# IMO this subroutine is pretty messy still -- it's responsible for
# building the HTML output for the template
sub searchResults {
- my ( $searchdesc, $hits, $results_per_page, $offset, @marcresults ) = @_;
+ my ( $searchdesc, $hits, $results_per_page, $offset, $scan, @marcresults ) = @_;
my $dbh = C4::Context->dbh;
my $even = 1;
my @newresults;
}
# XSLT processing of some stuff
- if (C4::Context->preference("XSLTResultsDisplay") ) {
+ if (C4::Context->preference("XSLTResultsDisplay") && !$scan) {
my $newxmlrecord = XSLTParse4Display($oldbiblio->{biblionumber},C4::Context->config('opachtdocs')."/prog/en/xslt/MARC21slim2OPACResults.xsl");
$oldbiblio->{XSLTResultsRecord} = $newxmlrecord;
}
if ($server =~/biblioserver/) { # this is the local bibliographic server
$hits = $results_hashref->{$server}->{"hits"};
my $page = $cgi->param('page') || 0;
- my @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,@{$results_hashref->{$server}->{"RECORDS"}});
+ my @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,$scan,@{$results_hashref->{$server}->{"RECORDS"}});
$total = $total + $results_hashref->{$server}->{"hits"};
## If there's just one result, redirect to the detail page
if ($total == 1) {
# format output
my $total = scalar @$marcresults;
- my @newresults = searchResults( $query, $total, $results_per_page, $page-1, @$marcresults );
+ my @newresults = searchResults( $query, $total, $results_per_page, $page-1, 0, @$marcresults );
$template->param(
total => $total,
query => $query,
# because pazGetRecords handles retieving only the records
# we want as specified by $offset and $results_per_page,
# we need to set the offset parameter of searchResults to 0
- my @group_results = searchResults( $query_desc, $group->{'group_count'},$results_per_page, 0,
+ my @group_results = searchResults( $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
@{ $group->{"RECORDS"} });
push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results };
}
} else {
- @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,@{$results_hashref->{$server}->{"RECORDS"}});
+ @newresults = searchResults( $query_desc,$hits,$results_per_page,$offset,$scan,@{$results_hashref->{$server}->{"RECORDS"}});
}
my $tag_quantity;
if (C4::Context->preference('TagsEnabled') and