Bug 32518: Add reason option to cancel_unfilled_holds cronjob
authorNick Clemens <nick@bywatersolutions.com>
Thu, 22 Dec 2022 21:02:56 +0000 (21:02 +0000)
committerTomas Cohen Arazi <tomascohen@theke.io>
Thu, 2 Mar 2023 17:46:16 +0000 (14:46 -0300)
commit406d61cbb2da5c75adb659ef0f4a42c2734b73ca
tree1e03b20f68cb01bea0055dc2b6ea471c8f47833c
parent9e19a88f021c1a53ef3324193b88c55b48e19e87
Bug 32518: Add reason option to cancel_unfilled_holds cronjob

This adds a reaosn parameter and passes it into the cancellation if supplied

To test:
1 - Place a hold for a patron in your system
2 - Run script with --days 0 -v
3 - verify that it would cancel the reserves (and that you are okay with cancelling the ones it found)
4 - Make sure you have a notice in the holds module with code 'HOLD_CANCELLATION'
5 - Set content of the notice like:
[% IF hold.cancellation_reason=='too_old' %]
Canceled old
[% END %]
6 - Run script with --days 0 -v --reason too_bad -c
7 - Confirm hold cancelled, no notice sent to patron
8 - Place another hold
9 - Run script with --days 0 -v --reason too_old -c
10 - Confirm hold cancelled, notice sent to patron

Signed-off-by: Andrew Fuerste-Henry <andrewfh@dubcolib.org>
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
misc/cronjobs/holds/cancel_unfilled_holds.pl