Files
Facilitor/APPL/RES/res_edit_multi.asp
2025-03-25 10:00:27 +00:00

185 lines
8.2 KiB
Plaintext

<%@ language = "JavaScript" %>
<% /*
$Revision$
$Id$
File: res_multi_edit.asp
Description: Maak een dialoog om gegevens van een deelreservering naar
anderen over te nemen
Globalen:
rsv_ruimte_key bron-deelreservering
Context: Als gebruiker bij opslaan vinkje 'voor meerdere' heeft aangezet
Note:
*/
%>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="./res.inc" -->
<%
FCLTHeader.Requires({plugins: ["jQuery"]});
var urole = getQParamSafe("urole");
var rsv_ruimte_key = getQParamInt("rsv_ruimte_key");
//
// Submit code
//
/* --flags (0-16383)
-- 0 Niks
-- 1 Omschrijving
-- 2 Opmerkingen
-- 4 Tijdstip
-- 8 Aantal personen
-- 16 Ruimte/opstelling
-- 32 Gastheer
-- 64 Kostenplaats
-- 128 Voorzieningen (delen)
-- 256 Catering (artikelen)
-- 512 Bezoekers
-- 1024 Flexkenmerken
-- 2048 Tijdstip
-- 4096 Naam contactpersoon
-- 8192 Reserveringsstatus
-- 16384 Afgesproken ruimteprijs
-- 32768 Korting
-- 65536 Flags (bolletjes)
*/
%>
<html>
<head>
<% FCLTHeader.Generate()
var sql = "SELECT res_reservering_key"
+ " , rrr.res_rsv_ruimte_van"
+ " , res_rsv_ruimte_volgnr"
+ " FROM res_rsv_ruimte rrr"
+ " WHERE res_rsv_ruimte_key = " + rsv_ruimte_key
oRs = Oracle.Execute(sql);
var rrr = { rsv_ruimte_key : rsv_ruimte_key,
reservering_key : oRs("res_reservering_key").value,
rsv_ruimte_van : new Date(oRs("res_rsv_ruimte_van").value),
rsv_ruimte_volgnr : oRs("res_rsv_ruimte_volgnr").value
}
oRs.Close();
var this_res = res.func_enabled(rsv_ruimte_key);
var hasFoBo = this_res.canWrite("WEB_RESFOF") || this_res.canWrite("WEB_RESBOF");
%>
<script type="text/javascript">
function res_submit_callback(json)
{
iface.button.enable("btn_res_submit");
if (json.success)
FcltMgr.closeDetail(window, json);
}
function multi_submit ()
{
$.post($("form[name=u2]")[0].action, $("[name=u2]").serialize(), FcltCallbackAndThenAlways(res_submit_callback), "json");;
return true; // disable submit
}
</script>
</head>
<body class="fclt-modal" id="mod_resmulti_save">
<% MODAL_START(); %>
<form name="u2"
action="res_edit_multi_save.asp?urole=<%=urole%>&rsv_ruimte_key=<%=rsv_ruimte_key%>"
method="post">
<% MODAL_BLOCK_START("", L("lcl_res_cascade1") + rrr.reservering_key + "/" + rrr.rsv_ruimte_volgnr + L("lcl_res_cascade2"), { icon: "fa-copy" }); %>
<tr>
<td valign=top>
<label><%=L("lcl_res_copypart")%></label>
<br><label><a href="#" onclick="javascript:$('input[type=checkbox]').prop('checked', true); return false;"><%=L("lcl_all")%></a></label>
<br><label for="c1"><input id='c1' name='c1' value="1" type='checkbox'><%=L("lcl_descr")%></label>
<br><label for="c2"><input id='c2' name='c2' value="1" type='checkbox'><%=L("lcl_remark")%></label>
<br><label for="c4"><input id='c4' name='c4' value="1" type='checkbox'><%=L("lcl_date_time")%></label>
<br><label for="c2048"><input name='c2048' id='c2048' value="1" type='checkbox'><%=L("lcl_date")%></label>
<br><label for="c8"><input id='c8' name='c8' value="1" type='checkbox'><%=L("lcl_visitors")%></label>
<br><label for="c16"><input id='c16' name='c16' value="1" type='checkbox'><%=L("lcl_room")%></label>
<br><label for="c4096"><input id='c4096' name='c4096' value="1" type='checkbox'><%=L("lcl_name")%></label>
<br><label for="c32"><input id='c32' name='c32' value="1" type='checkbox'><%=L("lcl_host")%></label>
<br><label for="c64"><input id='c64' name='c64' value="1" type='checkbox'><%=L("lcl_account")%></label>
<br><label for="c1024"><input id='c1024' name='c1024' value="1" type='checkbox'><%=L("lcl_res_flexblok")%></label>
<% if (S("res_roompricingtotaal")) { %>
<br><label for="c16384"><input id='c16384' name='c16384' value="1" type='checkbox'><%=L("lcl_res_ruimtetotaal")%></label>
<% } %>
<% if (S("res_roompricingkorting")) { %>
<br><label for="c32768"><input id='c32768' name='c32768' value="1" type='checkbox'><%=L("lcl_res_ruimtekorting")%></label>
<% } %>
<% if (hasFoBo) { %>
<br><label for="c8192"><input id='c8192' name='c8192' value="1" type='checkbox'><%=L("lcl_status_FO")%></label>
<br><label for="c65536"><input id='c65536' name='c65536' value="1" type='checkbox'><%=L("lcl_res_flags")%></label>
<% } %>
<br>
<br><label for="c128"><input id='c128' name='c128' value="1" type='checkbox'><%=L("lcl_reserved_object")%></label>
<br><label for="c256"><input id='c256' name='c256' value="1" type='checkbox'><%=L("lcl_catering")%></label>
<br><label for="c512"><input id='c512' name='c512' value="1" type='checkbox'><%=(S("bez_sel_internpersoon") == 1? L("lcl_res_frame_visitors") : L("lcl_res_frame_visitors_external"))%></label>
</td>
<td valign="top">
<% // ============================================
// Show list of reservation-rooms die nog aangepast mogen worden
// ============================================
// Merk op: de outer-join is alleen van toepassing op erg 'dirty' ruimtes.
var res_deleted = null;
var res_deleted_user = -1;
sql = "SELECT res_rsv_ruimte_key"
sql += ", res_rsv_ruimte_van"
sql += ", res_rsv_ruimte_tot"
sql += ", rm.res_rsv_ruimte_volgnr"
sql += ", rm.res_rsv_ruimte_dirtlevel"
sql += " FROM res_rsv_ruimte rm, res_ruimte_opstelling ro, res_ruimte r"
sql += " WHERE rm.res_ruimte_opstel_key = ro.res_ruimte_opstel_key(+)"
sql += " AND ro.res_ruimte_key = r.res_ruimte_key(+)"
sql += " AND res_reservering_key = " + rrr.reservering_key
sql += " AND res_rsv_ruimte_key <> " + rrr.rsv_ruimte_key
sql += " AND res_rsv_ruimte_verwijder IS NULL"
sql += " AND (rm.res_status_bo_key IS NULL OR rm.res_status_bo_key <> 6)" // (CV heeft geen bo_status)
sql += " ORDER BY res_rsv_ruimte_van, res_rsv_ruimte_key"
oRs = Oracle.Execute( sql );
%>
<label><%=L("lcl_res_copytodates")%></label>
<br>
<select id="deelreserveringen" class="fld" name="deelreserveringen" size="15" multiple>
<% while (!oRs.eof)
{
var rKey = oRs("res_rsv_ruimte_key").value;
var rDisc; // Nodig als parameter, zonder waarde.
var this_res2 = res.func_enabled(rKey, rDisc, {isOptional: true}); // Wat mag ik op deze deelreservering
// niet enorm efficient maar wel robuust
if (this_res2.canChange)
{
d1Key = new Date(oRs("res_rsv_ruimte_van").value);
d2Key = new Date(oRs("res_rsv_ruimte_tot").value);
tekst = toDateTimeString(d1Key) + "-" + toTimeString(d2Key)
volgnrTxt = oRs("res_rsv_ruimte_volgnr").value;
sel = "";
if (d1Key > new Date())
var sel = " SELECTED "
%>
<option style="text-align: right;" value="<%=rKey%>" <%=sel%>><%=volgnrTxt+" "+tekst%></option>
<% }
oRs.Movenext();
}
oRs.Close();
%> </select>
</td>
</tr>
<% MODAL_BLOCK_END();
IFACE.FORM_END();
%>
</form>
<% SIMPLE_BLOCK_START();
CreateButtons([ { title: L("lcl_submit"), icon: "fa-fclt-save", action: "multi_submit()", singlepress: true, id: "btn_res_submit", importance: 1 },
{ title: L("lcl_cancel"), icon: "fa-fclt-cancel", action: "FcltMgr.closeDetail(window, { cancel: true } )", importance: 3} ]);
SIMPLE_BLOCK_END();
%>
<% MODAL_END(); %>
</body>
</html>
<% ASPPAGE_END(); %>