[Koha-patches] [PATCH 1/2][NEEDS SIGNOFF] Bug #6142 - Delete sub CanBookBeReserved

Stéphane Delaune stephane.delaune at biblibre.com
Fri Jul 8 11:55:46 CEST 2011


From: Alex Arnaud <alex.arnaud at biblibre.com>


Signed-off-by: Stéphane Delaune <stephane.delaune at biblibre.com>
---
 C4/ILSDI/Utility.pm |   49 -------------------------------------------------
 1 files changed, 0 insertions(+), 49 deletions(-)

diff --git a/C4/ILSDI/Utility.pm b/C4/ILSDI/Utility.pm
index 8ee1224..274a266 100644
--- a/C4/ILSDI/Utility.pm
+++ b/C4/ILSDI/Utility.pm
@@ -67,55 +67,6 @@ sub BorrowerExists {
     return $sth->fetchrow;
 }
 
-=head2 CanBookBeReserved
-
-Checks if a book (at bibliographic level) can be reserved by a borrower.
-
-	if ( CanBookBeReserved($borrower, $biblionumber) ) {
-		# Do stuff
-	}
-
-=cut
-
-sub CanBookBeReserved {
-    my ( $borrower, $biblionumber ) = @_;
-
-    my $MAXIMUM_NUMBER_OF_RESERVES = C4::Context->preference("maxreserves");
-    my $MAXOUTSTANDING             = C4::Context->preference("maxoutstanding");
-
-    my $out = 1;
-
-    if ( $borrower->{'amountoutstanding'} > $MAXOUTSTANDING ) {
-        $out = undef;
-    }
-    if ( $borrower->{gonenoaddress} eq 1 ) {
-        $out = undef;
-    }
-    if ( $borrower->{lost} eq 1 ) {
-        $out = undef;
-    }
-    if ( $borrower->{debarred} eq 1 ) {
-        $out = undef;
-    }
-    my @reserves = GetReservesFromBorrowernumber( $borrower->{'borrowernumber'} );
-    if ( $MAXIMUM_NUMBER_OF_RESERVES && scalar(@reserves) >= $MAXIMUM_NUMBER_OF_RESERVES ) {
-        $out = undef;
-    }
-    foreach my $res (@reserves) {
-        if ( $res->{'biblionumber'} == $biblionumber ) {
-            $out = undef;
-        }
-    }
-    my $issues = GetPendingIssues( $borrower->{'borrowernumber'} );
-    foreach my $issue (@$issues) {
-        if ( $issue->{'biblionumber'} == $biblionumber ) {
-            $out = undef;
-        }
-    }
-
-    return $out;
-}
-
 =head2 Availability
 
 Returns, for an itemnumber, an array containing availability information.
-- 
1.7.0.4



More information about the Koha-patches mailing list