Files
Facilitor/APPL/API2/model_res_ruimte.inc
Jos Groot Lipman 18aa560f48 FSN#36126 Eenvoudiger personen in meerdere groepen kunnen zetten
svn path=/Website/trunk/; revision=32887
2017-02-21 15:34:13 +00:00

285 lines
9.6 KiB
C++

<% /*
$Revision$
$Id$
File: model_res_ruimte.inc
Description: Vanuit CodeCharge gegenereerd model voor res_ruimte
Context:
Notes:
*/
%>
<!-- #include file="../Shared/flexfiles.inc"-->
<!-- #include file="../api2/model_res_alg_ruimte.inc" -->
<!-- #include file="../api2/model_res_ruimte_opstelling.inc" -->
<%
function model_res_ruimte()
{
this.table = "res_ruimte";
this.primary = "res_ruimte_key";
this.records_name = "res_ruimtes";
this.record_name = "res_ruimte";
this.soft_delete = "res_ruimte_verwijder";
this.soft_expire = "res_ruimte_vervaldatum";
this.autfunction = "WEB_RESMSU";
this.record_title = L("res_v_aanwezigruimte");
this.records_title = L("res_v_aanwezigruimte_m");
this.fields = {
"id": {
"dbs": "res_ruimte_key",
"label": "Key",
"typ": "key",
"required": true,
"filter": "exact",
"seq": "res_s_res_ruimte_key"
},
"name": {
"dbs": "res_ruimte_nr",
"label": L("res_ruimte_nr"),
"typ": "varchar",
"translate": true,
"required": true,
"translate": true,
"filter": "like"
},
"description": {
"dbs": "res_ruimte_omschrijving",
"label": L("res_ruimte_omschrijving"),
"typ": "memo",
"translate": true,
"filter": "like"
},
"sequence": {
"dbs": "res_ruimte_volgnummer",
"label": L("res_ruimte_volgnummer"),
"typ": "number"
},
"res_ruimte_info_url": {
"dbs": "res_ruimte_info_url",
"label": L("res_ruimte_info_url"),
"typ": "varchar"
},
"locatiekey": {
"dbs": "res_v_alg_ruimte_gegevens.alg_locatie_key",
"label": L("lcl_location"),
"typ": "key",
"hidden_fld": true,
"foreign": {
"tbl": "alg_v_ruimte_gegevens",
"key": "alg_locatie_key",
"desc": "MIN(alg_locatie_code)",
"selectorforeign": "ALG_LOCATIE"
},
"foreignfiltercode": null // Ook facilitor irrelevant
},
"catalog": {
"dbs": "res_discipline_key",
"label": L("res_discipline_key"),
"typ": "key",
"foreign": {
"tbl": "ins_tab_discipline",
"key": "ins_discipline_key",
"desc": "ins_discipline_omschrijving",
"where": "ins_discipline_verwijder is null and ins_discipline_module = 'RES' and ins_discipline_min_level = 3"
},
"filter": "exact",
"required": true
},
"open": {
"dbs": "res_ruimte_begintijd",
"label": L("res_ruimte_begintijd"),
"typ": "float",
"LOV": api2.getTimetable(),
"emptyoption": L("lcl_res_standaard").format(toTimeString(S("res_t1"),false))
},
"close": {
"dbs": "res_ruimte_eindtijd",
"label": L("res_ruimte_eindtijd"),
"typ": "float",
"LOV": api2.getTimetable(),
"emptyoption": L("lcl_res_standaard").format(toTimeString(S("res_t2"),false))
},
"blockstart": {
"dbs": "res_ruimte_begintijdblok",
"label": L("res_ruimte_begintijdblok"),
"typ": "float",
"LOV": api2.getTimetable()
},
"blockend": {
"dbs": "res_ruimte_eindtijdblok",
"label": L("res_ruimte_eindtijdblok"),
"typ": "float",
"LOV": api2.getTimetable()
},
"min_res_time": {
"dbs": "res_ruimte_min_duur",
"label": L("res_ruimte_min_duur"),
"typ": "float"
},
"res_ruimte_prijs_vast": {
"dbs": "res_ruimte_prijs_vast",
"label": L("res_ruimte_prijs_vast"),
"typ": "check"
},
"_interne_prijzen": {
"dbs": "",
"label": "",
"typ": "label",
"labelvalue": L("res_ruimte_intprijs_label")
},
"res_ruimte_intprijs": {
"dbs": "res_ruimte_intprijs",
"label": L("res_ruimte_intprijs"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_intprijs_ochtend": {
"dbs": "res_ruimte_intprijs_ochtend",
"label": L("res_ruimte_intprijs_ochtend"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_intprijs_middag": {
"dbs": "res_ruimte_intprijs_middag",
"label": L("res_ruimte_intprijs_middag"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_intprijs_avond": {
"dbs": "res_ruimte_intprijs_avond",
"label": L("res_ruimte_intprijs_avond"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_intprijs_dag": {
"dbs": "res_ruimte_intprijs_dag",
"label": L("res_ruimte_intprijs_dag"),
"iscurrency": true,
"typ": "float"
},
"_externe_prijzen": {
"dbs": "",
"label": "",
"typ": "label",
"labelvalue": L("res_ruimte_extprijs_label")
},
"res_ruimte_prijs": {
"dbs": "res_ruimte_prijs",
"label": L("res_ruimte_prijs"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_prijs_ochtend": {
"dbs": "res_ruimte_prijs_ochtend",
"label": L("res_ruimte_prijs_ochtend"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_prijs_middag": {
"dbs": "res_ruimte_prijs_middag",
"label": L("res_ruimte_prijs_middag"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_prijs_avond": {
"dbs": "res_ruimte_prijs_avond",
"label": L("res_ruimte_prijs_avond"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_prijs_dag": {
"dbs": "res_ruimte_prijs_dag",
"label": L("res_ruimte_prijs_dag"),
"iscurrency": true,
"typ": "float"
},
"res_ruimte_image": {
"dbs": "res_ruimte_image",
"label": L("res_ruimte_image"),
"typ": "varchar",
"flexmodule": "RESPH"
},
"res_ruimte_groep": {
"dbs": "res_ruimte_groep",
"label": L("res_ruimte_groep"),
"typ": "varchar"
},
"action": {
"dbs": "bez_actie_key",
"label": L("bez_actie_key"),
"typ": "key",
"foreign": {
"tbl": "bez_actie",
"key": "bez_actie_key",
"desc": "bez_actie_omschrijving",
"where": "bez_actie_verwijder IS NULL"
},
"filter": "exact",
"LOVinit": ""
},
"res_status_fo_key": {
"dbs": "res_status_fo_key",
"label": L("res_status_fo_key"),
"typ": "key",
"LOV": L("res_status_fo_keyLOV"),
"LOVinit": ""
},
"friendlyname": {
"dbs": "res_ruimte_friendlyname",
"label": L("res_ruimte_friendlyname"),
"typ": "varchar"
},
"res_ruimte_vervaldatum": {
"dbs": "res_ruimte_vervaldatum",
"label": L("res_ruimte_vervaldatum"),
"typ": "date"
},
"res_ruimte_extern_id": {
"dbs": "res_ruimte_extern_id",
"label": L("res_ruimte_extern_id"),
"typ": "varchar"
}
};
// veld "res_ruimte_extern_id" alleen te wijzigen met PRSSYS rechten.
var authparams = user.checkAutorisation("WEB_PRSSYS", true);
if (!authparams)
this.fields.res_ruimte_extern_id.readonly = true;
this.includes = {
"rooms": {
"model": new model_res_alg_ruimte(),
"joinfield": "res_ruimte_key"
},
"configurations": {
"model": new model_res_ruimte_opstelling(),
"joinfield": "res_ruimte_key",
"multiadd": "res_opstelling_key"
}
};
// res_v_alg_ruimte_gegevens levert voor een koppelzaal meerdere records waardoor de opstelling ook meervoudig wordt weergegeven.
// Door alleen de onderstaande unieke combinaties te nemen wordt dit opgelost.
// JGL: liever zou ik dit generieker doen via includes/rooms/locatiekey maar dat werd onwerkbaar complex
var get_tbl = "(SELECT DISTINCT"
+ " alg_locatie_key"
+ " , res_ruimte_key"
+ " , res_ruimte_nr"
+ " FROM res_v_alg_ruimte_gegevens) res_v_alg_ruimte_gegevens";
var gparams = { GET: { tables: [get_tbl],
wheres: ["res_ruimte.res_ruimte_key = res_v_alg_ruimte_gegevens.res_ruimte_key(+)"
]
}
};
this.REST_GET = generic_REST_GET(this, gparams);
this.REST_POST = generic_REST_POST(this);
this.REST_PUT = generic_REST_PUT(this);
this.REST_DELETE = generic_REST_DELETE(this, {});
}
%>