From 030fe0570f6ae2d0561756ee2168c1d3528af985 Mon Sep 17 00:00:00 2001 From: Maxime Pelletier Date: Tue, 4 Oct 2011 14:32:08 -0400 Subject: [PATCH] Bug 6972: Hardcoded template paths to en in showmarc Couldn't help but reformat the indentation a bit. Signed-off-by: Katrin Fischer Card view works correctly in cataloguing search. Plain view/labelled show correctly in OPAC. Signed-off-by: Chris Cormack Fixing merge conflict. --- catalogue/showmarc.pl | 18 +++++++----------- opac/opac-showmarc.pl | 9 +++++---- 2 files changed, 12 insertions(+), 15 deletions(-) diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index 5e03798d5c..97e7ed7240 100755 --- a/catalogue/showmarc.pl +++ b/catalogue/showmarc.pl @@ -2,8 +2,6 @@ # Koha library project www.koha-community.org -# Licensed under the GPL - # Copyright 2007 Liblime # Parts copyright 2010 BibLibre # @@ -66,11 +64,11 @@ if($importid) { $xmlrecord = $record->as_xml(); } } - -if($view eq 'card') { -$xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; -my $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/compact.xsl"; +if($view eq 'card') { + my $themelang = '/' . C4::Context->preference("opacthemes") . '/' . C4::Templates::_current_language(); + $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; +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); @@ -80,13 +78,11 @@ my $results = $stylesheet->transform($source); my $newxmlrecord = $stylesheet->output_string($results); $newxmlrecord=Encode::decode_utf8($newxmlrecord) unless utf8::is_utf8($newxmlrecord); #decode only if not in perl internal format print $input->header(-charset => 'UTF-8'), $newxmlrecord; - } else { + $record =GetMarcBiblio($biblionumber) unless $record; -$record =GetMarcBiblio($biblionumber) unless $record; - -my $formatted = $record->as_formatted; -$template->param( MARC_FORMATTED => $formatted ); + my $formatted = $record->as_formatted; + $template->param( MARC_FORMATTED => $formatted ); my $output= $template->output; $output=Encode::decode_utf8($output) unless utf8::is_utf8($output); diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl index 673069eec4..aec114b333 100755 --- a/opac/opac-showmarc.pl +++ b/opac/opac-showmarc.pl @@ -62,18 +62,19 @@ if ($importid) { $record = MARC::Record->new_from_usmarc($marc) ; if($view eq 'card') { $xmlrecord = $record->as_xml(); - } + } } - if ($view eq 'card' || $view eq 'html') { $xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; my $xslfile; + my $themelang = '/' . C4::Context->preference("opacthemes") . '/' . C4::Templates::_current_language(); + 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(); -- 2.39.5