From c3c520b385efbba68e89fcf5f947e2eb3c364478 Mon Sep 17 00:00:00 2001 From: Chris Cormack Date: Sun, 21 Oct 2007 21:05:53 -0500 Subject: [PATCH] Working on a fix for bug 1456 Signed-off-by: Joshua Ferraro --- C4/Reserves.pm | 3 +-- circ/pendingreserves.pl | 16 ++++++++++------ circ/waitingreserves.pl | 11 +++++++++-- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/C4/Reserves.pm b/C4/Reserves.pm index 9e8398fb16..bc9707433b 100644 --- a/C4/Reserves.pm +++ b/C4/Reserves.pm @@ -94,8 +94,7 @@ C4::Reserves - Koha functions for dealing with reservation. &GetReservesToBranch &GetReserveCount &GetReserveFee - &GetReservesForBranch - &GetReservesToBranch + &GetOtherReserves &ModReserveFill diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl index a158854a79..c2dd6a038b 100755 --- a/circ/pendingreserves.pl +++ b/circ/pendingreserves.pl @@ -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; diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl index c3799757c7..f6b101a3bb 100755 --- a/circ/waitingreserves.pl +++ b/circ/waitingreserves.pl @@ -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'} ); -- 2.11.0