Files
Facilitor/APPL/API2/model_ctr_discipline.inc
Erik Groener e3624170ac FSN#39312 Verder ontsluiten van modellen via de API
svn path=/Website/trunk/; revision=32963
2017-02-27 10:52:47 +00:00

78 lines
2.4 KiB
PHP

<% /*
$Revision$
$Id$
File: model_ctr_discipline.inc
Description: Model voor srtcontrole disciplines
Context:
Notes: intern hebben we een apart model voor ctr_disc_params
Naar de buitenwereld presenteren we het als één model
*/
%>
<!-- #include file="model_ctr_disc_params.inc" -->
<%
function model_ctr_discipline(disc_key, params)
{
// Eén model voor de buitenwereld
var disc = new _model_ctr_discipline();
api2.merge_disc_params_model(this, disc);
this.REST_GET = generic_REST_GET(disc, // Let op: de originele _model
{ "GET": {
wheres: [ "ins_tab_discipline.ins_discipline_module = 'CTR'"
]
}
}
)
this.REST_POST = generic_REST_POST(disc);
this.REST_PUT = generic_REST_PUT(disc);
this.REST_DELETE = generic_REST_DELETE(this, {});
}
function _model_ctr_discipline()
{
this.records_name = "taskdisciplines";
this.record_name = "taskdiscipline";
this.table = "ins_tab_discipline";
this.primary = "ins_discipline_key";
this.autfunction = "WEB_CTRMGT";
this.record_title = L("ctr_discipline");
this.records_title = L("ctr_discipline_m");
this.fields = {
"id": {
"dbs": "ins_discipline_key",
"label": L("lcl_key"),
"typ": "key",
"required": true,
"filter": "exact",
"seq": "ins_s_ins_discipline_key"
},
"module": {
"dbs": "ins_discipline_module",
"label": L("ctr_discipline_module"),
"typ": "varchar",
"hidden_fld": true,
"defaultvalue": "CTR"
},
"name": {
"dbs": "ins_discipline_omschrijving",
"label": L("ctr_discipline_omschrijving"),
"typ": "varchar",
"translate": true,
"required": true
}
};
/* Velden van CTR_DISC_PARAMS komen er dynamisch bij */
this.disc_params = {
model: model_ctr_disc_params,
joinfield: "taskdiscipline"
};
this.soft_delete = "ins_discipline_verwijder";
}
%>