[Koha-cvs] CVS: koha/C4/Circulation Circ2.pm,1.37,1.37.2.1
Andrew Arensburger
arensb at users.sourceforge.net
Fri Oct 4 04:27:32 CEST 2002
Update of /cvsroot/koha/koha/C4/Circulation
In directory usw-pr-cvs1:/tmp/cvs-serv19209
Modified Files:
Tag: arensb-context
Circ2.pm
Log Message:
Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
C4Connect.
Index: Circ2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Circulation/Circ2.pm,v
retrieving revision 1.37
retrieving revision 1.37.2.1
diff -C2 -r1.37 -r1.37.2.1
*** Circ2.pm 1 Oct 2002 11:51:58 -0000 1.37
--- Circ2.pm 4 Oct 2002 02:27:30 -0000 1.37.2.1
***************
*** 26,30 ****
require Exporter;
use DBI;
! use C4::Database;
#use C4::Accounts;
#use C4::InterfaceCDK;
--- 26,30 ----
require Exporter;
use DBI;
! use C4::Context;
#use C4::Accounts;
#use C4::InterfaceCDK;
***************
*** 85,89 ****
# returns a reference to a hash of references to branches...
my %branches;
! my $dbh=&C4Connect;
my $sth=$dbh->prepare("select * from branches");
$sth->execute;
--- 85,89 ----
# returns a reference to a hash of references to branches...
my %branches;
! my $dbh = C4::Context->dbh;
my $sth=$dbh->prepare("select * from branches");
$sth->execute;
***************
*** 99,103 ****
$branches{$branch->{'branchcode'}}=$branch;
}
- $dbh->disconnect;
return (\%branches);
}
--- 99,102 ----
***************
*** 107,111 ****
my ($env) = @_;
my %printers;
! my $dbh=&C4Connect;
my $sth=$dbh->prepare("select * from printers");
$sth->execute;
--- 106,110 ----
my ($env) = @_;
my %printers;
! my $dbh = C4::Context->dbh;
my $sth=$dbh->prepare("select * from printers");
$sth->execute;
***************
*** 113,117 ****
$printers{$printer->{'printqueue'}}=$printer;
}
- $dbh->disconnect;
return (\%printers);
}
--- 112,115 ----
***************
*** 122,126 ****
# returns
my ($env, $borrowernumber,$cardnumber) = @_;
! my $dbh=&C4Connect;
my $query;
my $sth;
--- 120,124 ----
# returns
my ($env, $borrowernumber,$cardnumber) = @_;
! my $dbh = C4::Context->dbh;
my $query;
my $sth;
***************
*** 139,143 ****
my $flags = patronflags($env, $borrower, $dbh);
$sth->finish;
- $dbh->disconnect;
$borrower->{'flags'}=$flags;
return($borrower, $flags);
--- 137,140 ----
***************
*** 178,182 ****
# returns a hash of item information given either the itemnumber or the barcode
my ($env, $itemnumber, $barcode) = @_;
! my $dbh=&C4Connect;
my $sth;
if ($itemnumber) {
--- 175,179 ----
# returns a hash of item information given either the itemnumber or the barcode
my ($env, $itemnumber, $barcode) = @_;
! my $dbh = C4::Context->dbh;
my $sth;
if ($itemnumber) {
***************
*** 208,212 ****
$sth->finish;
}
- $dbh->disconnect;
return($iteminformation);
}
--- 205,208 ----
***************
*** 216,220 ****
# surname
my ($env, $key) = @_;
! my $dbh=&C4Connect;
my @borrowers;
my $q_key=$dbh->quote($key);
--- 212,216 ----
# surname
my ($env, $key) = @_;
! my $dbh = C4::Context->dbh;
my @borrowers;
my $q_key=$dbh->quote($key);
***************
*** 234,238 ****
}
$sth->finish;
- $dbh->disconnect;
return(\@borrowers);
}
--- 230,233 ----
***************
*** 287,291 ****
sub dotransfer {
my ($itm, $fbr, $tbr) = @_;
! my $dbh = &C4Connect;
$itm = $dbh->quote($itm);
$fbr = $dbh->quote($fbr);
--- 282,286 ----
sub dotransfer {
my ($itm, $fbr, $tbr) = @_;
! my $dbh = C4::Context->dbh;
$itm = $dbh->quote($itm);
$fbr = $dbh->quote($fbr);
***************
*** 298,306 ****
$sth->finish;
#update holdingbranch in items .....
$query = "update items set datelastseen = now(), holdingbranch=$tbr where items.itemnumber=$itm";
$sth = $dbh->prepare($query);
$sth->execute;
$sth->finish;
- $dbh->disconnect;
return;
}
--- 293,301 ----
$sth->finish;
#update holdingbranch in items .....
+ # FIXME - Use $dbh->do()
$query = "update items set datelastseen = now(), holdingbranch=$tbr where items.itemnumber=$itm";
$sth = $dbh->prepare($query);
$sth->execute;
$sth->finish;
return;
}
***************
*** 309,313 ****
sub issuebook {
my ($env, $patroninformation, $barcode, $responses, $date) = @_;
! my $dbh=&C4Connect;
my $iteminformation = getiteminformation($env, 0, $barcode);
my ($datedue);
--- 304,308 ----
sub issuebook {
my ($env, $patroninformation, $barcode, $responses, $date) = @_;
! my $dbh = C4::Context->dbh;
my $iteminformation = getiteminformation($env, 0, $barcode);
my ($datedue);
***************
*** 486,490 ****
$message=sprintf "Rental charge of \$%.02f applies.", $iteminformation->{'charge'};
}
- $dbh->disconnect;
return ($iteminformation, $dateduef, $rejected, $question, $questionnumber, $defaultanswer, $message);
}
--- 481,484 ----
***************
*** 554,558 ****
sub doreturn {
my ($brn, $itm) = @_;
! my $dbh=&C4Connect;
$brn = $dbh->quote($brn);
$itm = $dbh->quote($itm);
--- 548,552 ----
sub doreturn {
my ($brn, $itm) = @_;
! my $dbh = C4::Context->dbh;
$brn = $dbh->quote($brn);
$itm = $dbh->quote($itm);
***************
*** 566,570 ****
$sth->execute;
$sth->finish;
- $dbh->disconnect;
return;
}
--- 560,563 ----
***************
*** 572,576 ****
sub updateitemlost{
my ($itemno)=@_;
! my $dbh=&C4Connect;
my $query="update items set itemlost=0 where itemnumber=$itemno";
my $sth=$dbh->prepare($query);
--- 565,570 ----
sub updateitemlost{
my ($itemno)=@_;
! my $dbh = C4::Context->dbh;
! # FIXME - Use $dbh->do();
my $query="update items set itemlost=0 where itemnumber=$itemno";
my $sth=$dbh->prepare($query);
***************
*** 582,586 ****
my ($iteminfo, $borrower) = @_;
my %env;
! my $dbh=&C4Connect;
my $itm = $dbh->quote($iteminfo->{'itemnumber'});
# check for charge made for lost book
--- 576,580 ----
my ($iteminfo, $borrower) = @_;
my %env;
! my $dbh = C4::Context->dbh;
my $itm = $dbh->quote($iteminfo->{'itemnumber'});
# check for charge made for lost book
***************
*** 674,678 ****
sub fixoverduesonreturn {
my ($brn, $itm) = @_;
! my $dbh=&C4Connect;
$itm = $dbh->quote($itm);
$brn = $dbh->quote($brn);
--- 668,672 ----
sub fixoverduesonreturn {
my ($brn, $itm) = @_;
! my $dbh = C4::Context->dbh;
$itm = $dbh->quote($itm);
$brn = $dbh->quote($brn);
***************
*** 786,790 ****
# Original subroutine for Circ2.pm
my ($itemnumber) = @_;
! my $dbh = &C4Connect;
my $q_itemnumber = $dbh->quote($itemnumber);
my $sth=$dbh->prepare("select borrowers.borrowernumber from
--- 780,784 ----
# Original subroutine for Circ2.pm
my ($itemnumber) = @_;
! my $dbh = C4::Context->dbh;
my $q_itemnumber = $dbh->quote($itemnumber);
my $sth=$dbh->prepare("select borrowers.borrowernumber from
***************
*** 845,849 ****
# New subroutine for Circ2.pm
my ($env, $borrower) = @_;
! my $dbh=&C4Connect;
my %currentissues;
my $counter=1;
--- 839,843 ----
# New subroutine for Circ2.pm
my ($env, $borrower) = @_;
! my $dbh = C4::Context->dbh;
my %currentissues;
my $counter=1;
***************
*** 884,894 ****
}
$sth->finish;
- $dbh->disconnect;
return(\%currentissues);
}
sub getissues {
# New subroutine for Circ2.pm
my ($borrower) = @_;
! my $dbh=&C4Connect;
my $borrowernumber = $borrower->{'borrowernumber'};
my $brn =$dbh->quote($borrowernumber);
--- 878,888 ----
}
$sth->finish;
return(\%currentissues);
}
+
sub getissues {
# New subroutine for Circ2.pm
my ($borrower) = @_;
! my $dbh = C4::Context->dbh;
my $borrowernumber = $borrower->{'borrowernumber'};
my $brn =$dbh->quote($borrowernumber);
***************
*** 922,926 ****
}
$sth->finish;
- $dbh->disconnect;
return(\%currentissues);
}
--- 916,919 ----
***************
*** 1120,1124 ****
my ($itemno) = @_;
my %env;
! my $dbh=&C4Connect;
my ($itemdata) = getiteminformation(\%env, $itemno,0);
my $bibno = $dbh->quote($itemdata->{'biblionumber'});
--- 1113,1117 ----
my ($itemno) = @_;
my %env;
! my $dbh = C4::Context->dbh;
my ($itemdata) = getiteminformation(\%env, $itemno,0);
my $bibno = $dbh->quote($itemdata->{'biblionumber'});
More information about the Koha-cvs
mailing list