From 13763623e763aa7ecede7475a6aae28f25698a35 Mon Sep 17 00:00:00 2001 From: Nahuel Angelinetti Date: Fri, 6 Mar 2009 11:37:48 +0100 Subject: [PATCH] add the possibility to replace, in sysprefs, the code by it's valuecode with {{code}} ex : {{995c}} Signed-off-by: Henri-Damien LAURENT Signed-off-by: Galen Charlton --- opac/opac-ISBDdetail.pl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/opac/opac-ISBDdetail.pl b/opac/opac-ISBDdetail.pl index 463efb896d..e679ed8ffc 100755 --- a/opac/opac-ISBDdetail.pl +++ b/opac/opac-ISBDdetail.pl @@ -189,23 +189,31 @@ foreach my $isbdfield ( split /#/, $bloc ) { else { 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 ); my $tagsubf = $tag . $subfieldcode; + + $calculated =~ s/ # replace all {{}} codes by the value code. + \{\{$tagsubf\}\} # catch the {{actualcode}} + / + $valuecode # replace by the value code + /gx; + $calculated =~ s/\{(.?.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue$2\{$1$tagsubf$2\}/g; $calculated =~s#/cgi-bin/koha/[^/]+/([^.]*.pl\?.*)$#opac-$1#g; } - + # field builded, store the result if ( $calculated && !$hasputtextbefore ) { # put textbefore if not done $blocres .= $textbefore; $hasputtextbefore = 1; } - + # remove punctuation at start $calculated =~ s/^( |;|:|\.|-)*//g; $blocres .= $calculated; -- 2.20.1