<%@language = "javascript" %>
<%
/*
    $Revision$
    $Id$

    Note: Let op: alleen gebruikt om rechten van een persoon te kunnen tonen
          Nog niet om personen te bewerkern
*/
%>
<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../api2/model_prs_perslid.inc" -->

<%
var prs_key = getQParamInt("person", -1);
var prs_arr = getQParamIntArray("prsarr", []);
var ext_model = getQParamSafe("model", "");

var authparamsPRSSYS = user.checkAutorisation("WEB_PRSSYS", true);
var authparamsPRSMSU = user.checkAutorisation("WEB_PRSMSU", true);
var canMultiAut = (authparamsPRSSYS || (authparamsPRSMSU && authparamsPRSMSU.PRSwritelevel < 9));
var extra_auth = [];

if ((mode == "search") || (mode == "list") || (mode == "show") || (mode == "edit" && ext_model == "authorization") )
    extra_auth = ["WEB_PRSMSU"];

if (mode == 'list')
{
    Oracle.Execute("alter session set nls_comp = 'LINGUISTIC' NLS_SORT = 'BINARY_AI'"); // Zodat müller gevonden wordt
}
var this_model_params = { readonly: true    // We willen hier niet via de interface bewerken
                        , prs_key: prs_key
                        , prs_arr: prs_arr
                        , extra_auth: extra_auth
                        }

var this_model = new model_prs_perslid(this_model_params); // We willen hier niet via de interface bewerken
var scf_params = {
            "search": {
                "filters": [
                    "lastname",
                    "firstname",
                    "department",
                    "login",
                    "authorization.authorizationgroup"
                ]
            },
            "multicolumn": true,
            "list": {
                "columns": [
                    "id",
                    "lastname",
                    "firstname",
                    "lastlogin",
                    "login",
                    "authorization.authorizationgroup"
                  ],
              "requires": {
                  js: ["./prs_perslid.js"]
              }
            },
            "show": {},
            "layout": {
                "active_tab": 1,
                "block": [
                    {
                        "icon": "fa-user",
                        "label": L("lcl_prs_persoon_frame")
                    },
                    {
                        "icon": "fa-user-cog",
                        "label": L("lcl_prs_details")
                    }
                ]
            },
            "transit_qlist": [
                {"name": "prsarr", "val": prs_arr}
            ]
        };

if (canMultiAut)
{
    scf_params.list.actions = [{ "action": "authgroupAdd", "caption": L("fac_groep"), multi: true, onlyMulti: true, multiOnce: true } ];
}

scaffolding(this_model, scf_params);

%>
<% ASPPAGE_END(); %>
