From 56c2856e268ec02638898923d751a0b69c716f93 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 18 Jun 2021 15:27:40 +0200 Subject: [PATCH] Bug 12561: Remove non-XSLT views Signed-off-by: Owen Leonard Signed-off-by: Tomas Cohen Arazi Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- C4/Auth.pm | 4 - C4/Search.pm | 59 +------ catalogue/detail.pl | 11 +- .../en/modules/admin/preferences/opac.pref | 6 +- .../admin/preferences/staff_interface.pref | 2 +- .../bootstrap/en/modules/opac-MARCdetail.tt | 8 +- .../bootstrap/en/modules/opac-detail.tt | 155 +----------------- .../bootstrap/en/modules/opac-results.tt | 92 +---------- .../bootstrap/en/modules/opac-shelves.tt | 61 +------ opac/opac-detail.pl | 27 +-- opac/opac-shelves.pl | 28 ++-- opac/opac-tags.pl | 30 ++-- virtualshelves/shelves.pl | 10 +- 13 files changed, 54 insertions(+), 439 deletions(-) diff --git a/C4/Auth.pm b/C4/Auth.pm index fd327bf618..ac635b1a9c 100644 --- a/C4/Auth.pm +++ b/C4/Auth.pm @@ -492,8 +492,6 @@ sub get_template_and_user { item_level_itypes => C4::Context->preference('item-level_itypes'), patronimages => C4::Context->preference("patronimages"), singleBranchMode => ( Koha::Libraries->search->count == 1 ), - XSLTDetailsDisplay => C4::Context->preference("XSLTDetailsDisplay"), - XSLTResultsDisplay => C4::Context->preference("XSLTResultsDisplay"), noItemTypeImages => C4::Context->preference("noItemTypeImages"), marcflavour => C4::Context->preference("marcflavour"), OPACBaseURL => C4::Context->preference('OPACBaseURL'), @@ -613,8 +611,6 @@ sub get_template_and_user { suggestion => "" . C4::Context->preference("suggestion"), virtualshelves => "" . C4::Context->preference("virtualshelves"), OPACSerialIssueDisplayCount => C4::Context->preference("OPACSerialIssueDisplayCount"), - OPACXSLTDetailsDisplay => C4::Context->preference("OPACXSLTDetailsDisplay"), - OPACXSLTResultsDisplay => C4::Context->preference("OPACXSLTResultsDisplay"), SyndeticsClientCode => C4::Context->preference("SyndeticsClientCode"), SyndeticsEnabled => C4::Context->preference("SyndeticsEnabled"), SyndeticsCoverImages => C4::Context->preference("SyndeticsCoverImages"), diff --git a/C4/Search.pm b/C4/Search.pm index 1ca987add2..529f83428d 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1655,17 +1655,10 @@ sub searchResults { my ($bibliotag,$bibliosubf)=GetMarcFromKohaField( 'biblio.biblionumber' ); # set stuff for XSLT processing here once, not later again for every record we retrieved - my $xslfile; - my $xslsyspref; - if( $is_opac ){ - $xslsyspref = "OPACXSLTResultsDisplay"; - $xslfile = C4::Context->preference( $xslsyspref ); - } else { - $xslsyspref = "XSLTResultsDisplay"; - $xslfile = C4::Context->preference( $xslsyspref ) || "default"; - } - my $lang = $xslfile ? C4::Languages::getlanguage() : undef; - my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; + my $xslsyspref = $is_opac ? 'OPACXSLTResultsDisplay' : 'XSLTResultsDisplay'; + my $xslfile = C4::Context->preference( $xslsyspref ) || "default"; + my $lang = C4::Languages::getlanguage(); + my $sysxml = C4::XSLT::get_xslt_sysprefs(); my $userenv = C4::Context->userenv; my $logged_in_user @@ -1719,50 +1712,6 @@ sub searchResults { # Build summary if there is one (the summary is defined in the itemtypes table) $oldbiblio->{description} = $itemtype ? $itemtype->{translated_description} : q{}; - # FIXME: this is only used in the deprecated non-XLST opac results - if ( !$xslfile && $is_opac && $itemtype && $itemtype->{summary} ) { - my $summary = $itemtypes{ $oldbiblio->{itemtype} }->{summary}; - my @fields = $marcrecord->fields(); - - my $newsummary; - foreach my $line ( "$summary\n" =~ /(.*)\n/g ){ - my $tags = {}; - foreach my $tag ( $line =~ /\[(\d{3}[\w|\d])\]/ ) { - $tag =~ /(.{3})(.)/; - if($marcrecord->field($1)){ - my @abc = $marcrecord->field($1)->subfield($2); - $tags->{$tag} = $#abc + 1 ; - } - } - - # We catch how many times to repeat this line - my $max = 0; - foreach my $tag (keys(%$tags)){ - $max = $tags->{$tag} if($tags->{$tag} > $max); - } - - # we replace, and repeat each line - for (my $i = 0 ; $i < $max ; $i++){ - my $newline = $line; - - foreach my $tag ( $newline =~ /\[(\d{3}[\w|\d])\]/g ) { - $tag =~ /(.{3})(.)/; - - if($marcrecord->field($1)){ - my @repl = $marcrecord->field($1)->subfield($2); - my $subfieldvalue = $repl[$i]; - $newline =~ s/\[$tag\]/$subfieldvalue/g; - } - } - $newsummary .= "$newline\n"; - } - } - - $newsummary =~ s/\[(.*?)]//g; - $newsummary =~ s/\n//g; - $oldbiblio->{summary} = $newsummary; - } - # Pull out the items fields my @fields = $marcrecord->field($itemtag); my $marcflavor = C4::Context->preference("marcflavour"); diff --git a/catalogue/detail.pl b/catalogue/detail.pl index b06c90a866..f70803a029 100755 --- a/catalogue/detail.pl +++ b/catalogue/detail.pl @@ -122,12 +122,11 @@ my $fw = GetFrameworkCode($biblionumber); my $showallitems = $query->param('showallitems'); my $marcflavour = C4::Context->preference("marcflavour"); -# XSLT processing of some stuff -my $xslfile = C4::Context->preference('XSLTDetailsDisplay') || "default"; -my $lang = $xslfile ? C4::Languages::getlanguage() : undef; -my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; - -if ( $xslfile ) { +{ + # XSLT processing of some stuff + my $xslfile = C4::Context->preference('XSLTDetailsDisplay') || "default"; + my $lang = C4::Languages::getlanguage(); + my $sysxml = C4::XSLT::get_xslt_sysprefs(); my $searcher = Koha::SearchEngine::Search->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index 49ffe1b2d6..72331ff8a6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -90,17 +90,17 @@ OPAC: - 'Display lists in the OPAC using XSLT stylesheet at: ' - pref: OPACXSLTListsDisplay class: file - - '
Options:
  • leave empty for "no xslt"
  • enter "default" for the default one
  • put a path to define a xslt file
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language.' + - '
Options:
  • Enter "default" for the default one
  • put a path to define a xslt file
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language.' - - 'Display OPAC results using XSLT stylesheet at: ' - pref: OPACXSLTResultsDisplay class: file - - '
Options:
  • leave empty for "no xslt"
  • enter "default" for the default one
  • put a path to define a xslt file
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language.' + - '
Options:
  • Enter "default" for the default one
  • put a path to define a xslt file
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language.' - - 'Display OPAC details using XSLT stylesheet at: ' - pref: OPACXSLTDetailsDisplay class: file - - '
Options:
  • leave empty for "no xslt"
  • enter "default" for the default one
  • put a path to define a xslt file
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language.' + - '
Options:
  • Enter "default" for the default one
  • put a path to define a xslt file
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language.' - - "Show itemtype icons in the OPAC: " - pref: OpacNoItemTypeImages diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref index a2b25e5168..654944e54a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/staff_interface.pref @@ -71,7 +71,7 @@ Staff interface: - 'Display lists in the staff interface using XSLT stylesheet at: ' - pref: XSLTListsDisplay class: file - - '
Options:
  • Leave empty for "no xslt"
  • enter "default" for the default one
  • put a path to define a xslt file
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language' + - '
Options:
  • Enter "default" for the default one
  • put a path to define a xslt file
  • put an URL for an external specific stylesheet.
{langcode} will be replaced with current interface language' - - 'Display results in the staff interface using XSLT stylesheet at: ' - pref: XSLTResultsDisplay diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt index a076cb2d4e..ac6f48b7cd 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-MARCdetail.tt @@ -33,10 +33,8 @@

[% bibliotitle | html %] (Record no. [% biblio.biblionumber | html %])

- [% IF ( OPACXSLTDetailsDisplay ) %] - -
- [% END %] + +
@@ -178,7 +176,6 @@ [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] [% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt index 8336f36edf..ce9bff3939 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt @@ -138,161 +138,8 @@ ISBD view [% END %] - [% IF ( OPACXSLTDetailsDisplay ) %] - [% XSLTBloc | $raw %] - [% ELSE %] -

[% INCLUDE 'biblio-title.inc' %]

- [% IF ( author ) %] - by [% author | html %] - [% END %] - - - [% IF ( unititle ) %], [% unititle | html %][% END %] - - - [% IF ( MARCAUTHORS ) %] -
- Additional authors: - [% FOREACH MARCAUTHOR IN MARCAUTHORS %] - [% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %] - [% MARCAUTHOR_SUBFIELDS_LOO.separator | html %] - [% IF ( MARCAUTHOR.authoritylink ) %] - - [% ELSE %] - - [% END %] - [% MARCAUTHOR_SUBFIELDS_LOO.value | html %] - [% END %] - [% IF (MARCAUTHOR.authoritylink) %] - - [% END %] - [% IF IDREF and MARCAUTHOR.unimarc3 %] - IdRef - [% END %] - [% UNLESS ( loop.last ) %]|[% END %] - [% END # /FOREACH MARCAUTHORS %] -
- [% END # IF MARCAUTHORS %] - - [% IF ( MARCSERIES ) %] - Series: - [% FOREACH MARCSERIE IN MARCSERIES %] - [% FOREACH MARCSERIES_SUBFIELDS_LOO IN MARCSERIE.MARCSERIES_SUBFIELDS_LOOP %] - [% IF ( MARCSERIES_SUBFIELDS_LOO.value ) %] - [% MARCSERIES_SUBFIELDS_LOO.value | html %] - [% END %] - [% IF ( MARCSERIES_SUBFIELDS_LOO.volumenum ) %] - . [% MARCSERIES_SUBFIELDS_LOO.volumenum | html %] - [% END %] - [% END %] - [% UNLESS ( loop.last ) %]|[% END %] - [% END # / FOREACH MARCSERIES %] - - [% END # /MARCSERIES %] - - [% IF ( editionstatement ) %] - Edition statement:[% editionstatement | html %][% IF ( editionresponsibility ) %]/[% editionresponsibility | html %][% END %] - [% END %] - [% IF ( publishercode ) %] - Published by : - - [% publishercode | html %] - [% IF ( place ) %]([% place | html %])[% END %] [% IF ( publicationyear ) %], [% publicationyear | html %][% END %] - - [% END %] - - [% IF ( pages ) %] - Physical details: [% pages | html %] [% illus | html %] [% size | html %] - [% END %] - - [% IF ( MARCISBNS ) %] - ISBN:[% FOREACH MARCISBN IN MARCISBNS %][% MARCISBN | html %][% IF ( loop.last ) %].[% ELSE %]; [% END %][% END %] - [% ELSE %] - [% IF ( normalized_isbn ) %] - ISBN: [% normalized_isbn | html %] - [% END %] - [% END %] - - [% IF ( issn ) %] - ISSN:[% issn | html %] - [% END %] - - [% IF ( collectiontitle ) %] - Collection: - [% collectiontitle | html %] - [% IF ( collectionissn ) %] [% ', ISSN ' _ collectionissn | html %][% END %] - [% IF ( collectionvolume ) %] [% ' ; ' _ collectionvolume | html %] [% END %] - - [% END %] - - [% IF ( unititles ) %] - Uniform titles: - [% FOREACH unititle IN unititles %] - [% unititle.unititle | html %] ; - [% END %] - - [% END %] - - [% IF ( MARCSUBJCTS ) %] -
- Subject(s): - - [% FOREACH MARCSUBJCT IN MARCSUBJCTS %] - [% subjectsloop = loop %] - [% FOREACH SUBFIELD IN MARCSUBJCT.MARCSUBJECT_SUBFIELDS_LOOP %] - [% SUBFIELD.separator | html %] - [% SUBFIELD.value | html %] - [% END %] - [% IF (MARCSUBJCT.authoritylink) %] - - [% END %] - [% UNLESS ( loop.last ) %] | [% END %] - [% END # / FOREACH MARCSUBJCTS %] -
- [% ELSE # /IF MARCSUBJCTS %] - [% IF ( subjects ) %] - Subject(s): [% FOREACH subject IN subjects %][% subject.subject | html %] | [% END %] - [% END %] - [% END # /IF MARCSUBJCTS %] - - [% IF ( copyrightdate ) %] - Year: [% copyrightdate | html %] - [% END %] - - [% IF ( MARCURLS ) %] -
Online resources: - -
- [% END # / IF MARCURLS %] - [% END # / IF OPACXSLTDetailsDisplay %] + [% XSLTBloc | $raw %] [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %] Item type: diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt index 4b9ef83913..3a9be017dc 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt @@ -447,98 +447,8 @@ [% END %]
- [% IF ( OPACXSLTResultsDisplay ) %] - [% SEARCH_RESULT.XSLTResultsRecord | $raw %] - [% ELSE %] - [% IF ( BiblioDefaultViewmarc ) %] - - [% ELSE %] - [% IF ( BiblioDefaultViewisbd ) %] - - [% ELSE %] - - [% END %] - [% END %] - - [% INCLUDE 'biblio-title.inc' biblio=SEARCH_RESULT %] - [% IF ( SEARCH_RESULT.author ) %] - by [% SEARCH_RESULT.author | html %] - [% ELSE %] -   - [% END %] - - - Publication: - [% IF ( SEARCH_RESULT.place ) %][% SEARCH_RESULT.place | html %] [% END %] - [% IF ( SEARCH_RESULT.publishercode ) %][% SEARCH_RESULT.publishercode | html %][% END %] - [% IF ( SEARCH_RESULT.publicationyear ) %] - [% SEARCH_RESULT.publicationyear | html %] - [% ELSE %] - [% IF ( SEARCH_RESULT.copyrightdate ) %] - [% SEARCH_RESULT.copyrightdate | html %] - [% END %] - [% END %] - [% IF ( SEARCH_RESULT.pages ) %]. [% SEARCH_RESULT.pages | html %][% END %] - [% IF ( SEARCH_RESULT.notes ) %], [% SEARCH_RESULT.notes | html %][% END %] - [% IF ( SEARCH_RESULT.size ) %] [% SEARCH_RESULT.size | html %][% END %] - [% IF ( SEARCH_RESULT.timestamp ) %] (modified on [% SEARCH_RESULT.timestamp | html %])[% END %] - - - [% IF ( SEARCH_RESULT.summary ) %] - - [% SEARCH_RESULT.summary | html %] - - [% END %] - - [% IF ( SEARCH_RESULT.copyrightdate ) %] - - Date: - [% SEARCH_RESULT.copyrightdate | html %] - - [% END %] - - - Availability: - [% IF ( SEARCH_RESULT.available_items_loop.size() ) %] - Items available: - [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %] - - [% IF ( singleBranchMode ) %] - [% available_items_loo.location | html %] - [% ELSE %] - [% available_items_loo.branchname | html %] - [% END %] - - [% IF ( OPACItemsResultsDisplay ) %] - [% UNLESS ( singleBranchMode ) %][% available_items_loo.location | html %][% END %] - [% IF ( available_items_loo.itemcallnumber ) %][[% available_items_loo.itemcallnumber | html %]][% END %] - [% END %] - ([% available_items_loo.count | html %]), - - [% END # / FOREACH available_items_loo %] - - [% ELSE %] - [% IF ( SEARCH_RESULT.ALTERNATEHOLDINGS ) %] - [% FOREACH ALTERNATEHOLDING IN SEARCH_RESULT.ALTERNATEHOLDINGS %] -  [% ALTERNATEHOLDING.holding | html %], - [% END %] - [% ELSE %] - No items available: - [% END %] - [% END # / IF SEARCH_RESULT.available_items_loop.size %] - - - [% IF ( SEARCH_RESULT.onloancount ) %] Checked out ([% SEARCH_RESULT.onloancount | html %]), [% END %] - [% IF ( SEARCH_RESULT.withdrawncount ) %] Withdrawn ([% SEARCH_RESULT.withdrawncount | html %]), [% END %] - [% UNLESS ( SEARCH_RESULT.hidelostitems ) %][% IF ( SEARCH_RESULT.itemlostcount ) %] Lost ([% SEARCH_RESULT.itemlostcount | html %]),[% END %][% END %] - [% IF ( SEARCH_RESULT.damagedcount ) %] Damaged ([% SEARCH_RESULT.damagedcount | html %]),[% END %] - [% IF ( SEARCH_RESULT.orderedcount ) %] On order ([% SEARCH_RESULT.orderedcount | html %]),[% END %] - [% IF ( SEARCH_RESULT.onholdcount ) %] On hold ([% SEARCH_RESULT.onholdcount | html %]),[% END %] - [% IF ( SEARCH_RESULT.intransitcount ) %] In transit ([% SEARCH_RESULT.intransitcount | html %]),[% END %] - - - [% END # / IF OPACXSLTResultsDisplay %] + [% SEARCH_RESULT.XSLTResultsRecord | $raw %] [% IF ( SEARCH_RESULT.score_avg ) %]
diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt index 08b7f668a6..e1191095d7 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt @@ -480,67 +480,8 @@ [% END %]
- [% IF ( itemsloo.XSLTBloc ) %] - [% itemsloo.XSLTBloc | $raw %] - [% ELSE %] - - [% IF ( itemsloo.BiblioDefaultViewmarc ) %] - - [% ELSE %] - [% IF ( itemsloo.BiblioDefaultViewisbd ) %] - - [% ELSE %] - - [% END %] - [% END %] - - [% INCLUDE 'biblio-title.inc' biblio=itemsloo %] - - [% IF ( itemsloo.author ) %] - by [% itemsloo.author | html %] - [% ELSE %] -   - [% END %] - - - Publication: - [% IF ( itemsloo.place ) %] - [% itemsloo.place | html %] - [% END %] - [% IF ( itemsloo.publishercode ) %] - [% itemsloo.publishercode | html %] - [% END %] - [% IF ( itemsloo.publicationyear ) %] - [% itemsloo.publicationyear | html %] - [% ELSE %] - [% IF ( itemsloo.copyrightdate ) %] - [% itemsloo.copyrightdate | html %] - [% END %] - [% END %] - [% IF ( itemsloo.pages ) %]. [% itemsloo.pages | html %][% END %] - [% IF ( itemsloo.notes ) %], [% itemsloo.notes | html %][% END %] - [% IF ( itemsloo.item('size') ) %] [% itemsloo.item('size') | html %][% END %] - - - Holdings: - [% IF itemsloo.ITEM_RESULTS %] - [% FOREACH item IN itemsloo.ITEM_RESULTS %] - [% item.homebranch | html %] - [% SET location_opac = AuthorisedValues.GetByCode( 'LOC', item.location, 1 ) %] - [% IF location_opac %] - [% location_opac | html %] - [% END %] - [% IF item.itemcallnumber %] - ([% item.itemcallnumber | html %]) - [% IF ( loop.last ) %].[% ELSE %],[% END %] - [% END %] - [% END %] - [% ELSE %] - This record has no items. - [% END %] - - [% END # / IF itemsloo.XSLTBloc %] + [% itemsloo.XSLTBloc | $raw %] [% IF ( TagsShowEnabled && itemsloo.TagLoop.size ) %]
diff --git a/opac/opac-detail.pl b/opac/opac-detail.pl index 704bee6118..97f8f0c2a9 100755 --- a/opac/opac-detail.pl +++ b/opac/opac-detail.pl @@ -193,12 +193,12 @@ SetUTF8Flag($record); my $marcflavour = C4::Context->preference("marcflavour"); my $ean = GetNormalizedEAN( $record, $marcflavour ); -# XSLT processing of some stuff -my $xslfile = C4::Context->preference('OPACXSLTDetailsDisplay'); -my $lang = $xslfile ? C4::Languages::getlanguage() : undef; -my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; +{ -if ( $xslfile ) { + # XSLT processing of some stuff + my $xslfile = C4::Context->preference('OPACXSLTDetailsDisplay') || "default"; + my $lang = C4::Languages::getlanguage(); + my $sysxml = C4::XSLT::get_xslt_sysprefs(); my $searcher = Koha::SearchEngine::Search->new( { index => $Koha::SearchEngine::BIBLIOS_INDEX } @@ -784,23 +784,6 @@ if (scalar(@itemloop) == 0 || scalar(@otheritemloop) == 0) { } } -## get notes and subjects from MARC record -if (!C4::Context->preference("OPACXSLTDetailsDisplay") ) { - my $marcisbnsarray = GetMarcISBN ($record,$marcflavour); - my $marcauthorsarray = GetMarcAuthors ($record,$marcflavour); - my $marcsubjctsarray = GetMarcSubjects($record,$marcflavour); - my $marcseriesarray = GetMarcSeries ($record,$marcflavour); - my $marcurlsarray = GetMarcUrls ($record,$marcflavour); - - $template->param( - MARCSUBJCTS => $marcsubjctsarray, - MARCAUTHORS => $marcauthorsarray, - MARCSERIES => $marcseriesarray, - MARCURLS => $marcurlsarray, - MARCISBNS => $marcisbnsarray, - ); -} - my $marcnotesarray = $biblio->get_marc_notes({ marcflavour => $marcflavour, opac => 1 }); if( C4::Context->preference('ArticleRequests') ) { diff --git a/opac/opac-shelves.pl b/opac/opac-shelves.pl index 6796691f1f..90ec38cc40 100755 --- a/opac/opac-shelves.pl +++ b/opac/opac-shelves.pl @@ -304,9 +304,9 @@ if ( $op eq 'view' ) { } # Lists display falls back to search results configuration - my $xslfile = C4::Context->preference('OPACXSLTListsDisplay'); - my $lang = $xslfile ? C4::Languages::getlanguage() : undef; - my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; + my $xslfile = C4::Context->preference('OPACXSLTListsDisplay') || "default"; + my $lang = C4::Languages::getlanguage(); + my $sysxml = C4::XSLT::get_xslt_sysprefs(); my $record_processor = Koha::RecordProcessor->new({ filters => 'ViewPolicy' }); @@ -370,18 +370,16 @@ if ( $op eq 'view' ) { $this_item->{allow_onshelf_holds} = $allow_onshelf_holds; $this_item->{'ITEM_RESULTS'} = $items; - if ($xslfile) { - my $variables = { - anonymous_session => ($loggedinuser) ? 0 : 1 - }; - $this_item->{XSLTBloc} = XSLTParse4Display( - $biblionumber, $record, - "OPACXSLTListsDisplay", 1, - undef, $sysxml, - $xslfile, $lang, - $variables, $items->reset - ); - } + my $variables = { + anonymous_session => ($loggedinuser) ? 0 : 1 + }; + $this_item->{XSLTBloc} = XSLTParse4Display( + $biblionumber, $record, + "OPACXSLTListsDisplay", 1, + undef, $sysxml, + $xslfile, $lang, + $variables, $items->reset + ); if ( grep {$_ eq $biblionumber} @cart_list) { $this_item->{incart} = 1; diff --git a/opac/opac-tags.pl b/opac/opac-tags.pl index f9dd2070fd..e420bee5d6 100755 --- a/opac/opac-tags.pl +++ b/opac/opac-tags.pl @@ -285,22 +285,20 @@ if ($loggedinuser) { # BZ17530: 'Intelligent' guess if result can be article requested $tag->{artreqpossible} = ( $art_req_itypes->{ $tag->{itemtype} // q{} } || $art_req_itypes->{ '*' } ) ? 1 : q{}; - my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay'); - my $lang = $xslfile ? C4::Languages::getlanguage() : undef; - my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; - - if ($xslfile) { - my $variables = { - anonymous_session => ($loggedinuser) ? 0 : 1 - }; - $tag->{XSLTBloc} = XSLTParse4Display( - $tag->{biblionumber}, $record, - "OPACXSLTResultsDisplay", 1, - $hidden_items, $sysxml, - $xslfile, $lang, - $variables - ); - } + my $xslfile = C4::Context->preference('OPACXSLTResultsDisplay') || "default"; + my $lang = C4::Languages::getlanguage(); + my $sysxml = C4::XSLT::get_xslt_sysprefs(); + + my $variables = { + anonymous_session => ($loggedinuser) ? 0 : 1 + }; + $tag->{XSLTBloc} = XSLTParse4Display( + $tag->{biblionumber}, $record, + "OPACXSLTResultsDisplay", 1, + $hidden_items, $sysxml, + $xslfile, $lang, + $variables + ); my $date = $tag->{date_created} || ''; $date =~ /\s+(\d{2}\:\d{2}\:\d{2})/; diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl index d0a900168a..91f219d105 100755 --- a/virtualshelves/shelves.pl +++ b/virtualshelves/shelves.pl @@ -259,8 +259,8 @@ if ( $op eq 'view' ) { ); my $xslfile = C4::Context->preference('XSLTListsDisplay'); - my $lang = $xslfile ? C4::Languages::getlanguage() : undef; - my $sysxml = $xslfile ? C4::XSLT::get_xslt_sysprefs() : undef; + my $lang = C4::Languages::getlanguage(); + my $sysxml = C4::XSLT::get_xslt_sysprefs(); my @items; while ( my $content = $contents->next ) { @@ -268,10 +268,8 @@ if ( $op eq 'view' ) { my $biblionumber = $content->biblionumber; my $record = GetMarcBiblio({ biblionumber => $biblionumber }); - if ( $xslfile ) { - $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay", - 1, undef, $sysxml, $xslfile, $lang); - } + $this_item->{XSLTBloc} = XSLTParse4Display( $biblionumber, $record, "XSLTListsDisplay", + 1, undef, $sysxml, $xslfile, $lang); my $marcflavour = C4::Context->preference("marcflavour"); my $itemtype = Koha::Biblioitems->search({ biblionumber => $content->biblionumber })->next->itemtype; -- 2.39.5