Summary: | Make long overdue patron category options configurable in interface | ||
---|---|---|---|
Product: | Koha | Reporter: | Lisette Scheer <lisette> |
Component: | Command-line Utilities | Assignee: | Matthias Le Gac <matthias.le-gac> |
Status: | RESOLVED FIXED | QA Contact: | Kyle M Hall (khall) <kyle> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | caroline.cyr-la-rose, fridolin.somers, kyle, lucas, matthias.le-gac, philippe.blouin, robin |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
See Also: | https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35170 | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Caroline Cyr La Rose | Documentation submission: | https://gitlab.com/koha-community/koha-manual/-/merge_requests/967 |
Text to go in the release notes: |
This adds two new system preferences `DefaultLongOverduePatronCategories` and `DefaultLongOverdueSkipPatronCategories` that allow for additional configuration of the `longoverdue.pl` CLI script directly from the staff interface. The settings of the system preferences will be used when the script is called without the corresponding options.
|
Version(s) released in: |
24.05.00
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 38053 | ||
Attachments: |
Bug 35169: Make long overdue borrower category options configurable in interface
Bug 35169: Make long overdue borrower category options configurable in interface Bug 35169: add bug_35169.pl for DB Bug 35169: update sysprefs.sql Bug 35169: update DBupdate file Bug 35169: Resolve the override situations Bug 35169: (follow-up) perltidy Bug 35169: Make long overdue borrower category options configurable in interface Bug 35169: add bug_35169.pl for DB Bug 35169: update sysprefs.sql Bug 35169: update DBupdate file Bug 35169: Resolve the override situations Bug 35169: (follow-up) perltidy Bug 35169: (QA follow-up) Fix up syspref language and group them together Bug 35169: (QA follow-up) Fix spelling and preference name |
Description
Lisette Scheer
2023-10-26 16:47:25 UTC
Created attachment 162340 [details] [review] Bug 35169: Make long overdue borrower category options configurable in interface Test Plan : 1 - Apply the patch 2 - Go to Koha administration > System preferences > Circulation > Checkout policy 3 - Set "DefaultLongOverdueLostValue" to "Lost" and "DefaultLongOverdueDays" to "2" 4 - Check out an item to a patron and set the date to more than two days. 5 - Remember the category of the patron Test of DefaultLongOverdueBorrowerCategories option : 6 - Go to Koha administration > System preferences > Circulation > Checkout policy 7 - Set "DefaultLongOverdueBorrowerCategories" to the category of the patron 8 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 9 - Normaly you see in list the check out item set just before and the list it's only borrowers with the category Test of DefaultLongOverdueSkipBorrowerCategories option : 10 - Go to Koha administration > System preferences > Circulation > Checkout policy 11 - Set "DefaultLongOverdueSkipBorrowerCategories" to the category of the patron 12 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 13 - Normaly you don't see in list the check out item set just before and the list it's only borrowers with others categories Test of warning : 14 - Go to Koha administration > System preferences > Circulation > Checkout policy 15 - Set "DefaultLongOverdueBorrowerCategories" to the category of the patron and Set "DefaultLongOverdueSkipBorrowerCategories" to the category of the patron 16 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 17 - Normaly you don't see in list the check out item set just before because the "DefaultLongOverdueSkipBorrowerCategories" take advantage of "DefaultLongOverdueBorrowerCategories" Created attachment 162345 [details] [review] Bug 35169: Make long overdue borrower category options configurable in interface Created attachment 162346 [details] [review] Bug 35169: add bug_35169.pl for DB Matthias, Can you update sysprefs.sql to include the new system preferences? You also need to use INSERT IGNORE INTO in your database update. Also, perltidy :) Created attachment 162611 [details] [review] Bug 35169: update sysprefs.sql Test Plan : 1 - Apply the patch 2 - Go to Koha administration > System preferences > Circulation > Checkout policy 3 - Set "DefaultLongOverdueLostValue" to "Lost" and "DefaultLongOverdueDays" to "2" 4 - Check out an item to a patron and set the date to more than two days. 5 - Remember the category of the patron Test of DefaultLongOverdueBorrowerCategories option : 6 - Go to Koha administration > System preferences > Circulation > Checkout policy 7 - Set "DefaultLongOverdueBorrowerCategories" to the category of the patron 8 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 9 - Normaly you see in list the check out item set just before and the list it's only borrowers with the category Test of DefaultLongOverdueSkipBorrowerCategories option : 10 - Go to Koha administration > System preferences > Circulation > Checkout policy 11 - Set "DefaultLongOverdueSkipBorrowerCategories" to the category of the patron 12 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 13 - Normaly you don't see in list the check out item set just before and the list it's only borrowers with others categories Test of warning : 14 - Go to Koha administration > System preferences > Circulation > Checkout policy 15 - Set "DefaultLongOverdueBorrowerCategories" to the category of the patron and Set "DefaultLongOverdueSkipBorrowerCategories" to the category of the patron 16 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 17 - Normaly you don't see in list the check out item set just before because the "DefaultLongOverdueSkipBorrowerCategories" take advantage of "DefaultLongOverdueBorrowerCategories" Lucas, Tell me if the update of sysprefs.sql is good. It's the first time I am doing this. Matthias, I tested this and it seems to work as intended, you sysprefs.sql update looks good to me. However, your DBUpdate explanation and type should not be NULL. Sorry to be a pain! Created attachment 162667 [details] [review] Bug 35169: update DBupdate file Test Plan : 1 - Apply the patch 2 - Go to Koha administration > System preferences > Circulation > Checkout policy 3 - Set "DefaultLongOverdueLostValue" to "Lost" and "DefaultLongOverdueDays" to "2" 4 - Check out an item to a patron and set the date to more than two days. 5 - Remember the category of the patron Test of DefaultLongOverdueBorrowerCategories option : 6 - Go to Koha administration > System preferences > Circulation > Checkout policy 7 - Set "DefaultLongOverdueBorrowerCategories" to the category of the patron 8 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 9 - Normaly you see in list the check out item set just before and the list it's only borrowers with the category Test of DefaultLongOverdueSkipBorrowerCategories option : 10 - Go to Koha administration > System preferences > Circulation > Checkout policy 11 - Set "DefaultLongOverdueSkipBorrowerCategories" to the category of the patron 12 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 13 - Normaly you don't see in list the check out item set just before and the list it's only borrowers with others categories Test of warning : 14 - Go to Koha administration > System preferences > Circulation > Checkout policy 15 - Set "DefaultLongOverdueBorrowerCategories" to the category of the patron and Set "DefaultLongOverdueSkipBorrowerCategories" to the category of the patron 16 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 17 - Normaly you don't see in list the check out item set just before because the "DefaultLongOverdueSkipBorrowerCategories" take advantage of "DefaultLongOverdueBorrowerCategories" (In reply to Lucas Gass from comment #7) > Matthias, > > I tested this and it seems to work as intended, you sysprefs.sql update > looks good to me. > > However, your DBUpdate explanation and type should not be NULL. Sorry to be > a pain! Thank you for your feedback. Normally it's good now. Matthias, Looking closer here. If you add values to the new system preferences they override what is added at the cron level? Then you probably need to add a better description about what is happening in the POD? Also, if you use the system preferences now you are unable to configure the cron differently and run it more than once. For example you might want to do something like this: longoverdue.pl --skip-category PT --lost 14=2 --confirm longoverdue.pl --skip-category PT2 --lost 21=2 --confirm That seems like it could be a problem? I won't fail this again. I'll let someone else have a look and give opinions. I agree with Lucas that it's a problem you can't set different options for different patron categories. Currently you can set not only to skip, but also to have different patron types go to lost at different times at the cron level (such as having staff go to lost at 365 when the default is 60.) The skip default is good, but this doesn't really address the other part where you can set different rules by category. (In reply to Lucas Gass from comment #10) > Matthias, > > Looking closer here. If you add values to the new system preferences they > override what is added at the cron level? Then you probably need to add a > better description about what is happening in the POD? > > Also, if you use the system preferences now you are unable to configure the > cron differently and run it more than once. For example you might want to do > something like this: > > longoverdue.pl --skip-category PT --lost 14=2 --confirm > longoverdue.pl --skip-category PT2 --lost 21=2 --confirm > > That seems like it could be a problem? > > I won't fail this again. I'll let someone else have a look and give opinions. I'll look into that to implement the correct behavior. Created attachment 162688 [details] [review] Bug 35169: Resolve the override situations Test Plan : 1 - Apply the patch 2 - Go to Koha administration > System preferences > Circulation > Checkout policy 3 - Set "DefaultLongOverdueLostValue" to "Lost" and "DefaultLongOverdueDays" to "2" 4 - Check out an item to a patron and set the date to more than two days. 5 - Remember the category of the patron Test of DefaultLongOverdueBorrowerCategories option : 6 - Go to Koha administration > System preferences > Circulation > Checkout policy 7 - Set "DefaultLongOverdueBorrowerCategories" to the category of the patron 8 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 9 - Normaly you see in list the check out item set just before and the list it's only borrowers with the category Test of DefaultLongOverdueSkipBorrowerCategories option : 10 - Go to Koha administration > System preferences > Circulation > Checkout policy 11 - Set "DefaultLongOverdueSkipBorrowerCategories" to the category of the patron 12 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 13 - Normaly you don't see in list the check out item set just before and the list it's only borrowers with others categories Test of warning : 14 - Go to Koha administration > System preferences > Circulation > Checkout policy 15 - Set "DefaultLongOverdueBorrowerCategories" to the category of the patron and Set "DefaultLongOverdueSkipBorrowerCategories" to the category of the patron 16 - Go to the terminal in the koha environment and execute the script "./misc/cronjobs/longoverdue.pl" 17 - Normaly you don't see in list the check out item set just before because the "DefaultLongOverdueSkipBorrowerCategories" take advantage of "DefaultLongOverdueBorrowerCategories" Currently, you can set different lengths for different patrons, running the cron multiple times with different settings. Ideally a solution in the staff interface would also allow this. This + the option to add different settings at the patron category level with different settings would be ideal: longoverdue.pl --skip-category PT --lost 14=2 --confirm longoverdue.pl --skip-category PT2 --lost 21=2 --confirm (In reply to Lisette Scheer from comment #14) > Currently, you can set different lengths for different patrons, running the > cron multiple times with different settings. Ideally a solution in the staff > interface would also allow this. This + the option to add different settings > at the patron category level with different settings would be ideal: > > longoverdue.pl --skip-category PT --lost 14=2 --confirm > longoverdue.pl --skip-category PT2 --lost 21=2 --confirm Currently, you can't set different values for DefaultLongOverdueLostValue and DefaultLongOverdueLostValue from the interface. So it's not possible to have two longoverdue.pl running at the same time if they're set from the interface. So I think it would be an improvement on all longoverdue.pl system preferences, not just on categories. I'm not sure it's directly related to this bz. Tell me what you think? For presition longoverdue.pl doesn't allow DefaultLongOverdueBorrowerCategories and DefaultLongOverdueSkipBorrowerCategories to be used at the same time. If they are used at the same time, DefaultLongOverdueSkipBorrowerCategories will override DefaultLongOverdueBorrowerCategories. Created attachment 163008 [details] [review] Bug 35169: (follow-up) perltidy Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 166121 [details] [review] Bug 35169: Make long overdue borrower category options configurable in interface Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 166122 [details] [review] Bug 35169: add bug_35169.pl for DB Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 166123 [details] [review] Bug 35169: update sysprefs.sql Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 166124 [details] [review] Bug 35169: update DBupdate file Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 166125 [details] [review] Bug 35169: Resolve the override situations Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 166126 [details] [review] Bug 35169: (follow-up) perltidy Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Created attachment 166127 [details] [review] Bug 35169: (QA follow-up) Fix up syspref language and group them together The language used in the syspref preferences was a bit confusing. Also, it makes sense to keep these two together on the page as they are intrinsically linked. Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> Small things, but please provide a follow-up: 1) Terminology: DefaultLongOverdueSkipBorrowerCategories DefaultLongOverdueSkipBorrowerCategories I have checked, we have no other BorrowerCategories system preferences, but we have suggestionPatronCategoryExceptions. I think it's worthwhile to make these *PatronCategories. Also in sysprefs.sql and the database update: +('DefaultLongOverdueBorrowerCategories', '', NULL, "Set the borrower categories that will be listed when longoverdue cronjob is executed", 'choice'), -> patron categories 2) Typo Set the default patron categories to recieve overdues to Set the default patron categories to recieve overdues to -> receive 3) Sponsorship Just asking as the new version of the QA script keeps asking me about it! :) Created attachment 166256 [details] [review] Bug 35169: (QA follow-up) Fix spelling and preference name Update the preference name from 'Borrower' to 'Patron' and correct spelling of receive. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Pushed for 24.05! Well done everyone, thank you! Not backported to 23.11.x |