Bug 31981 - Add classes to each NEEDSCONFIRM message for easier styling in circ/circulation.tt
Summary: Add classes to each NEEDSCONFIRM message for easier styling in circ/circulati...
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Hold requests (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Lucas Gass
QA Contact: Kyle M Hall
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-25 21:47 UTC by Donna
Modified: 2024-05-07 18:08 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.05


Attachments
warning box for example two (299.66 KB, image/png)
2022-10-25 21:47 UTC, Donna
Details
warning box for example 1 (315.12 KB, image/png)
2022-10-25 21:47 UTC, Donna
Details
Bug 31981: Add classes to each NEEDSCONFIRM message in circ/circulation.tt (18.50 KB, patch)
2024-03-21 16:49 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 31981: Add classes to each NEEDSCONFIRM message in circ/circulation.tt (18.55 KB, patch)
2024-03-21 20:46 UTC, ByWater Sandboxes
Details | Diff | Splinter Review
Bug 31981: Add classes to each NEEDSCONFIRM message in circ/circulation.tt (18.60 KB, patch)
2024-05-07 16:24 UTC, Kyle M Hall
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Donna 2022-10-25 21:47:15 UTC
Created attachment 142657 [details]
warning box for example two

There are potentially two yellow warning boxes staff can see when checking out an item that is on hold and the two boxes are VERY difficult to distinguish between.  It would be helpful to either change the wording, or change the color of one of them to help staff determine what action should be taken.

For instance, place a hold on an item for Patron A, do not trigger the hold, and check the item out to Patron B.  The message is:

Please confirm checkout
Item Toby goes bananas / (312824) has been on hold for Donna B (donnab) at Sparkly Unicorn Land since 10/25/2022
 Cancel hold
Yes, check out (Y)  
Don't check out and print slip (P)  
No, don't check out (N)  
Cancel checkout and place a hold for Jack Shepard (68)

Then check the item in, confirm the hold, then check the item out to Patron B.  The message is:

Please confirm checkout
Item Toby goes bananas / (312824) has been waiting for Donna B (donnab) at Sparkly Unicorn Land since 10/25/2022
Cancel hold 
Revert waiting status 

The first message is much more common - libraries typically see it when a patron has placed a hold on something, but another patron has taken it off the shelf to check out before staff were able to pull it for the other patron.  The second message is much less common - this is when an item is on the hold pick up shelf and a patron other than who it was triggered for is trying to check it out.
Comment 1 Donna 2022-10-25 21:47:41 UTC
Created attachment 142658 [details]
warning box for example 1
Comment 2 Lucas Gass 2023-11-08 18:02:28 UTC
These look the same because they are the same! ( #circ_needsconfirmation )

If something NEEDSCONFIRMATION Koha will then cycle through all the possible things. In your care I believe it is:

1. [% IF ( RESERVED ) %] Item has been on hold for X since...

2. [% IF ( RESERVE_WAITING ) %] Item has been waiting for...


I think we could add a ID/class to each of the NEEDSCONFIRMATION reasons. This would make it much easier to customize the dialog/alert boxes based on the reason. 


Would that work?
Comment 3 Donna 2023-11-08 22:18:33 UTC
Absolutely!  Anything that would make it easier for libraries to distinguish would work!
Comment 4 Lucas Gass 2024-03-21 16:49:29 UTC
Created attachment 163647 [details] [review]
Bug 31981: Add classes to each NEEDSCONFIRM message in circ/circulation.tt

This patch adds a 'needsconfirm' class and a unique class to each NEEDSCONFIRM message on circ/circulation.tt to make these easier to style individually.

To test:
1. APPLY patch
2. Review the diff to see each of the NEEDSCONFIRMATION messages.
3. Add some CSS to IntranetUserCSS like this:

.needsconfirm { padding: 1em; color: #fff; }

.reserved { background: blue; }
.debt { background: red; }
.reserve_waiting { background: orange; }
.rentalcharge { background: purple; }
.renew_issue { background: limegreen; }

4. Place a hold on an item for Patron A, do not trigger the hold, and check the item out to Patron B.  The message background is blue.
5. Then check the item in, confirm the hold, then check the item out to Patron B.  The message background is orange
6. Check something out that is already checked out to that patron, message background is lime green.
7. Have too much debt and check something out to a patron, message is red.

Note: There are plenty more NEEDSCONFIRMATION messages but I don't think we need to test every single one.
Note: These background colors are more testing purposes only.
Comment 5 ByWater Sandboxes 2024-03-21 20:46:54 UTC
Created attachment 163653 [details] [review]
Bug 31981: Add classes to each NEEDSCONFIRM message in circ/circulation.tt

This patch adds a 'needsconfirm' class and a unique class to each NEEDSCONFIRM message on circ/circulation.tt to make these easier to style individually.

To test:
1. APPLY patch
2. Review the diff to see each of the NEEDSCONFIRMATION messages.
3. Add some CSS to IntranetUserCSS like this:

.needsconfirm { padding: 1em; color: #fff; }

.reserved { background: blue; }
.debt { background: red; }
.reserve_waiting { background: orange; }
.rentalcharge { background: purple; }
.renew_issue { background: limegreen; }

4. Place a hold on an item for Patron A, do not trigger the hold, and check the item out to Patron B.  The message background is blue.
5. Then check the item in, confirm the hold, then check the item out to Patron B.  The message background is orange
6. Check something out that is already checked out to that patron, message background is lime green.
7. Have too much debt and check something out to a patron, message is red.

Note: There are plenty more NEEDSCONFIRMATION messages but I don't think we need to test every single one.
Note: These background colors are more testing purposes only.
Signed-off-by: Donna <donna@bywatersolutions.com>
Comment 6 Donna 2024-03-21 20:48:10 UTC
Beautiful! Works as expected, and if there are two notices, both color boxes show on the modal.
Comment 7 Katrin Fischer 2024-05-06 07:48:17 UTC
Only adds CSS classes, reviewed closely.
Comment 8 Kyle M Hall 2024-05-07 16:24:16 UTC
Created attachment 166307 [details] [review]
Bug 31981: Add classes to each NEEDSCONFIRM message in circ/circulation.tt

This patch adds a 'needsconfirm' class and a unique class to each NEEDSCONFIRM message on circ/circulation.tt to make these easier to style individually.

To test:
1. APPLY patch
2. Review the diff to see each of the NEEDSCONFIRMATION messages.
3. Add some CSS to IntranetUserCSS like this:

.needsconfirm { padding: 1em; color: #fff; }

.reserved { background: blue; }
.debt { background: red; }
.reserve_waiting { background: orange; }
.rentalcharge { background: purple; }
.renew_issue { background: limegreen; }

4. Place a hold on an item for Patron A, do not trigger the hold, and check the item out to Patron B.  The message background is blue.
5. Then check the item in, confirm the hold, then check the item out to Patron B.  The message background is orange
6. Check something out that is already checked out to that patron, message background is lime green.
7. Have too much debt and check something out to a patron, message is red.

Note: There are plenty more NEEDSCONFIRMATION messages but I don't think we need to test every single one.
Note: These background colors are more testing purposes only.
Signed-off-by: Donna <donna@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 9 Katrin Fischer 2024-05-07 18:08:02 UTC
Sorry, it looks like I forgot to switch to PQA and then the script didn#t update it. This is pushed already. Did you change something in the patch or just a sign-off?

https://git.koha-community.org/Koha-community/Koha/commits/branch/main/search?q=31981