From 1a157575d360d663aed2c3c56f70aeeef64ca762 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Thu, 16 Feb 2017 02:28:13 +0000 Subject: [PATCH] Bug 13205: Last/first page options for result list paging for OPAC Same fix but on OPAC side. Same test plan Sponsored-by: Catalyst IT Signed-off-by: Dilan Johnpulle Signed-off-by: Your Full Name Signed-off-by: Lee Jamison Signed-off-by: Nick Clemens Signed-off-by: Jonathan Druart --- .../bootstrap/en/includes/page-numbers.inc | 26 ++++++++++--------- opac/opac-search.pl | 2 ++ 2 files changed, 16 insertions(+), 12 deletions(-) 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 f18c9ce3fe..63e083e8ab 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc +++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc @@ -1,19 +1,21 @@ [% IF ( PAGE_NUMBERS ) %] [% END %] diff --git a/opac/opac-search.pl b/opac/opac-search.pl index c10e95890c..506fc57587 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -839,6 +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; # default page number my $current_page_number = 1; if ($offset) { @@ -889,6 +890,7 @@ for (my $i=0;$i<@servers;$i++) { } $template->param( PAGE_NUMBERS => \@page_numbers, + last_page => $last_page, previous_page_offset => $previous_page_offset) unless $pages < 2; $template->param(next_page_offset => $next_page_offset) unless $pages eq $current_page_number; } -- 2.39.5