[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Koha-cvs] CVS: koha bookcount.pl,1.7,1.7.2.1
From: |
MJ Ray |
Subject: |
[Koha-cvs] CVS: koha bookcount.pl,1.7,1.7.2.1 |
Date: |
Thu, 08 Jan 2004 09:29:58 -0800 |
Update of /cvsroot/koha/koha
In directory sc8-pr-cvs1:/tmp/cvs-serv18013
Modified Files:
Tag: rel_2_0
bookcount.pl
Log Message:
DBI call fix for bug 662.
Index: bookcount.pl
===================================================================
RCS file: /cvsroot/koha/koha/bookcount.pl,v
retrieving revision 1.7
retrieving revision 1.7.2.1
diff -C2 -r1.7 -r1.7.2.1
*** bookcount.pl 8 May 2003 13:19:39 -0000 1.7
--- bookcount.pl 8 Jan 2004 17:29:56 -0000 1.7.2.1
***************
*** 108,115 ****
my ($itemnumber)address@hidden;
my $dbh = C4::Context->dbh;
! my $itm = $dbh->quote("$itemnumber");
! my $query = "select * from items where itemnumber=$itm";
! my $sth=$dbh->prepare($query);
! $sth->execute;
my $data=$sth->fetchrow_hashref;
$sth->finish;
--- 108,113 ----
my ($itemnumber)address@hidden;
my $dbh = C4::Context->dbh;
! my $sth=$dbh->prepare("select * from items where itemnumber=?");
! $sth->execute($itemnumber);
my $data=$sth->fetchrow_hashref;
$sth->finish;
***************
*** 120,131 ****
my ($itemnumber)address@hidden;
my $dbh = C4::Context->dbh;
! my $var1 = $dbh->quote($itemnumber);
! my $sth =$dbh->prepare("select max(branchtransfers.datearrived) from
branchtransfers where branchtransfers.itemnumber=$var1");
! $sth->execute;
my ($date) = $sth->fetchrow_array;
return(0, "Item has no branch transfers record") if not $date;
! my $var2 = $dbh->quote($date);
! $sth=$dbh->prepare("Select * from branchtransfers where
branchtransfers.itemnumber=$var1 and branchtransfers.datearrived=$var2");
! $sth->execute;
my ($data) = $sth->fetchrow_hashref;
return(0, "Item has no branch transfers record") if not $data;
--- 118,127 ----
my ($itemnumber)address@hidden;
my $dbh = C4::Context->dbh;
! my $sth =$dbh->prepare("select max(branchtransfers.datearrived) from
branchtransfers where branchtransfers.itemnumber=?");
! $sth->execute($itemnumber);
my ($date) = $sth->fetchrow_array;
return(0, "Item has no branch transfers record") if not $date;
! $sth=$dbh->prepare("Select * from branchtransfers where
branchtransfers.itemnumber=? and branchtransfers.datearrived=?");
! $sth->execute($itemnumber,$date);
my ($data) = $sth->fetchrow_hashref;
return(0, "Item has no branch transfers record") if not $data;
***************
*** 137,144 ****
my ($itemnumber, $date)address@hidden;
my $dbh = C4::Context->dbh;
! my $itm = $dbh->quote($itemnumber);
! my $dat = $dbh->quote($date);
! my $sth=$dbh->prepare("Select count(*) from issues where
issues.itemnumber=$itm and issues.timestamp > $dat");
! $sth->execute;
my $count=$sth->fetchrow_hashref;
$sth->finish;
--- 133,138 ----
my ($itemnumber, $date)address@hidden;
my $dbh = C4::Context->dbh;
! my $sth=$dbh->prepare("Select count(*) from issues where
issues.itemnumber=? and issues.timestamp > ?");
! $sth->execute($itemnumber,$date);
my $count=$sth->fetchrow_hashref;
$sth->finish;
***************
*** 149,157 ****
my ($itemnumber, $brcd)address@hidden;
my $dbh = C4::Context->dbh;
! my $itm = $dbh->quote($itemnumber);
! my $brc = $dbh->quote($brcd);
! my $query = "Select count(*) from issues where itemnumber=$itm and
branchcode = $brc";
! my $sth=$dbh->prepare($query);
! $sth->execute;
my ($count)=$sth->fetchrow_array;
$sth->finish;
--- 143,148 ----
my ($itemnumber, $brcd)address@hidden;
my $dbh = C4::Context->dbh;
! my $sth=$dbh->prepare("Select count(*) from issues where itemnumber=?
and branchcode = ?");
! $sth->execute($itemnumber,$brcd);
my ($count)=$sth->fetchrow_array;
$sth->finish;
***************
*** 160,178 ****
sub lastseenat {
! my ($itemnumber, $brcd)address@hidden;
my $dbh = C4::Context->dbh;
! my $itm = $dbh->quote($itemnumber);
! my $brc = $dbh->quote($brcd);
! my $query = "Select max(timestamp) from issues where itemnumber=$itm
and branchcode = $brc";
! my $sth=$dbh->prepare($query);
! $sth->execute;
my ($date1)=$sth->fetchrow_array;
$sth->finish;
! $query = "Select max(datearrived) from branchtransfers where
itemnumber=$itm and tobranch = $brc";
! # FIXME - There's already a $sth in this scope.
! my $sth=$dbh->prepare($query);
! $sth->execute;
my ($date2)=$sth->fetchrow_array;
$sth->finish;
$date2 =~ s/-//g;
$date2 =~ s/://g;
--- 151,165 ----
sub lastseenat {
! my ($itm, $brc)address@hidden;
my $dbh = C4::Context->dbh;
! my $sth=$dbh->prepare("Select max(timestamp) from issues where
itemnumber=? and branchcode = ?");
! $sth->execute($itm,$brc);
my ($date1)=$sth->fetchrow_array;
$sth->finish;
! $sth=$dbh->prepare("Select max(datearrived) from branchtransfers where
itemnumber=? and tobranch = ?");
! $sth->execute($itm,$brc);
my ($date2)=$sth->fetchrow_array;
$sth->finish;
+ #FIXME: MJR thinks unsafe
$date2 =~ s/-//g;
$date2 =~ s/://g;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Koha-cvs] CVS: koha bookcount.pl,1.7,1.7.2.1,
MJ Ray <=