From d4dd393e20539c1eae014fd2ad8277f1ed536ab2 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Thu, 5 Jun 2008 12:15:52 -0500 Subject: [PATCH] Update issues_stats to use authorised_values instead of distinct(sortn); add col/row headers as Descriptions instead of codes. Signed-off-by: Joshua Ferraro --- .../prog/en/modules/reports/issues_stats.tmpl | 37 +++- reports/issues_stats.pl | 163 ++++++++---------- 2 files changed, 106 insertions(+), 94 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 2c500bb85c..d21da53a49 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 @@ -189,13 +189,25 @@ Patron Category - + + Item Type - + + Library @@ -240,19 +252,30 @@ From (inclusive) to (exclusive) - + Patron sort1 - + + - - Patron sort2 + Patron sort2 - + + diff --git a/reports/issues_stats.pl b/reports/issues_stats.pl index 9465b768ca..2d91748ffd 100755 --- a/reports/issues_stats.pl +++ b/reports/issues_stats.pl @@ -27,6 +27,7 @@ use C4::Koha; use C4::Output; use C4::Circulation; use C4::Dates qw/format_date format_date_in_iso/; +use C4::Members; use Date::Manip; =head1 NAME @@ -70,10 +71,19 @@ $template->param(do_it => $do_it, DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), ); +my $itemtypes = GetItemTypes(); +my $categoryloop = GetBorrowercategoryList; my $ccodes = GetKohaAuthorisedValues("items.ccode"); my $locations = GetKohaAuthorisedValues("items.location"); +my $Bsort1 = GetAuthorisedValues("Bsort1"); +my $Bsort2 = GetAuthorisedValues("Bsort2"); +my ($hassort1,$hassort2); +$hassort1=1 if $Bsort1; +$hassort2=1 if $Bsort2; + + if ($do_it) { # Displaying results my $results = calculate($line, $column, $podsp, $type, $daysel, $monthsel, $calc, \@filters); @@ -124,39 +134,12 @@ if ($do_it) { my @values; my %labels; my %select; - my $req; - $req = $dbh->prepare("select distinctrow categorycode,description from categories order by description"); - $req->execute; - my @select; - push @select,""; - $select{""}=""; - while (my ($value, $desc) =$req->fetchrow) { - push @select, $value; - $select{$value}=$desc; - } - my $CGIBorCat=CGI::scrolling_list( -name => 'Filter', - -id => 'borcat', - -values => \@select, - -labels => \%select, - -size => 1, - -multiple => 0 ); - - $req = $dbh->prepare( "select distinctrow itemtype,description from itemtypes order by description"); - $req->execute; - undef @select; - undef %select; - push @select,""; - $select{""}=""; - while (my ($value,$desc) =$req->fetchrow) { - push @select, $value; - $select{$value}=$desc; - } - my $CGIItemTypes=CGI::scrolling_list( -name => 'Filter', - -id => 'itemtype', - -values => \@select, - -labels => \%select, - -size => 1, - -multiple => 0 ); + + # create itemtype arrayref for