[Koha-cvs] CVS: koha/C4 Koha.pm,1.7,1.7.2.1

Andrew Arensburger arensb at users.sourceforge.net
Fri Oct 4 04:25:21 CEST 2002


Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv18691

Modified Files:
      Tag: arensb-context
	Koha.pm 
Log Message:
Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
C4Connect.


Index: Koha.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Koha.pm,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -r1.7 -r1.7.2.1
*** Koha.pm	20 Sep 2002 12:49:47 -0000	1.7
--- Koha.pm	4 Oct 2002 02:25:19 -0000	1.7.2.1
***************
*** 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