[Koha-cvs] CVS: koha/C4 Biblio.pm,1.19,1.20

Andrew Arensburger arensb at users.sourceforge.net
Sun Oct 13 10:28:34 CEST 2002


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

Modified Files:
	Biblio.pm 
Log Message:
Deleted unused variables.
Removed trailing whitespace.


Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -r1.19 -r1.20
*** Biblio.pm	13 Oct 2002 05:56:10 -0000	1.19
--- Biblio.pm	13 Oct 2002 08:28:32 -0000	1.20
***************
*** 2,5 ****
--- 2,9 ----
  # $Id$
  # $Log$
+ # Revision 1.20  2002/10/13 08:28:32  arensb
+ # Deleted unused variables.
+ # Removed trailing whitespace.
+ #
  # Revision 1.19  2002/10/13 05:56:10  arensb
  # Added some FIXME comments.
***************
*** 100,104 ****
  
  
! # move from 1.2 to 1.4 version : 
  # 1.2 and previous version uses a specific API to manage biblios. This API uses old-DB style parameters.
  # In the 1.4 version, we want to do 2 differents things :
--- 104,108 ----
  
  
! # move from 1.2 to 1.4 version :
  # 1.2 and previous version uses a specific API to manage biblios. This API uses old-DB style parameters.
  # In the 1.4 version, we want to do 2 differents things :
***************
*** 150,154 ****
  use MARC::Record;
  
! use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
  
  # set the version for version checking
--- 154,158 ----
  use MARC::Record;
  
! use vars qw($VERSION @ISA @EXPORT);
  
  # set the version for version checking
***************
*** 161,171 ****
  #
  @EXPORT = qw(
! 	     &updateBiblio &updateBiblioItem &updateItem 
! 	     &itemcount &newbiblio &newbiblioitem 
  	     &modnote &newsubject &newsubtitle
  	     &modbiblio &checkitems
  	     &newitems &modbibitem
! 	     &modsubtitle &modsubject &modaddauthor &moditem &countitems 
! 	     &delitem &deletebiblioitem &delbiblio  
  	     &getitemtypes &getbiblio
  	     &getbiblioitembybiblionumber
--- 165,175 ----
  #
  @EXPORT = qw(
! 	     &updateBiblio &updateBiblioItem &updateItem
! 	     &itemcount &newbiblio &newbiblioitem
  	     &modnote &newsubject &newsubtitle
  	     &modbiblio &checkitems
  	     &newitems &modbibitem
! 	     &modsubtitle &modsubject &modaddauthor &moditem &countitems
! 	     &delitem &deletebiblioitem &delbiblio
  	     &getitemtypes &getbiblio
  	     &getbiblioitembybiblionumber
***************
*** 181,187 ****
  	     &MARCgettagslib
  	     &MARCaddbiblio &MARCadditem
! 	     &MARCmodsubfield &MARCaddsubfield 
  	     &MARCmodbiblio &MARCmoditem
! 	     &MARCfindsubfield 
  	     &MARCkoha2marcBiblio &MARCmarc2koha &MARCkoha2marcItem
  	     &MARCgetbiblio &MARCgetitem
--- 185,191 ----
  	     &MARCgettagslib
  	     &MARCaddbiblio &MARCadditem
! 	     &MARCmodsubfield &MARCaddsubfield
  	     &MARCmodbiblio &MARCmoditem
! 	     &MARCfindsubfield
  	     &MARCkoha2marcBiblio &MARCmarc2koha &MARCkoha2marcItem
  	     &MARCgetbiblio &MARCgetitem
***************
*** 189,199 ****
   );
  
- %EXPORT_TAGS = ( );
- 
- # your exported package globals go here,
- # as well as any optionally exported functions
- 
- @EXPORT_OK   = qw($Var1 %Hashit);	# FIXME - These are never used
- 
  #
  #
--- 193,196 ----
***************
*** 232,236 ****
  =head2 &MARCaddsubfield($dbh,$bibid,$tagid,$indicator,$tagorder,$subfieldcode,$subfieldorder,$subfieldvalue);
        adds a subfield in a biblio (in the MARC tables only).
!      
  =head2 $MARCRecord = &MARCgetbiblio($dbh,$bibid);
        Returns a MARC::Record for the biblio $bibid.
--- 229,233 ----
  =head2 &MARCaddsubfield($dbh,$bibid,$tagid,$indicator,$tagorder,$subfieldcode,$subfieldorder,$subfieldvalue);
        adds a subfield in a biblio (in the MARC tables only).
! 
  =head2 $MARCRecord = &MARCgetbiblio($dbh,$bibid);
        Returns a MARC::Record for the biblio $bibid.
***************
*** 486,491 ****
      my ($tagorder) = $sth2->fetchrow_array();
  #---- TODO : the leader is missing
!     my $sth=$dbh->prepare("select bibid,subfieldid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue,valuebloblink 
! 		 		 from marc_subfield_table 
  		 		 where bibid=? and tagorder=? order by subfieldorder
  		 	 ");
--- 483,488 ----
      my ($tagorder) = $sth2->fetchrow_array();
  #---- TODO : the leader is missing
!     my $sth=$dbh->prepare("select bibid,subfieldid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue,valuebloblink
! 		 		 from marc_subfield_table
  		 		 where bibid=? and tagorder=? order by subfieldorder
  		 	 ");
***************
*** 566,570 ****
  # otherwise, skip through each subfield...
      my @fields = $record->fields();
! # search old MARC item 
      my $sth2 = $dbh->prepare("select tagorder from marc_subfield_table,marc_subfield_structure where marc_subfield_table.tag=marc_subfield_structure.tagfield and marc_subfield_table.subfieldcode=marc_subfield_structure.tagsubfield and bibid=? and kohafield='items.itemnumber' and subfieldvalue=?");
      $sth2->execute($bibid,$itemnumber);
--- 563,567 ----
  # otherwise, skip through each subfield...
      my @fields = $record->fields();
! # search old MARC item
      my $sth2 = $dbh->prepare("select tagorder from marc_subfield_table,marc_subfield_structure where marc_subfield_table.tag=marc_subfield_structure.tagfield and marc_subfield_table.subfieldcode=marc_subfield_structure.tagsubfield and bibid=? and kohafield='items.itemnumber' and subfieldvalue=?");
      $sth2->execute($bibid,$itemnumber);
***************
*** 668,672 ****
      my ($dbh,$bibid,$tag,$tagorder,$subfield,$subfieldorder) = @_;
      my $sth=$dbh->prepare("select subfieldid from marc_subfield_table
! 			where bibid=? and tag=? and tagorder=? 
  				and subfieldcode=? and subfieldorder=?");
      $sth->execute($bibid,$tag,$tagorder,$subfield,$subfieldorder);
--- 665,669 ----
      my ($dbh,$bibid,$tag,$tagorder,$subfield,$subfieldorder) = @_;
      my $sth=$dbh->prepare("select subfieldid from marc_subfield_table
! 			where bibid=? and tag=? and tagorder=?
  				and subfieldcode=? and subfieldorder=?");
      $sth->execute($bibid,$tag,$tagorder,$subfield,$subfieldorder);
***************
*** 679,683 ****
      my ($dbh,$bibid,$tag,$tagorder,$subfield,$subfieldorder) = @_;
      $dbh->do("delete from marc_subfield_table where bibid='$bibid' and
! 			tag='$tag' and tagorder='$tagorder' 
  			and subfieldcode='$subfield' and subfieldorder='$subfieldorder
  			");
--- 676,680 ----
      my ($dbh,$bibid,$tag,$tagorder,$subfield,$subfieldorder) = @_;
      $dbh->do("delete from marc_subfield_table where bibid='$bibid' and
! 			tag='$tag' and tagorder='$tagorder'
  			and subfieldcode='$subfield' and subfieldorder='$subfieldorder
  			");
***************
*** 698,703 ****
  #--- if bibid, then retrieve old-style koha data
      if ($biblionumber>0) {
! 	my $sth2=$dbh->prepare("select biblionumber,author,title,unititle,notes,abstract,serial,seriestitle,copyrightdate,timestamp 
! 		from biblio where biblionumber=?");		
  	$sth2->execute($biblionumber);
  	my $row=$sth2->fetchrow_hashref;
--- 695,700 ----
  #--- if bibid, then retrieve old-style koha data
      if ($biblionumber>0) {
! 	my $sth2=$dbh->prepare("select biblionumber,author,title,unititle,notes,abstract,serial,seriestitle,copyrightdate,timestamp
! 		from biblio where biblionumber=?");
  	$sth2->execute($biblionumber);
  	my $row=$sth2->fetchrow_hashref;
***************
*** 713,720 ****
  	my $sth2=$dbh->prepare(" SELECT biblioitemnumber,biblionumber,volume,number,classification,
  						itemtype,url,isbn,issn,dewey,subclass,publicationyear,publishercode,
! 						volumedate,volumeddesc,timestamp,illus,pages,notes,size,place 
  					FROM biblioitems
  					WHERE biblionumber=? and biblioitemnumber=?
! 					");		
  	$sth2->execute($biblionumber,$biblioitemnumber);
  	my $row=$sth2->fetchrow_hashref;
--- 710,717 ----
  	my $sth2=$dbh->prepare(" SELECT biblioitemnumber,biblionumber,volume,number,classification,
  						itemtype,url,isbn,issn,dewey,subclass,publicationyear,publishercode,
! 						volumedate,volumeddesc,timestamp,illus,pages,notes,size,place
  					FROM biblioitems
  					WHERE biblionumber=? and biblioitemnumber=?
! 					");
  	$sth2->execute($biblionumber,$biblioitemnumber);
  	my $row=$sth2->fetchrow_hashref;
***************
*** 742,746 ****
  						booksellerid,homebranch,price,replacementprice,replacementpricedate,datelastborrowed,
  						datelastseen,multivolume,stack,notforloan,itemlost,wthdrawn,bulk,issues,renewals,
! 					reserves,restricted,binding,itemnotes,holdingbranch,timestamp 
  					FROM items
  					WHERE itemnumber=?");
--- 739,743 ----
  						booksellerid,homebranch,price,replacementprice,replacementpricedate,datelastborrowed,
  						datelastseen,multivolume,stack,notforloan,itemlost,wthdrawn,bulk,issues,renewals,
! 					reserves,restricted,binding,itemnotes,holdingbranch,timestamp
  					FROM items
  					WHERE itemnumber=?");
***************
*** 814,818 ****
  	$result = &MARCmarc2kohaOneField($sth,"items",$field,$record,$result);
      }
! # additional authors : specific 
      $result = &MARCmarc2kohaOneField($sth,"additionalauthors","additionalauthors",$record,$result);
      return $result;
--- 811,815 ----
  	$result = &MARCmarc2kohaOneField($sth,"items",$field,$record,$result);
      }
! # additional authors : specific
      $result = &MARCmarc2kohaOneField($sth,"additionalauthors","additionalauthors",$record,$result);
      return $result;
***************
*** 876,880 ****
  #
  #
! # ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL 
  #
  #
--- 873,877 ----
  #
  #
! # ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL ALL
  #
  #
***************
*** 940,944 ****
  	die;
      }
!     my $newfield = MARC::Field->new( $tagfield1,'','', 
  				     "$tagsubfield1" => $oldbibnum,
  				     "$tagsubfield2" => $oldbibitemnum);
--- 937,941 ----
  	die;
      }
!     my $newfield = MARC::Field->new( $tagfield1,'','',
  				     "$tagsubfield1" => $oldbibnum,
  				     "$tagsubfield2" => $oldbibitemnum);
***************
*** 956,960 ****
      my $error;
      ($itemnumber,$error) = &OLDnewitems($dbh,$item,$item->{'barcode'});
! # search MARC biblionumber 
      my $bibid=&MARCfind_MARCbibid_from_oldbiblionumber($dbh,$item->{'biblionumber'});
  # calculate tagorder
--- 953,957 ----
      my $error;
      ($itemnumber,$error) = &OLDnewitems($dbh,$item,$item->{'barcode'});
! # search MARC biblionumber
      my $bibid=&MARCfind_MARCbibid_from_oldbiblionumber($dbh,$item->{'biblionumber'});
  # calculate tagorder
***************
*** 1004,1008 ****
    without the OLD. The OLDxxx is called by the original xxx sub.
    the 1.4 xxx sub also builds MARC::Record an calls the MARCxxx
!  
    WARNING : there is 1 difference between initialxxx and OLDxxx :
    the db header $dbh is always passed as parameter
--- 1001,1005 ----
    without the OLD. The OLDxxx is called by the original xxx sub.
    the 1.4 xxx sub also builds MARC::Record an calls the MARCxxx
! 
    WARNING : there is 1 difference between initialxxx and OLDxxx :
    the db header $dbh is always passed as parameter
***************
*** 1053,1057 ****
    deletes a biblioitem
    NOTE : not standard sub name. Should be OLDdelbiblioitem()
!  
  =head2 OLDdelbiblio($dbh,$biblio);
    delete a biblio
--- 1050,1054 ----
    deletes a biblioitem
    NOTE : not standard sub name. Should be OLDdelbiblioitem()
! 
  =head2 OLDdelbiblio($dbh,$biblio);
    delete a biblio
***************
*** 1105,1109 ****
      my $query;
      my $sth;
!     
      $biblio->{'title'}         = $dbh->quote($biblio->{'title'});
      $biblio->{'author'}        = $dbh->quote($biblio->{'author'});
--- 1102,1106 ----
      my $query;
      my $sth;
! 
      $biblio->{'title'}         = $dbh->quote($biblio->{'title'});
      $biblio->{'author'}        = $dbh->quote($biblio->{'author'});
***************
*** 1114,1118 ****
      $biblio->{'unititle'}      = $dbh->quote($biblio->{'unititle'});
      $biblio->{'notes'}         = $dbh->quote($biblio->{'notes'});
!     
      $query = "Update biblio set
  title         = $biblio->{'title'},
--- 1111,1115 ----
      $biblio->{'unititle'}      = $dbh->quote($biblio->{'unititle'});
      $biblio->{'notes'}         = $dbh->quote($biblio->{'notes'});
! 
      $query = "Update biblio set
  title         = $biblio->{'title'},
***************
*** 1126,1132 ****
  where biblionumber = $biblio->{'biblionumber'}";
      $sth   = $dbh->prepare($query);
!     
      $sth->execute;
!     
      $sth->finish;
      return($biblio->{'biblionumber'});
--- 1123,1129 ----
  where biblionumber = $biblio->{'biblionumber'}";
      $sth   = $dbh->prepare($query);
! 
      $sth->execute;
! 
      $sth->finish;
      return($biblio->{'biblionumber'});
***************
*** 1182,1186 ****
  	my $sth   = $dbh->prepare($query);
  	$sth->execute;
! 	
  	if (my $data = $sth->fetchrow_hashref) {
  	} else {
--- 1179,1183 ----
  	my $sth   = $dbh->prepare($query);
  	$sth->execute;
! 
  	if (my $data = $sth->fetchrow_hashref) {
  	} else {
***************
*** 1291,1295 ****
      my $data;
      my $bibitemnum;
!     
      $biblioitem->{'volume'}          = $dbh->quote($biblioitem->{'volume'});
      $biblioitem->{'number'} 	   = $dbh->quote($biblioitem->{'number'});
--- 1288,1292 ----
      my $data;
      my $bibitemnum;
! 
      $biblioitem->{'volume'}          = $dbh->quote($biblioitem->{'volume'});
      $biblioitem->{'number'} 	   = $dbh->quote($biblioitem->{'number'});
***************
*** 1312,1316 ****
      $biblioitem->{'lccn'}            = $dbh->quote($biblioitem->{'lccn'});
      $biblioitem->{'marc'}            = $dbh->quote($biblioitem->{'marc'});
!   
      $sth->execute;
      $data       = $sth->fetchrow_arrayref;
--- 1309,1313 ----
      $biblioitem->{'lccn'}            = $dbh->quote($biblioitem->{'lccn'});
      $biblioitem->{'marc'}            = $dbh->quote($biblioitem->{'marc'});
! 
      $sth->execute;
      $data       = $sth->fetchrow_arrayref;
***************
*** 1391,1395 ****
    $itemnumber = $data->{'max(itemnumber)'} + 1;
    $sth->finish;
!   
    $item->{'booksellerid'}     = $dbh->quote($item->{'booksellerid'});
    $item->{'homebranch'}       = $dbh->quote($item->{'homebranch'});
--- 1388,1392 ----
    $itemnumber = $data->{'max(itemnumber)'} + 1;
    $sth->finish;
! 
    $item->{'booksellerid'}     = $dbh->quote($item->{'booksellerid'});
    $item->{'homebranch'}       = $dbh->quote($item->{'homebranch'});
***************
*** 1445,1449 ****
                               homebranch='$item->{'homebranch'}',
                               itemlost='$item->{'lost'}',
!                              wthdrawn='$item->{'wthdrawn'}' 
                            where itemnumber=$item->{'itemnum'}";
    }
--- 1442,1446 ----
                               homebranch='$item->{'homebranch'}',
                               itemlost='$item->{'lost'}',
!                              wthdrawn='$item->{'wthdrawn'}'
                            where itemnumber=$item->{'itemnum'}";
    }
***************
*** 1493,1497 ****
  
      $sth->execute;
!   
      if (@results = $sth->fetchrow_array) {
          $query = "Insert into deletedbiblioitems values (";
--- 1490,1494 ----
  
      $sth->execute;
! 
      if (@results = $sth->fetchrow_array) {
          $query = "Insert into deletedbiblioitems values (";
***************
*** 1579,1584 ****
    my ($bi,$bib)=@_;
    my $dbh = C4::Context->dbh;
!   my $query="Select ordernumber 
!  	from aqorders 
   	where biblionumber=? and biblioitemnumber=?";
    my $sth=$dbh->prepare($query);
--- 1576,1581 ----
    my ($bi,$bib)=@_;
    my $dbh = C4::Context->dbh;
!   my $query="Select ordernumber
!  	from aqorders
   	where biblionumber=? and biblioitemnumber=?";
    my $sth=$dbh->prepare($query);
***************
*** 1596,1601 ****
    my ($ordnum)=@_;
    my $dbh = C4::Context->dbh;
!   my $query="Select * from biblio,biblioitems,aqorders,aqorderbreakdown 
!   where aqorders.ordernumber=? 
    and biblio.biblionumber=aqorders.biblionumber and
    biblioitems.biblioitemnumber=aqorders.biblioitemnumber and
--- 1593,1598 ----
    my ($ordnum)=@_;
    my $dbh = C4::Context->dbh;
!   my $query="Select * from biblio,biblioitems,aqorders,aqorderbreakdown
!   where aqorders.ordernumber=?
    and biblio.biblionumber=aqorders.biblionumber and
    biblioitems.biblioitemnumber=aqorders.biblioitemnumber and
***************
*** 1811,1815 ****
    my $count = 0;
    my @results;
!   
    $sth->execute;
      # || die "Cannot execute $query\n" . $sth->errstr;
--- 1808,1812 ----
    my $count = 0;
    my @results;
! 
    $sth->execute;
      # || die "Cannot execute $query\n" . $sth->errstr;
***************
*** 1818,1822 ****
      $count++;
    } # while
!   
    $sth->finish;
    return($count, @results);
--- 1815,1819 ----
      $count++;
    } # while
! 
    $sth->finish;
    return($count, @results);
***************
*** 1831,1835 ****
      my $count = 0;
      my @results;
!     
      $sth->execute;
        # || die "Cannot execute $query\n" . $sth->errstr;
--- 1828,1832 ----
      my $count = 0;
      my @results;
! 
      $sth->execute;
        # || die "Cannot execute $query\n" . $sth->errstr;
***************
*** 1838,1842 ****
        $count++;
      } # while
!     
      $sth->finish;
      return($count, @results);
--- 1835,1839 ----
        $count++;
      } # while
! 
      $sth->finish;
      return($count, @results);
***************
*** 1901,1905 ****
      my $count = 0;
      my @results;
!     
      $sth->execute;
        # || die "Cannot execute $query\n" . $sth->errstr;
--- 1898,1902 ----
      my $count = 0;
      my @results;
! 
      $sth->execute;
        # || die "Cannot execute $query\n" . $sth->errstr;
***************
*** 1908,1912 ****
        $count++;
      } # while
!     
      $sth->finish;
      return($count, @results);
--- 1905,1909 ----
        $count++;
      } # while
! 
      $sth->finish;
      return($count, @results);
***************
*** 1922,1926 ****
      my $sth;
      my @results;
!     
      $isbn  = $dbh->quote($isbn);
      $query = "Select biblio.* from biblio, biblioitems where
--- 1919,1923 ----
      my $sth;
      my @results;
! 
      $isbn  = $dbh->quote($isbn);
      $query = "Select biblio.* from biblio, biblioitems where
***************
*** 1928,1932 ****
  and isbn = $isbn";
      $sth   = $dbh->prepare($query);
!     
      $sth->execute;
      while (my $data = $sth->fetchrow_hashref) {
--- 1925,1929 ----
  and isbn = $isbn";
      $sth   = $dbh->prepare($query);
! 
      $sth->execute;
      while (my $data = $sth->fetchrow_hashref) {
***************
*** 1943,1947 ****
  # modification to work for additional authors, obviously.
  # Check for additional author changes
!     
  #    my $newadditionalauthor='';
  #    my $additionalauthors;
--- 1940,1944 ----
  # modification to work for additional authors, obviously.
  # Check for additional author changes
! 
  #    my $newadditionalauthor='';
  #    my $additionalauthors;
***************
*** 2031,2035 ****
  	$sth=$dbh->prepare("select biblionumber
  		from biblio
! 		where title=? and author=? 
  		  and copyrightdate=? and seriestitle=?");
  	$sth->execute(
--- 2028,2032 ----
  	$sth=$dbh->prepare("select biblionumber
  		from biblio
! 		where title=? and author=?
  		  and copyrightdate=? and seriestitle=?");
  	$sth->execute(
***************
*** 2450,2454 ****
      }
  
!     
  # Obtain a list of MARC Record_ID's that are tied to this biblio
      $sth=$dbh->prepare("select bibid from marc_subfield_table where tag='090' and subfieldvalue=$biblionumber and subfieldcode='c'");
--- 2447,2451 ----
      }
  
! 
  # Obtain a list of MARC Record_ID's that are tied to this biblio
      $sth=$dbh->prepare("select bibid from marc_subfield_table where tag='090' and subfieldvalue=$biblionumber and subfieldcode='c'");
***************
*** 2534,2538 ****
  
  # Check for subject heading changes
!     
      my $newsubject='';
      my $subjects;
--- 2531,2535 ----
  
  # Check for subject heading changes
! 
      my $newsubject='';
      my $subjects;
***************
*** 2741,2745 ****
      $sth->execute;
      my ($Subfield852_ID) = $sth->fetchrow;
!     
      if ($item->{'barcode'} ne $olditem->{'barcode'}) {
  	logchange('kohadb', 'change', 'items', 'barcode', $olditem->{'barcode'}, $item->{'barcode'});
--- 2738,2742 ----
      $sth->execute;
      my ($Subfield852_ID) = $sth->fetchrow;
! 
      if ($item->{'barcode'} ne $olditem->{'barcode'}) {
  	logchange('kohadb', 'change', 'items', 'barcode', $olditem->{'barcode'}, $item->{'barcode'});





More information about the Koha-cvs mailing list