koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/C4 Koha.pm,1.7,1.8
Date: Sat, 05 Oct 2002 02:51:29 -0700

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(address@hidden,\%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(address@hidden,\%labels);
  }
--- 149,152 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]