my $tag;
$tag = $params->{tag} if $params->{tag};
+
+# String with params with the search criteria for the paging in opac-detail
+my $pasarParams = '';
+my $j = 0;
+for (keys %$params) {
+ my @pasarParam = split("\0", $params->{$_});
+ for my $paramValue(@pasarParam) {
+ $pasarParams .= '&' if ($j > 0);
+ $pasarParams .= $_ . '=' . $paramValue;
+ $j++;
+ }
+}
+#
+
+
# Params that can have more than one value
# sort by is used to sort the query
# in theory can have more than one but generally there's just one
my @results;
## I. BUILD THE QUERY
-my $lang = C4::Output::getlanguagecookie($cgi);
+my $lang = C4::Templates::getlanguage($cgi, 'opac');
( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by, 0, $lang);
sub _input_cgi_parse ($) {
($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
};
} else {
+ $pasarParams .= '&query=' . $query;
+ $pasarParams .= '&count=' . $results_per_page;
+ $pasarParams .= '&simple_query=' . $simple_query;
+ $pasarParams .= '&query_type=' . $query_type if ($query_type);
eval {
($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
};
}
if (C4::Context->preference('COinSinOPACResults')) {
foreach (@newresults) {
- $_->{coins} = GetCOinSBiblio($_->{'biblionumber'});
+ my $record = GetMarcBiblio($_->{'biblionumber'});
+ $_->{coins} = GetCOinSBiblio($record);
}
}
exit;
}
if ($hits) {
+ if (!C4::Context->preference('NoZebra') && !$build_grouped_results) {
+ # We build the encrypted list of first OPACnumSearchResults biblios to pass with the search criteria for paging on opac-detail
+ $pasarParams .= '&listBiblios=';
+ my $j = 0;
+ foreach (@newresults) {
+ my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
+ $pasarParams .= $bibnum . ',';
+ $j++;
+ last if ($j == $results_per_page);
+ }
+ chop $pasarParams if ($pasarParams =~ /,$/);
+ $pasarParams .= '&total=' . int($total) if ($pasarParams !~ /total=(?:[0-9]+)?/);
+ if ($pasarParams) {
+ my $session = get_session($cgi->cookie("CGISESSID"));
+ $session->param('busc' => $pasarParams);
+ }
+ #
+ }
$template->param(total => $hits);
my $limit_cgi_not_availablity = $limit_cgi;
$limit_cgi_not_availablity =~ s/&limit=available//g if defined $limit_cgi_not_availablity;