From 3ddec89262ece68736cdce44b9709179f3b11e8c Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 23 Apr 2007 14:08:47 +0000 Subject: [PATCH] moving Reserves2.pm to Reserves.pm --- C4/Circulation.pm | 21 ++++----------------- C4/Members.pm | 2 +- C4/{Reserves2.pm => Reserves.pm} | 4 ++-- circ/branchreserves.pl | 2 +- circ/branchtransfers.pl | 2 +- circ/circulation.pl | 2 +- circ/currenttransfers.pl | 2 +- circ/returns.pl | 2 +- circ/waitingreservestransfers.pl | 2 +- members/moremember.pl | 2 +- opac/opac-reserve.pl | 2 +- opac/opac-user.pl | 2 +- reserve/modrequest.pl | 2 +- reserve/placerequest.pl | 2 +- reserve/request.pl | 2 +- serials/routing-preview.pl | 2 +- 16 files changed, 20 insertions(+), 33 deletions(-) rename C4/{Reserves2.pm => Reserves.pm} (99%) diff --git a/C4/Circulation.pm b/C4/Circulation.pm index 26c7fcd945..9c0c824f1d 100755 --- a/C4/Circulation.pm +++ b/C4/Circulation.pm @@ -23,10 +23,10 @@ use strict; require Exporter; use C4::Context; use C4::Stats; -use C4::Reserves2; +use C4::Reserves; use C4::Koha; use C4::Biblio; -use C4::Reserves2; +use C4::Reserves; use C4::Members; use C4::Date; use Date::Calc qw( @@ -1173,19 +1173,6 @@ patron who last borrowed the book. =cut -# FIXME - This API is bogus. There's no need to return $borrower and -# $iteminformation; the caller can ask about those separately, if it -# cares (it'd be inefficient to make two database calls instead of -# one, but &GetMemberDetails and &getiteminformation can be -# memoized if this is an issue). -# -# The ($doreturn, $messages) tuple is redundant: if the return -# succeeded, that's all the caller needs to know. So &AddReturn can -# return 1 and 0 on success and failure, and set -# $C4::Circulation::Circ2::errmsg to indicate the error. Or it can -# return undef for success, and an error message on error (though this -# is more C-ish than Perl-ish). - sub AddReturn { my ( $barcode, $branch ) = @_; my $dbh = C4::Context->dbh; @@ -1230,7 +1217,7 @@ sub AddReturn { if ($doreturn) { my $sth = $dbh->prepare( - "update issues set returndate = now() where (borrowernumber = ?) and (itemnumber = ?) and (returndate is null)" + "UPDATE issues SET returndate = now() WHERE (borrowernumber = ?) AND (itemnumber = ?) AND (returndate IS NULL)" ); $sth->execute( $borrower->{'borrowernumber'}, $iteminformation->{'itemnumber'} ); @@ -1263,7 +1250,7 @@ sub AddReturn { if ( $tobranch eq C4::Context->userenv->{'branch'} ) { my $sth = $dbh->prepare( - "update branchtransfers set datearrived = now() where itemnumber= ? AND datearrived IS NULL" + "UPDATE branchtransfers SET datearrived = now() WHERE itemnumber= ? AND datearrived IS NULL" ); $sth->execute( $iteminformation->{'itemnumber'} ); $sth->finish; diff --git a/C4/Members.pm b/C4/Members.pm index f3fe8b98fb..6bfb9f520c 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -27,7 +27,7 @@ use Digest::MD5 qw(md5_base64); use Date::Calc qw/Today Add_Delta_YM/; use C4::Log; # logaction use C4::Overdues; -use C4::Reserves2; +use C4::Reserves; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); diff --git a/C4/Reserves2.pm b/C4/Reserves.pm similarity index 99% rename from C4/Reserves2.pm rename to C4/Reserves.pm index 5192a2e222..d7d47bfe42 100755 --- a/C4/Reserves2.pm +++ b/C4/Reserves.pm @@ -1,7 +1,7 @@ # -*- tab-width: 8 -*- # NOTE: This file uses standard 8-character tabs -package C4::Reserves2; +package C4::Reserves; # Copyright 2000-2002 Katipo Communications # @@ -41,7 +41,7 @@ C4::Reserves2 - Koha functions for dealing with reservation. =head1 SYNOPSIS - use C4::Reserves2; + use C4::Reserves; =head1 DESCRIPTION diff --git a/circ/branchreserves.pl b/circ/branchreserves.pl index aa4ee5980b..89a181095f 100755 --- a/circ/branchreserves.pl +++ b/circ/branchreserves.pl @@ -35,7 +35,7 @@ use Date::Calc qw( Add_Delta_Days Date_to_Days ); -use C4::Reserves2; +use C4::Reserves; use C4::Koha; use C4::Interface::CGI::Output; diff --git a/circ/branchtransfers.pl b/circ/branchtransfers.pl index a92f54e59d..493363ab53 100755 --- a/circ/branchtransfers.pl +++ b/circ/branchtransfers.pl @@ -25,7 +25,7 @@ use strict; use CGI; use C4::Circulation; use C4::Output; -use C4::Reserves2; +use C4::Reserves; use C4::Biblio; use C4::Auth; use C4::Interface::CGI::Output; diff --git a/circ/circulation.pl b/circ/circulation.pl index 5d1474b4d4..1f79ae8939 100755 --- a/circ/circulation.pl +++ b/circ/circulation.pl @@ -42,7 +42,7 @@ use Date::Calc qw( use C4::Circulation; use C4::Members; use C4::Biblio; -use C4::Reserves2; +use C4::Reserves; # # PARAMETERS READING diff --git a/circ/currenttransfers.pl b/circ/currenttransfers.pl index bc453fa16c..833cbc3f10 100755 --- a/circ/currenttransfers.pl +++ b/circ/currenttransfers.pl @@ -37,7 +37,7 @@ use Date::Calc qw( ); use C4::Koha; -use C4::Reserves2; +use C4::Reserves; my $input = new CGI; diff --git a/circ/returns.pl b/circ/returns.pl index c311201540..d7ace40a54 100755 --- a/circ/returns.pl +++ b/circ/returns.pl @@ -31,7 +31,7 @@ use C4::Circulation; use C4::Date; use C4::Output; use C4::Print; -use C4::Reserves2; +use C4::Reserves; use C4::Auth; use C4::Biblio; use C4::Members; diff --git a/circ/waitingreservestransfers.pl b/circ/waitingreservestransfers.pl index 9c32bce826..221c29b433 100755 --- a/circ/waitingreservestransfers.pl +++ b/circ/waitingreservestransfers.pl @@ -27,7 +27,7 @@ use C4::Branch; # GetBranches use C4::Auth; use C4::Date; use C4::Circulation; -use C4::Reserves2; +use C4::Reserves; use C4::Members; use Date::Calc qw( Today diff --git a/members/moremember.pl b/members/moremember.pl index b401b07a23..2615cb661c 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -42,7 +42,7 @@ use CGI; use C4::Members; use Date::Manip; use C4::Date; -use C4::Reserves2; +use C4::Reserves; use C4::Circulation; use C4::Koha; use C4::Letters; diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl index 199fbfff5f..0b7f932f18 100755 --- a/opac/opac-reserve.pl +++ b/opac/opac-reserve.pl @@ -22,7 +22,7 @@ use C4::Biblio; use C4::Auth; # checkauth, getborrowernumber. use C4::Koha; use C4::Circulation; -use C4::Reserves2; +use C4::Reserves; use C4::Interface::CGI::Output; use C4::Date; use C4::Context; diff --git a/opac/opac-user.pl b/opac/opac-user.pl index 87d46b984b..29893c54dc 100755 --- a/opac/opac-user.pl +++ b/opac/opac-user.pl @@ -24,7 +24,7 @@ use CGI; use C4::Auth; use C4::Koha; use C4::Circulation; -use C4::Reserves2; +use C4::Reserves; use C4::Members; use C4::Interface::CGI::Output; use C4::Biblio; diff --git a/reserve/modrequest.pl b/reserve/modrequest.pl index 54d15b0d07..1732eb747a 100755 --- a/reserve/modrequest.pl +++ b/reserve/modrequest.pl @@ -25,7 +25,7 @@ use strict; use CGI; use C4::Output; -use C4::Reserves2; +use C4::Reserves; my $input = new CGI; #print $input->header; diff --git a/reserve/placerequest.pl b/reserve/placerequest.pl index 5d9f3670c5..932ff671dc 100755 --- a/reserve/placerequest.pl +++ b/reserve/placerequest.pl @@ -25,7 +25,7 @@ use strict; use C4::Biblio; use CGI; use C4::Output; -use C4::Reserves2; +use C4::Reserves; use C4::Circulation; use C4::Members; diff --git a/reserve/request.pl b/reserve/request.pl index b3411aecd1..0c83350b56 100755 --- a/reserve/request.pl +++ b/reserve/request.pl @@ -34,7 +34,7 @@ use Date::Calc qw/Today Date_to_Days/; use C4::Output; use C4::Interface::CGI::Output; use C4::Auth; -use C4::Reserves2; +use C4::Reserves; use C4::Biblio; use C4::Koha; use C4::Circulation; diff --git a/serials/routing-preview.pl b/serials/routing-preview.pl index 39dd696fa2..d3a60576e3 100755 --- a/serials/routing-preview.pl +++ b/serials/routing-preview.pl @@ -10,7 +10,7 @@ use C4::Auth; use C4::Date; use C4::Output; use C4::Acquisition; -use C4::Reserves2; +use C4::Reserves; use C4::Circulation; use C4::Interface::CGI::Output; use C4::Context; -- 2.39.2