[Koha-cvs] CVS: koha/C4 Reserves2.pm,1.37,1.38
Paul POULAIN
tipaul at users.sourceforge.net
Wed Dec 15 11:47:11 CET 2004
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20461/C4
Modified Files:
Reserves2.pm
Log Message:
fix for :
http://bugs.koha.org/cgi-bin/bugzilla/show_bug.cgi?id=858
* added a button to cancel issue
* adding checkbox to cancel reserve on the book (checked by default)
* the cancelation reserve is done on reserves done for a given item or for any item
Nelsonville, pls test & confirm it's OK
Index: Reserves2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Reserves2.pm,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -r1.37 -r1.38
*** Reserves2.pm 15 Jan 2004 23:33:29 -0000 1.37
--- Reserves2.pm 15 Dec 2004 10:47:09 -0000 1.38
***************
*** 292,337 ****
#warn "In CancelReserve";
if (($item and $borr) and (not $biblio)) {
! # removing a waiting reserve record....
! # update the database...
! my $sth = $dbh->prepare("update reserves set cancellationdate = now(),
! found = Null,
! priority = 0
! where itemnumber = ?
! and borrowernumber = ?");
! $sth->execute($item,$borr);
! $sth->finish;
}
if (($biblio and $borr) and (not $item)) {
!
! # removing a reserve record....
!
! # get the prioritiy on this record....
! my $priority;
! {
! my $sth=$dbh->prepare("SELECT priority FROM reserves
! WHERE biblionumber = ?
! AND borrowernumber = ?
! AND cancellationdate is NULL
! AND (found <> 'F' or found is NULL)");
! $sth->execute($biblio,$borr);
! ($priority) = $sth->fetchrow_array;
! $sth->finish;
! }
!
! # update the database, removing the record...
! {
! my $sth = $dbh->prepare("update reserves set cancellationdate = now(),
! found = Null,
! priority = 0
! where biblionumber = ?
! and borrowernumber = ?
! and cancellationdate is NULL
! and (found <> 'F' or found is NULL)");
! $sth->execute($biblio,$borr);
! $sth->finish;
! }
!
! # now fix the priority on the others....
! fixpriority($priority, $biblio);
}
}
--- 292,330 ----
#warn "In CancelReserve";
if (($item and $borr) and (not $biblio)) {
! # removing a waiting reserve record....
! # update the database...
! my $sth = $dbh->prepare("update reserves set cancellationdate = now(),
! found = Null,
! priority = 0
! where itemnumber = ?
! and borrowernumber = ?");
! $sth->execute($item,$borr);
! $sth->finish;
}
if (($biblio and $borr) and (not $item)) {
! # removing a reserve record....
! # get the prioritiy on this record....
! my $priority;
! my $sth=$dbh->prepare("SELECT priority FROM reserves
! WHERE biblionumber = ?
! AND borrowernumber = ?
! AND cancellationdate is NULL
! AND (found <> 'F' or found is NULL)");
! $sth->execute($biblio,$borr);
! ($priority) = $sth->fetchrow_array;
! $sth->finish;
!
! # update the database, removing the record...
! my $sth = $dbh->prepare("update reserves set cancellationdate = now(),
! found = Null,
! priority = 0
! where biblionumber = ?
! and borrowernumber = ?
! and cancellationdate is NULL
! and (found <> 'F' or found is NULL)");
! $sth->execute($biblio,$borr);
! $sth->finish;
! # now fix the priority on the others....
! fixpriority($priority, $biblio);
}
}
More information about the Koha-cvs
mailing list