Bugzilla – Attachment 60248 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: Last/first page options for result list paging
Bug-13205-Lastfirst-page-options-for-result-list-p.patch (text/plain), 4.51 KB, created by
Marc Véron
on 2017-02-15 09:47:32 UTC
(
hide
)
Description:
Bug 13205: Last/first page options for result list paging
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2017-02-15 09:47:32 UTC
Size:
4.51 KB
patch
obsolete
>From d75c063becc59079bef1524f583f1aca04b86535 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Wed, 15 Feb 2017 02:42:10 +0000 >Subject: [PATCH] Bug 13205: Last/first page options for result list paging >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This patch adds first and last page buttons to the pagination at the >bottom of a page of catalog search results. > >To test: >1) Apply patch >2) Do a number of searches >3) For each search, ensure that the first and last page buttons work as >expected > >Sponsored-by: Catalyst IT > >Followed test plan, works as expected. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > catalogue/search.pl | 2 ++ > koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc | 13 ++++++++++--- > 2 files changed, 12 insertions(+), 3 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index e4e5e66..1031623 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -615,6 +615,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; > $current_page_number = ($offset / $results_per_page + 1) if $offset; >@@ -665,6 +666,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, > 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 bf277c0..d593cdf 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,14 @@ > [% 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 %] >- [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %][% IF ( PAGE_NUMBER.highlight ) %]<li class="active"><span>[% PAGE_NUMBER.pg %]</span></li>[% ELSE %]<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 %] >+ [% 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 %] >+ [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %] >+ [% IF ( PAGE_NUMBER.highlight ) %] >+ <li class="active"><span>[% PAGE_NUMBER.pg %]</span></li> >+ [% ELSE %] >+ <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 %] >+ [% 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> > </ul></nav>[% END %] >-- >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