AAIT#27946 bookmark_refreshtime erbij
labelrot rotatie ondersteunen svn path=/Website/trunk/; revision=19829
This commit is contained in:
@@ -33,7 +33,8 @@
|
||||
+ " fac_bookmark_query,"
|
||||
+ " prs_perslid_key_auth,"
|
||||
+ " fac_bookmark_unauth_url,"
|
||||
+ " fac_bookmark_expire"
|
||||
+ " fac_bookmark_expire,"
|
||||
+ " fac_bookmark_refreshtime"
|
||||
+ " FROM fac_bookmark"
|
||||
+ " WHERE fac_bookmark_id = " + safe.quoted_sql(u);
|
||||
var oRs = Oracle.Execute(sql);
|
||||
@@ -51,6 +52,7 @@
|
||||
}
|
||||
|
||||
var url = oRs("fac_bookmark_path").Value;
|
||||
var refresher = oRs("fac_bookmark_refreshtime").Value;
|
||||
|
||||
if (oRs("prs_perslid_key_auth").Value)
|
||||
{
|
||||
@@ -59,25 +61,52 @@
|
||||
else
|
||||
Session("unauth_url") = oRs("fac_bookmark_unauth_url").Value; // wordt opgepikt door common.asp
|
||||
|
||||
if (oRs("fac_bookmark_query").Value)
|
||||
var params = oRs("fac_bookmark_query").Value;
|
||||
if (params)
|
||||
{
|
||||
if (keyparam > -1)
|
||||
{
|
||||
rest = rest.substring(("k="+keyparam).length+1);
|
||||
url += "?" + oRs("fac_bookmark_query").Value + keyparam + (rest?"&"+rest:"");
|
||||
params += keyparam;
|
||||
}
|
||||
else
|
||||
{
|
||||
url += "?" + oRs("fac_bookmark_query").Value + (rest?"&"+rest:"");
|
||||
}
|
||||
|
||||
if (rest)
|
||||
params += "&" + rest;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (rest)
|
||||
url += "?" + rest;
|
||||
params = rest;
|
||||
}
|
||||
oRs.Close();
|
||||
Response.Redirect(protectQS.create(url));
|
||||
|
||||
// Als getQParam maar dan uit een string. Altijd null als niet gevonden
|
||||
// Let op: de query mag niet (meer) URL-escaped zijn
|
||||
function getSParam (key, query)
|
||||
{
|
||||
var nn = 1;
|
||||
var params = query.split("&");
|
||||
for (var i in params)
|
||||
{
|
||||
var xx = params[i].split("=");
|
||||
if (xx[0].toUpperCase() == key.toUpperCase() && xx.length > 1)
|
||||
{
|
||||
return String(xx[1]);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
url = url + "?" + params;
|
||||
|
||||
// Als de bookmark een refreshrate heeft ingesteld wordt automatisch gerefreshed
|
||||
// Voorkom recursie met norefresh
|
||||
// Testen op referrer=refresher.asp is mij niet stabiel genoeg
|
||||
if (refresher > 0 && getQParamInt("norefresh",0) == 0)
|
||||
{
|
||||
theURL = "appl/shared/refresher.asp?url=" + Server.URLencode("/?norefresh=1" + transitQS()) + "&refreshrate=" + refresher;
|
||||
}
|
||||
else
|
||||
var theURL = protectQS.create(url);
|
||||
Response.Redirect(theURL);
|
||||
%>
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
|
||||
// 180 graden bijvoorbeeld om vanaf de andere kant te kijken
|
||||
var rot = getQParamInt("rot", 0) / 180 * Math.PI;
|
||||
var labelrot = getQParamInt("labelrot", getQParamInt("rot", 0));
|
||||
|
||||
var camZ = getQParamInt("camZ", parseInt(vpix * 1.0));
|
||||
var camY = getQParamInt("camY", parseInt(- vpix / 2.0));
|
||||
@@ -151,7 +152,7 @@ function zoom2DWG(centerX, centerY, newScale)
|
||||
|
||||
// PAINTING
|
||||
var imgurl = "../CAD/mySlnk2IMG.asp?labelPos=2" + gCustomParameters
|
||||
+ "&sizeX="+hpix+"&sizeY="+vpix
|
||||
+ "&sizeX="+hpix+"&sizeY="+vpix + "&labelrot=<%=labelrot%>"
|
||||
+ "&offsetX="+offsetX+"&offsetY="+offsetY+"&scale="+scale+"&paperColor=16777214";
|
||||
|
||||
// 'bordlabel' wordt voor de popup 'borden' gebruikt
|
||||
|
||||
@@ -27,7 +27,6 @@
|
||||
bordlabel_key optional, de middels 2d-bordjes te tonen ruimteinfo in 3d tekening (3D-only)
|
||||
|
||||
hidenav optional, geen verdieping selector tonen (impliceert scherm op deze subverdieping)
|
||||
refresh optional, autorefresh. default 100 seconds
|
||||
|
||||
( dimension optional, default=3d (fallback to 2d if 3d requirements are not met?) TO BE DEFINED )
|
||||
|
||||
@@ -45,7 +44,7 @@
|
||||
|
||||
Context:
|
||||
Note: Als disc_key meegegeven dan worden alleen de verdiepingen tonen waarop die objecten voorkomen
|
||||
Bij een refresh wordt altijd teruggesprongen naar de default verdieping.
|
||||
Bij elke refresh wordt altijd teruggesprongen naar de default verdieping.
|
||||
zoomDWGX etc. is niet per verdieping. Zorg dus dat ze identiek zijn als je er meerdere hebt
|
||||
Nauwkeurig DWGX DWGY etc bepalen:
|
||||
- Resize je scherm naar de gewenste grootte en bepaal pixelX (breedte plaatje)
|
||||
@@ -82,7 +81,6 @@ if (geb_key == -1 && floor_key != -1) {
|
||||
oRs.Close();
|
||||
}
|
||||
var hidenav = getQParamInt("hidenav", 0); // optie: toon geen floornavigator
|
||||
var refresh = getQParamInt("refresh", 100); // optie: refresh in secondes
|
||||
|
||||
var fac_usrrap_key = getQParamInt("fac_usrrap_key", 12); // In de core is een default usrrap met key 12 gedefinieerd
|
||||
|
||||
@@ -104,14 +102,14 @@ var autfunction= "WEB_CADUSE";
|
||||
var authparams = user.checkAutorisation(autfunction); // voor kiezen *andere* verdiepingen
|
||||
|
||||
// buildTransitParam met de settings die voor alle verdiepingen gelijk zullen zijn.
|
||||
var mapper = "3dize.asp?x=1" + buildTransitParam("symbolX,symbolY,symbol,floor_key,bordlabel_key,werkplek,mode,contmode,nolabel,camx,camy,camz,hpix,vpix,scl,ox,oy,rot,wallColor,ambientLight,directionalLight");
|
||||
var mapper = "3dize.asp?x=1" + buildTransitParam("symbolX,symbolY,symbol,floor_key,bordlabel_key,werkplek,mode,contmode,nolabel,camx,camy,camz,hpix,vpix,scl,ox,oy,rot,wallColor,ambientLight,directionalLight,labelrot");
|
||||
if (fac_usrrap_key > -1)
|
||||
{
|
||||
// parameters voor de rapportage, typisch de verdieping_key
|
||||
var params = "&nobuttons=1&bodyclass=rflrscreen"; // ik wil een uniek id tbv css styling
|
||||
params += "&fclt_f_colname1=hide_f_alg_gebouw_key&fclt_f_colvalue1=" + geb_key;
|
||||
// rapperBase is zonder floor_key
|
||||
var rapperBase = "../../appl/fac/fac_usrrap_list.asp?usrrap_key=" + fac_usrrap_key + params + "&refreshrate=" + refresh;
|
||||
var rapperBase = "../../appl/fac/fac_usrrap_list.asp?usrrap_key=" + fac_usrrap_key + params;
|
||||
}
|
||||
|
||||
%>
|
||||
@@ -171,7 +169,6 @@ if (fac_usrrap_key > -1)
|
||||
window.innerHeight / (pSLNKEvent.DWGmaxY - pSLNKEvent.DWGminY));
|
||||
MMap.zoom2DWG(zoomDWGX, zoomDWGY, zoomScale);
|
||||
MMap.Refresh(); // Try not to zoom extents
|
||||
resetReload();
|
||||
} );
|
||||
|
||||
}
|
||||
@@ -208,7 +205,7 @@ if (fac_usrrap_key > -1)
|
||||
|
||||
function MMap_onClick(SlnkEvent)
|
||||
{
|
||||
resetReload();
|
||||
// TODO: Doorgeven aan refresher.asp dat hij even geen reload moet doen resetReload();
|
||||
switch (SlnkEvent.Param)
|
||||
{
|
||||
case "onclick":
|
||||
@@ -269,17 +266,9 @@ if (fac_usrrap_key > -1)
|
||||
}
|
||||
};
|
||||
|
||||
var /*global*/ reloadTimerID=null;
|
||||
function resetReload()
|
||||
{
|
||||
if (window.reloadTimerID) clearTimeout(window.reloadTimerID);
|
||||
window.reloadTimerID = setTimeout(FcltMgr.reload, <%=refresh%> * 1000);
|
||||
}
|
||||
|
||||
var /*global*/ resizeTimerID=null;
|
||||
function init()
|
||||
{
|
||||
resetReload();
|
||||
resizeIframes();
|
||||
resetMap();
|
||||
myRefresh();
|
||||
@@ -434,7 +423,7 @@ else // Ruimte mode
|
||||
<div id='theReport' class="floorscreen">
|
||||
<iframe id='RRap' name='RRap' src="<%=safe.htmlattr(rapper)%>"
|
||||
frameborder='0' framespacing='0' scrolling='no'
|
||||
onload="FcltMgr.iframeLoaded()"
|
||||
onload="FcltMgr.iframeLoaded(this)"
|
||||
width="100%" height="26px">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
@@ -154,10 +154,12 @@ function myContourProcessor(cHandle)
|
||||
cHandle.SetLabelFont("Tahoma", (inoutMode==MODE_IN?S("fg_inLabelSize"):S("fg_outLabelSize")));
|
||||
|
||||
// Dit gaat langs alle ruimtes ongeacht of ze in de database zijn gevonden
|
||||
var labelRot = getQParamInt("labelrot", 0);
|
||||
for (var i2=0; i2 < cHandle.ContourCount; i2++)
|
||||
{
|
||||
var cont = cHandle.ContourItem(i2);
|
||||
cont.setcolor(0x00ff00); // grijs randjes
|
||||
cont.LabelRotation = labelRot;
|
||||
if (cont.area < S("fg_areaThreshold"))
|
||||
{
|
||||
cont.lineweight = S("fg_contourWeight") / 2;
|
||||
|
||||
@@ -32,6 +32,7 @@ var bkm_aanmaak;
|
||||
var bkm_prskey;
|
||||
var bkm_prskey_auth;
|
||||
var bkm_unauth_url;
|
||||
var bkm_refresh
|
||||
|
||||
if (bkm_id != "")
|
||||
{
|
||||
@@ -41,6 +42,7 @@ if (bkm_id != "")
|
||||
+ " , fac_bookmark_aanmaak"
|
||||
+ " , prs_perslid_key_auth"
|
||||
+ " , fac_bookmark_unauth_url"
|
||||
+ " , fac_bookmark_refreshtime"
|
||||
+ " , prs_perslid_key"
|
||||
+ " FROM fac_bookmark"
|
||||
+ " WHERE fac_bookmark_id = " + safe.quoted_sql(bkm_id);
|
||||
@@ -52,6 +54,7 @@ if (bkm_id != "")
|
||||
bkm_aanmaak = oRs("fac_bookmark_aanmaak").value;
|
||||
bkm_prskey_auth = oRs("prs_perslid_key_auth").value;
|
||||
bkm_unauth_url = oRs("fac_bookmark_unauth_url").value;
|
||||
bkm_refresh = oRs("fac_bookmark_refreshtime").value;
|
||||
bkm_prskey = oRs("prs_perslid_key").value;
|
||||
oRs.close();
|
||||
}
|
||||
@@ -101,6 +104,7 @@ else
|
||||
RWFIELDTR("query", "fldfac_query", L("lcl_fac_bookmarkquery"), bkm_query, { maxlength: 1000 });
|
||||
RWFIELDTR("prskey_auth", "fld", L("lcl_bkm_prskey_auth"), bkm_prskey_auth);
|
||||
RWFIELDTR("unauth_url", "fld", L("lcl_bkm_unauth"), bkm_unauth_url, { maxlength: 1000 });
|
||||
RWFIELDTR("refresh", "fld", L("lcl_bkm_refresh"), bkm_refresh);
|
||||
|
||||
FCLTpersoonselector("perslid_key",
|
||||
"sgPers",
|
||||
|
||||
@@ -30,11 +30,12 @@ var path = getFParam("path");
|
||||
if (path.substring(0, rooturl.length).toUpperCase() == rooturl.toUpperCase())
|
||||
path = path.substring(rooturl.length);
|
||||
|
||||
var fields = [ { dbs: "fac_bookmark_naam", typ: "varchar", frm: "naam", len: 60 },
|
||||
{ dbs: "fac_bookmark_path", typ: "varchar", val: path, len: 1000 },
|
||||
{ dbs: "fac_bookmark_query", typ: "varchar", frm: "query", len: 1000 },
|
||||
{ dbs: "prs_perslid_key_auth", typ: "key", frm: "prskey_auth" },
|
||||
{ dbs: "fac_bookmark_unauth_url", typ: "varchar", frm: "unauth_url", len: 1000 }
|
||||
var fields = [ { dbs: "fac_bookmark_naam", typ: "varchar", frm: "naam", len: 60 },
|
||||
{ dbs: "fac_bookmark_path", typ: "varchar", val: path, len: 1000 },
|
||||
{ dbs: "fac_bookmark_query", typ: "varchar", frm: "query", len: 1000 },
|
||||
{ dbs: "prs_perslid_key_auth", typ: "key", frm: "prskey_auth" },
|
||||
{ dbs: "fac_bookmark_unauth_url", typ: "varchar", frm: "unauth_url", len: 1000 },
|
||||
{ dbs: "fac_bookmark_refreshtime", typ: "number", frm: "refresh"}
|
||||
];
|
||||
|
||||
var warning = "";
|
||||
|
||||
@@ -33,6 +33,7 @@ var sql = "SELECT fac_bookmark_path"
|
||||
+ " , fac_bookmark_aanmaak"
|
||||
+ " , prs_perslid_key_auth"
|
||||
+ " , fac_bookmark_unauth_url"
|
||||
+ " , fac_bookmark_refreshtime"
|
||||
+ " , prs_perslid_key"
|
||||
+ " FROM fac_bookmark"
|
||||
+ " WHERE fac_bookmark_id = " + safe.quoted_sql(bkm_id);
|
||||
@@ -44,6 +45,7 @@ var bkm_naam = oRs("fac_bookmark_naam").value;
|
||||
var bkm_aanmaak = oRs("fac_bookmark_aanmaak").value;
|
||||
var bkm_prskey_auth = oRs("prs_perslid_key_auth").value;
|
||||
var bkm_unauth_url = oRs("fac_bookmark_unauth_url").value;
|
||||
var bkm_refresh = oRs("fac_bookmark_refreshtime").value;
|
||||
var bkm_prskey = oRs("prs_perslid_key").value;
|
||||
oRs.close();
|
||||
%>
|
||||
@@ -102,6 +104,7 @@ oRs.close();
|
||||
ROFIELDTR("fldfac_query", L("lcl_fac_bookmarkquery"), bkm_query);
|
||||
ROFIELDTR("fld", L("lcl_bkm_prskey_auth"), bkm_prskey_auth);
|
||||
ROFIELDTR("fld", L("lcl_bkm_unauth"), bkm_unauth_url);
|
||||
ROFIELDTR("fld", L("lcl_bkm_refresh"), bkm_refresh);
|
||||
FCLTpersoonselector("sgPers",
|
||||
"sgPers",
|
||||
{ perslidKey: bkm_prskey,
|
||||
|
||||
134
APPL/Shared/refresher.asp
Normal file
134
APPL/Shared/refresher.asp
Normal file
@@ -0,0 +1,134 @@
|
||||
<%@language = "javascript" %>
|
||||
<% /*
|
||||
$Revision$
|
||||
$Id$
|
||||
|
||||
File: refresher.asp
|
||||
Description: Toon een bepaald scherm en ververs deze regelmatig
|
||||
|
||||
Parameters: verplichte parameters
|
||||
url= de geescape-te url die ververst moet worden
|
||||
Bij voorkeur een bookmark met een PRS_PERSLID_KEY_AUTH (fallback_user_key)
|
||||
zodat een nachtelijke reset overleeft wordt
|
||||
optional parameters
|
||||
refreshrate=60 report refresht elke 60 seconde
|
||||
default 600 (10 minuten)
|
||||
doublebuf=1 Unsupported
|
||||
'Toggle' twee workFrame's om knipperen te voorkomen
|
||||
Let op: onderliggende scherm *moet* dan onload code
|
||||
parent & parent.Activate && parent.Activate()
|
||||
doen als hij klaar is met laden
|
||||
Let op: doubleauto is veel simpeler en heeft de voorkeur
|
||||
doubleauto=3 Als doublebuf maar onderliggende code hoeft niets te doen
|
||||
Automatisch wordt na S("refresher_doubleauto") (default 3) seconde
|
||||
verondersteld dat het scherm klaar is.
|
||||
|
||||
Context: Bijvoorbeeld als je bij een bookmark een refreshrate invult
|
||||
http://sgf12/facilitor5iwork/?fac_id=AAIT&u=VXlrSVAqUpAzFocg
|
||||
Notes:
|
||||
*/
|
||||
|
||||
ANONYMOUS_Allowed = 1; // We doen echt niets geheims.
|
||||
%>
|
||||
<!--#include file="../Shared/common.inc" -->
|
||||
<%
|
||||
FCLTHeader.Requires({plugins: ["jQuery"]});
|
||||
|
||||
var url = getQParam("url");
|
||||
var refreshrate = getQParamInt("refreshrate", 600);
|
||||
var doublebuf = getQParamInt("doublebuf", 0) == 1;
|
||||
var doubleauto = getQParamInt("doubleauto", S("refresher_doubleauto"));
|
||||
%>
|
||||
<html>
|
||||
<head>
|
||||
<%
|
||||
FCLTHeader.Generate();
|
||||
%>
|
||||
<script language="javascript">
|
||||
|
||||
window.activeFrame = "A";
|
||||
window.refreshtimerId = -1;
|
||||
window.myurl = "<%=rooturl + safe.jsstring(url)%>";
|
||||
|
||||
function refreshPage()
|
||||
{
|
||||
doResize();
|
||||
<% if (doublebuf || doubleauto > 0) { %>
|
||||
if (window.activeFrame == "A")
|
||||
$("#workFrameB")[0].src = window.myurl;
|
||||
else
|
||||
$("#workFrameA")[0].src = window.myurl;
|
||||
<% if (doubleauto > 0) { %>
|
||||
if (window.doubletimerId > 0)
|
||||
clearTimeout(window.doubletimerId);
|
||||
window.doubletimerId = setTimeout('doActivate();', <%=doubleauto*1000%>);
|
||||
<% } %>
|
||||
|
||||
<% } else { %>
|
||||
$("#workFrameA")[0].src = window.myurl;
|
||||
<% } %>
|
||||
}
|
||||
|
||||
// ondersteun de deprecated doublebuf
|
||||
function Activate()
|
||||
{
|
||||
<% if (doublebuf && doubleauto <= 0) { %>
|
||||
doActivate();
|
||||
<% } %>
|
||||
}
|
||||
|
||||
// Activeer het 'andere' workframe
|
||||
function doActivate()
|
||||
{
|
||||
var d2 = $("#workFrameA");
|
||||
var d3 = $("#workFrameB");
|
||||
if (window.activeFrame == "A")
|
||||
{
|
||||
d2.css("zIndex", -1);
|
||||
d3.css("zIndex", 1);
|
||||
window.activeFrame = "B";
|
||||
}
|
||||
else
|
||||
{
|
||||
d2.css("zIndex", 1);
|
||||
d3.css("zIndex", -1);
|
||||
window.activeFrame = "A";
|
||||
}
|
||||
}
|
||||
|
||||
// Ongeacht grootte content resizen naar window
|
||||
function doResize()
|
||||
{
|
||||
$("#workFrameA").width($(window).width());
|
||||
$("#workFrameB").width($(window).width());
|
||||
$("#workFrameA").height($(window).height());
|
||||
$("#workFrameB").height($(window).height());
|
||||
}
|
||||
|
||||
function startAutoRefreshTimer() {
|
||||
if (<%=refreshrate%> != -1) {
|
||||
window.refreshtimerId = setInterval('refreshPage();', <%=refreshrate*1000%>);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body style="margin:0;"
|
||||
onLoad="refreshPage();
|
||||
startAutoRefreshTimer()">
|
||||
|
||||
<iframe width="100%" height="100%"
|
||||
style="position:absolute;left:0px;top:0px; height:100%;z-index:0;"
|
||||
src="../Shared/empty.asp" id="workFrameA" frameborder="no"
|
||||
marginwidth="0" marginheight="0"
|
||||
scrolling="none" onload="doResize()">
|
||||
</iframe>
|
||||
<iframe width="100%" height="100%"
|
||||
style="position:absolute;left:0px;top:0px;height:100%;z-index:-1;"
|
||||
src="../Shared/empty.asp" id="workFrameB" frameborder="no"
|
||||
marginwidth="0" marginheight="0"
|
||||
scrolling="none" onload="doResize()">
|
||||
</iframe>
|
||||
</body>
|
||||
</html>
|
||||
Binary file not shown.
Reference in New Issue
Block a user