From b591d6b641dd0c86a59ec80480baa54fe1404736 Mon Sep 17 00:00:00 2001 From: Pongtawat C Date: Wed, 22 Feb 2017 23:26:46 +0700 Subject: [PATCH] Bug 3116 - Add 'all' option in ISBD template to show all subfields in order Sponsored-by: Thammasat University --- C4/Biblio.pm | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 6d64e80..525e9f0 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -996,6 +996,30 @@ sub GetISBDView { } } $blocres .= $textafter if $hasputtextbefore; + } elsif ( $analysestring =~ /^all(.*)/ ) { + my $sep = $1 || " "; + + foreach my $field (@fieldslist) { + my $calculated = "\n"; + my $tag = $field->tag(); + my @subf = $field->subfields; + for my $i ( 0 .. $#subf ) { + my $valuecode = $subf[$i][1]; + my $subfieldcode = $subf[$i][0]; + my $subfieldvalue = GetAuthorisedValueDesc( $tag, $subf[$i][0], $subf[$i][1], '', $tagslib ); + $calculated .= $subfieldvalue . $sep unless $subfieldcode == "9" + } + $calculated =~ s/$sep$//g; + + # field builded, store the result + if ( $calculated && !$hasputtextbefore ) { # put textbefore if not done + $blocres .= $textbefore; + $hasputtextbefore = 1; + } + + $blocres .= $calculated; + } + $blocres .= $textafter if $hasputtextbefore; } else { foreach my $field (@fieldslist) { my $calculated = $analysestring; -- 2.1.4