From 5fc0a1f5b1ad58b4fa0a538cef5d2106fd39c71a Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 27 Jun 2017 04:36:56 +0000 Subject: [PATCH] Bug 13205: [FOLLOW-UP] Some extra logic See Comment 8. Test: When on first page of results, confirm that the 'First' and 'Previous' buttons do not show. Confirm they come back on the second page and every page after. When on last page of results, confirm that the 'Last' and 'Next' buttons do not show. Confirm they come back on all previous pages. Check on both staff side and OPAC. Sponsored-by: Catalyst IT Signed-off-by: Lee Jamison Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- catalogue/search.pl | 2 +- .../prog/en/includes/page-numbers.inc | 14 +++++++++----- .../bootstrap/en/includes/page-numbers.inc | 4 ++-- opac/opac-search.pl | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 7b8e5e2818..baeb8b8a0d 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -617,7 +617,7 @@ for (my $i=0;$i<@servers;$i++) { my @page_numbers; # total number of pages there will be my $pages = ceil($hits / $results_per_page); - my $last_page = ($pages * $results_per_page) - $results_per_page; + my $last_page = $pages * ( $results_per_page - 1 ); # default page number my $current_page_number = 1; $current_page_number = ($offset / $results_per_page + 1) if $offset; 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 d593cdf661..4d9e291b85 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc @@ -1,7 +1,9 @@ [% IF ( PAGE_NUMBERS ) %][% END %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc index 63e083e8ab..a3f35da4e4 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc @@ -1,8 +1,8 @@ [% IF ( PAGE_NUMBERS ) %] [% END %] diff --git a/opac/opac-search.pl b/opac/opac-search.pl index 506fc57587..d9c4505fd7 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -839,7 +839,7 @@ for (my $i=0;$i<@servers;$i++) { my @page_numbers; # total number of pages there will be my $pages = ceil($hits / $results_per_page); - my $last_page = ($pages * $results_per_page) - $results_per_page; + my $last_page = $pages * ( $results_per_page - 1 ); # default page number my $current_page_number = 1; if ($offset) { -- 2.39.5