Bug 26280 - Add unique IDs or class names for each condition in returns.tt
Summary: Add unique IDs or class names for each condition in returns.tt
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-08-21 21:46 UTC by Lucas Gass
Modified: 2021-01-08 15:21 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
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 (10.73 KB, patch)
2020-09-08 22:48 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 26280: Add unique class for each problem in returns.tt (11.04 KB, patch)
2020-09-18 21:08 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 26280: Add unique class for each problem in returns.tt (11.12 KB, patch)
2020-09-23 13:57 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 26280: Add unique class for each problem in returns.tt (11.18 KB, patch)
2020-09-23 18:19 UTC, Katrin Fischer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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