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;
);
# 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
@newresults = searchResults('opac', $query_desc, $hits, $results_per_page, $offset, $scan,
$results_hashref->{$server}->{"RECORDS"});
}
+ $hits = 0 unless @newresults;
foreach my $res (@newresults) {
}
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);
}
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);