Bugzilla – Attachment 117103 Details for
Bug 27728
Add a search box on OPAC search history
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 27728: Add a search box on OPAC Search history
Bug-27728-Add-a-search-box-on-OPAC-Search-history.patch (text/plain), 10.12 KB, created by
David Nind
on 2021-02-19 23:11:29 UTC
(
hide
)
Description:
Bug 27728: Add a search box on OPAC Search history
Filename:
MIME Type:
Creator:
David Nind
Created:
2021-02-19 23:11:29 UTC
Size:
10.12 KB
patch
obsolete
>From ce76d9bb3337680d683ceed7a0c41826092c574c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 19 Feb 2021 12:40:01 +0000 >Subject: [PATCH] Bug 27728: Add a search box on OPAC Search history > >This patch makes changes to the OPAC search history DataTables >configuration so that table controls appear, including search, copy, >CSV, and print. > >The patch also makes some improvements to the checkbox interactions: The >date column is now a label for the checkbox, and the "Remove selected >searched" button is now disabled until a checkbox has been checked. > >To test, apply the patch and log into the OPAC as a user with a search >history. If possible, past and current searches of both bibliographic >and authority records. > >- On the search history page, confirm that the DataTables controls > appear above each table: "Current" and "Previous" under both the > "Catalog" and "Authority" tabs. >- All controls should work correctly and affect only the corresponding > table: Search, Clear filter, Copy, CSV, and Print. >- Confirm that clicking a date in the date column checks the correct > checkbox. >- Confirm that toggling a checkbox correctly enables and disables the > "Remove selected searches" button as well as the "Select searches to:" > menu at the top of the table. > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../bootstrap/en/modules/opac-search-history.tt | 52 +++++++++++++++++----- > 1 file changed, 42 insertions(+), 10 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >index a971c17726..d16109819b 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-search-history.tt >@@ -73,8 +73,14 @@ > <tbody> > [% FOREACH s IN current_biblio_searches %] > <tr> >- <td class="selectcol"><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >- <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> >+ <td class="selectcol"> >+ <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >+ </td> >+ <td> >+ <label for="result[% s.id | html %]"> >+ <span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span> >+ </label> >+ </td> > <td> > <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&[% s.query_cgi | $raw %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss" aria-label="Subscribe to this search" class="rsssearchlink"> > <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i> >@@ -90,7 +96,7 @@ > </form> > [% END # IF ( current_biblio_searches ) %] > </div> <!-- / #current_biblio --> >- >+ <hr /> > <div id="previous_biblio"> > [% IF ( previous_biblio_searches ) %] > <h2>Previous sessions</h2> >@@ -110,8 +116,14 @@ > <tbody> > [% FOREACH s IN previous_biblio_searches %] > <tr> >- <td class="selectcol"><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >- <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> >+ <td class="selectcol"> >+ <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >+ </td> >+ <td> >+ <label for="result[% s.id | html %]"> >+ <span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span> >+ </label> >+ </td> > <td> > <a href="[% OPACBaseURL | url %]/cgi-bin/koha/opac-search.pl?[% query_cgi | $raw %][% limit_cgi | $raw %]&[% s.query_cgi | $raw %]&count=[% countrss | uri %]&sort_by=acqdate_dsc&format=rss" aria-label="Subscribe to this search" class="rsssearchlink"> > <i class="fa fa-rss rsssearchicon" aria-hidden="true" title="Subscribe to this search"></i> >@@ -154,8 +166,14 @@ > <tbody> > [% FOREACH s IN current_authority_searches %] > <tr> >- <td class="selectcol"><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >- <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> >+ <td class="selectcol"> >+ <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >+ </td> >+ <td> >+ <label for="result[% s.id | html %]"> >+ <span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span> >+ </label> >+ </td> > <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> > <td>[% s.total | html %]</td> > </tr> >@@ -183,8 +201,14 @@ > <tbody> > [% FOREACH s IN previous_authority_searches %] > <tr> >- <td class="selectcol"><input type="checkbox" name="id" value="[% s.id | html %]" /></td> >- <td><span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span></td> >+ <td class="selectcol"> >+ <input type="checkbox" name="id" value="[% s.id | html %]" id="result[% s.id | html %]" /> >+ </td> >+ <td> >+ <label for="result[% s.id | html %]"> >+ <span title="[% s.time | html %]">[% s.time |$KohaDates with_hours => 1 %]</span> >+ </label> >+ </td> > <td><a href="/cgi-bin/koha/opac-authorities-home.pl?[% s.query_cgi | $raw %]">[% s.query_desc | html %]</a></td> > <td>[% s.total | html %]</td> > </tr> >@@ -233,10 +257,15 @@ > // (so that the more recent query is shown first) > $(".historyt").dataTable($.extend(true, {}, dataTablesDefaults, { > "order": [[ 1, "desc" ]], >+ "dom": '<"top"<"table_entries"><"table_controls"fB>>t', > "columnDefs": [ > { "targets": [ 0 ], "sortable": false, "searchable": false }, > { "targets": [ 1 ], "type": "title-string" }, >- ] >+ ], >+ "language": { >+ "search": "_INPUT_", >+ "searchPlaceholder": _("Search") >+ } > })); > > [% IF Koha.Preference( 'OpacAuthorities' ) == 1 %]$('#tabs').tabs();[% END %] >@@ -271,6 +300,7 @@ > } > return false; > }); >+ $(".remove-selected").addClass("disabled"); > }); > > function enableCheckboxActions(form){ >@@ -279,9 +309,11 @@ > if ($(checkedBoxes).size()) { > $(form).find(".selections").html(_("With selected searches: ")); > $(form).find(".selections-toolbar .links a").removeClass("disabled"); >+ $(form).find(".remove-selected").removeClass("disabled"); > } else { > $(form).find(".selections").html(_("Select searches to: ")); > $(form).find(".selections-toolbar .links a").addClass("disabled"); >+ $(form).find(".remove-selected").addClass("disabled"); > } > } > >-- >2.11.0
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 27728
:
117083
|
117103
|
117724