From b29e015f7d930e5dfe592c9801ebb77c98a9d5d8 Mon Sep 17 00:00:00 2001 From: Agustin Moyano Date: Tue, 29 Oct 2019 15:27:38 -0300 Subject: [PATCH] Bug 18532: set auto_renewals as patron messaging preference This patch adds the "Auto renewals" messaging preference on intranet and OPAC, and adds digest feature to misc/cronjobs/automatic_renewals.pl script. (Deprecated test plan. Please check the last patch) To test: 1. apply patches 2. perl installer/data/mysql/updatedatabase.pl 3. make sure automatic renewals are allowed in circ rules, have a positive number of allowed renewals and a positive number for renewal period 4. go to patron categories in administration of staff interface and choose a category. CHECK => in "Default messaging preferences for this patron category" has a "Auto renewals" row and has email and digest options checked 5. grab a patron and go to details page CHECK => patron's messaging preferences has a "Auto renewals" row with email and digest options checked 6. some settings and save 7. go to opac with that same patron to "your messaging" option CHECK => patron's messaging preferences has a "Auto renewals" row, and displays changes made in staff interface. 8. uncheck email and digest from "Auto renewals" row and save 9. check out an item for that patron, and set it as automatic renewal and set due date as your current yesterday 10. perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v SUCCESS => item was renewed, and in message_queue table there is no new message for the patron 11. update patrons messaging preferences and set email option of "Auto renewals" row as checked 12. repeat steps 9 and 10 SUCCESS => item was renewed, but in message_queue table there is a new message of type AUTO_RENEWALS 13. update patrons messaging preferences and set email and digest options of "Auto renewals" row as checked 14. repeat steps 9 and 10 CHECK => item was not renewed 15. run step 10 again, but add -d flag, like this: perl misc/cronjobs/automatic_renewals.pl -c --send-notices -v -d SUCCESS => item was renewed, and in message_queue table there is a new message of type AUTO_RENEWALS_DGST 16. Sign off Signed-off-by: tgoat Signed-off-by: Kelly McElligott Signed-off-by: Kelly McElligott Signed-off-by: Marti Fuerst Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- .../en/includes/messaging-preference-form.inc | 2 + .../bootstrap/en/modules/opac-messaging.tt | 1 + misc/cronjobs/automatic_renewals.pl | 184 ++++++++++++++++-- 3 files changed, 169 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc index 7808bb20f5..bccd846ce2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -17,6 +17,7 @@ [% IF ( messaging_preference.Item_Due ) %]Item due [% ELSIF ( messaging_preference.Advance_Notice ) %]Advance notice + [% ELSIF ( messaging_preference.Upcoming_Events ) %]Upcoming events [% ELSIF ( messaging_preference.Hold_Filled ) %]Hold filled [% ELSIF ( messaging_preference.Item_Check_in ) %]Item check-in [% ELSIF ( messaging_preference.Item_Checkout ) %] @@ -27,6 +28,7 @@ [% END %] [% ELSIF ( messaging_preference.Ill_ready ) %]Interlibrary loan ready [% ELSIF ( messaging_preference.Ill_unavailable ) %]Interlibrary loan unavailable + [% ELSIF ( messaging_preference.Auto_Renewals ) %]Auto renewals [% ELSE %]Unknown [% END %] [% IF ( messaging_preference.takes_days ) %] diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt index ef0b7af5d5..f8e115895e 100644 --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -69,6 +69,7 @@ [% END %] [% ELSIF ( messaging_preference.Ill_ready ) %]Interlibrary loan ready [% ELSIF ( messaging_preference.Ill_unavailable ) %]Interlibrary loan unavailable + [% ELSIF ( messaging_preference.Auto_Renewals ) %]Auto renewals [% ELSE %]Unknown [% END %] [% IF ( messaging_preference.takes_days ) %]