koha-devel
[Top][All Lists]
Advanced

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

[Koha-devel] CVS: koha/C4 Catalogue.pm,1.3,1.4


From: Steve Tonnesen
Subject: [Koha-devel] CVS: koha/C4 Catalogue.pm,1.3,1.4
Date: Tue, 26 Jun 2001 13:17:37 -0700

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

Modified Files:
        Catalogue.pm 
Log Message:
Added biblioitems table update when newBiblioItem() routine is called.


Index: Catalogue.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Catalogue.pm,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -r1.3 -r1.4
*** Catalogue.pm        2001/06/26 17:15:13     1.3
--- Catalogue.pm        2001/06/26 20:17:35     1.4
***************
*** 145,148 ****
--- 145,152 ----
        my $sti=$dbh->prepare("update biblio set title=$q_title where 
biblionumber=$biblio->{'biblionumber'}");
        $sti->execute;
+       logchange('marc', '245', 'a', $origbiblio->{'title'}, 
$biblio->{'title'});
+       foreach (@marcrecords) {
+           changeSubfield($_, '245', 'a', $origbiblio->{'title'}, 
$biblio->{'title'});
+       }
      }
      if ($biblio->{'unititle'} ne $origbiblio->{'unititle'}) {
***************
*** 157,160 ****
--- 161,168 ----
        my $sti=$dbh->prepare("update biblio set notes=$q_notes where 
biblionumber=$biblio->{'biblionumber'}");
        $sti->execute;
+       logchange('marc', '500', 'a', $origbiblio->{'notes'}, 
$biblio->{'notes'});
+       foreach (@marcrecords) {
+           changeSubfield($_, '500', 'a', $origbiblio->{'notes'}, 
$biblio->{'notes'});
+       }
      }
      if ($biblio->{'serial'} ne $origbiblio->{'serial'}) {
***************
*** 169,172 ****
--- 177,184 ----
        my $sti=$dbh->prepare("update biblio set seriestitle=$q_seriestitle 
where biblionumber=$biblio->{'biblionumber'}");
        $sti->execute;
+       logchange('marc', '440', 'a', $origbiblio->{'seriestitle'}, 
$biblio->{'seriestitle'});
+       foreach (@marcrecords) {
+           changeSubfield($_, '440', 'a', $origbiblio->{'seriestitle'}, 
$biblio->{'seriestitle'});
+       }
      }
      if ($biblio->{'copyrightdate'} ne $origbiblio->{'copyrightdate'}) {
***************
*** 175,178 ****
--- 187,194 ----
        my $sti=$dbh->prepare("update biblio set copyrightdate=$q_copyrightdate 
where biblionumber=$biblio->{'biblionumber'}");
        $sti->execute;
+       logchange('marc', '260', 'c', "c$origbiblio->{'notes'}", 
"c$biblio->{'notes'}");
+       foreach (@marcrecords) {
+           changeSubfield($_, '260', 'c', "c$origbiblio->{'notes'}", 
"c$biblio->{'notes'}");
+       }
      }
  }
***************
*** 242,268 ****
      my $biblioitemnumber=$biblioitem->{'biblioitemnumber'};
      my $volume=$biblioitem->{'volume'};
      my $number=$biblioitem->{'number'};
      my $classification=$biblioitem->{'classification'};
      my $itemtype=$biblioitem->{'itemtype'};
      my $isbn=$biblioitem->{'isbn'};
      my $issn=$biblioitem->{'issn'};
      my $dewey=$biblioitem->{'dewey'};
      $dewey=~s/\.*0*$//;
      ($dewey == 0) && ($dewey='');
      my $subclass=$biblioitem->{'subclass'};
      my $publicationyear=$biblioitem->{'publicationyear'};
      my $publishercode=$biblioitem->{'publishercode'};
      my $volumedate=$biblioitem->{'volumedate'};
      my $illus=$biblioitem->{'illus'};
      my $pages=$biblioitem->{'pages'};
      my $notes=$biblioitem->{'notes'};
      my $size=$biblioitem->{'size'};
      my $place=$biblioitem->{'place'};
      my $lccn=$biblioitem->{'lccn'};
  
  # Should we check if there is already a biblioitem/marc with the
  # same isbn/lccn/issn?
  
!     my $sth=$dbh->prepare("select 
title,unititle,seriestitle,copyrightdate,notes,author from biblio where 
biblionumber=$biblionumber");
      $sth->execute;
      my ($title, $unititle,$seriestitle,$copyrightdate,$biblionotes,$author) = 
$sth->fetchrow;
--- 258,317 ----
      my $biblioitemnumber=$biblioitem->{'biblioitemnumber'};
      my $volume=$biblioitem->{'volume'};
+     my $q_volume=$dbh->quote($volume);
      my $number=$biblioitem->{'number'};
+     my $q_number=$dbh->quote($number);
      my $classification=$biblioitem->{'classification'};
+     my $q_classification=$dbh->quote($classification);
      my $itemtype=$biblioitem->{'itemtype'};
+     my $q_itemtype=$dbh->quote($itemtype);
      my $isbn=$biblioitem->{'isbn'};
+     my $q_isbn=$dbh->quote($isbn);
      my $issn=$biblioitem->{'issn'};
+     my $q_issn=$dbh->quote($issn);
      my $dewey=$biblioitem->{'dewey'};
      $dewey=~s/\.*0*$//;
      ($dewey == 0) && ($dewey='');
      my $subclass=$biblioitem->{'subclass'};
+     my $q_subclass=$dbh->quote($subclass);
      my $publicationyear=$biblioitem->{'publicationyear'};
      my $publishercode=$biblioitem->{'publishercode'};
+     my $q_publishercode=$dbh->quote($publishercode);
      my $volumedate=$biblioitem->{'volumedate'};
+     my $q_volumedate=$dbh->quote($volumedate);
      my $illus=$biblioitem->{'illus'};
+     my $q_illus=$dbh->quote($illus);
      my $pages=$biblioitem->{'pages'};
+     my $q_pages=$dbh->quote($pages);
      my $notes=$biblioitem->{'notes'};
+     my $q_notes=$dbh->quote($notes);
      my $size=$biblioitem->{'size'};
+     my $q_size=$dbh->quote($size);
      my $place=$biblioitem->{'place'};
+     my $q_place=$dbh->quote($place);
      my $lccn=$biblioitem->{'lccn'};
+     my $q_lccn=$dbh->quote($lccn);
+ 
+ 
+ # Unless the $env->{'marconly'} flag is set, update the biblioitems table with
+ # the new data
+ 
+     unless ($env->{'marconly'}) {
+       #my $sth=$dbh->prepare("lock tables biblioitems write");
+       #$sth->execute;
+       my $sth=$dbh->prepare("select max(biblioitemnumber) from biblioitems");
+       $sth->execute;
+       my ($biblioitemnumber) =$sth->fetchrow;
+       $biblioitemnumber++;
+       $sth=$dbh->prepare("insert into biblioitems 
(biblionumber,biblioitemnumber,volume,number,classification,itemtype,isbn,issn,dewey,subclass,publicationyear,publishercode,volumedate,illus,pages,notes,size,place,lccn)
 values ($biblionumber, $biblioitemnumber, $q_volume, $q_number, 
$q_classification, $q_itemtype, $q_isbn, $q_issn, $dewey, $q_subclass, 
$q_publicationyear, $q_publishercode, $q_volumedate, $q_illus, 
$q_pages,$q_notes, $q_size, $q_place, $q_lccn)");
+       $sth->execute;
+       #my $sth=$dbh->prepare("unlock tables");
+       #$sth->execute;
+     }
+ 
  
  # Should we check if there is already a biblioitem/marc with the
  # same isbn/lccn/issn?
  
!     $sth=$dbh->prepare("select 
title,unititle,seriestitle,copyrightdate,notes,author from biblio where 
biblionumber=$biblionumber");
      $sth->execute;
      my ($title, $unititle,$seriestitle,$copyrightdate,$biblionotes,$author) = 
$sth->fetchrow;




reply via email to

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