From 3c97c19df7f0d7e2c4782f323a1c3794566145ec Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Thu, 22 Sep 2022 19:15:25 +1200 Subject: [PATCH] Bug 31611: Clearly highlight items that cannot be modified/deleted in the Batch item tools Test plan: 1. Apply patches 2. Check out an item with a different home branch than the library you're logged in as 3. Go to: 'Cataloguing' > 'Batch item deletion' 4. Into the barcode list area paste the checked-out item's barcode and the barcode of a non-checked out item (with the same home library as the branch you're logged in as) and submit the form 5. Observe in the table that loads the row containing the checked out item is highlighted yellow, and it has a red cross in the first column. 6. Hover over the red cross to see the reason why you cannot delete the item appears 7. Observe the non checked out item has a checkbox and is not highlighted yellow 8. Click 'Select all' and 'Clear all' links and notice the display of the checked out item remains unchanged 9. Change 'IndependentBranches' syspref = 'yes' 10. Log into the staff client as a patron with only the '(catalogue)', '(editcatalogue)', and '(tools)' permissions selected 11. Go to: 'Cataloguing' > 'Batch item modification' 12. Enter the checked-out item's barcode and a non-checked out item's barcode and submit the form 13. Observe the table row for the checked out item is again highlighted yellow, with a red cross. 14. Hover over the red cross and observe the text 'Cannot edit' is shown 15. Observe the non-checked out item is not highlighted yellow and does have a checkbox Sponsored-by: Toi Ohomai Institute of Technology, New Zealand Signed-off-by: David Nind --- .../intranet-tmpl/prog/en/includes/html_helpers.inc | 12 +++++++++--- koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js | 3 +++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc index 52d645f255..39fcaae30c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc @@ -268,7 +268,9 @@ [% item.index + 1 | html %] [% IF checkboxes_edit %] [% UNLESS can_be_edited%] - Cannot edit + + + [% ELSE %] @@ -276,7 +278,9 @@ [% END %] [% ELSIF checkboxes_delete %] [% UNLESS can_be_edited %] - Cannot delete + + + [% ELSE %] [% IF item.safe_to_delete %] @@ -293,7 +297,9 @@ [% END %] [% END %] - + + + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js b/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js index 4d178d29d5..56d5270a53 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js +++ b/koha-tmpl/intranet-tmpl/prog/js/pages/batchMod.js @@ -127,6 +127,9 @@ $(document).ready(function () { ], "bPaginate": false, })); + // Highlight in yellow item rows that cannot be deleted + $(".error").parents('tr').find('td').css('background-color', '#ffff99'); + $("#selectallbutton").click(function (e) { e.preventDefault(); $("#itemst input:checkbox").each(function () { -- 2.30.2