From 0dc30dfaca237f5aa79e2d4790150cd2462734d3 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Thu, 15 Sep 2016 14:27:24 +0000 Subject: [PATCH] Bug 17282 - Ability to exclude the last line in report results This patch add a checkbox (exclude last line). This is useful when this last is the result of a sql rollup which is the sum of each column and make the chart not consistent Signed-off-by: Josef Moravec --- koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc | 3 +++ .../intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc index ebb86ad..0ec5a32 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/chart.inc @@ -27,6 +27,9 @@ + + + [% column = 1 %]
[% FOREACH header IN header_row %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index 7c1b8f6..9a0b8e4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -884,6 +884,10 @@ canned reports and writing custom SQL reports.

headers = [% header_row.json %]; var results = [% results.json %] + if ($('input[name="chart-exclude-last"]').prop('checked')) { + results.splice(-1, 1); + } + $('select[name="y"]').each(function( index ) { y_elements.push( $(this).val() ); }); -- 2.1.4