<%@ LANGUAGE = JavaScript %>
<% /*
     $Revision$
     $Id$
*/ %>

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

var regio_key = getQParamInt("regio_key", -1);
var district_key = getQParamInt("district_key", -1);
var locatie_key = getQParamInt("locatie_key", -1); // Als geen input en wel eigen werkplek dan eigen locatie
var gebouw_key = getQParamInt("gebouw_key", -1);
var verdieping_key = getQParamInt("verdieping_key", -1);

autfunction = "WEB_MSGBOF";
var authparams = user.checkAutorisation(autfunction);
var xfunc = user.func_enabled2("MSG");
%>

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

  <body id="searchbody">
    <form name="u2" target="workFrame" action="fac_list_nieuws.asp" method="get">
<%  SEARCH_PAGE_START({ header: L("lcl_filterblok") }); %>
<%    SEARCH_BLOCK_START();%>
              <tr>
                <td class="label"><label for="searchtext"><%=L("lcl_msg_search_text")%></label></td>
                <td><input type="text" class="fld" name="searchtext" value=""></td>
              </tr>
<%

        var sql = "SELECT fac_nieuws_groep_key, fac_nieuws_groep_omschrijving, UPPER(fac_nieuws_groep_omschrijving) "
                + "  FROM fac_nieuws_groep"
                + " ORDER BY 3";

        FCLTselector( "nwsgroup", sql,
                        { label: L("fac_nieuws_groep"),
                          emptyOption: "",
                          multi: true
                        }
                      );

        sql = "SELECT fac_groep_key, fac_groep_omschrijving, fac_groep_upper"
            + "  FROM fac_groep"
            + " ORDER BY 3";

        FCLTselector( "msggroup", sql,
                        { label: L("fac_groep"),
                          emptyOption: "",
                          multi: true
                        }
                    );

        var group = { name: "nieuws_show", label: L("lcl_msg_nieuws_show"), mask: 3, defaultmask: 3, bits: [] };
        group.bits.push({ "mask": 1, "label": L("lcl_msg_nieuws_portal") });
        group.bits.push({ "mask": 2, "label": L("lcl_msg_nieuws_blogpagina") });
        if (xfunc.canWrite("WEB_MSGUSE")) {
          group.mask += 4;
          group.bits.push({ "mask": 4, "label": L("lcl_msg_community") });
        }
        GROUP_CHECK(group, "", 3);

      SEARCH_BLOCK_END();
      SEARCH_BLOCK_START();
          FCLTplaatsselector( authparams.PRSreadlevel
                            , {
                                locatiekey: locatie_key,
                                gebouwkey: gebouw_key,
                                startlevel: 1, // district
                                eindlevel: 4, // verdieping
                                whenEmpty: L("lcl_search_generic")  // want filter
                              });
%>
<%    SEARCH_BLOCK_END();
      var buttons =  [ {title: L("lcl_overview_list"), action:"document.forms.u2.submit();", id:"bSearch", icon: "fa-clipboard-list" } ];
      SIMPLE_BLOCK_START();
        CreateButtons(buttons, { entersubmit: true, showIcons: true });
      SIMPLE_BLOCK_END();
    SEARCH_PAGE_END();
%>
    </form>
    </div>
    <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(); %>
