From 0eee40410ec67f8734c3a6cc12d409de69789667 Mon Sep 17 00:00:00 2001 From: Maxime Pelletier Date: Tue, 4 Oct 2011 14:32:08 -0400 Subject: [PATCH] Fix to use the good themelang instead of the hardcoded one in showmarc --- catalogue/showmarc.pl | 8 ++++++-- opac/opac-showmarc.pl | 7 +++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index bd557e9..7a69c8d 100755 --- a/catalogue/showmarc.pl +++ b/catalogue/showmarc.pl @@ -63,11 +63,15 @@ if($importid) { $xmlrecord = $record->as_xml(); } } - + if($view eq 'card') { + +my $themelang = $template->param('themelang'); +$themelang =~ s/^\/intranet-tmpl//; + $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; -my $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/compact.xsl"; +my $xslfile = C4::Context->config('intrahtdocs').$themelang."/xslt/compact.xsl"; my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); my $source = $parser->parse_string($xmlrecord); diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index 4475512..c3c6bf8 100755 --- a/opac/opac-showmarc.pl +++ b/opac/opac-showmarc.pl @@ -66,11 +66,14 @@ if ($importid) { if ($view eq 'card' || $view eq 'html') { $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; my $xslfile; + my $themelang = $template->param('themelang'); + $themelang =~ s/^\/opac-tmpl//; + if ($view eq 'card'){ - $xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/compact.xsl"; + $xslfile = C4::Context->config('opachtdocs').$themelang."/xslt/compact.xsl"; } else { # must be html - $xslfile = C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACMARCdetail.xsl"; + $xslfile = C4::Context->config('opachtdocs').$themelang."/xslt/MARC21slim2OPACMARCdetail.xsl"; } my $parser = XML::LibXML->new(); my $xslt = XML::LibXSLT->new(); -- 1.5.6.5