[Koha-cvs] CVS: koha/acqui.simple addbiblio.pl,1.47,1.48

Paul POULAIN tipaul at users.sourceforge.net
Mon Oct 4 22:02:39 CEST 2004


Update of /cvsroot/koha/koha/acqui.simple
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18108/acqui.simple

Modified Files:
	addbiblio.pl 
Log Message:
(bugfix for previous commit, that was wrong)
when repeating a repeatable field, the new field is now :
* created AFTER the existing field(s)

This is more logic when adding subjects, from most to less important (or author, or anything else).

Index: addbiblio.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/addbiblio.pl,v
retrieving revision 1.47
retrieving revision 1.48
diff -C2 -r1.47 -r1.48
*** addbiblio.pl	30 Sep 2004 15:52:28 -0000	1.47
--- addbiblio.pl	4 Oct 2004 20:02:36 -0000	1.48
***************
*** 416,424 ****
  	my $started;
  	for (my $i=$#tags;$i>0;$i--) {
! 		$start=$i if ($start eq 0 && $tags[$i] == $addedfield);
! 		$end=$i if ($start>0 && $tags[$i] eq $addedfield);
! 		last if ($start>0 && $tags[$i] ne $addedfield);
  	}
! # 	warn "ST : $addedfield => $start / $end";
  	# add an empty line in all arrays. This forces a new field in MARC::Record.
  	splice(@tags,$end+1,0,'');
--- 416,424 ----
  	my $started;
  	for (my $i=$#tags;$i>0;$i--) {
! 		$end=$i if ($end eq 0 && $tags[$i] == $addedfield);
! 		$start=$i if ($end>0 && $tags[$i] eq $addedfield);
! 		last if ($end>0 && $tags[$i] ne $addedfield);
  	}
! 	warn "ST : $addedfield => $start / $end";
  	# add an empty line in all arrays. This forces a new field in MARC::Record.
  	splice(@tags,$end+1,0,'');
***************
*** 439,442 ****
--- 439,443 ----
  	}
  	my $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators);
+ 	warn "R=>".$record->as_formatted;
  	build_tabs ($template, $record, $dbh,$encoding);
  	build_hidden_data;





More information about the Koha-cvs mailing list