Bug 31611 - More visibly highlight records that cannot be batch deleted/modified
Summary: More visibly highlight records that cannot be batch deleted/modified
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Tools (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Alex Buckley
QA Contact: Marcel de Rooy
URL:
Keywords: Academy
: 34089 (view as bug list)
Depends on: 32550
Blocks:
  Show dependency treegraph
 
Reported: 2022-09-23 01:51 UTC by Alex Buckley
Modified: 2023-06-28 05:02 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement more clearly emphasises records that cannot be modified or deleted in the 'Batch record deletion', 'Batch item modification', and 'Batch item deletion' tools. Rows are now highlighted in yellow, with a red 'X' in the first column (hovering over the red 'X' shows the reason it cannot be modified or deleted).
Version(s) released in:
23.05.00


Attachments
Bug 31611: Clearly highlight items that cannot be modified/deleted in the Batch item tools (5.69 KB, patch)
2022-09-23 02:23 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool (2.23 KB, patch)
2022-09-23 02:24 UTC, Alex Buckley
Details | Diff | Splinter Review
Batch record deletion tool with the second patch applied clearly highlighting which record cannot be deleted (76.74 KB, image/png)
2022-09-23 02:26 UTC, Alex Buckley
Details
Bug 31611: Clearly highlight items that cannot be modified/deleted in the Batch item tools (4.69 KB, patch)
2022-12-30 00:47 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool (2.23 KB, patch)
2022-12-30 00:48 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool (2.24 KB, patch)
2022-12-30 00:57 UTC, Alex Buckley
Details | Diff | Splinter Review
Bug 31611: Clearly highlight items that cannot be modified/deleted in the Batch item tools (4.74 KB, patch)
2023-01-01 23:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool (2.28 KB, patch)
2023-01-01 23:05 UTC, David Nind
Details | Diff | Splinter Review
Bug 31611: Clearly highlight items that cannot be modified/deleted in the Batch item tools (4.83 KB, patch)
2023-02-24 09:42 UTC, Marcel de Rooy
Details | Diff | Splinter Review
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool (2.38 KB, patch)
2023-02-24 09:42 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buckley 2022-09-23 01:51:23 UTC
Currently, on the 'Batch item deletion', 'Batch item modification', and 'Batch record deletion' tools if a record cannot be modified/deleted it is displayed in the table of records with a disabled (greyed-out) checkbox.

To replicate:
1. Check out an item
2. Go to Tools > Batch item deletion
3. Enter the barcode of the checked-out item and submit
4. Observe the item is displayed in a table with a disabled checkbox
5. Select 'Delete selected items'
6. Notice the checked-out item is not deleted 

When libraries are modifying/deleting large numbers of records it's easy for them to miss the disabled checkboxes when scrolling through the table. The consequence of this is then wondering why some records have not been modified/deleted.

It would be useful to more clearly highlight records that cannot be modified/deleted for these tools.

Proposed solution:
- Replace the disabled checkbox with a red cross (like those displayed beside items on hold pages when you're not allowed to place item-level holds).

- Highlight the entire row for the record that cannot be modified/deleted with a yellow background.

- In the 'Batch item deletion' and 'Batch item modification' remove the 'Clear on loan' link - introduced in bug 10599 - as removing the disabled checkboxes would make this redundant.

---

I could not see disabled checkboxes in use in the 'Batch patron deletion and anonymisation', 'Batch patron modification', 'Batch extend due dates', or 'Batch record modification. However, I may have missed it so please do let me know if it is present there so I can apply my proposed solution to those pages to for consistency :)
Comment 1 Alex Buckley 2022-09-23 02:23:44 UTC
Created attachment 140878 [details] [review]
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: Tools > '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)' and '(tools)'
permissions selected
11. Go to: Tools > '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
Comment 2 Alex Buckley 2022-09-23 02:24:16 UTC
Created attachment 140879 [details] [review]
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool

Test plan:
1. Apply patch
2. Check out an item
3. Go to: Tools > 'Batch record deletion'
4. Into the 'Enter a list of record numbers' area paste in the
biblionumber belonging to the checked-out item and that of a biblio without checked out items
5. Submit the form
6. Observe the row of the biblio with checked-out items is highlighted yellow, with a
red cross in the first column
7. Hover over the red cross to see the reason why the biblio cannot be
deleted
8. Observe the row of the biblio without checked-out items is not
highlighted yellow, and does have a checkbox in the first column
9. Click 'Delete selected records'
10. Confirm the biblio without checked-out items is successfully deleted

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Comment 3 Alex Buckley 2022-09-23 02:24:41 UTC
Ready for testing
Comment 4 Alex Buckley 2022-09-23 02:26:31 UTC
Created attachment 140880 [details]
Batch record deletion tool with the second patch applied clearly highlighting which record cannot be deleted
Comment 5 Barbara Johnson 2022-09-26 14:43:16 UTC
This is a really nice usability enhancement.
Comment 6 Jonathan Druart 2022-10-14 14:25:59 UTC
Why did you remove "Clear on loan"?
Comment 7 Katrin Fischer 2022-10-16 14:29:29 UTC
2 small things:

1) QA test tools failure:

 FAIL	koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers.inc
   FAIL	  forbidden patterns
		forbidden pattern: tab char (line 283)

2) The removed bit Jonathan noted, maybe a rebase issue?

-                <a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a> | <a id="clearonloanbutton" href="#">Clear on loan</a>
+                <a id="selectallbutton" href="#"><i class="fa fa-check"></i> Select all</a> | <a id="clearallbutton" href="#"><i class="fa fa-remove"></i> Clear all</a>

-    $("#clearonloanbutton").click(function () {
-        $("#itemst input[name='itemnumber'][data-is-onloan='1']").each(function () {
-            $(this).prop('checked', false);
-        });
-        return false;
-    });
Comment 8 Katrin Fischer 2022-10-16 14:43:44 UTC
Hm. testing this, I don't see the 'select on loan' filter without the patch either... So maybe this was just removing dead code?

I think bringing back the option to remove all records from the list that have items checked out could still be useful to bring back. So maybe we should keep the code and file a new bug?

Alex, could you have a look?
Comment 9 Alex Buckley 2022-12-15 21:44:08 UTC
(In reply to Katrin Fischer from comment #8)
> Hm. testing this, I don't see the 'select on loan' filter without the patch
> either... So maybe this was just removing dead code?
> 
> I think bringing back the option to remove all records from the list that
> have items checked out could still be useful to bring back. So maybe we
> should keep the code and file a new bug?
> 
> Alex, could you have a look?

Hi Katrin, 

I am back from leave now, and will take a look at this. 

Thanks,
Alex
Comment 10 Alex Buckley 2022-12-30 00:47:36 UTC
Created attachment 144888 [details] [review]
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
Comment 11 Alex Buckley 2022-12-30 00:48:01 UTC
Created attachment 144889 [details] [review]
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool

Test plan:
1. Apply patch
2. Check out an item
3. Go to: Tools > 'Batch record deletion'
4. Into the 'Enter a list of record numbers' area paste in the
biblionumber belonging to the checked-out item and that of a biblio without checked out items
5. Submit the form
6. Observe the row of the biblio with checked-out items is highlighted yellow, with a
red cross in the first column
7. Hover over the red cross to see the reason why the biblio cannot be
deleted
8. Observe the row of the biblio without checked-out items is not
highlighted yellow, and does have a checkbox in the first column
9. Click 'Delete selected records'
10. Confirm the biblio without checked-out items is successfully deleted

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Comment 12 Alex Buckley 2022-12-30 00:57:08 UTC
Created attachment 144890 [details] [review]
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool

Test plan:
1. Apply patch
2. Check out an item
3. Go to: 'Cataloguing' > 'Batch record deletion'
4. Into the 'Enter a list of record numbers' area paste in the
biblionumber belonging to the checked-out item and that of a biblio without checked out items
5. Submit the form
6. Observe the row of the biblio with checked-out items is highlighted yellow, with a
red cross in the first column
7. Hover over the red cross to see the reason why the biblio cannot be
deleted
8. Observe the row of the biblio without checked-out items is not
highlighted yellow, and does have a checkbox in the first column
9. Click 'Delete selected records'
10. Confirm the biblio without checked-out items is successfully deleted

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand
Comment 13 Alex Buckley 2022-12-30 01:10:32 UTC
Hi Jonathan and Katrin, 

Thank you for your responses. 

Jonathan: I originally removed the 'Clear on loan' link from the batch item modification and deletion pages for the reason outlined in the description:

This patchset makes items on loan display a red cross, rather than a disabled checkbox. So giving users the ability to clear on loan items when they could not be selected in most cases seemed redundant.

However, when the 'IndependentBranches' syspref is set to 'No' then on-loan items can be displayed with a selectable checkbox in the Batch item modification page so I have now re-added the 'Clear on loan' link to both batch item tool pages. 

---

Katrin: I've done some testing: The 'Clear on loan' link only appears on the batch item modification and deletion pages on master/main (and I have re-added it in my patches) - loaded from the html_helpers.inc. 

It does not appear on the batch record deletion page - as that uses links from batch_delete_records.tt ( https://github.com/Koha-Community/Koha/blob/master/koha-tmpl/intranet-tmpl/prog/en/modules/tools/batch_delete_records.tt#L142 ).

I do notice, however, the 'Clear on loan' link doesn't appear to work on the batch item modification page on master/main - so I'll make a new bug report for that.

---

I've removed the tab char that QA test tools reported in comment #7, and have updated the test plans on both patches now batch item/record tools exist in the 'Cataloguing' module.

Ready for testing again!

Many thanks,
Alex
Comment 14 Alex Buckley 2022-12-30 01:24:04 UTC
(In reply to Alex Buckley from comment #13)
> Hi Jonathan and Katrin, 
> 
> Thank you for your responses. 
> 
> Jonathan: I originally removed the 'Clear on loan' link from the batch item
> modification and deletion pages for the reason outlined in the description:
> 
> This patchset makes items on loan display a red cross, rather than a
> disabled checkbox. So giving users the ability to clear on loan items when
> they could not be selected in most cases seemed redundant.
> 
> However, when the 'IndependentBranches' syspref is set to 'No' then on-loan
> items can be displayed with a selectable checkbox in the Batch item
> modification page so I have now re-added the 'Clear on loan' link to both
> batch item tool pages. 
> 
> ---
> 
> Katrin: I've done some testing: The 'Clear on loan' link only appears on the
> batch item modification and deletion pages on master/main (and I have
> re-added it in my patches) - loaded from the html_helpers.inc. 
> 
> It does not appear on the batch record deletion page - as that uses links
> from batch_delete_records.tt (
> https://github.com/Koha-Community/Koha/blob/master/koha-tmpl/intranet-tmpl/
> prog/en/modules/tools/batch_delete_records.tt#L142 ).
> 
> I do notice, however, the 'Clear on loan' link doesn't appear to work on the
> batch item modification page on master/main - so I'll make a new bug report
> for that.
> 
> ---
> 
> I've removed the tab char that QA test tools reported in comment #7, and
> have updated the test plans on both patches now batch item/record tools
> exist in the 'Cataloguing' module.
> 
> Ready for testing again!
> 
> Many thanks,
> Alex

I've created a new bug report for the 'Clear on loan' link not working on the 'Batch item modification' page: bug 32550
Comment 15 David Nind 2023-01-01 23:05:42 UTC
Created attachment 144897 [details] [review]
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 <david@davidnind.com>
Comment 16 David Nind 2023-01-01 23:05:48 UTC
Created attachment 144898 [details] [review]
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool

Test plan:
1. Apply patch
2. Check out an item
3. Go to: 'Cataloguing' > 'Batch record deletion'
4. Into the 'Enter a list of record numbers' area paste in the
biblionumber belonging to the checked-out item and that of a biblio without checked out items
5. Submit the form
6. Observe the row of the biblio with checked-out items is highlighted yellow, with a
red cross in the first column
7. Hover over the red cross to see the reason why the biblio cannot be
deleted
8. Observe the row of the biblio without checked-out items is not
highlighted yellow, and does have a checkbox in the first column
9. Click 'Delete selected records'
10. Confirm the biblio without checked-out items is successfully deleted

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 David Nind 2023-01-01 23:12:55 UTC
Moved release notes from the version(s) released in field to the text to go in the release notes field, and edited slightly...
Comment 18 Marcel de Rooy 2023-02-24 09:39:57 UTC
+    // Highlight in yellow item rows that cannot be deleted
+    $(".error").parents('tr').find('td').css('background-color', '#ffff99');

Would normally expect this via css file, but similar actions are found already in the batch delete too.
Comment 19 Marcel de Rooy 2023-02-24 09:42:03 UTC
Created attachment 147286 [details] [review]
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 <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 20 Marcel de Rooy 2023-02-24 09:42:05 UTC
Created attachment 147287 [details] [review]
Bug 31611: Clearly highlight biblios that cannot be deleted in the Batch record deletion tool

Test plan:
1. Apply patch
2. Check out an item
3. Go to: 'Cataloguing' > 'Batch record deletion'
4. Into the 'Enter a list of record numbers' area paste in the
biblionumber belonging to the checked-out item and that of a biblio without checked out items
5. Submit the form
6. Observe the row of the biblio with checked-out items is highlighted yellow, with a
red cross in the first column
7. Hover over the red cross to see the reason why the biblio cannot be
deleted
8. Observe the row of the biblio without checked-out items is not
highlighted yellow, and does have a checkbox in the first column
9. Click 'Delete selected records'
10. Confirm the biblio without checked-out items is successfully deleted

Sponsored-by: Toi Ohomai Institute of Technology, New Zealand

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 21 Tomás Cohen Arazi 2023-03-10 14:47:47 UTC
Pushed to master for 23.05.

Nice work everyone, thanks!
Comment 22 Matt Blenkinsop 2023-03-13 11:04:59 UTC
Enhancement - not backporting to 22.11.x

Nice work everyone!
Comment 23 Aleisha Amohia 2023-06-28 05:02:48 UTC
*** Bug 34089 has been marked as a duplicate of this bug. ***