AAIT#28088 Share & Meet: Mobiel erbij en rating (vooralsnog alleen desktop)

svn path=/Website/branches/v5.3.4/; revision=20429
This commit is contained in:
Jos Groot Lipman
2014-01-23 14:51:27 +00:00
parent dcfa38ab99
commit f8a39e4bfa
31 changed files with 576 additions and 301 deletions

View File

@@ -10,14 +10,12 @@
Context: Door een remote systeem (geen persoon) om info uit FACILITOR te halen aan te roepen
Notes:
Status: Autorisatie tegen de API_KEY-user checken
*/
DOCTYPE_Disable = 1;
LCL_Disable = 1
THIS_FILE = "appl/api/api_ressoap_info.asp";
Session("logging")=1;
// Session("logging")=1;
%>
<!-- #include file="../Shared/common.inc" -->
@@ -65,6 +63,14 @@ try
urole: urole
};
*/
var headerinfo = {
// file: String(Request.ServerVariables("SCRIPT_NAME")).toLowerCase(),
// datum: new Date(),
naam: user.naam(),
custId: customerId,
language: user.lang()
}
params.anonymous = true; // erg anoniem
params.get_deepurl = true; // we willen graag een bookmark
@@ -72,14 +78,16 @@ try
{
case "plan_rooms_info":
plan_info = res.plan_rooms_info(params);
set_deep_info(params, plan_info);
break;
case "plan_bezet_info":
plan_info = res.plan_bezet_info(params);
break;
case "prodsearch_rooms_info":
var w_discs = write_discs();
var filter = { s: params.s
var filter = { s: params.s
, soort: { val: "resruimte", lcl: L("lcl_srch_entiteit") }
, satisfaction: params.satisfaction
, locatieKey: -1
, gebouwKey: -1
, verdiepingKey: -1
@@ -92,22 +100,7 @@ try
var oRs = Oracle.Execute(sql);
var plan_info = Oracle.rs2hash(oRs);
oRs.Close();
// Bepaal de URL waar user straks op kan klikken
var sql = "SELECT fac_bookmark_id"
+ " FROM fac_bookmark"
+ " WHERE fac_bookmark_xmlnode = 'reservering'";
var oRs = Oracle.Execute(sql);
var bm = oRs("fac_bookmark_id").Value;
oRs.Close();
var deepurl = HTTP.urlzelf() + "/?fac_id=" + customerId + "&u=" + bm;
for (var r in plan_info)
{
plan_info[r].deepurl = deepurl;
if (plan_info[r].foto)
plan_info[r].image_url = HTTP.urlzelfnoroot() + S("res_image_path") + plan_info[r].foto;
}
set_deep_info(params, plan_info);
break;
case "user_lopend_info": // Alle lopende reserveringen van params.prs_externId
if (params.prs_externId && !(params.prs_key > 0))
@@ -125,16 +118,23 @@ try
plan_info = [];
if (params.prs_key > 0)
{
plan_info = res.user_lopend_info(params);
}
break;
default:
API.error("Unknown API request");
API.error("Unknown API request: " + params.request);
}
Response.ContentType = "application/json";
Response.AddHeader("Access-Control-Allow-Origin", "*"); // Opdat FireFox cross-domain toestaat
var antwoord = JSON.stringify(plan_info, null, getQParam("pretty","0")=="1"?2:0);
var result = { header: headerinfo,
success: true
}
result[params.request] = plan_info;
var antwoord = JSON.stringify(result, null, getQParam("pretty","0")=="1"?2:0);
var oCrypto = new ActiveXObject("SLNKDWF.Crypto");
var eTag = '"' + oCrypto.hex_sha1(antwoord).toLowerCase() + '"';
@@ -152,4 +152,29 @@ catch (e)
{
API.error(typeof e == "string"? e : "API_error: " + e.description);
}
function set_deep_info(params, plan_info)
{
// Bepaal de URL waar user straks op kan klikken
if (params.mobile)
{
var deepurl = HTTP.urlzelf() + "/appl/pda/reservering.asp?fac_id=" + customerId;
}
else
{
var sql = "SELECT fac_bookmark_id"
+ " FROM fac_bookmark"
+ " WHERE fac_bookmark_xmlnode = 'reservering'";
var oRs = Oracle.Execute(sql);
var bm = oRs("fac_bookmark_id").Value;
oRs.Close();
var deepurl = HTTP.urlzelf() + "/?fac_id=" + customerId + "&u=" + bm;
}
for (var r in plan_info)
{
plan_info[r].deepurl = deepurl;
if (plan_info[r].image)
plan_info[r].image_url = HTTP.urlzelfnoroot() + S("res_image_path") + plan_info[r].image;
}
}
%>

View File

@@ -17,14 +17,14 @@
*/ %>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../shared/data_recordset.inc" -->
<!-- #include file="../Shared/resultset_table_v2.inc" -->
<!-- #include file="../Shared/json2.js" -->
<!-- #include file="../shared/rater.inc" -->
<!-- #include file="../mld/mld.inc" -->
<!-- #include file="../res/res.inc" -->
<!-- #include file="fac.inc" -->
<%
FCLTHeader.Requires({ js: [] });
var pkey = getQParamInt("prs_key", user_key);
var outputmode = getQParamInt("outputmode", 0); // 0 = screen, 1 = print, 2 = excel etc
@@ -124,8 +124,9 @@ function fnLike(oRs)
if (isGereed(xmlnode, (xmlnode == "reservering"? bostatuskey : statuskey)))
{
likesymbol = shared.satisfactionsymbol(oRs.Fields("satisfaction").Value, {shownone: true});
likesymbol = "<div onclick='fLike(event, \"" + oRs.Fields("item_key").Value + "\", \"" + oRs.Fields("xmlnode").Value +"\")'><img src='" + likesymbol + "'></div>";
//likesymbol = "<img src='" + shared.satisfactionsymbol(oRs.Fields("satisfaction").Value, {shownone: true}) + "'>";
likesymbol = rater(oRs.Fields("satisfaction").Value, {shownone: true, readonly: true});
likesymbol = "<div onclick='fLike(event, \"" + oRs.Fields("item_key").Value + "\", \"" + oRs.Fields("xmlnode").Value +"\")'>" + likesymbol + "</div>";
}
return likesymbol;
}
@@ -165,7 +166,7 @@ function fnrowClass(oRs)
lclass = " listfatal"; // ja, deze overruled de vorige classes
// Tracking
if (oRs.Fields("recentdatum").Calue != null)
if (oRs.Fields("recentdatum").Value != null)
{
var ltrackdate = new Date();
var module = oRs.Fields("xmlnode").Value;
@@ -639,21 +640,8 @@ function sqlTracking(refkey, node)
// Overzicht externe ruimtes
autfunction = "WEB_RESUSE";
var sql = "SELECT dis.ins_discipline_key,"
+ " "+ lcl.xsqla('dis.ins_discipline_omschrijving','dis.ins_discipline_key') +","
+ " res_disc_params_remoteurl"
+ " FROM res_v_aanwezigdiscipline dis, res_disc_params rdp"
+ " WHERE dis.ins_discipline_key = rdp.res_ins_discipline_key"
// + " AND ins_discipline_min_level = 1" // TODO?
+ " AND res_disc_params_remoteurl IS NOT NULL"
+ " AND dis.ins_discipline_key IN("
+ " SELECT g.ins_discipline_key FROM fac_v_webgebruiker g, fac_functie f "
+ " WHERE g.fac_functie_key = f.fac_functie_key "
+ " AND f.fac_functie_code = " + safe.quoted_sql(autfunction)
+ " AND g.fac_gebruiker_alg_level_write < 9"
+ " AND g.fac_gebruiker_prs_level_write < 9"
+ " AND g.prs_perslid_key = " + user_key
+ " )";
var sql = res.getremotes_sql(autfunction);
var oRs = Oracle.Execute(sql);
// Als je hier weet dat er intern niks was zou je deze externe opties initieel opengeklapt willen?
while( !oRs.eof )
@@ -664,7 +652,7 @@ function sqlTracking(refkey, node)
prs_externId: customerId + "_" + String(user_key)
}
var user_lopend_info = HTTP.getJSON(url, xparams);
var user_lopend_info = HTTP.getJSON(url, xparams).user_lopend_info;
if (user_lopend_info.length)
{
%>
@@ -674,7 +662,6 @@ function sqlTracking(refkey, node)
</span>
<div class="resexterndiv">
<%
// Response.Write("<pre>" + JSON.stringify(user_lopend_info) + "</pre>");
rst.buttons = [];
rst.sql = null;
rst.ID = "factable2";

View File

@@ -28,8 +28,10 @@
v <20> Omschrijvingen van reserveerbare objecten.
*/ %>
<!--#include file="../Shared/common.inc" -->
<!--#include file="../shared/data_recordset.inc" -->
<!--#include file="../Shared/resultset_table_v2.inc" -->
<!--#include file="../Shared/json2.js" -->
<!--#include file="../shared/rater.inc" -->
<!--#include file="fac.inc" -->
<!--#include file="../res/res.inc" -->
<!--#include file="../res/res_plan_room.inc" -->
@@ -38,10 +40,14 @@
<!--#include file="../FAC/prodsearch.inc" -->
<%
FCLTHeader.Requires({js: ["../localscripts/raty/jquery.raty.min.js"]});
var inc_queries = ["mlddisc", "mldstdm", "resruimte", "resartikel", "resdeel", "bescatalogus", "besartikelgroep", "besartikel", "faq", "prsperslid"];
var filter = { s: { val: getQParam("s",""), lcl: L("lcl_search") }
, soort: { val: getQParam("soort", ""), lcl: L("lcl_srch_entiteit") }
, date_from_ms: { val: getQParamInt("date_from", null), lcl: L("lcl_date") }
, date_from_ms: { val: getQParamInt("date_from_ms", null), lcl: L("lcl_date") }
, satisfaction: { val: getQParamInt("satisfaction", 0), lcl: L("lcl_res_oordeel") }
, locatieKey: -1
, gebouwKey: -1
, verdiepingKey: -1
@@ -103,51 +109,50 @@ function fncolType(oRs)
function fnrowData(oRs, processParams)
{
var module = oRs.Fields("soort").Value;
var url= ""; // om zoiets toe te gaan voegen
var ttl= "";
var data = {url: "", ttl: ""};
switch (module) {
case "mlddisc":
url = "appl/mld/mld_melding.asp?disc="+oRs.Fields("product_key").Value;
ttl = L("lcl_complain");
data.url = "appl/mld/mld_melding.asp?disc="+oRs.Fields("product_key").Value;
data.ttl = L("lcl_complain");
break;
case "mldstdm":
url = "appl/mld/mld_melding.asp?mld_defaultstdmelding="+oRs.Fields("product_key").Value;
ttl = L("lcl_complain");
data.url = "appl/mld/mld_melding.asp?mld_defaultstdmelding="+oRs.Fields("product_key").Value;
data.ttl = L("lcl_complain");
break;
case "resruimte":
url = "appl/res/res_reservering.asp?res_ruimte_key="+oRs.Fields("product_key").Value;
ttl = L("lcl_reservation");
data.url = "appl/res/res_reservering.asp?res_ruimte_key="+oRs.Fields("product_key").Value;
data.ttl = L("lcl_reservation");
break;
case "resartikel":
url = "appl/res/res_reservering.asp?restype=CV&res_artikel_key="+oRs.Fields("product_key").Value;
ttl = L("lcl_reservation");
data.url = "appl/res/res_reservering.asp?restype=CV&res_artikel_key="+oRs.Fields("product_key").Value;
data.ttl = L("lcl_reservation");
break;
case "resdeel":
url = "appl/res/res_reservering.asp?restype=CV&res_deel_key="+oRs.Fields("product_key").Value;
ttl = L("lcl_reservation");
data.url = "appl/res/res_reservering.asp?restype=CV&res_deel_key="+oRs.Fields("product_key").Value;
data.ttl = L("lcl_reservation");
if (processParams && processParams.disc_key)
{
data.deepurl = oRs.Fields("deepurl").Value;
data.disc = processParams.disc_key;
}
break;
case "bescatalogus":
case "besartikelgroep":
case "besartikel":
url = "appl/bes/bes_bestelling.asp?artikel_key="+oRs.Fields("product_key").Value+"&dis_key="+oRs.Fields("disc_key").Value;
ttl = L("lcl_bes_srtdeel_full");
data.url = "appl/bes/bes_bestelling.asp?artikel_key="+oRs.Fields("product_key").Value+"&dis_key="+oRs.Fields("disc_key").Value;
data.ttl = L("lcl_bes_srtdeel_full");
break;
case "faq":
url = "appl/fac/fac_faq.asp?faq_key="+oRs.Fields("product_key").Value;
data.url = "appl/fac/fac_faq.asp?faq_key="+oRs.Fields("product_key").Value;
if (oRs.Fields("foto").Value) // eigenlijk fac_faq_url
url = oRs.Fields("foto").Value;
ttl = L("lcl_faq_item");
data.url = oRs.Fields("foto").Value;
data.ttl = L("lcl_faq_item");
break;
case "prsperslid":
url = "appl/fac/fac_user_info_phone.asp?prs_key="+oRs.Fields("product_key").Value;
data.url = "appl/fac/fac_user_info_phone.asp?prs_key="+oRs.Fields("product_key").Value;
break;
}
var data = {url: url, ttl: ttl};
if (processParams && processParams.disc_key)
{
data.deepurl = oRs.Fields("deepurl").Value;
data.disc = processParams.disc_key;
}
return JSON.stringify(data);
}
@@ -236,6 +241,11 @@ function fncolProduct(oRs)
i ++;
}
}
if (filter.soort.val == "resruimte" && oRs.Fields("satisfaction").Value)
{
var likesymbol = rater(oRs.Fields("satisfaction").Value, { readonly: true } );
resstr = "<table><tr><td>" + resstr + "</td><td>" + likesymbol + "</td></tr></table>";
}
return "<span class='pscapt'>"+resstr+"</span>";
}
@@ -249,12 +259,10 @@ function fncolPrijs(oRs)
function fncolPlanbord(oRs)
{
// if (resparams.res_van) ...
//make_plan_room(plan_rooms_info, plan_bezet_info, resparams);
var room = { begintijd: S("res_t1"), eindtijd: S("res_t2") };
var hour_px = 16;
var nr_days = 1;
var size_px = hour_px*(room.eindtijd-room.begintijd)+1;
var nr_days = 1; // We hebben maar <20><>n dag aan info.
var width_px = getQParamInt("width_px", 1024);
var hour_px = res.hour_px(width_px - 300, nr_days);
var html = [ '\n<table id="tab_room_sched" cellspacing="0" hour_px="' + hour_px + '" ',
' class="compressed planbord planbord'+hour_px+' multiday">'];
@@ -336,7 +344,7 @@ function suggest_box_histogram (titel, histograms, kolom, params)
return result;
}
function suggest_box_datum (titel, histograms, kolom, params)
function suggest_box_resruimte (titel, histograms, kolom, params)
{
%>
<table class="filter" width="100%">
@@ -350,7 +358,24 @@ function suggest_box_datum (titel, histograms, kolom, params)
trclass: "primsearch",
volgnr: 1
});
%></td></tr></table><%
%></td></tr><%
var likesymbol = rater(filter.satisfaction.val||1, {});
%><tr><td><div id='rater'></div></td></tr>
</table>
<script>
$(function ()
{
$("#rater").raty({
score: (<%=filter.satisfaction.val%>)/2,
showHalf : true,
half : true,
path: '../localscripts/raty/img/',
width: 120
})
});
</script>
<%
}
%>
@@ -388,10 +413,15 @@ function suggest_box_datum (titel, histograms, kolom, params)
function refresh_filter(newfilter)
{
var item;
var url = "prodsearch.asp?1=1";
var url = "prodsearch.asp?width_px=" + $(window).width();
<% if (autosearch) { %>
url += "&autosearch=1"
<% } %>
filter.s.val = $('#searchText').val();
if ($("input[name=score]").length)
filter.satisfaction.val = 2 * $("input[name=score]").val();
filter.date_from_ms.val = $("#date_from").val();
for (item in newfilter)
{
if (!filter[item])
@@ -409,9 +439,6 @@ function suggest_box_datum (titel, histograms, kolom, params)
url += "&" + item + "=" + escape(v);
}
}
var dt = $("#date_from").val();
if (dt)
url += "&date_from=" + dt;
window.location.href = url;
}
@@ -427,7 +454,7 @@ function suggest_box_datum (titel, histograms, kolom, params)
<body id="listbody">
<table id="container" width="100%">
<tr><td id="searchBox" colspan="2"> <!-- TODO: table, biglabel style e.d; form buitenom?-->
<form id="srch" onsubmit="refresh_filter({ s: $('#searchText').val() <%= autosoort? ", soort: ''" : "" %>});return false;">
<form id="srch" onsubmit="refresh_filter({ <%= autosoort? " soort: ''" : "" %>});return false;">
<%=L("lcl_srch_zoeker")%>
<input type="text" value="<%=safe.htmlattr(filter.s.val)%>" id="searchText" />
<input type='submit' class='button' value="<%=L("lcl_srch_zoeker_alt")%>" id="prodsearchsearch">
@@ -453,6 +480,9 @@ function suggest_box_datum (titel, histograms, kolom, params)
case 'date_from_ms':
var xx = toDateString(new Date(filter[item].val))
break;
case 'satisfaction':
var xx = L("lcl_res_oordeel") + ": " + filter[item].val
break;
default:
var xx = getQParam(item + "_txt", filter[item].val);
break;
@@ -522,21 +552,7 @@ function suggest_box_datum (titel, histograms, kolom, params)
if (filter.soort.val == "resruimte") // Dan ook pogen externen er bij te tonen
{ var autfunction = "WEB_RESUSE"; // TODO
// Overzicht externe ruimtes
var sql = "SELECT dis.ins_discipline_key,"
+ " "+ lcl.xsqla('dis.ins_discipline_omschrijving','dis.ins_discipline_key') +","
+ " res_disc_params_remoteurl"
+ " FROM res_v_aanwezigdiscipline dis, res_disc_params rdp"
+ " WHERE dis.ins_discipline_key = rdp.res_ins_discipline_key"
// + " AND ins_discipline_min_level = 1" // TODO?
+ " AND res_disc_params_remoteurl IS NOT NULL"
+ " AND dis.ins_discipline_key IN("
+ " SELECT g.ins_discipline_key FROM fac_v_webgebruiker g, fac_functie f "
+ " WHERE g.fac_functie_key = f.fac_functie_key "
+ " AND f.fac_functie_code = " + safe.quoted_sql(autfunction)
+ " AND g.fac_gebruiker_alg_level_write < 9"
+ " AND g.fac_gebruiker_prs_level_write < 9"
+ " AND g.prs_perslid_key = " + user_key
+ " )";
var sql = res.getremotes_sql(autfunction);;
var oRs = Oracle.Execute(sql);
while( !oRs.eof )
{
@@ -555,12 +571,14 @@ function suggest_box_datum (titel, histograms, kolom, params)
xparams.alg_locatie_plaats = q_items.alg_locatie_plaats.replace(new RegExp("^" + L("lcl_res_extern_prefix")), "");
if (filter.s)
xparams.s = filter.s;
if (filter.satisfaction)
xparams.satisfaction = filter.satisfaction;
var prodsearch_rooms_info = HTTP.getJSON(url, xparams);
var prodsearch_rooms_info = HTTP.getJSON(url, xparams).prodsearch_rooms_info;
if (filter.soort.val == "resruimte" && filter.date_from_ms.val>0)
{
resparams.request = "plan_bezet_info";
/*global*/ plan_bezet_info = HTTP.getJSON(url, resparams);
/*global*/ plan_bezet_info = HTTP.getJSON(url, resparams).plan_bezet_info;
}
rst.sql = null;
@@ -608,7 +626,9 @@ for (col in rst.Counter)
<td style="width: 150px; vertical-align: top; padding: 0 5px 0 12px;">
<%
if (filter.soort.val == "resruimte")
suggest_box_datum(L("lcl_date"));
{
suggest_box_resruimte(L("lcl_date") + "/" + L("lcl_res_oordeel"));
}
var soorten = suggest_box_histogram(L("lcl_srch_entiteit"), rst.Counter, "soort", { fncol: fncolSoort });
// Als er onverwacht maar <20><>n soort is gaan we de pagina herladen maar dan met
@@ -616,7 +636,7 @@ var soorten = suggest_box_histogram(L("lcl_srch_entiteit"), rst.Counter, "soort"
if (!filter.soort.val && soorten.length == 1)
{
%>
<script type="text/javascript" >refresh_filter({ autosoort: "<%=soorten[0]%>" });</script>
<script>refresh_filter({ autosoort: "<%=soorten[0]%>" });</script>
<%
Response.End;
}

View File

@@ -155,6 +155,11 @@ function prodsearch_queries(write_discs, filter)
+ " AND d.ins_discipline_key IN (" + write_discs_MLDFOFBOF + ")";
// doet 3d wel var reslocstr = fac.mylocatiesqlstring(user_key, ["WEB_RESUSE","WEB_RESFOF"]);
var sati_sql = " (SELECT AVG(res_rsv_ruimte_satisfaction) "
+ " FROM res_rsv_ruimte rrr"
+ " WHERE res_ruimte_opstel_key = rro.res_ruimte_opstel_key"
+ " AND res_rsv_ruimte_van > sysdate - 180)";
queries['resruimte'] =
{ sql:
"SELECT r.res_ruimte_key product_key, "
@@ -170,6 +175,7 @@ function prodsearch_queries(write_discs, filter)
+ " res_ruimte_image foto,"
+ " alg_locatie_omschrijving,"
+ " alg_locatie_plaats,"
+ (filter.soort.val == "resruimte"? sati_sql + " satisfaction,":"")
+ " ro.res_opstelling_omschrijving"
+ " FROM res_v_aanwezigruimte r,"
+ " res_v_aanwezigdiscipline d,"
@@ -198,6 +204,8 @@ function prodsearch_queries(write_discs, filter)
+ " AND di.alg_district_key = l.alg_district_key"
+ " AND rro.res_ruimte_key = r.res_ruimte_key" // TODO: Duplicates verwijderen?
+ " AND rro.res_opstelling_key = ro.res_opstelling_key"
+ ((filter.soort.val == "resruimte" && filter.satisfaction.val > 0)?
" AND " + sati_sql + " >= " + filter.satisfaction.val :"")
+ reslocstr,
///doet de 3d wel + (reslocstr!=""?" AND g.alg_locatie_key IN ("+reslocstr+")":"")
icon : "../Pictures/house.png",

Binary file not shown.

After

Width:  |  Height:  |  Size: 699 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 715 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 667 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 685 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 631 B

File diff suppressed because one or more lines are too long

View File

@@ -9,11 +9,17 @@
Context: redirected from /default.asp if mobile device is detected.
Parameters: -
- Deze file moet zo klein mogelijk pagina's opleveren (bandbreedte)
- Deze file moet zo weinig mogelijk cs javascript bevatten
- het menu toont die opties waarvoor user_key geautoriseerd is.
*/
var orghome = Session("ORGHOME");
if (orghome) // Share and meet
{
//Session.Contents.Remove("ORGHOME"); gewoon laten staan voor als iemand 'back' drukt
Response.Redirect(orghome);
}
%>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../shared/login.inc" -->

View File

@@ -17,11 +17,14 @@
*/ %>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/discx3d.inc" -->
<!-- #include file="../shared/data_recordset.inc" -->
<!-- #include file="./resultset_table.inc" -->
<!-- #include file="../Shared/json2.js" -->
<!-- #include file="./mobile.inc" -->
<!-- #include file="./iface.inc" -->
<!-- #include file="../MLD/mld.inc" -->
<!-- #include file="../FAC/fac.inc" -->
<!-- #include file="../mld/mld.inc" -->
<!-- #include file="../fac/fac.inc" -->
<!-- #include file="../res/res.inc" -->
<%
var showall = getQParamInt("showall", 1) == 1;
@@ -62,10 +65,18 @@ function bes_getstatustext (p){
return statustekst;
}
function fncolLink(oRs)
function fncolLink(oRs, processParams)
{
var module = oRs("xmlnode").Value;
return fncolLinkKey(module, oRs("item_key").Value);
var module = oRs.Fields("xmlnode").Value;
if (module == "reservering" && processParams && processParams.disc_key)
{
var orghome = HTTP.urlzelf() + "/appl/pda/facilitor.asp";
var url = "../res/res_goto_extern.asp?res_disc_key=" + processParams.disc_key + "&deepurl=" + safe.url(oRs.Fields("deepurl").Value + "&orghome=" + orghome);
}
else // Gewoon intern
var url = fncolLinkKey(module, oRs.Fields("item_key").Value);
return url;
};
// Ook te gebruiken met key=-1 voor nieuwe
@@ -92,7 +103,7 @@ function fncolLinkKey(module, key)
function fncolHeader(oRs)
{
var module = oRs("xmlnode").Value;
var module = oRs.Fields("xmlnode").Value;
var txt= "??";
switch (module) {
case "melding": txt = L("lcl_complain"); break;
@@ -100,7 +111,7 @@ function fncolHeader(oRs)
case "bestelling": txt = L("lcl_bes_bestelling"); break;
case "afspraak": txt = L("lcl_vis_appointment"); break;
}
txt = oRs("item").value;
txt = oRs.Fields("item").Value;
return safe.html(txt);
};
@@ -119,7 +130,7 @@ function fncolHeader(oRs)
modules.push({
xmlnode: 'melding',
groupName: L("lcl_mobile_meldingen"),
fnStatus: function (oRs) { return mld.getmldstatustext(oRs("mld_melding_status").value); },
fnStatus: function (oRs) { return mld.getmldstatustext(oRs.Fields("mld_melding_status").Value); },
sql: "SELECT isd.ins_srtdiscipline_prefix || TO_CHAR (m.mld_melding_key) item, "
+ " m.mld_melding_key item_key, "
+ " 'melding' xmlnode, "
@@ -147,8 +158,8 @@ function fncolHeader(oRs)
modules.push({
xmlnode: 'bestelling',
groupName: L("lcl_FE_ordering"),
fnStatus: function (oRs) { return bes_getstatustext(oRs("bes_bestelling_status").value); },
fnSubheader: function (oRs) { return toDateString(oRs("bes_bestelling_leverdatum").value); },
fnStatus: function (oRs) { return bes_getstatustext(oRs.Fields("bes_bestelling_status").Value); },
fnSubheader: function (oRs) { return toDateString(oRs.Fields("bes_bestelling_leverdatum").Value); },
sql: "SELECT TO_CHAR (bes_bestelling_key) item, "
+ " bes_bestelling_key item_key, "
+ " 'bestelling' xmlnode, "
@@ -173,7 +184,7 @@ function fncolHeader(oRs)
modules.push({
xmlnode: 'reservering',
groupName: L("lcl_mobile_reserveringen"),
fnStatus: function (oRs) { return res_getfostatustext(oRs("status_key").value); },
fnStatus: function (oRs) { return res_getfostatustext(oRs.Fields("status_key").Value); },
sql: "SELECT * FROM ("
+ "SELECT TO_CHAR (rr.res_reservering_key) || '/' || rr.res_rsv_ruimte_volgnr item, "
+ " rr.res_rsv_ruimte_key item_key, "
@@ -223,7 +234,7 @@ function fncolHeader(oRs)
modules.push({
xmlnode: 'afspraak',
groupName: L("lcl_mobile_bezoek"),
fnStatus: function (oRs) { return oRs("done").value == 2 ? fac.localstring('lcl_vis_inside_st') : ''; },
fnStatus: function (oRs) { return oRs.Fields("done").Value == 2 ? fac.localstring('lcl_vis_inside_st') : ''; },
sql: "SELECT b.bez_afspraak_naam "
+ " || (CASE WHEN bez_afspraak_bedrijf IS NOT NULL THEN ' (' || bez_afspraak_bedrijf || ')' END) detail, "
+ " b.bez_afspraak_key item_key, "
@@ -250,6 +261,35 @@ function fncolHeader(oRs)
var oRs = Oracle.Execute("SELECT COUNT(*) FROM ("+modules[module].sql+")"); // beetje bot maar het zijn toch heel snelle queries?
var cnt = oRs(0).Value;
oRs.Close();
var remotes = []; // Externe reserveringen er vast bijzoeken
if (modules[module].xmlnode == "reservering")
{
var autfunction = "WEB_RESUSE";
var sql = res.getremotes_sql(autfunction);
var oRs = Oracle.Execute(sql);
// Als je hier weet dat er intern niks was zou je deze externe opties initieel opengeklapt willen?
while( !oRs.eof )
{
var url = oRs.Fields("res_disc_params_remoteurl").Value + "&API=RESINFO";
var xparams = { request: "user_lopend_info",
prs_externId: customerId + "_" + String(user_key),
mobile: true
}
var user_lopend_info = HTTP.getJSON(url, xparams).user_lopend_info;
if (user_lopend_info.length)
{
remotes.push({disc_desc: oRs.Fields("ins_discipline_omschrijving").Value,
disc_key: oRs.Fields("ins_discipline_key").Value,
user_lopend_info: user_lopend_info
});
cnt += user_lopend_info.length;
}
oRs.MoveNext();
}
oRs.close();
}
// Om dit helemaal volgens de regels te doen (en de bubble te kunnen gebruiken)
// moet dit in een list worden gevat volgens mij
@@ -278,6 +318,29 @@ function fncolHeader(oRs)
noSearch: true
});
var cnt = rst.processResultset();
if (modules[module].xmlnode == "reservering") // Externe reserveringen er bij slepen
{
for (var i in remotes)
{
%>
<div class="resexternlist">
<span class="resexterntitle">
<%= L("lcl_res_extern_prefix") + Server.HTMLencode(remotes[i].disc_desc)%>
</span>
<div class="resexterndiv">
<%
rst.buttons = [];
rst.sql = null;
rst.ID = "factable2";
rst.dataset = remotes[i].user_lopend_info;
var cnt = rst.processResultset({ disc_key: remotes[i].disc_key });
%>
</div>
</div>
<%
}
}
%></div><%
}
%></div><%

View File

@@ -62,7 +62,6 @@ function fncolIcon(oRs)
{
var module = oRs("soort").value;
var icon = "";
var hint = "";
switch (module) {
case "mlddisc":
case "mldstdm":
@@ -70,29 +69,25 @@ function fncolIcon(oRs)
if (oRs("foto").value != null){
icon = S("mlds_image_path") + oRs("foto");
}
hint = L("lcl_do_melding_hint");
break;
case "resruimte":
icon = "../Pictures/house_p.png";
if (oRs("foto").value != null)
icon = S("res_image_path") + oRs("foto").Value;
hint = L("lcl_do_reservering_hint");
break;
case "resartikel":
case "resdeel":
icon = "../Pictures/television_p.png";
hint = L("lcl_do_reservering_hint");
break;
case "bescatalogus":
case "besartikelgroep":
case "besartikel":
case "faq":
icon = "../Pictures/book_open_p.png";
hint = L("lcl_faq_item");
break;
case "prsperslid":
}
return '<img src="' + icon + '" title="' + hint + '">';
return icon;
}
function fncolLink(oRs)

View File

@@ -144,6 +144,18 @@ else
rsv.account = host_info.kostenplaats_key;
}
}
if (rsv.act_key < 0) // Toevallig maar <20><>n activiteit mogelijk voor onze ruimte? Pak gewoon de eerste
{
sql = "select res_activiteit_key"
+ " from res_activiteitdiscipline rad,"
+ " res_ruimte rr"
+ " where rr.res_ruimte_key = " + rsv.ruimtekey
+ " and rad.res_discipline_key = rr.res_discipline_key";
var oRs = Oracle.Execute(sql);
rsv.act_key = oRs("res_activiteit_key").Value;
oRs.Close()
}
// Als het aantal bezoekers is ingevuld moeten deze in de opstelling passen,
// maar neem bijvoorkeur de default opstelling.
// Neem de default opstelling altijd als het aantal bezoekers niet bekend is.

View File

@@ -21,7 +21,9 @@
<!-- #include file="../RES/res_plan_room.inc" -->
<!-- #include file="./mobile.inc" -->
<!-- #include file="./iface.inc" -->
<!-- #include file="../shared/data_recordset.inc" -->
<!-- #include file="./resultset_table.inc" -->
<!--#include file="../Shared/json2.js" -->
<%
@@ -43,6 +45,7 @@ autfunction = ("WEB_RESUSE");
var authparams = user.checkAutorisation(autfunction);
var transitParam = buildTransitParam(["act_key", "date_from", "date_to", "bez_cnt", "loc_key", "res_ruimte_key"]);
var transitParamExtern = buildTransitParam(["date_from", "date_to", "bez_cnt"]);
var sql = "SELECT COALESCE(MIN(fac_gebruiker_alg_level_write), 9) writelevel"
@@ -151,7 +154,7 @@ if (rsv_ruimte_key == -1)
// - ruimte
// - datum (was al)
// - aantal mensen (was al capaciteit, anders obv de default opstelling)
// en kan nog aangepast worden:
// en kan nog aangefpast worden:
// - tijd (de hele beschikbare periode)
// en is nog nodig en in te vullen:
// - een omschrijving en evt opmerking
@@ -180,15 +183,6 @@ if (rsv_ruimte_key == -1)
window.location.href = "reservering_new.asp" + purl;
}
function fn_res_ruimte(ruimte_key)
{
var purl = "?rsv_ruimte_key=-1"
+ "&res_ruimte_key=" + ruimte_key
+ "<%=safe.jsstring(transitParam)%>";
window.location.href = "reservering.asp" + purl;
}
</script>
</head>
<body>
@@ -267,44 +261,68 @@ if (rsv_ruimte_key == -1)
PAGE_END();
}
if (curPage == 2)
if (curPage == 2) // Lijst met geschikte ruimtes
{ PAGE_START({id: "page-2-"+rsv_ruimte_key});
HEADER({title: subject, back:!qrc, datatheme: (urole=='fe' ? jQFrontEndTheme : null) });
CONTENT_START();
function fnDataFilter(dataregel)
function fnDataFilter(oRs)
{
return dataregel && dataregel.will_fit;
return oRs.Fields("will_fit").Value;
}
function fncolIcon(dataregel)
function fncolIcon(oRs)
{
var icon = "";
var hint = "";
icon = "../Pictures/wijzigen_p.png";
if (dataregel.image != null)
var icon = "../Pictures/house_p.png";
if (oRs.Fields("image_url").Value != null)
{
icon = S("res_image_path") + dataregel.image;
icon = oRs.Fields("image_url").Value;
//if (!icon.match(/^http/))
// icon = S("res_image_path") + icon;
}
hint = L("lcl_do_reservering_hint");
return '<img src="' + icon + '" title="' + hint + '">';
return icon;
}
function fncol1Link(dataregel)
function fncol1Link(oRs, processParams)
{
var nurl = "javascript:fn_res_ruimte("+dataregel["res_ruimte_key"]+")";
if (processParams && processParams.disc_key)
{
var deepurl = oRs.Fields("deepurl").Value;
deepurl += "&res_ruimte_key=" + oRs.Fields("res_ruimte_key").Value
+ "&bez_omschr=" + "Vanuit+extern+systeem" // TODO
//+ "&flex_defaults=" + escape(extern_flex);
var orghome = HTTP.urlzelf() + "/appl/pda/facilitor.asp";
var nurl = "../res/res_goto_extern.asp?res_disc_key=" + processParams.disc_key
+ "&deepurl=" + escape(deepurl + transitParamExtern + "&orghome=" + orghome); // extern kan niets met onze act_key
}
else
{
var nurl = "reservering.asp?rsv_ruimte_key=-1"
+ "&res_ruimte_key=" + oRs.Fields("res_ruimte_key").Value
+ transitParam;
}
return nurl;
};
function fnDetail(dataregel)
function fnDetail(oRs)
{
// return toTimeString(dataregel.begintijd);
}
function fnSubheader(dataregel)
function fnSubheader(oRs)
{
// Toon extra gegevens over deze ruimte.
return safe.html(dataregel.omschrijving);
var bMin = oRs.Fields("bMin").Value;
var bMax = oRs.Fields("bMax").Value;
var capc_txt = String(bMin) + ((bMin!=bMax)?"-"+bMax:"") + " pers.";
if (oRs.Fields("prijs").Value)
capc_txt += ", " + S("currency_pref") + safe.curr(oRs.Fields("prijs").Value)
var txt = "<div class='listbodytext'>" + safe.html(capc_txt) + "</div>";
txt += "<div class='listbodytext'>" + safe.html(oRs.Fields("omschrijving").Value) + "</div>";
return txt;
/* // Voorlopig nog niet de beschikbare tijden laten zien.
var vrij = "";
@@ -360,10 +378,10 @@ if (rsv_ruimte_key == -1)
var plan_bezet_info = res.plan_bezet_info(params);
set_will_fit(plan_rooms_info, plan_bezet_info, params)
var rst = new ResultsetTable({ data: plan_rooms_info
var rst = new ResultsetTable({ dataset: plan_rooms_info
, fnDataFilter: fnDataFilter
, keyColumn: "res_ruimte_key"
//, iconColumn: fncolIcon
, iconColumn: fncolIcon
, linkColumn: fncol1Link
, headerColumn: "res_ruimte_nr"
//, detailColumn: fnDetail
@@ -376,6 +394,57 @@ if (rsv_ruimte_key == -1)
});
var cnt = rst.processResultset();
// En nu de externen
{ var autfunction = "WEB_RESUSE"; // TODO
// Overzicht externe ruimtes
var sql = res.getremotes_sql(autfunction);
var oRs = Oracle.Execute(sql);
while( !oRs.eof )
{
var disc_key = oRs.Fields("ins_discipline_key").Value;
%>
<div class="resprodextern">
<%= L("lcl_res_extern_prefix") + Server.HTMLencode(oRs.Fields("ins_discipline_omschrijving").Value)%>
</div>
<%
var url = oRs.Fields("res_disc_params_remoteurl").Value + "&API=RESINFO";
var resparams = {
res_van: params.res_van,
res_tot: params.res_tot,
reg: getFParamInt("regiokey", -1),
dist: getFParamInt("districtkey", -1),
loc: getFParamInt("locatiekey", -1),
bld: getFParamInt("gebouwkey", -1),
ver: getFParamInt("verdiepingkey", -1),
rui: getFParamInt("ruimtekey", -1),
ruimtecat: []
};
if (params.loc) // Aan de andere kant kennen we onze key niet, daarom via plaats.
resparams.alg_locatie_plaats = new Locatie(params.loc).alg_locatie_plaats();
resparams.request = "plan_rooms_info";
resparams.mobile = true;
/*global*/ plan_rooms_info = HTTP.getJSON(url, resparams).plan_rooms_info;
resparams.request = "plan_bezet_info";
/*global*/ plan_bezet_info = HTTP.getJSON(url, resparams).plan_bezet_info;
set_will_fit(plan_rooms_info, plan_bezet_info, resparams)
__DoLog("plan_rooms_info")
__DoLogj(plan_rooms_info)
rst.dataset = plan_rooms_info;
rst.sql = null;
rst.ID = "prodtable2";
var histogram = rst.processResultset({ disc_key: disc_key });
var allEmpty = allEmpty && (histogram == -1);
oRs.MoveNext();
}
oRs.close();
}
CONTENT_END();
FOOTER();

View File

@@ -210,7 +210,7 @@
// Selecteer de nabije reserveringen van deze ruimte, lopende of aanstaand
// Werkt niet goed bij de dagovergangen (waar alleen ontwikkelaars last van hebben)
if (RuimteMode)
if (RuimteMode) // TODO: DIT HOUDT NOG GEEN REKENING MET KOPPELZALEN
{
// Zoek alle bestaande reserveringen op deze ruimte die nog bezig zijn of komen
sql = "SELECT rm.res_reservering_key,"

View File

@@ -4,9 +4,9 @@
$Revision$
$Id$
PAS OP: voor de data optie (ipv. sql) wordt oRs.EOF ietswat getruct gezet.
Anders dan bij de OLEDB.Recordset is deze getructe EOF wel case
sensitive.
PAS OP: Soms gebruikt in combinatie met shared/data_recordset.inc.
Zie het commentaar daarin met betrekking tot het case-sensitive
zijn van bijvoorbeeld oRs.EOF
*/
%>
@@ -16,7 +16,7 @@ function ResultsetTable(params)
{
this.emptySetString = L("lcl_empty_rstable");
this.sql = null;
this.data = null; // of sql of data meegeven. Data is dan een array van objecten met properies
this.dataset = null; // of sql of dataset meegeven. Data is dan een array van objecten met properies
this.ID = null;
this.rowNum = 0;
this.showAll = null;
@@ -36,8 +36,10 @@ ResultsetTable.prototype.makeTableRow = __rsMakeTableRow;
/*global*/ isData = false;
function __rsProcessResultset()
function __rsProcessResultset(processParams)
{
this.processParams = processParams;
if (this.sql)
{
var oRs = Oracle.Execute(this.sql);
@@ -45,7 +47,7 @@ function __rsProcessResultset()
else
{
/*global*/isData = true;
oRs = { EOF: this.data.length == 0 };
oRs = new data_recordset( this.dataset );
}
if (oRs == null || oRs.EOF)
@@ -63,20 +65,9 @@ function __rsProcessResultset()
(cnt < S("qp_maxrows2")) &&
!oRs.EOF; cnt++)
{
if (this.data)
{
oRs = this.data[cnt]; // eigenlijk: dataregel
oRs.Fields = function(field) { return this[field]; }
}
if (this.fnDataFilter && !this.fnDataFilter(oRs))
{
if (this.sql)
oRs.MoveNext();
else
{
oRs.EOF = cnt + 1 >= this.data.length;
}
oRs.MoveNext();
continue;
}
@@ -92,12 +83,7 @@ function __rsProcessResultset()
if (this.groupColumn)
var lastGroup = __fnContent(this.groupColumn)(oRs);
if (this.sql)
oRs.MoveNext();
else
{
oRs.EOF = cnt + 1 >= this.data.length;
}
oRs.MoveNext();
if (this.groupColumn)
{
@@ -146,25 +132,29 @@ function __rsMakeTableRow(oRs, cnt)
var line = "";
if (this.iconColumn)
line += __fnContent(this.iconColumn)(oRs);
{
var icon = __fnContent(this.iconColumn)(oRs, this.processParams)
if (icon)
line += '<img src="' + safe.htmlattr(icon) + '">'
}
var headTxt = "";
if (this.headerColumn)
headTxt = __fnContent(this.headerColumn)(oRs);
headTxt = __fnContent(this.headerColumn)(oRs, this.processParams);
if (this.detailColumn)
headTxt += "<span class='cs1'>"+(__fnContent(this.detailColumn)(oRs) || "")+"</span>";
headTxt += "<span class='cs1'>"+(__fnContent(this.detailColumn)(oRs, this.processParams) || "")+"</span>";
line += "<h3 class='c1'>" + headTxt + "</h3>";
if (this.asideColumn && __fnContent(this.asideColumn)(oRs))
line += "<p class='ui-li-count'>" + __fnContent(this.asideColumn)(oRs) +"</p>";
line += "<p class='ui-li-count'>" + __fnContent(this.asideColumn)(oRs, this.processParams) +"</p>";
if (this.subheaderColumn)
line += "<div class='subheader'>" + __fnContent(this.subheaderColumn)(oRs) +"</div>";
line += "<div class='subheader'>" + __fnContent(this.subheaderColumn)(oRs, this.processParams) +"</div>";
if (this.linkColumn)
{
var lnk = __fnContent(this.linkColumn)(oRs);
var lnk = __fnContent(this.linkColumn)(oRs, this.processParams);
if (lnk)
{
line = "<a href='"+safe.htmlattr(lnk)+"' data-ajax='false'>"
@@ -223,17 +213,9 @@ function __fnContent(fnContent)
if (fnContent instanceof Function)
return fnContent;
if (isData)
return function (dataregel)
{
__DoLog("Data" + dataregel);
return ResultsetTable.formatValue(dataregel[fnContent], {datatype: this.datatype, decimals: this.decimals, nomidnight: this.nomidnight})
} ;
else
return function (oRs)
{
return ResultsetTable.formatValue(oRs.Fields(fnContent).value, {datatype: this.datatype, decimals: this.decimals, nomidnight: this.nomidnight})
} ;
return function (oRs)
{
return ResultsetTable.formatValue(oRs.Fields(fnContent).Value, {datatype: this.datatype, decimals: this.decimals, nomidnight: this.nomidnight})
} ;
}
%>

View File

@@ -923,6 +923,24 @@ res = {
oRs = Oracle.Execute(sql);
var all_rooms = []; // Hierin bouwen alle ruimtes op
if (params.get_deepurl)
{ // Bepaal de URL waarmee straks een boeking uitgevoerd kan worden
if (params.mobile)
{
var deepurl = HTTP.urlzelf() + "/pda/reservering.asp";
}
else
{
var sql = "SELECT fac_bookmark_id"
+ " FROM fac_bookmark"
+ " WHERE fac_bookmark_xmlnode = 'reservering'";
var oRs2 = Oracle.Execute(sql);
var bm = oRs2("fac_bookmark_id").Value;
var deepurl = HTTP.urlzelf() + "/?fac_id=" + customerId + "&u=" + bm;
oRs2.Close();
}
}
while (!oRs.eof)
{
var room = { res_ruimte_key: oRs("res_ruimte_key").Value,
@@ -942,18 +960,16 @@ res = {
if (room.eindtijd > S("res_t2")) room.eindtijd = S("res_t2");
if (room.begintijd > room.eindtijd) room.begintijd = room.eindtijd;
if (params.get_deepurl)
{ // Bepaal de URL waarmee straks een boeking uitgevoerd kan worden
var sql = "SELECT fac_bookmark_id"
+ " FROM fac_bookmark"
+ " WHERE fac_bookmark_xmlnode = 'reservering'";
var oRs2 = Oracle.Execute(sql);
var bm = oRs2("fac_bookmark_id").Value;
oRs2.Close();
room.deepurl = HTTP.urlzelf() + "/?fac_id=" + customerId + "&u=" + bm;
{
room.deepurl = deepurl;
if (oRs("res_ruimte_image").value)
room.image_url = HTTP.urlzelfnoroot() + S("res_image_path") + oRs("res_ruimte_image").value;
}
else
{
if (oRs("res_ruimte_image").value)
room.image_url = S("res_image_path") + oRs("res_ruimte_image").value;
}
all_rooms.push(room);
oRs.MoveNext();
}
@@ -1179,13 +1195,46 @@ res = {
var oRs = Oracle.Execute(sql);
var bm = oRs("fac_bookmark_id").Value;
oRs.Close();
var deepurl = HTTP.urlzelf() + "/?fac_id=" + customerId + "&u=" + bm;
if (params.mobile)
var deepurl = HTTP.urlzelf() + "/appl/pda/reservering.asp?fac_id=" + customerId + "&rsv_ruimte_key=";
else
var deepurl = HTTP.urlzelf() + "/?fac_id=" + customerId + "&u=" + bm + "&k=" ;
for (var r in user_res)
{
user_res[r].deepurl = deepurl + "&k=" + user_res[r].item_key
user_res[r].deepurl = deepurl + user_res[r].item_key
}
return user_res;
},
getremotes_sql: function (autfunction)
{
var sql = "SELECT dis.ins_discipline_key,"
+ " "+ lcl.xsqla('dis.ins_discipline_omschrijving','dis.ins_discipline_key') +","
+ " res_disc_params_remoteurl"
+ " FROM res_v_aanwezigdiscipline dis, res_disc_params rdp"
+ " WHERE dis.ins_discipline_key = rdp.res_ins_discipline_key"
+ " AND ins_discipline_min_level = 3" // Alleen nog Ruimte
+ " AND res_disc_params_remoteurl IS NOT NULL"
+ " AND dis.ins_discipline_key IN("
+ " SELECT g.ins_discipline_key FROM fac_v_webgebruiker g, fac_functie f "
+ " WHERE g.fac_functie_key = f.fac_functie_key "
+ " AND f.fac_functie_code = " + safe.quoted_sql(autfunction)
+ " AND g.fac_gebruiker_alg_level_write < 9"
+ " AND g.fac_gebruiker_prs_level_write < 9"
+ " AND g.prs_perslid_key = " + user_key + ")";
return sql;
},
hour_px: function (width_px, nr_days)
{
var nr_hours = nr_days * (S("res_t2") - S("res_t1"));
var targethour_px = width_px / nr_hours;
var hour_px = 48;
if (targethour_px < 48) hour_px = 36;
if (targethour_px < 36) hour_px = 24;
if (targethour_px < 24) hour_px = 16;
if (targethour_px < 16) hour_px = 8;
if (targethour_px < 8) hour_px = 4;
return hour_px;
}
}

View File

@@ -88,16 +88,10 @@ var authparams = user.checkAutorisation(autfunction)
<% FCLTHeader.Generate() %>
<%
// Bereken dynamisch breedte blokjes
var width_px = parseInt( getQParamInt("width_px", 1024));
var width_px = getQParamInt("width_px", 1024);
var nr_days = Math.round(1 + (res_tot.midnight() - res_van.midnight()) / 24 / 60 / 60 / 1000);
var nr_hours = nr_days*(S("res_t2")-S("res_t1"));
var targethour_px = (width_px - 250) / nr_hours;
var hour_px = 48;
if (targethour_px < 48) hour_px = 36;
if (targethour_px < 36) hour_px = 24;
if (targethour_px < 24) hour_px = 16;
if (targethour_px < 16) hour_px = 8;
if (targethour_px < 8) hour_px = 4;
var hour_px = res.hour_px(width_px - 250, nr_days);
%>
<script type="text/javascript">

View File

@@ -25,22 +25,7 @@ var deepurl = getQParam("deepurl");
var autfunction = "WEB_RESUSE"; // altijd?
var sql = "SELECT dis.ins_discipline_key,"
+ " "+ lcl.xsqla('dis.ins_discipline_omschrijving','dis.ins_discipline_key') +","
+ " res_disc_params_remoteurl"
+ " FROM res_v_aanwezigdiscipline dis, res_disc_params rdp"
+ " WHERE dis.ins_discipline_key = rdp.res_ins_discipline_key"
// + " AND ins_discipline_min_level = 1" // TODO?
+ " AND res_disc_params_remoteurl IS NOT NULL"
+ " AND res_ins_discipline_key = " + res_disc_key
+ " AND dis.ins_discipline_key IN("
+ " SELECT g.ins_discipline_key FROM fac_v_webgebruiker g, fac_functie f "
+ " WHERE g.fac_functie_key = f.fac_functie_key "
+ " AND f.fac_functie_code = " + safe.quoted_sql(autfunction)
+ " AND g.fac_gebruiker_alg_level_write < 9"
+ " AND g.fac_gebruiker_prs_level_write < 9"
+ " AND g.prs_perslid_key = " + user_key
+ " )";
var sql = res.getremotes_sql(autfunction);
var oRs = Oracle.Execute(sql);
if (oRs.Eof)

View File

@@ -226,16 +226,8 @@ __Log("start make_plan_room");
}
var nr_days = Math.round(1 + (params.res_tot.midnight() - params.res_van.midnight()) / 24 / 60 / 60 / 1000);
// Bereken dynamisch breedte blokjes
var nr_hours = nr_days * (S("res_t2") - S("res_t1"));
var targethour_px = (params.width_px - 300) / nr_hours;
var hour_px = 48;
if (targethour_px < 48) hour_px = 36;
if (targethour_px < 36) hour_px = 24;
if (targethour_px < 24) hour_px = 16;
if (targethour_px < 16) hour_px = 8;
if (targethour_px < 8) hour_px = 4;
var hour_px = res.hour_px(width_px - 300, nr_days);
var onclick = "";
if (!params.forSelectRoom && authparams.PRSwritelevel < 9 && authparams.ALGwritelevel < 9)

View File

@@ -58,7 +58,7 @@ var show_park = getFParamInt("park", 0)==1;
// Bereken dynamisch breedte blokjes
var width_px = parseInt( getQParamInt("width_px", 1024));
var width_px = getQParamInt("width_px", 1024);
var nr_days = Math.round(1+(date_to.midnight() - date_from.midnight())/24/60/60/1000);
var nr_hours = nr_days*(S("res_t2")-S("res_t1"));
var targethour_px = (width_px-250)/nr_hours;
@@ -68,6 +68,7 @@ if (targethour_px < 36) hour_px = 24;
if (targethour_px < 24) hour_px = 16;
if (targethour_px < 16) hour_px = 8;
if (targethour_px < 8) hour_px = 4;
var hour_px = res.hour_px(width_px - 250, nr_days);
%>
<script type="text/javascript">

View File

@@ -49,7 +49,7 @@ var fnStep = getFParam("fnStep", null); // Clientside functie voor Next/Prev
// Bereken dynamisch breedte blokjes
// PAS OP: identiek houden aan res_plan_room.inc!
var width_px = parseInt( getQParamInt("width_px", 1024));
var width_px = getQParamInt("width_px", 1024);
var nr_days = Math.round(1+(date_to.midnight() - date_from.midnight())/24/60/60/1000);
var nr_hours = nr_days*(S("res_t2")-S("res_t1"));
var targethour_px = (width_px-300)/nr_hours;
@@ -59,6 +59,7 @@ if (targethour_px < 36) hour_px = 24;
if (targethour_px < 24) hour_px = 16;
if (targethour_px < 16) hour_px = 8;
if (targethour_px < 8) hour_px = 4;
hour_px = res.hour_px(width_px-300, nr_days);
%>
<html style='overflow:scroll'>
@@ -265,21 +266,7 @@ if (targethour_px < 8) hour_px = 4;
<table>
<%
// Overzicht externe ruimtes
var sql = "SELECT dis.ins_discipline_key,"
+ " "+ lcl.xsqla('dis.ins_discipline_omschrijving','dis.ins_discipline_key') +","
+ " res_disc_params_remoteurl"
+ " FROM res_v_aanwezigdiscipline dis, res_disc_params rdp"
+ " WHERE dis.ins_discipline_key = rdp.res_ins_discipline_key"
// + " AND ins_discipline_min_level = 1" // TODO?
+ " AND res_disc_params_remoteurl IS NOT NULL"
+ " AND dis.ins_discipline_key IN("
+ " SELECT g.ins_discipline_key FROM fac_v_webgebruiker g, fac_functie f "
+ " WHERE g.fac_functie_key = f.fac_functie_key "
+ " AND f.fac_functie_code = " + safe.quoted_sql(autfunction)
+ " AND g.fac_gebruiker_alg_level_write < 9"
+ " AND g.fac_gebruiker_prs_level_write < 9"
+ " AND g.prs_perslid_key = " + user_key
+ " )";
var sql = res.getremotes_sql(autfunction);
var oRs = Oracle.Execute(sql);
// Als je hier weet dat er intern niks was zou je deze externe opties initieel opengeklapt willen?
while( !oRs.eof )
@@ -302,9 +289,9 @@ if (targethour_px < 8) hour_px = 4;
xparams.alg_locatie_plaats = new Locatie(params.loc).alg_locatie_plaats();
xparams.request = "plan_rooms_info";
var plan_rooms_info = HTTP.getJSON(url, xparams);
var plan_rooms_info = HTTP.getJSON(url, xparams).plan_rooms_info;
xparams.request = "plan_bezet_info";
var plan_bezet_info = HTTP.getJSON(url, xparams);
var plan_bezet_info = HTTP.getJSON(url, xparams).plan_bezet_info;
xparams.extern = true;
params.disc_key = oRs("ins_discipline_key").Value;

View File

@@ -48,7 +48,7 @@ var vis = getQParamInt("vis", null);
var autfunction = urole == "fe"? "WEB_RESUSE" : "WEB_RESFOF";
var width_px = parseInt(getQParamInt("width_px", 1024));
var width_px = getQParamInt("width_px", 1024);
%>
<html>
<head>

View File

@@ -43,7 +43,7 @@ if (String(Request.ServerVariables("HTTP_ACCEPT")).match(/application\/json/) !=
msg += "\n(Zie " + LogfileName() + ")";
}
if ((Application("otap_environment") == "O" || Session("logging") > 0) && objASPError.Description)
msg += "\n\n(gaat niet naar klanten:)\n" + objASPError.Description;
msg += "\n\n(gaat niet naar klanten:)\n" + objASPError.Description + " " + objASPError.File + "(" + objASPError.Line + ")";
Response.Write("FCLTFriendly:" + msg); // FCLTFriendly wordt zo opgepikt door FcltJquery.js ajaxSetup error handler
LogErrorToFile();

View File

@@ -123,6 +123,9 @@ if (S("auto_https") && Request.ServerVariables("SERVER_PORT") != "443")
Response.End;
}
if (Request.QueryString("orghome").Count>0) // Remember it. Share&Meet's
Session("orghome") = String(Request.QueryString("orghome"));
// Merk op: door onze Server.Transfer's met API's of inloggen zie je in Fiddler wel
// eens dat X-FRAME-OPTIONS twee keer in de header komt. Slordig maar acceptabel.
if (!S("allow_framed_facilitor"))

View File

@@ -145,7 +145,6 @@ var shared = {
imgstr = "../Pictures/flike_good.png";
return imgstr;
}
};
// Check for parameter pName and return the value

View File

@@ -0,0 +1,62 @@
<% /*
File:
$Revision$
$Id$
File: shared/data_recordset.inc
Description: Emuleer een ADODB recordset gebaseerd op een JavaScript dataobject
Context: Meestal in combinatie met resultset_table
Notes: De ADODB interface is normaal gesproken case-insensitive qua properties
oRs.eof, oRs.Eof en oRs.EOF werken daar allemaal.
Deze emulator doet dat niet: je moet altijd EOF gebruiken (hoofdletters)
Default properties worden ook niet ondersteund. In plaats van
oRs("veldnaam") moet je oRs.Fields("veldnaam").Value gebruiken
Let verder op dat de veldnaam ook case-sensitive is!
*/
%>
<%
function data_recordset(dataset)
{
this.dataset = dataset;
this.position = -1;
this.Fields = function (columnName)
{
if (typeof columnName == "string")
return { Value: this.dataset[this.position][columnName] };
var cnt = columnName;
for (var nm in this.dataset[this.position])
{
if (cnt == 0)
{
return { Value: this.dataset[this.position][nm],
Name: nm.toUpperCase()};
}
cnt --;
}
};
this.MoveNext = function ()
{
this.position ++;
this.EOF = this.position+1 > this.dataset.length;
}
this.MoveFirst = function ()
{
this.position = 0;
this.EOF = this.position+1 > this.dataset.length;
this.Fields.Count = 0;
if (!this.EOF)
{
for (var nm in this.dataset[0])
this.Fields.Count++;
}
}
this.close = function () {};
this.MoveFirst(); // Naar eerste record
}%>

View File

@@ -229,6 +229,15 @@ function __Log(s, optionalCaller, leave_open)
}
}
// Log een JavaScript hash
function __Logj(j, optionalCaller)
{
if (Session("logging")&1)
{
return __DoLogj(j, null);
}
}
function __callerTekst(clr)
{
if (!clr)
@@ -260,6 +269,15 @@ function __DoLog(s, optionalColor, optionalCaller, leave_open)
}
}
// Log een JavaScript hash
function __DoLogj(j, optionalColor)
{
var s = String(j);
if (typeof JSON != "undefined" && typeof j == "object")
s = JSON.stringify(j, null, '&nbsp;&nbsp;').replace(/\n/ig,"<br>");
return __DoLog(s, optionalColor)
}
function __DumpCollection(pCollection, title, optionalColor)
{
var sLog = title + " ("+pCollection.Count+" items):";

47
APPL/Shared/rater.inc Normal file
View File

@@ -0,0 +1,47 @@
<% /*
$Revision$
$Id$
File: Calendar.inc
Description: generic interface function for selecting a 'date' and/or time
*/ %>
<%
FCLTHeader.Requires({ plugins: ["jQuery"],
js: ["../localscripts/raty/jquery.raty.min.js"],
extrahead: _initRater });
function _initRater()
{
%>
<script>
$(document).ready(function () {
$(".rater").raty({
score: function() {
return (parseInt($(this).attr('data-score')))/2;
},
readOnly: function() {
return $(this).attr('readonly');
},
showHalf : true,
half : true,
path: '../localscripts/raty/img/',
width: 120
});
});
</script>
<%
}
function rater(rating, params)
{
params = params||{};
if (!rating && params.shownone)
return "";
likesymbol = "<div class='rater' data-score='"+rating+ (params.readonly?"' readonly='1'":"")+"></div>";
return likesymbol;
}
%>

View File

@@ -12,7 +12,7 @@
- Geen inline actions
- Geen multiactions
- Geen (overtollige) styling
==>LET OP: mobile gebruikt dit bestand tegenwoordig helemaal niet meer. Bovenstaand commentaart
==>LET OP: mobile gebruikt dit bestand tegenwoordig helemaal niet meer. Bovenstaand commentaar
is dus wat deprecated
*/
%>
@@ -707,7 +707,7 @@ function __rsProcessResultset(processParams) // processParams wordt blind aan al
if (this.pRs)
oRs = this.pRs;
else if (this.dataset)
oRs = new PseudoRecordset( dataset );
oRs = new data_recordset( this.dataset );
else
oRs = Oracle.Execute(sql);
@@ -1707,45 +1707,4 @@ function __cWithCustomSort(fnCustomSort)
return this;
}
function PseudoRecordset(dataset)
{
this.dataset = dataset;
this.counter = -1;
this.Fields = function (columnName)
{
if (typeof columnName == "string")
return { Value: this.dataset[this.counter][columnName.toLowerCase()] };
var cnt = columnName;
for (var nm in this.dataset[this.counter])
{
if (cnt == 0)
{
return { Value: this.dataset[this.counter][nm],
Name: nm.toUpperCase()};
}
cnt --;
}
};
this.MoveNext = function ()
{
this.counter ++;
this.EOF = this.counter+1 > this.dataset.length;
}
this.MoveFirst = function ()
{
this.counter = 0;
this.EOF = this.counter+1 > this.dataset.length;
this.Fields.Count = 0;
if (!this.EOF)
{
for (var nm in this.dataset[0])
this.Fields.Count++;
}
}
this.close = function () {};
this.MoveFirst(); // Naar eerste record
}
%>