query => $query,
type => "opac",
authnotrequired => 1,
- flagsrequired => {borrow => 1},
});
# we assume that C4::Search will validate these values for us
my @fields = ('keyword', 'subject', 'author', 'illustrator', 'itemnumber', 'isbn', 'date-before', 'date-after', 'class', 'dewey', 'branch', 'title', 'abstract', 'publisher');
-
-
# collect all the fields ...
my %search;
($startfrom+$num<=$count) ? ($template->param(endat => $startfrom+$num)) : ($template->param(endat => $count));
$template->param(numrecords => $count);
my $nextstartfrom=($startfrom+$num<$count) ? ($startfrom+$num) : (-1);
-my $prevstartfrom=($startfrom-$num>=0) ? ($startfrom-$num) : (-1);
+my $prevstartfrom=($startfrom-$num>=0) ? ($startfrom-$number_of_results) : (-1);
$template->param(nextstartfrom => $nextstartfrom);
my $displaynext=($nextstartfrom==-1) ? 0 : 1;
my $displayprev=($prevstartfrom==-1) ? 0 : 1;
my $numbers;
@$numbers = ();
-if ($count>10) {
- for (my $i=1; $i<$count/10+1; $i++) {
+if ($count>$number_of_results) {
+ for (my $i=1; $i<$count/$number_of_results+1; $i++) {
my $highlight=0;
my $themelang = $template->param('themelang');
- ($startfrom==($i-1)*10) && ($highlight=1);
- push @$numbers, { number => $i, highlight => $highlight , startfrom => ($i-1)*10 };
+ ($startfrom==($i-1)*$number_of_results+1) && ($highlight=1);
+ push @$numbers, { number => $i, highlight => $highlight , startfrom => ($i-1)*$number_of_results+1 };
}
}
-$template->param(numbers => $numbers);
+$template->param(numbers => $numbers,
+ LibraryName => C4::Context->preference("LibraryName"),
+);
output_html_with_http_headers $query, $cookie, $template->output;