Files
Facilitor/APPL/API2/model_fac_usrtab.inc
Koen Reefman d96cd24751 FCLT#70611 SCF-iconen (3/3)
svn path=/Website/trunk/; revision=61032
2023-07-03 13:34:11 +00:00

117 lines
3.4 KiB
PHP

<% /*
$Revision$
$Id$
File: model_fac_usrtab.inc
Description: Vanuit CodeCharge gegenereerd model voor fac_usrtab
Context:
Notes:
*/
%>
<!-- #include file="./model_fac_usrdata.inc" -->
<%
function model_fac_usrtab(tab_key)
{
var params = params || {};
this.records_name = "customtables";
this.record_name = "customtable";
this.table = "fac_usrtab";
this.primary = "fac_usrtab_key";
this.soft_delete = "fac_usrtab_verwijder";
this.autfunction = false; // we controleren het zelf
this.record_title = L("fac_usrtab");
this.records_title = L("fac_usrtab_m");
this.fields = {
"id": {
"dbs": "fac_usrtab_key",
"label": L("lcl_key"),
"typ": "key",
"required": true,
"seq": "fac_s_fac_usrtab_key"
},
"name": {
"dbs": "fac_usrtab_naam",
"label": L("fac_usrtab_naam"),
"typ": "varchar",
"required": true
},
"description": {
"dbs": "fac_usrtab_omschrijving",
"label": L("fac_usrtab_omschrijving"),
"typ": "varchar",
"translate": true,
"filter": "like"
},
"objectname": {
"dbs": "fac_usrtab_object",
"label": L("fac_usrtab_object"),
"typ": "varchar",
"hidden_fld": true
},
"parent": {
"dbs": "fac_usrtab_parentkey",
"label": L("fac_usrtab_parentkey"),
"typ": "key",
"foreign": {
"tbl": "(SELECT fac_usrtab_key"
+ " , fac_usrtab_naam"
+ " FROM fac_usrtab"
+ " ORDER BY fac_usrtab_naam)",
"key": "fac_usrtab_key",
"desc": "fac_usrtab_naam"
}
},
"authorization": {
"dbs": "fac_functie_key",
"label": L("lcl_mgt_aut_group"),
"typ": "key",
"foreign": "fac_functie"
}
};
this.show = {};
this.includes = {
"customtablevalues": {
"model": new model_fac_usrdata(tab_key),
"joinfield": "customtable",
"enable_update": true
}
};
var gparams = { GET: { } };
var authparams = user.checkAutorisation("WEB_PRSSYS", true);
if (!authparams)
{
gparams.GET.wheres = [ "fac_functie_key IN"
+ " (SELECT w.fac_functie_key"
+ " FROM fac_v_webgebruiker W"
+ " WHERE w.prs_perslid_key = " + user_key
+ " )"];
}
else
this.autfunction = authparams.autfunction;
this.REST_GET = generic_REST_GET(this, gparams);
if (authparams)
{
this.REST_POST = generic_REST_POST(this);
this.REST_PUT = generic_REST_PUT(this);
this.REST_DELETE = generic_REST_DELETE(this, {});
}
this.hook_pre_edit = function (obj, fld)
{
fld.parent.foreign.tbl = "(SELECT fac_usrtab_key, fac_usrtab_naam FROM fac_usrtab"
+ (obj.id ? " WHERE fac_usrtab_key <> " + obj.id : "")
+ " ORDER BY fac_usrtab_naam)";
}
}
%>