Bugzilla – Attachment 64983 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]
[SIGNED-OFF] Bug 13205: [FOLLOW-UP] Some extra logic
SIGNED-OFF-Bug-13205-FOLLOW-UP-Some-extra-logic.patch (text/plain), 6.73 KB, created by
Lee Jamison
on 2017-07-10 19:44:29 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 13205: [FOLLOW-UP] Some extra logic
Filename:
MIME Type:
Creator:
Lee Jamison
Created:
2017-07-10 19:44:29 UTC
Size:
6.73 KB
patch
obsolete
>From 5455762e1ed63885d2c301c1bc1d22409186144e Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Tue, 27 Jun 2017 04:36:56 +0000 >Subject: [PATCH] [SIGNED-OFF] 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 <ldjamison@marywood.edu> >--- > 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 06a377c..62d9605 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) - $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 ) %]<nav><ul class="pagination"> >- <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]">First</a></li> >- <!-- Row of numbers corresponding to search result pages --> >- [% IF ( previous_page_offset.defined ) %]<li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% previous_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]"><< Previous</a></li>[% END %] >+ [% IF ( previous_page_offset.defined ) %] >+ <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]">First</a></li> >+ <!-- Row of numbers corresponding to search result pages --> >+ <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% previous_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]"><< Previous</a></li> >+ [% END %] > [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %] > [% IF ( PAGE_NUMBER.highlight ) %] > <li class="active"><span>[% PAGE_NUMBER.pg %]</span></li> >@@ -9,6 +11,8 @@ > <li><a href="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% PAGE_NUMBER.offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]">[% PAGE_NUMBER.pg %]</a></li> > [% END %] > [% 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>[% END %] >- <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> >+ [% 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> >+ [% 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 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 ) %] > <div class="pagination pagination-small noprint"> > <ul> >- <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">First</a></li> > [% IF ( previous_page_offset.defined ) %] >+ <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">First</a></li> > <li><a href="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset=[% previous_page_offset %][% IF ( sort_by ) %]&sort_by=[% sort_by |html %][% END %]">« Previous</a></li> > [% END %] > [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %] >@@ -14,8 +14,8 @@ > [% 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> > [% END %] >- <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> > </ul> > </div> > [% END %] >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 7e34aa5..332ed84 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) - $results_per_page; >+ my $last_page = $pages * ( $results_per_page - 1 ); > # default page number > my $current_page_number = 1; > if ($offset) { >-- >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