FSN#49967 mobile filteren op meldingen lijst

svn path=/Website/trunk/; revision=35897
This commit is contained in:
Ruud Lipper
2017-11-03 13:42:20 +00:00
parent 59a94b1257
commit 1a8a8e9fc1
3 changed files with 164 additions and 49 deletions

View File

@@ -306,6 +306,7 @@ function BUTTON(plabel, params)
<%=1||params.mini ? " data-mini='true'" : ""%>
<%=params.id ? " id='"+params.id+"'" : ""%>
<%=params.dataicon ? " data-icon='"+params.dataicon+"'" : ""%>
<%=params.datarel ? " data-rel='"+params.datarel+"'" : ""%>
<%=params.dataiconpos? " data-iconpos='"+params.dataiconpos+"'" : ""%>
<%=params.dataajax ? " data-ajax='"+params.dataajax+"'" : ""%>
<%=params.transition ? " transition='"+params.transition+"'" : ""%>

View File

@@ -33,6 +33,11 @@ var self = getQParamInt("self", -1);
var status = getQParamIntArray("status", []);
var behandel_key = getQParamInt("behandel", -1);
// 0 = Pending(0),Ingevoerd(2),Ingezien(3)
// 2 = Geaccepteerd(4), Uitgegeven(7)
// 1 = beide (default)
var fase = getQParamInt("fase", 1);
var locatie_key = getQParamInt("locatie_key", user.alg_locatie_key({withcurrent:true})); // Locatie
var gebouw_key = getQParamInt("gebouw_key", user.alg_gebouw_key({withcurrent:true})); // Gebouw, kan -1 zijn, dan niet gebruiken
var verdieping_key = getQParamInt("verdieping_key", user.alg_verdieping_key({withcurrent:true}));
@@ -95,62 +100,73 @@ var urole = getQParamSafe("urole", "bo");
var params = { urole: urole };
params.flags = [];
var checkboxParams = [];
var hasParamFlag = false;
// in tegenstelling tot desktop zijn hier de flags default on
// en kun je dus expliciet zaken wegfilteren met &flagN=off
for (flagkey=0; flagkey < S("mld_melding_flags"); flagkey++)
{
if (getQParam("flag" + flagkey, "on") == "on")
if (getQParam("flag" + flagkey, "off") == "on")
{
hasParamFlag = true;
checkboxParams[flagkey] = "on";
params.flags.push(flagkey);
}
params.behandel_key = behandel_key;
// Self overruled de setting S("mld_restrict_mobile_to_me").
if (self > -1)
{
if (self == 0 || ruimte_key > -1 || ins_key > -1 || rsv_ruimte_key > -1)
{ // De actieve meldingen binnen scope (impliceert status 4|7).
if (status.length > 0)
{ // Er is/zijn (een) status(sen) meegegeven.
if (status.join(",").indexOf("0") >= 0) params.mldstpen = true; // Status "Pending(0)".
if (status.join(",").indexOf("2") >= 0) params.mldstnew = true; // Status "Ingevoerd(2)".
if (status.join(",").indexOf("3") >= 0) params.mldsting = true; // Status "Ingezien(3)".
if (status.join(",").indexOf("4") >= 0) params.mldstacc = true; // Status "Geaccepteerd(4)".
if (status.join(",").indexOf("7") >= 0) params.mldstuit = true; // Status "Uitgegeven(7)".
}
else
{
params.mldstacc = true; // Status "Geaccepteerd(4)".
params.mldstuit = true; // Status "Uitgegeven(7)".
checkboxParams[flagkey] = "false";
}
}
else
{ // De actieve meldingen van mij.
params.behandel_key = user_key; // De meldingen waarvan ik de behandelaar ben.
params.mldstpen = true; // Status "Pending(0)".
params.mldstnew = true; // Status "Ingevoerd(2)".
params.mldsting = true; // Status "Ingezien(3)".
params.mldstacc = true; // Status "Geaccepteerd(4)".
params.mldstuit = true; // Status "Uitgegeven(7)".
}
}
if (!hasParamFlag)
{
for (flagkey=0; flagkey < S("mld_melding_flags"); flagkey++)
{
if (getQParam("flag" + flagkey, "on") == "off")
{
checkboxParams[flagkey] = "off";
}
else
{
params.flags.push(flagkey);
checkboxParams[flagkey] = "on";
}
}
}
params.behandel_key = behandel_key;
__Log("status length = " + status.length);
if (status.length > 0)
{ // Er is/zijn (een) status(sen) meegegeven.
if (status.join(",").indexOf("0") >= 0) params.mldstpen = true; // Status "Pending(0)".
if (status.join(",").indexOf("2") >= 0) params.mldstnew = true; // Status "Ingevoerd(2)".
if (status.join(",").indexOf("3") >= 0) params.mldsting = true; // Status "Ingezien(3)".
if (status.join(",").indexOf("4") >= 0) params.mldstacc = true; // Status "Geaccepteerd(4)".
if (status.join(",").indexOf("7") >= 0) params.mldstuit = true; // Status "Uitgegeven(7)".
}
else
{ // Alle actieve meldingen tonen.
params.mldstacc = true; // Status "Geaccepteerd(4)".
params.mldstuit = true; // Status "Uitgegeven(7)".
params.mldstpen = true; // Status "Pending(0)".
params.mldstnew = true; // Status "Ingevoerd(2)".
params.mldsting = true; // Status "Ingezien(3)".
{
if (((self <=0 && S("mld_restrict_mobile_to_me")) != 1 || ruimte_key != -1 || ins_key != -1 || rsv_ruimte_key != -1) && fase <=1)
{
params.mldstpen = true; // Status "Pending(0)".
params.mldstnew = true; // Status "Ingevoerd(2)".
params.mldsting = true; // Status "Ingezien(3)".
}
if (S("mld_restrict_mobile_to_me") == 1 && ruimte_key == -1 && ins_key == -1 && rsv_ruimte_key == -1)
{
// Alleen die actieve meldingen waarvan ik de behandelaar ben binnen scope.
// Dit is goed en logisch en handig voor de handymen.
// In hun actielijst, maar als ik de meldingen op een ruimte/object wil zien,
// vind ik (PF) dat niet logisch. Daarom: alleen als ik geen context meekreeg.
params.behandel_key = user_key;
}
if (fase >= 1)
{
params.mldstacc = true; // Status "Geaccepteerd(4)".
params.mldstuit = true; // Status "Uitgegeven(7)".
}
}
if ((self > 0 || S("mld_restrict_mobile_to_me") == 1) && ruimte_key == -1 && ins_key == -1 && rsv_ruimte_key == -1)
{
params.behandel_key = user_key;
}
autfunction = ["WEB_MLDBOF", "WEB_MLDBO2"];
// De functie checkAutorisation(autfunction) geeft een Response.End indien er geen autorisatie voor autfunction wordt gevonden
var authparams = user.checkAutorisation(autfunction);
@@ -312,7 +328,7 @@ var authparams = user.checkAutorisation(autfunction);
var url = "";
if ((grp_sel == "") && show_vakgroepen)
{
url = "../pda/mld_list.asp?grp=" + safe.url(oRs("ins_discipline_omschrijving").Value)
url = rooturl + "/appl/pda/mld_list.asp?grp=" + safe.url(oRs("ins_discipline_omschrijving").Value)
+ (self > -1? "&self=" + self : "")
+ (behandel_key != -1? "&behandel=" + behandel_key : "")
+ (status.length > 0? "&status=" + status.join(",") : "")
@@ -321,12 +337,12 @@ var authparams = user.checkAutorisation(autfunction);
for (flagkey=0; flagkey < S("mld_melding_flags"); flagkey++)
{
url += ((getQParam("flag" + flagkey, "on") == "on") ? "&flag" + flagkey + "=on" : "&flag" + flagkey + "=off");
url += ((getQParam("flag" + flagkey, "off") == "on") ? "&flag" + flagkey + "=on" : "");
}
}
else
{
url = "../pda/melding.asp?mld_key=" + oRs("mld_melding_key").Value;
url = rooturl + "/appl/pda/melding.asp?mld_key=" + oRs("mld_melding_key").Value;
}
return url;
};
@@ -364,9 +380,107 @@ var authparams = user.checkAutorisation(autfunction);
return mld_status;
}
PAGE_START();
PAGE_START({datacache:false});
%>
<script type="text/javascript" >
function openFilterPanel()
{
$(document).ready(function ()
{
$('.mldFilterPanel:visible').panel('open');
});
}
function mld_search()
{
// document.forms.mld_search_list.submit();
var data = $("[name=u2]").serialize();
var purl = "mld_list.asp?" + JSON.stringify(data).replace(/\"/g,'');
window.location.href = purl;
}
function mld_home()
{
window.location.href = rooturl + "/appl/pda/Facilitor.asp";
}
</script>
<div data-role="panel" data-display="overlay" id="mldFilterP" class="mldFilterPanel">
<form name="u2" id="mld_search_list" action="<%=rooturl%>/appl/pda/mld_list.asp" method="get">
<input type="hidden" name="grp" id="grp" value="<%=grp_sel%>">
<input type="hidden" name="qrc" id="qrc" value="<%=(qrc ? 1 : 0)%>">
<input type="hidden" name="deelsrtcont_key" id="deelsrtcont_key" value="deelsrtcont_key%>">
<input type="hidden" name="meldbron_key" id="meldbron_key" value="meldbron_key%>">
<%
if (S('mld_melding_flags') > 1)
{
CONTROLGROUP_START();
for (flagkey=0; flagkey < S("mld_melding_flags"); flagkey++)
{ %>
<label for="flag<%=flagkey%>"><input type="checkbox" name="flag<%=flagkey%>" data-mini="true" id="flag<%=flagkey%>" <%=((checkboxParams[flagkey] == "on") ? "checked" : "")%>><i class="fa <%=flagkey==0?"fa-circle-o":"fa-circle"%> mldflag<%=flagkey%> mlds"></i>&nbsp;<%=safe.html(L("lcl_mld_flag"+flagkey))%></label><%
}
CONTROLGROUP_END();
}
if (S("mld_restrict_mobile_to_me") == 1 && self == -1)
{
%>
<input type="hidden" name="self" id="mldbehall" value="-1">
<% }
else
{
CONTROLGROUP_START();
%>
<input type="radio" name="self" id="mldbehall" data-mini="true" value="-1" <%=((self<=0) ? "checked" : "")%> />
<label for="mldbehall">Onze meldingen</label>
<input type="radio" name="self" id="mldbehown" data-mini="true" value="1" <%=((self > 0) ? "checked" : "")%> />
<label for="mldbehown">Eigen meldingen</label>
<%
CONTROLGROUP_END();
}
CONTROLGROUP_START();
if (status.length == 0)
{
%>
<input type="radio" name="fase" id="mldtebeh" value="0" <%=((fase < 1) ? "checked" : "")%> />
<label for="mldtebeh"><%=safe.html(L("lcl_mld_chk_bo_mldNew"))%></label>
<input type="radio" name="fase" id="mldinbeh" value="2" <%=((fase > 1) ? "checked" : "")%> />
<label for="mldinbeh"><%=safe.html(L("lcl_mld_chk_bo_mldSelf"))%></label>
<input type="radio" name="fase" id="mldboth" value="1" <%=((fase == 1) ? "checked" : "")%> />
<label for="mldboth">Beide</label>
<%
}
CONTROLGROUP_END();
CONTROLGROUP_START();
if (behandel_key < 0 && !(S("mld_restrict_mobile_to_me") == 1 && self == -1))
{
%>
<div>
<label style="float: left;" for="behandel">Alleen zonder behandelaar</label>
<select name="behandel" style="float: left;" id="behandel" data-role="slider" data-mini="true">
<option value="-2" <%=((behandel_key == -2) ? "selected" : "")%> >Ja</option>
<option value="-1" <%=((behandel_key == -1) ? "selected" : "")%> >Nee</option>
</select>
</div>
<% }
CONTROLGROUP_END();
CONTROLGROUP_START({ horizontal: true });
BUTTON(L("lcl_search"), {id: "search_submit", click: "mld_search()", dataicon: "refresh", datarel: "close", dataajax: "true"});
BUTTON(L("lcl_home"), {id: "home", click: "mld_home()", dataicon: "home", datarel: "close"});
CONTROLGROUP_END();
%>
</form>
</div>
<%
var withContext = (ruimte_key > -1 || ins_key > -1 || rsv_ruimte_key > -1);
var p_useraction = {icon: "bars", action: "openFilterPanel()", label: L("lcl_back")};
HEADER({title: subject,
back: !qrc,
back: (!qrc && withContext),
useraction: (!withContext ? p_useraction : null),
addaction: "../pda/melding.asp?mld_key=-1" + (ins_key > -1? "&ins_key=" + ins_key : "") + (ruimte_key > -1? "&ruimte_key=" + ruimte_key : "") + "&meldbronkey=" + meldbron_key + (deelsrtcont_key>-1 ? "&deelsrtcont_key=" + deelsrtcont_key : "")});
CONTENT_START();

View File

@@ -132,7 +132,7 @@ function __rsProcessResultset(processParams)
if (oRs.EOF || overLimit || nextGroup != lastGroup)
{
html += "<li>";
html += "<a href='"+ lastLink +"'>";
html += "<a href='"+ lastLink +"' data-ajax='false'>";
html += "<h2>" + lastGroup + "</h2><span class='ui-li-count'>" + (numberInGroup > 0? numberInGroup : lines.length) + "</span>";
html += "</a></li>";
lines = [];