Bug 20554: (follow-up) Add local font files and add method for loading them
[koha.git] / catalogue / search.pl
index 27b36b7..842ada5 100755 (executable)
@@ -399,7 +399,7 @@ my %is_nolimit = map { $_ => 1 } @nolimits;
 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  '()');
 }
 
@@ -619,8 +619,11 @@ for (my $i=0;$i<@servers;$i++) {
             ## 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;