Bugzilla – Attachment 50474 Details for
Bug 15263
XSLT display fetches sysprefs for every result processed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15263: (QA followup) Use the new XSLTParse4Display everywhere
Bug-15263-QA-followup-Use-the-new-XSLTParse4Displa.patch (text/plain), 4.28 KB, created by
Tomás Cohen Arazi (tcohen)
on 2016-04-20 18:09:45 UTC
(
hide
)
Description:
Bug 15263: (QA followup) Use the new XSLTParse4Display everywhere
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2016-04-20 18:09:45 UTC
Size:
4.28 KB
patch
obsolete
>From f163e7a3340add15649c0c506744ad673c8fa33e Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Wed, 20 Apr 2016 14:44:27 -0300 >Subject: [PATCH] Bug 15263: (QA followup) Use the new XSLTParse4Display > everywhere > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > catalogue/detail.pl | 18 +++++++++++++----- > opac/opac-detail.pl | 16 ++++++++++++---- > opac/opac-tags.pl | 17 +++++++++++++---- > 3 files changed, 38 insertions(+), 13 deletions(-) > >diff --git a/catalogue/detail.pl b/catalogue/detail.pl >index 23d6d04..ddac3e9 100755 >--- a/catalogue/detail.pl >+++ b/catalogue/detail.pl >@@ -16,8 +16,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > >-use strict; >-use warnings; >+use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Acquisition qw( GetHistory ); >@@ -84,9 +83,18 @@ my $showallitems = $query->param('showallitems'); > my $marcflavour = C4::Context->preference("marcflavour"); > > # XSLT processing of some stuff >-if (C4::Context->preference("XSLTDetailsDisplay") ) { >- $template->param('XSLTDetailsDisplay' =>'1', >- 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, "XSLTDetailsDisplay") ); >+my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay'); >+my $lang = $xslfile ? C4::Languages::getlanguage() : undef; >+my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; >+ >+if ( $xslfile ) { >+ $template->param( >+ XSLTDetailsDisplay => '1', >+ XSLTBloc => XSLTParse4Display( >+ $biblionumber, $record, "XSLTDetailsDisplay", >+ 1, undef, $sysxml, $xslfile, $lang >+ ) >+ ); > } > > $template->param( 'SpineLabelShowPrintOnBibDetails' => C4::Context->preference("SpineLabelShowPrintOnBibDetails") ); >diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl >index 6d71bed..94e3348 100755 >--- a/opac/opac-detail.pl >+++ b/opac/opac-detail.pl >@@ -20,8 +20,7 @@ > # along with Koha; if not, see <http://www.gnu.org/licenses>. > > >-use strict; >-use warnings; >+use Modern::Perl; > > use CGI qw ( -utf8 ); > use C4::Acquisition qw( SearchOrders ); >@@ -141,8 +140,17 @@ my $marcflavour = C4::Context->preference("marcflavour"); > my $ean = GetNormalizedEAN( $record, $marcflavour ); > > # XSLT processing of some stuff >-if (C4::Context->preference("OPACXSLTDetailsDisplay") ) { >- $template->param( 'XSLTBloc' => XSLTParse4Display($biblionumber, $record, "OPACXSLTDetailsDisplay" ) ); >+my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay'); >+my $lang = $xslfile ? C4::Languages::getlanguage() : undef; >+my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; >+ >+if ( $xslfile ) { >+ $template->param( >+ XSLTBloc => XSLTParse4Display( >+ $biblionumber, $record, "OPACXSLTDetailsDisplay", >+ 1, undef, $sysxml, $xslfile, $lang >+ ) >+ ); > } > > my $OpacBrowseResults = C4::Context->preference("OpacBrowseResults"); >diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl >index e7f892c..665d6b6 100755 >--- a/opac/opac-tags.pl >+++ b/opac/opac-tags.pl >@@ -30,8 +30,8 @@ C4::Scrubber is used to remove all markup content from the sumitted text. > > =cut > >-use strict; >-use warnings; >+use Modern::Perl; >+ > use CGI qw ( -utf8 ); > use CGI::Cookie; # need to check cookies before having CGI parse the POST request > >@@ -234,9 +234,18 @@ if ($loggedinuser) { > $tag->{subtitle} = GetRecordValue( 'subtitle', $record, GetFrameworkCode( $tag->{biblionumber} ) ); > $tag->{title} = $biblio->{title}; > $tag->{author} = $biblio->{author}; >- if (C4::Context->preference("OPACXSLTResultsDisplay")) { >- $tag->{XSLTBloc} = XSLTParse4Display($tag->{biblionumber}, $record, "OPACXSLTResultsDisplay"); >+ >+ my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay'); >+ my $lang = $xslfile ? C4::Languages::getlanguage() : undef; >+ my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; >+ >+ if ( $xslfile ) { >+ $tag->{XSLTBloc} = XSLTParse4Display( >+ $tag->{ biblionumber }, $record, "OPACXSLTResultsDisplay", >+ 1, undef, $sysxml, $xslfile, $lang >+ ); > } >+ > my $date = $tag->{date_created} || ''; > $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/; > $tag->{time_created_display} = $1; >-- >2.7.4
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 15263
:
45221
|
48962
|
48963
|
49031
|
49159
|
49502
|
49503
|
49504
|
49505
|
50474
|
50506
|
50507
|
50508
|
50509
|
50510
|
50511