diff --git a/APPL/API2/api2.inc b/APPL/API2/api2.inc index 740a22a50e..2a353523d6 100644 --- a/APPL/API2/api2.inc +++ b/APPL/API2/api2.inc @@ -1369,7 +1369,7 @@ function generic_REST_GET(model, gparams) sql += " ORDER BY " + orderbys.join(", "); // TODO: Altijd goed met includes? // Probeer ook nog de 1e include te sorteren. Fraaier met subframes in scaffolding - if (params.include && params.include.length && model.includes) + if (params.include && params.include.length && model.includes && params.include[0] in model.includes) { var inc0 = model.includes[params.include[0]].model; if (inc0.fields["sequence"]) diff --git a/APPL/API2/api2_dispatch.inc b/APPL/API2/api2_dispatch.inc index c4a45c216f..38c6fd5e69 100644 --- a/APPL/API2/api2_dispatch.inc +++ b/APPL/API2/api2_dispatch.inc @@ -109,6 +109,7 @@ var api2_mapper = { function api2_dispatch(api2_name) { + api2_name = api2_name.toLowerCase(); if (api2_name in api2_mapper) return api2_mapper[api2_name]; @@ -120,6 +121,4 @@ function api2_dispatch(api2_name) return fullname; } } - -// FAC_LCL('lcl_rap_expression', 'SQL expressie', 'SQL expression', 'SQL-Ausdruck', 'Expressie SQL') %> \ No newline at end of file diff --git a/APPL/API2/api2_rest.inc b/APPL/API2/api2_rest.inc index ac26690221..8560077849 100644 --- a/APPL/API2/api2_rest.inc +++ b/APPL/API2/api2_rest.inc @@ -209,6 +209,8 @@ api2_rest = { { // TODO: Onderstaande in een of ander standaardformaat opleveren? var result = { id: model.records_name, + "name": model.record_title, + "names": model.records_title, methods: [], includes: [], fields: [] @@ -230,7 +232,9 @@ api2_rest = { result.fields.push({ id: fld, filter: model.fields[fld].filter, type: model.fields[fld].typ, - label: model.fields[fld].label + label: model.fields[fld].label, + required: model.fields[fld].required, + valuelist: model.fields[fld].LOV && api2.splitLOV(model.fields[fld].LOV) }); } } @@ -426,7 +430,7 @@ api2_rest = { case "html": Response.ContentType = "text/html"; var antwoord = JSON.stringify(resultdata, null, 2); - var str_antwoord = "
"
+                var str_antwoord = "{0}
".format(single?model.record_name:model.records_name)
                                  +      Server.HTMLEncode(antwoord)
                                  + "
"; break; @@ -771,6 +775,8 @@ var simple_json2xml = (function (undefined) { if (obj.hasOwnProperty(i)) { var value = obj[i], type = typeof value; + if (value === obj) // bij merged_model zouden we hier oneindige recursie krijgen + continue; if (value instanceof Array && type == 'object') { for (var sub in value) { xml += simple_json2xml(value[sub]); diff --git a/APPL/API2/model_alg_srtgebouw.inc b/APPL/API2/model_alg_srtgebouw.inc index dc9f423a72..80fcd82a1a 100644 --- a/APPL/API2/model_alg_srtgebouw.inc +++ b/APPL/API2/model_alg_srtgebouw.inc @@ -4,7 +4,7 @@ File: model_alg_srtgebouw.inc - Description: Vanuit CodeCharge gegenereerd model voor alg_srtgebouw + Description: Model voor alg_srtgebouw Context: @@ -14,10 +14,8 @@ <% function model_alg_srtgebouw() { - var tab_key = getQParamInt("alg_srtgebouw_key", -1); - - this.records_name = "alg_buildingfunctions"; - this.record_name = "alg_buildingfunction"; + this.records_name = "buildingfunctions"; + this.record_name = "buildingfunction"; this.table = "alg_srtgebouw"; this.primary = "alg_srtgebouw_key"; this.soft_delete = "alg_srtgebouw_verwijder"; diff --git a/APPL/API2/model_alg_srtterreinsector.inc b/APPL/API2/model_alg_srtterreinsector.inc index a33eb9f666..af4e3318a8 100644 --- a/APPL/API2/model_alg_srtterreinsector.inc +++ b/APPL/API2/model_alg_srtterreinsector.inc @@ -4,7 +4,7 @@ File: model_alg_srtterreinsector.inc - Description: Vanuit CodeCharge gegenereerd model voor alg_srtterreinsector + Description: Model voor alg_srtterreinsector Context: @@ -14,8 +14,8 @@ <% function model_alg_srtterreinsector() { - this.records_name = "alg_terrainfunctions"; - this.record_name = "alg_terrainfunction"; + this.records_name = "terrainfunctions"; + this.record_name = "terrainfunction"; this.table = "alg_srtterreinsector"; this.primary = "alg_srtterreinsector_key"; this.soft_delete = "alg_srtterreinsector_verwijder"; diff --git a/APPL/API2/model_apis.inc b/APPL/API2/model_apis.inc index 6a37ba1579..e794800819 100644 --- a/APPL/API2/model_apis.inc +++ b/APPL/API2/model_apis.inc @@ -20,8 +20,9 @@ model_apis = primary: "id", records_name: "apis", record_name: "api", - fields : { "id" : { xxdbs: "fac_usrrap_key", typ: "varchar", label: "Api", filter: "exact" }, - "name" : { xxdbs: "fac_usrrap_key", typ: "varchar", label: "Api", filter: "exact" } + fields : { "id" : { typ: "varchar", label: "Api", filter: "exact" }, + "module" : { typ: "varchar", label: "Module", filter: "exact" }, + "name" : { typ: "varchar", label: "Api", filter: "exact" } }, REST_GET: function _GET(params) @@ -32,8 +33,9 @@ model_apis = var api2_names = []; for (var dispatch in api2_mapper) { + var module = api2_mapper[dispatch].substr(9, 3).toUpperCase(); // TODO: kijken of er een L() bestaat voor de api2_mapper filenaam - api2_names.push({ id: dispatch, name: "X-" + dispatch }); + api2_names.push({ id: dispatch, name: dispatch, modulecode: module, module: L("lcl_module_" + module) }); } var fullpath = Server.MapPath("./appl/api2"); @@ -57,15 +59,6 @@ model_apis = return api2_names; }, - PUT: function (params) /* update api */ - { - }, - POST: function (params) /* new api */ - { - }, - DELETE: function (params) /* delete api */ - { - }, search: { autosearch: true }, list: { default_url: "api2/{0}.scf" } diff --git a/APPL/API2/model_doc.inc b/APPL/API2/model_doc.inc index eef02d1ef6..bd5deb7bcb 100644 --- a/APPL/API2/model_doc.inc +++ b/APPL/API2/model_doc.inc @@ -26,7 +26,7 @@ function model_doc() this.fields = {}; for (var i = 0; i < apis.length; i++) { - this.fields[ apis[i].id ] = { label: apis[i].name }; + this.fields[ apis[i].id ] = { label: apis[i].name, module: apis[i].module }; } this.REST_GET = generic_REST_GET(this, {}); diff --git a/APPL/API2/model_doc.xsl b/APPL/API2/model_doc.xsl index 49fb14dbc6..c41ae4cf4f 100644 --- a/APPL/API2/model_doc.xsl +++ b/APPL/API2/model_doc.xsl @@ -7,13 +7,16 @@ + FACILITOR® API reference

FACILITOR® API reference

+ - + +   ../api2/.doc diff --git a/APPL/API2/model_fac_profiel.inc b/APPL/API2/model_fac_profiel.inc index 89784c943e..2b11f4fdfe 100644 --- a/APPL/API2/model_fac_profiel.inc +++ b/APPL/API2/model_fac_profiel.inc @@ -52,7 +52,7 @@ function model_fac_profiel() this.includes = { - "profile_values": { + "profilevalues": { "model": new model_fac_profielwaarde(), "joinfield": "profile", "enable_update": true, diff --git a/APPL/API2/model_fac_srtnotificatie.inc b/APPL/API2/model_fac_srtnotificatie.inc index b6836aaafe..fdf067e260 100644 --- a/APPL/API2/model_fac_srtnotificatie.inc +++ b/APPL/API2/model_fac_srtnotificatie.inc @@ -15,10 +15,10 @@ function model_fac_srtnotificatie(cust) { + this.records_name = "notificationtypes"; + this.record_name = "notificationtype"; this.table = "fac_srtnotificatie"; this.primary = "fac_srtnotificatie_key"; - this.records_name = "fac_srtnotificaties"; - this.record_name = "fac_srtnotificatie"; this.autfunction = "WEB_PRSSYS"; this.record_title = L("fac_srtnotificatie"); this.records_title = L("fac_srtnotificatie_m"); @@ -26,7 +26,7 @@ function model_fac_srtnotificatie(cust) this.fields = { "id": { "dbs": "fac_srtnotificatie_key", - "label": "Key", + "label": L("lcl_key"), "typ": "key", "required": true, "seq": "fac_s_fac_srtnotificatie_key", @@ -54,7 +54,7 @@ function model_fac_srtnotificatie(cust) "LOV": fill_srtnotificatie_LOV(), "emptyoption": null }, - "notification_url": { + "notificationurl": { "dbs": "fac_srtnotificatie_url", "label": L("fac_srtnotificatie_url"), "typ": "varchar", @@ -66,7 +66,7 @@ function model_fac_srtnotificatie(cust) "typ": "varchar", "readonly": true }, - "notification_mode": { + "notificationmode": { "dbs": "fac_srtnotificatie_mode", "label": "", "typ": "number", @@ -121,40 +121,43 @@ function model_fac_srtnotificatie(cust) "dbs": "fac_srtnotificatie_usermode", "label": L("fac_srtnotificatie_usermode"), "typ": "check0", - "listfunction": fnshowusermode + "listfunction": fnshowusermode, + "multiedit": true }, - "mail_building": { + "mailbuilding": { "dbs": "fac_srtnotificatie_gebouw", "label": L("fac_srtnotificatie_gebouw"), "typ": "check0", - "listfunction": fnshowmailbuilding + "listfunction": fnshowmailbuilding, + "multiedit": true }, "delay": { "dbs": "fac_srtnotificatie_delay", "label": L("fac_srtnotificatie_delay"), "typ": "number", "required": true, - "defaultvalue": "0" + "defaultvalue": "0", + "multiedit": true }, - "mode_status": { + "modestatus": { "dbs": "notimode.status", "label": L("fac_srtnotificatie_status"), "typ": "varchar", "hidden_fld": true }, - "mode_email": { + "modeemail": { "dbs": "notimode.email", "label": L("fac_srtnotificatie_mail"), "typ": "varchar", "hidden_fld": true }, - "mode_sms": { + "modesms": { "dbs": "notimode.sms", "label": L("fac_srtnotificatie_sms"), "typ": "varchar", "hidden_fld": true }, - "mode_alert": { + "modealert": { "dbs": "notimode.portal", "label": L("fac_srtnotificatie_alert"), "typ": "varchar", @@ -163,7 +166,7 @@ function model_fac_srtnotificatie(cust) }; if (!S("puo_smsaccount")) - this.fields.notification_mode.bits[0].radios.splice(2, 1); + this.fields.notificationmode.bits[0].radios.splice(2, 1); var ext_sql = "(SELECT fac_srtnotificatie_key" + " , DECODE(BITAND(fac_srtnotificatie_mode, 1), 1,"+ safe.qL("lcl_on") +", '') status" @@ -179,6 +182,24 @@ function model_fac_srtnotificatie(cust) } }; + function fill_srtnotificatie_LOV() + { + var xmlnodeLOV = ""; + var sql = "SELECT distinct fac_srtnotificatie_xmlnode" + + " , NVL(fac_srtnotificatie_xmlnode,'') xmlnode_lov" + + " FROM fac_srtnotificatie" + + " ORDER BY 1 NULLS FIRST"; + var oRs = Oracle.Execute(sql); + while (!oRs.eof) + { + var xmlnode = oRs("fac_srtnotificatie_xmlnode").Value; + xmlnodeLOV += (xmlnodeLOV?";":"") + xmlnode + ";" + oRs("xmlnode_lov").Value; + oRs.moveNext(); + } + oRs.Close(); + return xmlnodeLOV; + } + function xxx_srtkenmerk_sql() { var sql = "(select sk.mld_srtkenmerk_key srtkenmerk_key" @@ -201,7 +222,7 @@ function model_fac_srtnotificatie(cust) this.fields.xmlnode.readonly = false; this.fields.xmlnode.required = true; this.fields.description.required = true; - this.fields.notification_url.readonly = false; + this.fields.notificationurl.readonly = false; this.fields.group.readonly = false; get_param.GET.wheres.push("UPPER(SUBSTR(fac_srtnotificatie_code, 1, 4)) = 'CUST' "); @@ -218,7 +239,7 @@ function model_fac_srtnotificatie(cust) // Voorlopig mag alleen voor meldingen en opdrachten het vinkje 'E-mail sturen naar gebouw' // gezet worden if (iscust == 1 || !inArray(obj.name.substring(0,3), ["MLD", "ORD"])) - fld.mail_building.readonly = true; + fld.mailbuilding.readonly = true; if (inArray(obj.name, ["MLDAFM", "MLDAFR", "MLDUPD"])) { diff --git a/APPL/API2/model_res_ruimte.inc b/APPL/API2/model_res_ruimte.inc index 960b0de1ce..9abf421b43 100644 --- a/APPL/API2/model_res_ruimte.inc +++ b/APPL/API2/model_res_ruimte.inc @@ -18,10 +18,10 @@ function model_res_ruimte() { + this.records_name = "bookingrooms"; + this.record_name = "bookingroom"; 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"; @@ -31,7 +31,7 @@ function model_res_ruimte() this.fields = { "id": { "dbs": "res_ruimte_key", - "label": "Key", + "label": L("lcl_key"), "typ": "key", "required": true, "filter": "exact", @@ -58,12 +58,12 @@ function model_res_ruimte() "label": L("res_ruimte_volgnummer"), "typ": "number" }, - "res_ruimte_info_url": { + "infourl": { "dbs": "res_ruimte_info_url", "label": L("res_ruimte_info_url"), "typ": "varchar" }, - "locatiekey": { + "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", @@ -76,7 +76,7 @@ function model_res_ruimte() }, "foreignfiltercode": null // Ook facilitor irrelevant }, - "catalog": { + "bookingdiscipline": { "dbs": "res_discipline_key", "label": L("res_discipline_key"), "typ": "key", @@ -94,121 +94,127 @@ function model_res_ruimte() "label": L("res_ruimte_begintijd"), "typ": "float", "LOV": api2.getTimetable(), - "emptyoption": L("lcl_res_standaard").format(toTimeString(S("res_t1"),false)) + "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)) + "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() + "LOV": api2.getTimetable(), + "multiedit": true }, "blockend": { "dbs": "res_ruimte_eindtijdblok", "label": L("res_ruimte_eindtijdblok"), "typ": "float", - "LOV": api2.getTimetable() + "LOV": api2.getTimetable(), + "multiedit": true }, - "min_res_time": { + "minduration": { "dbs": "res_ruimte_min_duur", "label": L("res_ruimte_min_duur"), - "typ": "float" + "typ": "float", + "multiedit": true }, - "res_ruimte_prijs_vast": { + "fixedprice": { "dbs": "res_ruimte_prijs_vast", "label": L("res_ruimte_prijs_vast"), - "typ": "check" + "typ": "check", + "multiedit": true }, - "_interne_prijzen": { + "_intpricelabel": { "dbs": "", "label": "", "typ": "label", "labelvalue": L("res_ruimte_intprijs_label") }, - "res_ruimte_intprijs": { + "intpricehour": { "dbs": "res_ruimte_intprijs", "label": L("res_ruimte_intprijs"), "iscurrency": true, "typ": "float" }, - "res_ruimte_intprijs_ochtend": { + "intpricemorning": { "dbs": "res_ruimte_intprijs_ochtend", "label": L("res_ruimte_intprijs_ochtend"), "iscurrency": true, "typ": "float" }, - "res_ruimte_intprijs_middag": { + "intpriceafternoon": { "dbs": "res_ruimte_intprijs_middag", "label": L("res_ruimte_intprijs_middag"), "iscurrency": true, "typ": "float" }, - "res_ruimte_intprijs_avond": { + "intpriceevening": { "dbs": "res_ruimte_intprijs_avond", "label": L("res_ruimte_intprijs_avond"), "iscurrency": true, "typ": "float" }, - "res_ruimte_intprijs_dag": { + "intpriceday": { "dbs": "res_ruimte_intprijs_dag", "label": L("res_ruimte_intprijs_dag"), "iscurrency": true, "typ": "float" }, - "_externe_prijzen": { + "_extpricelabel": { "dbs": "", "label": "", "typ": "label", "labelvalue": L("res_ruimte_extprijs_label") }, - "res_ruimte_prijs": { + "extpricehour": { "dbs": "res_ruimte_prijs", "label": L("res_ruimte_prijs"), "iscurrency": true, "typ": "float" }, - "res_ruimte_prijs_ochtend": { + "extpricemorning": { "dbs": "res_ruimte_prijs_ochtend", "label": L("res_ruimte_prijs_ochtend"), "iscurrency": true, "typ": "float" }, - "res_ruimte_prijs_middag": { + "extpriceafternoon": { "dbs": "res_ruimte_prijs_middag", "label": L("res_ruimte_prijs_middag"), "iscurrency": true, "typ": "float" }, - "res_ruimte_prijs_avond": { + "extpriceevening": { "dbs": "res_ruimte_prijs_avond", "label": L("res_ruimte_prijs_avond"), "iscurrency": true, "typ": "float" }, - "res_ruimte_prijs_dag": { + "extpriceday": { "dbs": "res_ruimte_prijs_dag", "label": L("res_ruimte_prijs_dag"), "iscurrency": true, "typ": "float" }, - "res_ruimte_image": { + "image": { "dbs": "res_ruimte_image", "label": L("res_ruimte_image"), "typ": "varchar", "flexmodule": "RESPH" }, - "res_ruimte_groep": { + "waitingarea": { "dbs": "res_ruimte_groep", "label": L("res_ruimte_groep"), "typ": "varchar" }, - "action": { + "visitoraction": { "dbs": "bez_actie_key", "label": L("bez_actie_key"), "typ": "key", @@ -221,7 +227,7 @@ function model_res_ruimte() "filter": "exact", "LOVinit": "" }, - "res_status_fo_key": { + "defaultstatus": { "dbs": "res_status_fo_key", "label": L("res_status_fo_key"), "typ": "key", @@ -233,12 +239,13 @@ function model_res_ruimte() "label": L("res_ruimte_friendlyname"), "typ": "varchar" }, - "res_ruimte_vervaldatum": { + "expirationdate": { "dbs": "res_ruimte_vervaldatum", "label": L("res_ruimte_vervaldatum"), - "typ": "date" + "typ": "date", + "multiedit": true }, - "res_ruimte_extern_id": { + "externalid": { "dbs": "res_ruimte_extern_id", "label": L("res_ruimte_extern_id"), "typ": "varchar" @@ -251,14 +258,14 @@ function model_res_ruimte() this.fields.res_ruimte_extern_id.readonly = true; this.includes = { - "rooms": { + "physicalrooms": { "model": new model_res_alg_ruimte(), - "joinfield": "res_ruimte_key" + "joinfield": "bookingroom" }, - "configurations": { + "bookingconfigurations": { "model": new model_res_ruimte_opstelling(), - "joinfield": "res_ruimte_key", - "multiadd": "res_opstelling_key" + "joinfield": "bookingroom", + "multiadd": "bookingconfiguration" } }; diff --git a/APPL/API2/reference.xsl b/APPL/API2/reference.xsl index aee2a7da8d..acfd5435fc 100644 --- a/APPL/API2/reference.xsl +++ b/APPL/API2/reference.xsl @@ -7,9 +7,13 @@ + API <xsl:value-of select="/api/records_name"/>

FACILITOR® API reference:

+ +

+
Record name:
Records name:

Parameters:

@@ -36,6 +40,15 @@ GET /api2/.json
+ +
+ + ../api2/.html?include=&limit=3 + _new + GET /api2/.json?include= + +
+
../api2/.xml?limit=3 @@ -46,7 +59,9 @@

Fields list:

- Name:
+ + Label: ""
+
Filter:
diff --git a/APPL/MGT/res_ruimte.asp b/APPL/MGT/res_ruimte.asp index 25ffa5c83c..3d12e313ff 100644 --- a/APPL/MGT/res_ruimte.asp +++ b/APPL/MGT/res_ruimte.asp @@ -19,7 +19,7 @@ scaffolding(this_model, "description", "locatiekey", "bookingdiscipline", - "bookingconfigurations.roomconfiguration" + "bookingconfigurations.bookingroom" ] }, "list": { @@ -29,8 +29,8 @@ scaffolding(this_model, "name", "description", "bookingdiscipline", - "bookingconfigurations.roomconfiguration", - "rooms.ruimtekey" + "bookingconfigurations.bookingroom", + "physicalrooms.ruimtekey" ] }, "show": { diff --git a/APPL/Shared/User.inc b/APPL/Shared/User.inc index 52e62dcff6..5b5a6cda3c 100644 --- a/APPL/Shared/User.inc +++ b/APPL/Shared/User.inc @@ -928,9 +928,16 @@ Perslid.prototype.checkAutorisation_readit = function _checkAutorisation_readit( { if (Request.QueryString("api2").Count > 0) { - Response.Status = '403 Forbidden'; - // Response.Write(L("lcl_no_auth")); ? - Response.End(); + if (Request.QueryString("format") == 'doc') + { + shared.simpel_page(L("lcl_no_auth") + " ({0})".format(String(autfunction))); + } + else + { + Response.Status = '403 Forbidden'; + // Response.Write(L("lcl_no_auth")); ? + Response.End(); + } } shared.simpel_page(L("lcl_no_auth")); }