koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/C4 Biblio.pm,1.14,1.15


From: Andrew Arensburger
Subject: [Koha-cvs] CVS: koha/C4 Biblio.pm,1.14,1.15
Date: Sat, 05 Oct 2002 02:49:27 -0700

Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv20709

Modified Files:
        Biblio.pm 
Log Message:
Merged with arensb-context branch: use C4::Context->dbh instead of
&C4Connect, and generally prefer C4::Context over C4::Database.


Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** Biblio.pm   3 Oct 2002 11:28:18 -0000       1.14
--- Biblio.pm   5 Oct 2002 09:49:25 -0000       1.15
***************
*** 2,5 ****
--- 2,9 ----
  # $Id$
  # $Log$
+ # Revision 1.15  2002/10/05 09:49:25  arensb
+ # Merged with arensb-context branch: use C4::Context->dbh instead of
+ # &C4Connect, and generally prefer C4::Context over C4::Database.
+ #
  # Revision 1.14  2002/10/03 11:28:18  tipaul
  # Extending Context.pm to add stopword management and using it in MARC-API.
***************
*** 9,12 ****
--- 13,39 ----
  # road to 1.3.1
  #
+ # Revision 1.12.2.4  2002/10/05 07:09:31  arensb
+ # Merged in changes from main branch.
+ #
+ # Revision 1.12.2.3  2002/10/05 06:12:10  arensb
+ # Added a whole mess of FIXME comments.
+ #
+ # Revision 1.12.2.2  2002/10/05 04:03:14  arensb
+ # Added some missing semicolons.
+ #
+ # Revision 1.12.2.1  2002/10/04 02:24:01  arensb
+ # Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
+ # C4Connect.
+ #
+ # Revision 1.12.2.3  2002/10/05 06:12:10  arensb
+ # Added a whole mess of FIXME comments.
+ #
+ # Revision 1.12.2.2  2002/10/05 04:03:14  arensb
+ # Added some missing semicolons.
+ #
+ # Revision 1.12.2.1  2002/10/04 02:24:01  arensb
+ # Use C4::Connect instead of C4::Database, C4::Connect->dbh instead
+ # C4Connect.
+ #
  # Revision 1.12  2002/10/01 11:48:51  arensb
  # Added some FIXME comments, mostly marking duplicate functions.
***************
*** 107,110 ****
--- 134,138 ----
  use strict;
  require Exporter;
+ use C4::Context;
  use C4::Database;
  use MARC::Record;
***************
*** 154,158 ****
  # as well as any optionally exported functions
  
! @EXPORT_OK   = qw($Var1 %Hashit);
  
  #
--- 182,186 ----
  # as well as any optionally exported functions
  
! @EXPORT_OK   = qw($Var1 %Hashit);     # FIXME - These are never used
  
  #
***************
*** 241,245 ****
  
  Paul POULAIN address@hidden
! /
  =cut
  
--- 269,273 ----
  
  Paul POULAIN address@hidden
! 
  =cut
  
***************
*** 452,455 ****
--- 480,484 ----
                                 where bibid=? and tagorder=? order by 
subfieldorder
                         ");
+     # FIXME - There's already a $sth2 in this scope.
      my $sth2=$dbh->prepare("select subfieldvalue from marc_blob_subfield 
where blobidlink=?");
      $sth->execute($bibid,$tagorder);
***************
*** 759,770 ****
--- 788,803 ----
        $result=&MARCmarc2kohaOneField($sth,"biblio",$field,$record,$result);
      }
+     # FIXME - There's already a $sth2 in this scope.
      my $sth2=$dbh->prepare("SHOW COLUMNS from biblioitems");
      $sth2->execute;
+     # FIXME - There's already a $field in this scope.
      my $field;
      while (($field)=$sth2->fetchrow) {
        
$result=&MARCmarc2kohaOneField($sth,"biblioitems",$field,$record,$result);
      }
+     # FIXME - There's already a $sth2 in this scope.
      my $sth2=$dbh->prepare("SHOW COLUMNS from items");
      $sth2->execute;
+     # FIXME - There's already a $field in this scope.
      my $field;
      while (($field)=$sth2->fetchrow) {
***************
*** 1087,1091 ****
      
      $sth->finish;
-     $dbh->disconnect;
      return($biblio->{'biblionumber'});
  } # sub modbiblio
--- 1120,1123 ----
***************
*** 1124,1129 ****
          $sth->finish;
      } # if
- 
-   $dbh->disconnect;
  } # sub modaddauthor
  
--- 1156,1159 ----
***************
*** 1523,1529 ****
  # FIXME - This is the same as &C4::Acquisitions::itemcount, but not
  # the same as &C4::Search::itemcount
  sub itemcount{
    my ($biblio)address@hidden;
!   my $dbh=C4Connect;
    my $query="Select count(*) from items where biblionumber=$biblio";
  #  print $query;
--- 1553,1560 ----
  # FIXME - This is the same as &C4::Acquisitions::itemcount, but not
  # the same as &C4::Search::itemcount
+ # Since they're both exported, acqui/acquire.pl doesn't compile with -w.
  sub itemcount{
    my ($biblio)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $query="Select count(*) from items where biblionumber=$biblio";
  #  print $query;
***************
*** 1532,1536 ****
    my $data=$sth->fetchrow_hashref;
    $sth->finish;
-   $dbh->disconnect;
    return($data->{'count(*)'});
  }
--- 1563,1566 ----
***************
*** 1538,1542 ****
  sub getorder{
    my ($bi,$bib)address@hidden;
!   my $dbh=C4Connect;
    my $query="Select ordernumber 
        from aqorders 
--- 1568,1572 ----
  sub getorder{
    my ($bi,$bib)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $query="Select ordernumber 
        from aqorders 
***************
*** 1547,1551 ****
    $sth->finish;
    my $order=getsingleorder($ordnum->{'ordernumber'});
-   $dbh->disconnect;
  #  print $query;
    return ($order,$ordnum->{'ordernumber'});
--- 1577,1580 ----
***************
*** 1556,1560 ****
  sub getsingleorder {
    my ($ordnum)address@hidden;
!   my $dbh=C4Connect;
    my $query="Select * from biblio,biblioitems,aqorders,aqorderbreakdown 
    where aqorders.ordernumber=? 
--- 1585,1589 ----
  sub getsingleorder {
    my ($ordnum)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $query="Select * from biblio,biblioitems,aqorders,aqorderbreakdown 
    where aqorders.ordernumber=? 
***************
*** 1566,1595 ****
    my $data=$sth->fetchrow_hashref;
    $sth->finish;
-   $dbh->disconnect;
    return($data);
  }
  
  sub newbiblio {
    my ($biblio) = @_;
!   my $dbh    = &C4Connect;
    my $bibnum=OLDnewbiblio($dbh,$biblio);
  # TODO : MARC add
-   $dbh->disconnect;
    return($bibnum);
  }
  
  sub modbiblio {
    my ($biblio) = @_;
!   my $dbh  = C4Connect;
    my $biblionumber=OLDmodbiblio($dbh,$biblio);
-   $dbh->disconnect;
    return($biblionumber);
  } # sub modbiblio
  
  sub modsubtitle {
    my ($bibnum, $subtitle) = @_;
!   my $dbh   = C4Connect;
    &OLDmodsubtitle($dbh,$bibnum,$subtitle);
-   $dbh->disconnect;
  } # sub modsubtitle
  
--- 1595,1626 ----
    my $data=$sth->fetchrow_hashref;
    $sth->finish;
    return($data);
  }
  
+ # FIXME - This is in effect identical to &C4::Acquisitions::newbiblio.
+ # Pick one and stick with it.
  sub newbiblio {
    my ($biblio) = @_;
!   my $dbh    = C4::Context->dbh;
    my $bibnum=OLDnewbiblio($dbh,$biblio);
  # TODO : MARC add
    return($bibnum);
  }
  
+ # FIXME - This is in effect the same as &C4::Acquisitions::modbiblio.
+ # Pick one and stick with it.
  sub modbiblio {
    my ($biblio) = @_;
!   my $dbh  = C4::Context->dbh;
    my $biblionumber=OLDmodbiblio($dbh,$biblio);
    return($biblionumber);
  } # sub modbiblio
  
+ # FIXME - This is in effect identical to &C4::Acquisitions::modsubtitle.
+ # Pick one and stick with it.
  sub modsubtitle {
    my ($bibnum, $subtitle) = @_;
!   my $dbh   = C4::Context->dbh;
    &OLDmodsubtitle($dbh,$bibnum,$subtitle);
  } # sub modsubtitle
  
***************
*** 1597,1636 ****
  # FIXME - This is functionally identical to
  # &C4::Acquisitions::modaddauthor
  sub modaddauthor {
      my ($bibnum, $author) = @_;
!     my $dbh   = C4Connect;
      &OLDmodaddauthor($dbh,$bibnum,$author);
-     $dbh->disconnect;
  } # sub modaddauthor
  
  
  sub modsubject {
    my ($bibnum, $force, @subject) = @_;
!   my $dbh   = C4Connect;
    my $error= &OLDmodsubject($dbh,$bibnum,$force, @subject);
    return($error);
  } # sub modsubject
  
  sub modbibitem {
      my ($biblioitem) = @_;
!     my $dbh   = C4Connect;
      &OLDmodbibitem($dbh,$biblioitem);
      my $MARCbibitem = MARCkoha2marcBiblio($dbh,$biblioitem);
      &MARCmodbiblio($dbh,$biblioitem->{biblionumber},0,$MARCbibitem);
-     $dbh->disconnect;
  } # sub modbibitem
  
  sub modnote {
    my ($bibitemnum,$note)address@hidden;
!   my $dbh=C4Connect;
    &OLDmodnote($dbh,$bibitemnum,$note);
-   $dbh->disconnect;
  }
  
  # FIXME - This is quite similar in effect to &C4::newbiblioitem,
! # except for the MARC stuff.
  sub newbiblioitem {
    my ($biblioitem) = @_;
!   my $dbh   = C4Connect;
    my $bibitemnum = &OLDnewbiblioitem($dbh,$biblioitem);
  #  print STDERR "bibitemnum : $bibitemnum\n";
--- 1628,1672 ----
  # FIXME - This is functionally identical to
  # &C4::Acquisitions::modaddauthor
+ # Pick one and stick with it.
  sub modaddauthor {
      my ($bibnum, $author) = @_;
!     my $dbh   = C4::Context->dbh;
      &OLDmodaddauthor($dbh,$bibnum,$author);
  } # sub modaddauthor
  
  
+ # FIXME - This is in effect identical to &C4::Acquisitions::modsubject.
+ # Pick one and stick with it.
  sub modsubject {
    my ($bibnum, $force, @subject) = @_;
!   my $dbh   = C4::Context->dbh;
    my $error= &OLDmodsubject($dbh,$bibnum,$force, @subject);
    return($error);
  } # sub modsubject
  
+ # FIXME - This is very similar to &C4::Acquisitions::modbibitem.
+ # Pick one and stick with it.
  sub modbibitem {
      my ($biblioitem) = @_;
!     my $dbh   = C4::Context->dbh;
      &OLDmodbibitem($dbh,$biblioitem);
      my $MARCbibitem = MARCkoha2marcBiblio($dbh,$biblioitem);
      &MARCmodbiblio($dbh,$biblioitem->{biblionumber},0,$MARCbibitem);
  } # sub modbibitem
  
+ # FIXME - This is in effect identical to &C4::Acquisitions::modnote.
+ # Pick one and stick with it.
  sub modnote {
    my ($bibitemnum,$note)address@hidden;
!   my $dbh = C4::Context->dbh;
    &OLDmodnote($dbh,$bibitemnum,$note);
  }
  
  # FIXME - This is quite similar in effect to &C4::newbiblioitem,
! # except for the MARC stuff. There's also a &newbiblioitem in
! # acqui.simple/addbookslccn.pl
  sub newbiblioitem {
    my ($biblioitem) = @_;
!   my $dbh   = C4::Context->dbh;
    my $bibitemnum = &OLDnewbiblioitem($dbh,$biblioitem);
  #  print STDERR "bibitemnum : $bibitemnum\n";
***************
*** 1641,1649 ****
  }
  
  sub newsubject {
    my ($bibnum)address@hidden;
!   my $dbh=C4Connect;
    &OLDnewsubject($dbh,$bibnum);
-   $dbh->disconnect;
  }
  
--- 1677,1686 ----
  }
  
+ # FIXME - This is in effect identical to &C4::Acquisitions::newsubject.
+ # Pick one and stick with it.
  sub newsubject {
    my ($bibnum)address@hidden;
!   my $dbh = C4::Context->dbh;
    &OLDnewsubject($dbh,$bibnum);
  }
  
***************
*** 1652,1663 ****
  sub newsubtitle {
      my ($bibnum, $subtitle) = @_;
!     my $dbh   = C4Connect;
      &OLDnewsubtitle($dbh,$bibnum,$subtitle);
-   $dbh->disconnect;
  }
  
  sub newitems {
    my ($item, @barcodes) = @_;
!   my $dbh   = C4Connect;
    my $errors;
    my $itemnumber;
--- 1689,1701 ----
  sub newsubtitle {
      my ($bibnum, $subtitle) = @_;
!     my $dbh   = C4::Context->dbh;
      &OLDnewsubtitle($dbh,$bibnum,$subtitle);
  }
  
+ # FIXME - This is different from &C4::Acquisitions::newitems, though
+ # both are exported.
  sub newitems {
    my ($item, @barcodes) = @_;
!   my $dbh   = C4::Context->dbh;
    my $errors;
    my $itemnumber;
***************
*** 1672,1683 ****
  #      print STDERR "MARCmodbiblio called\n";
    }
-   $dbh->disconnect;
    return($errors);
  }
  
  sub moditem {
      my ($item) = @_;
  #  my 
($loan,$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn,$replacement)address@hidden;
!     my $dbh=C4Connect;
      &OLDmoditem($dbh,$item);
      warn "biblionumber : $item->{'biblionumber'} / $item->{'itemnum'}\n";
--- 1710,1723 ----
  #      print STDERR "MARCmodbiblio called\n";
    }
    return($errors);
  }
  
+ # FIXME - This appears to be functionally equivalent to
+ # &C4::Acquisitions::moditem.
+ # Pick one and stick with it.
  sub moditem {
      my ($item) = @_;
  #  my 
($loan,$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn,$replacement)address@hidden;
!     my $dbh = C4::Context->dbh;
      &OLDmoditem($dbh,$item);
      warn "biblionumber : $item->{'biblionumber'} / $item->{'itemnum'}\n";
***************
*** 1688,1697 ****
      my $bibid = 
&MARCfind_MARCbibid_from_oldbiblionumber($dbh,$item->{biblionumber});
      &MARCmoditem($dbh,$MARCitem,$bibid,$item->{itemnum},0);
-     $dbh->disconnect;
  }
  
  sub checkitems{
    my ($count,@barcodes)address@hidden;
!   my $dbh=C4Connect;
    my $error;
    for (my $i=0;$i<$count;$i++){
--- 1728,1738 ----
      my $bibid = 
&MARCfind_MARCbibid_from_oldbiblionumber($dbh,$item->{biblionumber});
      &MARCmoditem($dbh,$MARCitem,$bibid,$item->{itemnum},0);
  }
  
+ # FIXME - This is the same as &C4::Acquisitions::Checkitems.
+ # Pick one and stick with it.
  sub checkitems{
    my ($count,@barcodes)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $error;
    for (my $i=0;$i<$count;$i++){
***************
*** 1705,1715 ****
      $sth->finish;
    }
-   $dbh->disconnect;
    return($error);
  }
  
  sub countitems{
    my ($bibitemnum)address@hidden;
!   my $dbh=C4Connect;
    my $query="Select count(*) from items where biblioitemnumber='$bibitemnum'";
    my $sth=$dbh->prepare($query);
--- 1746,1757 ----
      $sth->finish;
    }
    return($error);
  }
  
+ # FIXME - This is identical to &C4::Acquisitions::countitems.
+ # Pick one and stick with it.
  sub countitems{
    my ($bibitemnum)address@hidden;
!   my $dbh = C4::Context->dbh;
    my $query="Select count(*) from items where biblioitemnumber='$bibitemnum'";
    my $sth=$dbh->prepare($query);
***************
*** 1717,1721 ****
    my $data=$sth->fetchrow_hashref;
    $sth->finish;
-   $dbh->disconnect;
    return($data->{'count(*)'});
  }
--- 1759,1762 ----
***************
*** 1723,1750 ****
  # FIXME - This is just a wrapper around &OLDdelitem, and acts
  # identically to &C4::Acquisitions::delitem
  sub delitem{
    my ($itemnum)address@hidden;
!   my $dbh=C4Connect;
    &OLDdelitem($dbh,$itemnum);
-   $dbh->disconnect;
  }
  
  sub deletebiblioitem {
      my ($biblioitemnumber) = @_;
!     my $dbh   = C4Connect;
      &OLDdeletebiblioitem($dbh,$biblioitemnumber);
-     $dbh->disconnect;
  } # sub deletebiblioitem
  
  
  sub delbiblio {
    my ($biblio)address@hidden;
!   my $dbh=C4Connect;
    &OLDdelbiblio($dbh,$biblio);
-   $dbh->disconnect;
  }
  
  sub getitemtypes {
!   my $dbh   = C4Connect;
    my $query = "select * from itemtypes";
    my $sth   = $dbh->prepare($query);
--- 1764,1796 ----
  # FIXME - This is just a wrapper around &OLDdelitem, and acts
  # identically to &C4::Acquisitions::delitem
+ # Pick one and stick with it.
  sub delitem{
    my ($itemnum)address@hidden;
!   my $dbh = C4::Context->dbh;
    &OLDdelitem($dbh,$itemnum);
  }
  
+ # FIXME - This is functionally identical to
+ # &C4::Acquisitions::deletebiblioitem.
+ # Pick one and stick with it.
  sub deletebiblioitem {
      my ($biblioitemnumber) = @_;
!     my $dbh   = C4::Context->dbh;
      &OLDdeletebiblioitem($dbh,$biblioitemnumber);
  } # sub deletebiblioitem
  
  
+ # FIXME - This is functionally identical to &C4::Acquisitions::delbiblio.
+ # Pick one and stick with it.
  sub delbiblio {
    my ($biblio)address@hidden;
!   my $dbh = C4::Context->dbh;
    &OLDdelbiblio($dbh,$biblio);
  }
  
+ # FIXME - This is identical to &C4::Acquisitions::getitemtypes.
+ # Pick one and stick with it.
  sub getitemtypes {
!   my $dbh   = C4::Context->dbh;
    my $query = "select * from itemtypes";
    my $sth   = $dbh->prepare($query);
***************
*** 1761,1765 ****
    
    $sth->finish;
-   $dbh->disconnect;
    return($count, @results);
  } # sub getitemtypes
--- 1807,1810 ----
***************
*** 1767,1771 ****
  sub getbiblio {
      my ($biblionumber) = @_;
!     my $dbh   = C4Connect;
      my $query = "Select * from biblio where biblionumber = $biblionumber";
      my $sth   = $dbh->prepare($query);
--- 1812,1816 ----
  sub getbiblio {
      my ($biblionumber) = @_;
!     my $dbh   = C4::Context->dbh;
      my $query = "Select * from biblio where biblionumber = $biblionumber";
      my $sth   = $dbh->prepare($query);
***************
*** 1782,1792 ****
      
      $sth->finish;
-     $dbh->disconnect;
      return($count, @results);
  } # sub getbiblio
  
  sub getbiblioitem {
      my ($biblioitemnum) = @_;
!     my $dbh   = C4Connect;
      my $query = "Select * from biblioitems where
  biblioitemnumber = $biblioitemnum";
--- 1827,1838 ----
      
      $sth->finish;
      return($count, @results);
  } # sub getbiblio
  
+ # FIXME - This is identical to &C4::Acquisitions::getbiblioitem.
+ # Pick one and stick with it.
  sub getbiblioitem {
      my ($biblioitemnum) = @_;
!     my $dbh   = C4::Context->dbh;
      my $query = "Select * from biblioitems where
  biblioitemnumber = $biblioitemnum";
***************
*** 1803,1813 ****
  
      $sth->finish;
-     $dbh->disconnect;
      return($count, @results);
  } # sub getbiblioitem
  
  sub getbiblioitembybiblionumber {
      my ($biblionumber) = @_;
!     my $dbh   = C4Connect;
      my $query = "Select * from biblioitems where biblionumber =
  $biblionumber";
--- 1849,1861 ----
  
      $sth->finish;
      return($count, @results);
  } # sub getbiblioitem
  
+ # FIXME - This is identical to
+ # &C4::Acquisitions::getbiblioitembybiblionumber.
+ # Pick one and stick with it.
  sub getbiblioitembybiblionumber {
      my ($biblionumber) = @_;
!     my $dbh   = C4::Context->dbh;
      my $query = "Select * from biblioitems where biblionumber =
  $biblionumber";
***************
*** 1824,1834 ****
  
      $sth->finish;
-     $dbh->disconnect;
      return($count, @results);
  } # sub
  
  sub getitemsbybiblioitem {
      my ($biblioitemnum) = @_;
!     my $dbh   = C4Connect;
      my $query = "Select * from items, biblio where
  biblio.biblionumber = items.biblionumber and biblioitemnumber
--- 1872,1884 ----
  
      $sth->finish;
      return($count, @results);
  } # sub
  
+ # FIXME - This is identical to
+ # &C4::Acquisitions::getbiblioitembybiblionumber.
+ # Pick one and stick with it.
  sub getitemsbybiblioitem {
      my ($biblioitemnum) = @_;
!     my $dbh   = C4::Context->dbh;
      my $query = "Select * from items, biblio where
  biblio.biblionumber = items.biblionumber and biblioitemnumber
***************
*** 1847,1857 ****
      
      $sth->finish;
-     $dbh->disconnect;
      return($count, @results);
  } # sub getitemsbybiblioitem
  
  sub isbnsearch {
      my ($isbn) = @_;
!     my $dbh   = C4Connect;
      my $count = 0;
      my $query;
--- 1897,1908 ----
      
      $sth->finish;
      return($count, @results);
  } # sub getitemsbybiblioitem
  
+ # FIXME - This is identical to &C4::Acquisitions::isbnsearch.
+ # Pick one and stick with it.
  sub isbnsearch {
      my ($isbn) = @_;
!     my $dbh   = C4::Context->dbh;
      my $count = 0;
      my $query;
***************
*** 1872,1876 ****
  
      $sth->finish;
-     $dbh->disconnect;
      return($count, @results);
  } # sub isbnsearch
--- 1923,1926 ----
***************
*** 2001,2005 ****
  sub OLD_MAYBE_DELETED_newBiblioItem {
      my ($env, $biblioitem) = @_;
!     my $dbh=&C4Connect;  
      my $biblionumber=$biblioitem->{'biblionumber'};
      my $biblioitemnumber=$biblioitem->{'biblioitemnumber'};
--- 2051,2055 ----
  sub OLD_MAYBE_DELETED_newBiblioItem {
      my ($env, $biblioitem) = @_;
!     my $dbh = C4::Context->dbh;
      my $biblionumber=$biblioitem->{'biblionumber'};
      my $biblioitemnumber=$biblioitem->{'biblioitemnumber'};
***************
*** 2255,2259 ****
      }
      $sth->finish;
-     $dbh->disconnect;
      return ($env, $Record_ID);
  }
--- 2305,2308 ----
***************
*** 2261,2265 ****
  sub OLD_MAYBE_DELETED_newItem {
      my ($env, $Record_ID, $item) = @_;
!     my $dbh=&C4Connect;  
      my $barcode=$item->{'barcode'};
      my $q_barcode=$dbh->quote($barcode);
--- 2310,2314 ----
  sub OLD_MAYBE_DELETED_newItem {
      my ($env, $Record_ID, $item) = @_;
!     my $dbh = C4::Context->dbh;
      my $barcode=$item->{'barcode'};
      my $q_barcode=$dbh->quote($barcode);
***************
*** 2364,2368 ****
      my $Record_ID;
      my $biblionumber=$biblio->{'biblionumber'};
!     my $dbh=&C4Connect;  
      my $sth=$dbh->prepare("select * from biblio where 
biblionumber=$biblionumber");
      $sth->execute;
--- 2413,2417 ----
      my $Record_ID;
      my $biblionumber=$biblio->{'biblionumber'};
!     my $dbh = C4::Context->dbh;
      my $sth=$dbh->prepare("select * from biblio where 
biblionumber=$biblionumber");
      $sth->execute;
***************
*** 2512,2516 ****
  
      my ($env, $biblioitem) = @_;
!     my $dbh=&C4Connect;  
  
      my $biblioitemnumber=$biblioitem->{'biblioitemnumber'};
--- 2561,2565 ----
  
      my ($env, $biblioitem) = @_;
!     my $dbh = C4::Context->dbh;
  
      my $biblioitemnumber=$biblioitem->{'biblioitemnumber'};
***************
*** 2632,2637 ****
      }
      $sth->finish;
-     $dbh->disconnect;
- 
  }
  
--- 2681,2684 ----
***************
*** 2645,2649 ****
  
      my ($env, $item) = @_;
!     my $dbh=&C4Connect;  
      my $itemnumber=$item->{'itemnumber'};
      my $biblionumber=$item->{'biblionumber'};
--- 2692,2696 ----
  
      my ($env, $item) = @_;
!     my $dbh = C4::Context->dbh;
      my $itemnumber=$item->{'itemnumber'};
      my $biblionumber=$item->{'biblionumber'};
***************
*** 2786,2790 ****
      }
      $sth->finish;
-     $dbh->disconnect;
  }
  
--- 2833,2836 ----




reply via email to

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