127 lines
3.9 KiB
C++
127 lines
3.9 KiB
C++
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: model_fac_functie.inc
|
|
|
|
Description: Dit is het model om de *rechten* van een groep voor diverse
|
|
functies te beheren.
|
|
model_fac_functie moet dan ook altijd aangroepen worden met
|
|
een fac_groep_key
|
|
Context:
|
|
|
|
Notes:
|
|
*/
|
|
%>
|
|
<!-- #include file="../api2/model_fac_groeprechten.inc" -->
|
|
<%
|
|
|
|
function model_fac_functie (functie_key, params)
|
|
{
|
|
this.table = "fac_functie";
|
|
this.primary = "fac_functie_key";
|
|
this.records_name = "fac_functies";
|
|
this.record_name = "fac_functie";
|
|
this.module = null;
|
|
if (params.disc_key > 0)
|
|
{
|
|
var sql = "SELECT ins_discipline_module FROM ins_tab_discipline WHERE ins_discipline_key = " + params.disc_key;
|
|
var oRs = Oracle.Execute(sql);
|
|
this.module = oRs("ins_discipline_module").Value;
|
|
oRs.Close();
|
|
}
|
|
this.fields = {
|
|
"id": {
|
|
"dbs": "fac_functie_key",
|
|
"label": "Key",
|
|
"typ": "key",
|
|
"required": true,
|
|
"filter": "exact",
|
|
"seq": "fac_s_fac_functie_key"
|
|
},
|
|
"module": {
|
|
"dbs": "fac_functie_module",
|
|
"label": L("fac_functie_module"),
|
|
"readonly": true,
|
|
"typ": "varchar",
|
|
"filterdefault": this.module?":!"+this.module:null,
|
|
"foreign": {
|
|
"tbl": "fac_module",
|
|
"key": "fac_module_name",
|
|
"desc": "fac_module_name || ' - ' || fac_module_remark"
|
|
}
|
|
},
|
|
"name": {
|
|
"dbs": "fac_functie_code",
|
|
"label": L("fac_functie_code"),
|
|
"readonly": true,
|
|
"typ": "varchar"
|
|
},
|
|
"level": {
|
|
"dbs": "fac_functie_min_level",
|
|
"label": L("fac_functie_min_level"),
|
|
"readonly": true,
|
|
"typ": "number",
|
|
"LOV": L("fac_functie_min_levelLOV"),
|
|
"hidden_fld": true
|
|
},
|
|
"discipline": {
|
|
"dbs": "fac_functie_discipline",
|
|
"label": L("fac_functie_discipline"),
|
|
"readonly": true,
|
|
"typ": "number",
|
|
"LOV": "0;Globaal;1;Per discipline",
|
|
"hidden_fld": true
|
|
},
|
|
"nn_discipline": {
|
|
"dbs": "nn_discipline",
|
|
//"label": L("fac_functie_omschrijving"),
|
|
"typ": "varchar",
|
|
"sql": "(SELECT COUNT(*) FROM ins_tab_discipline WHERE ins_discipline_verwijder IS NULL AND ins_discipline_module = fac_functie_module)",
|
|
"hidden_fld": true
|
|
},
|
|
"description": {
|
|
"dbs": "fac_functie_omschrijving",
|
|
"label": L("fac_functie_omschrijving"),
|
|
"typ": "varchar",
|
|
"readonly": true,
|
|
"required": true
|
|
},
|
|
"info": {
|
|
"dbs": "fac_functie_info",
|
|
"label": L("fac_functie_info"),
|
|
"readonly": true,
|
|
"typ": "varchar"
|
|
}
|
|
};
|
|
|
|
if (params.groep_key > 0 || params.disc_key > 0)
|
|
{
|
|
this.includes = {"authorization":
|
|
{ "model": new model_fac_groeprechten(params),
|
|
"joinfield": "fac_functie",
|
|
"outertoggle": { def: false, lbl: "Toon alle functies" }
|
|
}};
|
|
}
|
|
|
|
this.autfunction = "WEB_PRSMSU";
|
|
this.record_title = L("fac_functie");
|
|
this.records_title = L("fac_functie_m");
|
|
|
|
this.edit = {
|
|
"modal": true
|
|
}
|
|
|
|
var xparams = null;
|
|
if (params.disc_key > 0)
|
|
{
|
|
xparams = { GET: { wheres: ["fac_functie_module = " + safe.quoted_sql(module),
|
|
"fac_functie_discipline = 1" // dan ook alleen de discipline gebonden functies
|
|
] } }
|
|
}
|
|
this.REST_GET = generic_REST_GET(this, xparams);
|
|
//this.REST_POST = generic_REST_POST(this);
|
|
//this.REST_PUT = generic_REST_PUT(this);
|
|
//this.REST_DELETE = generic_REST_DELETE(this);
|
|
}
|
|
%> |