(bug #3726) fix ISBD url translation
[koha.git] / C4 / Biblio.pm
index c7645e2..5e5825e 100755 (executable)
@@ -742,7 +742,7 @@ Return the ISBD view which can be included in opac and intranet
 =cut
 
 sub GetISBDView {
-    my $biblionumber    = shift;
+    my ($biblionumber, $template) = @_;
     my $record          = GetMarcBiblio($biblionumber);
     my $itemtype        = &GetFrameworkCode($biblionumber);
     my ($holdingbrtagf,$holdingbrtagsubf) = &GetMarcFromKohaField("items.holdingbranch",$itemtype);
@@ -786,7 +786,7 @@ sub GetISBDView {
                     my $tagsubf = $tag . $subfvalue;
                     $calculated =~
                           s/\{(.?.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue$2\{$1$tagsubf$2\}/g;
-                    $calculated =~s#/cgi-bin/koha/[^/]+/([^.]*.pl\?.*)$#opac-$1#g;
+                    $calculated =~s#/cgi-bin/koha/[^/]+/([^.]*.pl\?.*)$#opac-$1#g if ($template eq "opac");
                 
                     # field builded, store the result
                     if ( $calculated && !$hasputtextbefore )
@@ -827,7 +827,7 @@ sub GetISBDView {
     
                 $calculated =~
             s/\{(.?.?.?.?)$tagsubf(.*?)\}/$1$subfieldvalue$2\{$1$tagsubf$2\}/g;
-            $calculated =~s#/cgi-bin/koha/[^/]+/([^.]*.pl\?.*)$#opac-$1#g;
+            $calculated =~s#/cgi-bin/koha/[^/]+/([^.]*.pl\?.*)$#opac-$1#g if ($template eq "opac");
                 }
     
                 # field builded, store the result