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

    File:          prs_contactpersoon_search.asp
    Description:   Toont zoekvelden voor lijst van contactpersonen
    Parameters:
    Context:       Vanuit menu
    Note:

*/ %>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/selector.inc" -->
<!-- #include file="../Shared/bedrijfselector.inc" -->
<!-- #include file="../Shared/plaatsselector.inc" -->

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

/***** Get webform parameters *****/

var loc_key = getQParamInt("locatie_key", -1);

// optional prefilling params
var contact_name = getQParam("contact_name", "");
var contact_key = getQParamInt("contact_key", -1); // Contactpersoon
var comp_key = getQParamInt("comp_key", -1); // Bedrijf

/***** End get webform parameters *****/

var authparams = user.checkAutorisation('WEB_RELUSE', true);
user.auth_required_or_abort(authparams);
var ALGreadlevel = (authparams? authparams.ALGreadlevel : 9);
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>
    <script type="text/javascript">
      function doSubmit()
      { // Submitten met kenmerken
        doSubmitWithKenmerken();
      }

      function myModal()
      {
        var lvl = "";
        var key = 0;
        var bld_key = "";
        var url = "load_kenmerk.asp?disc=" + "&urole=bo" + "&advanced=1" + "&niveau=C";
        var titel = "";
        showKenmerkModal(url, titel)
      }
    </script>
  </head>

  <body id="searchbody">
    <div id="search">
      <form name="u2" method="get" action="prs_contactpersoon_search_list.asp" target="workFrame">
        <input type="hidden" id="search" name="search" value="1">
<%    BLOCK_START("searchtable", L("lcl_filterblok"));%>
        <tr>
          <td class="searchkolom1">
            <table><!-- x rijen, 2 kolommen: label + veld -->
              <tr class="primsearch">
                <td class="label"><label for="contact_name"><%=L("lcl_prs_contactpersoon_name")%>:</label></td>
                <td><input type="text" class="fld wildcard" name="contact_name" <%="value='" + (contact_name != ""? safe.htmlattr(contact_name) : "") + "'"%>></td>
              </tr>
<%            FCLTbedrijfselector("bedrijf_key", // company
                                  "sgComp",
                                  { companyKey: comp_key,
                                    label: L("lcl_prs_company"),
                                    autlevel: ALGreadlevel, // Was voorheen niet aanwezig
                                    whenEmpty: L("lcl_search_generic")  // want filter
                                  }); %>
            </table>
          </td><!-- end column 1 -->

          <!-- Second column -->
          <td class="searchkolom2">
            <table><!-- x rijen, 2 kolommen: label + veld -->
<%            FCLTplaatsselector(ALGreadlevel,
                                 { locatiekey: loc_key,
                                   startlevel: 2, // locatie
                                   eindlevel: 3, // gebouw
                                   whenEmpty: L("lcl_search_generic")  // want filter
                                 }); %>
            </table>
          </td><!-- end column 2-->
        </tr>
<%    BLOCK_END();

      var buttons =  [ {title: L("lcl_search"), action:"doSubmit()", id: "bSearch"},
                       {title: L("lcl_obj_advanced"), action: "myModal()", id: "bAdvanced"} ];
      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>