Bug 31097 - Patron restriction types should display in staff interface and OPAC
Summary: Patron restriction types should display in staff interface and OPAC
Status: Passed QA
Alias: None
Product: Koha
Classification: Unclassified
Component: Patrons (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Philip Orr
QA Contact: Martin Renvoize
URL:
Keywords: Academy
Depends on: 23681
Blocks:
  Show dependency treegraph
 
Reported: 2022-07-04 14:28 UTC by Martin Renvoize
Modified: 2024-04-19 16:56 UTC (History)
3 users (show)

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


Attachments
Attachment to Bug 31097 - Patron restriction types should display in staff interface and OPAC (1.99 KB, patch)
2024-04-18 09:50 UTC, Philip Orr
Details | Diff | Splinter Review
Bug 31097: display restriction types (2.07 KB, patch)
2024-04-18 10:02 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Attachment to Bug 31097 - Patron restriction types should display in staff interface and OPAC (2.05 KB, patch)
2024-04-18 15:50 UTC, Philip Orr
Details | Diff | Splinter Review
Bug 31097: Added more restrictions info (9.11 KB, patch)
2024-04-18 15:50 UTC, Philip Orr
Details | Diff | Splinter Review
Bug 31097: display restriction types (2.05 KB, patch)
2024-04-19 16:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 31097: Added more restrictions info (9.18 KB, patch)
2024-04-19 16:28 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 31097: Display restriction types (2.12 KB, patch)
2024-04-19 16:30 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 31097: Added more restrictions info (9.18 KB, patch)
2024-04-19 16:30 UTC, Martin Renvoize
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Renvoize 2022-07-04 14:28:31 UTC
Where we display the patron restrictions in the OPAC and Staff client, we don't always display the type description.. only the comment.

We should add this to the display.
Comment 1 Philip Orr 2024-04-17 15:30:04 UTC
Agreed, had a client ask me about that the other day.
Comment 2 Philip Orr 2024-04-18 09:35:16 UTC
taking this one.
Comment 3 Philip Orr 2024-04-18 09:50:00 UTC
Created attachment 165059 [details] [review]
Attachment to Bug 31097 - Patron restriction types should display in staff interface and OPAC

Bug 31097: display restriction types

This patch changes the display of patron
restrictions in checkout and patron details
pages to show the restriction type for each
restriction. It also changes the display so
each restriction is shown on a newline.

To test:
1. Before applying patch, set system preference
"PatronRestrictionTypes" to "Allow"
2. Go to Administration -> Patron restriction types
3. Add some restriction types, make sure you
fill out both "Code" and "Label"
4. Go to any patron and add one or more of each
restriction type
5. Go to that patron's checkout page
6. Notice that only the comments of the
restrictions are displayed
7. Apply the patch
8. Reload the page
9. Notice the restriction types are now
displayed correctly
Comment 4 Philip Orr 2024-04-18 09:53:27 UTC
Credit to ashimema on this one, as he knew the proper TT :)
Comment 5 Matt Blenkinsop 2024-04-18 10:02:22 UTC
Created attachment 165060 [details] [review]
Bug 31097: display restriction types

This patch changes the display of patron
restrictions in checkout and patron details
pages to show the restriction type for each
restriction. It also changes the display so
each restriction is shown on a newline.

To test:
1. Before applying patch, set system preference
"PatronRestrictionTypes" to "Allow"
2. Go to Administration -> Patron restriction types
3. Add some restriction types, make sure you
fill out both "Code" and "Label"
4. Go to any patron and add one or more of each
restriction type
5. Go to that patron's checkout page
6. Notice that only the comments of the
restrictions are displayed
7. Apply the patch
8. Reload the page
9. Notice the restriction types are now
displayed correctly

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 6 Martin Renvoize 2024-04-18 11:08:53 UTC
This is a good improvement.. but I think we could do even better ;)

* We could improve the output a little by checking whether there's a comment before adding the colon.. or put in a "No comment" text as a default.

* Should we rename the bug to reflect we've only looked at the staff client here.. or should we consider doing the same for opac-user.tt and possibly /opac-reserve.tt

I must admit.. I also wonder about exposing more information here.. we've got access to all of it so we could put in whether the restriction is indefinite or has an end date and we might want to order restrictions by start/end/indefinite perhaps so we should the 'most important' first?
Comment 7 Philip Orr 2024-04-18 15:50:52 UTC
Created attachment 165138 [details] [review]
Attachment to Bug 31097 - Patron restriction types should display in staff interface and OPAC

Bug 31097: display restriction types

This patch changes the display of patron
restrictions in checkout and patron details
pages to show the restriction type for each
restriction. It also changes the display so
each restriction is shown on a newline.

To test:
1. Before applying patch, set system preference
"PatronRestrictionTypes" to "Allow"
2. Go to Administration -> Patron restriction types
3. Add some restriction types, make sure you
fill out both "Code" and "Label"
4. Go to any patron and add one or more of each
restriction type
5. Go to that patron's checkout page
6. Notice that only the comments of the
restrictions are displayed
7. Apply the patch
8. Reload the page
9. Notice the restriction types are now
displayed correctly

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 8 Philip Orr 2024-04-18 15:50:55 UTC
Created attachment 165139 [details] [review]
Bug 31097: Added more restrictions info

Added more info to the restrictions message
in circulation as well as to the OPAC display
in "Your account" and to the display of
restriction messages when trying to place a
hold in the OPAC.

To Test:
1. Before applying patch, set system preference
"PatronRestrictionTypes" to "Allow"
2. Go to Administration -> Patron restriction types
3. Add some restriction types, make sure you
fill out both "Code" and "Label"
4. Go to any patron and add one or more of each
restriction type
4a. Make sure that you add some with an
expiration date and some without
4b. Make sure you add some with a comment and
some without
5. Go to that patron's checkout page
6. Notice that only the comments of the
restrictions are displayed and not all info
is displayed
7. Apply the patch
8. Reload the page
9. Notice the restriction types are now
displayed correctly
10. Notice the colon is only displayed
if there is a comment
11. Notice the expiration date is also displayed
12. Open the OPAC and log in with that user
(or if you want to log in with your own user:
 make sure they have all the restrictions
 mentioned above as well)
13. Go to "Your account" in the OPAC
14. Notice the display of restrictions
15. Try to place a hold on any record
16. Notice the display of restrictions
Comment 9 Philip Orr 2024-04-18 15:55:15 UTC
Good idea on checking if there's a comment first, added that now.
opac-user.tt and opac-reserve.tt now show the full display as well.
I like the idea of sorting by expiration date, but I haven't found
out how exactly to do that in TT yet. If you know how, point me in
the right direction and I'm happy to write a new patch :)
Comment 10 Martin Renvoize 2024-04-19 16:28:50 UTC
Created attachment 165218 [details] [review]
Bug 31097: display restriction types

This patch changes the display of patron
restrictions in checkout and patron details
pages to show the restriction type for each
restriction. It also changes the display so
each restriction is shown on a newline.

To test:
1. Before applying patch, set system preference
"PatronRestrictionTypes" to "Allow"
2. Go to Administration -> Patron restriction types
3. Add some restriction types, make sure you
fill out both "Code" and "Label"
4. Go to any patron and add one or more of each
restriction type
5. Go to that patron's checkout page
6. Notice that only the comments of the
restrictions are displayed
7. Apply the patch
8. Reload the page
9. Notice the restriction types are now
displayed correctly

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Comment 11 Martin Renvoize 2024-04-19 16:28:53 UTC
Created attachment 165219 [details] [review]
Bug 31097: Added more restrictions info

Added more info to the restrictions message
in circulation as well as to the OPAC display
in "Your account" and to the display of
restriction messages when trying to place a
hold in the OPAC.

To Test:
1. Before applying patch, set system preference
"PatronRestrictionTypes" to "Allow"
2. Go to Administration -> Patron restriction types
3. Add some restriction types, make sure you
fill out both "Code" and "Label"
4. Go to any patron and add one or more of each
restriction type
4a. Make sure that you add some with an
expiration date and some without
4b. Make sure you add some with a comment and
some without
5. Go to that patron's checkout page
6. Notice that only the comments of the
restrictions are displayed and not all info
is displayed
7. Apply the patch
8. Reload the page
9. Notice the restriction types are now
displayed correctly
10. Notice the colon is only displayed
if there is a comment
11. Notice the expiration date is also displayed
12. Open the OPAC and log in with that user
(or if you want to log in with your own user:
 make sure they have all the restrictions
 mentioned above as well)
13. Go to "Your account" in the OPAC
14. Notice the display of restrictions
15. Try to place a hold on any record
16. Notice the display of restrictions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 12 Martin Renvoize 2024-04-19 16:30:09 UTC
Created attachment 165220 [details] [review]
Bug 31097: Display restriction types

This patch changes the display of patron
restrictions in checkout and patron details
pages to show the restriction type for each
restriction. It also changes the display so
each restriction is shown on a newline.

To test:
1. Before applying patch, set system preference
"PatronRestrictionTypes" to "Allow"
2. Go to Administration -> Patron restriction types
3. Add some restriction types, make sure you
fill out both "Code" and "Label"
4. Go to any patron and add one or more of each
restriction type
5. Go to that patron's checkout page
6. Notice that only the comments of the
restrictions are displayed
7. Apply the patch
8. Reload the page
9. Notice the restriction types are now
displayed correctly

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 13 Martin Renvoize 2024-04-19 16:30:11 UTC
Created attachment 165221 [details] [review]
Bug 31097: Added more restrictions info

Added more info to the restrictions message
in circulation as well as to the OPAC display
in "Your account" and to the display of
restriction messages when trying to place a
hold in the OPAC.

To Test:
1. Before applying patch, set system preference
"PatronRestrictionTypes" to "Allow"
2. Go to Administration -> Patron restriction types
3. Add some restriction types, make sure you
fill out both "Code" and "Label"
4. Go to any patron and add one or more of each
restriction type
4a. Make sure that you add some with an
expiration date and some without
4b. Make sure you add some with a comment and
some without
5. Go to that patron's checkout page
6. Notice that only the comments of the
restrictions are displayed and not all info
is displayed
7. Apply the patch
8. Reload the page
9. Notice the restriction types are now
displayed correctly
10. Notice the colon is only displayed
if there is a comment
11. Notice the expiration date is also displayed
12. Open the OPAC and log in with that user
(or if you want to log in with your own user:
 make sure they have all the restrictions
 mentioned above as well)
13. Go to "Your account" in the OPAC
14. Notice the display of restrictions
15. Try to place a hold on any record
16. Notice the display of restrictions

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 14 Martin Renvoize 2024-04-19 16:32:13 UTC
This is great, thankyou!

I couldn't work out he ordering either.. I thought you could add is like:

[% FOR restriction IN patron.restrictions({},{ order_by => expiration }) %]

But it didn't appear to work.

Anyway, I think this is already a vast improvement, so I'm signing off and passing QA