Description
Katrin Fischer
2021-12-16 15:29:47 UTC
Created attachment 129812 [details] [review] 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. Note: This patch includes some whitespace changes, so diff accordingly. 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. - Perform the same test when placing a hold on multiple titles. Confirm that each table of items is sortable. Created attachment 129815 [details] [review] 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. Note: This patch includes some whitespace changes, so diff accordingly. 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. - Perform the same test when placing a hold on multiple titles. Confirm that each table of items is sortable. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> This works well and I am signing off on it but thought it would be worth mentioning that the QA tool says: FAIL koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt FAIL forbidden patterns forbidden pattern: Font Awesome icons need the aria-hidden attribute for accessibility purpose (see bug 25166) (line 378) I don't quite understand what would be wrong because the FA icon on line 378 does have the aria-hidden attribute: <i class="fa fa-remove danger" aria-hidden="true" title="Cannot be put on hold"></i> *** Bug 29972 has been marked as a duplicate of this bug. *** CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt Created attachment 130050 [details] [review] 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. Note: This patch includes some whitespace changes, so diff accordingly. 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. - Perform the same test when placing a hold on multiple titles. Confirm that each table of items is sortable. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 130864 [details] [review] 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. Note: This patch includes some whitespace changes, so diff accordingly. 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. - Perform the same test when placing a hold on multiple titles. Confirm that each table of items is sortable. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Not a big deal but I don't understand how the "Information" column is sorted: https://snipboard.io/zkms9E.jpg QA script raises an error, but it's not a regression: forbidden pattern: Font Awesome icons need the aria-hidden attribute for accessibility purpose (see bug 25166) (line 379) Arf sorry patch does not apply anymore. Looks like it is because of Bug 29660. I tried... but it's way too confusing for me. :( I don't have the time right now, but here is the result of the -w version of the local branch I have. That should make the patch easier to rewrite. 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 2d84cdffb44..424a26bac19 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt @@ -345,6 +345,7 @@ [% IF bibitemloo.itemholdable %] <table class="copiesrow table table-bordered table-striped" id="copiesrow_[% bibitemloo.biblionumber | html %]"> <caption>Select a specific item:</caption> + <thead> <tr> <th>Copy number</th> [% IF ( item_level_itypes ) %] @@ -365,10 +366,11 @@ <th>Notes</th> <th>Information</th> </tr> - + </thead> + <tbody> [% FOREACH itemLoo IN bibitemloo.itemLoop %] <tr class="[% itemLoo.backgroundcolor | html %]"> - <td class="copynumber"> + <td class="copynumber" data-order="[% itemLoo.copynumber | html %]"> [% IF ( itemLoo.available ) %] <input type="radio" class="checkitem checkitem_[% bibitemloo.biblionumber | html %]" name="checkitem_[% bibitemloo.biblionumber | html %]" value="[% itemLoo.itemnumber | html %]" /> [% ELSE %] @@ -451,6 +453,7 @@ </td> </tr> [% END # / FOREACH itemLoo IN bibitemloo.itemLoop%] + </tbody> </table> <!-- / #copiesrow_[% bibitemloo.biblionumber | html %] --> [% END # / IF ( bibitemloo.itemholdable )%] </div> <!-- / #hold-options-[% bibitemloo.biblionumber | html %] --> @@ -472,6 +475,7 @@ [% INCLUDE 'opac-bottom.inc' %] [% BLOCK jsinclude %] [% INCLUDE 'calendar.inc' %] + [% INCLUDE 'datatables.inc' %] <script> var MSG_NO_ITEM_SELECTED = _("Expecting a specific item selection."); @@ -673,6 +677,11 @@ return true; }); + $(".copiesrow").each(function(){ + $(this).DataTable({ + dom: "t" + }); + }); }); </script> [% END %] Created attachment 131206 [details] [review] 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. Created attachment 131410 [details] [review] 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. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> This works nicely, thx for rescuing the patch, Owen! Only 'nit-pick' I have that we offer sorting on the first column with the checkboxes, but that doesn't appear to work, so we might want to remove the sorting option there altogether. (QA follow-up?) Created attachment 132002 [details] [review] 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. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Pushed to master for 22.05, thanks to everybody involved [U+1F984] |