Bugzilla – Attachment 5778 Details for
Bug 6972
Hardcoded template paths to en in showmarc
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Working patch.
0001-Fix-to-use-the-good-themelang-instead-of-the-hardcod.patch (text/plain), 3.44 KB, created by
Maxime Pelletier
on 2011-10-07 15:49:48 UTC
(
hide
)
Description:
Working patch.
Filename:
MIME Type:
Creator:
Maxime Pelletier
Created:
2011-10-07 15:49:48 UTC
Size:
3.44 KB
patch
obsolete
>From f3e00f6829ad9b29b143e595781fdf4bd43021dd Mon Sep 17 00:00:00 2001 >From: Maxime Pelletier <maxime.pelletier@libeo.com> >Date: Tue, 4 Oct 2011 14:32:08 -0400 >Subject: [PATCH] Proper working patch > >Couldn't help but reformat the indentation a bit. >--- > catalogue/showmarc.pl | 38 +++++++++++++++++++------------------- > opac/opac-showmarc.pl | 9 +++++---- > 2 files changed, 24 insertions(+), 23 deletions(-) > >diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl >index bd557e9..8c59bb2 100755 >--- a/catalogue/showmarc.pl >+++ b/catalogue/showmarc.pl >@@ -63,29 +63,29 @@ if($importid) { > $xmlrecord = $record->as_xml(); > } > } >- >+ > if($view eq 'card') { >-$xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; >+ my $themelang = '/' . C4::Context->preference("opacthemes") . '/' . C4::Templates::_current_language(); > >-my $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/compact.xsl"; >-my $parser = XML::LibXML->new(); >-my $xslt = XML::LibXSLT->new(); >-my $source = $parser->parse_string($xmlrecord); >-my $style_doc = $parser->parse_file($xslfile); >-my $stylesheet = $xslt->parse_stylesheet($style_doc); >-my $results = $stylesheet->transform($source); >-my $newxmlrecord = $stylesheet->output_string($results); >-#warn $newxmlrecord; >-print "Content-type: text/html\n\n"; >-utf8::encode($newxmlrecord); >-print $newxmlrecord; >+ $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); >+ my $style_doc = $parser->parse_file($xslfile); >+ my $stylesheet = $xslt->parse_stylesheet($style_doc); >+ my $results = $stylesheet->transform($source); >+ my $newxmlrecord = $stylesheet->output_string($results); >+ #warn $newxmlrecord; >+ print "Content-type: text/html\n\n"; >+ utf8::encode($newxmlrecord); >+ print $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 ); > >-output_html_with_http_headers $input, $cookie, $template->output; >+ output_html_with_http_headers $input, $cookie, $template->output; > } >diff --git a/opac/opac-showmarc.pl b/opac/opac-showmarc.pl >index 4475512..3b9a0ac 100755 >--- a/opac/opac-showmarc.pl >+++ b/opac/opac-showmarc.pl >@@ -59,18 +59,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(); >-- >1.5.6.5 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 6972
:
5708
|
5778
|
5867