Bug 30858: Add serial enumeration/chronology to item search
[srvgit] / circ / view_holdsqueue.pl
index f7dbbc2..b7070fd 100755 (executable)
@@ -24,23 +24,19 @@ This script displays items in the tmp_holdsqueue table
 
 use Modern::Perl;
 use CGI qw ( -utf8 );
-use C4::Auth;
-use C4::Output;
-use C4::Biblio;
-use C4::Items;
-use C4::HoldsQueue qw(GetHoldsQueueItems);
+use C4::Auth qw( get_template_and_user );
+use C4::Output qw( output_html_with_http_headers );
+use C4::HoldsQueue qw( GetHoldsQueueItems );
 use Koha::BiblioFrameworks;
 use Koha::ItemTypes;
 
-my $query = new CGI;
+my $query = CGI->new;
 my ( $template, $loggedinuser, $cookie, $flags ) = get_template_and_user(
     {
         template_name   => "circ/view_holdsqueue.tt",
         query           => $query,
         type            => "intranet",
-        authnotrequired => 0,
         flagsrequired   => { circulate => "circulate_remaining_permissions" },
-        debug           => 1,
     }
 );
 
@@ -48,15 +44,24 @@ my $params = $query->Vars;
 my $run_report     = $params->{'run_report'};
 my $branchlimit    = $params->{'branchlimit'};
 my $itemtypeslimit = $params->{'itemtypeslimit'};
+my $ccodeslimit = $params->{'ccodeslimit'};
+my $locationslimit = $params->{'locationslimit'};
 
 if ( $run_report ) {
-    # XXX GetHoldsQueueItems() does not support $itemtypeslimit!
-    my $items = GetHoldsQueueItems($branchlimit, $itemtypeslimit);
+    my $items = GetHoldsQueueItems({
+        branchlimit => $branchlimit,
+        itemtypeslimit => $itemtypeslimit,
+        ccodeslimit => $ccodeslimit,
+        locationslimit => $locationslimit
+    });
     for my $item ( @$items ) {
         $item->{patron} = Koha::Patrons->find( $item->{borrowernumber} );
     }
     $template->param(
         branchlimit     => $branchlimit,
+        itemtypeslimit     => $itemtypeslimit,
+        ccodeslimit     => $ccodeslimit,
+        locationslimit     => $locationslimit,
         total      => scalar @$items,
         itemsloop  => $items,
         run_report => $run_report,