VOLK#83130 Bezoek via API geregistreerd pas zichtbaar na 'Wijzigen'

svn path=/Website/trunk/; revision=64204
This commit is contained in:
Erik Groener
2024-04-10 13:11:39 +00:00
parent 7c58281b0d
commit 736a9af82e

View File

@@ -214,6 +214,37 @@ function model_appointments()
dbfields["action"] = { dbs: "bez_actie_key", typ: "key", val: default_actie };
}
}
// Zet ook de locatie als S("vis_afspraak_onrgoed_uses_keys")=1 en er onrgoed_keys zijn meegegeven.
if (S("vis_afspraak_onrgoed_uses_keys") == 1)
{
if (!jsondata.location)
{
var alg_key = -1;
if (jsondata.room)
alg_key = jsondata.room;
else if (jsondata.floor)
alg_key = jsondata.floor;
else if (jsondata.building)
alg_key = jsondata.building;
var sql = "SELECT MAX(alg_locatie_key) loc_key"
+ " FROM alg_v_allonroerendgoed"
+ " WHERE alg_onroerendgoed_keys = " + alg_key;
var oRs = Oracle.Execute(sql);
if (!oRs.eof)
{
var loc_key = oRs("loc_key").Value;
dbfields["location"] = { dbs: "alg_locatie_key", typ: "key", foreign: "alg_locatie", val: loc_key};
jsondata.location = loc_key;
}
oRs.Close();
}
if (!jsondata.location)
{ // Bij gegeven onroerendgoed_key kan geen locatie_key worden gevonden.
abort_with_warning(L("lcl_vis_error_location"));
}
}
};
this.REST_PUT = function (params, jsondata, the_key) /* update appointment */