X-Git-Url: http://git.rot13.org/?a=blobdiff_plain;f=reports%2Freserves_stats.pl;h=09bfd0c729cc379fd91764988efb52f18cc28999;hb=2fdfbaf0ddbf214c0efb9a3a3c2595a54517f795;hp=c20a6760bab87e85d613d16ffc475e799bc8d336;hpb=0486d0c6b781fbda73df19eb825ef330bdc4544a;p=koha.git diff --git a/reports/reserves_stats.pl b/reports/reserves_stats.pl index c20a6760ba..09bfd0c729 100755 --- a/reports/reserves_stats.pl +++ b/reports/reserves_stats.pl @@ -17,49 +17,44 @@ # Koha; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. +use Modern::Perl; -use strict; -use warnings; - -use CGI; +use CGI qw ( -utf8 ); use C4::Auth; use C4::Debug; use C4::Context; -use C4::Branch; # GetBranches use C4::Koha; use C4::Output; use C4::Reports; use C4::Members; -use C4::Dates qw/format_date format_date_in_iso/; -use C4::Category; +use Koha::AuthorisedValues; +use Koha::DateUtils; +use Koha::ItemTypes; +use Koha::Libraries; +use Koha::Patron::Categories; use List::MoreUtils qw/any/; use YAML; =head1 NAME -plugin that shows circulation stats + reports/reserve_stats.pl =head1 DESCRIPTION -=over 2 + Plugin that shows reserve stats =cut # my $debug = 1; # override for now. my $input = new CGI; -my $fullreportname = "reports/reserves_stats.tmpl"; +my $fullreportname = "reports/reserves_stats.tt"; my $do_it = $input->param('do_it'); my $line = $input->param("Line"); my $column = $input->param("Column"); -my $podsp = $input->param("DisplayBy"); -my $type = $input->param("PeriodTypeSel"); -my $daysel = $input->param("PeriodDaySel"); -my $monthsel = $input->param("PeriodMonthSel"); my $calc = $input->param("Cellvalue"); my $output = $input->param("output"); my $basename = $input->param("basename"); -my $mime = $input->param("MIME"); my $hash_params = $input->Vars; my $filter_hashref; foreach my $filter (grep {$_ =~/^filter/} keys %$hash_params){ @@ -78,15 +73,12 @@ my ($template, $borrowernumber, $cookie) = get_template_and_user({ our $sep = $input->param("sep") || ''; $sep = "\t" if ($sep eq 'tabulation'); $template->param(do_it => $do_it, - DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(), ); -my $itemtypes = GetItemTypes(); -my $categoryloop = GetBorrowercategoryList; +my @patron_categories = Koha::Patron::Categories->search_limited({}, {order_by => ['description']}); -my $ccodes = GetKohaAuthorisedValues("items.ccode"); -my $locations = GetKohaAuthorisedValues("items.location"); -my $authvalue = GetKohaAuthorisedValues("items.authvalue"); +my $locations = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.location' }, { order_by => ['description'] } ) }; +my $ccodes = { map { ( $_->{authorised_value} => $_->{lib} ) } Koha::AuthorisedValues->get_descriptions_by_koha_field( { frameworkcode => '', kohafield => 'items.ccode' }, { order_by => ['description'] } ) }; my $Bsort1 = GetAuthorisedValues("Bsort1"); my $Bsort2 = GetAuthorisedValues("Bsort2"); @@ -138,11 +130,7 @@ my @values; my %labels; my %select; -# create itemtype arrayref for