Bug 15548: Move new patron related code to Patron*
[koha.git] / reserve / request.pl
index 4860dcd..970596f 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/perl
 
 
-#writen 2/1/00 by chris@katipo.oc.nz
+#written 2/1/00 by chris@katipo.oc.nz
 # Copyright 2000-2002 Katipo Communications
 # Parts Copyright 2011 Catalyst IT
 #
@@ -44,11 +44,11 @@ use C4::Utils::DataTables::Members;
 use C4::Members;
 use C4::Search;                # enabled_staff_search_views
 use Koha::DateUtils;
-use Koha::Borrower::Debarments qw(IsDebarred);
+use Koha::Patron::Debarments qw(IsDebarred);
 use Koha::Holds;
+use Koha::Libraries;
 
 my $dbh = C4::Context->dbh;
-my $sth;
 my $input = new CGI;
 my ( $template, $borrowernumber, $cookie, $flags ) = get_template_and_user(
     {
@@ -141,7 +141,6 @@ if ($multihold) {
 if ($borrowernumber_hold && !$action) {
     my $borrowerinfo = GetMember( borrowernumber => $borrowernumber_hold );
     my $diffbranch;
-    my @getreservloop;
 
     # we check the reserves of the borrower, and if he can reserv a document
     # FIXME At this time we have a simple count of reservs, but, later, we could improve the infos "title" ...
@@ -284,7 +283,6 @@ foreach my $biblionumber (@biblionumbers) {
     # adding a fixed value for priority options
     my $fixedRank = $count+1;
 
-    my @branchcodes;
     my %itemnumbers_of_biblioitem;
     my @itemnumbers;
 
@@ -509,7 +507,6 @@ foreach my $biblionumber (@biblionumbers) {
         }
 
         if ( $res->is_found() ) {
-            $reserve{'wait'}          = 1;
             $reserve{'holdingbranch'} = $res->item()->holdingbranch();
             $reserve{'biblionumber'}  = $res->item()->biblionumber();
             $reserve{'barcodenumber'} = $res->item()->barcode();
@@ -554,7 +551,6 @@ foreach my $biblionumber (@biblionumbers) {
         $reserve{'firstname'}      = $res->borrower()->firstname();
         $reserve{'surname'}        = $res->borrower()->surname();
         $reserve{'notes'}          = $res->reservenotes();
-        $reserve{'wait'}           = $res->is_waiting();
         $reserve{'waiting_date'}   = $res->waitingdate();
         $reserve{'waiting_until'}  = $res->is_waiting() ? $res->waiting_expires_on() : undef;
         $reserve{'ccode'}          = $res->item() ? $res->item()->ccode() : undef;
@@ -567,7 +563,7 @@ foreach my $biblionumber (@biblionumbers) {
         $reserve{'reserve_id'}     = $res->reserve_id();
 
         if ( C4::Context->preference('IndependentBranches') && $flags->{'superlibrarian'} != 1 ) {
-            $reserve{'branchloop'} = [ GetBranchDetail( $res->branchcode() ) ];
+            $reserve{'branchloop'} = [ Koha::Libraries->find( $res->branchcode() ) ];
         }
         else {
             $reserve{'branchloop'} = GetBranchesLoop( $res->branchcode() );