695 lines
26 KiB
HTML
695 lines
26 KiB
HTML
<% /*
|
|
$Revision$
|
|
$Id$
|
|
|
|
File: pda/iface.inc
|
|
Description: Vergeljk ../shared/iface.inc maar dan voor Mobile
|
|
Parameters:
|
|
Context:
|
|
Note:
|
|
data-theme configureerbaar maken
|
|
|
|
*/ %>
|
|
<!-- #include file="../FontAwesome/icons.inc" -->
|
|
<%
|
|
FCLTHeader.Requires({ plugins: ["jQuery", "bootstrap", "modernizr"], js: ["iface.js"]})
|
|
|
|
jQDataTheme = "b";
|
|
jQHeaderTheme = "b";
|
|
jQButtonTheme = "b";
|
|
jQButtonIconpos = "notext";
|
|
jQFrontEndTheme = "b";
|
|
// The mobile version of FCLTHeader
|
|
FCLTMHeader =
|
|
{
|
|
Generate: function (params)
|
|
{
|
|
if (!params) params = {};
|
|
params.mobile = true;
|
|
FCLTHeader.testTemplateCssRefresh(true); // generate default customer css
|
|
FCLTHeader.Requires({ plugins: ["jQuery"],
|
|
js: [rooturl + "/appl/Localscripts/jquery-ui-progressbar.js", rooturl + "/appl/pda/mobile.js",
|
|
rooturl + "/appl/pda/attachments.js"],
|
|
css: [rooturl + "/appl/localscripts/jquery-ui-progressbar.css"]
|
|
})
|
|
if (__Logging == 0)
|
|
FCLTHeader.Requires({ js: ["jquery.mobile.min.js"] })
|
|
else
|
|
FCLTHeader.Requires({ js: ["jquery.mobile.js"] });
|
|
var theme = S("cssformobile") || rooturl + "/appl/localscripts/theme/cust.mobile.min.css";
|
|
FCLTHeader.Requires({ css: [rooturl + "/appl/localscripts/theme/jquery.mobile.icons.min.css",
|
|
rooturl + "/appl/localscripts/theme/jquery.mobile.structure.min.css",
|
|
FCLTHeader._mobileTemplateCss,
|
|
theme
|
|
]
|
|
})
|
|
|
|
FCLTHeader.Generate(params);
|
|
return;
|
|
}
|
|
}
|
|
|
|
function HEADER(params)
|
|
{
|
|
if (!params) params = {};
|
|
|
|
if (params.title && params.title != " ") var safe_title = safe.html(params.title);
|
|
var use_title = safe_title || params.title;
|
|
|
|
if (getQParamInt("modal", 0) == 1 || params.modal) // Dan params.title in de modal-dialog titel stoppen en geen buttons
|
|
{
|
|
if (params.title)
|
|
{
|
|
%><title><%=use_title%></title>
|
|
<script>
|
|
if (parent && parent.$)
|
|
{
|
|
parent.$('span.ui-dialog-title').html("<%=safe.jsstring(use_title)%>");
|
|
}
|
|
</script><%
|
|
}
|
|
return;
|
|
}
|
|
|
|
%><div data-role="header" data-theme="<%= params.datatheme_discontinued ? params.datatheme : jQHeaderTheme%>" data-position="fixed">
|
|
<div class="ui-btn-left">
|
|
<%
|
|
if (params.go) {
|
|
%><a href="ins_list.asp?urole=bo&grp=Behandeldienst Actieve lift" data-role="button" data-icon="fa fa-arrow-left" data-iconpos="<%=jQButtonIconpos%>" data-ajax='false'></a><%
|
|
}
|
|
if (params.back && !params.go) {
|
|
%><a data-rel="back" data-role="button" data-icon="fa fa-arrow-left" data-iconpos="<%=jQButtonIconpos%>" data-ajax='false'><%=L("lcl_back")%></a><%
|
|
}
|
|
if (params.search) {
|
|
%><a href="<%=rooturl + "/appl/pda/"%>productsearch.asp" data-role="button" data-icon="fa fa-search" data-iconpos="<%=jQButtonIconpos%>" data-direction="reverse" data-ajax='false'><%=L("lcl_search")%></a><%
|
|
}
|
|
if (params.useraction) {
|
|
%><a onclick="<%=params.useraction.action%>" data-role="button" data-icon="<%=params.useraction.icon%>" data-iconpos="<%=jQButtonIconpos%>" data-direction="reverse"><%=params.useraction.label%></a><%
|
|
}
|
|
%>
|
|
</div><!-- ui-btn-left -->
|
|
<div class="ui-title<%=params.bigtitle ? ' bigtitle' : '' %>"><%= (params.title ? use_title : L("lcl_mobile_title"))%></div>
|
|
<div class="ui-btn-right">
|
|
<%
|
|
// nog kiezen wat het leukst is
|
|
if (params.home) {
|
|
%><a href="<%=rooturl + "/appl/pda/"%>Facilitor.asp" data-role="button" data-icon="fa fa-home" data-iconpos="<%=jQButtonIconpos%>" data-direction="reverse" data-ajax='false'><%=L("lcl_home")%></a><%
|
|
}
|
|
if (params.refresh) {
|
|
%><a onclick="FcltMgr.reload()" data-role="button" data-icon="<%=ICONS.placeholder("fa-fclt-refresh", true)%>" data-iconpos="<%=jQButtonIconpos%>" data-direction="reverse"><%=L("lcl_refresh")%></a><%
|
|
}
|
|
if (params.location) {
|
|
%><a href="<%=rooturl + "/appl/pda/"%>setlocation.asp" data-role="button" data-icon="fa fa-map-marker-alt" data-iconpos="<%=jQButtonIconpos%>" data-direction="reverse" data-ajax='false'><%=L("lcl_mobile_setlocation")%></a><%
|
|
}
|
|
if (params.addaction) {
|
|
%><a href="<%=params.addaction%>" data-role="button" data-icon="fa fa-plus" data-iconpos="<%=jQButtonIconpos%>" data-ajax='false'><%=L("lcl_add")%></a><%
|
|
}
|
|
if (params.delaction) {
|
|
%><a href="<%=params.delaction%>" data-role="button" data-icon="fa fa-times" data-iconpos="<%=jQButtonIconpos%>" data-ajax='false'><%=L("lcl_delete")%></a><%
|
|
}
|
|
%>
|
|
</div><!-- ui-btn-right -->
|
|
<%
|
|
if (params.banner) {
|
|
%><div id="hbanner"> </div><%
|
|
}
|
|
%>
|
|
</div><!-- data-role=header -->
|
|
<%
|
|
}
|
|
|
|
function FOOTER(params)
|
|
{
|
|
if (!params) params = {};
|
|
// no footer at all when used modal (as a popup somewhere)
|
|
if (getQParamInt("modal", 0) == 1 || params.modal)
|
|
return;
|
|
%><div data-role="footer" data-theme="<%= params.datatheme_discontinued ? params.datatheme : jQHeaderTheme%>" data-position="fixed"><% /* ff proberen */
|
|
if (params.banner) {
|
|
%> <div id="fbanner"> <%
|
|
if (params.thisuser)
|
|
{
|
|
%> <a href="<%=rooturl%>/appl/pda/user_info.asp" data-ajax="false">
|
|
<img alt="<%=safe.htmlattr(L("fac_profiel")) + " " + safe.htmlattr(L("lcl_photos"))%>" id="photo" src="<%=safe.htmlattr(params.thisuser.photopaththumb)%>" class="footerphoto">
|
|
</a>
|
|
<% }
|
|
%> </div> <%
|
|
}
|
|
if (params.back) {%><a data-role="button" data-icon="fa fa-arrow-left" data-iconpos="<%=jQButtonIconpos%>" onclick="window.history.back(1)"><%=L("lcl_back")%></a><%}%>
|
|
<div class="f1">
|
|
<%
|
|
if (params.mswitch && !device.isapp())
|
|
var txt = "<span class='mobile2touch'>"
|
|
+ "<a href='#' onclick='toTouch();' target=_top>"+L("lcl_mobile_classicmode")+"</a>"
|
|
+ "</span>";
|
|
// else
|
|
// var txt = "<span style='float:right'><small>"+toDateTimeString(new Date)+"</small></span>";
|
|
Response.Write(txt)
|
|
|
|
if (Application("otap_environment") == "O")
|
|
{ // Afmelden: alleen beschikbaar voor ontwikkeling!
|
|
var txt = "<span class='mobile2touch'>"
|
|
+ "<button id='loggingoff' onclick='logOff()'>Afmelden</button>"
|
|
+ "</span>";
|
|
Response.Write(txt)
|
|
%>
|
|
<script>
|
|
function logOff()
|
|
{
|
|
var data = {};
|
|
<% protectRequest.dataToken("data"); %>
|
|
$.post( "<%=rooturl%>/appl/aut/LogOff.asp"
|
|
, data
|
|
, McltCallbackAndThen(logOffCallback)
|
|
, "json"
|
|
);
|
|
return true; // disable button
|
|
}
|
|
function logOffCallback(json, textStatus)
|
|
{
|
|
if (json && json.message)
|
|
logOffCancel();
|
|
else
|
|
parent.location.href = json.return_url;
|
|
}
|
|
function logoff_cancel()
|
|
{
|
|
window.history.back();
|
|
}
|
|
</script>
|
|
<%
|
|
}
|
|
|
|
if (Application("otap_environment") == "O" || __Logging > 0)
|
|
{
|
|
var txt = "<span class='mobile2touch'>"
|
|
+ ((Application("otap_environment") == "O") ? "<a href='./fac_StreamFile.asp?logger=0' target='_blank'><button id='loggingshow'>Open logging</button></a>" : "")
|
|
+ "</span>"
|
|
+ "<span class='mobile2touch'>"
|
|
+ "<button id='loggingoff' onclick='stopLogging()'>Stop logging</button>"
|
|
+ "</span>"
|
|
+ "<span class='mobile2touch'>"
|
|
+ "<a href='../shared/wislog.asp?logging=1' target='_blank'><button id='loggingon' onclick='startLogging()'>Start logging</button></a>"
|
|
+ "</span>"
|
|
Response.Write(txt);
|
|
%>
|
|
<script>
|
|
function startLogging(silent)
|
|
{
|
|
if (!silent)
|
|
$.toast({ text: "Logging is now on", icon: "success", position : 'top-left'});
|
|
$("#loggingon").hide();
|
|
$("#loggingoff").show();
|
|
}
|
|
function stopLogging()
|
|
{
|
|
$.post("../shared/wislog.asp?logging=0");
|
|
$.toast({ text: "Logging is now off", icon: "success", position : 'top-left'});
|
|
$("#loggingoff").hide();
|
|
$("#loggingon").show();
|
|
}
|
|
<%
|
|
if (__Logging > 0)
|
|
Response.Write("$(function() {startLogging(true) });");
|
|
%>
|
|
</script>
|
|
<%
|
|
|
|
}
|
|
%>
|
|
</div>
|
|
<span class="f2">
|
|
<% = !params.nousername && user_key > 0 ? safe.html(user.naam()) : "" %>
|
|
<% = !params.noplaats && user.alg_locatie_key({withcurrent:true}) >-1 ? L("lcl_mobile_currentpos") + safe.html(CurrentPosition) : "" %>
|
|
</span></div><!-- data-role=footer --><%
|
|
}
|
|
|
|
function PAGE_START(params)
|
|
{
|
|
// params.dialog is deprecated/unsupported due to app problems.
|
|
if (!params) params = {};
|
|
%><div data-role="page" id="<%=params.id ? params.id : 'page'%>" data-theme="<%= params.datatheme_discontinued ? params.datatheme : jQDataTheme%>"
|
|
<%= params.pclass?" class='"+params.pclass+"'":"" %> ><%
|
|
}
|
|
function PAGE_END()
|
|
{
|
|
%></div><!-- data-role=page --><%
|
|
}
|
|
function CONTENT_START(params)
|
|
{
|
|
params = params || {};
|
|
%><div data-role="content" data-theme="<%= params.datatheme_discontinued ? params.datatheme : ""%>"
|
|
<%= params.pclass?" class='"+params.pclass+"'":"" %> ><%
|
|
}
|
|
function CONTENT_END()
|
|
{
|
|
%></div><!-- data-role=content --><%
|
|
}
|
|
|
|
function CONTROLGROUP_START(params)
|
|
{
|
|
params = params || {};
|
|
%><div data-role="controlgroup" data-mini="true" <%= params.id?" id='" + params.id + "'":"" %>
|
|
<%= params.horizontal?" data-type='horizontal'":"" %> <%= params.noCenter?"":"style=\"text-align:center\"" %>><%
|
|
}
|
|
function CONTROLGROUP_END()
|
|
{
|
|
%></div><!-- data-role=content --><%
|
|
}
|
|
function BLOCK_START_HTML(params)
|
|
{
|
|
params = params || {};
|
|
if (params.safe !== false && params.title && params.title != " ") var safe_title = safe.html(params.title);
|
|
return "<div data-role='collapsible' data-collapsed-icon='fa fa-plus' data-expanded-icon='fa fa-minus' data-theme='b' data-inset=false data-content-theme='d' data-collapsed='"+(params.collapsed? "true": "false")+"' data-mini='"+(params.mini? "true": "false")+"'><h3>"+(safe_title || params.title || L("lcl_alg_flexblok"))+"</h3>";
|
|
}
|
|
function BLOCK_END_HTML()
|
|
{
|
|
return "</div><!-- data-role=collapsible -->";
|
|
}
|
|
function BLOCK_START(params)
|
|
{
|
|
Response.Write(BLOCK_START_HTML(params));
|
|
}
|
|
function BLOCK_END()
|
|
{
|
|
Response.Write(BLOCK_END_HTML());
|
|
}
|
|
function CONTAINER_START()
|
|
{
|
|
%><div data-role="fieldcontain"><%}
|
|
function CONTAINER_END()
|
|
{
|
|
%></div><!-- data-role=fieldcontain --><%
|
|
}
|
|
function LISTVIEW_START()
|
|
{
|
|
%><ul data-role = "listview" data-inset = "true" data-divider-theme = "b"><%
|
|
}
|
|
function LISTVIEW_END()
|
|
{
|
|
%></ul><%
|
|
}
|
|
function LISTVIEW_DIVIDER(params)
|
|
{
|
|
%><li data-role="list-divider" class="ui-li ui-li-divider ui-bar-b"><%=params.title%></li><%
|
|
}
|
|
|
|
function GRID_START(columns, params)
|
|
{
|
|
params = params||{};
|
|
var vgridclass = '';
|
|
switch (columns)
|
|
{ // maximaal 5 kolommen. 1 kolom bestaat niet.
|
|
case 1: break;
|
|
case 2: vgridclass = ' class="ui-grid-a"'; break;
|
|
case 3: vgridclass = ' class="ui-grid-b"'; break;
|
|
case 4: vgridclass = ' class="ui-grid-c"'; break;
|
|
case 5: vgridclass = ' class="ui-grid-d"'; break;
|
|
}
|
|
%><div<%=vgridclass%>><%
|
|
}
|
|
|
|
function GRID_END()
|
|
{
|
|
%></div><!-- GRID --><%
|
|
}
|
|
|
|
// Parameter items is een array van { href, img, desc, color }-objecten
|
|
function ICON_GRID_HTML(items)
|
|
{
|
|
var result = "<div class='container-fluid ui-grid-b'>"
|
|
+ " <div class='row'>";
|
|
for (x in items)
|
|
{
|
|
var item = items[x];
|
|
result += "<div class='col-4 micon'>"
|
|
+ " <a href='" + safe.htmlattr(item.href) + "'" + (item.color ? " style='color: " + safe.htmlattr(item.color) + ";'" : "") + " data-ajax='false'>"
|
|
+ " <span class='miconimg'>"
|
|
+ (item.img.match(/^fa-/) ? I(item.img) : "<img alt='" + safe.htmlattr(item.desc) + "' src='" + safe.htmlattr(item.img) + "'>")
|
|
+ " </span>"
|
|
+ " </a>"
|
|
+ " <div class='imgCaption'>"
|
|
+ safe.html(item.desc)
|
|
+ " </div>"
|
|
+ "</div>";
|
|
}
|
|
result += " </div>"
|
|
+ "</div>";
|
|
return result;
|
|
}
|
|
|
|
function ICON_GRID(items)
|
|
{
|
|
Response.Write(items.length ? ICON_GRID_HTML(items) : L("lcl_empty_rstable"));
|
|
}
|
|
|
|
function COL_START(column, params)
|
|
{
|
|
params = params||{};
|
|
var vcolclass = '';
|
|
var vcolwidth = (params.width ? ' style="width:'+params.width+'%"' : '');
|
|
switch (column)
|
|
{ // maximaal 5 kolommen
|
|
case 1: vcolclass = ' class="ui-block-a"' + vcolwidth; break;
|
|
case 2: vcolclass = ' class="ui-block-b"' + vcolwidth; break;
|
|
case 3: vcolclass = ' class="ui-block-c"' + vcolwidth; break;
|
|
case 4: vcolclass = ' class="ui-block-d"' + vcolwidth; break;
|
|
case 5: vcolclass = ' class="ui-block-e"' + vcolwidth; break;
|
|
}
|
|
%><div<%=vcolclass%>><%
|
|
}
|
|
|
|
function COL_END()
|
|
{
|
|
%></div><!-- COL --><%
|
|
}
|
|
|
|
function LISTCOUNTER(p)
|
|
{
|
|
return "<span class='ui-li-count'>"+ p + "</span>"
|
|
}
|
|
|
|
function ROFIELD(pclass, plabel, pvalue, params)
|
|
{
|
|
params = params||{};
|
|
if (!pvalue && (params && params.suppressEmpty))
|
|
return; // snel klaar
|
|
if (!params.moreinfo && params.type)
|
|
switch(params.type)
|
|
{
|
|
case "mail":
|
|
case "email":
|
|
case "e-mail":
|
|
case "mailto":
|
|
params.moreinfo = "mailto:" + pvalue;
|
|
break;
|
|
case "tel":
|
|
case "phone":
|
|
case "callto":
|
|
case "telefoon":
|
|
params.moreinfo = S("pda_phone_protocol") + ":" + (params.phone_number || pvalue);
|
|
break;
|
|
}
|
|
if (params.moreinfo)
|
|
params.disabled = true;
|
|
params.readonly = true;
|
|
if (!plabel)
|
|
{ // Heel simpel
|
|
Response.Write("<div class='" + pclass + "'>" + safe.fclthtml(pvalue) + "</div>");
|
|
return;
|
|
}
|
|
|
|
if (pclass) params.pclass = pclass;
|
|
RWFIELD (null, plabel, pvalue, params);
|
|
if (params.withhidden)
|
|
{
|
|
Response.Write("<input type='hidden' id='"+params.withhidden.id+"' name='"+params.withhidden.id+"' value='"+safe.htmlattr(params.withhidden.value)+"'>");
|
|
}
|
|
}
|
|
|
|
function RWFIELD(pId, plabel, pvalue, params)
|
|
{
|
|
params = params||{};
|
|
|
|
var vcontain = (params.contain?" class='ui-field-contain'":"");
|
|
var vdatarole = (params.datarole?" data-role='"+params.datarole+"'":"");
|
|
var vlabel = plabel ? "<label"+(pId ? " for='"+pId+"'" : "")
|
|
+((!params.readonly&&!params.disabled) ? " class='ed'": "")+">" + safe.html(plabel) + "</label>" : "";
|
|
var hasPhoneIcon = params.type && inArray(params.type, ["tel", "phone", "callto", "telefoon"]);
|
|
if (hasPhoneIcon)
|
|
params.pclass = (params.pclass || "") + " hasPhoneIcon";
|
|
if (params.disabled || params.readonly)
|
|
params.pclass = (params.pclass || "") + " ui-disabled" ;
|
|
var vinputattr = "";
|
|
if (pId)
|
|
{
|
|
vinputattr += " name='" + (params.name ? params.name : pId) + "' id='" + pId + "'";
|
|
}
|
|
vinputattr += (params.disabled || params.readonly ? " readonly" : "");
|
|
vinputattr += (params.pclass ? " class='"+params.pclass+"'" : "");
|
|
vinputattr += (params.datatype ? " type='"+params.datatype+"'" : " type='text'");
|
|
vinputattr += (params.html ? " "+params.html : "");
|
|
vinputattr += (params.onkeyup ? " onkeyup='"+params.onkeyup+"'" : " type='text'");
|
|
|
|
|
|
if ((!params.multi || !params.disabled) && params.readonly)
|
|
pvalue = shared.stripbbcodes(pvalue);
|
|
|
|
vinput = (params.multi
|
|
? (params.disabled
|
|
? safe.fclthtml(pvalue)
|
|
: "<textarea " + (plabel ? "placeholder='" + safe.htmlattr(plabel) + "'" : "") + vinputattr + ">" + safe.textarea(pvalue) + "</textarea>"
|
|
)
|
|
: "<input " + (plabel ? "placeholder='" + safe.htmlattr(plabel) + "'" : "") + vinputattr + " value='" + safe.htmlattr(pvalue) + "' />"
|
|
);
|
|
if (params.moreinfo && params.disabled)
|
|
{
|
|
if (params.multi && plabel)
|
|
vlabel = "<a class='moreinfo' data-ajax='false' href='" + safe.htmlattr(params.moreinfo) + "'>" + vlabel + "</a>";
|
|
else
|
|
vinput = "<a class='moreinfo' data-ajax='false' href='" + safe.htmlattr(params.moreinfo) + "'>" + vinput + "</a>";
|
|
|
|
if (hasPhoneIcon)
|
|
{
|
|
%> <script>
|
|
$(function()
|
|
{
|
|
var $phoneIcon = "<div class='suggestklikker'><span class='suggestklikker'><%=I("fa-phone")%></span></div>";
|
|
$("input<%=(params.pclass ? "."+params.pclass.split(" ").join(".") : "")%><%=(pId ? "#"+pId+"[name="+pId+"]" : "")%>[type=<%=(params.datatype || "text")%>]").after($phoneIcon);
|
|
});
|
|
</script>
|
|
<% }
|
|
}
|
|
%><div<%=vdatarole%><%=vcontain%>><%=vlabel%><%=vinput%></div><%
|
|
}
|
|
|
|
function HIFIELD(pId, pValue, params)
|
|
{ // Hidden input field
|
|
var params = params || {};
|
|
var vinput = "<input type='hidden'"
|
|
+ ( pId
|
|
? " id='" + pId + "' name='" + (params.name ? params.name : pId) + "'"
|
|
: ""
|
|
)
|
|
+ ( pValue
|
|
? " value='" + safe.htmlattr(pValue) + "'"
|
|
: ""
|
|
)
|
|
+ " />\n";
|
|
Response.Write(vinput);
|
|
}
|
|
|
|
function BTN_BACK(plabel)
|
|
{
|
|
BUTTON(L("lcl_back"), {click: "window.history.back(1)", dataicon: "fa fa-arrow-left"});
|
|
}
|
|
|
|
function BUTTON(plabel, params)
|
|
{
|
|
// Merk op: dataajax is een string, geen echte boolean. En deze moet "true" zijn
|
|
// als het een link is naar een file met meerdere pagina's!
|
|
params = params||{};
|
|
%><a data-role='button' data-theme='<%=jQButtonTheme%>'
|
|
<%=1||params.mini ? " data-mini='true'" : ""%>
|
|
<%=params.id ? " id='"+params.id+"'" : ""%>
|
|
<%=params.dataicon ? " data-icon='"+ ICONS.placeholder(params.dataicon, true) + "'" : ""%>
|
|
<%=params.dataiconpos? " data-iconpos='"+params.dataiconpos+"'" : ""%>
|
|
<%=params.dataajax ? " data-ajax='"+params.dataajax+"'" : ""%>
|
|
<%=params.transition ? " transition='"+params.transition+"'" : ""%>
|
|
<%=params.datarel ? " data-rel='"+safe.htmlattr(params.datarel)+"'" : ""%>
|
|
<%=params.click ? " onclick='mobile.button.click(event, this)' mobClick='"+safe.htmlattr(params.click)+"'" : ""%>
|
|
<%=params.singlepress? " singlepress=1":""%>
|
|
<%=params.linkid ? " href='"+safe.htmlattr(params.linkid)+"'" : ""%>><%=plabel%></a><%
|
|
}
|
|
|
|
function BTN_SUBMIT(plabel, pform)
|
|
{
|
|
var save_icon = "fa-fclt-save";
|
|
%><a data-role='button' data-icon='<%=ICONS.placeholder(save_icon, true)%>' data-iconpos='right' onclick="$('#<%=pform%>').submit()" ><%=plabel%></a><%
|
|
}
|
|
|
|
function CHB_FIELD_HTML(pId, plabel, pvalue, params)
|
|
{
|
|
params = params || {};
|
|
var vlabel = "";
|
|
var vinput = "<input type='checkbox' class='custom " + (params.pclass ? params.pclass : "") + "' ";
|
|
if (pId)
|
|
{
|
|
vinput += "name='" + pId + "' id='" + pId + "' ";
|
|
vlabel += "<label class='ed' for='" + pId + "'>" + plabel + "</label>";
|
|
}
|
|
vinput += (pvalue && pvalue==1 ? "checked " : "");
|
|
vinput += (params.disabled ? "disabled " : "")
|
|
+ (params.html ? params.html + " " : "");
|
|
vinput += (params.onclick ? "onclick='" + params.onclick + "' " : "");
|
|
vinput += "/>";
|
|
// Net als in /Shared/iface.inc voegen we hier een hidden field has_xxxx toe
|
|
if (pId)
|
|
vinput += "<input type='hidden' id='has_" + pId + "' name='has_" + pId + "' value='1' " + (params.disabled ? ' disabled' : '') + ">";
|
|
return vlabel + vinput;
|
|
}
|
|
|
|
function CHB_FIELD(pId, plabel, pvalue, params)
|
|
{
|
|
params = params || {};
|
|
Response.Write(CHB_FIELD_HTML(pId, plabel, pvalue, params));
|
|
}
|
|
|
|
function FORM_START(pId, params)
|
|
{
|
|
var params = params || {}
|
|
var vform = "<form" + ( pId ? " id='" + pId + "'" + (params.name ? "" : " name='" + pId + "'") : "")
|
|
+ ( params.name ? " name='" + params.name + "'" : "")
|
|
+ ( params.action ? " action='" + safe.htmlattr(params.action) + "'" : "")
|
|
+ ( params.method && (params.method=="get" || params.method=="post") ? " method='" + params.method + "'" : "")
|
|
//onsubmit
|
|
//enctype
|
|
//target
|
|
//accept-charset
|
|
//data-ajax
|
|
+ ">\n";
|
|
Response.Write(vform);
|
|
}
|
|
|
|
function FORM_RVT()
|
|
{
|
|
protectRequest.inputToken();
|
|
}
|
|
|
|
function FORM_END()
|
|
{
|
|
Response.Write("</form>\n");
|
|
}
|
|
|
|
// Kopie uit ../shared/iface.inc
|
|
IFACE =
|
|
{
|
|
FORM_END: function()
|
|
{
|
|
protectRequest.inputToken();
|
|
}
|
|
}
|
|
|
|
function shorttxt(txt, len)
|
|
{
|
|
len = len || S("max_tracking_length");
|
|
txt = txt || "";
|
|
txt = txt.replace(/\n\s*\n/ig, "\n"); // Geheel lege regels of met alleen whitespace
|
|
|
|
if (txt.length < len)
|
|
return txt;
|
|
|
|
// Oke, op scherm afkappen na len karakters.
|
|
// Probeer op de eerste spatie maar die moet wel binnen 20% karakters komen
|
|
var spatie = String(txt).substr(len).indexOf(" ");
|
|
if (spatie < 0 || spatie > len/5)
|
|
spatie = 0;
|
|
return txt.substr(0, len+spatie+1) + "...";
|
|
}
|
|
|
|
function CATLIST_START(p_id, p_inset)
|
|
{
|
|
var v_inset = (p_inset ? "true" : "false");
|
|
var v_id = (p_id ? " id='" +p_id+ "'" : "");
|
|
%><ul data-role="listview" data-theme="b" class="ui-listview" data-content-theme="d" data-inset="<%=v_inset%>" <%=v_id%> ><%
|
|
}
|
|
|
|
function CATLIST_END()
|
|
{
|
|
%></ul><%
|
|
}
|
|
|
|
function CATLIST_ARTIKEL(p_cat_id, params)
|
|
{
|
|
var totaal = params.aantal * params.prijs;
|
|
var uren = params.begindatum.getHours();
|
|
var minuten = params.begindatum.getMinutes();
|
|
|
|
var params_aantal = "";
|
|
if (params.attrib && params.attrib.aantal)
|
|
{
|
|
var a = params.attrib.aantal;
|
|
params_aantal = (a.min ? " min='"+a.min+"'" : "")
|
|
+ (a.max ? " max='"+a.max+"'" : "")
|
|
}
|
|
|
|
if (params.looplijst)
|
|
{ // looplijst catering
|
|
//var isChecked = " checked"; // We zetten default alles al op geleverd.
|
|
var isChecked = (params.geleverd == 1 ? " checked": "");
|
|
var vlabel = "<label class='ed' for='inpb_g_"+p_cat_id + "'> " + L("lcl_res_daglijst_geleverd") + "</label>";
|
|
%>
|
|
<li class="ui-field-contain">
|
|
<img alt="<%=safe.htmlattr(L("lcl_res_article"))%>" src="<%=safe.htmlattr(params.image)%>"/>
|
|
<h3 class="c1"><%=safe.html(params.omschrijving)%></h3>
|
|
<div style="display: inline-block">
|
|
<div class="subheader">
|
|
<div class="listbodytext"><%=L("lcl_count")%>: <%=params.aantal%></div>
|
|
</div>
|
|
<label class='ed' for="inpb_g_<%=p_cat_id%>"><%=L("lcl_res_daglijst_geleverd")%></label>
|
|
<input type="checkbox" id="inpb_g_<%=p_cat_id%>" name="inpb_g_<%=p_cat_id%>"
|
|
value="<%=params.geleverd%>" <%=isChecked%>/>
|
|
</div>
|
|
|
|
<div class="subheader">
|
|
<div class="listbodytext"><%=params.opmerking%></div>
|
|
</div>
|
|
</li>
|
|
<%
|
|
}
|
|
else
|
|
{ // toevoegen/wijzigen catering
|
|
%>
|
|
<li class="ui-field-contain">
|
|
<img alt="<%=safe.htmlattr(L("lcl_res_article"))%>" src="<%=params.image%>">
|
|
<div>
|
|
<h3 class="c1"><%=safe.html(params.omschrijving)%></h3>
|
|
<div data-role="fieldcontain">
|
|
<label for="inpb_c_<%=p_cat_id%>"><%=L("lcl_count")%></label>
|
|
<input type="number" name="inpb_c_<%=p_cat_id%>" id="inpb_c_<%=p_cat_id%>" value="<%=params.aantal%>" data-clear-btn="false" data-wrapper-class="numspinner" <%=params_aantal%>>
|
|
</div>
|
|
<div class="subheader">
|
|
<div class="listbodytext"><%=safe.html(params.opmerking)%></div>
|
|
</div>
|
|
</div>
|
|
<input type="hidden" id="inpbp_c_<%=p_cat_id%>" name="inpbp_c_<%=p_cat_id%>" value="<%=params.prijs%>"/>
|
|
<input type="hidden" id="inpbtp_c_<%=p_cat_id%>" name="inpbtp_c_<%=p_cat_id%>" value="<%=totaal%>"/>
|
|
<input type="hidden" id="inpbh1_c_<%=p_cat_id%>" name="inpbh1_c_<%=p_cat_id%>" value="<%=uren%>"/>
|
|
<input type="hidden" id="inpbm1_c_<%=p_cat_id%>" name="inpbm1_c_<%=p_cat_id%>" value="<%=minuten%>"/>
|
|
</li>
|
|
<%
|
|
}
|
|
}
|
|
|
|
// Returns an icon to be displayed. icon can be an image (e.g. "notfound.png") or a fontawesome icon-name (e.g. "fa-user")
|
|
// trailing fa-qualifiers (e.g. "fa-2x fa-rotate-180" are preserved
|
|
// The optional params provides some options
|
|
// params.fastyle: overrule global fastyle
|
|
function I(icon, params)
|
|
{
|
|
if (!icon)
|
|
return "";
|
|
var params = params || {};
|
|
|
|
if (icon.match(/^fa-/))
|
|
{
|
|
var lstyle = params.fastyle == null ? S("fontawesomestyle") : params.fastyle;
|
|
var fa_fw = !("fa_fw" in params) || params.fa_fw ? " fa-fw" : ""; /* Default met fa-fw maar je kunt het er afhalen met { fa-fw: false } */
|
|
var icon_arr = icon.split(/\s/);
|
|
for (var i = 0; i < icon_arr.length; i++)
|
|
icon_arr[i] = ICONS.placeholder(icon_arr[i]); /* Vervang door placeholder icon indien aanwezig */
|
|
icon = icon_arr.join(" ");
|
|
|
|
/* Geef ik een style mee in de icoon naam, bijv: I("fa-image fas"), dan is die leidend, nuttig voor placeholder-overrules */
|
|
var styles = ["fal", "far", "fas"];
|
|
for (style in styles)
|
|
if (inArray(styles[style], icon.split(/\s/)))
|
|
{
|
|
lstyle = styles[style];
|
|
icon = icon.replace(new RegExp("\\s?" + lstyle), "");
|
|
}
|
|
return "<i class='{0}{1} {2}'></i>".format(lstyle, fa_fw, safe.htmlattr(icon));
|
|
}
|
|
return "";
|
|
}
|
|
%> |