From 51d4e749d5f3fd5af050f0a7b42a3ad2bc9bf8c6 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Wed, 12 May 2010 16:14:16 +0200 Subject: [PATCH] (MT 3267) Add Homebranch and Holdingbranch search criterion on circulation stat. Signed-off-by: Galen Charlton Signed-off-by: Chris Cormack --- .../prog/en/modules/reports/issues_stats.tmpl | 24 +++++++ reports/issues_stats.pl | 72 +++++++++++-------- 2 files changed, 67 insertions(+), 29 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl index 6eefeac53c..1b9f462214 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tmpl @@ -271,6 +271,30 @@ + Home branch + + + + + + + Holding branch + + + + + +
diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index f932a6f1f8..ea87aa2fc8 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -200,17 +200,21 @@ sub calculate { $cell{filter} = format_date(@$filters[$i]); } $cell{crit} = - ($i==0) ? "Period From" : - ($i==1) ? "Period To" : - ($i==2) ? "Patron Category =" : - ($i==3) ? "Item Type =" : - ($i==4) ? "Library =" : - ($i==5) ? "Collection =" : - ($i==6) ? "Location =" : - ($i==7) ? "Item callnumber >=" : - ($i==8) ? "Item callnumber <" : - ($i==9) ? "sort1 =" : - ($i==10)? "sort2 =" : "UNKNOWN FILTER ($i)"; + ( $i == 0 ) ? "Period From" + : ( $i == 1 ) ? "Period To" + : ( $i == 2 ) ? "Patron Category =" + : ( $i == 3 ) ? "Item Type =" + : ( $i == 4 ) ? "Library =" + : ( $i == 5 ) ? "Collection =" + : ( $i == 6 ) ? "Location =" + : ( $i == 7 ) ? "Item callnumber >=" + : ( $i == 8 ) ? "Item callnumber <" + : ( $i == 9 ) ? "sort1 =" + : ( $i == 10 ) ? "sort2 =" + : ( $i == 11 ) ? "Home branch =" + : ( $i == 12 )? "Holding branch =" + : "UNKNOWN FILTER ($i)"; + # FIXME - no translation mechanism ! push @loopfilter, \%cell; } @@ -223,29 +227,39 @@ sub calculate { $debug and warn "filtres ". join "|", @filters; my ($colsource, $linesource); $linefilter[1] = @$filters[1] if ($line =~ /datetime/); - $linefilter[0] = ($line =~ /datetime/) ? @$filters[0] : - ($line =~ /category/) ? @$filters[2] : - ($line =~ /itemtype/) ? @$filters[3] : - ($line =~ /branch/ ) ? @$filters[4] : - ($line =~ /ccode/ ) ? @$filters[5] : - ($line =~ /location/) ? @$filters[6] : - ($line =~ /sort1/ ) ? @$filters[9] : - ($line =~ /sort2/ ) ? @$filters[10] : undef ; - if ($line =~ /ccode/ or $line =~ /location/) { + $linefilter[0] = + ( $line =~ /datetime/ ) ? @$filters[0] + : ( $line =~ /category/ ) ? @$filters[2] + : ( $line =~ /itemtype/ ) ? @$filters[3] + : ( $line =~ /branch/ ) ? @$filters[4] + : ( $line =~ /ccode/ ) ? @$filters[5] + : ( $line =~ /location/ ) ? @$filters[6] + : ( $line =~ /sort1/ ) ? @$filters[9] + : ( $line =~ /sort2/ ) ? @$filters[10] + : ( $line =~ /homebranch/) ? @$filters[11] + : ( $line =~ /holdingbranch/) ? @$filters[12] + : undef; + + if ( $line =~ /ccode/ or $line =~ /location/ or $line =~ /homebranch/ or $line =~ /holdingbranch/ ) { $linesource = 'items'; } my @colfilter; $colfilter[1] = @$filters[1] if ($column =~ /datetime/); - $colfilter[0] = ($column =~ /datetime/) ? @$filters[0] : - ($column =~ /category/) ? @$filters[2] : - ($column =~ /itemtype/) ? @$filters[3] : - ($column =~ /branch/ ) ? @$filters[4] : - ($column =~ /ccode/ ) ? @$filters[5] : - ($column =~ /location/) ? @$filters[6] : - ($column =~ /sort1/ ) ? @$filters[9] : - ($column =~ /sort1/ ) ? @$filters[10] : undef ; - if ($column =~ /ccode/ or $column =~ /location/) { + $colfilter[0] = + ( $column =~ /datetime/ ) ? @$filters[0] + : ( $column =~ /category/ ) ? @$filters[2] + : ( $column =~ /itemtype/ ) ? @$filters[3] + : ( $column =~ /branch/ ) ? @$filters[4] + : ( $column =~ /ccode/ ) ? @$filters[5] + : ( $column =~ /location/ ) ? @$filters[6] + : ( $column =~ /sort1/ ) ? @$filters[9] + : ( $column =~ /sort1/ ) ? @$filters[10] + : ( $column =~ /homebranch/) ? @$filters[11] + : ( $column =~ /holdingbranch/) ? @$filters[12] + : undef; + + if ( $column =~ /ccode/ or $column =~ /location/ or $column =~ /homebranch/ or $column =~ /holdingbranch/ ) { $colsource = 'items'; } # 1st, loop rows. -- 2.39.5