koha-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Koha-cvs] CVS: koha/acqui.simple addbiblio.pl,1.52.2.5,1.52.2.6


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/acqui.simple addbiblio.pl,1.52.2.5,1.52.2.6
Date: Thu, 19 May 2005 15:17:35 -0700

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

Modified Files:
      Tag: rel_2_2
        addbiblio.pl 
Log Message:
bugfix in authority reporting & field duplicating

Index: addbiblio.pl
===================================================================
RCS file: /cvsroot/koha/koha/acqui.simple/addbiblio.pl,v
retrieving revision 1.52.2.5
retrieving revision 1.52.2.6
diff -C2 -r1.52.2.5 -r1.52.2.6
*** addbiblio.pl        25 Mar 2005 12:52:42 -0000      1.52.2.5
--- addbiblio.pl        19 May 2005 22:17:33 -0000      1.52.2.6
***************
*** 264,268 ****
                                        }
  # If there is more than 1 field, add an empty hidden field as separator.
!                                       if ($#fields >1) {
                                                my @subfields_data;
                                                my %tag_data;
--- 264,268 ----
                                        }
  # If there is more than 1 field, add an empty hidden field as separator.
!                                       if ($#fields >=1) {
                                                my @subfields_data;
                                                my %tag_data;
***************
*** 435,468 ****
        my @ind_tag = $input->param('ind_tag');
        my @indicator = $input->param('indicator');
-       splice(@tags,$addedfield,0,$tags[$addedfield]);
-       splice(@subfields,$addedfield,0,$subfields[$addedfield]);
-       splice(@values,$addedfield,0,$values[$addedfield]);
-       splice(@ind_tag,$addedfield,0,$ind_tag[$addedfield]);
-       my %indicators;
-       for (my $i=0;$i<=$#ind_tag;$i++) {
-               $indicators{$ind_tag[$i]} = $indicator[$i];
-       }
- # search the part of the array to duplicate.
-       my $start=0;
-       my $end=0;
-       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);
-       }
-       # 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,'');
-       splice(@values,$end+1,0,'');
-       splice(@ind_tag,$end+1,0,'');
-       splice(@indicator,$end+1,0,'');
- # then duplicate the field.
-       splice(@tags,$end+2,0,@tags[$start..$end]);
-       splice(@subfields,$end+2,0,@subfields[$start..$end]);
-       splice(@values,$end+2,0,@values[$start..$end]);
-       splice(@ind_tag,$end+2,0,@ind_tag[$start..$end]);
-       splice(@indicator,$end+2,0,@indicator[$start..$end]);
- 
        my %indicators;
        for (my $i=0;$i<=$#ind_tag;$i++) {
--- 435,438 ----
***************
*** 470,473 ****
--- 440,446 ----
        }
        my $record = 
MARChtml2marc($dbh,address@hidden,address@hidden,address@hidden,%indicators);
+       # adding an empty field
+       my $field = MARC::Field->new("$addedfield",'','','a'=> "");
+       $record->append_fields($field);
        build_tabs ($template, $record, $dbh,$encoding);
        build_hidden_data;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]