From e75e59d8561f247f2f58c514f7dbe50d40d9fe01 Mon Sep 17 00:00:00 2001 From: Thibaud Guillot Date: Thu, 21 Mar 2024 09:25:08 +0100 Subject: [PATCH] Bug 36380: Add filter value on patron statistics report summary MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Test plan: 1) Go to reports and select "Patrons" 2) Select some filters (patron category, library,..) and run it 3) Normally you will see filters selected but with blank value like "branch code = " 4) Apply this patch 5) Refresh Sponsored by: BibLibre Signed-off-by: Frédéric Demians Signed-off-by: Emily Lamancusa Signed-off-by: Katrin Fischer --- reports/borrowers_stats.pl | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/reports/borrowers_stats.pl b/reports/borrowers_stats.pl index 4e0f645999..2aee2d1b2b 100755 --- a/reports/borrowers_stats.pl +++ b/reports/borrowers_stats.pl @@ -184,15 +184,14 @@ sub calculate { foreach my $i (0 .. scalar @$filters) { my %cell; if ( @$filters[$i] ) { - if ( $i == 0) { $cell{crit} = "Cat code"; } - elsif ( $i == 1 ) { $cell{crit} = "ZIP/Postal code"; } - elsif ( $i == 2 ) { $cell{crit} = "Branch code"; } - elsif ( $i == 3 || - $i == 4 ) { $cell{crit} = "Date of birth"; } - elsif ( $i == 5 ) { $cell{crit} = "Sex"; } - elsif ( $i == 6 ) { $cell{crit} = "Sort1"; } - elsif ( $i == 7 ) { $cell{crit} = "Sort2"; } - else { $cell{crit} = "Unknown"; } + if ( $i == 0 ) { $cell{crit} = "Cat code"; $cell{filter} = @$filters[$i]; } + elsif ( $i == 1 ) { $cell{crit} = "ZIP/Postal code"; $cell{filter} = @$filters[$i]; } + elsif ( $i == 2 ) { $cell{crit} = "Branch code"; $cell{filter} = @$filters[$i]; } + elsif ( $i == 3 || $i == 4 ) { $cell{crit} = "Date of birth"; $cell{filter} = @$filters[$i]; } + elsif ( $i == 5 ) { $cell{crit} = "Sex"; $cell{filter} = @$filters[$i]; } + elsif ( $i == 6 ) { $cell{crit} = "Sort1"; $cell{filter} = @$filters[$i]; } + elsif ( $i == 7 ) { $cell{crit} = "Sort2"; $cell{filter} = @$filters[$i]; } + else { $cell{crit} = "Unknown"; } push @loopfilter, \%cell; } -- 2.20.1