diff --git a/APPL/API2/model_reportcolumns.inc b/APPL/API2/model_reportcolumns.inc index 858d30a643..c94689e3c5 100644 --- a/APPL/API2/model_reportcolumns.inc +++ b/APPL/API2/model_reportcolumns.inc @@ -49,7 +49,7 @@ model_reportcolumns = { case "date": case "datetime": - model_reportcolumns.fields.group.LOV = api2.filterLOV(L("lcl_rap_groupbyLOV"), "G,D,W,M,Y,H"); + model_reportcolumns.fields.group.LOV = api2.filterLOV(L("lcl_rap_groupbyLOV"), "G,D,W,M,Q,Y,H"); model_reportcolumns.fields.datatype.LOV = api2.filterLOV(L("lcl_rap_datatypeLOV"), "date,datetime,time"); break; case "time": @@ -122,7 +122,7 @@ model_reportcolumns = if (view_name_short.match(/_V_UDR/)) colpar.visible = 'H'; // Hidden, die hebben te veel kolommen - if (ucolname.match(/^(FCLT_F_|FCLT_D_)/)) + if (ucolname.match(/^(FCLT_F_|FCLT_D_|FCLT_X_)/)) colpar.filter = 'A'; var ora_type = oRs("data_type").Value; @@ -130,11 +130,7 @@ model_reportcolumns = var ora_precision = oRs("data_precision").Value; var ora_scale = oRs("data_scale").Value; - if (ucolname.match("^FCLT_F_|FCLT_X_")) // Filter, altijd varchar - { - colpar.filter = 'A'; - } - else if (ucolname.match("^FCLT_C_")) // Currency + if (ucolname.match("^FCLT_C_")) // Currency { colpar.datatype = 'currency'; } diff --git a/APPL/API2/model_reports.inc b/APPL/API2/model_reports.inc index 7674c58894..74a1d12774 100644 --- a/APPL/API2/model_reports.inc +++ b/APPL/API2/model_reports.inc @@ -42,7 +42,16 @@ function model_reports_template() if (this.list && this.list.default_url && fld == "id") groupbys.push(this.fields["id"].dbs); else - this.fields[fld].hidden = true; // Onnodige velden niet ophalen + { + if (this.fields[fld].dbs.match(/^hide_f/)) // Meenemen om te sorteren + { + this.fields[fld].hidden = false; + params.columns.splice(0, 0, fld); + params.groupby.splice(0, 0, "G"); + } + else + this.fields[fld].hidden = true; // Onnodige velden niet ophalen + } } } @@ -109,6 +118,12 @@ function model_reports_template() groupbys.push(field.sql); field.label = L("lcl_usrrap_label_MONTH").format(field.label); break; + case "Q": + field.sql = "TO_CHAR(" + field.dbs + ", 'YYYY-Q')"; + field.newtyp = "varchar"; + groupbys.push(field.sql); + field.label = L("lcl_usrrap_label_QUARTER").format(field.label); + break; case "Y": field.sql = "TO_CHAR(" + field.dbs + ", 'YYYY')"; field.newtyp = "varchar"; @@ -118,6 +133,16 @@ function model_reports_template() } } } + for (var i=0; i < params.columns.length; i++) + { + var fld = params.columns[i]; + if (this.fields[fld].dbs.match(/^hide_f/)) // Die willen we uiteindelijk niet zien + { + params.columns.splice(i, 1); + params.groupby.splice(i, 1); + } + } + var query = api2.sqlfields(params, this); params.filter.fclt_3d_user_key = user_key; // Die is gemakkelijk diff --git a/APPL/API2/model_reportsx.inc b/APPL/API2/model_reportsx.inc index f1cfd6736c..5af7f61fb5 100644 --- a/APPL/API2/model_reportsx.inc +++ b/APPL/API2/model_reportsx.inc @@ -31,8 +31,9 @@ function model_reportsx(usrrap_key, params) "description" : { dbs: "fac_usrrap_info", typ: "varchar", label: L("lcl_usrrap_info"), filter: "like", translate: true }, "viewname" : { dbs: "fac_usrrap_view_name", typ: "varchar", label: L("lcl_usrrap_viewname"), filter: "like"}, "authorisation": { dbs: "fac_functie_key", typ: "key", label: L("lcl_usrrap_functie"), foreign: "fac_functie"}, + "group" : { dbs: "fac_usrrap_groep", typ: "varchar", label: L("lcl_usrrap_groep"), filter: "like" }, "styling" : { dbs: "fac_usrrap_functie", typ: "key", label: L("lcl_usrrap_styling"), - LOV: L("lcl_usrrap_stylingLOV") }, // 0;on-gestylede;1;gestylede;2;procedure;3;procedure gestyled;8;Via tabelizer + LOV: L("lcl_usrrap_stylingLOV") }, // 0;on-gestylede;1;gestylede;2;procedure;3;procedure gestyled;8;Via tabelizer;16;mobile "urllink" : { dbs: "fac_usrrap_urllink", typ: "varchar", label: L("lcl_usrrap_urllink")}, "autorefresh" : { dbs: "fac_usrrap_autorefresh", typ: "check", label: L("lcl_usrrap_autorefresh")} @@ -176,7 +177,10 @@ function model_reportsx(usrrap_key, params) if (user.oslogin() != "_FACILITOR") // Alleen _FACILITOR mag nieuwe rapporten toevoegen { // (PRSSYS mag wel clonen) this.REST_POST = false; + this.fields["viewname"].readonly = true; } + else + settings.overrule_setting("fac_usrrap_mode", 0xff); // _FACILITOR mag alles if (!user.checkAutorisation("WEB_PRSSYS", true)) { diff --git a/APPL/FAC/fac_report.asp b/APPL/FAC/fac_report.asp index d862ab06ed..00628e1832 100644 --- a/APPL/FAC/fac_report.asp +++ b/APPL/FAC/fac_report.asp @@ -21,58 +21,186 @@ Server.ScriptTimeout=600; // extra tijd var rapport = model_reports(usrrap_key); - if (rapport.styling) - { - if ((rapport.styling.id & 2) == 2) // view proc doen we 'old style' - Response.Redirect("fac_usrrap_search.asp?usrrap_key=" + usrrap_key); + if ((S("fac_usrrap_mode") & 2) == 0) + rapport.list.canGroup = false; - if ((rapport.styling.id & 1) == 1) // XSL proc doen we niet via resultsettable + rapport.list.canGraph = (S("fac_usrrap_mode") & 4) == 4; + + //if (rapport.styling) + { + if (getQParam("graph", "") == "G") { + FCLTHeader.Requires({plugins: ["jQuery"], + js: ["../Localscripts/jqPlot/dist/excanvas.js", + "../Localscripts/jqPlot/dist/jquery.jqplot.js", + "../Localscripts/jqPlot/dist/plugins/jqplot.canvasTextRenderer.js", + "../Localscripts/jqPlot/dist/plugins/jqplot.canvasAxisLabelRenderer.js", + "../Localscripts/jqPlot/dist/plugins/jqplot.canvasAxisTickRenderer.js", + "../Localscripts/jqPlot/dist/plugins/jqplot.categoryAxisRenderer.js", + "../Localscripts/jqPlot/dist/plugins/jqplot.barRenderer.js", + "../Localscripts/jqPlot/dist/plugins/jqplot.meterGaugeRenderer.js", + "../Localscripts/jqPlot/dist/plugins/jqplot.pieRenderer.min.js", + "../Localscripts/jqPlot/dist/plugins/jqplot.highlighter.min.js" + ], + css: ["../Localscripts/jqPlot/dist/jquery.jqplot.css"] + }); // Overrule scaffolding_list scaffolding_list = function (model, scf_params) { - var outputmode = getQParamInt("outputmode", 0); - var nohtml = getQParamInt("nohtml", 0) == 1; - if (nohtml) // Die is simpel - { - Response.Clear(); - FCLT2XMLResponse ({xmlnode: 'rapport', key: usrrap_key, mode: mode, xwhere: "sql_where"}); - Response.End; - } + scf_params.list = scf_params.list || {}; + scf_params.list.columns = scf_params.list.columns || []; - var mode = ''; - if (outputmode==2) mode = 'excel'; - if (outputmode==1) mode = 'print'; - %> - - <% FCLTHeader.Generate({ outputmode: outputmode }); %> - <% if (outputmode == 0) {%> - + <% } %> + + + + <% + if(outputmode==0) { - window.open("fac_report.asp?outputmode=1<%=safe.jsstring(transitQS())%>"); + var buttons = [ { icon: "print.png", title: L("lcl_print_table"), action: 'rap_print()' }, + { icon: "excel.png", title: L("lcl_export_to_excel"), action: 'rap_excel() ' } + ]; + IFRAMER_HEADER(model.records_title, buttons); } - function rap_excel() - { - window.open("fac_report.asp?outputmode=2<%=safe.jsstring(transitQS())%>"); - } - - <% } %> - - + %> +
+ + <% - if(outputmode==0) - { - var buttons = [ { icon: "print.png", title: L("lcl_print_table"), action: 'rap_print()' }, - { icon: "excel.png", title: L("lcl_export_to_excel"), action: 'rap_excel() ' } - ]; - IFRAMER_HEADER(model.records_title, buttons); - } - FCLT2XMLResponse ({xmlnode: 'rapport', key: usrrap_key, mode: mode, xwhere: "sql_where"}); - %> - - - <% } } } diff --git a/APPL/FAC/fac_reportx.asp b/APPL/FAC/fac_reportx.asp index d6dc3c0dc2..761e73b642 100644 --- a/APPL/FAC/fac_reportx.asp +++ b/APPL/FAC/fac_reportx.asp @@ -16,6 +16,12 @@ <% var reportsx = new model_reportsx(); + var show_buttons = [{ title: L("lcl_usrrap_show"), action: "show_report", icon: "doc_text_image.png" }]; + if (S("fac_usrrap_mode") & 1) + show_buttons.push({ title: L("lcl_usrrap_clone"), action: "clone_report", icon: "copy.png" }); + else + reportsx.includes = []; // Geen kolom details laten zien + scaffolding(reportsx, { "search": { @@ -23,8 +29,7 @@ }, "show": { requires: { js: ["./fac_reportx.js"] }, - buttons: [{ title: L("lcl_usrrap_show"), action: "show_report", icon: "doc_text_image.png" }, - { title: L("lcl_usrrap_clone"), action: "clone_report", icon: "copy.png" }] + buttons: show_buttons } }); %> diff --git a/APPL/PDA/reports.asp b/APPL/PDA/reports.asp index 669a5cbf76..5c72b7978d 100644 --- a/APPL/PDA/reports.asp +++ b/APPL/PDA/reports.asp @@ -4,7 +4,7 @@ <% params = { list: {}, - filter: {} + filter: { "styling" : 16 } // Alleen de mobiele }; var usrrap_key = getQParamInt("usrrap_key", -1); diff --git a/APPL/SCF/scaffolding_search.inc b/APPL/SCF/scaffolding_search.inc index ad07a56ca5..d453cdf2b9 100644 --- a/APPL/SCF/scaffolding_search.inc +++ b/APPL/SCF/scaffolding_search.inc @@ -136,8 +136,10 @@ function scaffolding_search(model, scf_params) BLOCK_END(); var buttons = []; - // buttons.push({title: L("lcl_menu_fac_graphs"), action: "doSubmit('G')" }); buttons.push({title: L("lcl_search"), action: "doSubmit()" }); + + if (model.list && model.list.canGraph) + buttons.push({title: L("lcl_menu_fac_graphs"), action: "doSubmit('G')" }); buttons.push({title: L("lcl_scf_columns"), action: "pick_columns(this)" }); CreateButtons(buttons, { entersubmit: true }); %>