Description
Martin Renvoize (ashimema)
2022-07-04 14:28:31 UTC
Agreed, had a client ask me about that the other day. taking this one. 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 Credit to ashimema on this one, as he knew the proper TT :) 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> 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? 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> 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 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 :) 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> 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> 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> 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> 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 I am a bit overly careful maybe as this is for the OPAC and I am not sure how much libraries are relying on things displaying or not displaying in a certain way. 1) When no restriction types are used, all restrictions use the internal type "Manual" which currently will display like this: Manual, frozen until: Indefinite Manual: Unter, frozen until: 05/08/2024 I think the "Manual" could be confusing to patrons and I am also not sure how this might be translated. Maybe we should hide the type in this case? 2) I'd really like some classes to make it possible to customize the content a bit. At the moment it's all one text paragraph. Using block elements or a list could also help avoid the <br />. Some notes (not blocking) * Some lines are almost repeated identically. The IF/ELSE on restriction.comment could be moved to only include the first line that is different to make it a little more compact. Created attachment 166054 [details] [review] Bug 31097: Add classes, drop an ELSE, drop <br /> Created attachment 166055 [details] [review] Bug 31097: Add classes, drop an ELSE, drop <br /> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> This is much better, thanks! Can we still take care of not displying the "Manual" for libraries not using the restriction types (or just in general?) For testing I have added 3 restrictions, it also highlights what I mean I think: Manual: Foo, frozen until: 28.05.2024 Manual Manual: bar, frozen until: Indefinite Sorry! Maybe we should just update "Manual" to "Manual restriction"? Created attachment 166255 [details] [review] Bug 31097: Update restriction type display text I've asked Owen to take a look, waiting a little longer with this one. Created attachment 166296 [details] [review] Bug 31097: (follow-up) Restructure messages a bit This patch updates the patron restrictions markup and splits up some strings to (hopefully) improve the translation process. The patch also fixes a bug in a previous patch which prevented manual restrictions from being displayed if there was also a restriction added by overdue_notices.pl. Test that all three kinds of restrictions display correctly: - Restrictions added by overdue process - Manual restriction without an expiration date - Manual restriction with an expiration date This is a tricky one. I think we will leave it as is now, but some notes: For an indefinite restriction without comment, there is no punctuation between the restriction description and the note about it being indefinite. When there is punctuation, there is a colon with a space between restriction description and the colon. I didn't see an easy way to fix these. Created attachment 166428 [details] [review] Bug 31097: (follow-up) Standardize appearance of colon between restriction type and comments Pushed for 24.05! Well done everyone, thank you! Not backported to 23.11.x *** Bug 16898 has been marked as a duplicate of this bug. *** I don't think we need to change anything in the manual for this. Neat enhancement though! :) |