From b22cda6be7115d31a4f146493b9c0fd621a984b5 Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Wed, 14 Jan 2009 13:26:51 +0100 Subject: [PATCH] (bug #2913) show "--" on repeated fields This patch just transform the script to set the field title as "--" if it was already shown. Signed-off-by: Henri-Damien LAURENT --- opac/opac-MARCdetail.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/opac/opac-MARCdetail.pl b/opac/opac-MARCdetail.pl index c6ddee4768..a372826042 100755 --- a/opac/opac-MARCdetail.pl +++ b/opac/opac-MARCdetail.pl @@ -127,7 +127,7 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { } else { my @subf = $fields[$x_i]->subfields; - + my $previous; # loop through each subfield for my $i ( 0 .. $#subf ) { $subf[$i][0] = "@" unless $subf[$i][0]; @@ -139,7 +139,10 @@ for ( my $tabloop = 0 ; $tabloop <= 10 ; $tabloop++ ) { if ( $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{hidden} > 0 ); my %subfield_data; $subfield_data{marc_lib} = - $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{lib}; + ($tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{lib} eq $previous) ? + '--' : + $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{lib}; + $previous = $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{lib}; $subfield_data{link} = $tagslib->{ $fields[$x_i]->tag() }->{ $subf[$i][0] }->{link}; $subf[$i][1] =~ s/\n//g; -- 2.39.5