107 lines
3.6 KiB
Plaintext
107 lines
3.6 KiB
Plaintext
<%@language = "javascript" %>
|
|
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: ins_tab_discipline.inc
|
|
|
|
Description: Dit is het model om de *rechten* van een discipline voor diverse
|
|
functies te beheren.
|
|
|
|
Context:
|
|
|
|
Notes:
|
|
*/
|
|
%>
|
|
|
|
<!-- #include file="../scf/scaffolding.inc" -->
|
|
<!-- #include file="../mgt/mgt_tools.inc" -->
|
|
<!-- #include file="../api2/model_ins_tab_discipline.inc" -->
|
|
|
|
<%
|
|
var groep_key = getQParamInt("fac_groep", -1);
|
|
var functie_key = getQParamInt("fac_functie", -1);
|
|
var model = new model_ins_tab_discipline(null, { groep_key: groep_key, functie_key: functie_key });
|
|
|
|
function fnrowData(oRs)
|
|
{
|
|
var data = { functie_key: functie_key,
|
|
groep_key: groep_key,
|
|
module: oRs.Fields("module").Value
|
|
};
|
|
return JSON.stringify(data);
|
|
}
|
|
|
|
var scf_params =
|
|
{
|
|
"search": {
|
|
"autosearch": model.module != null,
|
|
"labels" : [],
|
|
"filters": [
|
|
"name"
|
|
]
|
|
},
|
|
"list": {
|
|
"columns": [
|
|
"id",
|
|
"name"
|
|
],
|
|
"orderby": [
|
|
"name"
|
|
],
|
|
"default_action": "edit_rechten",
|
|
"fnRowData": fnrowData,
|
|
"requires": {
|
|
js: ["./ins_tab_discipline.js"]
|
|
}
|
|
},
|
|
"transit": {
|
|
"fac_groep": groep_key,
|
|
"fac_functie": functie_key
|
|
}
|
|
};
|
|
if (!model.module || model.module == 'MLD')
|
|
{
|
|
scf_params.search.filters.splice(0, 0, "disciplinetype");
|
|
scf_params.list.columns.splice(1, 0, "disciplinetype");
|
|
scf_params.list.orderby.splice(0, 0, "disciplinetype");
|
|
}
|
|
if (!model.module)
|
|
{
|
|
scf_params.search.filters.push("module");
|
|
scf_params.list.columns.splice(1, 0, "module");
|
|
scf_params.list.orderby.splice(0, 0, "module");
|
|
}
|
|
|
|
if (groep_key > 0 && functie_key > 0)
|
|
{
|
|
var groep_desc = Oracle.Get("fac_groep_omschrijving", "fac_groep", groep_key);
|
|
var func_desc = Oracle.Get("fac_functie_omschrijving", "fac_functie", functie_key);
|
|
scf_params.search.title = groep_desc + "/" + func_desc;
|
|
scf_params.search.labels.push({ "lbl": L("fac_groep"), "txt" : groep_desc });
|
|
scf_params.search.labels.push({ "lbl": L("fac_groep_opmerking"), "txt" : Oracle.Get("fac_groep_opmerking", "fac_groep", groep_key)});
|
|
scf_params.search.labels.push({ "lbl": L("fac_functie"), "txt" : func_desc});
|
|
scf_params.search.labels.push({ "lbl": L("fac_functie_info"), "txt" : Oracle.Get("fac_functie_info", "fac_functie", functie_key)});
|
|
if (model.level & 4)
|
|
{
|
|
scf_params.list.columns.push("authorization.prs_level_read");
|
|
if (model.level & 2)
|
|
scf_params.list.columns.push("authorization.prs_level_write");
|
|
}
|
|
if (model.level & 8)
|
|
{
|
|
scf_params.list.columns.push("authorization.alg_level_read")
|
|
if (model.level & 2)
|
|
scf_params.list.columns.push("authorization.alg_level_write");
|
|
}
|
|
if (!(model.level & (4 | 8)))
|
|
{
|
|
scf_params.list.columns.push("authorization.prs_level_read");
|
|
if (model.level & 2) // Schrijfrechten
|
|
scf_params.list.columns.push("authorization.alg_level_write");
|
|
}
|
|
}
|
|
|
|
scaffolding(model, scf_params);
|
|
%>
|