Bugzilla – Attachment 118331 Details for
Bug 18532
Messaging preferences for auto renewals
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 18532: (follow-up) fix messages and bug in automatic_renewals script
Bug-18532-follow-up-fix-messages-and-bug-in-automa.patch (text/plain), 13.95 KB, created by
Agustín Moyano
on 2021-03-16 14:48:17 UTC
(
hide
)
Description:
Bug 18532: (follow-up) fix messages and bug in automatic_renewals script
Filename:
MIME Type:
Creator:
Agustín Moyano
Created:
2021-03-16 14:48:17 UTC
Size:
13.95 KB
patch
obsolete
>From 73c530d519eaac05e909bd8b9412f2c1baa1671d Mon Sep 17 00:00:00 2001 >From: Agustin Moyano <agustinmoyano@theke.io> >Date: Tue, 16 Mar 2021 11:44:19 -0300 >Subject: [PATCH] Bug 18532: (follow-up) fix messages and bug in > automatic_renewals script > >--- > .../data/mysql/en/mandatory/sample_notices.yml | 18 +++++++++++++++--- > .../mysql/fr-CA/obligatoire/sample_notices.sql | 18 +++++++++++++++--- > .../fr-FR/1-Obligatoire/sample_notices.sql | 18 +++++++++++++++--- > .../nb-NO/1-Obligatorisk/sample_notices.sql | 18 +++++++++++++++--- > .../mysql/pl-PL/mandatory/sample_notices.sql | 18 +++++++++++++++--- > .../mysql/ru-RU/mandatory/sample_notices.sql | 18 +++++++++++++++--- > .../mysql/uk-UA/mandatory/sample_notices.sql | 18 +++++++++++++++--- > misc/cronjobs/automatic_renewals.pl | 2 +- > 8 files changed, 106 insertions(+), 22 deletions(-) > >diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml >index 745321f717..bbcddf545c 100644 >--- a/installer/data/mysql/en/mandatory/sample_notices.yml >+++ b/installer/data/mysql/en/mandatory/sample_notices.yml >@@ -1493,13 +1493,25 @@ tables: > - "There were [% error %] items that were not renewed." > - "[% END %]" > - "[% IF success %]" >- - "There were [% success %] items that where renewed." >+ - "There were [% success %] items that were renewed." > - "[% END %]" > - "[% FOREACH checkout IN checkouts %]" > - "[% checkout.item.biblio.title %] : [% checkout.item.barcode %]" > - "[% IF !checkout.auto_renew_error %]" > - "was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%]" >- - "[% ELSE %]" >- - "was not renewed with error: [% checkout.auto_renew_error %]" >+ - "[% ELSIF checkout.auto_renew_error == 'too_many' %]" >+ - "You have reached the maximum number of checkouts possible." >+ - "[% ELSIF checkout.auto_renew_error == 'on_reserve' %]" >+ - "This item is on hold for another patron." >+ - "[% ELSIF checkout.auto_renew_error == 'restriction' %]" >+ - "You are currently restricted." >+ - "[% ELSIF checkout.auto_renew_error == 'overdue' %]" >+ - "You have overdue items." >+ - "[% ELSIF checkout.auto_renew_error == 'auto_too_late' %]" >+ - "It's too late to renew this item." >+ - "[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %]" >+ - "Your total unpaid fines are too high." >+ - "[% ELSIF checkout.auto_renew_error == 'too_unseen' %]" >+ - "This item must be renewed at the library." > - "[% END %]" > - "[% END %]" >diff --git a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql >index 94aa4deec8..0f88bccf19 100644 >--- a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql >+++ b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql >@@ -323,14 +323,26 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport > There were [% error %] items that were not renewed. > [% END %] > [% IF success %] >- There were [% success %] items that where renewed. >+ There were [% success %] items that were renewed. > [% END %] > [% FOREACH checkout IN checkouts %] > [% checkout.item.biblio.title %] : [% checkout.item.barcode %] > [% IF !checkout.auto_renew_error %] > was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] >- [% ELSE %] >- was not renewed with error: [% checkout.auto_renew_error %] >+ [% ELSIF checkout.auto_renew_error == 'too_many' %] >+ You have reached the maximum number of checkouts possible. >+ [% ELSIF checkout.auto_renew_error == 'on_reserve' %] >+ This item is on hold for another patron. >+ [% ELSIF checkout.auto_renew_error == 'restriction' %] >+ You are currently restricted. >+ [% ELSIF checkout.auto_renew_error == 'overdue' %] >+ You have overdue items. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_late' %] >+ It's too late to renew this item. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] >+ Your total unpaid fines are too high. >+ [% ELSIF checkout.auto_renew_error == 'too_unseen' %] >+ This item must be renewed at the library. > [% END %] > [% END %] > ", 'email'); >\ No newline at end of file >diff --git a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql >index 745d46acec..779ba021a2 100644 >--- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql >+++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql >@@ -436,14 +436,26 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport > There were [% error %] items that were not renewed. > [% END %] > [% IF success %] >- There were [% success %] items that where renewed. >+ There were [% success %] items that were renewed. > [% END %] > [% FOREACH checkout IN checkouts %] > [% checkout.item.biblio.title %] : [% checkout.item.barcode %] > [% IF !checkout.auto_renew_error %] > was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] >- [% ELSE %] >- was not renewed with error: [% checkout.auto_renew_error %] >+ [% ELSIF checkout.auto_renew_error == 'too_many' %] >+ You have reached the maximum number of checkouts possible. >+ [% ELSIF checkout.auto_renew_error == 'on_reserve' %] >+ This item is on hold for another patron. >+ [% ELSIF checkout.auto_renew_error == 'restriction' %] >+ You are currently restricted. >+ [% ELSIF checkout.auto_renew_error == 'overdue' %] >+ You have overdue items. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_late' %] >+ It's too late to renew this item. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] >+ Your total unpaid fines are too high. >+ [% ELSIF checkout.auto_renew_error == 'too_unseen' %] >+ This item must be renewed at the library. > [% END %] > [% END %] > ", 'email'); >\ No newline at end of file >diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql >index e0c7048909..d89a445f50 100644 >--- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql >+++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql >@@ -454,14 +454,26 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport > There were [% error %] items that were not renewed. > [% END %] > [% IF success %] >- There were [% success %] items that where renewed. >+ There were [% success %] items that were renewed. > [% END %] > [% FOREACH checkout IN checkouts %] > [% checkout.item.biblio.title %] : [% checkout.item.barcode %] > [% IF !checkout.auto_renew_error %] > was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] >- [% ELSE %] >- was not renewed with error: [% checkout.auto_renew_error %] >+ [% ELSIF checkout.auto_renew_error == 'too_many' %] >+ You have reached the maximum number of checkouts possible. >+ [% ELSIF checkout.auto_renew_error == 'on_reserve' %] >+ This item is on hold for another patron. >+ [% ELSIF checkout.auto_renew_error == 'restriction' %] >+ You are currently restricted. >+ [% ELSIF checkout.auto_renew_error == 'overdue' %] >+ You have overdue items. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_late' %] >+ It's too late to renew this item. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] >+ Your total unpaid fines are too high. >+ [% ELSIF checkout.auto_renew_error == 'too_unseen' %] >+ This item must be renewed at the library. > [% END %] > [% END %] > ", 'email'); >\ No newline at end of file >diff --git a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql >index 7764c1ec18..550901eb7b 100644 >--- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql >+++ b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql >@@ -433,14 +433,26 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport > There were [% error %] items that were not renewed. > [% END %] > [% IF success %] >- There were [% success %] items that where renewed. >+ There were [% success %] items that were renewed. > [% END %] > [% FOREACH checkout IN checkouts %] > [% checkout.item.biblio.title %] : [% checkout.item.barcode %] > [% IF !checkout.auto_renew_error %] > was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] >- [% ELSE %] >- was not renewed with error: [% checkout.auto_renew_error %] >+ [% ELSIF checkout.auto_renew_error == 'too_many' %] >+ You have reached the maximum number of checkouts possible. >+ [% ELSIF checkout.auto_renew_error == 'on_reserve' %] >+ This item is on hold for another patron. >+ [% ELSIF checkout.auto_renew_error == 'restriction' %] >+ You are currently restricted. >+ [% ELSIF checkout.auto_renew_error == 'overdue' %] >+ You have overdue items. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_late' %] >+ It's too late to renew this item. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] >+ Your total unpaid fines are too high. >+ [% ELSIF checkout.auto_renew_error == 'too_unseen' %] >+ This item must be renewed at the library. > [% END %] > [% END %] > ", 'email'); >diff --git a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql >index b4ff4efc45..0d28d7c31f 100644 >--- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql >+++ b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql >@@ -435,14 +435,26 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport > There were [% error %] items that were not renewed. > [% END %] > [% IF success %] >- There were [% success %] items that where renewed. >+ There were [% success %] items that were renewed. > [% END %] > [% FOREACH checkout IN checkouts %] > [% checkout.item.biblio.title %] : [% checkout.item.barcode %] > [% IF !checkout.auto_renew_error %] > was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] >- [% ELSE %] >- was not renewed with error: [% checkout.auto_renew_error %] >+ [% ELSIF checkout.auto_renew_error == 'too_many' %] >+ You have reached the maximum number of checkouts possible. >+ [% ELSIF checkout.auto_renew_error == 'on_reserve' %] >+ This item is on hold for another patron. >+ [% ELSIF checkout.auto_renew_error == 'restriction' %] >+ You are currently restricted. >+ [% ELSIF checkout.auto_renew_error == 'overdue' %] >+ You have overdue items. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_late' %] >+ It's too late to renew this item. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] >+ Your total unpaid fines are too high. >+ [% ELSIF checkout.auto_renew_error == 'too_unseen' %] >+ This item must be renewed at the library. > [% END %] > [% END %] > ", 'email'); >\ No newline at end of file >diff --git a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql >index 16c26b1f5d..da38015d2a 100644 >--- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql >+++ b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql >@@ -526,14 +526,26 @@ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport > There were [% error %] items that were not renewed. > [% END %] > [% IF success %] >- There were [% success %] items that where renewed. >+ There were [% success %] items that were renewed. > [% END %] > [% FOREACH checkout IN checkouts %] > [% checkout.item.biblio.title %] : [% checkout.item.barcode %] > [% IF !checkout.auto_renew_error %] > was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] >- [% ELSE %] >- was not renewed with error: [% checkout.auto_renew_error %] >+ [% ELSIF checkout.auto_renew_error == 'too_many' %] >+ You have reached the maximum number of checkouts possible. >+ [% ELSIF checkout.auto_renew_error == 'on_reserve' %] >+ This item is on hold for another patron. >+ [% ELSIF checkout.auto_renew_error == 'restriction' %] >+ You are currently restricted. >+ [% ELSIF checkout.auto_renew_error == 'overdue' %] >+ You have overdue items. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_late' %] >+ It's too late to renew this item. >+ [% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] >+ Your total unpaid fines are too high. >+ [% ELSIF checkout.auto_renew_error == 'too_unseen' %] >+ This item must be renewed at the library. > [% END %] > [% END %] > ", 'email'); >\ No newline at end of file >diff --git a/misc/cronjobs/automatic_renewals.pl b/misc/cronjobs/automatic_renewals.pl >index e407b3f114..c8958cdc9d 100755 >--- a/misc/cronjobs/automatic_renewals.pl >+++ b/misc/cronjobs/automatic_renewals.pl >@@ -183,7 +183,7 @@ while ( my $auto_renew = $auto_renews->next ) { > # cache this one to process after we've run through all of the items. > if ($digest_per_branch) { > $renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{success}++ if $error eq 'auto_renew'; >- $renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{error}++ unless $error eq 'auto_renew' || $error == 'auto_too_soon' ; >+ $renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{error}++ unless $error eq 'auto_renew' || $error eq 'auto_too_soon' ; > push @{$renew_digest->{ $auto_renew->branchcode }->{ $auto_renew->borrowernumber }->{issues}}, $auto_renew->itemnumber; > } else { > $renew_digest->{ $auto_renew->borrowernumber }->{success} ++ if $error eq 'auto_renew'; >-- >2.25.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 18532
:
95030
|
95031
|
95337
|
95338
|
95456
|
96049
|
96050
|
96487
|
96494
|
96495
|
98078
|
98079
|
99193
|
99194
|
104880
|
104881
|
104882
|
104883
|
105500
|
105501
|
105502
|
105503
|
114316
|
115798
|
115799
|
115800
|
115801
|
115802
|
115829
|
115830
|
115831
|
115832
|
115833
|
118198
|
118199
|
118205
|
118318
|
118329
|
118330
| 118331 |
118356