5i verder
svn path=/Website/trunk/; revision=36
This commit is contained in:
@@ -1,114 +1,206 @@
|
||||
<%@language ="javascript" %>
|
||||
<% /*
|
||||
$Revision: 1 $
|
||||
$Modtime: 2-04-09 10:09 $
|
||||
$Revision: 2 $
|
||||
$Modtime: 29-10-09 11:32 $
|
||||
|
||||
Klap een tak van de catering boom open.
|
||||
*/ %>
|
||||
<%Response.Expires = 0; %>
|
||||
Er wordt combinatie-validate gedaan
|
||||
*/
|
||||
DOCTYPE_Disable = 1;
|
||||
%>
|
||||
<!-- #include file="../../cust/install.inc" -->
|
||||
<!-- #include file="../Shared/escape.inc" -->
|
||||
|
||||
<head>
|
||||
<script type="text/javascript">
|
||||
|
||||
function ConsObj(cap, key, description, def, hour, min, price, pricefixed)
|
||||
{
|
||||
this.caption = cap;
|
||||
this.key = key;
|
||||
this.description = description;
|
||||
this.def = def
|
||||
this.hour = hour;
|
||||
this.min = min;
|
||||
this.price = price;
|
||||
this.pricefixed = pricefixed;
|
||||
}
|
||||
|
||||
ConsObjects = new Array();
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<!-- #include file="./res.inc" -->
|
||||
<!-- #include file="../shared/kpl_ksrt_validate.inc" -->
|
||||
|
||||
<%
|
||||
discipline_key = parseInt(Request.QueryString("discipline_key"), 10);
|
||||
|
||||
rsv_ruimte_key = getQParam("rsv_ruimte_key");
|
||||
var discipline_key = getQParamInt("discipline_key");
|
||||
var rsv_ruimte_key = getQParamInt("rsv_ruimte_key");
|
||||
// Niet meer alg_ruimte_key = parseInt(Request.QueryString("alg_ruimte_key"), 10);
|
||||
// Zo snel mogelijk relevante basisinformatie opzoeken
|
||||
sql = "select res_reservering_key, "
|
||||
+ " res_rsv_ruimte_verwijder, "
|
||||
+ " alg_ruimte_key, res_ruimte_opstel_key, "
|
||||
+ " res_rsv_ruimte_van, res_rsv_ruimte_tot,"
|
||||
sql = "select res_rsv_ruimte_van, res_rsv_ruimte_tot,"
|
||||
+ " res_rsv_ruimte_bezoekers, "
|
||||
+ " prs_kostenplaats_key"
|
||||
+ " from res_rsv_ruimte"
|
||||
+ " where res_rsv_ruimte_key = " + rsv_ruimte_key;
|
||||
oRs = Oracle.Execute(sql);
|
||||
var res_key = oRs("res_reservering_key").value;
|
||||
var resdeleted = (oRs("res_rsv_ruimte_verwijder").value != null);
|
||||
var res_van = new Date(oRs("res_rsv_ruimte_van").value);
|
||||
var res_tot = new Date(oRs("res_rsv_ruimte_tot").value);
|
||||
var res_vis = oRs("res_rsv_ruimte_bezoekers").Value;
|
||||
if (!kpl_ksrt_validate(oRs("prs_kostenplaats_key"), null, discipline_key))
|
||||
{
|
||||
%><script type="text/javascript">
|
||||
alert("<%=lcl_res_kpks_validatie%>");
|
||||
</script>
|
||||
<%
|
||||
Response.End()
|
||||
}
|
||||
oRs.Close()
|
||||
|
||||
var this_res = res.func_enabled(rsv_ruimte_key); // wat mag ik zoal op deze reservering
|
||||
//user.auth_required_or_abort(this_res.canChange);
|
||||
backo = this_res.canWrite("WEB_RESBOF");
|
||||
|
||||
|
||||
hour1 = res_van.getHours();
|
||||
min1 = res_van.getMinutes();
|
||||
|
||||
%>
|
||||
<body onLoad="javascript:parent.UpdateConsObj(<% = discipline_key %>)">
|
||||
<%
|
||||
// Haal bestaande gereserveerde artikelen op
|
||||
var existing_res = new Array();
|
||||
sql= " SELECT r_Art.RES_ARTIKEL_KEY,"
|
||||
+ " r_r_Art.RES_RSV_ARTIKEL_KEY,"
|
||||
+ " r_r_Art.RES_RSV_ARTIKEL_AANTAL,"
|
||||
+ " r_r_Art.RES_RSV_ARTIKEL_LEVERING,"
|
||||
+ " COALESCE(r_art.res_artikel_prijs_vast,0) prijs_vast, "
|
||||
+ " COALESCE(r_r_art.res_rsv_artikel_prijs/r_r_Art.RES_RSV_ARTIKEL_AANTAL, r_art.res_artikel_prijs, 0) prijs, "
|
||||
+ " r_r_Art.res_status_BO_key"
|
||||
+ " FROM RES_v_aanwezigDISCIPLINE r_Disc,"
|
||||
+ " RES_v_aanwezigARTIKEL r_Art,"
|
||||
+ " RES_v_aanwezigRSV_ARTIKEL r_r_Art,"
|
||||
+ " RES_v_aanwezigRSV_RUIMTE r_r_Rmt"
|
||||
+ " WHERE r_r_art.res_rsv_ruimte_key = r_r_Rmt.res_rsv_ruimte_key"
|
||||
+ " and r_r_Art.RES_RSV_RUIMTE_KEY=" + rsv_ruimte_key
|
||||
+ " and r_Disc.ins_discipline_key =" + discipline_key
|
||||
+ " AND r_r_Art.RES_ARTIKEL_KEY = r_Art.RES_ARTIKEL_KEY"
|
||||
+ " AND r_Art.RES_DISCIPLINE_KEY = r_Disc.INS_DISCIPLINE_KEY"
|
||||
+ " order by INS_DISCIPLINE_OMSCHRIJVING, RES_ARTIKEL_NR";
|
||||
|
||||
oRs = Oracle.Execute(sql);
|
||||
while( !oRs.eof ) {
|
||||
existing_res.push({ artikel_key : oRs("RES_ARTIKEL_KEY").Value,
|
||||
rsv_artikel_key : oRs("RES_RSV_ARTIKEL_KEY").Value,
|
||||
rsv_artikel_aantal : oRs("RES_RSV_ARTIKEL_AANTAL").Value,
|
||||
rsv_artikel_levering: new Date(oRs("RES_RSV_ARTIKEL_LEVERING").Value),
|
||||
prijs_vast : oRs("PRIJS_VAST").Value,
|
||||
prijs : oRs("PRIJS").Value,
|
||||
status_BO_key : oRs("res_status_BO_key").Value
|
||||
})
|
||||
oRs.MoveNext();
|
||||
}
|
||||
oRs.close();
|
||||
|
||||
// Alle mogelijke artikelen
|
||||
sql = "SELECT res_artikel_key"
|
||||
+ ", res_artikel_omschrijving"
|
||||
+ ", res_artikel_opmerking"
|
||||
+ ", COALESCE(res_artikel_default, 0) res_artikel_default"
|
||||
+ ", COALESCE((SELECT rra.res_rsv_artikel_prijs / rra.res_rsv_artikel_aantal"
|
||||
+ " FROM res_v_aanwezigrsv_artikel rra"
|
||||
+ " WHERE rra.res_artikel_key = ra.res_artikel_key"
|
||||
+ " AND rra.res_rsv_ruimte_key = " + rsv_ruimte_key + "), res_artikel_prijs) prijs" // prijs tijdens invullen, anders actuele prijs
|
||||
+ ", res_artikel_eenheid"
|
||||
+ ", COALESCE(res_artikel_prijs_vast,0) res_artikel_prijs_vast"
|
||||
+ " FROM res_v_aanwezigartikel ra"
|
||||
+ ", res_artikel_omschrijving"
|
||||
+ ", res_artikel_opmerking"
|
||||
+ ", COALESCE(res_artikel_default, 0) res_artikel_default"
|
||||
+ ", COALESCE((SELECT rra.res_rsv_artikel_prijs / rra.res_rsv_artikel_aantal"
|
||||
+ " FROM res_v_aanwezigrsv_artikel rra"
|
||||
+ " WHERE rra.res_artikel_key = ra.res_artikel_key"
|
||||
+ " AND rra.res_rsv_ruimte_key = " + rsv_ruimte_key + "), res_artikel_prijs) prijs" // prijs tijdens invullen, anders actuele prijs
|
||||
+ ", res_artikel_eenheid"
|
||||
+ ", COALESCE(res_artikel_prijs_vast,0) res_artikel_prijs_vast"
|
||||
+ " FROM res_v_aanwezigartikel ra"
|
||||
+ " WHERE res_discipline_key = " + discipline_key
|
||||
+ " ORDER BY res_artikel_volgnummer"
|
||||
+ ", res_artikel_omschrijving";
|
||||
+ ", res_artikel_omschrijving";
|
||||
oRs = Oracle.Execute( sql );
|
||||
|
||||
%>
|
||||
|
||||
<script type="text/javascript">
|
||||
<table cellspacing='0' id='table_dis<%=discipline_key%>'>
|
||||
<thead><tr><th><%=lcl_object%></th><th><%=lcl_count%></th>
|
||||
<% if (backo) { %>
|
||||
<th><%=lcl_r_price5%></th><th><%=lcl_r_price7%></th>
|
||||
<% } %>
|
||||
<th colspan='2'><%=lcl_time%></th></tr></thead>
|
||||
|
||||
<%
|
||||
var i = 0;
|
||||
while( !oRs.eof ) {
|
||||
var ch = res_van.getHours();
|
||||
var cm = res_van.getMinutes();
|
||||
var aantal = oRs("res_artikel_default")*res_vis;
|
||||
var cprice = oRs("prijs").Value;
|
||||
var cpricefix = oRs("res_artikel_prijs_vast").Value;
|
||||
var cstatus_reado = false;
|
||||
|
||||
str1 = oRs("res_artikel_omschrijving").Value;
|
||||
str2 = parseFloat(oRs("prijs").Value);
|
||||
str3 = oRs("res_artikel_eenheid").Value;
|
||||
|
||||
if( !isNaN(str2) ) {
|
||||
str1 = str1+' ('+currency_pref+num2curr(str2)+currency_suff+'/'+str3+')';
|
||||
}
|
||||
str1 = escape2(str1);
|
||||
|
||||
str = escape2(oRs("res_artikel_opmerking"));
|
||||
|
||||
if (str == "null") {
|
||||
str = "";
|
||||
}
|
||||
|
||||
str = replace( str , "\n" , "<br>" );
|
||||
str = replace( str , "\r" , "" );
|
||||
|
||||
str_d= oRs("res_artikel_default").Value;
|
||||
|
||||
str_pv = oRs("res_artikel_prijs_vast").Value;
|
||||
// Zoek of ons artikel al gereserveerd was: dan nemen we het oude tijdstip en aantal over
|
||||
var existing = false; // zodadelijk highlighten
|
||||
for(j=0;j<existing_res.length;j++)
|
||||
{
|
||||
if (existing_res[j].artikel_key == oRs("res_artikel_key").Value)
|
||||
{
|
||||
existing = true;
|
||||
ch = existing_res[j].rsv_artikel_levering.getHours();
|
||||
cm = existing_res[j].rsv_artikel_levering.getMinutes();
|
||||
aantal = existing_res[j].rsv_artikel_aantal;
|
||||
if (cpricefix==0) cprice = existing_res[j].prijs;
|
||||
if (existing_res[j].status_BO_key==6) cstatus_reado = true;
|
||||
}
|
||||
}
|
||||
ch = (ch<10?'0'+ch:ch);
|
||||
cm = (cm<10?'0'+cm:cm);
|
||||
|
||||
art_key = oRs("res_artikel_key").Value;
|
||||
%><tr onClick='javascript:HiliteRow(<%=art_key%>, <%=art_key%>)' id='row<%=art_key%>'
|
||||
<%=(existing?" class='selectable_em' ":" class='selectable' ")%>
|
||||
>
|
||||
<%
|
||||
// res_artikel_opmerking in popupje tonen
|
||||
// TODO: Wel of juist geen HTMLEncode er overheen? Als we het niet doet kunnen ze
|
||||
// heel fraaie 'previews' geven....
|
||||
var str = "";
|
||||
if (oRs("res_artikel_opmerking").Value)
|
||||
str = "<b>" + oRs("res_artikel_omschrijving").Value + ":</b><br>" + oRs("res_artikel_opmerking");
|
||||
|
||||
%><td OnMouseOver="$('#remark<%=art_key%>').show();"
|
||||
OnMouseOut="$('#remark<%=art_key%>').hide();">
|
||||
<%=oRs("res_artikel_omschrijving").Value%>
|
||||
<div class="res_remark" id="remark<%=art_key%>">
|
||||
<%=str%>
|
||||
</div>
|
||||
</td>
|
||||
<td>
|
||||
<input type=text id='inpb_c_<%=art_key%>'
|
||||
name='inpb_c_<%=art_key%>'
|
||||
value='<%=aantal%>'
|
||||
size='4'
|
||||
<%=(cstatus_reado?"readonly style='background-color: #dddddd;' ":"")%>
|
||||
<%=backo?"onblur='showTotPriceArt("+art_key+");'":""%>>
|
||||
</td>
|
||||
<%
|
||||
if (backo) // Voeg prijs en totaalprijs toe
|
||||
{ // Prijs
|
||||
%>
|
||||
ConsObjects[<%=i%>] = new ConsObj("<%=str1%>", <%=oRs("res_artikel_key")%>, "<%=str%>", <%=str_d%>, <%=hour1%>, <%=min1%>, <%=toJsNumber(str2)%>, <%=str_pv%>);
|
||||
<%
|
||||
<td>
|
||||
<input type=text
|
||||
id='inpbp_c_<%=art_key%>'
|
||||
name='inpbp_c_<%=art_key%>'
|
||||
value='<%=!isNaN(cprice)?num2curr(cprice):'0'%>'
|
||||
size='9'
|
||||
onblur='showTotPriceArt(<%=art_key%>);'
|
||||
style='text-align: right;'
|
||||
<%= (cpricefix==1||cstatus_reado?" readonly style='background-color: #dddddd;'":"") %>
|
||||
></td>
|
||||
|
||||
<td>
|
||||
<input type=text id='inpbtp_c_<%=art_key%>'
|
||||
style='text-align: right;'
|
||||
name='inpbtp_c_<%=art_key%>'
|
||||
value='<%=!isNaN(cprice*aantal)?num2curr(cprice*aantal):'0'%>'
|
||||
size='10'
|
||||
readonly style='background-color: #dddddd;'
|
||||
></td>
|
||||
<% } %>
|
||||
|
||||
<td>
|
||||
<input type=text id='inpbh1_c_<%=art_key%>'
|
||||
name='inpbh1_c_<%=art_key%>'
|
||||
value='<%=ch%>'
|
||||
maxlength='2' size='2'
|
||||
<%=(cstatus_reado?"readonly style='background-color: #dddddd;' ":"")%>
|
||||
></td>
|
||||
|
||||
|
||||
<td>
|
||||
<input type=text id='inpbm1_c_<%=art_key%>'
|
||||
name='inpbm1_c_<%=art_key%>'
|
||||
value='<%=cm%>'
|
||||
maxlength='2' size='2'
|
||||
<%=(cstatus_reado?"readonly style='background-color: #dddddd;' ":"")%>
|
||||
>
|
||||
</tr>
|
||||
<%
|
||||
oRs.MoveNext();
|
||||
i++;
|
||||
}
|
||||
oRs.close();
|
||||
}
|
||||
%>
|
||||
</script>
|
||||
</body>
|
||||
</table>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
$Revision: 1 $
|
||||
$Modtime: 14-09-09 12:27 $
|
||||
$Revision: 2 $
|
||||
$Modtime: 2-11-09 19:50 $
|
||||
*/
|
||||
// As in RES_STATUS_FO
|
||||
var fo_stat_opt=1
|
||||
@@ -8,120 +8,45 @@
|
||||
var fo_stat_blk=3
|
||||
var fo_stat_vvl=4
|
||||
|
||||
function ShowObjectRemark(txt)
|
||||
function loadtitle(target,dest)
|
||||
{
|
||||
if (parent.SetRemark) parent.SetRemark(txt,'');
|
||||
target.title = "..."; // Voorkom te snelle recall's
|
||||
$.get(dest, function (data) { target.title = data });
|
||||
}
|
||||
|
||||
function IsFree(ts, te, frm, key, stat_fo)
|
||||
var timerID=null;
|
||||
function delayed(delay, fn)
|
||||
{
|
||||
var ar = window.frames[frm].sched;
|
||||
ts_start = ts;
|
||||
te_start = te;
|
||||
if (timerID) clearTimeout(timerID);
|
||||
timerID = setTimeout(fn, delay);
|
||||
}
|
||||
|
||||
for (i=0; i<ar.length; i++)
|
||||
{
|
||||
ts = ts_start;
|
||||
te = te_start;
|
||||
if (stat_fo != fo_stat_blk) {
|
||||
ts-=ar[i].prepost_time;
|
||||
te+=ar[i].prepost_time;
|
||||
}
|
||||
h_start = ar[i].h_start
|
||||
h_end = ar[i].h_end
|
||||
if (ar[i].status_fo==fo_stat_blk) // Tegencorrectie bestaande blokkade schoonmaaktijd
|
||||
function setResRsvDeelTitle(elm, rsv_deel_key)
|
||||
{
|
||||
if (!elm.title)
|
||||
loadtitle(elm, "../res/ResRsvDeelTitle.asp?rsv_deel_key="+rsv_deel_key);
|
||||
}
|
||||
|
||||
function rsv_title(elm, rsv_ruimte_key)
|
||||
{
|
||||
if (!elm.title)
|
||||
{
|
||||
if (stat_fo != fo_stat_blk) {
|
||||
h_start += ar[i].prepost_time;
|
||||
h_end -= ar[i].prepost_time;
|
||||
}
|
||||
delayed(200, function () {
|
||||
loadtitle(elm, "../res/ResRsvTitle.asp?rsv_ruimte_key="+elm.rsv_key);
|
||||
});
|
||||
}
|
||||
if ( !(ts >= h_end || h_start >= te) && (!key || (key && key != ar[i].key)))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function UpdateRoomSchedule(id, frm, room_starttime, room_endtime)
|
||||
function setBezBezoekersTitle(elm, bez_bezoekers_key)
|
||||
{
|
||||
// ar bevat de reserveringen op de 'huidige' ruimte. Gesorteerd op tijd.
|
||||
// In geval van een koppelzaal kunnen er identieke records in zitten.
|
||||
var ar = window.frames[frm].sched;
|
||||
|
||||
ci = 0;
|
||||
cl = res_t1 + 0.0001;
|
||||
ys = 0;
|
||||
yf = 0;
|
||||
if ( ar.length ) {
|
||||
ys = ar[ci].h_start;
|
||||
yf = ar[ci].h_end;
|
||||
if (ar[ci].status_fo!=fo_stat_blk)
|
||||
{
|
||||
ys -= ar[ci].prepost_time;
|
||||
yf += ar[ci].prepost_time;
|
||||
}
|
||||
}
|
||||
var begin_res_intervals = 0;
|
||||
var eind_res_intervals = 0;
|
||||
if (room_starttime && res_t1 < room_starttime) begin_res_intervals = (room_starttime - res_t1) / res_h;
|
||||
if (room_endtime && res_t2 > room_endtime) eind_res_intervals = (res_t2 - room_endtime) / res_h;
|
||||
for (i=0; i<res_intervals; i++)
|
||||
{
|
||||
if (ci < ar.length && cl > ar[ci].h_start && cl < ar[ci].h_end)
|
||||
document.all.item(id).all.item("" + i).bgColor = ar[ci].status_fo==fo_stat_blk?res_color_blok:ar[ci].status_fo==fo_stat_vvl?res_color_verv:res_color_resv;
|
||||
else {
|
||||
if (begin_res_intervals > i || eind_res_intervals >= res_intervals - i) {
|
||||
document.all.item(id).all.item("" + i).bgColor = res_color_na;
|
||||
}
|
||||
else if( !( cl+res_h-0.0001<=ys || cl-0.0001>=yf ) ) {
|
||||
document.all.item(id).all.item("" + i).bgColor = res_color_techb;
|
||||
} else {
|
||||
document.all.item(id).all.item("" + i).bgColor = res_color_free;
|
||||
}
|
||||
if ( ci < ar.length && cl+res_h > yf ) {
|
||||
ys = ar[ci].h_start;
|
||||
yf = ar[ci].h_end;
|
||||
if (ar[ci].status_fo!=fo_stat_blk)
|
||||
{
|
||||
ys -= ar[ci].prepost_time;
|
||||
yf += ar[ci].prepost_time;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
cl += res_h;
|
||||
|
||||
while (ci < ar.length && cl > ar[ci].h_end)
|
||||
ci++;
|
||||
}
|
||||
document.all.item(id).style.visibility = "visible";
|
||||
if (!elm.title)
|
||||
loadtitle(elm, "../res/BezBezoekersTitle.asp?bez_bezoekers_key="+bez_bezoekers_key);
|
||||
}
|
||||
|
||||
function doCClick(rsv_ruimte_key, readwrite, obj_edit, res_deel, alg_ruimte)
|
||||
function rsv_click(elm,urole)
|
||||
{
|
||||
if( obj_edit && obj_edit == 1 ) {
|
||||
enableObjData(rsv_ruimte_key, readwrite, window.event.srcElement, res_deel, alg_ruimte);
|
||||
} else {
|
||||
cmd_file = "res_reservering.asp";
|
||||
cmd = "res_reservering.asp?&rsv_ruimte_key=" + rsv_ruimte_key
|
||||
+ (!frontend?'&fronto=':'') + (readwrite?'':'&reado=');
|
||||
|
||||
if( alg_ruimte!=null && alg_ruimte != -1 ) {
|
||||
cmd += "&restype=CV&alg_ruimte_key=" + alg_ruimte;
|
||||
}
|
||||
else
|
||||
cmd += "&restype=R";
|
||||
|
||||
if( window.c_year ) {
|
||||
cmd += "&yy=" + c_year + "&mm=" + c_month + "&dd=" + c_day;
|
||||
}
|
||||
|
||||
if( window.name != "workFrame" ) {
|
||||
parent.navigate(cmd);
|
||||
} else {
|
||||
navigate(cmd);
|
||||
}
|
||||
}
|
||||
var cmd = "appl/res/res_reservering.asp?rsv_ruimte_key=" + elm.rsv_key + "&urole="+urole;
|
||||
FcltMgr.openDetail(cmd);
|
||||
}
|
||||
|
||||
function noCClick(i)
|
||||
@@ -129,9 +54,44 @@ function noCClick(i)
|
||||
return;
|
||||
}
|
||||
|
||||
function room_table_click(hours, urole)
|
||||
{
|
||||
var ob = window.event.srcElement;
|
||||
if ($(ob).hasClass("plantd") && $(ob).hasClass("reserv"))
|
||||
{
|
||||
var theTR = $(window.event.srcElement).parent("TR");
|
||||
var res_ruimte_key = theTR[0].id;
|
||||
// TODO: hours meegeven icm. een datum
|
||||
var res_van = new Date();
|
||||
res_van.setHours(Math.floor(hours), Math.floor(60*(hours-Math.floor(hours))), 0, 0);
|
||||
var cmd = "appl/res/res_reservering.asp"
|
||||
+ "?res_ruimte_key=" + res_ruimte_key
|
||||
+ "&res_van=" + res_van.getTime()
|
||||
+ "&urole="+urole;
|
||||
FcltMgr.openDetail(cmd); // TODO: , LCL.shared.nieuw
|
||||
}
|
||||
}
|
||||
|
||||
function obj_table_click(hours, urole)
|
||||
{
|
||||
var ob = window.event.srcElement;
|
||||
if ($(ob).hasClass("plantd") && $(ob).hasClass("reserv"))
|
||||
{
|
||||
var theTR = $(window.event.srcElement).parent("TR");
|
||||
var res_deel_key = theTR[0].id;
|
||||
// TODO: hours meegeven icm. een datum
|
||||
var res_van = new Date();
|
||||
res_van.setHours(Math.floor(hours), Math.floor(60*(hours-Math.floor(hours))), 0, 0);
|
||||
var cmd = "appl/res/res_reservering.asp?restype=CV"
|
||||
+ "&res_deel_key=" + res_deel_key
|
||||
+ "&res_van=" + res_van.getTime()
|
||||
+ "&urole="+urole;
|
||||
FcltMgr.openDetail(cmd);
|
||||
}
|
||||
}
|
||||
|
||||
function doTClick(obj_edit)
|
||||
{
|
||||
|
||||
if( window.event.srcElement.onclick != null ) return;
|
||||
|
||||
var tName ="";
|
||||
@@ -217,80 +177,130 @@ function selectRoom(radio)
|
||||
FcltMgr.closeDetail(window, { res_ruimte_key: res_ruimte_key });
|
||||
}
|
||||
|
||||
function objTimeChanged(pres_deel_key, pduur, pid) {
|
||||
var ph1 = "inpbh1_" + pres_deel_key;
|
||||
var pm1 = "inpbm1_" + pres_deel_key;
|
||||
var ph2 = "inpbh2_" + pres_deel_key;
|
||||
var pm2 = "inpbm2_" + pres_deel_key;
|
||||
|
||||
var trid = "rdeel" + pres_deel_key; //fromID;
|
||||
var tr = document.all.item("tr_" + trid);
|
||||
var row = tr;
|
||||
var cell = row.cells[1];
|
||||
var im = cell.all.item("plus");
|
||||
if (im.style.visibility == "visible")
|
||||
{ // Object is aangvinkt
|
||||
// Indien ongeldige invoer dan focus behouden
|
||||
if (isNaN(parseInt(document.u2.item(ph1).value, 10))) {
|
||||
document.u2.item(ph1).select();
|
||||
return false;
|
||||
}
|
||||
if ((parseInt(document.u2.item(pm1).value, 10) >= 60) || (isNaN(parseInt(document.u2.item(pm1).value, 10)))) {
|
||||
document.u2.item(pm1).select();
|
||||
return false;
|
||||
}
|
||||
if (isNaN(parseInt(document.u2.item(ph2).value, 10))) {
|
||||
document.u2.item(ph2).select();
|
||||
return false;
|
||||
}
|
||||
if ((parseInt(document.u2.item(pm2).value, 10) >= 60) || (isNaN(parseInt(document.u2.item(pm2).value, 10)))) {
|
||||
document.u2.item(pm2).select();
|
||||
return false;
|
||||
}
|
||||
var ptime1 = parseInt(document.u2.item(ph1).value, 10) + parseInt(document.u2.item(pm1).value, 10)/60;
|
||||
var ptime2 = parseInt(document.u2.item(ph2).value, 10) + parseInt(document.u2.item(pm2).value, 10)/60;
|
||||
|
||||
if (pid == "inpbh1_" || pid == "inpbm1_") { // Begintijd is aangepast
|
||||
if (ptime1 < res_t1) {
|
||||
// De begintijd is kleiner dan de minimale waarde res_t1
|
||||
ptime1 = res_t1;
|
||||
ptime2 = ptime1 + pduur;
|
||||
if (ptime2 > res_t2)
|
||||
ptime2 = res_t2;
|
||||
} else if (ptime1 > res_t2) {
|
||||
// De begintijd is groter dan de maximale waarde res_t2
|
||||
ptime1 = res_t2;
|
||||
ptime2 = ptime1
|
||||
} else if (ptime1 > ptime2) {
|
||||
// De begintijd is groter dan de eindtijd (de begintijd is al gechecked op het overschrijden van de maximale tijd)
|
||||
ptime2 = ptime1 + pduur;
|
||||
if (ptime2 > res_t2)
|
||||
ptime2 = res_t2;
|
||||
} else {
|
||||
// begintijd is goed
|
||||
ptime2 = ptime1 + pduur;
|
||||
if (ptime2 > res_t2)
|
||||
ptime2 = res_t2;
|
||||
}
|
||||
} else { // eindtijd is aangepast
|
||||
if (ptime2 < res_t1) {
|
||||
// De eindtijd is kleiner dan de minimale waarde res_t1
|
||||
ptime1 = res_t1;
|
||||
ptime2 = ptime1;
|
||||
} else if (ptime2 > res_t2) {
|
||||
// De eindtijd is groter dan de maximale waarde res_t2
|
||||
ptime2 = res_t2;
|
||||
} else if (ptime2 < ptime1) {
|
||||
// De eindtijd is kleiner dan de begintijd (de eindtijd is al gechecked op het overschrijden van de minimale tijd)
|
||||
ptime1 = ptime2;
|
||||
} else {
|
||||
// eindtijd is goed dus niets aanpassen
|
||||
}
|
||||
}
|
||||
document.u2.item(ph1).value = (Math.floor(ptime1)<10 ? "0" + Math.floor(ptime1) : Math.floor(ptime1));
|
||||
document.u2.item(pm1).value = (60 * (ptime1 - Math.floor(ptime1)) < 10 ? "0" + Math.round(60 * (ptime1 - Math.floor(ptime1))) : Math.round(60 * (ptime1 - Math.floor(ptime1))));
|
||||
document.u2.item(ph2).value = (Math.floor(ptime2)<10 ? "0" + Math.floor(ptime2) : Math.floor(ptime2));
|
||||
document.u2.item(pm2).value = (60 * (ptime2 - Math.floor(ptime2)) < 10 ? "0" + Math.round(60 * (ptime2 - Math.floor(ptime2))) : Math.round(60 * (ptime2 - Math.floor(ptime2))));
|
||||
}
|
||||
return;
|
||||
function rConsObj(rRA, rA, rSA, rAan, rh1, rmin1, l_year, l_month, l_day, rpricefixed, rprice, rstatus)
|
||||
{
|
||||
this.resRsvArt = rRA;
|
||||
this.resArt = rA;
|
||||
this.resSrtArt = rSA;
|
||||
this.resAantal = rAan;
|
||||
this.rH1 = rh1;
|
||||
this.rMin1 = rmin1;
|
||||
this.year = l_year;
|
||||
this.month = l_month;
|
||||
this.day = l_day;
|
||||
this.pricefix = rpricefixed;
|
||||
this.price = rprice;
|
||||
this.status = rstatus;
|
||||
}
|
||||
|
||||
// Clientside version
|
||||
function replace(str,s1,s2) {
|
||||
var i,r,pos=0;
|
||||
if(str==null) str=''; else str=''+str;
|
||||
while( (i = str.indexOf(s1,pos)) >= 0 ) {
|
||||
l = str.length; r = '';
|
||||
if( i > 0 ) r = r + str.substring(0,i);
|
||||
r = r + s2;
|
||||
if( i < l-1 ) r = r + str.substring(i+s1.length,l);
|
||||
str=r; pos=i-s1.length+s2.length+1;
|
||||
}
|
||||
return str;
|
||||
}
|
||||
function escape_js(s) {
|
||||
return replace(replace(replace(replace(replace(s,"\\","/"),'"','"'),"'",'''), '\n', ' '), '\r', '');
|
||||
}
|
||||
|
||||
// Controleer of alle catering tijden wel binnen res_cat_t1 en res_cat_t2 vallen
|
||||
// Als dat niet zo is geef dan een melding en return false
|
||||
function checkConsTimes()
|
||||
{return true; // TODO
|
||||
for (var i=0; i<ConsObjects.length; i++)
|
||||
{
|
||||
var key = ConsObjects[i].key;
|
||||
var objCnt = document.getElementById("inpb_c_" + key); var Cnt = parseInt(objCnt.value,10);
|
||||
var objH = document.getElementById("inpbh1_c_" + key); var hh = parseInt(objH.value,10);
|
||||
var objM = document.getElementById("inpbm1_c_" + key); var mm = parseInt(objM.value,10);
|
||||
if (!isNaN(Cnt) && Cnt == 0)
|
||||
continue; // Niet over zeuren als het 0 is
|
||||
|
||||
if (isNaN(Cnt) || isNaN(hh) || isNaN(mm) ||
|
||||
(hh+(mm/60) < (res_cat_t1>=0?res_cat_t1:("" + starttime_room)) ) ||
|
||||
(hh+(mm/60) > (res_cat_t2>=0?res_cat_t2:("" + endtime_room)) ))
|
||||
{
|
||||
objCnt.parentElement.parentElement.parentElement.parentElement.style.display = 'block';
|
||||
FcltMgr.resized(window);
|
||||
objCnt.focus();
|
||||
alert(LCL.res.cons_time); // Niet beschikbaar op dit tijdstip
|
||||
return false;
|
||||
}
|
||||
var jsDate = res_van.midnight();
|
||||
jsDate.setHours(hh);
|
||||
jsDate.setMinutes(mm);
|
||||
if (jsDate < tCatExpire && !backo && !fronto) {
|
||||
alert(LCL.res.lastmin);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function ItemChoosed_obj(elm, fromID, disc_key)
|
||||
{
|
||||
$(elm).toggleClass("closed");
|
||||
var tabel = $("#table_dis" + disc_key);
|
||||
if (tabel.length)
|
||||
{
|
||||
FcltMgr.resized(window);
|
||||
return;
|
||||
}
|
||||
|
||||
params = "?rsv_ruimte_key="+rsv_ruimte_key+"&urole="+urole;
|
||||
params += "&sdisc="+disc_key;
|
||||
params += "&ch_obj_mode="+"1";// TODO ch_obj_mode;
|
||||
params += "&hour_px=" + hour_px;
|
||||
params += "&res_van=" + res_van.getTime();
|
||||
params += "&res_tot=" + res_tot.getTime();
|
||||
|
||||
$("#"+fromID).load("./res_load_plan_obj.asp" + params,
|
||||
function(txt) { FcltMgr.resized(window); }).show();
|
||||
}
|
||||
|
||||
function ItemChoosed_cat(elm, fromID, disc_key)
|
||||
{
|
||||
$(elm).toggleClass("closed");
|
||||
|
||||
var tabel = $("#table_dis" + disc_key);
|
||||
if (tabel.length)
|
||||
{
|
||||
FcltMgr.resized(window);
|
||||
return;
|
||||
}
|
||||
|
||||
params = "?discipline_key=" + disc_key
|
||||
+ "&rsv_ruimte_key="+rsv_ruimte_key;
|
||||
|
||||
$("#div_"+fromID).load("./res_load_cat.asp" + params,
|
||||
function(txt) { FcltMgr.resized(window); }).show();
|
||||
}
|
||||
|
||||
// onclick van een reserveerbaar deel regel (dan is de categorie al opengeklapt)
|
||||
//
|
||||
function res_deel_click(fromID, rdeel)
|
||||
{
|
||||
$("#" + rdeel).toggleClass("selected").toggleClass("unselected");
|
||||
}
|
||||
|
||||
function showTotPriceArt(number)
|
||||
{
|
||||
// show the total price of the selected artikel
|
||||
if (backo==1) {
|
||||
|
||||
var aant = document.forms.u2["inpb_c_"+number].value.replace(',','.');
|
||||
var pric = document.forms.u2["inpbp_c_"+number].value.replace(',','.');
|
||||
document.forms.u2["inpb_c_"+number].value = aant;
|
||||
document.forms.u2["inpbp_c_"+number].value = pric;
|
||||
document.forms.u2["inpbtp_c_"+number].value = num2curr(aant*pric);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<% /*
|
||||
$Revision: 1 $
|
||||
$Modtime: 25-09-09 10:13 $
|
||||
$Revision: 2 $
|
||||
$Modtime: 2-11-09 11:39 $
|
||||
*/ %>
|
||||
|
||||
<%
|
||||
@@ -8,199 +8,114 @@
|
||||
|
||||
frontend = Request.QueryString("frontend").Count>0;
|
||||
|
||||
var res_color_free = "#b0b0b0"; // Vrij: licht grijs
|
||||
var res_color_resv = "#990000"; // Definitief: rood
|
||||
var res_color_optie = "#31398C"; // Optie: blauw
|
||||
var res_color_techb = "#808080"; // Schoonmaak: donker grijs
|
||||
var res_color_blok = "#000000"; // Blokkade: zwart
|
||||
var res_color_verv = "#990099"; // Vervallen: paars
|
||||
var res_color_na = "#D6D80E"; // Niet beschikbaar: geel
|
||||
|
||||
|
||||
// As in RES_STATUS_FO
|
||||
var fo_stat_opt=1; // Optie
|
||||
var fo_stat_def=2; // Definitief
|
||||
var fo_stat_blk=3; // Blokkade
|
||||
var fo_stat_vvl=4; // Vervallen
|
||||
var fo_stat_na=9; // Niet beschikbaar
|
||||
|
||||
// Laat 20% over voor ruimteomschrijving e.d.
|
||||
// werkt niet goed: 1.99% wordt 1% met IE7 var t_w = (80 / res_intervals).toFixed(1)+"%";
|
||||
t_w = "16px"; // Maakt ze vierkant. Als het niet past wordt het vanzelf kleiner
|
||||
var ht_w = (5+400 / res_intervals).toFixed(1)+"%";
|
||||
ht_w = "20%";
|
||||
%>
|
||||
<style>
|
||||
tr.planbord td.other { width:<%=t_w%>; }
|
||||
tr.planbord td.free { width:<%=t_w%>; }
|
||||
tr.planbord td.freeH { width:<%=t_w%>; }
|
||||
tr.planbord td.header { width:<%=ht_w%>; }
|
||||
tr.planbord td.freeNC { width:<%=t_w%>; }
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
var res_color_free = "<%=res_color_free%>";
|
||||
var res_color_resv = "<%=res_color_resv%>";
|
||||
var res_color_optie = "<%=res_color_optie%>";
|
||||
var res_color_techb = "<%=res_color_techb%>";
|
||||
var res_color_blok = "<%=res_color_blok%>";
|
||||
var res_color_verv = "<%=res_color_verv%>";
|
||||
var res_color_na = "<%=res_color_na%>";
|
||||
|
||||
res_t1 = <% = " " + res_t1 %>;
|
||||
res_t2 = <% = " " + res_t2 %>;
|
||||
res_h = <% = " " + res_h %>;
|
||||
res_intervals = <% = res_intervals %>;
|
||||
var frontend = 1==<%=frontend?1:0%>;
|
||||
</script>
|
||||
|
||||
<%
|
||||
function h_seg( van, tot, p_name, rsv_ruimte_key, fo_status, na_status, host_key, user_key, contact_key ) {
|
||||
this.h_start = van.getHours() + van.getMinutes()/60;
|
||||
this.h_end = tot.getHours() + tot.getMinutes()/60;
|
||||
this.p_name = p_name;
|
||||
this.rsv_ruimte_key = rsv_ruimte_key;
|
||||
this.fo_status = fo_status;
|
||||
this.na_status = na_status;
|
||||
this.host_key = host_key;
|
||||
this.user_key = user_key;
|
||||
this.contact_key = contact_key;
|
||||
}
|
||||
|
||||
var res = new Array();
|
||||
|
||||
// multi: Gebruik voor planbord (meerdere regels)
|
||||
// !multi: Gebruik voor ene regeltje onderaan een ruimtereservering
|
||||
function CreateRoomSchedule(id,multi,date1,date2,readwrite,loc,opstel,ruimtecat)
|
||||
{
|
||||
if (multi)
|
||||
CreateRoomScheduleMulti({ id: id, date1: date1, date2: date2,
|
||||
readwrite: readwrite, loc: loc,
|
||||
opstel: opstel,ruimtecat:ruimtecat});
|
||||
else
|
||||
CreateRoomScheduleSingle(id);
|
||||
}
|
||||
var existing_res = new Array();
|
||||
|
||||
function CreateRoomScheduleMulti(params)
|
||||
{
|
||||
__Log("Entering CreateRoomScheduleMulti with id=" + params.id + " and readwrite=" + params.readwrite);
|
||||
var sql, Autfunction;
|
||||
|
||||
params.hour_px = params.hour_px || 48;
|
||||
var res_h_px = params.hour_px * res_h;
|
||||
|
||||
var authparams = user.checkAutorisation(params.autfunction);
|
||||
|
||||
// Determine all existing reservations and store them in an array 'res'
|
||||
if (params.rsv_ruimte_key>0) // single-reservering mode
|
||||
{
|
||||
var sql = "select res_reservering_key, "
|
||||
+ " rrr.res_rsv_ruimte_van, "
|
||||
+ " rrr.res_rsv_ruimte_tot, "
|
||||
+ " res_rsv_ruimte_volgnr "
|
||||
+ " from res_rsv_ruimte rrr"
|
||||
+ " where res_rsv_ruimte_key = " + params.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_tot : new Date(oRs("res_rsv_ruimte_tot").value),
|
||||
rsv_ruimte_volgnr : oRs("res_rsv_ruimte_volgnr").value
|
||||
}
|
||||
oRs.Close();
|
||||
}
|
||||
|
||||
// Determine all existing reservations and store them in an array 'existing_res'
|
||||
sql = "select distinct "
|
||||
+ "rv.RES_RSV_RUIMTE_VAN,"
|
||||
+ "rv.RES_RSV_RUIMTE_TOT"
|
||||
+ ", res_ruimte_key_1, to_char(r.res_reservering_key)||'/'||TO_CHAR(rv.res_rsv_ruimte_volgnr)||"
|
||||
+ "': '||rv.res_rsv_ruimte_omschrijving||"
|
||||
+ "' - '||p.PRS_PERSLID_NAAM||"
|
||||
+ "' ('||rv.RES_RSV_RUIMTE_TELEFOON||')'"
|
||||
+ "||' - '||rv.res_rsv_ruimte_bezoekers||' pers' tooltip"
|
||||
+ ", rv.res_status_fo_key, r.RES_RESERVERING_key, rv.res_rsv_ruimte_key, res_ruimte_key_2 "
|
||||
+ ", rv.res_rsv_ruimte_host_key "
|
||||
+ ", r.res_reservering_user_key, rv.res_rsv_ruimte_contact_key "
|
||||
+ " from RES_v_aanwezigRESERVERING r, PRS_PERSLID p,"
|
||||
+ " RES_V_AANWEZIGRSV_RUIMTE rv, RES_RUIMTE_OPSTELLING ro,"
|
||||
+ ((params.loc !=-1)?" alg_ruimte ar, alg_verdieping av, alg_gebouw ag, ":"") // als bld!=-1 dan is zeker loc!=-1
|
||||
// Koppelzalen meenemen want daardoor kunnen we ook bezet raken
|
||||
+ " ( SELECT DISTINCT r1.res_ruimte_key res_ruimte_key_1, r2.res_ruimte_key res_ruimte_key_2, r2.alg_ruimte_key "
|
||||
+ " FROM res_alg_ruimte r1, res_alg_ruimte r2 "
|
||||
+ " WHERE r1.alg_ruimte_key = r2.alg_ruimte_key"
|
||||
+ " AND r1.res_alg_ruimte_verwijder IS NULL"
|
||||
+ " AND r2.res_alg_ruimte_verwijder IS NULL"
|
||||
+ " ) X"
|
||||
+ " where rv.RES_RSV_RUIMTE_VAN between " + params.date1.toSQL() + " and " + params.date2.endToSQL()
|
||||
+ " and rv.RES_RESERVERING_KEY = r.RES_RESERVERING_KEY"
|
||||
+ " and rv.res_ruimte_opstel_key = ro.res_ruimte_opstel_key"
|
||||
+ " and p.PRS_PERSLID_KEY=rv.RES_RSV_RUIMTE_CONTACT_KEY"
|
||||
+ " and X.res_ruimte_key_2 = ro.res_ruimte_key"
|
||||
+ ((params.loc !=-1)?" and x.alg_ruimte_key = ar.alg_ruimte_key and ar.alg_verdieping_key = av.alg_verdieping_key and av.alg_gebouw_key = ag.alg_gebouw_key and ag.alg_locatie_key = "+params.loc:"")
|
||||
+ ((params.bld !=-1)?" and ag.alg_gebouw_key = " + params.bld:"")
|
||||
+ ((params.res_ruimte_key&&!params.showall)?" and res_ruimte_key_1="+ params.res_ruimte_key:"");
|
||||
+ " rv.RES_RSV_RUIMTE_VAN,"
|
||||
+ " rv.RES_RSV_RUIMTE_TOT,"
|
||||
+ " rv.res_rsv_ruimte_dirtlevel"
|
||||
+ " , res_ruimte_key_1"
|
||||
+ " , rv.res_status_fo_key, r.RES_RESERVERING_key, rv.res_rsv_ruimte_key, res_ruimte_key_2 "
|
||||
+ " , rv.res_rsv_ruimte_host_key "
|
||||
+ " , r.res_reservering_user_key, rv.res_rsv_ruimte_contact_key "
|
||||
+ " from RES_v_aanwezigRESERVERING r, PRS_PERSLID p,"
|
||||
+ " RES_V_AANWEZIGRSV_RUIMTE rv, RES_RUIMTE_OPSTELLING ro,"
|
||||
+ ( (params.loc !=-1)?" alg_ruimte ar, alg_verdieping av, alg_gebouw ag, ":"") // als bld!=-1 dan is zeker loc!=-1
|
||||
// ///////Koppelzalen meenemen want daardoor kunnen we ook bezet raken
|
||||
+ " ( SELECT DISTINCT r1.res_ruimte_key res_ruimte_key_1, r2.res_ruimte_key res_ruimte_key_2, r2.alg_ruimte_key "
|
||||
+ " FROM res_alg_ruimte r1, res_alg_ruimte r2 "
|
||||
+ " WHERE r1.alg_ruimte_key = r2.alg_ruimte_key"
|
||||
+ " AND r1.res_alg_ruimte_verwijder IS NULL"
|
||||
+ " AND r2.res_alg_ruimte_verwijder IS NULL"
|
||||
+ " ) X"
|
||||
+ " where rv.RES_RSV_RUIMTE_VAN between " + params.res_van.toSQL() + " and " + params.res_tot.endToSQL()
|
||||
+ " and rv.RES_RESERVERING_KEY = r.RES_RESERVERING_KEY"
|
||||
+ " and rv.res_ruimte_opstel_key = ro.res_ruimte_opstel_key"
|
||||
+ " and p.PRS_PERSLID_KEY=rv.RES_RSV_RUIMTE_CONTACT_KEY"
|
||||
+ " and X.res_ruimte_key_2 = ro.res_ruimte_key"
|
||||
+ ((params.loc !=-1)?" and x.alg_ruimte_key = ar.alg_ruimte_key and ar.alg_verdieping_key = av.alg_verdieping_key and av.alg_gebouw_key = ag.alg_gebouw_key and ag.alg_locatie_key = "+params.loc:"")
|
||||
+ ((params.bld !=-1)?" and ag.alg_gebouw_key = " + params.bld:"")
|
||||
+ ((params.res_ruimte_key&&!params.showall)?" and res_ruimte_key_1="+ params.res_ruimte_key:"");
|
||||
|
||||
oRs = Oracle.Execute(sql);
|
||||
while( !oRs.eof ) {
|
||||
var res_ruimte_key = oRs("res_ruimte_key_1").Value;
|
||||
if( ! res[res_ruimte_key] ) res[res_ruimte_key]=new Array();
|
||||
if( ! existing_res[res_ruimte_key] ) existing_res[res_ruimte_key]=new Array();
|
||||
|
||||
//function h_seg( van, tot, p_name, rsv_ruimte_key, fo_status, na_status, prepost_time, host_key, user_key, contact_key ) {
|
||||
|
||||
res[res_ruimte_key].push(new h_seg(
|
||||
new Date(oRs("res_rsv_ruimte_van").Value),
|
||||
new Date(oRs("res_rsv_ruimte_tot").Value),
|
||||
oRs("tooltip").Value, oRs("res_rsv_ruimte_key").Value, oRs("res_status_fo_key").Value,
|
||||
(oRs("res_ruimte_key_1").Value==oRs("res_ruimte_key_2").Value)?0:1,
|
||||
oRs("res_rsv_ruimte_host_key").Value,
|
||||
oRs("res_reservering_user_key").Value,
|
||||
oRs("res_rsv_ruimte_contact_key").Value));
|
||||
existing_res[res_ruimte_key].push({ res_van: new Date(oRs("res_rsv_ruimte_van").Value),
|
||||
res_tot: new Date(oRs("res_rsv_ruimte_tot").Value),
|
||||
rsv_ruimte_key : oRs("res_rsv_ruimte_key").Value,
|
||||
fo_status : oRs("res_status_fo_key").Value,
|
||||
na_koppel : (oRs("res_ruimte_key_1").Value==oRs("res_ruimte_key_2").Value)?0:1,
|
||||
host_key : oRs("res_rsv_ruimte_host_key").Value,
|
||||
user_key : oRs("res_reservering_user_key").Value,
|
||||
contact_key : oRs("res_rsv_ruimte_contact_key").Value,
|
||||
dirtlevel : oRs("res_rsv_ruimte_dirtlevel").Value
|
||||
});
|
||||
oRs.MoveNext();
|
||||
}
|
||||
oRs.close();
|
||||
|
||||
var nr_days = 1+(params.res_tot.midnight() - params.res_van.midnight())/24/60/60/1000;
|
||||
|
||||
var onclick = "";
|
||||
if (params.readwrite>2&&authparams.ALGwritelevel<9&&!params.jumped)
|
||||
onclick = "onclick=room_table_click(parseInt(window.event.offsetX)/"+params.hour_px+"+"+res_t1+",'"+urole+"')";
|
||||
%>
|
||||
|
||||
<table id="<%=params.id%>" border="0" cellspacing="0" cellpadding="0"
|
||||
<%=(params.readwrite>2&&authparams.ALGwritelevel<9&&!params.jumped)?'onClick="doTClick()"':''%>
|
||||
<table id="<%=params.id%>" cellspacing="0"
|
||||
class="planbord planbord<%=params.hour_px%>"
|
||||
<%=onclick%>
|
||||
>
|
||||
|
||||
<tr>
|
||||
<td><b><%=lcl_show_rooms%></b></td>
|
||||
<td align='right'><b><%=lcl_res_roomcap%></b></td>
|
||||
|
||||
<%
|
||||
var showOnlyOddHours = ((res_t2 - res_t1) >= res_roomplan_skiplimit)
|
||||
var mod_t1 = (res_t1 % (showOnlyOddHours?2:1)); // bepaal restwaarde
|
||||
if (mod_t1 == 0) mod_t1 = (showOnlyOddHours?2:1); // als even dan restwaarde is 1 of 2
|
||||
s0 = res_t1 - (mod_t1);
|
||||
|
||||
//s0 = res_t1 - 1;
|
||||
s = res_t1;
|
||||
i0 = -2;
|
||||
m ="";
|
||||
for (i=0; i<=res_intervals; i++)
|
||||
{
|
||||
if (s - s0 >= (showOnlyOddHours?2:1)) // Elke 1 of 2 uur de tijd weergeven
|
||||
{
|
||||
h = Math.floor(s);
|
||||
if (h < 10) h = "0" + h;
|
||||
%>
|
||||
|
||||
<td colspan="<%=(i-i0)%>" align="right" class=header>
|
||||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" class="room_sched_cap"><%=m%></td>
|
||||
<td align="right" class="room_sched_cap"><%=h%></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<%
|
||||
m = Math.floor((s - h)*60);
|
||||
if (m < 10) m = "0" + m;
|
||||
i0 = i;
|
||||
s0 = s;
|
||||
}
|
||||
s += res_h;
|
||||
}
|
||||
%>
|
||||
<td colspan="2" width=<%=t_w%> class="room_sched_cap"><%=m%></td></tr>
|
||||
|
||||
<%//// Extra regel met losse cellen om afmetingen te forceren%>
|
||||
<tr>
|
||||
<td colspan=5></td>
|
||||
<%
|
||||
for (i=0; i<=res_intervals+5; i++) {
|
||||
%><td width=<%=t_w%>></td><%
|
||||
}
|
||||
%>
|
||||
<td></td></tr>
|
||||
|
||||
<tr><td><label><%=lcl_show_rooms%></label></td>
|
||||
<td align='right' class="capaciteit"><label><%=lcl_res_roomcap%></label></td>
|
||||
<% res.emit_planbord_tijdbalk(params.res_van, nr_days, params.hour_px); %>
|
||||
</tr>
|
||||
<%
|
||||
// Iterate through all reservable rooms (vertically) and show schedule for them (horizontally)
|
||||
var n=0,room_id,free,p_name,rsv_ruimte_key;
|
||||
var n=0,res_ruimte_key,free,rsv_ruimte_key;
|
||||
|
||||
// PF: dit stond uitgecommentarieerd, maar de view fac_v_my_res_ruimte_read2 bestaat niet (meer?)
|
||||
// En door dit te doen werkte het weer, Was waarschijnlijk nog TODO?
|
||||
var fac_v_my_res_ruimte_read2 =
|
||||
"SELECT rr.res_ruimte_key,"
|
||||
"SELECT rr.res_ruimte_key,"
|
||||
+" fr.prs_perslid_key,"
|
||||
+" g.fac_functie_key,"
|
||||
+" rr.res_ruimte_begintijd,"
|
||||
@@ -230,8 +145,8 @@ __Log("Entering CreateRoomScheduleMulti with id=" + params.id + " and readwrite=
|
||||
+ " bmax, "
|
||||
+ " rg.res_ruimte_nr, alg_locatie_omschrijving, "
|
||||
+ " alg_locatie_code,"
|
||||
+ " COALESCE(fr.res_ruimte_begintijd, " + res_t1 + ") begintijd,"
|
||||
+ " COALESCE(fr.res_ruimte_eindtijd, " + res_t2 + ") eindtijd,"
|
||||
+ " fr.res_ruimte_begintijd,"
|
||||
+ " fr.res_ruimte_eindtijd,"
|
||||
+ " res_disc_params_preposttime"
|
||||
+ " FROM alg_locatie l, opstel_bez, "
|
||||
+ ((authparams.ALGreadlevel > -1) ? "("+fac_v_my_res_ruimte_read2+") fr, ":"res_ruimte fr, fac_v_webgebruiker md, ")
|
||||
@@ -252,13 +167,13 @@ __Log("Entering CreateRoomScheduleMulti with id=" + params.id + " and readwrite=
|
||||
+ ((params.opstel!=-1)?" and fr.res_ruimte_key = ro.res_ruimte_key and ro.res_opstelling_key = "+params.opstel:"")
|
||||
+ ((params.loc !=-1)?" and l.alg_locatie_key = " + params.loc:"")
|
||||
+ ((params.bld !=-1)?" and rg.alg_gebouw_key = " + params.bld:"")
|
||||
+ ((params.ruimtecat!=-1)?" and rg.res_discipline_key="+params.ruimtecat:"")
|
||||
+ ((params.ruimtecat!=-1)?" and rg.res_discipline_key IN ("+params.ruimtecat+")":"")
|
||||
+ ((params.res_ruimte_key&&!params.showall)?"and fr.res_ruimte_key="+ params.res_ruimte_key:"")
|
||||
+ ((params.vis)?" and bmax >= " + params.vis:"")
|
||||
+ ((params.activiteit_key)?" and exists (select res_activiteit_key from res_activiteitdiscipline rad"
|
||||
+ " where rad.res_discipline_key = rg.res_discipline_key"
|
||||
+ " and rad.res_activiteit_key = " + params.activiteit_key +")":"")
|
||||
+ " ORDER BY res_ruimte_nr, alg_locatie_omschrijving"; // res_ruimte_nr zou nu al genoeg zijn
|
||||
+ " ORDER BY "+(params.showall?" bmin,":"")+"res_ruimte_nr, alg_locatie_omschrijving"; // res_ruimte_nr zou nu al genoeg zijn
|
||||
|
||||
// Extra wrapper omdat ADO anders komt met 'Operation not allowed when object is closed'
|
||||
// Blijkbaar snapt die de WITH constructie vooraan niet zo
|
||||
@@ -266,186 +181,196 @@ __Log("Entering CreateRoomScheduleMulti with id=" + params.id + " and readwrite=
|
||||
|
||||
oRs = Oracle.Execute(sql);
|
||||
|
||||
var any_nofit = false;
|
||||
while( !oRs.eof ) {
|
||||
|
||||
room_id = oRs("res_ruimte_key").Value;
|
||||
desc = oRs("res_ruimte_nr").Value;
|
||||
res_ruimte_key = oRs("res_ruimte_key").Value;
|
||||
res_ruimte_nr = oRs("res_ruimte_nr").Value;
|
||||
bMin = oRs("bMin").Value;
|
||||
bMax = oRs("bMax").Value;
|
||||
capc = ''+bMin+((bMin!=bMax)?"-"+bMax:"")+" pers."
|
||||
var prepost_time = oRs("res_disc_params_preposttime").Value;
|
||||
|
||||
var begintijd = oRs("begintijd").Value;
|
||||
var eindtijd = oRs("eindtijd").Value;
|
||||
var begintijd = oRs("res_ruimte_begintijd").Value||res_t1;
|
||||
var eindtijd = oRs("res_ruimte_eindtijd").Value||res_t2;
|
||||
if (begintijd < res_t1) begintijd = res_t1;
|
||||
if (eindtijd > res_t2) eindtijd = res_t2;
|
||||
if (begintijd > eindtijd) begintijd = eindtijd;
|
||||
|
||||
var ar = existing_res[res_ruimte_key];
|
||||
var is_selected = false;
|
||||
if (params.rsv_ruimte_key > 0)
|
||||
{
|
||||
for (ci=0; ar != null && ci<ar.length; ci++)
|
||||
{
|
||||
if (ar[ci].rsv_ruimte_key == params.rsv_ruimte_key)
|
||||
{ // we zijn het zelf
|
||||
is_selected = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rrr.rsv_ruimte_van < ar[ci].res_tot && rrr.rsv_ruimte_tot > ar[ci].res_van)
|
||||
is_nofit = true; // Overlap!
|
||||
}
|
||||
}
|
||||
any_nofit |= is_nofit;
|
||||
}
|
||||
|
||||
|
||||
%>
|
||||
<tr class='planbord<%=(params.showall&¶ms.res_ruimte_key==room_id?" selected":"")%>' id='<%=room_id%>' height=15>
|
||||
<tr class='<%=(params.showall&¶ms.res_ruimte_key==res_ruimte_key?" selected":"")%><%=is_nofit?" res_nofit":""%>' id='<%=res_ruimte_key%>'>
|
||||
<td title="<%=oRs("alg_locatie_omschrijving").value%>">
|
||||
<nobr>
|
||||
<%
|
||||
if (params.showall)
|
||||
Response.Write("<INPUT type=radio name=radioroom onClick='selectRoom(this);'" + (params.res_ruimte_key==room_id?" CHECKED":"") + ">");
|
||||
Response.Write("<INPUT type=radio name=radioroom onClick='selectRoom(this);'" + (params.res_ruimte_key==res_ruimte_key?" CHECKED":"") + ">");
|
||||
%>
|
||||
<%=desc%></nobr>
|
||||
<label><%=res_ruimte_nr%><label></nobr>
|
||||
</td>
|
||||
<td align='right'><nobr><%=capc%></nobr></td>
|
||||
<td width='65'> </td>
|
||||
<td class="capaciteit"><nobr><%=capc%></nobr></td>
|
||||
|
||||
<td width="1"></td>
|
||||
<%
|
||||
var cl = res_t1;
|
||||
var ar = res[room_id];
|
||||
|
||||
var begin_res_intervals = 0;
|
||||
var eind_res_intervals = 0;
|
||||
if (cl < begintijd) begin_res_intervals = (begintijd - cl) / res_h;
|
||||
if (res_t2 > eindtijd) eind_res_intervals = (res_t2 - eindtijd) / res_h;
|
||||
builder="";
|
||||
for (i = 0; i < res_intervals; i++)
|
||||
var begintijd_mask = null;
|
||||
var eindtijd_mask = null;
|
||||
if (begintijd > res_t1)
|
||||
begintijd_mask = "<div class='begintijd' style='width:"+((begintijd-res_t1)*hour_px)+"px'> </div>";
|
||||
if (eindtijd < res_t2)
|
||||
{
|
||||
theSpan = "";
|
||||
free = true; fo_status=-1; blokkade=false; yellow=false; cleaning=false;
|
||||
if (ar) { // is er *iets* gereserveerd in onze ruimte
|
||||
var spanBlk = 1; // Buiten de loop: Bij een koppelzaal 'niet beschikbaar' tellen we meerdere ar's op
|
||||
for (ci=0; ci<ar.length; ci++) {
|
||||
if (cl+res_h>ar[ci].h_start && cl<ar[ci].h_end)
|
||||
{
|
||||
// if we filter on host key we do not want to show the other reservations
|
||||
// where our host is not the host.
|
||||
// UWVA#258: Only own reservations can be edited if argument only_user_res is true
|
||||
free = false; // Binnen reservering dus niet vrij
|
||||
if ((params.host != -1 && params.host != ar[ci].host_key) ||
|
||||
(requestor != -1 && requestor != ar[ci].contact_key) ||
|
||||
(ar[ci].user_key != user_key && ar[ci].contact_key != user_key && only_user_res))
|
||||
{
|
||||
yellow=true; // FE en niet een eigen reservering
|
||||
}
|
||||
p_name = ar[ci].p_name;
|
||||
rsv_ruimte_key = ar[ci].rsv_ruimte_key;
|
||||
fo_status = ar[ci].fo_status;
|
||||
if (ar[ci].na_status == 1) fo_status = fo_stat_na;
|
||||
var start_px = (eindtijd - res_t1) * hour_px+1;
|
||||
var width_px = (res_t2 - eindtijd) * hour_px;
|
||||
eindtijd_mask = "<div class='eindtijd' style='left:"+start_px+"px;width:"+width_px+"px'> </div>";
|
||||
}
|
||||
var is_nofit = false; // zouden we hier passen?
|
||||
|
||||
// Over hoeveel blokjes spant deze reservering
|
||||
while (cl + res_h < ar[ci].h_end && cl + res_h < res_t2)
|
||||
{
|
||||
spanBlk ++;
|
||||
cl += res_h;
|
||||
i++;
|
||||
}
|
||||
if (spanBlk == 1)
|
||||
theSpan = "";
|
||||
else
|
||||
{
|
||||
theSpan = " colspan=" + spanBlk;
|
||||
}
|
||||
}
|
||||
// Perhaps cleaning time
|
||||
if (ar[ci].fo_status != fo_stat_blk &&
|
||||
// For the time being 'blokkade' includes pre/post time
|
||||
cl+res_h>ar[ci].h_start-prepost_time && cl<ar[ci].h_end+prepost_time)
|
||||
{
|
||||
if ((cl < ar[ci].h_start && ar[ci].h_start - prepost_time <= cl) ||
|
||||
(cl < ar[ci].h_end + 1 && ar[ci].h_end <= cl)) {
|
||||
cleaning=true; // schoonmaaktijd voor of na een reservering
|
||||
}
|
||||
}
|
||||
for (dagen=0; dagen<nr_days; dagen++)
|
||||
{
|
||||
%>
|
||||
<td class="plantd reserv"><%=begintijd_mask?begintijd_mask:""%><%=eindtijd_mask?eindtijd_mask:""%>
|
||||
<%
|
||||
for (ci=0; ar && ci<ar.length; ci++) {
|
||||
free = true; fo_status=-1; blokkade=false; not_available=false;
|
||||
|
||||
// if we filter on host key we do not want to show the other reservations
|
||||
// where our host is not the host.
|
||||
// UWVA#258: Only own reservations can be edited if argument only_user_res is true
|
||||
if ((params.host != -1 && params.host != ar[ci].host_key) ||
|
||||
(requestor != -1 && requestor != ar[ci].contact_key) ||
|
||||
(ar[ci].user_key != user_key && ar[ci].contact_key != user_key && only_user_res))
|
||||
{
|
||||
not_available=true; // FE en niet een eigen reservering
|
||||
}
|
||||
cl += res_h;
|
||||
while( ci < ar.length && cl > ar[ci].h_end ) ci++;
|
||||
}
|
||||
|
||||
var before_starttime = false;
|
||||
if (free && (begin_res_intervals > i || eind_res_intervals >= res_intervals - i)) {
|
||||
yellow = true;
|
||||
free = false;
|
||||
before_starttime = true;
|
||||
}
|
||||
|
||||
th = Math.floor(res_t1 + res_h * i);
|
||||
tm = Math.floor((res_t1 + res_h * i - th) * 60);
|
||||
sTime = ''+th+":"+(tm<10?'0':'')+tm
|
||||
rsv_ruimte_key = ar[ci].rsv_ruimte_key;
|
||||
fo_status = ar[ci].fo_status;
|
||||
|
||||
canClick = false;
|
||||
clickHTML = '';
|
||||
bgHTML = '';
|
||||
|
||||
if (yellow || fo_status == fo_stat_na)
|
||||
if (not_available || ar[ci].na_koppel == 1)
|
||||
canClick = false;
|
||||
else if ((params.readwrite>2 || (params.readwrite==2 && !free)) && authparams.ALGwritelevel<9)
|
||||
else if ((params.readwrite>2 || (params.readwrite==2)) && authparams.ALGwritelevel<9)
|
||||
canClick = true;
|
||||
|
||||
bgColor = (free
|
||||
? cleaning // Vrij: schoonmaak of echt vrij
|
||||
? res_color_techb // Schoonmaak (donker grijs)
|
||||
: res_color_free // Vrij (licht grijs)
|
||||
: yellow // Niet vrij: niet beschikbaar, optie, blokkering, vervallen, definitief
|
||||
? res_color_na // Niet beschikbaar (geel)
|
||||
: fo_status==fo_stat_na
|
||||
? res_color_na // Niet beschikbaar (geel)
|
||||
: fo_status==fo_stat_opt
|
||||
? res_color_optie // Optie (blauw)
|
||||
: fo_status==fo_stat_blk
|
||||
? res_color_blok // Blokkade (zwart)
|
||||
: fo_status==fo_stat_vvl
|
||||
? res_color_verv // Vervallen (paars)
|
||||
: res_color_resv) // Definitief (rood)
|
||||
if (not_available || ar[ci].na_koppel == 1)
|
||||
statClass = "res_nietvrij";
|
||||
else
|
||||
statClass = { 1 : "res_optie",
|
||||
2 : "res_definitief",
|
||||
3 : "res_blok",
|
||||
4 : "res_vervallen"}[ar[ci].fo_status];
|
||||
|
||||
bgHTML = ' class=other bgcolor="'+ bgColor +'"';
|
||||
if (bgColor == res_color_free)
|
||||
if (ar[ci].rsv_ruimte_key == params.rsv_ruimte_key)
|
||||
statClass += " res_current";
|
||||
|
||||
theClass = statClass + " gepland";
|
||||
|
||||
if (ar[ci].dirtlevel & res.dirtlevel.ruimte.notavailable)
|
||||
theClass += " res_fatal";
|
||||
|
||||
var h_start = (ar[ci].res_van - params.res_van.midnight()) /1000/60/60 - 24*dagen;
|
||||
var h_end = (ar[ci].res_tot - params.res_tot.midnight()) /1000/60/60 + 24*(nr_days-1-dagen);
|
||||
if (h_start>24 || h_end < 0)
|
||||
continue;
|
||||
|
||||
px_end = (h_end-res_t1)*params.hour_px - 0;
|
||||
if (h_start<res_t1)
|
||||
{
|
||||
bgHTML = " ";
|
||||
if (canClick)
|
||||
{ // Vrij blokjes doen we heel efficient
|
||||
// (mod_t1/res_h) is verschil in begin t.o.v. hele uren.
|
||||
if ((i+1+(mod_t1/res_h))%(1/res_h)==0)
|
||||
clickHTML = " class=freeH"; // Uurblokje heeft twee pixels
|
||||
else
|
||||
clickHTML = " class=free";
|
||||
h_start = res_t1 - res_h;
|
||||
if (dagen > 0)
|
||||
theClass += " continueleft";
|
||||
else
|
||||
theClass += " overflowleft";
|
||||
}
|
||||
px_start = (h_start-res_t1)*params.hour_px;
|
||||
|
||||
var contright = false;
|
||||
if (h_end>res_t2)
|
||||
{
|
||||
h_end = res_t2 + res_h;
|
||||
if (dagen < nr_days-1)
|
||||
{
|
||||
theClass += " continueright";
|
||||
contright = true;
|
||||
}
|
||||
else
|
||||
clickHTML = " class=freeNC"; // Bij print functie
|
||||
theClass += " overflowright";
|
||||
}
|
||||
else if (before_starttime) {
|
||||
if ((i+1+(mod_t1/res_h))%(1/res_h)==0)
|
||||
bgHTML = ' class=otherH bgcolor="'+ bgColor +'"';
|
||||
px_end = (h_end-res_t1)*params.hour_px;
|
||||
|
||||
px_width = px_end - px_start;
|
||||
|
||||
// Perhaps cleaning time, alleen optie en definitief
|
||||
if (prepost_time > 0 && ar[ci].fo_status == 1 || ar[ci].fo_status == 2)
|
||||
{
|
||||
theClass += " res_cleaning";
|
||||
if (px_start >= 0)
|
||||
{
|
||||
px_start -= res_h_px-1; // border is 1px minder
|
||||
px_width += 1; // border is 1px minder
|
||||
}
|
||||
}
|
||||
else if (canClick)
|
||||
|
||||
if (canClick)
|
||||
clickHTML = ' style="cursor:hand" '
|
||||
|
||||
if (free&¶ms.readwrite>0&&!yellow)
|
||||
bgHTML += 'title='+sTime;
|
||||
else if (fo_status!=fo_stat_na)
|
||||
//if (free&¶ms.readwrite>0&&!not_available)
|
||||
// TODO bgHTML += 'title='+sTime;
|
||||
onclick = "";
|
||||
theMouse = "";
|
||||
if (ar[ci].na_koppel == 0)
|
||||
{
|
||||
if (yellow) {
|
||||
if (not_available) {
|
||||
if (res_fe_show_plantooltip) {
|
||||
bgHTML += ' title="'+escape2(p_name)+'"';
|
||||
theMouse = " onMouseOver='rsv_title(this)'";
|
||||
}
|
||||
}
|
||||
else {
|
||||
bgHTML += ' title="'+escape2(p_name)+'"';
|
||||
if (params.readwrite>0&&authparams.ALGwritelevel<9&&!params.jumped) {
|
||||
bgHTML += ' onClick="doCClick('+rsv_ruimte_key+',true'+');"'
|
||||
theMouse = " onMouseOver='rsv_title(this)'";
|
||||
if (params.readwrite>0&&authparams.ALGwritelevel<9&&!params.jumped) {
|
||||
onclick = ' onClick="rsv_click(this,\''+urole+'\');"'
|
||||
theClass += " click";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Als de *volgende* cel anders is dan moeten we prevtdHTML nog emitten
|
||||
prevtdHTML = "<td" + theSpan
|
||||
if (canClick) prevtdHTML+= " id="+i; // id is voor de doTClick
|
||||
|
||||
prevtdHTML += clickHTML + bgHTML
|
||||
prevtdHTML += "> </td>"
|
||||
builder+=prevtdHTML;
|
||||
|
||||
} // next cell for multi
|
||||
Response.Write(builder);
|
||||
|
||||
%>
|
||||
<td width="<%=t_w%>"></td>
|
||||
</tr>
|
||||
div = "<div class='"+theClass+"' rsv_key='" + rsv_ruimte_key + "'"
|
||||
+onclick
|
||||
+theMouse
|
||||
+" style='left:"+px_start+"px;width:"+px_width+"px'>"
|
||||
+" </div>";
|
||||
Response.Write("\n"+div);
|
||||
}
|
||||
%>
|
||||
</td>
|
||||
<% if (dagen<nr_days-1) { %>
|
||||
<td class="between"><div class=" <%=contright?statClass:""%>"> </div></td>
|
||||
<% } else { %>
|
||||
<td class="post"><div> </div></td>
|
||||
<% } %>
|
||||
<%
|
||||
}
|
||||
%> </tr>
|
||||
<%
|
||||
oRs.MoveNext();
|
||||
n++;
|
||||
@@ -453,136 +378,41 @@ __Log("Entering CreateRoomScheduleMulti with id=" + params.id + " and readwrite=
|
||||
oRs.close();
|
||||
|
||||
%>
|
||||
|
||||
<!-- LEGENDA -->
|
||||
<tr class="planbordlegenda"><td colspan="5"></td><td colspan="<% = res_intervals + 1 %>">
|
||||
|
||||
<table id="planbordlegenda"><tr>
|
||||
<!--<td align="right"><img src="../Pictures/room_free.gif"></td>
|
||||
<td><% = lcl_free %></td>-->
|
||||
<td align="right"><img src="../Pictures/room_clean.gif"></td>
|
||||
<td><% = lcl_r_clean %></td>
|
||||
<td align="right"><img src="../Pictures/room_opt.gif"></td>
|
||||
<td><% = lcl_optie %></td>
|
||||
<td align="right"><img src="../Pictures/room_def.gif"></td>
|
||||
<td>
|
||||
<%
|
||||
Response.write(lcl_def);
|
||||
%>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><img src="../Pictures/room_blk.gif"></td>
|
||||
<td><% = lcl_blokkade %></td>
|
||||
<td align="right"><img src="../Pictures/room_vvl.gif"></td>
|
||||
<td><% = lcl_vervallen %></td>
|
||||
<td align="right"><img src="../Pictures/room_na.gif"></td>
|
||||
<td colspan=3><% = lcl_niet_beschikbaar %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<tr><td></td>
|
||||
<td></td>
|
||||
<% res.emit_planbord_tijdbalk(params.res_van, nr_days, params.hour_px); %>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<% }
|
||||
|
||||
function CreateRoomScheduleSingle(id)
|
||||
{
|
||||
__Log("Entering CreateRoomScheduleSingle with id=" + id);
|
||||
%>
|
||||
|
||||
<table id="<%=id%>" border=0" cellspacing="0" cellpadding="0" width="500" style="visibility:hidden">
|
||||
|
||||
<tr>
|
||||
<td><b></b></td>
|
||||
<td> </td>
|
||||
<td align='right'><b></b></td>
|
||||
|
||||
<%
|
||||
var showOnlyOddHours = ((res_t2 - res_t1) >= res_roomplan_skiplimit)
|
||||
var mod_t1 = (res_t1 % (showOnlyOddHours?2:1)); // bepaal restwaarde
|
||||
if (mod_t1 == 0) mod_t1 = (showOnlyOddHours?2:1); // als even dan restwaarde is 1 of 2
|
||||
s0 = res_t1 - (mod_t1);
|
||||
|
||||
//s0 = res_t1 - 1;
|
||||
s = res_t1;
|
||||
i0 = -2;
|
||||
m ="";
|
||||
for (i=0; i<=res_intervals; i++)
|
||||
{
|
||||
if (s - s0 >= (showOnlyOddHours?2:1)) // Elke 1 of 2 uur de tijd weergeven
|
||||
if (any_nofit)
|
||||
{
|
||||
h = Math.floor(s);
|
||||
if (h < 10) h = "0" + h;
|
||||
%>
|
||||
|
||||
<td colspan="<%=(i-i0)%>" align="right" class=header>
|
||||
<table border="0" cellspacing="0" cellpadding="0" width="100%">
|
||||
<tr>
|
||||
<td align="left" class="room_sched_cap"><%=m%></td>
|
||||
<td align="right" class="room_sched_cap"><%=h%></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
<%
|
||||
m = Math.floor((s - h)*60);
|
||||
if (m < 10) m = "0" + m;
|
||||
i0 = i;
|
||||
s0 = s;
|
||||
}
|
||||
s += res_h;
|
||||
}
|
||||
%>
|
||||
<td colspan="2" width=<%=t_w%> class="room_sched_cap"><%=m%></td></tr>
|
||||
|
||||
<%//// Extra regel met losse cellen om afmetingen te forceren%>
|
||||
<tr>
|
||||
<td colspan=5></td>
|
||||
<%
|
||||
for (i=0; i<=res_intervals+5; i++) {
|
||||
%><td width=<%=t_w%>></td><%
|
||||
}
|
||||
%>
|
||||
<td></td></tr>
|
||||
|
||||
<%
|
||||
|
||||
|
||||
// Het kleine planbordje onderaan het reserveringscherm wordt dynamisch gevuld
|
||||
// Daar hoeven we verder niet echt moeilijk voor te doen
|
||||
Response.Write("<tr class=planbord height=15><td colspan=5 width="+t_w + "></td>");
|
||||
for (i = 0; i < res_intervals; i++)
|
||||
{
|
||||
// Vrij blokjes doen we heel efficient
|
||||
// (mod_t1/res_h) is verschil in begintijd t.o.v. hele uren.
|
||||
Response.Write("<td class='" + (((i+1+(mod_t1/res_h))%(1/res_h))==0?"otherH":"other") + "' width="+t_w + " id="+i+" bgcolor="+res_color_free+"></td>");
|
||||
%><span onclick="$('.res_nofit').css('display','block');$(this).toggle();$(this).next().toggle();FcltMgr.resized();">
|
||||
TODO: Alleen beschikbare objecten getoond. Toon alles.
|
||||
</span>
|
||||
<span onclick="$('.res_nofit').css('display','none');$(this).toggle();;$(this).prev().toggle()" style='display:none'>
|
||||
TODO: Alle objecten getoond. Toon alleen beschikbare.
|
||||
</span><%
|
||||
}
|
||||
Response.Write("<td width="+t_w + "></td></tr>");
|
||||
|
||||
%>
|
||||
|
||||
<!-- LEGENDA -->
|
||||
<tr><td colspan="5"></td><td colspan="<% = res_intervals + 1 %>">
|
||||
|
||||
<table width="100%" border="0"><tr>
|
||||
<!--<td align="right"><img src="../Pictures/room_free.gif"></td>
|
||||
<td><% = lcl_free %></td>-->
|
||||
<td align="right"><img src="../Pictures/room_clean.gif"></td>
|
||||
<td><% = lcl_r_clean %></td>
|
||||
<td align="right"><img src="../Pictures/room_def.gif"></td>
|
||||
<td>
|
||||
<% Response.write(lcl_occupied); %>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><img src="../Pictures/room_blk.gif"></td>
|
||||
<td><% = lcl_blokkade %></td>
|
||||
<td align="right"><img src="../Pictures/room_vvl.gif"></td>
|
||||
<td><% = lcl_vervallen %></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- LEGENDA -->
|
||||
<table id="planbordlegenda">
|
||||
<tr>
|
||||
<td align="right"><img src="../Pictures/room_clean.gif"></td>
|
||||
<td><% = lcl_r_clean %></td>
|
||||
<td align="right"><img src="../Pictures/room_opt.gif"></td>
|
||||
<td><% = lcl_optie %></td>
|
||||
<td align="right"><img src="../Pictures/room_def.gif"></td>
|
||||
<td><%= lcl_def %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><img src="../Pictures/room_blk.gif"></td>
|
||||
<td><% = lcl_blokkade %></td>
|
||||
<td align="right"><img src="../Pictures/room_vvl.gif"></td>
|
||||
<td><% = lcl_vervallen %></td>
|
||||
<td align="right"><img src="../Pictures/room_na.gif"></td>
|
||||
<td colspan=3><% = lcl_niet_beschikbaar %></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<% }
|
||||
|
||||
Reference in New Issue
Block a user