<%@language = "javascript" %>
<% /*
     $Revision$
     $Id$
*/ %>
<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/disciplineselector.inc" -->
<!-- #include file="../Shared/srtgroepselector.inc" -->
<!-- #include file="../Shared/srtdeelselector.inc" -->

<%
FCLTHeader.Requires({ plugins:["suggest", "jQuery", "kenmerk"],
                      js: []
                    });

var authparams = user.checkAutorisation("WEB_INSMGT");
var disc_key = getQParamInt("disc_key", -1);
var srtgroep_key = getQParamInt("srtgroep_key", -1);
var srtdeel_key = getQParamInt("srtdeel_key", -1);
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>

    <script type="text/javascript">
      function onChangeDiscipline()
      {
        sgSrtgroep.setValue(-1, "", true, false, null, true);
        sgSrtgroep.CheckJustOne();
      }
      function onChangeSrtgroep()
      {
        sgSrtdeel.setValue(-1, "", true, false, null, true);
        sgSrtdeel.CheckJustOne();
      }
      function doSubmit()
      {
          document.forms.u2.submit();
      }
    </script>
  </head>

  <body id="searchbody">
    <div id="search">
      <form name="u2" target="workFrame" action="ins_srtdeel_search_list.asp" method="get">
<%      BLOCK_START("searchtable", L("lcl_filterblok"));
        %>
        <tr>
          <td class="searchkolom1"><!-- start column 1 -->
            <table><!-- x rijen, 2 kolommen: label + veld -->
<%
      RWFIELDTR("srtdeel", "fldsearch", L("lcl_obj_srtdeel_code"), "", { trclass: "primsearch" });
      FCLTdisciplineselector("disc_key",
                               "sgDisc",
                               { label: L("lcl_discipline"),
                                 disc_key: disc_key,
                                 autfunctionKey: authparams.autfunctionkey,
                                 autRW: "R",
                                 module: "INS",
                                 perslidKey: user_key,
                                 onChange: "onChangeDiscipline",
                                 readonly: disc_key>0
                               });

        FCLTsrtgroepselector("srtgroep_key",
                             "sgSrtgroep",
                             { label: L("lcl_obj_group"),
                               srtgroep_key: srtgroep_key,
                               autfunction: "WEB_INSMGT",
                               onChange: "onChangeSrtgroep",
                               urlAdd: [{urlParam: "disc_key", field: "disc_key"}],
                               readonly: srtgroep_key>0
                             });
        FCLTsrtdeelselector("srtdeel_key",
                            "sgSrtdeel",
                            { label: L("lcl_obj_sort"),
                              srtdeel_key: srtdeel_key,
                              module: "INS",
                              autfunction: "WEB_INSMGT",
                              urlAdd: [{urlParam: "srtgroep_key", field: "srtgroep_key"},
                                       {urlParam: "disc_key", field: "disc_key"}],
                              readonly: srtdeel_key>0
                            });

%>
            </table>
          </td><!-- end column 1 -->

          <!-- Second column -->
          <td valign=top>
            <table><!-- x rijen, 2 kolommen: label + veld -->

            </table>
          </td><!-- end column 2-->
        </tr>
        </table>
<%      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>
