From 25532fc27159b5f7ab8254842354b0f82db4fae5 Mon Sep 17 00:00:00 2001 From: Srdjan Jankovic Date: Wed, 7 Mar 2012 16:53:09 +1300 Subject: [PATCH] Bug 6488: Display OPAC search result count conditional to OpacHiddenItems syspref Signed-off-by: Marcel de Rooy Works as advertised. Amended this patch for a small spelling issue: supress->suppress. Could not suppress it ;) --- koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt | 1 + opac/opac-search.pl | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt index 1a3d6f843b..e50ea7aefe 100755 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -381,6 +381,7 @@ $(document).ready(function(){ [% IF ( opacbookbag ) %] [% ELSE %] [% IF ( virtualshelves ) %] [% ELSE %] [% IF ( RequestOnOpac ) %][% UNLESS ( SEARCH_RESULT.norequests ) %][% IF ( opacuserlogin ) %] [% END %][% END %][% END %][% END %][% END %] + [% UNLESS suppress_result_number %][% SEARCH_RESULT.result_number %].[% END %] [% UNLESS ( item_level_itypes ) %] [% UNLESS ( noItemTypeImages ) %] diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 87d2890092..fd45af3e56 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -613,8 +613,12 @@ for (my $i=0;$i<@servers;$i++) { } $template->param(stopwords_removed => "@$stopwords_removed") if $stopwords_removed; $template->param(results_per_page => $results_per_page); - $template->param(SEARCH_RESULTS => \@newresults, - OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay") eq "itemdetails"?1:0), + my $hide = C4::Context->preference('OpacHiddenItems'); + $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines + $template->param( + SEARCH_RESULTS => \@newresults, + OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay") eq "itemdetails"?1:0), + suppress_result_number => $hide, ); if (C4::Context->preference("OPACLocalCoverImages")){ $template->param(OPACLocalCoverImages => 1); -- 2.39.5