149 lines
5.9 KiB
HTML
149 lines
5.9 KiB
HTML
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: mobile.inc
|
|
Description: Generieke functies die door elke mobile pagina gebruikt (kunnen) worden.
|
|
Parameters:
|
|
Context: In ELK mobile asp bestand
|
|
Note: Dus gebruik met mate
|
|
|
|
*/ %>
|
|
<!--#include file="../Shared/status.inc"-->
|
|
<%
|
|
if (S("mobile_enabled") != 1)
|
|
{
|
|
shared.simpel_page("Mobile module not enabled.<br><a href='" + rooturl + "?interface=desktop'>Continue</a>"); // Wel betalen he!
|
|
Session("interface") = "desktop";
|
|
}
|
|
|
|
// Uses S("mobile_alg_level"); // L, G of V
|
|
|
|
// Het idee is dat ik heel gedetailleerd kan vastleggen waar ik ben (achter deze PC)
|
|
// maar soms ook wat globaler (in dit gebouw). Het is aan de betreffende functionaliteit
|
|
// om te bepalen tot welk niveau ik deze kennis gebruik. Dus:
|
|
// Als ik op een werkplek zit moeten toch niet de meldingen in mijn ovz worden beperkt tot 1
|
|
// Verdieping is een goed defaultniveau, maar er is te configureren dat dat hoger ligt.
|
|
|
|
if (S("mobile_alg_level") == 'V' && user.alg_verdieping_key({withcurrent:true}) > -1)
|
|
{
|
|
var CurrentPosition = new Gebouw(user.alg_gebouw_key({withcurrent:true})).alg_gebouw_omschrijving()+"/"+new Verdieping(user.alg_verdieping_key({withcurrent:true})).naam();
|
|
var CurrentPositionMinus1 = new Gebouw(user.alg_gebouw_key({withcurrent:true})).alg_gebouw_omschrijving();
|
|
}
|
|
else if (S("mobile_alg_level") == 'G' && user.alg_gebouw_key({withcurrent:true}) > -1)
|
|
{
|
|
var CurrentPosition = new Gebouw(user.alg_gebouw_key({withcurrent:true})).alg_gebouw_omschrijving();
|
|
var CurrentPositionMinus1 = new Locatie(user.alg_locatie_key({withcurrent:true})).locatie_string()||"";
|
|
}
|
|
else
|
|
{
|
|
var CurrentPosition = new Locatie(user.alg_locatie_key({withcurrent:true})).locatie_string()||"";
|
|
var CurrentPositionMinus1 = "";
|
|
}
|
|
|
|
var mobile = {
|
|
iamhere:
|
|
function (plevel, pkey)
|
|
{ // level is L,G,V,R
|
|
var sql = "UPDATE prs_perslid "
|
|
+ " SET alg_onroerendgoed_keys = " + pkey
|
|
+ " , alg_onroerendgoed_type = "+safe.quoted_sql(plevel)
|
|
+ " , prs_perslid_bezetdatum = SYSDATE"
|
|
+ " WHERE prs_perslid_key = " + user_key;
|
|
|
|
Oracle.Execute(sql);
|
|
},
|
|
|
|
hasflexkenmerken:
|
|
function (pnode, pkey)
|
|
{
|
|
return true; // TODO placeholder function, to be defined
|
|
},
|
|
|
|
hastrackingpage:
|
|
function (pnode, pkey)
|
|
{
|
|
// goedkopere versie van de trackingpage query, alleen maar om te checken
|
|
// of er wel geen tracking is. Levert het aantal trackingregels op
|
|
var res;
|
|
var sql = "SELECT COUNT(*)"
|
|
+ " FROM fac_tracking tr, fac_srtnotificatie str"
|
|
+ " WHERE tr.fac_srtnotificatie_key = str.fac_srtnotificatie_key"
|
|
+ " AND tr.fac_tracking_refkey = " + pkey
|
|
+ " AND str.fac_srtnotificatie_xmlnode = "+safe.quoted_sql(pnode)
|
|
+ " AND tr.fac_tracking_datum > (SYSDATE - 365)";
|
|
var oRs = Oracle.Execute(sql);
|
|
res = oRs(0).Value;
|
|
oRs.close();
|
|
return res;
|
|
},
|
|
|
|
// Deze vereist wel de resultset: moet de aanroeper nu geinclude hebben, wat niet zo goed is
|
|
trackingpage:
|
|
function (pnode, pkey, psubject)
|
|
{
|
|
HEADER({title: L("lcl_history")+" "+psubject, back: true, home: true}) ;
|
|
CONTENT_START();
|
|
|
|
function fnTrackText (oRs)
|
|
{
|
|
var tekst = safe.html(oRs("fac_tracking_oms").Value);
|
|
if (!tekst)
|
|
tekst = status.getsrtnotificatietext(oRs("fac_srtnotificatie_code").Value);
|
|
return "<div class='listbodytext'>" + tekst + "</div>";
|
|
}
|
|
|
|
var sql = "SELECT tr.fac_tracking_datum"
|
|
+ " , tr.fac_tracking_key"
|
|
+ " , str.fac_srtnotificatie_code"
|
|
+ " , COALESCE(pf.prs_perslid_naam_friendly, '-') prs_perslid_naam_friendly"
|
|
+ " , tr.fac_tracking_oms"
|
|
+ " FROM fac_tracking tr, fac_srtnotificatie str, prs_v_perslid_fullnames_all pf"
|
|
+ " WHERE tr.fac_srtnotificatie_key = str.fac_srtnotificatie_key"
|
|
+ " AND tr.prs_perslid_key = pf.prs_perslid_key (+)"
|
|
+ " AND tr.fac_tracking_refkey = " + pkey
|
|
+ " AND str.fac_srtnotificatie_xmlnode = "+safe.quoted_sql(pnode)
|
|
+ " AND tr.fac_tracking_datum > (SYSDATE - 365)"
|
|
+ " ORDER BY tr.fac_tracking_datum DESC, tr.fac_tracking_key DESC ";
|
|
|
|
|
|
var rst = new ResultsetTable({ sql: sql,
|
|
keyColumn: "fac_tracking_key",
|
|
ID: "trackingtable",
|
|
headerColumn: "fac_tracking_datum",
|
|
detailColumn: "prs_perslid_naam_friendly",
|
|
subheaderColumn: fnTrackText,
|
|
noPrint: true,
|
|
noSearch: true,
|
|
mobile: true,
|
|
showAll: true,
|
|
mfilter: false //not yet supported
|
|
});
|
|
|
|
var cnt = rst.processResultset();
|
|
|
|
CONTENT_END();
|
|
},
|
|
|
|
simpel_page:
|
|
function(bodyhtml)
|
|
{
|
|
var showbuttons = (getQParamInt("qrc", 0) != 1 && getQParamInt("modal", 0) != 1)
|
|
Response.Clear();
|
|
Response.Write("<html><head>");
|
|
FCLTMHeader.Generate({title: "simpelpage" });
|
|
Response.Write("</head>");
|
|
Response.Write("<body class='simpelpage'>");
|
|
PAGE_START({id: "simpelpage"});
|
|
CONTENT_START();
|
|
HEADER({title: "", back: showbuttons, home: showbuttons });
|
|
Response.Write(bodyhtml);
|
|
CONTENT_END();
|
|
|
|
Response.Write("</body></html>");
|
|
Response.End;
|
|
}
|
|
};
|
|
|
|
%>
|