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

    File:               shared/Bijlagen.asp
    Description:        Toon de knoppen voor de diverse bijlagen dialogen
    Parameters:
    Context:            Vanuit menu
    Note:               Hulpbestand om 'rechtstreeks' bijlagen te uploaden

*/ %>

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

<%
 FCLTHeader.Requires({plugins: ["jQuery"],
                      js:      ["jQuery-ui.js"],
                      css:     []});

var transitParam = buildTransitParam(["zipfile", "autozipfile"]);

var groep = getQParamSafe("groep", ""); // *,import,export

var xfunc = user.func_enabled("*");
function bijlagen(autfunction, label, module, reado, imp_exp_key)
{
    if (xfunc.canWrite(autfunction))
    {
        var url = "../shared/BijlagenForm.asp?showall=1&module=" + module + transitParam;
        if (reado)
            url += "&reado=1";
        if (imp_exp_key)
            url += "&imp_exp_key=" + imp_exp_key;
        var proturl = protectQS.create(url);
        var tekst = "{0} ({1})".format(label, module);
        var li_html = '<li class="mi" onclick="bl(\'' + safe.jsstring(proturl) + '\', \'' + safe.jsstring(tekst) + '\')">' + safe.html(tekst) + '</li>';
        Response.Write(li_html);
    }
}
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>
    <script>
        function bl (url, titel)
        {
            FcltMgr.openModalDetail(url, { titel: titel} );
        }
    </script>
  </head>

  <body class="fclt-modal" id="mod_bijlagen">
<%  SUBFRAME_START(); %>
    <form name="u2">
<%
if (!groep || user.has("WEB_PRSSYS"))
{
    BLOCK_START("bijlagen", L("lcl_appendixes"), { "icon": "fa-images" });
      Response.Write("<ul>");
// TODO: Authorisatie functies anders, lcl's??
        bijlagen("WEB_PRSSYS", "Locatie foto's", "ALGPHL");
        bijlagen("WEB_PRSSYS", "Gebouw foto's", "ALGPHG");
        bijlagen("WEB_PRSSYS", "Terrein foto's", "ALGPHT");
        bijlagen("WEB_PRSSYS", "Opdrachtverstrekking bijlagen", "BDRADR");
        bijlagen("WEB_PRSSYS", "Bestelartikel catalogus symbolen", "BESD");
        bijlagen("WEB_PRSSYS", "Bestelartikel plaatjes", "BESPH");
        bijlagen("WEB_PRSSYS", "Budgetprojecten symbolen", "BGTD");
        bijlagen("WEB_PRSSYS", "Object discipline symbolen", "INSD");
        bijlagen("WEB_PRSSYS", "Contractsoort symbolen", "CNTD");
        bijlagen("WEB_PRSSYS", "Reservering catalogus symbolen", "RESD");
        bijlagen("WEB_PRSSYS", "Reservering foto's", "RESPHR");
        bijlagen("WEB_PRSSYS", "Reservering artikel foto's", "RESPHA");
        bijlagen("WEB_PRSSYS", "Reservering voorziening foto's", "RESPHD");
        bijlagen("WEB_PRSSYS", "Facilitor Graphics DWF bestanden (concept)", "FGII");
        bijlagen("WEB_FACTAB", "Facilitor Graphics DWF bestanden (actueel)", "FGIIA", true);
        bijlagen("WEB_PRSSYS", "Facilitor Graphics Vluchtplannen", "FGIIV");
        bijlagen("WEB_PRSSYS", "Facilitor Graphics Symbolen", "FGIIS");
        bijlagen("WEB_PRSSYS", "Facilitor Graphics Project DWF", "FGIIP");
        bijlagen("WEB_PRSSYS", "Objectsoort foto's", "INSPHS");
        bijlagen("WEB_PRSSYS", "Object foto's", "INSPHD");
        bijlagen("WEB_PRSSYS", "Vakgroep symbolen", "MLDD");
        bijlagen("WEB_PRSSYS", "Vakgroeptype symbolen", "MLDSD");
        bijlagen("WEB_PRSSYS", "Melding plaatjes", "MLDS");
        bijlagen("WEB_PRSSYS", "Marktplaats foto's", "MRK");
        bijlagen("WEB_PRSSYS", "Menu plaatjes", "MENU");
        bijlagen("WEB_PRSSYS", "Styling plaatjes", "STYLE");
      Response.Write("</ul>");
    BLOCK_END();
}

if (!groep || user.has("WEB_FACTAB"))
{
    BLOCK_START("bijlagen", "Logfiles (FACTAB only)", { "icon": "fa-file-shield" });
      Response.Write("<ul>");
        bijlagen("WEB_FACTAB", rooturl + "/temp/" + customerId + " logbestanden", "CUSTTEMP", true);
        bijlagen("WEB_FACTAB", rooturl + "/temp/" + customerId + "/putorders logbestanden", "CUSTTEMPPUO", true);
        bijlagen("WEB_FACTAB", rooturl + "/temp/_AiAi_error" + " AiAi logbestanden", "AIAI", true);
        bijlagen("WEB_FACTAB", custpath + "/xsl bestanden", "CUSTXSL");
        bijlagen("WEB_FACTAB", custpath + "/export bestanden", "CUSTEXP", true);
        bijlagen("WEB_FACTAB", custpath + "/import bestanden", "CUSTIMP", true);
        bijlagen("WEB_FACTAB", custpath + "/tasks bestanden", "CUSTTASKS", true);
        bijlagen("WEB_FACTAB", rooturl + "/temp/" + customerId + "/exchange bestanden", "CUSTEXCH", true);
        bijlagen("WEB_FACTAB", "hMailServer logbestanden", "SMTP", true);
        bijlagen("WEB_FACTAB", "Shibboleth SAML logbestanden", "SHIB", true);
      Response.Write("</ul>");
    BLOCK_END();
}

if (!groep || groep == "EXPORT")
{
    BLOCK_START("bijlagen", L("fac_export_app"), { "icon": "fa-file-export" });
      Response.Write("<ul>");
        var sql = "SELECT * "
                + "  FROM fac_export_app, fac_functie"
                + " WHERE fac_export_app_folder IS NOT NULL"
                + "  AND fac_export_app.fac_functie_key = fac_functie.fac_functie_key (+)";
        var oRs = Oracle.Execute(sql);
        while (!oRs.Eof)
        {
            bijlagen(oRs("fac_functie_code").Value || "WEB_FACTAB", (oRs("fac_export_app_oms").Value || oRs("fac_export_app_code").Value), "EXPORTS", true, oRs("fac_export_app_key").Value );
            oRs.MoveNext()
        }
        oRs.Close();
      Response.Write("</ul>");
    BLOCK_END();
}

if (!groep || groep == "IMPORT")
{
    BLOCK_START("bijlagen", L("fac_import_app"), { "icon": "fa-file-import" });
      Response.Write("<ul>");
        var sql = "SELECT * "
                + "  FROM fac_import_app, fac_functie"
                + " WHERE fac_import_app_folder IS NOT NULL"
                + "  AND fac_import_app.fac_functie_key = fac_functie.fac_functie_key (+)";
        var oRs = Oracle.Execute(sql);
        while (!oRs.Eof)
        {
            bijlagen(oRs("fac_functie_code").Value || "WEB_FACTAB", (oRs("fac_import_app_oms").Value || oRs("fac_import_app_code").Value), "IMPORTS", false, oRs("fac_import_app_key").Value);
            oRs.MoveNext()
        }
        oRs.Close();
      Response.Write("</ul>");
    BLOCK_END();
}

IFACE.FORM_END();
%>
    </form>
<%  SUBFRAME_END(); %>
</body>
</html>
<% ASPPAGE_END(); %>
