Files
Facilitor/APPL/API2/model_res_ruimte.inc
Jos Groot Lipman 68a774c4c2 FSN#39312 Verder ontsluiten van modellen via de API
svn path=/Website/trunk/; revision=33021
2017-03-02 16:52:23 +00:00

292 lines
9.7 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.records_name = "bookingrooms";
this.record_name = "bookingroom";
this.table = "res_ruimte";
this.primary = "res_ruimte_key";
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": L("lcl_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"
},
"infourl": {
"dbs": "res_ruimte_info_url",
"label": L("res_ruimte_info_url"),
"typ": "varchar"
},
"locatiekey": { // liever location maar zo komt het uit de plaatsselector
"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
},
"bookingdiscipline": {
"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)),
"multiedit": true
},
"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)),
"multiedit": true
},
"blockstart": {
"dbs": "res_ruimte_begintijdblok",
"label": L("res_ruimte_begintijdblok"),
"typ": "float",
"LOV": api2.getTimetable(),
"multiedit": true
},
"blockend": {
"dbs": "res_ruimte_eindtijdblok",
"label": L("res_ruimte_eindtijdblok"),
"typ": "float",
"LOV": api2.getTimetable(),
"multiedit": true
},
"minduration": {
"dbs": "res_ruimte_min_duur",
"label": L("res_ruimte_min_duur"),
"typ": "float",
"multiedit": true
},
"fixedprice": {
"dbs": "res_ruimte_prijs_vast",
"label": L("res_ruimte_prijs_vast"),
"typ": "check",
"multiedit": true
},
"_intpricelabel": {
"dbs": "",
"label": "",
"typ": "label",
"labelvalue": L("res_ruimte_intprijs_label")
},
"intpricehour": {
"dbs": "res_ruimte_intprijs",
"label": L("res_ruimte_intprijs"),
"iscurrency": true,
"typ": "float"
},
"intpricemorning": {
"dbs": "res_ruimte_intprijs_ochtend",
"label": L("res_ruimte_intprijs_ochtend"),
"iscurrency": true,
"typ": "float"
},
"intpriceafternoon": {
"dbs": "res_ruimte_intprijs_middag",
"label": L("res_ruimte_intprijs_middag"),
"iscurrency": true,
"typ": "float"
},
"intpriceevening": {
"dbs": "res_ruimte_intprijs_avond",
"label": L("res_ruimte_intprijs_avond"),
"iscurrency": true,
"typ": "float"
},
"intpriceday": {
"dbs": "res_ruimte_intprijs_dag",
"label": L("res_ruimte_intprijs_dag"),
"iscurrency": true,
"typ": "float"
},
"_extpricelabel": {
"dbs": "",
"label": "",
"typ": "label",
"labelvalue": L("res_ruimte_extprijs_label")
},
"extpricehour": {
"dbs": "res_ruimte_prijs",
"label": L("res_ruimte_prijs"),
"iscurrency": true,
"typ": "float"
},
"extpricemorning": {
"dbs": "res_ruimte_prijs_ochtend",
"label": L("res_ruimte_prijs_ochtend"),
"iscurrency": true,
"typ": "float"
},
"extpriceafternoon": {
"dbs": "res_ruimte_prijs_middag",
"label": L("res_ruimte_prijs_middag"),
"iscurrency": true,
"typ": "float"
},
"extpriceevening": {
"dbs": "res_ruimte_prijs_avond",
"label": L("res_ruimte_prijs_avond"),
"iscurrency": true,
"typ": "float"
},
"extpriceday": {
"dbs": "res_ruimte_prijs_dag",
"label": L("res_ruimte_prijs_dag"),
"iscurrency": true,
"typ": "float"
},
"image": {
"dbs": "res_ruimte_image",
"label": L("res_ruimte_image"),
"typ": "varchar",
"flexmodule": "RESPH"
},
"waitingarea": {
"dbs": "res_ruimte_groep",
"label": L("res_ruimte_groep"),
"typ": "varchar"
},
"visitoraction": {
"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": ""
},
"defaultstatus": {
"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"
},
"expirationdate": {
"dbs": "res_ruimte_vervaldatum",
"label": L("res_ruimte_vervaldatum"),
"typ": "date",
"multiedit": true
},
"externalid": {
"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 = {
"physicalrooms": {
"model": new model_res_alg_ruimte(),
"joinfield": "bookingroom"
},
"bookingconfigurations": {
"model": new model_res_ruimte_opstelling(),
"joinfield": "bookingroom",
"multiadd": "bookingconfiguration"
}
};
// 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, {});
}
%>