<%@language = "javascript" %>
<% /*
    $Revision$
    $Id$

    File:        fac_menu_ovz
    Description: Toont zoekvelden voor lijst van menuopties
    Parameters:  ??
    Context:     Vanuit menu (alleen prssys)
    Note:        In principe kan voor elk veld een parameter worden gegeven (conventies hanteren!)

*/ %>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/selector.inc" -->
<%
FCLTHeader.Requires({ plugins:["jQuery"],
                      js: []
                    });

// PREFILL PARAMETERS:
var mobilemenu = S("mobile_enabled") && getQParamInt("mobile", 0) == 1;
var mgroep = getQParamInt("groep", -1);
var mmodule = getQParam("module", -1);
var minuse = getQParam("inuse", -1);

// So what authorization must we check?
var autfunction = "WEB_PRSSYS";
var authparams = user.checkAutorisation(autfunction);
%>
<html>
  <head>
<%  FCLTHeader.Generate() %>
    <script type="text/javascript">
      function doSubmit()
      {
        document.forms.u2.submit();
      }
    </script>
  </head>

  <body id="searchbody">
    <form name="u2" method="get" action="fac_menu_list.asp" target="workFrame">
      <input type="hidden" name="mobile" value="<%=mobilemenu?1:0%>">
      <% SEARCH_PAGE_START({ header: L("lcl_filterblok") });
      SEARCH_BLOCK_START();
          if (!mobilemenu)
          {
              var sql = "SELECT        0, " + safe.quoted_sql(L("lcl_menu_pers"))   + " FROM DUAL"
                      + " UNION SELECT 1, " + safe.quoted_sql(L("lcl_menu_prof"))   + " FROM DUAL"
                      + " UNION SELECT 2, " + safe.quoted_sql(L("lcl_menu_config")) + " FROM DUAL"
                      + " ORDER BY 1";
              FCLTselector("mgroep",
                          sql,
                          { label: L("lcl_menugroep"),
                            emptyOption: L("lcl_search_generic")
                          });
          }
          var sql = "   SELECT DISTINCT"
                  + "          fac_menuitems_module,"
                  + "          fac_module_name || ' -   ' || lcl.l (fac_module_remark)"
                  + "     FROM fac_module m, fac_menuitems mi"
                  + "    WHERE m.fac_module_name = mi.fac_menuitems_module"
                  + " ORDER BY 2";
          FCLTselector("mmodule",
                        sql,
                        { label: L("lcl_menu_module"),
                          emptyOption: L("lcl_search_generic")
                        });
          RWFIELDTR("tekst", "fld wildcard", L("lcl_menulabel"), "");
          if (mobilemenu)
              RWCHECKBOXTR("portal", "fldcheck", L("lcl_menu_app"), 0);
      SEARCH_BLOCK_END();
      SEARCH_BLOCK_START();
          RWCHECKBOXTR("notinuse", "", L("lcl_menunotused"), 0, { boxfirst: true, twocols: true });
          RWCHECKBOXTR("inuse", "", L("lcl_menuused"), 1, { boxfirst: true, twocols: true });
      SEARCH_BLOCK_END();
      var buttons =  [ {title: L("lcl_overview_list"), action: "doSubmit()", icon: "fa-clipboard-list" } ];

      SIMPLE_BLOCK_START();
          CreateButtons(buttons, { entersubmit: true, showIcons: true });
      SIMPLE_BLOCK_END();
      SEARCH_PAGE_END();
%>
      </form>

    <div id="result">
      <iframe width="100%" height="100%"
              src="../Shared/empty.asp"
              name="workFrame" id="workFrame"
              onload="FcltMgr.iframeLoaded(this)"
              frameborder="0" scrolling="no">
      </iframe>
    </div>
  </body>
</html><% ASPPAGE_END(); %>
