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

    File:         kpn_mandate.asp
    Description:  dit is de grote 'wrapper' voor de diverse andere schermen

    Parameters:
        keys      String van prs_perslidkostenplaats keys

    Context:
    Note:

*/ %>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="prs.inc" -->

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

var kpnman_keys = getQParamIntArray("keys", [-1]);
var multi = kpnman_keys.length > 1;
var kpnman_title = "";
var modal = (getQParamInt("modal", 0) == 1);

if (!multi && kpnman_keys[0] > -1)
{
  kpnman_title = String(kpnman_keys);
}
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>
    <script  type="text/javascript" >
      function kpnClose(params)
      {
<%      if (!multi && kpnman_keys[0] == -1)
        { %>
          if (params.cancel)
          {
            FcltMgr.closeDetail(window, params );
            return true;
          }
          if (!params.keepForm)
          {
            FcltMgr.closeDetail(window, params );
            return true;
          }
<%      }
        else
        { /* Bestaande mandaat bewerkt, switch naar show-mode */ %>
          if (params.close)
          {
            FcltMgr.closeDetail(window, {close: true})
          }
          if (!params.keepForm && !params.deleted)
            $("#kpnFrame")[0].src = "kpn_show_mandate.asp?keys=<%=kpnman_keys.join(",")%>";
<%      } %>
      }
      $(function()
      {
        FcltMgr.setTitle(L("lcl_prs_kosten_mandate") + " <%=safe.jsstring(kpnman_title)%>", {hot: false});
      });

    </script>
  </head>

  <body>
<%
PAGE_START();
    if (multi || (!multi && kpnman_keys[0] == -1))
        var page="kpn_edit_mandate.asp"; // Maak een nieuw of multi edit
    else
        var page="kpn_show_mandate.asp";
    page += "?keys=" + kpnman_keys.join(",");
    page += (modal ? "&modal=1" : "")

    IFRAMER("kpnFrame", page, { FcltClose: "kpnClose", title: L("lcl_kpn_mandate_frame") } );
PAGE_END();
%>
  </body>
</html>
<% ASPPAGE_END(); %> 
