if($params->{'multibranchlimit'}) {
my $search_group = Koha::Library::Groups->find( $params->{multibranchlimit} );
my @libraries = $search_group->all_libraries;
- my $multibranch = '('.join( " or ", map { 'branch: ' . $_->id } @libraries ) .')';
+ my $multibranch = '('.join( " or ", map { 'branch: ' . $_->branchcode } @libraries ) .')';
push @limits, $multibranch if ($multibranch ne '()');
}
## FIXME: add a global function for this, it's better than the current global one
## Build the page numbers on the bottom of the page
my @page_numbers;
+ my $max_result_window = $searcher->max_result_window;
+ my $hits_to_paginate = ($max_result_window && $max_result_window < $hits) ? $max_result_window : $hits;
+ $template->param( hits_to_paginate => $hits_to_paginate );
# total number of pages there will be
- my $pages = ceil($hits / $results_per_page);
+ my $pages = ceil($hits_to_paginate / $results_per_page);
my $last_page_offset = ( $pages -1 ) * $results_per_page;
# default page number
my $current_page_number = 1;