<%@ language = "JavaScript" %> <% /* $Revision$ $Id$ File: fac_menu_list.asp Description: Toont alle gebruikte of beschikbare menu-opties Parameters: filters, zie onder Context: Als resultaat van het menubeheer/selectiescherm voor de applicatiebeheerder Requires: WEB_PRSSYS autorisatie Note: */ %> <% var mobilemenu = S("mobile_enabled") && getQParamInt("mobile", 0) == 1; var mgroep = getQParamInt("mgroep", mobilemenu ? 3 : -1); var appOnly = getQParam("portal", "off") == "on"; var mmodule = getQParam("mmodule", -1); var minuse = getQParam("inuse", "off") == "on"; var mnotinuse = getQParam("notinuse", "off") == "on"; var tekst = getQParam("tekst", ""); var showall = getQParamInt("showall", 0) == 1; var outputmode = getQParamInt("outputmode", 0); var addButton = []; var autfunction = "WEB_PRSSYS"; var authparams = user.checkAutorisation(autfunction); var canAdd = (authparams.PRSwritelevel < 9); FCLTHeader.Requires({ plugins: ["jQuery"], js: ["jquery-ui.js"] }) %>
<% FCLTHeader.Generate({outputmode: outputmode}) %>
<% var sqln = "SELECT menu.* FROM (" + " SELECT mi.fac_menuitems_key" + ", mi.fac_menuitems_module" + ", COALESCE(m.fac_menu_altgroep, mi.fac_menuitems_groep) fac_menuitems_groep" + ", " + lcl.xsql2("COALESCE(m.fac_menu_altlabel, mi.fac_menuitems_label)", 'FAC_MENU_ALTLABEL', 'fac_menu_key') + " fac_menuitems_label" + ", COALESCE(m.fac_menu_alturl, mi.fac_menuitems_url) fac_menuitems_url" + ", mi.fac_menuitems_srtdisc" + ", mi.fac_menuitems_disc" + ", fac_menu_volgnr" + ", m.fac_functie_key" + ", fac_menuitems_rw" + ", " + lcl.xsqla("fac_menu_info", "fac_menu_key") + ", fac_menu_key" + ", m.ins_srtdiscipline_key" + ", m.ins_discipline_key" + ", f.fac_functie_code" + ", f2.fac_functie_code fac_functie_code2" + ", m.fac_menu_level" + ", m.fac_menu_portal" + ", COALESCE(m.fac_menu_image, mi.fac_menuitems_image) image" + ", (SELECT SUM (fac_gui_counter_count)" + " FROM fac_gui_counter" + " WHERE fac_gui_counter_group = 'menu' AND fac_gui_counter_refkey = fac_menu_key" + " AND fac_gui_counter_date > sysdate - 365) aantal" + ", (SELECT SUM (fac_gui_counter_count)" + " FROM fac_gui_counter" + " WHERE fac_gui_counter_group = 'menu' AND fac_gui_counter_refkey = fac_menu_key" + " AND fac_gui_counter_date > sysdate - 31) aantalmaand" + " FROM fac_menuitems mi, fac_functie f, fac_menu m, fac_functie f2" + " WHERE m.fac_functie_key = f.fac_functie_key(+)" + " AND mi.fac_functie_key = f2.fac_functie_key(+)" + " AND mi.fac_menuitems_key = m.fac_menuitems_key(+)" + " UNION ALL " + " SELECT NULL fac_menuitems_key" + ", NULL fac_menuitems_module" + ", m.fac_menu_altgroep fac_menuitems_groep" + ", " + lcl.xsqla2("m.fac_menu_altlabel", 'FAC_MENU_ALTLABEL', 'fac_menu_key') + ", m.fac_menu_alturl fac_menuitems_url" + ", NULL " + ", NULL" + ", fac_menu_volgnr" + ", m.fac_functie_key" + ", NULL " + ", " + lcl.xsqla("fac_menu_info", "fac_menu_key") + ", fac_menu_key" + ", m.ins_srtdiscipline_key" + ", m.ins_discipline_key" + ", f.fac_functie_code" + ", NULL fac_functie_code2" + ", m.fac_menu_level" + ", m.fac_menu_portal" + ", m.fac_menu_image image" + ", (SELECT SUM (fac_gui_counter_count)" + " FROM fac_gui_counter" + " WHERE fac_gui_counter_group = 'menu' AND fac_gui_counter_refkey = fac_menu_key" + " AND fac_gui_counter_date > sysdate - 365) aantal" + ", (SELECT SUM (fac_gui_counter_count)" + " FROM fac_gui_counter" + " WHERE fac_gui_counter_group = 'menu' AND fac_gui_counter_refkey = fac_menu_key" + " AND fac_gui_counter_date > sysdate - 31) aantalmaand" + " FROM fac_functie f, fac_menu m" + " WHERE m.fac_functie_key = f.fac_functie_key(+)" + " AND m.fac_menuitems_key IS NULL" + " AND m.fac_menu_altgroep NOT IN (5, 6)" + ") menu" + (tekst? " ,fac_locale_xsl":"") + " where (1=1) " + (mobilemenu ? "AND fac_menuitems_groep = 3" : "AND fac_menuitems_groep IN (0, 1, 2)" ) + (appOnly ? "AND fac_menu_portal = 1" : "") + (mgroep != -1 ? " AND fac_menuitems_groep = " + mgroep : "" ) + (mmodule != -1 ? " AND fac_menuitems_module = " + safe.quoted_sql(mmodule) : "") + (!minuse ? " AND fac_menu_key IS NULL" : "") + (!mnotinuse ? " AND fac_menu_key IS NOT NULL" : "") + (tekst ? " AND fac_locale_xsl_label(+) = fac_menuitems_label" + " AND fac_locale_xsl_module(+) = 'ASP'" + " AND fac_locale_xsl_lang(+) = " + safe.quoted_sql(user.lang()) + " AND UPPER(COALESCE(fac_locale_xsl_cust, fac_locale_xsl_tekst, fac_menuitems_label)) LIKE " + safe.quoted_sql_wild("%" + tekst + "%") : ""); // Zelfs met PRSSYS kom je hier niet in, dan ook maar niet tonen. Is te verwarrend if (!user.has("WEB_FACTAB")) { sqln += " AND (fac_functie_code IS NULL OR fac_functie_code NOT IN ('WEB_FACFAC', 'WEB_FACTAB'))" sqln += " AND (fac_functie_code2 IS NULL OR fac_functie_code2 NOT IN ('WEB_FACFAC', 'WEB_FACTAB'))" } sqln += " ORDER BY fac_menuitems_groep, fac_menu_volgnr, fac_menuitems_label"; function fnrowData(oRs) { var menu_key = oRs("fac_menu_key").value; var menuitem_key = oRs("fac_menuitems_key").value; if (menu_key == null) menu_key = -1 if (menuitem_key == null) menuitem_key = -1 var data = {menu_key: menu_key, menuitem_key: menuitem_key}; return JSON.stringify(data); } function fncolGroep(oRs) { var lgrtext = "?"; switch (oRs("fac_menuitems_groep").value) { case 0 : lgrtext = L("lcl_menu_pers") ; break; case 1 : lgrtext = L("lcl_menu_prof") ; break; case 2 : lgrtext = L("lcl_menu_config") ; break; case 3 : lgrtext = L("lcl_menu_mobile") ; break; case 7 : lgrtext = L("lcl_menu_app") ; break; } return lgrtext; } function fncolPortal(oRs) { if (oRs("fac_menu_portal").value == 1) return (outputmode < 2 ? I("fa-check") : L("lcl_Yes")); } function fncolLabel(oRs) { var l = ""; l = safe.html(fac.localstring(oRs("fac_menuitems_label").value)); if (oRs("fac_menu_level").value == 1) l = "" + l + ""; return l; } function fncolUse(oRs) { if (oRs("fac_menu_key").value == null) return L("lcl_No"); else return L("lcl_Yes"); } function fncolImage(oRs) { if (outputmode < 2 && oRs("image").value && (oRs("image").value).match(/^fa-/)) return I(oRs("image").value); else return safe.html(oRs("image").value); } function fncolExplode(oRs) { var s = ""; if (oRs("fac_menuitems_srtdisc").value == 1 && oRs("fac_menuitems_module").value == "MLD") s = L("lcl_vakgroup_type"); else if (oRs("fac_menuitems_srtdisc").value == 1 && oRs("fac_menuitems_module").value == "RES") s = L("lcl_srtactivity"); else if (oRs("fac_menuitems_disc").value == 1) s = L("lcl_bes_discipline"); else if (oRs("ins_srtdiscipline_key").value != null ) s = "="+L("lcl_vakgroup_type"); else if (oRs("ins_discipline_key").value != null) s = "="+L("lcl_bes_discipline"); // NB: uit de explosie halen van srtactiviteit werkt nog niet zomaar return s; } function fnAantalYr(oRs) { if (oRs("aantal").Value) return (oRs("aantal").Value||0); } function fnAantalMnd(oRs) { if (oRs("aantalmaand").Value) return (oRs("aantalmaand").Value||0); } var addurl = "appl/fac/fac_menu.asp" + (mobilemenu ? "?mobile=1" : "") if (canAdd) addButton = [{ icon: "fa-plus", title: L("lcl_add"), action: "FcltMgr.openDetail('" + addurl + "', '" + safe.jsstring(L("lcl_add")) + "')" }] var rst = new ResultsetTable({ sql: sqln, keyColumn: "fac_menu_key", ID: "menutable", title : L("lcl_fac_menuopties"), rowData: fnrowData, showAll: showall, outputmode: outputmode, buttons: addButton }); if (minuse && mnotinuse) rst.addColumn(new Column({caption: L("lcl_menuused"), content: fncolUse})); if (!mobilemenu) rst.addColumn(new Column({caption: L("lcl_menugroep"), content: fncolGroep})); rst.addColumn(new Column({caption: L("lcl_menuvolgnr"), content: "fac_menu_volgnr", datatype: "number"})); rst.addColumn(new Column({caption: mobilemenu ? L("lcl_menu_app") : L("lcl_menuportal"), content: fncolPortal, align: "center"})); rst.addColumn(new Column({caption: L("lcl_menulabel"), content: fncolLabel})); rst.addColumn(new Column({caption: L("lcl_fac_menuexplode"), content: fncolExplode})); rst.addColumn(new Column({caption: L("lcl_menuinfo"), content: "fac_menu_info"})); rst.addColumn(new Column({caption: L("lcl_fac_menusysautorisatie"), content: "fac_functie_code2"})); rst.addColumn(new Column({caption: L("lcl_fac_menuautorisatie"), content: "fac_functie_code"})); rst.addColumn(new Column({caption: L("lcl_image"), content: fncolImage, align: "center", tooltip: "image"})); if (user.has("WEB_FACFAC")) { rst.addColumn(new Column({caption: L("lcl_fac_menu_usage_yr"), align: "right", content: fnAantalYr})); rst.addColumn(new Column({caption: L("lcl_fac_menu_usage_mnd"), align: "right", content: fnAantalMnd})); } rst.addAction({action: "aMenuDetails", caption:L("lcl_menu_details"), isDefault: true}); var cnt = rst.processResultset(); %>
<% ASPPAGE_END(); %>