[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha/admin branches.pl,1.3,1.4
From: |
Andrew Arensburger |
Subject: |
[Koha-cvs] CVS: koha/admin branches.pl,1.3,1.4 |
Date: |
Sat, 05 Oct 2002 03:02:10 -0700 |
Update of /cvsroot/koha/koha/admin
In directory usw-pr-cvs1:/tmp/cvs-serv26510/admin
Modified Files:
branches.pl
Log Message:
Merged with arensb-context branch: use C4::Context->dbh instead of
&C4Connect, and generally prefer C4::Context over C4::Database.
Index: branches.pl
===================================================================
RCS file: /cvsroot/koha/koha/admin/branches.pl,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** branches.pl 14 Aug 2002 18:12:53 -0000 1.3
--- branches.pl 5 Oct 2002 10:02:08 -0000 1.4
***************
*** 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,362 ----
}
}
! # FIXME - There's already a $dbh in this scope.
! 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;
}
--- 371,374 ----
***************
*** 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;
}
--- 377,384 ----
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) {
--- 386,394 ----
# 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) {
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha/admin branches.pl,1.3,1.4,
Andrew Arensburger <=