[Koha-cvs] CVS: koha/C4 Biblio.pm,1.115.2.19,1.115.2.20

Henri-Damien LAURENT hdl at users.sourceforge.net
Thu Sep 1 15:43:36 CEST 2005


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11743

Modified Files:
      Tag: rel_2_2
	Biblio.pm 
Log Message:
Fixing a bug for marcimport.
Verifying that a record tag exists before getting its value


Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.19
retrieving revision 1.115.2.20
diff -C2 -r1.115.2.19 -r1.115.2.20
*** Biblio.pm	26 Aug 2005 12:28:57 -0000	1.115.2.19
--- Biblio.pm	1 Sep 2005 13:43:33 -0000	1.115.2.20
***************
*** 1080,1083 ****
--- 1080,1084 ----
  	my $field;
  	while (($field)=$sth2->fetchrow) {
+ # 		warn "biblio.".$field;
  		$result=&MARCmarc2kohaOneField($sth,"biblio",$field,$record,$result,$frameworkcode);
  	}
***************
*** 1086,1089 ****
--- 1087,1091 ----
  	while (($field)=$sth2->fetchrow) {
  		if ($field eq 'notes') { $field = 'bnotes'; }
+ # 		warn "biblioitems".$field;
  		$result=&MARCmarc2kohaOneField($sth,"biblioitems",$field,$record,$result,$frameworkcode);
  	}
***************
*** 1091,1094 ****
--- 1093,1097 ----
  	$sth2->execute;
  	while (($field)=$sth2->fetchrow) {
+ # 		warn "items".$field;
  		$result=&MARCmarc2kohaOneField($sth,"items",$field,$record,$result,$frameworkcode);
  	}
***************
*** 1130,1139 ****
      my $subfield;
      ( $tagfield, $subfield ) = MARCfind_marc_from_kohafield("",$kohatable.".".$kohafield,$frameworkcode);
!     foreach my $field ( $record->field($tagfield) ) {
  		if ($field->tag()<10) {
  			if ($result->{$kohafield}) {
! 				$result->{$kohafield} .= " | ".$field->data();
  			} else {
! 				$result->{$kohafield} = $field->data();
  			}
  		} else {
--- 1133,1143 ----
      my $subfield;
      ( $tagfield, $subfield ) = MARCfind_marc_from_kohafield("",$kohatable.".".$kohafield,$frameworkcode);
! 	if (($tagfield) && $record->field($tagfield)) {
! 		my $field =$record->field($tagfield);
  		if ($field->tag()<10) {
  			if ($result->{$kohafield}) {
! 				$result->{$kohafield} .= " | ".$field->data() ;
  			} else {
! 				$result->{$kohafield} = $field->data() ;
  			}
  		} else {
***************
*** 1143,1150 ****
  					if ($subfields[$subfieldcount][0] eq $subfield) {
  						if ( $result->{$kohafield} ) {
! 							$result->{$kohafield} .= " | " . $subfields[$subfieldcount][1];
  						}
  						else {
! 							$result->{$kohafield} = $subfields[$subfieldcount][1];
  						}
  					}
--- 1147,1154 ----
  					if ($subfields[$subfieldcount][0] eq $subfield) {
  						if ( $result->{$kohafield} ) {
! 							$result->{$kohafield} .= " | " . $subfields[$subfieldcount][1] if ($subfields[$subfieldcount][1]);
  						}
  						else {
! 							$result->{$kohafield} = $subfields[$subfieldcount][1] if ($subfields[$subfieldcount][1]);
  						}
  					}
***************
*** 1152,1156 ****
  			}
  		}
!     }
  # 	warn "OneField for $kohatable.$kohafield and $frameworkcode=> $tagfield, $subfield";
      return $result;
--- 1156,1160 ----
  			}
  		}
! 	}
  # 	warn "OneField for $kohatable.$kohafield and $frameworkcode=> $tagfield, $subfield";
      return $result;
***************
*** 1585,1589 ****
      #  my $dbh   = C4Connect;
      my $count = @subject;
!     my $error;
      for ( my $i = 0 ; $i < $count ; $i++ ) {
          $subject[$i] =~ s/^ //g;
--- 1589,1593 ----
      #  my $dbh   = C4Connect;
      my $count = @subject;
!     my $error="";
      for ( my $i = 0 ; $i < $count ; $i++ ) {
          $subject[$i] =~ s/^ //g;
***************
*** 1627,1631 ****
          $sth->finish;
      }    # else
!     if ( $error eq '' ) {
          my $sth =
            $dbh->prepare("Delete from bibliosubject where biblionumber = ?");
--- 1631,1635 ----
          $sth->finish;
      }    # else
!     if ($error eq '') {
          my $sth =
            $dbh->prepare("Delete from bibliosubject where biblionumber = ?");
***************
*** 1779,1784 ****
  
      $sth->execute;
!     $data       = $sth->fetchrow_hashref;
!     $itemnumber = $data->{'max(itemnumber)'} + 1;
      $sth->finish;
  
--- 1783,1788 ----
  
      $sth->execute;
!     my ($maxitemnumber)= $sth->fetchrow;
!     $itemnumber = $maxitemnumber + 1;
      $sth->finish;
  
***************
*** 2742,2745 ****
--- 2746,2753 ----
  # $Id$
  # $Log$
+ # Revision 1.115.2.20  2005/09/01 13:43:33  hdl
+ # Fixing a bug for marcimport.
+ # Verifying that a record tag exists before getting its value
+ #
  # Revision 1.115.2.19  2005/08/26 12:28:57  hdl
  # Adding a test on a temporary value before processing it in Biblio.pm





More information about the Koha-cvs mailing list