Working on a fix for bug 1456
authorChris Cormack <crc@liblime.com>
Mon, 22 Oct 2007 02:05:53 +0000 (21:05 -0500)
committerJoshua Ferraro <jmf@liblime.com>
Mon, 22 Oct 2007 02:55:57 +0000 (21:55 -0500)
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
C4/Reserves.pm
circ/pendingreserves.pl
circ/waitingreserves.pl

index 9e8398f..bc97074 100644 (file)
@@ -94,8 +94,7 @@ C4::Reserves - Koha functions for dealing with reservation.
   &GetReservesToBranch
   &GetReserveCount
   &GetReserveFee
-  &GetReservesForBranch
-  &GetReservesToBranch
+
   &GetOtherReserves
   
   &ModReserveFill
index a158854..c2dd6a0 100755 (executable)
@@ -100,16 +100,20 @@ my $strsth =
  LEFT JOIN borrowers ON reserves.borrowernumber=borrowers.borrowernumber
  LEFT JOIN biblio ON reserves.biblionumber=biblio.biblionumber
  WHERE isnull(cancellationdate)
-  && reserves.found is NULL
-  && items.holdingbranch=?
- ";
+ AND reserves.found is NULL ";
 
+if (C4::Context->preference('IndependantBranches')){
+       $strsth .= " items.holdingbranch=? ";
+}
 $strsth .= $sqlorderby;
-
 my $sth = $dbh->prepare($strsth);
 
-$sth->execute(C4::Context->userenv->{'branch'});
-
+if (C4::Context->preference('IndependantBranches')){
+       $sth->execute(C4::Context->userenv->{'branch'});
+}
+else {
+       $sth->execute();
+}      
 my @reservedata;
 my $previous;
 my $this;
index c379975..f6b101a 100755 (executable)
@@ -108,8 +108,15 @@ if ($item) {
 
 my @reservloop;
 
-my @getreserves = GetReservesForBranch($default);
-
+my @getreserves;
+if (C4::Context->preference('IndependantBranches')){
+       @getreserves = GetReservesForBranch($default);
+}
+else {
+       @getreserves = GetReservesForBranch($default);
+       # need to have a routine to get all waiting reserves
+}      
+       
 foreach my $num (@getreserves) {
     my %getreserv;
     my $gettitle     = GetBiblioFromItemNumber( $num->{'itemnumber'} );