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

    File            fac_reportx.asp
    Description:    Voor *beheer* van rapporten
    Parameters:
    Note:
*/
%>

<!-- #include file="../scf/scaffolding.inc" -->
<!-- #include file="../api2/model_reportsx.inc" -->

<%
    var reportsx = new model_reportsx();

    if (S("qp_maxrows") < 250)
        settings.overrule_setting("qp_maxrows", 250); // Toon alle kolommen direct

    var show_buttons = [{ title: L("lcl_usrrap_show"), action: "show_report", icon: "fa-file-alt" }];
    if (S("fac_usrrap_mode") != 1)
        reportsx.includes = []; // Geen kolom details laten zien

    scaffolding(reportsx,
        {
            "search": {
                        autosearch: true
                      },
            "show":   {
                        requires: { js: ["./fac_reportx.js"] },
                        buttons: show_buttons,
                        no_clone: S("fac_usrrap_mode") != 1
                      },
            "edit":   {
                        requires: { js: ["./fac_reportx.js"] }
                      },
            "layout": {
            "block": [
                        {
                            "blockid": "repGeneral",
                            "label": L("lcl_usrrap_gegevens"),
                            "icon": "fa-database",
                            "fields": [
                                "id",
                                "name",
                                "viewname",
                                "description",
                                "count",
                                "ratio",
                                "maxrows",
                                "pivot",
                                "condition",
                                "urllink"
                            ]
                        },
                        {
                            "blockid": "repAccess",
                            "label": L("lcl_usrrap_meta"),
                            "icon": "fa-low-vision",
                            "fields": [
                                "authorization",
                                "group",
                                "sequence",
                                "code",
                                "parameters"
                            ]
                        },
                        {
                            "blockid": "repFormat",
                            "label": L("lcl_usrrap_presentatie"),
                            "icon": "fa-swatchbook",
                            "fields": [
                                "styling",
                                "graph",
                                "graph_type",
                                "sort",
                                "autorefresh"
                            ]
                        },
                        {
                            "blockid": "repStyle",
                            "label": L("lcl_usrrap_style"),
                            "icon": "fa-tachometer",
                            "fields": [
                                "limit0",
                                "limit1",
                                "limit2",
                                "limit3",
                                "graph_options"
                            ]
                        },
                        {
                            "blockid": "repMeta",
                            "label": L("lcl_usrrap_usage"),
                            "icon": "fa-stopwatch",
                            "fields": [
                                "created",
                                "lastrefresh",
                                "usage"
                            ]
                        }
                    ]
            },
            "included": {
                "columns": {
                    "list": {
                        "requires": { js: ["./fac_reportx.js"] },
                        "buttons": [{
                            "title": L("lcl_usrrap_show"),
                            "action": "show_report({0})".format(getQParamInt("fac_usrrap_key", -1)),
                            "icon": "fa-file-alt"
                        }]
                    }
                }
            }
        });
%>
<% ASPPAGE_END(); %>
