Bugzilla – Attachment 64938 Details for
Bug 13205
Last/First page options for result list paging
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13205: [FOLLOW-UP] Fixing math and variable names
Bug-13205-FOLLOW-UP-Fixing-math-and-variable-names.patch (text/plain), 5.15 KB, created by
Aleisha Amohia
on 2017-07-10 00:10:58 UTC
(
hide
)
Description:
Bug 13205: [FOLLOW-UP] Fixing math and variable names
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-07-10 00:10:58 UTC
Size:
5.15 KB
patch
obsolete
>From d7f9b807d2823f95027cfadf72b14897b2212f11 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Mon, 10 Jul 2017 00:07:38 +0000 >Subject: [PATCH] Bug 13205: [FOLLOW-UP] Fixing math and variable names > >Have changed > my $last_page = $pages * ( $results_per_page - 1 ); >to > my $last_page = ( $pages - 1) * $results_per_page; >which seems to fix the 'last' button offset! (Comment 10) > >Will add the box to jump to a page in a separate patch. >Adding the pagination to the top on the staff client will be dealt with >in Bug 18916 as it is slightly out of the scope of this bug. >--- > catalogue/search.pl | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc | 2 +- > opac/opac-search.pl | 4 ++-- > 4 files changed, 6 insertions(+), 6 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index 9350a1a..53fea0b 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -616,7 +616,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 - 1 ); >+ my $last_page_offset = ( $pages -1 ) * $results_per_page; > # default page number > my $current_page_number = 1; > $current_page_number = ($offset / $results_per_page + 1) if $offset; >@@ -667,7 +667,7 @@ for (my $i=0;$i<@servers;$i++) { > } > # FIXME: no previous_page_offset when pages < 2 > $template->param( PAGE_NUMBERS => \@page_numbers, >- last_page => $last_page, >+ 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; > } >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 4d9e291..1c9bd33 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc >@@ -13,6 +13,6 @@ > [% END %] > [% IF ( next_page_offset ) %] > <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% next_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]">Next >></a></li> >- <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% last_page %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]">Last</a></li> >+ <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% last_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]">Last</a></li> > [% END %] > </ul></nav>[% 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 a3f35da..fbfdfc8 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >@@ -14,7 +14,7 @@ > [% END %] > [% IF ( next_page_offset ) %] > <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% next_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">Next »</a></li> >- <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% last_page %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">Last</a></li> >+ <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% last_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">Last</a></li> > [% END %] > </ul> > </div> >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 332ed84..43f13e5 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -838,7 +838,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 - 1 ); >+ my $last_page_offset = ( $pages - 1 ) * $results_per_page; > # default page number > my $current_page_number = 1; > if ($offset) { >@@ -889,7 +889,7 @@ for (my $i=0;$i<@servers;$i++) { > > } > $template->param( PAGE_NUMBERS => \@page_numbers, >- last_page => $last_page, >+ 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; > } >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13205
:
60229
|
60248
|
60300
|
61194
|
64670
|
64938
|
64981
|
64982
|
64983
|
64984
|
67774
|
67775
|
67776
|
67777