[Koha-cvs] CVS: koha/C4 Biblio.pm,1.40,1.41 Output.pm,1.40,1.41 Reserves2.pm,1.27,1.28 SearchMarc.pm,1.2,1.3

Paul POULAIN tipaul at users.sourceforge.net
Tue Apr 1 14:26:45 CEST 2003


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

Modified Files:
	Biblio.pm Output.pm Reserves2.pm SearchMarc.pm 
Log Message:
fixes

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** Biblio.pm	11 Mar 2003 15:14:03 -0000	1.40
--- Biblio.pm	1 Apr 2003 12:26:43 -0000	1.41
***************
*** 2,5 ****
--- 2,8 ----
  # $Id$
  # $Log$
+ # Revision 1.41  2003/04/01 12:26:43  tipaul
+ # fixes
+ #
  # Revision 1.40  2003/03/11 15:14:03  tipaul
  # pod updating
***************
*** 572,576 ****
  		$sth->execute($bibid,(sprintf "%03s",$tagid),$tagorder,$tag_indicator,$subfieldcode,$subfieldorder,$res);
  		if ($sth->errstr) {
! 		print STDERR "ERROR ==> insert into marc_subfield_table (bibid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue) values ($bibid,$tagid,$tagorder,$tag_indicator,$subfieldcode,$subfieldorder,$subfieldvalue)\n";
  		}
  #	$dbh->do("unlock tables");
--- 575,579 ----
  		$sth->execute($bibid,(sprintf "%03s",$tagid),$tagorder,$tag_indicator,$subfieldcode,$subfieldorder,$res);
  		if ($sth->errstr) {
! 		warn "ERROR ==> insert into marc_subfield_table (bibid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue) values ($bibid,$tagid,$tagorder,$tag_indicator,$subfieldcode,$subfieldorder,$subfieldvalue)\n";
  		}
  #	$dbh->do("unlock tables");
***************
*** 579,583 ****
  		$sth->execute($bibid,(sprintf "%03s",$tagid),$tagorder,$tag_indicator,$subfieldcode,$subfieldorder,$subfieldvalue);
  		if ($sth->errstr) {
! 		print STDERR "ERROR ==> insert into marc_subfield_table (bibid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue) values ($bibid,$tagid,$tagorder,$tag_indicator,$subfieldcode,$subfieldorder,$subfieldvalue)\n";
  		}
      }
--- 582,586 ----
  		$sth->execute($bibid,(sprintf "%03s",$tagid),$tagorder,$tag_indicator,$subfieldcode,$subfieldorder,$subfieldvalue);
  		if ($sth->errstr) {
! 		warn "ERROR ==> insert into marc_subfield_table (bibid,tag,tagorder,tag_indicator,subfieldcode,subfieldorder,subfieldvalue) values ($bibid,$tagid,$tagorder,$tag_indicator,$subfieldcode,$subfieldorder,$subfieldvalue)\n";
  		}
      }
***************
*** 692,695 ****
--- 695,700 ----
  		return;
  	}
+ #	warn "rec : ".$record->as_formatted;
+ #	die;
  	# otherwise, skip through each subfield...
  	my @fields = $record->fields();
***************
*** 719,722 ****
--- 724,728 ----
  					if ($oldfield->subfield(@$subfield[0]) ne @$subfield[1] ) {
  						my $subfieldid=&MARCfindsubfieldid($dbh,$bibid,$field->tag(),$tagorder,@$subfield[0],$subfieldorder);
+ 						warn "subfieldid => $subfieldid";
  						&MARCmodsubfield($dbh,$subfieldid,@$subfield[1]);
  					}
***************
*** 970,1002 ****
  sub MARChtml2marc {
  	my ($dbh,$rtags,$rsubfields,$rvalues,%indicators) = @_;
! 	my $prevtag = @$rtags[0];
  	my $record = MARC::Record->new();
! 	my %subfieldlist={};
  	for (my $i=0; $i< @$rtags; $i++) {
  		# rebuild MARC::Record
  		if (@$rtags[$i] ne $prevtag) {
- #			if ($prevtag<10) {
- #				$prevtag='0'.10;
- #			}
- 			$indicators{$prevtag}.='  ';
  			if ($prevtag < 10) {
  				$record->add_fields((sprintf "%03s",$prevtag),%subfieldlist->{'@'});
  			} else {
- 				my $field = MARC::Field->new( (sprintf "%03s",$prevtag), substr($indicators{$prevtag},0,1),substr($indicators{$prevtag},1,1), %subfieldlist);
  				$record->add_fields($field);
  			}
  			$prevtag = @$rtags[$i];
- 			%subfieldlist={};
- 			%subfieldlist->{@$rsubfields[$i]} = @$rvalues[$i];
  		} else {
! 			if (%subfieldlist->{@$rsubfields[$i]}) {
! 				%subfieldlist->{@$rsubfields[$i]} .= '|';
! 			}
! 			%subfieldlist->{@$rsubfields[$i]} .=@$rvalues[$i];
  			$prevtag= @$rtags[$i];
  		}
  	}
  	# the last has not been included inside the loop... do it now !
- 	my $field = MARC::Field->new( $prevtag, "", "", %subfieldlist);
  	$record->add_fields($field);
  	return $record;
--- 976,1000 ----
  sub MARChtml2marc {
  	my ($dbh,$rtags,$rsubfields,$rvalues,%indicators) = @_;
! 	my $prevtag = -1;
  	my $record = MARC::Record->new();
! 	my %subfieldlist=();
! 	my $field;
  	for (my $i=0; $i< @$rtags; $i++) {
  		# rebuild MARC::Record
  		if (@$rtags[$i] ne $prevtag) {
  			if ($prevtag < 10) {
  				$record->add_fields((sprintf "%03s",$prevtag),%subfieldlist->{'@'});
  			} else {
  				$record->add_fields($field);
  			}
+ 			$indicators{@$rtags[$i]}.='  ';
+ 			$field = MARC::Field->new( (sprintf "%03s",@$rtags[$i]), substr($indicators{@$rtags[$i]},0,1),substr($indicators{@$rtags[$i]},1,1), @$rsubfields[$i] => @$rvalues[$i]);
  			$prevtag = @$rtags[$i];
  		} else {
! 			$field->add_subfields(@$rsubfields[$i] => @$rvalues[$i]);
  			$prevtag= @$rtags[$i];
  		}
  	}
  	# the last has not been included inside the loop... do it now !
  	$record->add_fields($field);
  	return $record;
***************
*** 1064,1068 ****
  	    $sth->execute($bibid,$tag,$tagorder,$subfieldid,$subfieldorder,$word,$word);
  	    if ($sth->err()) {
! 		print STDERR "ERROR ==> insert into marc_word (bibid, tag, tagorder, subfieldid, subfieldorder, word, sndx_word) values ($bibid,$tag,$tagorder,$subfieldid,$subfieldorder,$word,soundex($word))\n";
  	    }
  	}
--- 1062,1066 ----
  	    $sth->execute($bibid,$tag,$tagorder,$subfieldid,$subfieldorder,$word,$word);
  	    if ($sth->err()) {
! 		warn "ERROR ==> insert into marc_word (bibid, tag, tagorder, subfieldid, subfieldorder, word, sndx_word) values ($bibid,$tag,$tagorder,$subfieldid,$subfieldorder,$word,soundex($word))\n";
  	    }
  	}
***************
*** 1131,1135 ****
      (my $tagfield2, my $tagsubfield2) = $sth->fetchrow;
      if ($tagfield1 != $tagfield2) {
! 	print STDERR "Error in NEWnewbiblio : biblio.biblionumber and biblioitems.biblioitemnumber MUST have the same field number";
   	print "Content-Type: text/html\n\nError in NEWnewbiblio : biblio.biblionumber and biblioitems.biblioitemnumber MUST have the same field number";
  	die;
--- 1129,1133 ----
      (my $tagfield2, my $tagsubfield2) = $sth->fetchrow;
      if ($tagfield1 != $tagfield2) {
! 	warn "Error in NEWnewbiblio : biblio.biblionumber and biblioitems.biblioitemnumber MUST have the same field number";
   	print "Content-Type: text/html\n\nError in NEWnewbiblio : biblio.biblionumber and biblioitems.biblioitemnumber MUST have the same field number";
  	die;

Index: Output.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Output.pm,v
retrieving revision 1.40
retrieving revision 1.41
diff -C2 -r1.40 -r1.41
*** Output.pm	4 Mar 2003 17:49:50 -0000	1.40
--- Output.pm	1 Apr 2003 12:26:43 -0000	1.41
***************
*** 121,128 ****
    foreach my $th (@themes) {
      foreach my $la (@languages) {
! #	warn "File = $htdocs/$th/$la/$tmpl\n";
  	if (-e "$htdocs/$th/$la/$tmpl") {
  	    $theme = $th;
  	    $lang = $la;
  	    last THEME;
  	}
--- 121,129 ----
    foreach my $th (@themes) {
      foreach my $la (@languages) {
! 	warn "File = $htdocs/$th/$la/$tmpl\n";
  	if (-e "$htdocs/$th/$la/$tmpl") {
  	    $theme = $th;
  	    $lang = $la;
+ 	    warn "FOUND";
  	    last THEME;
  	}

Index: Reserves2.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Reserves2.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** Reserves2.pm	6 Feb 2003 07:41:28 -0000	1.27
--- Reserves2.pm	1 Apr 2003 12:26:43 -0000	1.28
***************
*** 794,798 ****
   my $data=$sth->fetchrow_hashref;
   $sth->finish;
- # print $query;
   return($data);
  }
--- 794,797 ----

Index: SearchMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/SearchMarc.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** SearchMarc.pm	7 Mar 2003 16:35:44 -0000	1.2
--- SearchMarc.pm	1 Apr 2003 12:26:43 -0000	1.3
***************
*** 57,61 ****
  # marcsearch : search in the MARC biblio table.
  # everything is choosen by the user : what to search, the conditions...
- # FIXME this is a 1st version of the Marc Search. It does not use fulltext searching or marc_words table
  
  sub catalogsearch {
--- 57,60 ----
***************
*** 128,132 ****
  	}
  	chop $sql_tables;
- 	warn "select m1.bibid from $sql_tables where $sql_where2 and ($sql_where1)";
  	my $sth;
  	if ($sql_where2) {
--- 127,130 ----





More information about the Koha-cvs mailing list