}
use C4::Output;
-use C4::Auth qw(:DEFAULT get_session);
+use C4::Auth qw(:DEFAULT get_session ParseSearchHistoryCookie);
use C4::Languages qw(getAllLanguages);
use C4::Search;
use C4::Biblio; # GetBiblioData
}
$template->param(advancedsearchesloop => \@advancedsearchesloop);
-# # load the itypes (Called item types in the template -- just authorized values for searching)
-# my ($itypecount,@itype_loop) = GetCcodes();
-# $template->param(itypeloop=>\@itype_loop,);
-
# The following should only be loaded if we're bringing up the advanced search template
if ( $template_type && $template_type eq 'advsearch' ) {
# load the servers (used for searching -- to do federated searching, etc.)
# Opac search history
my $newsearchcookie;
if (C4::Context->preference('EnableOpacSearchHistory')) {
- my @recentSearches;
-
- # Getting the (maybe) already sent cookie
- my $searchcookie = $cgi->cookie('KohaOpacRecentSearches');
- if ($searchcookie){
- $searchcookie = uri_unescape($searchcookie);
- if (decode_json($searchcookie)) {
- @recentSearches = @{decode_json($searchcookie)};
- }
- }
+ my @recentSearches = ParseSearchHistoryCookie($cgi);
# Adding the new search if needed
my $path_info = $cgi->url(-path_info=>1);