From eaedd3f9b0b2cec2a9a009ce13012a8b3cfe125a Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Tue, 30 Jul 2019 15:20:27 +0000 Subject: [PATCH] Bug 23389: Add 'All' option to report dropdowns This patch optionally adds an 'all' option to report dropdowns Note you will need to use 'LIKE' instead of '=' to allow 'All' to work To test: 1 - Write a report: SELECT branchname FROM branches WHERE branchcode LIKE <> 2 - Run it 3 - Select a branch 4 - You get one branch info 5 - Note you cannot select all 6 - Apply patch 7 - Run report 8 - No change 9 - Update report like: SELECT branchname FROM branches WHERE branchcode LIKE <> 10 - Run report 11 - Select 'All' 12 - You get all branches 13 - Select one branch 14 - You get one branch 15 - Test with other authorised categories (itemtypes, YES_NO, etc.) 16 - Confirm it works as expected 17 - Prove -v t/db_dependent/Reports/Guided.t Signed-off-by: Lisette Scheer --- C4/Reports/Guided.pm | 1 + .../prog/en/modules/reports/guided_reports_start.tt | 1 + reports/guided_reports.pl | 11 ++++++----- t/db_dependent/Reports/Guided.t | 6 ++++-- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index 08c554f55d..b9b7f1852a 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -903,6 +903,7 @@ sub GetParametersFromSQL { for ( my $i = 0; $i < ($#split/2) ; $i++ ) { my ($name,$authval) = split(/\|/,$split[$i*2+1]); + $authval =~ s/\:all$// if $authval; push @sql_parameters, { 'name' => $name, 'authval' => $authval }; } 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 45f3789c20..bbea0b14e9 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 @@ -701,6 +701,7 @@ canned reports and writing custom SQL reports.

[% ELSE %]