add the possibility to replace, in sysprefs, the code by it's valuecode with {{code...
authorNahuel Angelinetti <nahuel.angelinetti@biblibre.com>
Mon, 13 Oct 2008 09:11:41 +0000 (11:11 +0200)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Fri, 6 Mar 2009 09:47:30 +0000 (10:47 +0100)
Signed-off-by: Henri-Damien LAURENT <henridamien.laurent@biblibre.com>
opac/opac-ISBDdetail.pl

index bb3b570..2a57604 100755 (executable)
@@ -170,23 +170,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;