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