koha-cvs
[Top][All Lists]
Advanced

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

[Koha-cvs] CVS: koha/authorities authorities.pl,1.8.2.1,1.8.2.2


From: Paul POULAIN
Subject: [Koha-cvs] CVS: koha/authorities authorities.pl,1.8.2.1,1.8.2.2
Date: Mon, 30 May 2005 04:26:44 -0700

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

Modified Files:
      Tag: rel_2_2
        authorities.pl 
Log Message:
fixing a bug in repeatable fields + minor improvements.

Index: authorities.pl
===================================================================
RCS file: /cvsroot/koha/koha/authorities/authorities.pl,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -C2 -r1.8.2.1 -r1.8.2.2
*** authorities.pl      28 Apr 2005 08:45:33 -0000      1.8.2.1
--- authorities.pl      30 May 2005 11:26:40 -0000      1.8.2.2
***************
*** 240,243 ****
--- 240,244 ----
                                $tag_data{tag} = $tag;
                                $tag_data{tag_lib} = $tagslib->{$tag}->{lib};
+                               $tag_data{repeatable} = 
$tagslib->{$tag}->{repeatable};
                                $tag_data{indicator} = $indicator;
                                $tag_data{subfield_loop} = address@hidden;
***************
*** 366,404 ****
        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=0;$i<=$#tags;$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);
!       }
! # 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++) {
-               $indicators{$ind_tag[$i]} = $indicator[$i];
-       }
-       my $record = 
MARChtml2marc($dbh,address@hidden,address@hidden,address@hidden,%indicators);
        build_tabs ($template, $record, $dbh,$encoding);
        build_hidden_data;
--- 367,378 ----
        my @ind_tag = $input->param('ind_tag');
        my @indicator = $input->param('indicator');
        my %indicators;
        for (my $i=0;$i<=$#ind_tag;$i++) {
                $indicators{$ind_tag[$i]} = $indicator[$i];
        }
!       my $record = 
AUTHhtml2marc($dbh,address@hidden,address@hidden,address@hidden,%indicators);
!       my $field = MARC::Field->new("$addedfield",'','','a'=> "");
!       $record->append_fields($field);
  
        build_tabs ($template, $record, $dbh,$encoding);
        build_hidden_data;
***************
*** 415,419 ****
  }
  
! if ($authid) {
        build_tabs ($template, $record, $dbh,$encoding);
        build_hidden_data;
--- 389,394 ----
  }
  
! unless ($op) {
! #     warn "BUILDING";
        build_tabs ($template, $record, $dbh,$encoding);
        build_hidden_data;




reply via email to

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