<%@language = "javascript" %>

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

<%
var niveau = getQParam("prs_kenmerk_niveau"); // [ B | A | P | C ]
var this_model = new model_prs_kenmerk(niveau);

this_model.hook_pre_edit = function (obj, fld)
{
    var kenmerktype = (obj.property_type ? obj.property_type.id : "");
    fld.property_type.LOV = buildKenmerktypeLOV(kenmerktype);

    if (obj.id != -1)
        fld.position.foreign.readonly = true;
%>
<script type="text/javascript">
  var module = "PRS";
  var property_type = "<%=kenmerktype%>";
</script>
<%
}


scaffolding(this_model,
    {
        "search": {
            "autosearch": true,
            "filters": [
                "property_type"
            ]
        },
        "list": {
            "columns": [
                "id",
                "prs_kenmerk_niveau",
                "name",
                "sequence",
                "property_type"
            ]
        },
        "edit": {
            "requires": { js: ["./mgt_srtkenmerk.js"] }
        },
        "print": {},
        "transit": {
            "prs_kenmerk_niveau": niveau
        }
    });


    function fill_prs_niveau_LOV()
    {
        return  "B;"+L("lcl_company")
             + ";A;"+L("lcl_department")
             + ";P;"+L("lcl_person")
             + ";C;"+L("lcl_contact");
    }
%>
