From fd2a89b4edfec238e82a8a283b8b4eb6d89741ad Mon Sep 17 00:00:00 2001 From: wajasu Date: Fri, 7 Mar 2014 12:05:12 -0600 Subject: [PATCH] Bug 11909 - Fix hidelostitems, OpacHiddenItems total count, prog theme facet display hidelostitems hides the biblio when all items are lost. fix makes it so we hide the items, not the biblio. opac-search.pl search results calculates correct "total" so that Number of results found indicator is correct, and auto-redirect to details when ONLY one result is returned works. facets "Refine your search" displays in "prog" theme when no search results returned. --- C4/Search.pm | 6 ------ koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt | 2 +- opac/opac-search.pl | 2 +- 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 09c1951..284abff 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -1867,17 +1867,11 @@ sub searchResults { # OPAC hidden items if ($is_opac) { - # hidden because lost - if ($hidelostitems && $item->{itemlost}) { - $hideatopac_count++; - next; - } # hidden based on OpacHiddenItems syspref my @hi = C4::Items::GetHiddenItemnumbers($item); if (scalar @hi) { push @hiddenitems, @hi; $hideatopac_count++; - next; } } 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 9235b2b..d93b831 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tt @@ -757,7 +757,7 @@ $(document).ready(function(){ - [% IF ( opacfacets ) %] + [% IF ( opacfacets && SEARCH_RESULTS.size ) %]
[% INCLUDE 'opac-facets.inc' %] diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 617d67e..a6fbea8 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -610,7 +610,7 @@ for (my $i=0;$i<@servers;$i++) { } if ($results_hashref->{$server}->{"hits"}){ - $total = $total + $results_hashref->{$server}->{"hits"}; + $total = @newresults; # newresults will just have the hidden biblios filtered (see Search) } # Opac search history -- 1.8.5.3