Many libraries in my system lend DVDs out for a shorter period than their normal checkout period, like 2 days versus 14 or 21 days for other items. They also charge larger fines on DVDs than other items. They would like to be able to generate overdue notices for DVDs on the first day overdue, unlike the first notice generation of 7 days on their other items. So this is an enhancement request to allow libraries to generate an overdue notice for a particular item type separate from the three notice triggers.
This is standard behavior now, right?
Right now we can only set the overdue notices by patron category, but we can't differentiate by item type. I think this is still valid.
Here in 2017 still wishing for greater flexibility for overdue notices based on Item Type, not only Patron Category -- in our case (school library) for better communication about items on Reserve (in our case loan period is 2 hours).
+1
This is important in our consortium of mainly public libraries as our Library of Things (LoT) items go out for shorter periods of time and are overdue on a different time schedule to regular items like books. We would like overdues to be based on item type not just patron type. We also have one college member library in our consortium and their items go out on for different time periods again based on Item type not just patron type.
Matt and I are working on this together.. we're not too far off submitting code as per the spec above.. getting the API patches linked above through would certainly help it keep marching forward.
Created attachment 170357 [details] [review] Bug 10190: DB migration for overduerules This patch adds the data migration for overduerules to circulation rules. We attempt to create the default rules based on most commonly occuring rule values and then add overrides for all other rule values we find. Sponsored-by: Glasgow Colleges Library Group
Created attachment 170358 [details] [review] Bug 10190: Fix unit test to exclude _X_ rules Sponsored-by: Glasgow Colleges Library Group
Created attachment 170359 [details] [review] Bug 10190: Add support for incrementable circulation rules This patch adds support for _X_ grouped circulation rules to both the internal and external API's for handling circulation rules. This allows us to group overdue_X_rulename rules by an 'X' integer so we can have triggers incremented and grouped together. We also add the new overdue_x_* rule definition here for overdue trigger rules. Sponsored-by: Glasgow Colleges Library Group
Created attachment 170360 [details] [review] Bug 10190: Add a vue app for circulation triggers This patch adds a new vue based page for administering circulation triggers. This aims to replace the 'Overdue notice/status triggers' page available from Tools. The new page is available from Koha administration > Circulation triggers Sponsored-by: Glasgow Colleges Library Group
Created attachment 170361 [details] [review] Bug 10190: Add components to list/add and edit circulation triggers These new components are used by the new 'Circulation triggers' administration page to display existing trigger rules and add the ability to add new rules and edit existing ones. Sponsored-by: Glasgow Colleges Library Group
Created attachment 170362 [details] [review] Bug 10190: Add a library API client This patch adds a library api client to the vue ecosystem for later use in the Circulation triggers page. Sponsored-by: Glasgow Colleges Library Group
Created attachment 170363 [details] [review] Bug 10190: Add itemtypes and patron categories to the item/patron api clients This patch adds patron and itemtype api clients for the Vue ecosystem Sponsored-by: Glasgow Colleges Library Group
Created attachment 170364 [details] [review] Bug 10190: Let the circulation_rules endpoint accept query parameters Sponsored-by: Glasgow Colleges Library Group
Created attachment 170365 [details] [review] Bug 10190: Update GetBranchcodesWithOverdueRules to use CirculationRules This patch updates the C4::Overdues method GetBranchecodesWithOverdueRules to refer to the new location of these rules in the circulation rules table. We also update the unit tests to move the mocked data into the right location. We could perhaps migrate this method in Koha::CirculationRules at a later date? Sponsored-by: Glasgow Colleges Library Group
Created attachment 170366 [details] [review] Bug 10190: Update overdue_notices script to refer to circ rules This patch updates the overdue_notices cron script to refer to the new location for overdue rules found in the circulation rules table now. Sponsored-by: Glasgow Colleges Library Group
Created attachment 170367 [details] [review] Bug 10190: Add itemtype handling to overdue_notices script This patch enhances the overdue_notices script to understand the newly introduced itemtype level for overdue rules. Sponsored-by: Glasgow Colleges Library Group
Created attachment 170368 [details] [review] Bug 10190: Update has_restricting_overdues to refer to circulation rules This patch updates the Koha::Patron->has_restriction_overdues method to refer to the migrated overdue rules. We also correct an oversight in the method prior to this patch that meant that not all overdues were being correctly checked for a restriction.. we were incorrectly filtering to only overdues at the current checkin branch. Finally, we also take account of the itemtype level addition here too. NOTE: There weren't any unit tests for this Koha::Patron method.. we should add some here! Sponsored-by: Glasgow Colleges Library Group
Created attachment 170369 [details] [review] Bug 10190: Add letter names to tables Sponsored-by: Glasgow Colleges Library Group
Created attachment 170370 [details] [review] Bug 10190: Set tab based on trigger edited/created Sponsored-by: Glasgow Colleges Library Group
Created attachment 170371 [details] [review] Bug 10190: Add fallback to 'Default' text for notice Sponsored-by: Glasgow Colleges Library Group
Created attachment 170372 [details] [review] Bug 10190: Migrate MarkIssueReturned test to circulation rules Sponsored-by: Glasgow Colleges Library Group
Created attachment 170373 [details] [review] Bug 10190: Remove old overduerules interface This patch updates the link from the tools homepage to open the new circulation triggers administration page. We then remove the old overduerules controller and template, and finally we drop the no longer referenced C4::Overdues::GetOverdueMessageTransportTypes method and associated unit tests. Sponsored-by: Glasgow Colleges Library Group
This is going to be fun to test.. Matt and I worked hard together on it, so whilst it's assigned to me we're both available to comment. I'm happy to walk through intentions in a Jistsi or whatever.. reach out on chat.koha-community.org if you want any guidance.
Created attachment 170374 [details] [review] Bug 10190: Drop overduerules and overduerules_transport_types
Created attachment 170375 [details] [review] Bug 10190: DBIC Schema update
Created attachment 170376 [details] [review] Bug 10190: Remove OverdueRule Koha Objects
Created attachment 170380 [details] [review] Bug 10190: Update itiva script to reflect move to circ_rules
Whilst I've updated the itiva script to reflect the move to circulation rules.. I've not got any way to really test this. We also need to expose itiva in the new admin page.. I'm going to ask Matt to take a look at that.
Created attachment 170449 [details] [review] Bug 10190: Add comments to overdue_notices and rename variable Trying to fully understand how this script operates.. this patch adds some notes to the script for developers and also renames a variable that I found was being re-used.
https://github.com/PTFS-Europe/koha/tree/bug_10190_submission
I'm still cleaning up the commits and Matt and I are working on adding tests. But, it's all working pretty well now and testing is ongoing in production at a customer site. I've set up a sandbox for anyone wanting to have a play: https://staff-overdues.sandboxes.ptfs-europe.co.uk/ Test plan: 1) Head on over to either 'Tools > Overdue notice/status triggers' or 'Administration > Circulation triggers' (They're the same page) 2) Add a base ALL, ALL, ALL rule 3) Add rule overrides for various combinations of Library, Patron category and Item type
Created attachment 171727 [details] [review] Bug 10190: DB migration for overduerules This patch adds the data migration for overduerules to circulation rules. We attempt to create the default rules based on most commonly occuring rule values and then add overrides for all other rule values we find. Sponsored-by: Glasgow Colleges Library Group
Created attachment 171728 [details] [review] Bug 10190: DBIC Schema update
Created attachment 171729 [details] [review] Bug 10190: Remove OverdueRule Koha Objects
Created attachment 171730 [details] [review] Bug 10190: Fix unit test to exclude _X_ rules Sponsored-by: Glasgow Colleges Library Group
Created attachment 171731 [details] [review] Bug 10190: Add support for incrementable circulation rules This patch adds support for _X_ grouped circulation rules to both the internal and external API's for handling circulation rules. This allows us to group overdue_X_rulename rules by an 'X' integer so we can have triggers incremented and grouped together. We also add the new overdue_x_* rule definition here for overdue trigger rules. Sponsored-by: Glasgow Colleges Library Group
Created attachment 171732 [details] [review] Bug 10190: Add a vue app for circulation triggers This patch adds a new vue based page for administering circulation triggers. This aims to replace the 'Overdue notice/status triggers' page available from Tools. The new page is available from Koha administration > Circulation triggers Sponsored-by: Glasgow Colleges Library Group
Created attachment 171733 [details] [review] Bug 10190: Add components to list/add and edit circulation triggers These new components are used by the new 'Circulation triggers' administration page to display existing trigger rules and add the ability to add new rules and edit existing ones. Sponsored-by: Glasgow Colleges Library Group
Created attachment 171734 [details] [review] Bug 10190: Add a library API client This patch adds a library api client to the vue ecosystem for later use in the Circulation triggers page. Sponsored-by: Glasgow Colleges Library Group
Created attachment 171735 [details] [review] Bug 10190: Add itemtypes and patron categories to the item/patron api clients This patch adds patron and itemtype api clients for the Vue ecosystem Sponsored-by: Glasgow Colleges Library Group
Created attachment 171736 [details] [review] Bug 10190: Let the circulation_rules endpoint accept query parameters Sponsored-by: Glasgow Colleges Library Group
Created attachment 171737 [details] [review] Bug 10190: Update GetBranchcodesWithOverdueRules to use CirculationRules This patch updates the C4::Overdues method GetBranchecodesWithOverdueRules to refer to the new location of these rules in the circulation rules table. We also update the unit tests to move the mocked data into the right location. We could perhaps migrate this method in Koha::CirculationRules at a later date? Sponsored-by: Glasgow Colleges Library Group
Created attachment 171738 [details] [review] Bug 10190: Update overdue_notices script to refer to circ rules This patch updates the overdue_notices cron script to refer to the new location for overdue rules found in the circulation rules table now. Sponsored-by: Glasgow Colleges Library Group
Created attachment 171739 [details] [review] Bug 10190: Add itemtype handling to overdue_notices script This patch enhances the overdue_notices script to understand the newly introduced itemtype level for overdue rules. Sponsored-by: Glasgow Colleges Library Group
Created attachment 171740 [details] [review] Bug 10190: Update has_restricting_overdues to refer to circulation rules This patch updates the Koha::Patron->has_restriction_overdues method to refer to the migrated overdue rules. We also correct an oversight in the method prior to this patch that meant that not all overdues were being correctly checked for a restriction.. we were incorrectly filtering to only overdues at the current checkin branch. Finally, we also take account of the itemtype level addition here too. NOTE: There weren't any unit tests for this Koha::Patron method.. we should add some here! Sponsored-by: Glasgow Colleges Library Group
Created attachment 171741 [details] [review] Bug 10190: Add letter names to tables Sponsored-by: Glasgow Colleges Library Group
Created attachment 171742 [details] [review] Bug 10190: Set tab based on trigger edited/created Sponsored-by: Glasgow Colleges Library Group
Created attachment 171743 [details] [review] Bug 10190: Add fallback to 'Default' text for notice Sponsored-by: Glasgow Colleges Library Group
Created attachment 171744 [details] [review] Bug 10190: Migrate MarkIssueReturned test to circulation rules Sponsored-by: Glasgow Colleges Library Group
Created attachment 171745 [details] [review] Bug 10190: Remove old overduerules interface This patch updates the link from the tools homepage to open the new circulation triggers administration page. We then remove the old overduerules controller and template, and finally we drop the no longer referenced C4::Overdues::GetOverdueMessageTransportTypes method and associated unit tests. Sponsored-by: Glasgow Colleges Library Group
Created attachment 171746 [details] [review] Bug 10190: Update itiva script to reflect move to circ_rules
Created attachment 171747 [details] [review] Bug 10190: Add comments to overdue_notices and rename variable Trying to fully understand how this script operates.. this patch adds some notes to the script for developers and also renames a variable that I found was being re-used.
Created attachment 171748 [details] [review] Bug 10190: Rework logic of overdue_notices The original logic for digesting overdues in the overdue notices script was flawed given the additional itemtype handling introduced in this patchset and the way in which it handles effective fallbacks for rules. This patch tidies the file and reworks the logic so that we fetch overdues by patron category and branch and then iterate through those comparing to the correct effective rules and combing them into digest groups based on notice + trigger level.
Created attachment 171749 [details] [review] Bug 10190: Display effective values and highlight them
Created attachment 171750 [details] [review] Bug 10190: Restore 'edit' from 'Add/Edit' Modal
Created attachment 171751 [details] [review] Bug 10190: Modal form improvements We now fetch all rules on modal open and the effective rule on context selection. This allows us to compare the specific values of the rule we're adding/editing to the fallback values present in the all rules set. We use the fallback rule values as placeholders in the input boxes to highlight to the end user what value will be used should they choose to wipe the input. We also allow wiping inputs and pass 'null' to the API appropriately. Finally, we set a minimum value for delay when adding a new rule to highlight to the user that the new trigger will be added after existing triggers.
Created attachment 171752 [details] [review] Bug 10190: Add custom input for delay This custom input allows for dynamic min/max rules and it updates the input styling to match other inputs on the page including a 'clear' button.
Created attachment 171753 [details] [review] Bug 10190: Clarify workflow This patch re-arranges the edit/add modal form to clarify the need to select context, then decide on editing an existing trigger or adding a new one and then, and only then, exposes the actual rule inputs
Created attachment 171754 [details] [review] Bug 10190: Update for bootstrap 5
Created attachment 171755 [details] [review] Bug 10190: Rebase for rspack
This is all ready for testing now and can be done using the sandbox above, a fresh sandbox or a local dev env.
Installed on sandboxes : updatedatabase error, problem of foreign key constraint
Notes from Nick Clemens at KohaCon24 * Use syspref for 'All libraries' or 'Logged in library' by default - DefaultToLoggedInLibraryOverdueTriggers * We should not be able to save a notice without a transport type (including aking into account fallbacks) * Note about whether we're talking aobut 'patrons home library' or 'items home library' * If a notice template is only set up for one library only display it in the notice dropdown when in that context * Can we expose somewhere the list of all notice trigger context combinations..
Created attachment 172588 [details] [review] Bug 10190: DB migration for overduerules This patch adds the data migration for overduerules to circulation rules. We attempt to create the default rules based on most commonly occuring rule values and then add overrides for all other rule values we find. Sponsored-by: Glasgow Colleges Library Group
Created attachment 172589 [details] [review] Bug 10190: DBIC Schema update
Created attachment 172590 [details] [review] Bug 10190: Remove OverdueRule Koha Objects
Created attachment 172591 [details] [review] Bug 10190: Fix unit test to exclude _X_ rules Sponsored-by: Glasgow Colleges Library Group
Created attachment 172592 [details] [review] Bug 10190: Add support for incrementable circulation rules This patch adds support for _X_ grouped circulation rules to both the internal and external API's for handling circulation rules. This allows us to group overdue_X_rulename rules by an 'X' integer so we can have triggers incremented and grouped together. We also add the new overdue_x_* rule definition here for overdue trigger rules. Sponsored-by: Glasgow Colleges Library Group
Created attachment 172593 [details] [review] Bug 10190: Add a vue app for circulation triggers This patch adds a new vue based page for administering circulation triggers. This aims to replace the 'Overdue notice/status triggers' page available from Tools. The new page is available from Koha administration > Circulation triggers Sponsored-by: Glasgow Colleges Library Group
Created attachment 172594 [details] [review] Bug 10190: Add components to list/add and edit circulation triggers These new components are used by the new 'Circulation triggers' administration page to display existing trigger rules and add the ability to add new rules and edit existing ones. Sponsored-by: Glasgow Colleges Library Group
Created attachment 172595 [details] [review] Bug 10190: Add a library API client This patch adds a library api client to the vue ecosystem for later use in the Circulation triggers page. Sponsored-by: Glasgow Colleges Library Group
Created attachment 172596 [details] [review] Bug 10190: Add itemtypes and patron categories to the item/patron api clients This patch adds patron and itemtype api clients for the Vue ecosystem Sponsored-by: Glasgow Colleges Library Group
Created attachment 172597 [details] [review] Bug 10190: Let the circulation_rules endpoint accept query parameters Sponsored-by: Glasgow Colleges Library Group
Created attachment 172598 [details] [review] Bug 10190: Update GetBranchcodesWithOverdueRules to use CirculationRules This patch updates the C4::Overdues method GetBranchecodesWithOverdueRules to refer to the new location of these rules in the circulation rules table. We also update the unit tests to move the mocked data into the right location. We could perhaps migrate this method in Koha::CirculationRules at a later date? Sponsored-by: Glasgow Colleges Library Group
Created attachment 172599 [details] [review] Bug 10190: Update overdue_notices script to refer to circ rules This patch updates the overdue_notices cron script to refer to the new location for overdue rules found in the circulation rules table now. Sponsored-by: Glasgow Colleges Library Group
Created attachment 172600 [details] [review] Bug 10190: Add itemtype handling to overdue_notices script This patch enhances the overdue_notices script to understand the newly introduced itemtype level for overdue rules. Sponsored-by: Glasgow Colleges Library Group
Created attachment 172601 [details] [review] Bug 10190: Update has_restricting_overdues to refer to circulation rules This patch updates the Koha::Patron->has_restriction_overdues method to refer to the migrated overdue rules. We also correct an oversight in the method prior to this patch that meant that not all overdues were being correctly checked for a restriction.. we were incorrectly filtering to only overdues at the current checkin branch. Finally, we also take account of the itemtype level addition here too. NOTE: There weren't any unit tests for this Koha::Patron method.. we should add some here! Sponsored-by: Glasgow Colleges Library Group
Created attachment 172602 [details] [review] Bug 10190: Add letter names to tables Sponsored-by: Glasgow Colleges Library Group
Created attachment 172603 [details] [review] Bug 10190: Set tab based on trigger edited/created Sponsored-by: Glasgow Colleges Library Group
Created attachment 172604 [details] [review] Bug 10190: Add fallback to 'Default' text for notice Sponsored-by: Glasgow Colleges Library Group
Created attachment 172605 [details] [review] Bug 10190: Migrate MarkIssueReturned test to circulation rules Sponsored-by: Glasgow Colleges Library Group
Created attachment 172606 [details] [review] Bug 10190: Remove old overduerules interface This patch updates the link from the tools homepage to open the new circulation triggers administration page. We then remove the old overduerules controller and template, and finally we drop the no longer referenced C4::Overdues::GetOverdueMessageTransportTypes method and associated unit tests. Sponsored-by: Glasgow Colleges Library Group
Created attachment 172607 [details] [review] Bug 10190: Update itiva script to reflect move to circ_rules
Created attachment 172608 [details] [review] Bug 10190: Add comments to overdue_notices and rename variable Trying to fully understand how this script operates.. this patch adds some notes to the script for developers and also renames a variable that I found was being re-used.
Created attachment 172609 [details] [review] Bug 10190: Rework logic of overdue_notices The original logic for digesting overdues in the overdue notices script was flawed given the additional itemtype handling introduced in this patchset and the way in which it handles effective fallbacks for rules. This patch tidies the file and reworks the logic so that we fetch overdues by patron category and branch and then iterate through those comparing to the correct effective rules and combing them into digest groups based on notice + trigger level.
Created attachment 172612 [details] [review] Bug 10190: Display effective values and highlight them
Created attachment 172614 [details] [review] Bug 10190: Restore 'edit' from 'Add/Edit' Modal
Created attachment 172617 [details] [review] Bug 10190: Modal form improvements We now fetch all rules on modal open and the effective rule on context selection. This allows us to compare the specific values of the rule we're adding/editing to the fallback values present in the all rules set. We use the fallback rule values as placeholders in the input boxes to highlight to the end user what value will be used should they choose to wipe the input. We also allow wiping inputs and pass 'null' to the API appropriately. Finally, we set a minimum value for delay when adding a new rule to highlight to the user that the new trigger will be added after existing triggers.
Created attachment 172619 [details] [review] Bug 10190: Add custom input for delay This custom input allows for dynamic min/max rules and it updates the input styling to match other inputs on the page including a 'clear' button.
Created attachment 172621 [details] [review] Bug 10190: Clarify workflow This patch re-arranges the edit/add modal form to clarify the need to select context, then decide on editing an existing trigger or adding a new one and then, and only then, exposes the actual rule inputs
Created attachment 172622 [details] [review] Bug 10190: Update for bootstrap 5
Created attachment 172623 [details] [review] Bug 10190: Rebase for rspack
Created attachment 172624 [details] [review] Bug 10190: Rename 'All *' to 'Default rule for *' Try to clarify that the 'All' rules are actually fallback/default rules for when there's not a more specific rule for the context. We need to expose these clearly for each 'Library' view too which we're not currently doing.
Created attachment 172625 [details] [review] Bug 10190: Take DefaultToLoggedInLibraryOverdueTriggers into account This updates the logic for the default page load to take account of DefaultToLoggedInLibraryOverdueTriggers.
Created attachment 172626 [details] [review] Bug 10190: Only display default and library specific letters This patch filters the list of letter templates available to use by only those available for the context the rule is being added for (i.e. the correct library relation)
Created attachment 172630 [details] [review] Bug 10190: Display value of OverdueNoticeFrom in note
Created attachment 172631 [details] [review] Bug 10190: DB migration for overduerules This patch adds the data migration for overduerules to circulation rules. We attempt to create the default rules based on most commonly occuring rule values and then add overrides for all other rule values we find. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172632 [details] [review] Bug 10190: DBIC Schema update Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172633 [details] [review] Bug 10190: Remove OverdueRule Koha Objects Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172634 [details] [review] Bug 10190: Fix unit test to exclude _X_ rules Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172635 [details] [review] Bug 10190: Add support for incrementable circulation rules This patch adds support for _X_ grouped circulation rules to both the internal and external API's for handling circulation rules. This allows us to group overdue_X_rulename rules by an 'X' integer so we can have triggers incremented and grouped together. We also add the new overdue_x_* rule definition here for overdue trigger rules. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172636 [details] [review] Bug 10190: Add a vue app for circulation triggers This patch adds a new vue based page for administering circulation triggers. This aims to replace the 'Overdue notice/status triggers' page available from Tools. The new page is available from Koha administration > Circulation triggers Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172637 [details] [review] Bug 10190: Add components to list/add and edit circulation triggers These new components are used by the new 'Circulation triggers' administration page to display existing trigger rules and add the ability to add new rules and edit existing ones. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172638 [details] [review] Bug 10190: Add a library API client This patch adds a library api client to the vue ecosystem for later use in the Circulation triggers page. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172639 [details] [review] Bug 10190: Add itemtypes and patron categories to the item/patron api clients This patch adds patron and itemtype api clients for the Vue ecosystem Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172640 [details] [review] Bug 10190: Let the circulation_rules endpoint accept query parameters Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172641 [details] [review] Bug 10190: Update GetBranchcodesWithOverdueRules to use CirculationRules This patch updates the C4::Overdues method GetBranchecodesWithOverdueRules to refer to the new location of these rules in the circulation rules table. We also update the unit tests to move the mocked data into the right location. We could perhaps migrate this method in Koha::CirculationRules at a later date? Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172642 [details] [review] Bug 10190: Update overdue_notices script to refer to circ rules This patch updates the overdue_notices cron script to refer to the new location for overdue rules found in the circulation rules table now. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172643 [details] [review] Bug 10190: Add itemtype handling to overdue_notices script This patch enhances the overdue_notices script to understand the newly introduced itemtype level for overdue rules. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172644 [details] [review] Bug 10190: Update has_restricting_overdues to refer to circulation rules This patch updates the Koha::Patron->has_restriction_overdues method to refer to the migrated overdue rules. We also correct an oversight in the method prior to this patch that meant that not all overdues were being correctly checked for a restriction.. we were incorrectly filtering to only overdues at the current checkin branch. Finally, we also take account of the itemtype level addition here too. NOTE: There weren't any unit tests for this Koha::Patron method.. we should add some here! Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172645 [details] [review] Bug 10190: Add letter names to tables Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172646 [details] [review] Bug 10190: Set tab based on trigger edited/created Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172647 [details] [review] Bug 10190: Add fallback to 'Default' text for notice Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172648 [details] [review] Bug 10190: Migrate MarkIssueReturned test to circulation rules Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172649 [details] [review] Bug 10190: Remove old overduerules interface This patch updates the link from the tools homepage to open the new circulation triggers administration page. We then remove the old overduerules controller and template, and finally we drop the no longer referenced C4::Overdues::GetOverdueMessageTransportTypes method and associated unit tests. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172650 [details] [review] Bug 10190: Update itiva script to reflect move to circ_rules Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172651 [details] [review] Bug 10190: Add comments to overdue_notices and rename variable Trying to fully understand how this script operates.. this patch adds some notes to the script for developers and also renames a variable that I found was being re-used. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172652 [details] [review] Bug 10190: Rework logic of overdue_notices The original logic for digesting overdues in the overdue notices script was flawed given the additional itemtype handling introduced in this patchset and the way in which it handles effective fallbacks for rules. This patch tidies the file and reworks the logic so that we fetch overdues by patron category and branch and then iterate through those comparing to the correct effective rules and combing them into digest groups based on notice + trigger level. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172653 [details] [review] Bug 10190: Display effective values and highlight them Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172654 [details] [review] Bug 10190: Restore 'edit' from 'Add/Edit' Modal Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172655 [details] [review] Bug 10190: Modal form improvements We now fetch all rules on modal open and the effective rule on context selection. This allows us to compare the specific values of the rule we're adding/editing to the fallback values present in the all rules set. We use the fallback rule values as placeholders in the input boxes to highlight to the end user what value will be used should they choose to wipe the input. We also allow wiping inputs and pass 'null' to the API appropriately. Finally, we set a minimum value for delay when adding a new rule to highlight to the user that the new trigger will be added after existing triggers. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172656 [details] [review] Bug 10190: Add custom input for delay This custom input allows for dynamic min/max rules and it updates the input styling to match other inputs on the page including a 'clear' button. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172657 [details] [review] Bug 10190: Clarify workflow This patch re-arranges the edit/add modal form to clarify the need to select context, then decide on editing an existing trigger or adding a new one and then, and only then, exposes the actual rule inputs Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172658 [details] [review] Bug 10190: Update for bootstrap 5 Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172659 [details] [review] Bug 10190: Rebase for rspack Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172660 [details] [review] Bug 10190: Rename 'All *' to 'Default rule for *' Try to clarify that the 'All' rules are actually fallback/default rules for when there's not a more specific rule for the context. We need to expose these clearly for each 'Library' view too which we're not currently doing. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172661 [details] [review] Bug 10190: Take DefaultToLoggedInLibraryOverdueTriggers into account This updates the logic for the default page load to take account of DefaultToLoggedInLibraryOverdueTriggers. Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172662 [details] [review] Bug 10190: Only display default and library specific letters This patch filters the list of letter templates available to use by only those available for the context the rule is being added for (i.e. the correct library relation) Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
Created attachment 172663 [details] [review] Bug 10190: Display value of OverdueNoticeFrom in note Sponsored-by: Glasgow Colleges Library Group <https://library.cityofglasgowcollege.ac.uk> Signed-off-by: George Harkins <George.Harkins@cityofglasgowcollege.ac.uk>
(In reply to Martin Renvoize (ashimema) from comment #65) > Notes from Nick Clemens at KohaCon24 > * Use syspref for 'All libraries' or 'Logged in library' by default - > DefaultToLoggedInLibraryOverdueTriggers DONE > * Note about whether we're talking aobut 'patrons home library' or 'items > home library' DONE > * If a notice template is only set up for one library only display it in the > notice dropdown when in that context DONE > * Can we expose somewhere the list of all notice trigger context > combinations.. In a follow-up bug I reckon.