Files
Facilitor/APPL/API2/model_ctr_scenario.inc
Jos Groot Lipman 4d37fc5813 FSN#36298: Scenario’s: voortaan key=1 voor actueel, deze niet tonen
svn path=/Website/trunk/; revision=35139
2017-08-29 11:10:06 +00:00

83 lines
2.3 KiB
PHP

<% /*
$Revision$
$Id$
File: model_ctr_scenario.inc
Description: Model voor scenario's
Context:
Notes:
*/
%>
<!-- #include file="../ins/ins.inc" -->
<%
function model_ctr_scenario()
{
this.records_name = "scenarios";
this.record_name = "scenario";
this.table = "ins_scenario";
this.primary = "ins_scenario_key";
this.autfunction = "WEB_BEZMGT";
this.record_title = L("ctr_scenario");
this.records_title = L("ctr_scenario_m");
this.fields = {
"id": {
"dbs": "ins_scenario_key",
"label": L("lcl_key"),
"typ": "key",
"required": true,
"filter": "exact",
"seq": "ins_s_ins_scenario_key"
},
"name": {
"dbs": "ins_scenario_omschrijving",
"label": L("ctr_scenario_omschrijving"),
"typ": "varchar",
"required": true,
"translate": true
},
"nrelements": {
"dbs": "nn_elements",
"sql": "(SELECT COUNT(*) FROM ins_srtcontroledl_xcp isx WHERE isx.ins_scenario_key = ins_scenario.ins_scenario_key)",
"label": L("ctr_scenario_aantal"),
"typ": "number"
},
"remark": {
"dbs": "ins_scenario_opmerking",
"label": L("ctr_scenario_opmerking"),
"typ": "varchar",
"translate": true
},
"created": {
"dbs": "ins_scenario_aanmaak",
"label": L("ctr_scenario_aanmaak"),
"typ": "date",
"readonly": true
},
"status": {
"dbs": "ins_scenario_status",
"label": L("ctr_scenario_status"),
"foreign": ins.getscenariostatustext,
"typ": "exact"
},
"person": {
"dbs": "prs_perslid_key",
"label": L("lcl_user"),
"typ": "key",
"foreign" : "prs_perslid",
readonly: true
}
};
this.REST_GET = generic_REST_GET(this, { GET: { wheres: [ "ins_scenario_key <> 1"] }});
this.REST_POST = generic_REST_POST(this);
this.REST_PUT = generic_REST_PUT(this);
this.REST_DELETE = generic_REST_DELETE(this, {});
}
%>