From d41eadc10d9d21b7b6a1b891bf549acbe5024019 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 --- catalogue/search.pl | 2 +- koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc | 14 +++++++++----- koha-tmpl/opac-tmpl/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 7b8e5e2..baeb8b8 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 d593cdf..4d9e291 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 63e083e..a3f35da 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 506fc57..d9c4505 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.1.4