UWVA#31991: einddatum bij reserveerbare objecten.

RWSN#32027: Einddatum bij reserveerbare ruimte.

svn path=/Website/trunk/; revision=25192
This commit is contained in:
Maykel Geerdink
2015-05-13 13:39:29 +00:00
parent 967d5d61d6
commit df15f890ef
5 changed files with 36 additions and 14 deletions

View File

@@ -14,10 +14,10 @@
*/
var JSON_Result = true;
%>
<!--#include file="../Shared/common.inc"-->
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/json2.js" -->
<!--#include file="./res.inc"-->
<!--#include file="../bez/bez.inc"-->
<!-- #include file="./res.inc" -->
<!-- #include file="../bez/bez.inc" -->
<%
protectRequest.validateToken();
@@ -31,16 +31,23 @@ user.auth_required_or_abort(this_res.couldCreate);
// =========================================
// Eerst wat info ophalen
sql = "SELECT rr.res_reservering_key"
+ " , rr.res_reservering_ispool"
+ " FROM res_reservering rr,"
+ " res_rsv_ruimte rrr"
+ " WHERE rr.res_reservering_key = rrr.res_reservering_key AND"
+ " res_rsv_ruimte_key = " + rsv_ruimte_key;
+ " , rr.res_reservering_ispool"
+ " , r.res_ruimte_vervaldatum"
+ " FROM res_reservering rr"
+ " , res_rsv_ruimte rrr"
+ " , res_ruimte_opstelling ro"
+ " , res_ruimte r"
+ " WHERE rr.res_reservering_key = rrr.res_reservering_key"
+ " AND rrr.res_ruimte_opstel_key = ro.res_ruimte_opstel_key"
+ " AND ro.res_ruimte_key = r.res_ruimte_key"
+ " AND res_rsv_ruimte_key = " + rsv_ruimte_key;
oRs = Oracle.Execute(sql);
var reservering_key = oRs("res_reservering_key").Value;
var ispool = (oRs("res_reservering_ispool").Value) == 1;
var ruimte_vervaldatum = oRs("res_ruimte_vervaldatum").Value;
if (ruimte_vervaldatum != null)
ruimte_vervaldatum = new Date(ruimte_vervaldatum);
oRs.Close();
//
var nrPAF = 0;
if (!ispool) // Dan gaan bezoekers toch niet mee
@@ -64,6 +71,10 @@ var sql = "DECLARE"
for (var i = 1; i <= form_dates.Count; i++)
{
var datum = new Date(parseInt(form_dates(i),10));
if (ruimte_vervaldatum != null && ruimte_vervaldatum < datum)
{
abort_with_warning(L("lcl_res_room_expired").format(toDateString(ruimte_vervaldatum)));
}
if (ispool) // Hele reservering
{
sql += " new_key := res.res_copy_res(" + reservering_key + "," + datum.toSQL() + "," + user_key + ");";

View File

@@ -233,7 +233,8 @@ function make_plan_obj(disc_key, res_van, res_tot, params)
act_key : params.act_key,
sdisc : disc_key,
group_by: group_by,
autfunction : autfunction
autfunction : autfunction,
res_van: res_van
});
oRs = Oracle.Execute(sql1);

View File

@@ -182,7 +182,8 @@ IFRAMER_HEADER(L("lcl_res_frame_voorziening"), buttons);
fnStep : fnStep,
srtact : srtact,
planbord: true,
autfunction: autfunction
autfunction: autfunction,
res_van: date_from
}
// ==========================================================================
@@ -196,7 +197,8 @@ IFRAMER_HEADER(L("lcl_res_frame_voorziening"), buttons);
loc_key : params.loc_key,
act_key : params.act_key,
sdisc : "dis.ins_discipline_key",
autfunction : autfunction
autfunction : autfunction,
res_van : params.res_van
};
var sql_aantal = " ( " + get_res_deel_sql(deel_params) + ") aantal ";

View File

@@ -418,9 +418,11 @@ FCLTHeader.Requires({plugins: ["jQuery"]})
readonly: true,
no_table: true
});
%>
<!-- Ruimte -->
<% ROFIELDTR("fldresroom", L("lcl_room"), res_ruimte_data.ruimte_nr)
var date_from = rrr.rsv_ruimte_van;
var vervaldatum = res_ruimte_data.vervaldatum;
ROFIELDTR("fldresroom" + (vervaldatum && vervaldatum < date_from? " res_fatal" : "") , L("lcl_room"), res_ruimte_data.ruimte_nr + (vervaldatum && vervaldatum < date_from? L("lcl_inactive_data_suffix") : ""))
// Opstelling
for( i=0; i<res_ruimte_data.RoomConfigs.length; i++ )

View File

@@ -1539,6 +1539,12 @@ textarea.required.missing,
background-color:#ff5050;
}
input[type=text].button.required
{
background-color:==buttonbackgroundcolor==;
border-left:2px solid #ee5f5b;
}
input.number.bad, input.float.bad, input.currency.bad, input.flddate.bad, input.fldtime.bad,input.fldflexC.bad,input.fldflexC50.bad {
background-color:#ffB0B0;
}