Bug 17698: Do not send pending_checkout_notes from all circ scripts
[koha.git] / circ / view_holdsqueue.pl
index 75b02d5..f7dbbc2 100755 (executable)
@@ -22,8 +22,7 @@ This script displays items in the tmp_holdsqueue table
 
 =cut
 
-use strict;
-use warnings;
+use Modern::Perl;
 use CGI qw ( -utf8 );
 use C4::Auth;
 use C4::Output;
@@ -31,7 +30,6 @@ use C4::Biblio;
 use C4::Items;
 use C4::HoldsQueue qw(GetHoldsQueueItems);
 use Koha::BiblioFrameworks;
-
 use Koha::ItemTypes;
 
 my $query = new CGI;
@@ -54,6 +52,9 @@ my $itemtypeslimit = $params->{'itemtypeslimit'};
 if ( $run_report ) {
     # XXX GetHoldsQueueItems() does not support $itemtypeslimit!
     my $items = GetHoldsQueueItems($branchlimit, $itemtypeslimit);
+    for my $item ( @$items ) {
+        $item->{patron} = Koha::Patrons->find( $item->{borrowernumber} );
+    }
     $template->param(
         branchlimit     => $branchlimit,
         total      => scalar @$items,
@@ -62,20 +63,6 @@ if ( $run_report ) {
     );
 }
 
-# getting all itemtypes
-my $itemtypes = Koha::ItemTypes->search({}, {order_by => 'itemtype'});;
-my @itemtypesloop;
-while ( my $itemtype = $itemtypes->next ) {
-    push @itemtypesloop, {
-        value       => $itemtype->itemtype,
-        description => $itemtypes->description, # FIXME Don't we want the translated_description here?
-    };
-}
-
-$template->param( # FIXME Could be improved passing the $itemtypes iterator directly to the template
-   itemtypeloop => \@itemtypesloop,
-);
-
 # Checking if there is a Fast Cataloging Framework
 $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );