X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=opac%2Fopac-search.pl;h=83f16d8a61990a7355d25f0f4019b8341d4ec3e6;hb=da8d126c9a524dfefe610684349e69bb4d9c7a79;hp=00cd8e3fb9cc18e8198235cdba4aa72b15026001;hpb=d07df7d51250bb5a40bb556aab48afb18a67a396;p=koha_fer diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 00cd8e3fb9..83f16d8a61 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -43,7 +43,7 @@ for ( $searchengine ) { use C4::Output; use C4::Auth qw(:DEFAULT get_session ParseSearchHistorySession SetSearchHistorySession); -use C4::Languages qw(getAllLanguages); +use C4::Languages qw(getLanguages); use C4::Search; use C4::Biblio; # GetBiblioData use C4::Koha; @@ -198,7 +198,7 @@ $template->param( ); # load the language limits (for search) -my $languages_limit_loop = getAllLanguages($lang); +my $languages_limit_loop = getLanguages($lang, 1); $template->param(search_languages_loop => $languages_limit_loop,); # load the Type stuff @@ -556,6 +556,7 @@ for (my $i=0;$i<@servers;$i++) { @newresults = searchResults('opac', $query_desc, $hits, $results_per_page, $offset, $scan, $results_hashref->{$server}->{"RECORDS"}); } + $hits = 0 unless @newresults; foreach my $res (@newresults) { @@ -610,11 +611,10 @@ for (my $i=0;$i<@servers;$i++) { } if ($results_hashref->{$server}->{"hits"}){ - $total = $total + $results_hashref->{$server}->{"hits"}; + $total = $total + $hits; } # Opac search history - my $newsearchcookie; if (C4::Context->preference('EnableOpacSearchHistory')) { my @recentSearches = ParseSearchHistorySession($cgi); @@ -638,11 +638,10 @@ for (my $i=0;$i<@servers;$i++) { } shift @recentSearches if (@recentSearches > 15); - # Pushing the cookie back SetSearchHistorySession($cgi, \@recentSearches); } else { - # To the session (the user is logged in) + # To the database (the user is logged in) if (!$offset) { AddSearchHistory($borrowernumber, $cgi->cookie("CGISESSID"), $query_desc_history, $query_cgi_history, $total); $template->param(ShowOpacRecentSearchLink => 1);