Bug 26280

Summary: Add unique IDs or class names for each condition in returns.tt
Product: Koha Reporter: Lucas Gass <lucas>
Component: TemplatesAssignee: Lucas Gass <lucas>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: gmcharlt, kyle.m.hall
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: Trivial patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
20.11.00
Attachments: Bug 26280: Add unique class for each problem in returns.tt
Bug 26280: Add unique class for each problem in returns.tt
Bug 26280: Add unique class for each problem in returns.tt
Bug 26280: Add unique class for each problem in returns.tt

Description Lucas Gass 2020-08-21 21:46:27 UTC
In returns.tt there are a lot of conditionals that can possibility happen when checking in items, many of these have the common class of 'problem'. I would be nice if each one had a unique ID or class name so they could be specifically targeted for audio alerts. Examples:

Not for loan status updated.
Item is lost, cannot be checked in.

And so on.
Comment 1 Lucas Gass 2020-08-21 21:48:34 UTC
"I would be nice if each had a unique name" but also "It would be nice"
Comment 2 Lucas Gass 2020-08-21 21:58:59 UTC
Wait, I didn't realize I can use jQuery selectors here. So this works:

.problem:contains("Not for loan status updated")


Marking this as invalid
Comment 3 Owen Leonard 2020-08-22 00:47:34 UTC
I'm reopening this because I think a simpler selector would be a good idea. Having an open bug doesn't hurt.
Comment 4 Lucas Gass 2020-09-08 22:48:12 UTC Comment hidden (obsolete)
Comment 5 Owen Leonard 2020-09-11 14:08:20 UTC
I think to make it less likely that these classes collide with classes defined elsewhere in Koha they should have a common prefix. "ret_badbarcode" or something like that.
Comment 6 Lucas Gass 2020-09-18 21:08:02 UTC Comment hidden (obsolete)
Comment 7 Owen Leonard 2020-09-23 13:57:18 UTC
Created attachment 110601 [details] [review]
Bug 26280: Add unique class for each problem in returns.tt

1. Checkin an item with a bad barcode and see the prolem class also has
   a class called 'ret_badbarcode'
2. Checkin an item that triggers a lotforloan updated via
   UpdateNotForLoanStatusOnCheckin, notice the class 'ret_nflupdate'.
3. You should also see an updated_from and updated_to class. This
   should make it easier to target those for audio alerts
4. Checkin an item that triggers an location update and see the class
   'ret_locationupdate'
5. Checkin an item that is not at its permenat location and you should
   see the class 'ret_ispermenant'.
6. Checkin an item that is not checkout and you should see the class
   'ret_notissued'
7. Checkin lost items with BlockReturnOfLostItems set to 'Dont block'
   and see the class 'ret_checkedin'
8. Checkin lost items with BlockReturnOfLostItems set to 'block' and
   see the class 'ret_blocked'
9. Checkin lost items with a fee on the patron's account for that lost
   item and see the class 'ret_feeremains'
10. Checkin item that is withdrawn and see the class 'ret_withdrawn'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Comment 8 Katrin Fischer 2020-09-23 18:19:59 UTC
Created attachment 110612 [details] [review]
Bug 26280: Add unique class for each problem in returns.tt

1. Checkin an item with a bad barcode and see the prolem class also has
   a class called 'ret_badbarcode'
2. Checkin an item that triggers a lotforloan updated via
   UpdateNotForLoanStatusOnCheckin, notice the class 'ret_nflupdate'.
3. You should also see an updated_from and updated_to class. This
   should make it easier to target those for audio alerts
4. Checkin an item that triggers an location update and see the class
   'ret_locationupdate'
5. Checkin an item that is not at its permenat location and you should
   see the class 'ret_ispermenant'.
6. Checkin an item that is not checkout and you should see the class
   'ret_notissued'
7. Checkin lost items with BlockReturnOfLostItems set to 'Dont block'
   and see the class 'ret_checkedin'
8. Checkin lost items with BlockReturnOfLostItems set to 'block' and
   see the class 'ret_blocked'
9. Checkin lost items with a fee on the patron's account for that lost
   item and see the class 'ret_feeremains'
10. Checkin item that is withdrawn and see the class 'ret_withdrawn'

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 9 Jonathan Druart 2020-10-08 14:20:51 UTC
Pushed to master for 20.11, thanks to everybody involved!
Comment 10 Lucas Gass 2020-11-09 20:35:24 UTC
enhancement will not be backported to 20.05.x