<%@language = "javascript" %>

<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../api2/model_prs_kenmerk.inc" -->

<%
var niveau = getQParam("level"); // [ B | A | P | C ]

var this_model = new model_prs_kenmerk(niveau);

var model_params =
    {
        "search": {
            "autosearch": true,
            "filters": [
                "name",
                "attributetype"
            ],
            "transit": [
                "attributetype"
            ]
        },
        "list": {
            "columns": [
                "sequence",
                "name",
                "rolecode",
                "attributetype",
                "authorization",
                "code",
                "id"
            ],
            "orderby": [
                "sequence",
                "name"
            ]
        },
        "edit": {
            "requires": { js: ["./mgt_srtkenmerk.js"] }
        },
        "layout": {
            "block": [
                {
                    "blockid": "prsKenmerkAlgemeen",
                    "label": L("mgt_kenmerk"),
                    "icon": "fa-table-tree",
                    "ishtmlsafe": true,
                    "hidden": false,
                    "buttons": [],
                    "fields": [
                        "id",
                        "name",
                        "level",
                        "position",  // bij perslid de optionele srtperslid, zou graag iets van Alle functies tonen igv NULL -- TODO help
                        "rolecode",
                        "group",
                        "sequence",
                        "propertydefault",
                        "hint",
                        "regexp",
                        "code"
                    ]
                },
                {
                    "blockid": "prsKenmerkType",
                    "label": L("mgt_srtkenmerk_kenmerktype"),
                    "icon": "fa-asterisk",
                    "ishtmlsafe": true,
                    "hidden": false,
                    "buttons": [],
                    "fields": [
                        "attributetype",
                        "domain",
                        "length",
                        "decimals",
                        "minimum",
                        "maximum",
                        "unit"
                    ]
                },
                {
                    "blockid": "prsKenmerkFormat",
                    "label": L("mgt_kenmerk_displayprops"),
                    "icon": "fa-face-viewfinder",
                    "ishtmlsafe": true,
                    "hidden": false,
                    "buttons": [],
                    "fields": [
                        "required",
                        "authorization",
                        "showexpression",
                        "readonly",
                        "inlist",
                        "system"
                    ]
                }
            ]
        },
        "print": {},
        "transit": {
            "level": niveau
        }
    };

    // Bij personen is er een functieafhankelijkheid
    if (niveau == 'P')
    {
      model_params.list.columns.splice(0, 0, "position");
    }

scaffolding(this_model, model_params);
%>
<% ASPPAGE_END(); %>
