From ccb73f8335a19d7ace77b13db8afe446d7a30026 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Thu, 24 Mar 2016 00:33:32 -0300 Subject: [PATCH] Bug 15263: (QA followup) Make *shelves.pl use the new API This patch makes the lists work as the search results for rendering on XSLT-driven context. No behaviour change is expected. To test: - Apply the patch - Navigate lists (OPAC and intranet) => SUCCESS: the only difference is speed (faster) - Sign off :-D Signed-off-by: Kyle M Hall --- opac/opac-shelves.pl | 9 +++++++-- virtualshelves/shelves.pl | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 258044b..3dd9be6 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -248,14 +248,19 @@ if ( $op eq 'view' ) { my $borrower = GetMember( borrowernumber => $loggedinuser ); + my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay'); + my $lang = $xslfile ? C4::Languages::getlanguage() : undef; + my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; + my @items; while ( my $content = $contents->next ) { my $this_item; my $biblionumber = $content->biblionumber->biblionumber; my $record = GetMarcBiblio($biblionumber); - if ( C4::Context->preference("OPACXSLTResultsDisplay") ) { - $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "OPACXSLTResultsDisplay" ); + if ( $xslfile ) { + $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "OPACXSLTResultsDisplay", + 1, undef, $sysxml, $xslfile, $lang); } my $marcflavour = C4::Context->preference("marcflavour"); diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index eab6c17..76db727 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -215,14 +215,19 @@ if ( $op eq 'view' ) { my $borrower = GetMember( borrowernumber => $loggedinuser ); + my $xslfile = C4::Context->preference('XSLTResultsDisplay'); + my $lang = $xslfile ? C4::Languages::getlanguage() : undef; + my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; + my @items; while ( my $content = $contents->next ) { my $this_item; my $biblionumber = $content->biblionumber->biblionumber; my $record = GetMarcBiblio($biblionumber); - if ( C4::Context->preference("XSLTResultsDisplay") ) { - $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTResultsDisplay" ); + if ( $xslfile ) { + $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTResultsDisplay", + 1, undef, $sysxml, $xslfile, $lang); } my $marcflavour = C4::Context->preference("marcflavour"); -- 2.1.4