Bugzilla – Attachment 60301 Details for
Bug 18128
'Go to page' option for search results in opac and staff
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18128: Go to page option for search results in OPAC and staff
Bug-18128-Go-to-page-option-for-search-results-in-.patch (text/plain), 7.35 KB, created by
Aleisha Amohia
on 2017-02-16 03:32:13 UTC
(
hide
)
Description:
Bug 18128: Go to page option for search results in OPAC and staff
Filename:
MIME Type:
Creator:
Aleisha Amohia
Created:
2017-02-16 03:32:13 UTC
Size:
7.35 KB
patch
obsolete
>From 1c11a9d7a075b42a6b25a58bb5c40397ffc48488 Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 16 Feb 2017 03:29:55 +0000 >Subject: [PATCH] Bug 18128: Go to page option for search results in OPAC and > staff > >This patch adds a dropdown of all available search result pages for a >user to jump to. > >To test: >1) Apply Bug 13205 >2) Do a search in OPAC and in staff client >3) Try to jump to different pages in the dropdown, confirm they always >work > >Sponsored-by: Catalyst IT >--- > .../prog/en/includes/page-numbers.inc | 43 +++++++++++++++------- > .../prog/en/modules/catalogue/results.tt | 4 ++ > .../bootstrap/en/includes/page-numbers.inc | 10 +++++ > .../opac-tmpl/bootstrap/en/modules/opac-results.tt | 6 +++ > 4 files changed, 49 insertions(+), 14 deletions(-) > >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..6cb0b97 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/page-numbers.inc >@@ -1,14 +1,29 @@ >-[% 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 %] >- [% 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 %] >+[% 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 %] >+ [% 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> >+ <li> <label for="goto_page">Go to page: </label> >+ <select name="goto_page" id="goto_page"> >+ [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %] >+ [% IF ( PAGE_NUMBER.highlight ) %] >+ <option value="[% PAGE_NUMBER.offset %]" selected>[% PAGE_NUMBER.pg %]</option> >+ [% ELSE %] >+ <option value="[% PAGE_NUMBER.offset %]">[% PAGE_NUMBER.pg %]</option> >+ [% END %] >+ [% END %] >+ </select> >+ </li> >+ </ul> >+ </nav> >+[% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >index b9861bc..7e707fa 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -72,6 +72,10 @@ function cartList(){ > } > } > $(document).ready(function() { >+$("#goto_page").change(function() { >+ var offset = $("#goto_page").find("option:selected").attr("value"); >+ window.location="/cgi-bin/koha/catalogue/search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset="+offset+"[% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]"; >+}); > $("#cartsubmit").click(function(){ > cartList(); > return false; >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..215fcb9 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/includes/page-numbers.inc >@@ -17,5 +17,15 @@ > [% 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> >+ <label for="goto_page">Go to page: </label> >+ <select name="goto_page" id="goto_page"> >+ [% FOREACH PAGE_NUMBER IN PAGE_NUMBERS %] >+ [% IF ( PAGE_NUMBER.highlight ) %] >+ <option value="[% PAGE_NUMBER.offset %]" selected>[% PAGE_NUMBER.pg %]</option> >+ [% ELSE %] >+ <option value="[% PAGE_NUMBER.offset %]">[% PAGE_NUMBER.pg %]</option> >+ [% END %] >+ [% END %] >+ </select> > </div> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index 2d85671..30fb764 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -700,6 +700,12 @@ function highlightOn() { > } > [% END %] > $(document).ready(function(){ >+ >+ $("#goto_page").change(function() { >+ var offset = $("#goto_page").find("option:selected").attr("value"); >+ window.location="/cgi-bin/koha/opac-search.pl?[% query_cgi |html %][% limit_cgi |html %]&offset="+offset+"[% IF ( sort_by ) %]&sort_by=[% sort_by |url %][% END %]"; >+ }); >+ > [% IF ( OpacHighlightedWords ) %] > $('a.title').each(function() { > $(this).attr("href", $(this).attr("href") + "&query_desc=[% query_desc | uri %]"); >-- >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 18128
:
60301
|
64940
|
64980
|
67778
|
68306
|
68325
|
68326
|
68720
|
68721