<%@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 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">
    <div id="search">
      <form name="u2" method="get" action="fac_menu_list.asp" target="workFrame">
<%    BLOCK_START("searchtable", L("lcl_filterblok"));%>
        <tr>
          <td class="searchkolom1">
            <table><!-- x rijen, 2 kolommen: label + veld -->
<%
              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"
                      + (S("mobile_enabled") == 1 ? " UNION SELECT 3, " + safe.quoted_sql(L("lcl_menu_mobile")) + " FROM DUAL" : "")
                      + " ORDER BY 1";
              FCLTselector("mgroep",
                           sql,
                           { label: L("lcl_menugroep"),
                             trclass: "primsearch",
                             emptyOption: L("lcl_all")
                           })
              sql = "SELECT DISTINCT fac_menuitems_module, fac_menuitems_module FROM fac_menuitems ORDER BY 2";

              FCLTselector("mmodule",
                           sql,
                           { label: L("lcl_menu_module"),
                             emptyOption: L("lcl_all")
                           });
              RWFIELDTR("tekst", "fldsearch", L("lcl_menulabel"), "", { trclass: "primsearch" });
%>
            </table>
          </td>
          <td class="searchkolom2">
            <table><!-- x rijen, 2 kolommen: label + veld -->
            <tr>
              <td><input type="checkbox" name="notinuse" id="notinuse"></td>
              <td class="label"><label for="notinuse"><%=L("lcl_menunotused")%></label></td>
            </tr>
            <tr>
              <td><input type="checkbox" name="inuse" id="inuse" checked></td>
              <td class="label"><label for="inuse"><%=L("lcl_menuused")%></label></td>
            </tr>
            </table>
          </td>
        </tr>
<%    BLOCK_END();
      var buttons =  [ {title: L("lcl_search"), action: "doSubmit()" } ];
      CreateButtons(buttons, { entersubmit: true });
%>
      </form>
    </div> <!-- search -->

    <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>