Files
Facilitor/APPL/ALG/alg_edit_locatie.asp
Jos Groot Lipman 2aa489e0c7 FCLT#Recordsets die niet gesloten zijn beter detecteren
svn path=/Website/trunk/; revision=47235
2020-06-24 15:42:24 +00:00

192 lines
7.0 KiB
Plaintext

<%@language = "javascript" %>
<%
/* $Revision$
$Id$
File: alg_edit_locatie.asp
Description: edit locatie gegevens
Parameters: loc_key
Context:
Note:
*/ %>
<!--#include file="../Shared/common.inc" -->
<!--#include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/calendar.inc" -->
<!--#include file="../Shared/selector.inc" -->
<!--#include file="../Shared/plaatsselector.inc" -->
<!-- #include file="alg_flexkenmerk.inc" -->
<!-- #include file="alg.inc" -->
<%
FCLTHeader.Requires({plugins:["suggest", "jQuery", "kenmerk"], js: []})
var ins_score_enabled = S("ins_score_enabled") == 1;
var loc_key = getQParamInt("loc_key", -1);
var dis_key
var onrgoedlvl = "L";
var this_alg = alg.func_enabled(loc_key, onrgoedlvl);
user.auth_required_or_abort(this_alg.writeman || (loc_key>0&&this_alg.writeuse));
if (loc_key > 0)
{
sql = " SELECT * "
+ " FROM ALG_LOCATIE "
+ " WHERE alg_locatie_key = " + loc_key;
oRs = Oracle.Execute(sql);
var loc_omsch = oRs("alg_locatie_omschrijving").Value;
var loc_code = oRs("alg_locatie_code").Value;
var bez_adres = oRs("alg_locatie_adres").Value;
var bez_postc = oRs("alg_locatie_postcode").Value;
var bez_plaats = oRs("alg_locatie_plaats").Value
var bez_land = oRs("alg_locatie_land").Value;
var loc_vw = oRs("alg_locatie_verantw").Value;
var loc_vwtel = oRs("alg_locatie_verantw_tel").Value;
var loc_x = oRs("alg_locatie_x").Value;
var loc_y = oRs("alg_locatie_y").Value;
var loc_mail = oRs("alg_locatie_email").Value;
var loc_image = oRs("alg_locatie_image").Value;
var pst_adres = oRs("alg_locatie_post_adres").Value;
var pst_postc = oRs("alg_locatie_post_postcode").Value;
var pst_adres = oRs("alg_locatie_post_adres").Value;
var pst_plaats = oRs("alg_locatie_post_plaats").Value;
var pst_land = oRs("alg_locatie_post_land").Value;
var dienstniveau = oRs("mld_dienstniveau_key").Value;
var loc_score1 = oRs("alg_locatie_mjb_score1").Value;
var vervaldatum = oRs("alg_locatie_vervaldatum").Value != null ? new Date(oRs("alg_locatie_vervaldatum").Value) : null;
oRs.Close();
}
%>
<html>
<head>
<%
FCLTHeader.Generate();
%>
<script>
function alg_submit()
{
document.activeElement.blur(); // trigger laatste onChanges
if (!validateForm("u2"))
return false;
document.forms.u2.submit();
}
function alg_cancel()
{
FcltMgr.closeDetail(window, { cancel: true } );
}
function UploadImage()
{
url = "<%=protectQS.create("../shared/BijlagenForm.asp?module=ALGPHL")%>";
FcltMgr.openModalDetail(url, L("lcl_change"),
{ callback: function (data)
{
if (data.filenaam)
$("#loc_image").val(data.filenaam); }
} );
}
</script>
</head>
<body id="editbody">
<%
var buttons = [ {title: L("lcl_submit"), action:"alg_submit()", icon: "opslaan.png" },
{title: L("lcl_cancel"), action:"alg_cancel()", icon: "undo.png" } ];
IFRAMER_HEADER(L("lcl_alg_locatie_frame"), buttons);
%>
<div id="edit">
<form name="u2"
action="alg_edit_locatie_save.asp?loc_key=<%=loc_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", "&nbsp;");
FCLTplaatsselector(this_alg.authparams("WEB_ALGMAN").ALGwritelevel, {
districtkey: dis_key,
locatiekey: loc_key,
startlevel: 1, //District
eindlevel: 1, // District
readonly: !this_alg.writeman,
required: true });
manRWFIELD("loc_omsch", "fld", L("lcl_estate_locatie_man_descr"), loc_omsch, {required: true, maxlength: 60});
manRWFIELD("loc_code", "fld", L("lcl_estate_locatie_man_code"), loc_code, {required: true, maxlength: 10});
manRWFIELD("bez_adres", "fld", L("lcl_prs_address_bezoek_adres"), bez_adres, {maxlength: 50});
manRWFIELD("bez_postc", "fld", L("lcl_prs_address_bezoek_postcode"), bez_postc, {maxlength: 12});
manRWFIELD("bez_plaats", "fld", L("lcl_prs_address_bezoek_plaats"), bez_plaats, {maxlength: 30});
manRWFIELD("bez_land", "fld", L("lcl_prs_address_bezoek_land"), bez_land, {maxlength: 30});
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.writeuse
});
manRWFIELD("loc_x", "fld", L("lcl_geoxcoord"), loc_x, {maxlength: 25});
manRWFIELD("loc_y", "fld", L("lcl_geoycoord"), loc_y, {maxlength: 25});
BLOCK_END();
BLOCK_START("algLoc2", "&nbsp;");
FCLTcalendar("vervaldatum",
{ datum: vervaldatum,
initEmpty: vervaldatum==null,
label: L("lcl_alg_vervaldatum"),
readonly: !this_alg.writeman
});
manRWFIELD("pst_adres", "fld", L("lcl_prs_address_post_adres"), pst_adres, {maxlength: 50});
manRWFIELD("pst_postc", "fld", L("lcl_prs_address_post_postcode"), pst_postc, {maxlength: 12});
manRWFIELD("pst_plaats", "fld", L("lcl_prs_address_post_plaats"), pst_plaats, {maxlength: 30});
manRWFIELD("pst_land", "fld", L("lcl_prs_address_post_land"), pst_land, {maxlength: 30});
manRWFIELD("loc_vw", "fld", L("lcl_estate_locatie_man_verantw"), loc_vw, {maxlength: 30});
manRWFIELD("loc_vwtel", "fld", L("lcl_estate_locatie_man_verantw_tel"), loc_vwtel, {maxlength: 15});
manRWFIELD("loc_mail", "fld", L("lcl_noti_email"), loc_mail, {maxlength: 200});
manRWFIELD("loc_image", "fld", L("lcl_alg_locatie_image"), loc_image, {maxlength: 255});
var params = { type: "button",
html: "title='" + L("lcl_alg_symbol_upload") + "' onclick='UploadImage()'"
}
ROFIELDTR("image_button", L("lcl_alg_locatie_image_upload"), L("lcl_fg_upload"), params);
if (ins_score_enabled)
ROFIELDTR("fld", L("lcl_alg_locatie_mjb_score1"), loc_score1, {suppressEmpty: true});
BLOCK_END();
generateFlexKenmerkBlock ({
onrgoed_key : loc_key,
onrgoed_niveau : onrgoedlvl,
reado : false,
flexcolumns : S("alg_flexcolumns"),
this_alg : this_alg
});
IFACE.FORM_END();
%>
</form>
<iframe src="../Shared/empty.html" name="hidFrameSubmit" style="display:none"></iframe>
</div>
</body>
</html>
<% ASPPAGE_END(); %>