koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/C4 Shelf.pm,1.3,1.4


From: MJ Ray
Subject: [Koha-cvs] CVS: koha/C4 Shelf.pm,1.3,1.4
Date: Mon, 15 Dec 2003 05:41:45 -0800

Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1:/tmp/cvs-serv27390/C4

Modified Files:
        Shelf.pm 
Log Message:
DBI call fix for bug 662

Index: Shelf.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Shelf.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Shelf.pm    24 Oct 2002 04:12:10 -0000      1.3
--- Shelf.pm    15 Dec 2003 13:41:43 -0000      1.4
***************
*** 318,327 ****
      foreach (@$add) {
        my ($biblionumber,$biblioitemnumber,$itemnumber) = @$_;
!       $sth=$dbh->prepare("select count(*) from bookshelfcontents where 
bookshelfid=$bookshelfid and itemnumber=$itemnumber and 
biblioitemnumber=$biblioitemnumber and biblionumber=$biblionumber");
!       $sth->execute;
        my $rows=$sth->fetchrow();
        if ($rows==0) {
!           $sth=$dbh->prepare("insert into bookshelfcontents 
(bookshelfid,biblionumber,biblioitemnumber,itemnumber) values 
($bookshelfid,$biblionumber,$biblioitemnumber,$itemnumber)");
!           $sth->execute;
            $clearcache=1;
        }
--- 318,327 ----
      foreach (@$add) {
        my ($biblionumber,$biblioitemnumber,$itemnumber) = @$_;
!       $sth=$dbh->prepare("select count(*) from bookshelfcontents where 
bookshelfid=? and itemnumber=? and biblioitemnumber=? and biblionumber=?");
!       $sth->execute($bookshelfid,$itemnumber,$biblioitemnumber,$biblionumber);
        my $rows=$sth->fetchrow();
        if ($rows==0) {
!           $sth=$dbh->prepare("insert into bookshelfcontents 
(bookshelfid,biblionumber,biblioitemnumber,itemnumber) values (?,?,?,?)");
!           
$sth->execute($bookshelfid,$biblionumber,$biblioitemnumber,$itemnumber);
            $clearcache=1;
        }
***************
*** 443,453 ****
      my $biblioitemnumbers;
      if ($orderby eq 'author') {
!       $sth=$dbh->prepare("select 
itemnumber,BSC.biblionumber,BSC.biblioitemnumber from bookshelfcontents BSC, 
biblio B where BSC.biblionumber=B.biblionumber and bookshelfid=$bookshelfid 
order by B.author $limit");
      } elsif ($orderby eq 'title') {
!       $sth=$dbh->prepare("select 
itemnumber,BSC.biblionumber,BSC.biblioitemnumber from bookshelfcontents BSC, 
biblio B where BSC.biblionumber=B.biblionumber and bookshelfid=$bookshelfid 
order by B.title $limit");
      } else {
!       $sth=$dbh->prepare("select itemnumber,biblionumber,biblioitemnumber 
from bookshelfcontents where bookshelfid=$bookshelfid $limit");
      }
!     $sth->execute;
      my @results;
      my @biblioresults;
--- 443,453 ----
      my $biblioitemnumbers;
      if ($orderby eq 'author') {
!       $sth=$dbh->prepare("select 
itemnumber,BSC.biblionumber,BSC.biblioitemnumber from bookshelfcontents BSC, 
biblio B where BSC.biblionumber=B.biblionumber and bookshelfid=? order by 
B.author $limit");
      } elsif ($orderby eq 'title') {
!       $sth=$dbh->prepare("select 
itemnumber,BSC.biblionumber,BSC.biblioitemnumber from bookshelfcontents BSC, 
biblio B where BSC.biblionumber=B.biblionumber and bookshelfid=? order by 
B.title $limit");
      } else {
!       $sth=$dbh->prepare("select itemnumber,biblionumber,biblioitemnumber 
from bookshelfcontents where bookshelfid=? $limit");
      }
!     $sth->execute($bookshelfid);
      my @results;
      my @biblioresults;




reply via email to

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