Files
Facilitor/APPL/ALG/alg_edit_gebouw.asp
Erik Groener 37bdd1da1e VENR#88522 Probleem met lege kalenderoptie toont '-1' in show-mode.
svn path=/Website/trunk/; revision=68703
2025-04-09 10:29:47 +00:00

331 lines
15 KiB
Plaintext

<%@language = "javascript" %>
<%
/* $Revision$
$Id$
File: alg_edit_gebouw.asp
Description: edit of toevoegen van een gebouw
Parameters: bld_key
*/ %>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/calendar.inc" -->
<!-- #include file="../Shared/selector.inc" -->
<!-- #include file="../Shared/adresselector.inc" -->
<!-- #include file="../Shared/plaatsselector.inc" -->
<!-- #include file="../Shared/kostenplaatsselector.inc" -->
<!-- #include file="../Shared/persoonselector.inc" -->
<!-- #include file="../API2/api2.inc" -->
<!-- #include file="alg_flexkenmerk.inc" -->
<!-- #include file="alg.inc" -->
<%
FCLTHeader.Requires({plugins:["suggest","jQuery", "kenmerk"], js: []})
var bld_key = getQParamInt("bld_key");
var onrgoedlvl = "G";
var this_alg = alg.func_enabled(bld_key, onrgoedlvl);
user.auth_required_or_abort(this_alg.writeman || (bld_key>0&&this_alg.writeuse));
if (bld_key > 0)
{
var sql = " SELECT g.*, alg_locatie_adres, alg_locatie_postcode"
+ " FROM alg_gebouw g, alg_locatie l"
+ " WHERE g.alg_locatie_key = l.alg_locatie_key"
+ " AND alg_gebouw_key = " + bld_key;
oRs = Oracle.Execute(sql);
if (oRs.Eof)
shared.record_not_found("<!--"+bld_key+"-->");
var bld_srtkey = oRs("alg_srtgebouw_key").Value;
var bld_naam = oRs("alg_gebouw_naam").Value;
var bld_code = oRs("alg_gebouw_code").Value;
var bld_descr = oRs("alg_gebouw_omschrijving").Value;
var bld_adres = oRs("alg_gebouw_adres").Value;
var loc_adres = oRs("alg_locatie_adres").Value; // optische default
var bld_postcode = oRs("alg_gebouw_postcode").Value;
var loc_postcode = oRs("alg_locatie_postcode").Value; // optische default
var bld_maak = oRs("alg_gebouw_aanmaak").Value;
var bld_email = oRs("alg_gebouw_email").Value;
var bld_image = oRs("alg_gebouw_image").Value;
var bld_teken = oRs("alg_gebouw_getekend").Value;
var bld_opp = oRs("alg_gebouw_bruto_vloeropp").Value;
var bld_omtrek = oRs("alg_gebouw_omtrek").Value;
var bld_inhoud = oRs("alg_gebouw_inhoud").Value;
var bld_opmerk = oRs("alg_gebouw_opmerking").Value;
var mld_adres = oRs("mld_adres_key").Value;
var prs_kstpl = oRs("prs_kostenplaats_key").Value;
var bld_ordrnr = oRs("alg_gebouw_ordernr").Value;
var bld_dwgx = oRs("alg_gebouw_dwgx").Value;
var bld_dwgy = oRs("alg_gebouw_dwgy").Value;
var bld_x = oRs("alg_gebouw_x").Value;
var bld_y = oRs("alg_gebouw_y").Value;
var bld_mld = oRs("alg_gebouw_mld").Value;
var bld_bez = oRs("alg_gebouw_bez").Value;
var bld_groep = oRs("alg_gebouw_groep").Value;
var dienstniveau = oRs("mld_dienstniveau_key").Value;
var beginuur = oRs("alg_gebouw_beginuur").Value;
var einduur = oRs("alg_gebouw_einduur").Value;
var werkdagen = oRs("alg_gebouw_werkdagen").Value;
var toon_telefoon = oRs("alg_gebouw_toon_telefoon").Value;
var toon_email = oRs("alg_gebouw_toon_email").Value;
var toon_kenteken = oRs("alg_gebouw_toon_kenteken").Value;
var verantw_key = oRs("prs_perslid_key_verantw").Value;
var verantw_key2 = oRs("prs_perslid_key_verantw2").Value;
var vervaldatum = oRs("alg_gebouw_vervaldatum").Value != null ? new Date(oRs("alg_gebouw_vervaldatum").Value) : null;
var geb_score1 = oRs("alg_gebouw_mjb_score1").Value;
var actie_grp_key = oRs("bez_actie_groep_key").Value;
var kalender_id = oRs("mld_vrije_dagen_id").Value;
oRs.Close();
}
else
{
var bld_mld = 1;
var werkdagen = 1;
var toon_telefoon = 0;
var toon_email = 0;
var toon_kenteken = 0;
}
%>
<html>
<head>
<%
FCLTHeader.Generate();
%>
<script>
async function alg_submit()
{
document.activeElement.blur(); // trigger laatste onChanges
if (!await validateForm("u2"))
return false;
document.forms.u2.submit();
}
function alg_cancel()
{
FcltMgr.closeDetail(window, { cancel: true } );
}
</script>
</head>
<body class="editmode">
<% SUBFRAME_START(); %>
<%
var buttons = [ {title: L("lcl_submit"), action:"alg_submit()", icon: "fa-fclt-save" },
{title: L("lcl_cancel"), action:"alg_cancel()", icon: "fa-fclt-cancel" } ];
IFRAMER_HEADER(L("lcl_alg_gebouw_frame"), buttons);
%>
<form name="u2"
action="alg_edit_gebouw_save.asp?bld_key=<%=bld_key%>"
method="post"
target="hidFrameSubmit"
onSubmit="alg_submit();">
<%
if (this_alg.writeman)
manRWFIELD = RWFIELDTR;
else
manRWFIELD = function (a,b,c,d,e) { ROFIELDTR(b,c,d,e) }; // als geen USE of <self> dan zijn er veel readonly
BLOCK_START("algLoc1", L("lcl_building"), {icon: "fa-building"});
FCLTplaatsselector(this_alg.authparams("WEB_ALGMAN").ALGwritelevel,
{ gebouwkey: bld_key,
startlevel: 2, //Locatie
eindlevel: 2, // Locatie
readonly: bld_key > 0,
required: true
});
manRWFIELD("bld_naam", "fld", L("lcl_estate_gebouw_man_name"), bld_naam, {required: true, maxlength: 60});
manRWFIELD("bld_code", "fld", L("lcl_estate_gebouw_man_code"), bld_code, {required: true, maxlength: 12});
sql = "SELECT alg_srtgebouw_key, "
+ " "+lcl.xsqla('alg_srtgebouw_omschrijving', 'alg_srtgebouw_key')
+ " FROM alg_srtgebouw "
+ " WHERE alg_srtgebouw_verwijder IS NULL "
+ "ORDER BY UPPER("+lcl.xsql('alg_srtgebouw_omschrijving', 'alg_srtgebouw_key')+")";
FCLTselector("bld_srtkey",
sql,
{ label: L("lcl_estate_gebouw_srtgebouw"),
initKey: bld_srtkey,
emptyOption: "",
readonly: !this_alg.writeman
});
manRWFIELD("bld_descr", "fld", L("lcl_estate_gebouw_man_descr"), bld_descr, {maxlength: 60});
manRWFIELD("bld_adres", "fld", L("lcl_estate_gebouw_man_adres"), bld_adres, {maxlength: 50, placeholder: loc_adres});
manRWFIELD("bld_postcode", "fld", L("lcl_estate_gebouw_man_postcode"), bld_postcode, {maxlength: 12, placeholder: loc_postcode});
manRWFIELD("bld_opmerk", "fld", L("lcl_estate_gebouw_man_opmerk"), bld_opmerk, {maxlength: 50});
manRWFIELD("bld_groep", "fld", L("lcl_estate_gebouw_groepkenmerk"), bld_groep, {maxlength: 60});
BLOCK_END();
BLOCK_START("algLoc2", L("lcl_alg_gebouw_fysiek"), {icon: "fa-ruler-combined"});
if (bld_key > 0)
{
var calcopp = alg.calc_algm2(bld_key, onrgoedlvl);
ROFIELDTR("fld", L("lcl_estate_gebouw_floors_vloeropp") + L("lcl_estate_calc_vloeropp"), calcopp.oppfloors, {suppressEmpty: true, datatype: "float"});
ROFIELDTR("fld", L("lcl_estate_ruimte_bruto_vloeropp") + L("lcl_estate_calc_vloeropp"), calcopp.opprooms, {suppressEmpty: true, datatype: "float"});
ROFIELDTR("fld", L("lcl_estate_ruimte_opp_alt1") + L("lcl_estate_calc_vloeropp"), calcopp.oppalt1, {suppressEmpty: true, datatype: "float"});
ROFIELDTR("fld", L("lcl_estate_ruimte_opp_alt2") + L("lcl_estate_calc_vloeropp"), calcopp.oppalt2, {suppressEmpty: true, datatype: "float"});
}
manRWFIELD("bld_opp", "fld float", L("lcl_estate_gebouw_man_bruto_vloeropp"), bld_opp, {datatype: "float", maxlength: 15});
manRWFIELD("bld_omtrek", "fld", L("lcl_estate_gebouw_man_omtrek"), bld_omtrek, {datatype: "float", maxlength: 15});
manRWFIELD("bld_inhoud", "fld", L("lcl_estate_gebouw_man_inhoud"), bld_inhoud, {datatype: "float", maxlength: 15});
manRWFIELD("bld_x", "fldshort", L("lcl_geoxcoord"), bld_x, {maxlength: 25});
manRWFIELD("bld_y", "fldshort", L("lcl_geoycoord"), bld_y, {maxlength: 25});
ROFIELDTR("fld", L("lcl_alg_gebouw_mjb_score1"), geb_score1, {suppressEmpty: true});
BLOCK_END();
BLOCK_START("algLoc3", L("lcl_alg_gebouw_administr"), {icon: "fa-clipboard"});
FCLTcalendar("vervaldatum",
{ datum: vervaldatum,
initEmpty: vervaldatum==null,
label: L("lcl_alg_vervaldatum"),
readonly: !this_alg.writeman
});
FCLTkostenplaatsselector( "prs_kstpl",
"prs_kstpl",
user_key,
{ kostenplaatsKey: prs_kstpl,
label: L("lcl_prs_dept_kosten"),
filtercode: "G",
readonly: !this_alg.writeman
});
manRWFIELD("bld_ordrnr", "fld", L("lcl_estate_gebouw_ordernr"), bld_ordrnr, {maxlength: 30});
FCLTpersoonselector("verantw",
"sgVerantw",
{ perslidKey: verantw_key,
label: L("lcl_alg_verantw"),
readonly: !this_alg.writeman,
autlevel: this_alg.authparams("WEB_ALGMAN") && this_alg.authparams("WEB_ALGMAN").PRSwritelevel
});
FCLTpersoonselector("verantw2",
"sgVerantw2",
{ perslidKey: verantw_key2,
label: L("lcl_alg_verantw2"),
readonly: !this_alg.writeman,
autlevel: this_alg.authparams("WEB_ALGMAN") && this_alg.authparams("WEB_ALGMAN").PRSwritelevel
});
manRWFIELD("bld_email", "fld", L("lcl_alg_gebouw_email"), bld_email, {maxlength: 200});
FILEPICKERTR("bld_image", L("lcl_alg_gebouw_image"), bld_image, { "key": bld_key, "module": "ALGPHG", "readonly": !this_alg.writeman });
BLOCK_END();
BLOCK_START("algLoc4", L("lcl_alg_gebouw_facilitair"), {icon: "fa-users-cog"});
sql = "SELECT mld_dienstniveau_key"
+ " , " + lcl.xsqla("mld_dienstniveau_omschr", "mld_dienstniveau_key")
+ " FROM mld_dienstniveau"
+ " ORDER BY UPPER(" + lcl.xsql("mld_dienstniveau_omschr", "mld_dienstniveau_key") + ")";
FCLTselector("dienstniveau",
sql,
{ label: L("lcl_mld_dienst_niveau"),
initKey: dienstniveau,
emptyOption: "",
readonly: !this_alg.writeman
});
FCLTadresselector("mld_adres", "sgAdres",
{
label: L("lcl_delivery_address"),
adresKey: mld_adres,
emptyOption: "",
filtercode: "A",
readonly: !this_alg.writeman
}) ;
var sql = "SELECT DISTINCT mld_vrije_dagen_id, mld_vrije_dagen_id"
+ " FROM mld_vrije_dagen";
FCLTselector("cal_id"
, sql
, { label: L("lcl_calendar")
, initKey: kalender_id
, emptyOption: ""
, emptyKey: ""
, readonly: !this_alg.writeman
}
);
var times = [];
for (i=0; i<24; i++)
{
sql = " SELECT " + String(i+0/4) + ", '" + String(i) + ":00' FROM DUAL"
+ " UNION ALL SELECT " + String(i+1/4) + ", '" + String(i) + ":15' FROM DUAL"
+ " UNION ALL SELECT " + String(i+2/4) + ", '" + String(i) + ":30' FROM DUAL"
+ " UNION ALL SELECT " + String(i+3/4) + ", '" + String(i) + ":45' FROM DUAL"
times.push(sql);
}
FCLTselector("bld_beginuur", times.join(" UNION ALL "),
{ label: L("lcl_estate_gebouw_beginuur"),
initKey: beginuur,
emptyOption: "",
readonly: !this_alg.writeman
}
);
FCLTselector("bld_einduur", times.join(" UNION ALL "),
{ label: L("lcl_estate_gebouw_einduur"),
initKey: einduur,
emptyOption: "",
readonly: !this_alg.writeman
}
);
if (this_alg.writeman)
{
CHECKBOXTR(L("lcl_estate_gebouw_werkdagen"), "fldalgwerk", "bld_werkdagen", werkdagen==1);
CHECKBOXTR(L("lcl_estate_gebouw_mld"), "fldalgmld", "bld_mld", bld_mld==1);
}
BLOCK_END();
if (user.checkAutorisation("WEB_BEZMGT", true))
{
BLOCK_START("algLoc5", L("lcl_alg_gebouw_bezoek"), {icon: "fa-user-tag"});
if (this_alg.writeman)
CHECKBOXTR(L("lcl_estate_gebouw_bez"), "fldalgbez", "bld_bez", bld_bez==1);
var sql = api2.splitLOV2sql(L("lcl_estate_gebouw_toontelfLOV"));
FCLTselector("toon_telefoon",
sql,
{ label: L("lcl_estate_gebouw_toon_telefoon"),
initKey: toon_telefoon,
extraclass: "notmulti"
});
sql = api2.splitLOV2sql(L("lcl_estate_gebouw_toonmailLOV"));
FCLTselector("toon_email",
sql,
{ label: L("lcl_estate_gebouw_toon_email"),
initKey: toon_email,
extraclass: "notmulti"
});
sql = api2.splitLOV2sql(L("lcl_estate_gebouw_toonkentLOV"));
FCLTselector("toon_kenteken",
sql,
{ label: L("lcl_estate_gebouw_toon_kenteken"),
initKey: toon_kenteken,
extraclass: "notmulti"
});
var sql = "SELECT bez_actie_groep_key"
+ " , bez_actie_groep_omschrijving"
+ " FROM bez_actie_groep"
+ " WHERE bez_actie_groep_verwijder IS NULL"
FCLTselector( "group"
, sql
, { label: L("bez_actie_groep")
, initKey: actie_grp_key
, emptyOption: ""
}
);
BLOCK_END();
}
generateFlexKenmerkBlock ({ onrgoed_key : bld_key,
onrgoed_niveau : onrgoedlvl,
reado : false,
this_alg : this_alg
});
IFACE.FORM_END();
%>
</form>
<iframe src="../Shared/empty.html" name="hidFrameSubmit" style="display:none"></iframe>
<% SUBFRAME_END(); %>
</body>
</html>
<% ASPPAGE_END(); %>