Files
Facilitor/APPL/RES/res_edit_multi.asp
Erik Groener b209c5b7bb STPH#32305 [RES] Reeks reserveringen in een keer naar status definitief
svn path=/Website/trunk/; revision=27026
2015-11-17 08:53:50 +00:00

169 lines
7.1 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
*/
%>
<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 foboOnly = ((this_res.canChangeUrole == "fo") || (this_res.canChangeUrole == "bo"));
%>
<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="modal" id="mod_resmulti_save">
<form name="u2"
action="res_edit_multi_save.asp?urole=<%=urole%>&rsv_ruimte_key=<%=rsv_ruimte_key%>"
method="post">
<% BLOCK_START("", L("lcl_res_cascade1") + rrr.reservering_key + "/" + rrr.rsv_ruimte_volgnr + L("lcl_res_cascade2")); %>
<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><input name='c1' value="1" type='checkbox'><%=L("lcl_descr")%></label>
<br><label><input name='c2' value="2" type='checkbox'><%=L("lcl_remark")%></label>
<br><label><input name='c4' value="4" type='checkbox'><%=L("lcl_date_time")%></label>
<br><label><input name='c2048' id='c2048' value="2048" type='checkbox'><%=L("lcl_date")%></label>
<br><label><input name='c8' value="8" type='checkbox'><%=L("lcl_visitors")%></label>
<br><label><input name='c16' value="16" type='checkbox'><%=L("lcl_room")%></label>
<br><label><input name='c4096' value="4096" type='checkbox'><%=L("lcl_name")%></label>
<br><label><input name='c32' value="32" type='checkbox'><%=L("lcl_host")%></label>
<br><label><input name='c64' value="64" type='checkbox'><%=L("lcl_account")%></label>
<br><label><input name='c1024' value="1024" type='checkbox'><%=L("lcl_res_flexblok")%></label>
<% if (foboOnly) { %>
<br><label><input name='c8192' value="8192" type='checkbox'><%=L("lcl_status_FO")%></label>
<% } %>
<br>
<br><label><input name='c128' value="128" type='checkbox'><%=L("lcl_reserved_object")%></label>
<br><label><input name='c256' value="256" type='checkbox'><%=L("lcl_catering")%></label>
<br><label><input name='c512' value="512" 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" 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();
}
%> </select>
</td>
</tr>
<% BLOCK_END();
IFACE.FORM_END();
%>
</form>
<%
CreateButtons([ { title: L("lcl_submit"), action: "multi_submit()", singlepress: true, id: "btn_res_submit" },
{ title: L("lcl_cancel"), action: "FcltMgr.closeDetail(window, { cancel: true } )"} ]);
%>
</body>
</html>