Files
Facilitor/APPL/API2/model_bgt_discipline.inc
Jos Groot Lipman 95682f602d FSN#39312 Verder ontsluiten van modellen via de API
svn path=/Website/trunk/; revision=32886
2017-02-20 16:10:19 +00:00

89 lines
2.8 KiB
PHP

<% /*
$Revision$
$Id$
File: model_bgt_discipline.inc
Description: Model voor budget disciplines
Context:
Notes: intern hebben we een apart model voor bgt_disc_params
Naar de buitenwereld presenteren we het als één model
*/
%>
<!-- #include file="model_bgt_disc_params.inc" -->
<%
function model_bgt_discipline(disc_key, params)
{
// Eén model voor de buitenwereld
var disc = new _model_bgt_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 = 'BGT'"
]
}
}
)
this.REST_POST = generic_REST_POST(disc);
this.REST_PUT = generic_REST_PUT(disc);
this.REST_DELETE = generic_REST_DELETE(this, {});
}
function _model_bgt_discipline()
{
this.records_name = "budgetdisciplines";
this.record_name = "budgetdiscipline";
this.table = "ins_tab_discipline";
this.primary = "ins_discipline_key";
this.autfunction = "WEB_BGTMAN";
this.record_title = L("bgt_discipline");
this.records_title = L("bgt_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("bgt_discipline_module"),
"typ": "varchar",
"hidden_fld": true,
"defaultvalue": "BGT"
},
"name": {
"dbs": "ins_discipline_omschrijving",
"label": L("bgt_discipline_omschrijving"),
"typ": "varchar",
"translate": true,
"required": true
},
"sequence": {
"dbs": "ins_discipline_volgnr",
"label": L("bgt_discipline_volgnr"),
"typ": "number"
},
"vat": {
"dbs": "ins_discipline_btw",
"label": L("bgt_discipline_btw"),
"typ": "check",
"default": "false"
}
};
/* Velden van BGT_DISC_PARAMS komen er dynamisch bij */
this.disc_params = {
model: model_bgt_disc_params,
joinfield: "budgetdiscipline"
};
//this.soft_delete = "ins_discipline_verwijder"; // ik wil er iig niet standaard op kunnen filteren
}
%>