FCLT#75530 Default QR codes voor reserveerbare objecten/ruimtes en gewone objecten

svn path=/Website/trunk/; revision=60521
This commit is contained in:
2023-05-25 14:14:29 +00:00
parent cb7904128c
commit f3ec983923
15 changed files with 144 additions and 97 deletions

View File

@@ -114,6 +114,8 @@ alg = {
autfunctionUSE = "WEB_RUIUSE";
break;
}
rresult.readmgt = rresult.canRead("WEB_ALGMGT");
rresult.writemgt = rresult.canWrite("WEB_ALGMGT");
rresult.writeman = rresult.canWrite(autfunctionMAN);
if (onrgoedlvl != "T")
@@ -151,6 +153,8 @@ alg = {
var level = (oRs(0).Value==null)?-1:oRs(0).Value;
oRs.Close();
rresult.readmgt = rresult.authparams("WEB_ALGMGT").ALGreadlevel <= level;
rresult.writemgt = rresult.authparams("WEB_ALGMGT").ALGwritelevel <= level;
rresult.readman = rresult.authparams("WEB_ALGMAN").ALGreadlevel <= level;
rresult.writeman = rresult.authparams("WEB_ALGMAN").ALGwritelevel <= level;
rresult.readuse = rresult.authparams("WEB_ALGUSE").ALGreadlevel <= level;

View File

@@ -69,6 +69,13 @@ if (!room_data.cadcontours.length)
var url = '../cad/ShowRoom.asp?rKey=' + <%=room_key%>;
FcltMgr.openModalDetail(url, { titel: L("lcl_prs_wp_fgraph" ) + ": <%=safe.jsstring(room_data.name) %>"});
}
<% if (this_alg.readmgt) { %>
function qrcode() {
var url = "../fac/fac_print_qrcode.asp?title=<%=safe.jsstring(safe.url(L("lcl_pda_res_gereserveerd")))%>"
+ "&text=<%=safe.jsstring(safe.url("/?u=alg_ruimte&k=" + room_key))%>";
FcltMgr.openModalDetail(url, { titel: L("lcl_make_qrc_title2") });
}
<% } %>
</script>
</head>
@@ -78,13 +85,15 @@ if (!room_data.cadcontours.length)
if (!room_deleted)
{
if (this_alg.writeman || this_alg.writeuse)
buttons.push({title: L("lcl_change"), action:"room_change()", icon: "fa-fclt-edit" });
buttons.push({ title: L("lcl_change"), action:"room_change()", icon: "fa-fclt-edit" });
var xfunc = user.func_enabled2("CAD", { isOptional: true });
if (xfunc && xfunc.canRead("WEB_CADUSE"))
buttons.push({title: L("lcl_prs_wp_fgraph"), action:"openFG()", icon: "fa-map-marker" });
buttons.push({ title: L("lcl_prs_wp_fgraph"), action:"openFG()", icon: "fa-map-marker" });
if (this_alg.readmgt)
buttons.push({ title: L("lcl_make_qrc"), tooltip: L("lcl_make_qrc_title"), action: "qrcode()", icon: "fa-qrcode" });
if (this_alg.writeman) // RUIMAN nodig
buttons.push({title: L("lcl_delete"), action:"room_delete()", icon: "fa-trash-alt" });
buttons.push({ title: L("lcl_delete"), action:"room_delete()", icon: "fa-trash-alt" });
}
IFRAMER_HEADER(L("lcl_alg_ruimte_frame"), buttons);

View File

@@ -53,7 +53,12 @@ __Log("== Entering shorturl.asp ==");
'reservering': { gui: 'appl/res/res_reservering.asp?rsv_ruimte_key=', mob: 'appl/pda/reservering.asp?rsv_ruimte_key=' },
'ruimte': { gui: 'appl/alg/alg_ruimte.asp?key=', mob: 'appl/pda/ruimte.asp?ruimte_key=' },
'verdieping': { gui: 'appl/alg/alg_verdieping.asp?key='},
'xreservering': { gui: 'appl/res/res_reservering.asp?rsv_ruimte_key='}
'xreservering': { gui: 'appl/res/res_reservering.asp?rsv_ruimte_key='},
/* 'Genereer QR code's; (default acties en/of qrc=1) */
'alg_ruimte': { gui: 'appl/alg/alg_ruimte.asp?key=', mob: 'appl/pda/reserveringen.asp?qrc=1&alg_ruimte_key=' },
'res_ruimte': { gui: 'appl/mgt/res_ruimte.asp?id=', mob: 'appl/pda/reserveringen.asp?qrc=1&res_ruimte_key=' },
'res_object': { gui: 'appl/mgt/res_deel.asp?id=', mob: 'appl/pda/reserveringen.asp?qrc=1&res_deel_key=' },
'ins_object': { gui: 'appl/ins/ins_deel.asp?ins_key=', mob: 'appl/pda/ins_deel.asp?qrc=1&ins_key=' }
}
var keyparam = getQParamInt("k", -1);

View File

@@ -4,38 +4,45 @@
$Id$
File: fac_print_qrcode.asp
Description: Toont de persoonlijk QR-authenticatiecode van de bookmark
Parameters:
Description: Maakt een QR code op basis van bookmark_id of meegegeven text-parameter
Parameters: text: waarde van de qr code
Context:
Note:
*/ %>
<!--#include file="../Shared/common.inc"-->
<!--#include file="../../appl/shared/iface.inc"-->
<!--#include file="../../appl/FAC/fac.inc" -->
<!--#include file="../../appl/fac/fac.inc" -->
<%
var bkm_id = getQParam("bkm_id");
var sql = "SELECT fac_bookmark_naam"
+ " FROM fac_bookmark"
+ " WHERE fac_bookmark_id = " + safe.quoted_sql(bkm_id);
var oRs = Oracle.Execute(sql);
var bkm_naam = oRs("fac_bookmark_naam").value;
var bkm_id = getQParam("bkm_id", "");
var title = getQParam("title", L("lcl_fac_qrcode"));
var qrc = getQParam("text", "");
if (bkm_id) {
var sql = "SELECT fac_bookmark_naam"
+ " FROM fac_bookmark"
+ " WHERE fac_bookmark_id = " + safe.quoted_sql(bkm_id);
var oRs = Oracle.Execute(sql);
title = oRs("fac_bookmark_naam").value;
oRs.Close();
qrc = "/?u=" + bkm_id;
}
%>
<html>
<head>
<% FCLTHeader.Generate(); %>
</head>
<body class="modal" id="authQR" scroll="no">
<body class="modal" id="mod_qrcode" scroll="no">
<% MODAL_START();
var buttons = {};
IFRAMER_HEADER(bkm_naam, buttons); %>
<center><img class="QRC" alt="<%=L("lcl_fac_qrcode")%>" src='../shared/qrcode.asp?size=4&text=<%=Server.URLEncode("/?u=" + bkm_id)%>'></center>
<% MODAL_END(); %>
var buttons = [{ title: L("lcl_slnk_print"), icon: "fa-print", action: "print()", id: "print_qr", importance: 2 }];
MODAL_BLOCK_START("qrcode", title, { "icon": "fa-qrcode", isModal: true, "buttons": buttons }); %>
</table>
<div class="qrcode">
<img class="qrc" alt="<%=L("lcl_fac_qrcode")%>" src="../shared/qrcode.asp?size=16&text=<%=safe.htmlattr(safe.url(qrc))%>">
</div>
<% MODAL_BLOCK_END();
MODAL_END(); %>
</body>
</html>
<% ASPPAGE_END(); %>
<% ASPPAGE_END(); %>

View File

@@ -93,7 +93,7 @@ oRs.close();
{title: L("lcl_delete"), action: "bkm_delete()", icon: "fa-trash-alt" }
];
}
buttons.push({title: L("lcl_fac_print_qrcode"), action: "bkm_print()", icon: "fa-mobile" });
buttons.push({title: L("lcl_fac_print_qrcode"), action: "bkm_print()", icon: "fa-qrcode" });
IFRAMER_HEADER(L("lcl_fac_bookmark"), buttons);
%>

View File

@@ -18,7 +18,7 @@ FCLTHeader.Requires({ plugins:["suggest", "jQuery"],
js: ["jquery-ui.js"]
})
var urole = getQParamSafe("urole");
var urole = getQParamSafe("urole", "fe");
// Het maakt ons hier nog niet uit of we in SLE zitten
var urole = getQParamInt("self", 0) == 1 ? "fe" : urole;
var ins_key = getQParamInt("ins_key", -1);

View File

@@ -272,15 +272,20 @@ oRs.Close();
function ins_copy()
{
FcltMgr.openDetail("appl/ins/ins_deel.asp?urole=bo" + "&ins_key=<%=ins_key%>" + "&ins_copy=1", L("lcl_ins_copy") + " " + L("lcl_shared_object").toLowerCase());
FcltMgr.openDetail("appl/ins/ins_deel.asp?urole=bo" + "&ins_key=<%=ins_key%>" + "&ins_copy=1", L("lcl_ins_copy") + " " + L("lcl_ins_object").toLowerCase());
}
function qrcode() {
var url = "../fac/fac_print_qrcode.asp?title=<%=safe.jsstring(safe.url(L("lcl_ins_object") + " " + desc))%>"
+ "&text=<%=safe.jsstring(safe.url("/?u=ins_object&k=" + ins_key))%>";
FcltMgr.openModalDetail(url, { titel: L("lcl_make_qrc_title2") });
}
</script>
</head>
<body class="showmode" onLoad='javascript:init();'>
<% SUBFRAME_START(); %>
<% var buttons = [];
this_ins.verbruiksmeter = false;
<% this_ins.verbruiksmeter = false;
this_ins.contracts = false;
if (this_ins.canReadHistory)
{ // maar werd toch alleen hier gebruikt
@@ -321,29 +326,32 @@ oRs.Close();
if (!oRs.eof) uitleen_flex_present = true;
oRs.Close();
var buttons = [ ];
var buttons = [];
// In de frontoffice (uitgeleende objecten) mode kunnen alleen de flexkenmerken aangepast worden.
// Zijn er wel uitleen kenmerken anders hoeft de wijzig knop niet getoond te worden.
if ((this_ins.canChange || this_ins.canChangeOwn) && (urole == "bo" || (urole == "fo" && uitleen_flex_present)))
buttons.push({title: L("lcl_change"), action: "ins_change()", icon: "fa-fclt-edit" });
buttons.push({ title: L("lcl_change"), action: "ins_change()", icon: "fa-fclt-edit" });
if (canMelding)
buttons.push({title: L("lcl_do_amelding_hint"), action: "ins_melding()", icon: "fa-magic" });
buttons.push({ title: L("lcl_do_amelding_hint"), action: "ins_melding()", icon: "fa-magic" });
// Alleen historie kunnen tonen als het een verbruiksmeter betreft.
if (this_ins.verbruiksmeter)
buttons.push({title: L("lcl_history"), action: "showHistory()", icon: "fa-clock" });
buttons.push({ title: L("lcl_history"), action: "showHistory()", icon: "fa-clock" });
if (this_ins.canCopy)
buttons.push({ title: L("lcl_mld_copy"), icon: "fa-copy", action: "ins_copy()" });
if (this_ins.canDelete)
buttons.push({title: L("lcl_delete"), action: "ins_delete()", icon: "fa-trash-alt"});
buttons.push({ title: L("lcl_delete"), action: "ins_delete()", icon: "fa-trash-alt"});
if (user.has("WEB_INSMGT"))
buttons.push({ title: L("lcl_make_qrc"), tooltip: L("lcl_make_qrc_title"), action: "qrcode()", icon: "fa-qrcode" });
if (this_ins.hasRESMSU)
buttons.push({title: L("lcl_reserveerbaar"), action: "ins_reserveerbaar()", icon: (res_deel_key > 0 ? "fa-calendar-edit" : "fa-calendar"), tooltip: L("lcl_reserveerbaar_hint")});
buttons.push({ title: L("lcl_reserveerbaar"), action: "ins_reserveerbaar()", icon: (res_deel_key > 0 ? "fa-calendar-edit" : "fa-calendar"), tooltip: L("lcl_reserveerbaar_hint")});
buttons.push ({title: L("lcl_print"), action: "ins_print()", icon: "fa-print" });
buttons.push ({ title: L("lcl_print"), action: "ins_print()", icon: "fa-print" });
var headertitle = L("lcl_ins_frame_algemeen");
if (this_ins.isSleCil)

View File

@@ -153,6 +153,12 @@ var res_deelmodel_params = {
"scope"
]
},
"show": {
"requires": {
"js": ["../mgt/res_deel.js"]
},
"buttons": []
},
"edit": {
"requires": {
"js": ["../mgt/res_deel.js"]
@@ -172,6 +178,12 @@ var res_deelmodel_params = {
}
};
if (mode == "show" && res_deel_key > -1 && user.has("WEB_RESMGT")) {
res_deelmodel_params.show.buttons = [
{ title: L("lcl_make_qrc"), tooltip: L("lcl_make_qrc_title"), action: "qrcode(" + res_deel_key + ", '" + safe.jsstring(lcl_header.s) + "')", icon: "fa-qrcode" }
];
}
if (insMultiReserve)
{
delete res_deelmodel_params.edit.buttons;

View File

@@ -87,3 +87,9 @@ function pre_submit()
return true;
}
function qrcode(key) {
var url = "../fac/fac_print_qrcode.asp?title=" + encodeURIComponent(L("res_deel"))
+ "&text=" + encodeURIComponent("/?u=res_object&k=" + key);
FcltMgr.openModalDetail(url, { titel: L("lcl_make_qrc_title2") });
}

View File

@@ -78,7 +78,8 @@ var res_ruimtemodel_params = {
"show": {
"requires": {
"js": ["./res_ruimte.js"]
}
},
"buttons": []
},
"layout": {
"block": [
@@ -147,6 +148,12 @@ var res_ruimtemodel_params = {
}
};
if (mode == "show" && res_ruimte_key > -1 && user.has("WEB_RESMGT")) {
res_ruimtemodel_params.show.buttons.unshift(
{ title: L("lcl_make_qrc"), tooltip: L("lcl_make_qrc_title"), action: "qrcode", icon: "fa-qrcode" }
);
}
if (mode == "show" && res_ruimte_key > -1 && (S("msgraph_sync_level") & 6)) {
var sql = "SELECT ''"
+ " FROM res_rsv_ruimte rrr, res_ruimte_opstelling rro, res_ruimte rr"

View File

@@ -46,4 +46,10 @@ function sync_outlook(key) {
}).catch((errmsg) => {
console.error(errmsg);
});
}
function qrcode(key, title) {
var url = "../fac/fac_print_qrcode.asp?title=" + encodeURIComponent(title)
+ "&text=" + encodeURIComponent("/?u=res_ruimte&k=" + key);
FcltMgr.openModalDetail(url, { titel: L("lcl_make_qrc_title2") });
}

View File

@@ -273,7 +273,7 @@ function PAGE_START(params)
}
}
%><div data-role="page" id="<%=params.id ? params.id : 'page'%>" data-theme="<%=jQDataTheme%>"
<%=(params.pclass || bannerUrl ? " class='" + (bannerUrl ? "image-banner " : "") + params.pclass + "'" : "")%> ><%
<%=(params.pclass || bannerUrl ? " class='" + (bannerUrl ? "image-banner " : "") + (params.pclass || "") + "'" : "")%> ><%
}
function PAGE_END()
{

View File

@@ -193,6 +193,7 @@ function getBindlabel(plaats_niveau)
var transitParam = buildTransitParam(["qrc", "tiny"]);
var ins_info = {};
var imagePath;
if (ins_key == -1)
{
@@ -292,11 +293,15 @@ else
+ " , id.ins_deel_mjb_score1"
+ " , id.ins_deel_mjb_score2"
+ " , id.ins_discipline_key"
+ " , rd.res_deel_image"
+ " , id.ins_deel_image"
+ " , sd.ins_srtdeel_image"
+ " FROM ins_deel id"
+ " , ins_srtdeel sd"
+ " , res_deel rd"
+ " WHERE sd.ins_srtdeel_key = id.ins_srtdeel_key"
+ " AND id.ins_deel_key = " + ins_key;
+ " AND id.ins_deel_key = rd.res_ins_deel_key(+)";
var oRs = Oracle.Execute(sql);
if (!oRs.eof)
{
@@ -315,6 +320,8 @@ else
ins_info.ins_deel_mjb_score1 = oRs("ins_deel_mjb_score1").Value;
ins_info.ins_deel_mjb_score2 = oRs("ins_deel_mjb_score2").Value;
ins_info.perslid_key_beh = oRs("prs_perslid_key_beh").Value || -1;
ins_info.res_deel_image = oRs("res_deel_image").Value;
ins_info.ins_deel_image = oRs("ins_deel_image").Value;
ins_info.srtdeel_image = oRs("ins_srtdeel_image").Value;
ins_info.subject = ins_info.ins_srtdeel_omschrijving+ " " +ins_info.ins_deel_omschrijving;
ins_info.plaats_afdeling = getBindString(ins_info.ruimte_type, ins_info.ruimte_key, ins_info.ins_parent_key);
@@ -348,21 +355,18 @@ else
pRs.Close();
}
if (ins_info.srtdeel_image)
{
var imageFile = S("ins_image_path") + ins_info.srtdeel_image;
var fso = new ActiveXObject("Scripting.FileSystemObject");
if (fso.FileExists(Server.MapPath(imageFile)))
hasImage = true;
}
/* Pak de specifiekste foto */
var this_photoinfo = ins.photoinfo(ins_key);
var imgPath = "";
if (this_photoinfo.isDefault && hasImage)
imgPath = imageFile;
else
imgPath = this_photoinfo.photopath;
imagePath = ins.photoinfo(ins_key).photopath;
if (ins_info.srtdeel_image) {
imagePath = S("ins_image_path") + ins_info.srtdeel_image;
}
if (ins_info.ins_deel_image) {
imagePath = S("ins_image_path") + "deel/" + ins_info.ins_deel_image;
}
if (ins_info.res_deel_image) {
imagePath = S("res_image_path") + "deel/" + ins_info.res_deel_image;
}
}
// Mag object verplaatst worden.
this_ins.canMove = (ins_info.ruimte_type == "R" && this_ins.canChangeAlg && (this_ins.canWrite("WEB_INSMAN") || this_ins.canWrite("WEB_INSUSE")) && !eLendOut);
@@ -400,45 +404,7 @@ if (alg_typ == "R" || alg_typ == "W" || alg_typ == "T")
%>
<html>
<head>
<% FCLTMHeader.Generate({title: ins_info.subject});
if (qrc)
{ // Make the background-color of .ui-content 25% transparent (= 75% opaque)
var mobileBackgroundColor = S("csstemplate")["mobilebackgroundcolor"] || FCLTHeader.defaultTemplate["mobilebackgroundcolor"];
var newBackgroundColor = "";
if (mobileBackgroundColor)
{
if (/#[A-F\d]{6}/i.test(mobileBackgroundColor)) // Hexcode
newBackgroundColor = mobileBackgroundColor + "BF";
else if (/rgb\s?\([\s\d,]+\)/.test(mobileBackgroundColor)) // rgb-code
newBackgroundColor = mobileBackgroundColor.replace(/rgb\s?\(/, "rgba(").replace(/\)\s?$/, ", .75)");
else if (mobileBackgroundColor == "white") // Kleurnaam, korte hexcode of hsl, we doen hier alleen 'white'
newBackgroundColor = "rgba(255, 255, 255, .75)";
}
%>
<style>
geenhekjeaanbeginregel, #page {
display: flex;
flex-direction: column;
justify-content: center;
<% if (imgPath)
{ %>
background-image: url("<%=encodeURI(imgPath)%>");
background-repeat: no-repeat;
background-position: top;
background-size: contain;
<% } %>
}
<% if (newBackgroundColor != "")
{ %>
.ui-content {
background-color: <%=safe.jsstring(newBackgroundColor)%>;
}
<% } %>
</style>
<%
}
<% FCLTMHeader.Generate({ title: ins_info.subject });
%>
<script>
<% if (getQParamInt("notitie", 0) == 1) { %>
@@ -513,7 +479,7 @@ if (qrc)
<%
lcl.set_dialect(disc_key, 'INS_DISCIPLINE_KEY');
PAGE_START();
PAGE_START({ "headerImage": imagePath });
HEADER({title: ins_info.subject, go: return_from, back: !qrc, home: !qrc});
CONTENT_START();
FORM_START("deel", {action: rooturl + "/appl/ins/ins_edit_deel_save.asp?urole="+urole+"&ins_key="+ins_key, method: "get"});

View File

@@ -2711,7 +2711,7 @@ input[type=button][disabled] {
}
/* is ook maar een button */
.subframe .blockbuttoncontainer #buttons ul li {
:is(.modal, .subframe) .blockbuttoncontainer #buttons ul li {
box-shadow: 1.5px 1.5px 3px #ccc;
font-size: 0.9em;
}
@@ -3165,6 +3165,11 @@ span:is(.starticon, .endicon) {
text-align: left;
}
.exceeded {
color: red;
text-decoration: line-through;
}
#r_objs_button {
background-repeat: no-repeat;
background-position: 6px;
@@ -5812,11 +5817,23 @@ table.filter img {
font-size:9pt;
line-height: 14pt;
}
#mod_authQR #qrurl
{
font-size:12px;
font-family: courier;
white-space: nowrap;
.qrcode {
width: 100%;
aspect-ratio: 1;
display: flex;
}
@media print { /* Alleen de QR-code zelf printen */
#mod_qrcode {
visibility: hidden;
}
.qrcode {
visibility: visible;
position: absolute;
left: 0;
top: 0;
width: 5cm;
}
}
.droppable {
opacity: inherit;

View File

@@ -196,7 +196,7 @@ function BLOCK_START_HTML(id, title, params) {
if (hasButtons) {
resultstr += " <div class='blockbuttoncontainer'>";
resultstr += CreateButtons_HTML(params.buttons, { showIcons: true } );
resultstr += CreateButtons_HTML(params.buttons, { showIcons: true, isModal: params.isModal } );
resultstr += " </div>"
}