Lines 510-519
if ($params->{'limit-yr'}) {
Link Here
|
510 |
my $scan = $params->{'scan'}; |
510 |
my $scan = $params->{'scan'}; |
511 |
my $count = C4::Context->preference('OPACnumSearchResults') || 20; |
511 |
my $count = C4::Context->preference('OPACnumSearchResults') || 20; |
512 |
my $countRSS = C4::Context->preference('numSearchRSSResults') || 50; |
512 |
my $countRSS = C4::Context->preference('numSearchRSSResults') || 50; |
513 |
my $results_per_page = $params->{'count'} || $count; |
513 |
my $results_per_page = $params->{'results_per_page'} || $cgi->cookie("results_per_page") || $count; |
514 |
my $offset = $params->{'offset'} || 0; |
|
|
515 |
my $page = $cgi->param('page') || 1; |
514 |
my $page = $cgi->param('page') || 1; |
516 |
$offset = ($page-1)*$results_per_page if $page>1; |
515 |
my $offset = $results_per_page != 'all' ? ($page-1)*$results_per_page : 0; |
517 |
my $hits; |
516 |
my $hits; |
518 |
my $expanded_facet = $params->{'expand'}; |
517 |
my $expanded_facet = $params->{'expand'}; |
519 |
|
518 |
|
Lines 594-599
if ($tag) {
Link Here
|
594 |
# FIXME: No facets for tags search. |
593 |
# FIXME: No facets for tags search. |
595 |
} elsif ($build_grouped_results) { |
594 |
} elsif ($build_grouped_results) { |
596 |
eval { |
595 |
eval { |
|
|
596 |
unless($results_per_page =~ /\d+/) { # all |
597 |
# pazpar2 expects $results_per_page to be an integer, we hack around |
598 |
# this by setting $results_per_page to the max value of a 32bit |
599 |
# signed int - as defined by parpaz2 session.c:perform_termlist() |
600 |
$results_per_page = 2147483647; |
601 |
} |
597 |
($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan); |
602 |
($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan); |
598 |
}; |
603 |
}; |
599 |
} else { |
604 |
} else { |
Lines 627-632
for (my $i=0;$i<@servers;$i++) {
Link Here
|
627 |
my $server = $servers[$i]; |
632 |
my $server = $servers[$i]; |
628 |
if ($server && $server =~/biblioserver/) { # this is the local bibliographic server |
633 |
if ($server && $server =~/biblioserver/) { # this is the local bibliographic server |
629 |
$hits = $results_hashref->{$server}->{"hits"}; |
634 |
$hits = $results_hashref->{$server}->{"hits"}; |
|
|
635 |
$results_per_page = $hits if $results_per_page == 'all'; |
630 |
my $page = $cgi->param('page') || 0; |
636 |
my $page = $cgi->param('page') || 0; |
631 |
my @newresults; |
637 |
my @newresults; |
632 |
if ($build_grouped_results) { |
638 |
if ($build_grouped_results) { |
Lines 778-784
for (my $i=0;$i<@servers;$i++) {
Link Here
|
778 |
if ($query_desc || $limit_desc) { |
784 |
if ($query_desc || $limit_desc) { |
779 |
$template->param(searchdesc => 1); |
785 |
$template->param(searchdesc => 1); |
780 |
} |
786 |
} |
781 |
$template->param(results_per_page => $results_per_page); |
787 |
$template->param(results_per_page => $results_per_page == $hits ? 'all' : $results_per_page); |
782 |
my $hide = C4::Context->preference('OpacHiddenItems'); |
788 |
my $hide = C4::Context->preference('OpacHiddenItems'); |
783 |
$hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines |
789 |
$hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines |
784 |
my $branch = ''; |
790 |
my $branch = ''; |
785 |
- |
|
|