[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/C4 Reserves2.pm,1.19,1.20
From: |
Finlay Thompson |
Subject: |
[Koha-cvs] CVS: koha/C4 Reserves2.pm,1.19,1.20 |
Date: |
Thu, 26 Sep 2002 22:21:46 -0700 |
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv27402/C4
Modified Files:
Reserves2.pm
Log Message:
Added the possiblity of deleting waiting reservesm or setting them back to not
waiting.
uses UpdateReserve now, instead of updatereserves from Reserves2.pm
Index: Reserves2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Reserves2.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** Reserves2.pm 4 Sep 2002 22:51:39 -0000 1.19
--- Reserves2.pm 27 Sep 2002 05:21:44 -0000 1.20
***************
*** 32,36 ****
@ISA = qw(Exporter);
! @EXPORT = qw(&FindReserves &CheckReserves &CheckWaiting &CancelReserve
&FillReserve &ReserveWaiting &CreateReserve &updatereserves &getreservetitle
&Findgroupreserve);
# make all your functions, whether exported or not;
--- 32,36 ----
@ISA = qw(Exporter);
! @EXPORT = qw(&FindReserves &CheckReserves &CheckWaiting &CancelReserve
&FillReserve &ReserveWaiting &CreateReserve &updatereserves &UpdateReserve
&getreservetitle &Findgroupreserve);
# make all your functions, whether exported or not;
***************
*** 511,515 ****
my $dbh=C4Connect;
my $query="Update reserves ";
! if ($del ==0){
$query.="set priority='$rank',branchcode='$branch' where
biblionumber=$biblio and borrowernumber=$borrower";
--- 511,515 ----
my $dbh=C4Connect;
my $query="Update reserves ";
! if ($del == 0){
$query.="set priority='$rank',branchcode='$branch' where
biblionumber=$biblio and borrowernumber=$borrower";
***************
*** 543,546 ****
--- 543,572 ----
$sth->finish;
$dbh->disconnect;
+ }
+ sub UpdateReserve {
+ #subroutine to update a reserve
+ my ($rank,$biblio,$borrower,$branch)address@hidden;
+ return if $rank eq "W";
+ my $dbh=C4Connect;
+ if ($rank eq "del") {
+ my $query = "UPDATE reserves SET cancellationdate=now()
+ WHERE biblionumber = ?
+ AND borrowernumber = ?
+ AND cancellationdate is NULL
+ AND (found <> 'F' or found is NULL)";
+ my $sth=$dbh->prepare($query);
+ $sth->execute($biblio, $borrower);
+ $sth->finish;
+ } else {
+ my $query = "UPDATE reserves SET priority = ? ,branchcode = ?,
itemnumber = NULL, found = NULL
+ WHERE biblionumber = ?
+ AND borrowernumber = ?
+ AND cancellationdate is NULL
+ AND (found <> 'F' or found is NULL)";
+ my $sth=$dbh->prepare($query);
+ $sth->execute($rank, $branch, $biblio, $borrower);
+ $sth->finish;
+ }
+ $dbh->disconnect;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/C4 Reserves2.pm,1.19,1.20,
Finlay Thompson <=
- Prev by Date:
[Koha-cvs] CVS: koha/updater updatedatabase,1.17,1.18
- Next by Date:
[Koha-cvs] CVS: koha request.pl,1.14,1.15 modrequest.pl,1.2,1.3
- Previous by thread:
[Koha-cvs] CVS: koha/updater updatedatabase,1.17,1.18
- Next by thread:
[Koha-cvs] CVS: koha request.pl,1.14,1.15 modrequest.pl,1.2,1.3
- Index(es):