koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/admin branches.pl,1.3,1.3.2.1


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/admin branches.pl,1.3,1.3.2.1
Date: Thu, 03 Oct 2002 19:34:01 -0700

Update of /cvsroot/koha/koha/admin
In directory usw-pr-cvs1:/tmp/cvs-serv21117

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


Index: branches.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/branches.pl,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -C2 -r1.3 -r1.3.2.1
*** branches.pl 14 Aug 2002 18:12:53 -0000      1.3
--- branches.pl 4 Oct 2002 02:33:59 -0000       1.3.2.1
***************
*** 24,29 ****
  use strict;
  use CGI;
  use C4::Output;
- use C4::Database;
  
  # Fixed variables
--- 24,29 ----
  use strict;
  use CGI;
+ use C4::Context;
  use C4::Output;
  
  # Fixed variables
***************
*** 267,271 ****
  
      my ($branchcode) = @_;
!     my $dbh = &C4Connect;
      my $query;
      if ($branchcode) {
--- 267,271 ----
  
      my ($branchcode) = @_;
!     my $dbh = C4::Context->dbh;
      my $query;
      if ($branchcode) {
***************
*** 291,295 ****
      }
      $sth->finish;
-     $dbh->disconnect;
      return address@hidden;
  }
--- 291,294 ----
***************
*** 298,302 ****
  # returns a reference to an array of hashes containing branches,
      my ($catcode) = @_;
!     my $dbh = &C4Connect;
      my $query;
      if ($catcode) {
--- 297,301 ----
  # returns a reference to an array of hashes containing branches,
      my ($catcode) = @_;
!     my $dbh = C4::Context->dbh;
      my $query;
      if ($catcode) {
***************
*** 313,317 ****
      }
      $sth->finish;
-     $dbh->disconnect;
      return address@hidden;
  }
--- 312,315 ----
***************
*** 320,324 ****
  # sets the data from the editbranch form, and writes to the database...
      my ($data) = @_;
!     my $dbh=&C4Connect;
      my $query = "replace branches 
(branchcode,branchname,branchaddress1,branchaddress2,branchaddress3,branchphone,branchfax,branchemail)
 values (";
      my $tmp;
--- 318,322 ----
  # sets the data from the editbranch form, and writes to the database...
      my ($data) = @_;
!     my $dbh = C4::Context->dbh;
      my $query = "replace branches 
(branchcode,branchname,branchaddress1,branchaddress2,branchaddress3,branchphone,branchfax,branchemail)
 values (";
      my $tmp;
***************
*** 334,338 ****
      $sth->execute;
      $sth->finish;
-     $dbh->disconnect;
  # sort out the categories....
      my @checkedcats;
--- 332,335 ----
***************
*** 360,364 ****
        }
      } 
!     my $dbh=&C4Connect;
      foreach my $cat (@addcats) {
        my $query = "insert into branchrelations (branchcode, categorycode) 
values('$branchcode', '$cat')";
--- 357,361 ----
        }
      } 
!     my $dbh = C4::Context->dbh;
      foreach my $cat (@addcats) {
        my $query = "insert into branchrelations (branchcode, categorycode) 
values('$branchcode', '$cat')";
***************
*** 373,377 ****
        $sth->finish;
      }
-     $dbh->disconnect;
  }
  
--- 370,373 ----
***************
*** 380,388 ****
      my ($branchcode) = @_;
      my $query = "delete from branches where branchcode = '$branchcode'";
!     my $dbh=&C4Connect;
      my $sth=$dbh->prepare($query);
      $sth->execute;
      $sth->finish;
-     $dbh->disconnect;
  }
  
--- 376,383 ----
      my ($branchcode) = @_;
      my $query = "delete from branches where branchcode = '$branchcode'";
!     my $dbh = C4::Context->dbh;
      my $sth=$dbh->prepare($query);
      $sth->execute;
      $sth->finish;
  }
  
***************
*** 390,399 ****
  # check to see if the branchcode is being used in the database somewhere....
      my ($branchcode) = @_;
!     my $dbh = &C4Connect;
      my $sth=$dbh->prepare("select count(*) from items where 
holdingbranch='$branchcode' or homebranch='$branchcode'");
      $sth->execute;
      my ($total) = $sth->fetchrow_array;
      $sth->finish;
-     $dbh->disconnect;
      my $message;
      if ($total) {
--- 385,393 ----
  # check to see if the branchcode is being used in the database somewhere....
      my ($branchcode) = @_;
!     my $dbh = C4::Context->dbh;
      my $sth=$dbh->prepare("select count(*) from items where 
holdingbranch='$branchcode' or homebranch='$branchcode'");
      $sth->execute;
      my ($total) = $sth->fetchrow_array;
      $sth->finish;
      my $message;
      if ($total) {




reply via email to

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