From 8e01d3e98716be689043a6c1f98db32a430049f2 Mon Sep 17 00:00:00 2001 From: Brendan Lawlor Date: Thu, 11 Jan 2024 16:31:26 +0000 Subject: [PATCH] Bug 35746: add multiselect to report dropdowns --- C4/Reports/Guided.pm | 2 +- .../prog/en/modules/reports/guided_reports_start.tt | 2 +- reports/guided_reports.pl | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm index a55cd17743..1d8b195b3c 100644 --- a/C4/Reports/Guided.pm +++ b/C4/Reports/Guided.pm @@ -974,7 +974,7 @@ sub GetParametersFromSQL { for ( my $i = 0; $i < ($#split/2) ; $i++ ) { my ($name,$authval) = split(/\|/,$split[$i*2+1]); - $authval =~ s/\:all$// if $authval; + $authval =~ s/\:all$|\:in$// 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 74d9315a4e..e2a3990566 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 @@ -883,7 +883,7 @@ [% ELSE %]
  • - [% IF (sql_param.include_all) %] [% END %] diff --git a/reports/guided_reports.pl b/reports/guided_reports.pl index 85b42c4efb..016214e4a7 100755 --- a/reports/guided_reports.pl +++ b/reports/guided_reports.pl @@ -710,7 +710,9 @@ elsif ($phase eq 'Run this report'){ if( defined $uniq_params{$text.$sep.$authorised_value_all} ){ next; } else { $uniq_params{$text.$sep.$authorised_value_all} = "$i"; } - my ($authorised_value, $all) = split /:/, $authorised_value_all; + my ($authorised_value, $options) = split /:/, $authorised_value_all; + my $all = $options if $options eq "all"; + my $multiple = $options if $options eq "in"; my $input; my $labelid; if ( not defined $authorised_value ) { @@ -829,7 +831,7 @@ elsif ($phase eq 'Run this report'){ }; } - push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid, 'name' => $text.$sep.$authorised_value_all, 'include_all' => $all }; + push @tmpl_parameters, {'entry' => $text, 'input' => $input, 'labelid' => $labelid, 'name' => $text.$sep.$authorised_value_all, 'include_all' => $all, select_multiple => $multiple }; } $template->param('sql' => $sql, 'name' => $name, -- 2.30.2