From 691aec77b089fca8582eb32936ae45d0083bfb34 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 4 Oct 2004 20:02:36 +0000 Subject: [PATCH] (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). --- acqui.simple/addbiblio.pl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index 51f335e066..79d7a5318b 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -415,11 +415,11 @@ if ($op eq "addbiblio") { my $end=0; 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); + $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"; + 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,''); splice(@subfields,$end+1,0,''); @@ -438,6 +438,7 @@ if ($op eq "addbiblio") { $indicators{$ind_tag[$i]} = $indicator[$i]; } my $record = MARChtml2marc($dbh,\@tags,\@subfields,\@values,%indicators); + warn "R=>".$record->as_formatted; build_tabs ($template, $record, $dbh,$encoding); build_hidden_data; $template->param( -- 2.39.5