@@ -, +, @@ --- C4/Search.pm | 7 ++++++- C4/XSLT.pm | 3 ++- catalogue/detail.pl | 2 ++ opac/opac-detail.pl | 2 ++ opac/opac-search.pl | 5 ----- opac/opac-shelves.pl | 1 + opac/opac-tags.pl | 1 + virtualshelves/shelves.pl | 1 + 8 files changed, 15 insertions(+), 7 deletions(-) --- a/C4/Search.pm +++ a/C4/Search.pm @@ -2017,13 +2017,18 @@ sub searchResults { ), fix_amps => 1, hidden_items => \@hiddenitems, - xslt_variables => $xslt_variables + xslt_variables => $xslt_variables, + interface => $search_context->{'interface'} } ); } my $biblio_object = Koha::Biblios->find( $oldbiblio->{biblionumber} ); $oldbiblio->{biblio_object} = $biblio_object; + $oldbiblio->{coins} = eval { $biblio_object->get_coins } + if $biblio_object + && C4::Context->preference('COinSinOPACResults') + && $is_opac; my $can_place_holds = 1; # if biblio level itypes are used and itemtype is notforloan, it can't be reserved either --- a/C4/XSLT.pm +++ a/C4/XSLT.pm @@ -179,6 +179,7 @@ sub XSLTParse4Display { my $hidden_items = $params->{hidden_items} || []; my $variables = $params->{xslt_variables}; my $items_rs = $params->{items_rs}; + my $interface = $params->{interface}; die "Mandatory \$params->{xsl_syspref} was not provided, called with biblionumber $params->{biblionumber}" if not defined $params->{xsl_syspref}; @@ -208,7 +209,7 @@ sub XSLTParse4Display { $variables ||= {}; my $biblio; - if (C4::Context->preference('OPACShowOpenURL')) { + if ( $interface eq 'opac' && C4::Context->preference('OPACShowOpenURL')) { my @biblio_itemtypes; $biblio //= Koha::Biblios->find($biblionumber); if (C4::Context->preference('item-level_itypes')) { --- a/catalogue/detail.pl +++ a/catalogue/detail.pl @@ -261,6 +261,7 @@ if ( $showcomp eq 'both' || $showcomp eq 'staff' ) { record => $part, xsl_syspref => "XSLTResultsDisplay", fix_amps => 1, + interface => 'intranet' } ); } @@ -284,6 +285,7 @@ $template->param( xsl_syspref => "XSLTDetailsDisplay", fix_amps => 1, xslt_variables => $xslt_variables, + interface => 'intranet' }), ); --- a/opac/opac-detail.pl +++ a/opac/opac-detail.pl @@ -612,6 +612,7 @@ if ( $showcomp eq 'both' || $showcomp eq 'opac' ) { record => $part, xsl_syspref => 'OPACXSLTResultsDisplay', fix_amps => 1, + interface => 'opac' } ); } @@ -647,6 +648,7 @@ $template->param( xsl_syspref => 'OPACXSLTDetailsDisplay', fix_amps => 1, xslt_variables => $variables, + interface => 'opac' }), ); --- a/opac/opac-search.pl +++ a/opac/opac-search.pl @@ -659,11 +659,6 @@ for (my $i=0;$i<@servers;$i++) { $res->{'incart'} = 1; } - if (C4::Context->preference('COinSinOPACResults')) { - my $biblio = Koha::Biblios->find( $res->{'biblionumber'} ); - # Catch the exception as Koha::Biblio::Metadata->record can explode if the MARCXML is invalid - $res->{coins} = $biblio ? eval {$biblio->get_coins} : q{}; # FIXME This should be moved at the beginning of the @newresults loop - } if ( C4::Context->preference( "Babeltheque" ) and $res->{normalized_isbn} ) { if( my $isbn = Business::ISBN->new( $res->{normalized_isbn} ) ) { $isbn = $isbn->as_isbn13->as_string; --- a/opac/opac-shelves.pl +++ a/opac/opac-shelves.pl @@ -416,6 +416,7 @@ if ( $op eq 'view' ) { fix_amps => 1, xslt_variables => $variables, items_rs => $items->reset, + interface => 'opac' } ); --- a/opac/opac-tags.pl +++ a/opac/opac-tags.pl @@ -293,6 +293,7 @@ if ($loggedinuser) { fix_amps => 1, hidden_items => \@hidden_items, xslt_variables => $variables + interface => 'opac' } ); --- a/virtualshelves/shelves.pl +++ a/virtualshelves/shelves.pl @@ -293,6 +293,7 @@ if ( $op eq 'view' ) { record => $record, xsl_syspref => 'XSLTListsDisplay', fix_amps => 1, + interface => 'intranet' } ); --