Browse Source

Copying code from opac-search.pl that allows search terms to be output along with search results ("You searched for...") Add <!-- TMPL_VAR NAME="searchdesc" --> to template to take advantage of this change.

3.0.x
oleonard 18 years ago
parent
commit
534fe7fb6f
  1. 10
      search.marc/search.pl

10
search.marc/search.pl

@ -98,6 +98,7 @@ my $dbh = C4::Context->dbh;
my $startfrom=$query->param('startfrom');
$startfrom=0 if(!defined $startfrom);
my ($template, $loggedinuser, $cookie);
my $searchdesc;
my $resultsperpage;
if ($op eq "do_search") {
@ -107,6 +108,14 @@ if ($op eq "do_search") {
my @operator = $query->param('operator');
my @value = $query->param('value');
for (my $i=0;$i<=$#marclist;$i++) {
if ($searchdesc) { # don't put the and_or on the 1st search term
$searchdesc .= $and_or[$i]." ".$excluding[$i]." ".($marclist[$i]?$marclist[$i]:"*")." ".$operator[$i]." ".$value[$i]." " if ($value[$i]);
} else {
$searchdesc = $excluding[$i]." ".($marclist[$i]?$marclist[$i]:"*")." ".$operator[$i]." ".$value[$i]." " if ($value[$i]);
}
}
$resultsperpage= $query->param('resultsperpage');
$resultsperpage = 19 if(!defined $resultsperpage);
my $orderby = $query->param('orderby');
@ -194,6 +203,7 @@ if ($op eq "do_search") {
from=>$from,
to=>$to,
numbers=>\@numbers,
searchdesc=> $searchdesc,
MARC_ON => C4::Context->preference("marc"),
);

Loading…
Cancel
Save