Bug 26265: (QA follow-up) Remove g option from regex, add few dirs
[koha-equinox.git] / circ / view_holdsqueue.pl
index 72457e0..f7dbbc2 100755 (executable)
@@ -22,16 +22,15 @@ 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;
 use C4::Biblio;
 use C4::Items;
-use C4::Koha;   # GetItemTypes
 use C4::HoldsQueue qw(GetHoldsQueueItems);
 use Koha::BiblioFrameworks;
+use Koha::ItemTypes;
 
 my $query = new CGI;
 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
@@ -53,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,
@@ -61,20 +63,6 @@ if ( $run_report ) {
     );
 }
 
-# getting all itemtypes
-my $itemtypes = &GetItemTypes();
-my @itemtypesloop;
-foreach my $thisitemtype ( sort keys %$itemtypes ) {
-    push @itemtypesloop, {
-        value       => $thisitemtype,
-        description => $itemtypes->{$thisitemtype}->{'description'},
-    };
-}
-
-$template->param(
-   itemtypeloop => \@itemtypesloop,
-);
-
 # Checking if there is a Fast Cataloging Framework
 $template->param( fast_cataloging => 1 ) if Koha::BiblioFrameworks->find( 'FA' );