Lines 546-551
for (my $i=0;$i<@servers;$i++) {
Link Here
|
546 |
my @newresults = searchResults('intranet', $query_desc, $hits, $results_per_page, $offset, $scan, |
546 |
my @newresults = searchResults('intranet', $query_desc, $hits, $results_per_page, $offset, $scan, |
547 |
$results_hashref->{$server}->{"RECORDS"}); |
547 |
$results_hashref->{$server}->{"RECORDS"}); |
548 |
$total = $total + $results_hashref->{$server}->{"hits"}; |
548 |
$total = $total + $results_hashref->{$server}->{"hits"}; |
|
|
549 |
|
550 |
# Search history |
551 |
if (C4::Context->preference('EnableSearchHistory')) { |
552 |
unless ( $offset ) { |
553 |
my $path_info = $cgi->url(-path_info=>1); |
554 |
my $query_cgi_history = $cgi->url(-query=>1); |
555 |
$query_cgi_history =~ s/^$path_info\?//; |
556 |
$query_cgi_history =~ s/;/&/g; |
557 |
my $query_desc_history = $query_desc; |
558 |
$query_desc_history .= ", $limit_desc" |
559 |
if $limit_desc; |
560 |
|
561 |
C4::Search::History::add({ |
562 |
userid => $borrowernumber, |
563 |
sessionid => $cgi->cookie("CGISESSID"), |
564 |
query_desc => $query_desc_history, |
565 |
query_cgi => $query_cgi_history, |
566 |
total => $total, |
567 |
type => "biblio", |
568 |
}); |
569 |
} |
570 |
$template->param( EnableSearchHistory => 1 ); |
571 |
} |
572 |
|
549 |
## If there's just one result, redirect to the detail page |
573 |
## If there's just one result, redirect to the detail page |
550 |
if ($total == 1) { |
574 |
if ($total == 1) { |
551 |
my $biblionumber = $newresults[0]->{biblionumber}; |
575 |
my $biblionumber = $newresults[0]->{biblionumber}; |
Lines 654-682
for (my $i=0;$i<@servers;$i++) {
Link Here
|
654 |
$template->param(searchdesc => 1,query_desc => $query_desc,limit_desc => $limit_desc); |
678 |
$template->param(searchdesc => 1,query_desc => $query_desc,limit_desc => $limit_desc); |
655 |
} |
679 |
} |
656 |
|
680 |
|
657 |
# Search history |
|
|
658 |
if (C4::Context->preference('EnableSearchHistory')) { |
659 |
unless ( $offset ) { |
660 |
my $path_info = $cgi->url(-path_info=>1); |
661 |
my $query_cgi_history = $cgi->url(-query=>1); |
662 |
$query_cgi_history =~ s/^$path_info\?//; |
663 |
$query_cgi_history =~ s/;/&/g; |
664 |
my $query_desc_history = $query_desc; |
665 |
$query_desc_history .= ", $limit_desc" |
666 |
if $limit_desc; |
667 |
|
668 |
C4::Search::History::add({ |
669 |
userid => $borrowernumber, |
670 |
sessionid => $cgi->cookie("CGISESSID"), |
671 |
query_desc => $query_desc_history, |
672 |
query_cgi => $query_cgi_history, |
673 |
total => $total, |
674 |
type => "biblio", |
675 |
}); |
676 |
} |
677 |
$template->param( EnableSearchHistory => 1 ); |
678 |
} |
679 |
|
680 |
} # end of the if local |
681 |
} # end of the if local |
681 |
|
682 |
|
682 |
# asynchronously search the authority server |
683 |
# asynchronously search the authority server |