Bugzilla – Attachment 131206 Details for
Bug 29713
Make item table when placing an item level hold sortable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 29713: Make item table when placing an item level hold sortable
Bug-29713-Make-item-table-when-placing-an-item-lev.patch (text/plain), 4.59 KB, created by
Owen Leonard
on 2022-03-01 19:09:44 UTC
(
hide
)
Description:
Bug 29713: Make item table when placing an item level hold sortable
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2022-03-01 19:09:44 UTC
Size:
4.59 KB
patch
obsolete
>From 4bd878997c3c28e2d9a5c4d633fc9ab25e98efde Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 24 Feb 2022 16:43:14 +0000 >Subject: [PATCH] Bug 29713: Make item table when placing an item level hold > sortable > >This patch modifies the holds page in the OPAC so that users selecting a >specific item to place a hold on can sort the table of items. > >This patch also removes some obsolete JavaScript left over from before >Flatpickr. > >To test, apply the patch and go to Administration -> Circulation and >fine rules to make sure at least one item type in your system has >"OPAC item level holds" set to "allow." > >- Log in to the OPAC as a user who can place holds. >- Search the catalog for items which will accept item-level holds. >- Place a hold on one of the results, and click the "Show more options" > link on the holds page. > - Check the "specific item" radio button. > - A table of items should be displayed. Confirm that the table is > sortable. > - The first entry in the table should be selected. > - Perform the same test when placing a hold on multiple titles. > Confirm that each table of items is sortable. >--- > .../bootstrap/en/modules/opac-reserve.tt | 32 +++++++------------ > 1 file changed, 11 insertions(+), 21 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index aff10f9f33..dab9757844 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -344,7 +344,7 @@ > > [% IF bibitemloo.itemholdable %] > <div id="copiesrow_[% bibitemloo.biblionumber | html %]" class="copiesrow"> >- <table class="table table-bordered table-striped"> >+ <table class="table table-bordered table-striped itemstable"> > <caption>Select a specific item:</caption> > <thead> > <tr> >@@ -378,7 +378,7 @@ > [% ELSE %] > <tr class="holdable"> > [% END %] >- <td class="copynumber"> >+ <td class="copynumber" data-order="[% itemLoo.copynumber | html %]"> > <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" /> > [% ELSE %] > [% SET unholdable_items = 1 %] >@@ -493,21 +493,10 @@ > [% INCLUDE 'opac-bottom.inc' %] > [% BLOCK jsinclude %] > [% INCLUDE 'calendar.inc' %] >+[% INCLUDE 'datatables.inc' %] > <script> > var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection."); > >- // Clear the contents of an input field >- $(".clearfield").on("click",function(e){ >- $(this).closest("td").find("input").val(""); >- e.preventDefault(); >- }); >- >- // Select the first item available >- function select_first_available(id){ >- var radios = $("input:radio[name='checkitem_" + id + "']"); >- $(radios).first().attr("checked", "checked"); >- } >- > $(document).ready(function() { > > $(".toggle_unholdable").click(function(e){ >@@ -600,12 +589,6 @@ > // onload, selectany is checked > $(".selectany").attr("checked", "checked"); > >- // If the user is *allowed* to choose a specific item >- // The first one is preselected >- $(".copiesrow table").each(function(){ >- var id = suffixOf($(this).closest('div').attr("id"), "_"); >- select_first_available(id); >- }); > > // On confirmsjs change > $(".confirmjs").change(function(){ >@@ -699,7 +682,14 @@ > > return true; > }); >- >+ $(".itemstable").each(function(){ >+ $(this).DataTable({ >+ dom: "t", >+ initComplete: function() { >+ this.find("input:radio").first().prop("checked", true ); >+ } >+ }); >+ }); > }); > </script> > [% END %] >-- >2.20.1
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 29713
:
129812
|
129815
|
130050
|
130864
|
131206
|
131410
|
132002