my @operands;
@operands = split("\0",$params->{'q'}) if $params->{'q'};
+$template->{VARS}->{querystring} = join(' ', @operands);
+
# if a simple search, display the value in the search box
if ($operands[0] && !$operands[1]) {
$template->param(ms_value => $operands[0]);
#
# add OPAC suppression - requires at least one item indexed with Suppress
if (C4::Context->preference('OpacSuppression')) {
- $query = "($query) not Suppress=1";
+ # OPAC suppression by IP address
+ if (C4::Context->preference('OpacSuppressionByIPRange')) {
+ my $IPAddress = $ENV{'REMOTE_ADDR'};
+ my $IPRange = C4::Context->preference('OpacSuppressionByIPRange');
+ if ($IPAddress !~ /^$IPRange/) {
+ $query = "($query) not Suppress=1";
+ }
+ }
+ else {
+ $query = "($query) not Suppress=1";
+ }
}
$template->param ( LIMIT_INPUTS => \@limit_inputs );
if (!$borrowernumber || $borrowernumber eq '') {
# To a cookie (the user is not logged in)
- if (($params->{'offset'}||'') eq '') {
+ if (!$offset) {
push @recentSearches, {
"query_desc" => $query_desc_history || "unknown",
"query_cgi" => $query_cgi_history || "unknown",
}
else {
# To the session (the user is logged in)
- if (($params->{'offset'}||'') eq '') {
+ if (!$offset) {
AddSearchHistory($borrowernumber, $cgi->cookie("CGISESSID"), $query_desc_history, $query_cgi_history, $total);
$template->param(ShowOpacRecentSearchLink => 1);
}
$template->param('GoogleIndicTransliteration' => 1);
}
+$template->{VARS}->{DidYouMeanFromAuthorities} = C4::Context->preference('DidYouMeanFromAuthorities');
+
$template->param( borrowernumber => $borrowernumber);
output_with_http_headers $cgi, $cookie, $template->output, $content_type;