From 5e98e913dc98ced7167e73932ce865a952db6b1c Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Thu, 19 Apr 2018 23:13:49 +0000 Subject: [PATCH] Bug 19502: (follow-up) Pass parameters to avoid making templates depend on search engine https://bugs.koha-community.org/show_bug.cgi?id=19502 Signed-off-by: Nick Clemens Signed-off-by: Alex Arnaud Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- catalogue/search.pl | 2 ++ koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc | 2 +- .../opac-tmpl/bootstrap/en/includes/search/page-numbers.inc | 2 +- opac/opac-search.pl | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 7e2e300523..633200d848 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -620,6 +620,7 @@ for (my $i=0;$i<@servers;$i++) { ## Build the page numbers on the bottom of the page my @page_numbers; my $hits_to_paginate = C4::Context->preference('SearchEngine') eq 'Elasticsearch' ? 10000 : $hits; + $template->param( hits_to_paginate => $hits_to_paginate ); # total number of pages there will be my $pages = ceil($hits_to_paginate / $results_per_page); my $last_page_offset = ( $pages -1 ) * $results_per_page; @@ -676,6 +677,7 @@ for (my $i=0;$i<@servers;$i++) { last_page_offset => $last_page_offset, previous_page_offset => $previous_page_offset) unless $pages < 2; $template->param( next_page_offset => $next_page_offset) unless $pages eq $current_page_number; + warn "topage $hits_to_paginate"; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc index 387d09f2fb..599907e5c7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc @@ -1,5 +1,5 @@ [% IF ( PAGE_NUMBERS ) %]