[Koha-cvs] CVS: koha/C4 Koha.pm,1.7,1.8
Andrew Arensburger
arensb at users.sourceforge.net
Sat Oct 5 11:51:29 CEST 2002
Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv22140/C4
Modified Files:
Koha.pm
Log Message:
Merged with arensb-context branch: use C4::Context->dbh instead of
&C4Connect, and generally prefer C4::Context over C4::Database.
Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -r1.7 -r1.8
*** Koha.pm 20 Sep 2002 12:49:47 -0000 1.7
--- Koha.pm 5 Oct 2002 09:51:27 -0000 1.8
***************
*** 21,25 ****
use strict;
require Exporter;
! use C4::Database;
use vars qw($VERSION @ISA @EXPORT);
--- 21,25 ----
use strict;
require Exporter;
! use C4::Context;
use vars qw($VERSION @ISA @EXPORT);
***************
*** 92,101 ****
my $ethnicity = shift;
! my $dbh=C4Connect;
my $sth=$dbh->prepare("Select name from ethnicity where code = ?");
$sth->execute($ethnicity);
my $data=$sth->fetchrow_hashref;
$sth->finish;
- $dbh->disconnect;
return $data->{'name'};
}
--- 92,100 ----
my $ethnicity = shift;
! my $dbh = C4::Context->dbh;
my $sth=$dbh->prepare("Select name from ethnicity where code = ?");
$sth->execute($ethnicity);
my $data=$sth->fetchrow_hashref;
$sth->finish;
return $data->{'name'};
}
***************
*** 114,118 ****
sub borrowercategories {
! my $dbh=C4Connect;
my $sth=$dbh->prepare("Select categorycode,description from categories order by description");
$sth->execute;
--- 113,117 ----
sub borrowercategories {
! my $dbh = C4::Context->dbh;
my $sth=$dbh->prepare("Select categorycode,description from categories order by description");
$sth->execute;
***************
*** 124,128 ****
}
$sth->finish;
- $dbh->disconnect;
return(\@codes,\%labels);
}
--- 123,126 ----
***************
*** 141,145 ****
sub ethnicitycategories {
! my $dbh=C4Connect;
my $sth=$dbh->prepare("Select code,name from ethnicity order by name");
$sth->execute;
--- 139,143 ----
sub ethnicitycategories {
! my $dbh = C4::Context->dbh;
my $sth=$dbh->prepare("Select code,name from ethnicity order by name");
$sth->execute;
***************
*** 151,155 ****
}
$sth->finish;
- $dbh->disconnect;
return(\@codes,\%labels);
}
--- 149,152 ----
More information about the Koha-cvs
mailing list