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

    File:           prs_kostenplaats.asp

    Description:    fac_management aanroep van model_prs_kostenplaats

    Context:

    Notes:
*/
%>
<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../api2/model_prs_kostenplaats.inc" -->
<%
var this_model = new model_prs_kostenplaats();

if (S("bgt_enabled"))
{
    var model_params = {
        "search": {
            "filters": [
                "name",
                "description",
                "budgetdiscipline"
            ],
            "transit": [
                "budgetdiscipline"
            ],
            "requires": {
                "js": ["../bgt/bgt_budget.js"]
            }
        },
        "list": {
            "columns": [
                "name",
                "description",
                "budgetdiscipline"
            ]
        },
        "edit": {
            "requires": {
                "js": ["../bgt/bgt_budget.js"]
            }
        }
    }
}
else
{
    var perslid_key = getQParamInt("person", -1);
    var costgroup_key = getQParamInt("costgroup", -1)
    var model_params = {
        "search": {
            "filters": [
                "name",
                "description",
                "person",
                "costcentregroup",
                "costgroup"
            ],
            "transit": [
                "person",
                "costgroup"
            ]
        },
        "list": {
            "columns": [
                "name",
                "description",
                "person",
                "costgroup"
            ]
        },
        "edit": {
            "requires": {
                "js": ["../mgt/prs_kostenplaats.js"]
            }
        },
        "layout": {
            "miscellaneous": {
                "label": L("prs_kostenplaats"),
                "icon" : "fa-sack"
            }
        }
    };

//    if (costgroup_key > 0)
//        delete this_model.fields.person.readonly;
//    if (perslid_key > 0)
//        delete this_model.fields.costgroup.readonly;
};

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