From bc0ee173df096c1e7811581921d999c3e9ea6ca1 Mon Sep 17 00:00:00 2001
From: Agustin Moyano
Date: Thu, 10 Dec 2020 16:27:45 -0300
Subject: [PATCH] Bug 18532: (follow-up) Fix notice message, add notice to all
installer languages and fix preference message
Signed-off-by: Tomas Cohen Arazi
Signed-off-by: Martin Renvoize
Signed-off-by: Jonathan Druart
---
.../data/mysql/atomicupdate/bug-18532.perl | 16 ++++++------
.../mysql/en/mandatory/sample_notices.yml | 25 +++++++++++++++++++
.../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 | 6 ++---
.../mysql/ru-RU/mandatory/sample_notices.sql | 18 +++++++++++++
.../mysql/uk-UA/mandatory/sample_notices.sql | 18 +++++++++++++
.../en/modules/admin/preferences/patrons.pref | 4 +--
9 files changed, 128 insertions(+), 13 deletions(-)
diff --git a/installer/data/mysql/atomicupdate/bug-18532.perl b/installer/data/mysql/atomicupdate/bug-18532.perl
index 9d9aff2697..9daf0a5284 100644
--- a/installer/data/mysql/atomicupdate/bug-18532.perl
+++ b/installer/data/mysql/atomicupdate/bug-18532.perl
@@ -1,19 +1,19 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
# you can use $dbh here like:
- $dbh->do( qq{
- INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'notification on auto renewing', 'Auto renewals (Digest)',
+ $dbh->do( q{
+ INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)',
"Dear [% borrower.firstname %] [% borrower.surname %],
[% IF error %]
- There were [% error %] items that were not correctly renewed.
+ There were [% error %] items that were not renewed.
[% END %]
[% IF success %]
- There were [% success %] items that where correctly renewed.
+ There were [% success %] items that where renewed.
[% END %]
[% FOREACH checkout IN checkouts %]
[% checkout.item.biblio.title %] : [% checkout.item.barcode %]
[% IF !checkout.auto_renew_error %]
- was renewed until [% checkout.date_due %]
+ was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%]
[% ELSE %]
was not renewed with error: [% checkout.auto_renew_error %]
[% END %]
@@ -21,13 +21,13 @@ if( CheckVersion( $DBversion ) ) {
", 'email');
});
- $dbh->do( qq{
+ $dbh->do( q{
INSERT IGNORE INTO `message_attributes`
(`message_attribute_id`, message_name, `takes_days`)
VALUES (7, 'Auto_Renewals', 0)
});
- $dbh->do( qq{
+ $dbh->do( q{
INSERT IGNORE INTO `message_transports`
(`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`)
VALUES (7, 'email', 0, 'circulation', 'AUTO_RENEWALS'),
@@ -36,7 +36,7 @@ if( CheckVersion( $DBversion ) ) {
(7, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST')
});
- $dbh->do( qq{
+ $dbh->do( q{
insert into borrower_message_transport_preferences (borrower_message_preference_id, message_transport_type)
select p.borrower_message_preference_id, 'email'
from borrower_message_preferences p
diff --git a/installer/data/mysql/en/mandatory/sample_notices.yml b/installer/data/mysql/en/mandatory/sample_notices.yml
index e58c0075af..745321f717 100644
--- a/installer/data/mysql/en/mandatory/sample_notices.yml
+++ b/installer/data/mysql/en/mandatory/sample_notices.yml
@@ -1478,3 +1478,28 @@ tables:
- "Barcode: [% item.barcode %]
"
- "
"
- "[% END %]"
+
+ - module: circulation
+ code: AUTO_RENEWALS_DGST
+ branchcode: ""
+ name: "Notification on auto renewals"
+ is_html: 0
+ title: "Auto renewals (Digest)"
+ message_transport_type: email
+ lang: default
+ content:
+ - "Dear [% borrower.firstname %] [% borrower.surname %],"
+ - "[% IF error %]"
+ - "There were [% error %] items that were not renewed."
+ - "[% END %]"
+ - "[% IF success %]"
+ - "There were [% success %] items that where 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 %]"
+ - "[% 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 2317e98575..94aa4deec8 100644
--- a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql
+++ b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql
@@ -316,3 +316,21 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default');
+
+INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)',
+"Dear [% borrower.firstname %] [% borrower.surname %],
+[% IF error %]
+ There were [% error %] items that were not renewed.
+[% END %]
+[% IF success %]
+ There were [% success %] items that where 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 %]
+ [% 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 7bc86d3ec2..745d46acec 100644
--- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
+++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql
@@ -429,3 +429,21 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default');
+
+INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)',
+"Dear [% borrower.firstname %] [% borrower.surname %],
+[% IF error %]
+ There were [% error %] items that were not renewed.
+[% END %]
+[% IF success %]
+ There were [% success %] items that where 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 %]
+ [% 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 19821cb794..e0c7048909 100644
--- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql
+++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql
@@ -447,3 +447,21 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default');
+
+INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)',
+"Dear [% borrower.firstname %] [% borrower.surname %],
+[% IF error %]
+ There were [% error %] items that were not renewed.
+[% END %]
+[% IF success %]
+ There were [% success %] items that where 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 %]
+ [% 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 75e1311d55..7764c1ec18 100644
--- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql
+++ b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql
@@ -430,15 +430,15 @@ The following item, [% biblio.title %], has correctly been renewed and is now du
INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewing', 'Auto renewals (Digest)',
"Dear [% borrower.firstname %] [% borrower.surname %],
[% IF error %]
- There were [% error %] items that were not correctly renewed.
+ There were [% error %] items that were not renewed.
[% END %]
[% IF success %]
- There were [% success %] items that where correctly renewed.
+ There were [% success %] items that where 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 %]
+ was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%]
[% ELSE %]
was not renewed with error: [% checkout.auto_renew_error %]
[% END %]
diff --git a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql
index e9b0006f91..b4ff4efc45 100644
--- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql
+++ b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql
@@ -428,3 +428,21 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default');
+
+INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)',
+"Dear [% borrower.firstname %] [% borrower.surname %],
+[% IF error %]
+ There were [% error %] items that were not renewed.
+[% END %]
+[% IF success %]
+ There were [% success %] items that where 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 %]
+ [% 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 1c8b70eda7..16c26b1f5d 100644
--- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql
+++ b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql
@@ -519,3 +519,21 @@ INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, conten
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_CANCEL', '', 'ILL request cancelled', 0, "Interlibrary loan request cancelled", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has requested cancellation of this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_REQUEST_MODIFIED', '', 'ILL request modified', 0, "Interlibrary loan request modified", "The patron for interlibrary loans request [% illrequest.illrequest_id %], with the following details, has modified this ILL request:\n\n[% ill_full_metadata %]", 'sms', 'default');
INSERT IGNORE INTO letter(module, code, branchcode, name, is_html, title, content, message_transport_type, lang) VALUES ('ill', 'ILL_PARTNER_REQ', '', 'ILL request to partners', 0, "Interlibrary loan request to partners", "Dear Sir/Madam,\n\nWe would like to request an interlibrary loan for a title matching the following description:\n\n[% ill_full_metadata %]\n\nPlease let us know if you are able to supply this to us.\n\nKind Regards\n\n[% branch.branchname %]\n[% branch.branchaddress1 %]\n[% branch.branchaddress2 %]\n[% branch.branchaddress3 %]\n[% branch.branchcity %]\n[% branch.branchstate %]\n[% branch.branchzip %]\n[% branch.branchphone %]\n[% branch.branchillemail %]\n[% branch.branchemail %]", 'sms', 'default');
+
+INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)',
+"Dear [% borrower.firstname %] [% borrower.surname %],
+[% IF error %]
+ There were [% error %] items that were not renewed.
+[% END %]
+[% IF success %]
+ There were [% success %] items that where 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 %]
+ [% END %]
+[% END %]
+", 'email');
\ No newline at end of file
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
index 21235e9ee5..e599773fa2 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref
@@ -192,12 +192,12 @@ Patrons:
0: Disable
- sending purchase suggestion messages by SMS if no patron email is defined.
-
- - "Send automatic renewal notices "
+ - "Send automatic renewal notices: "
- pref: AutoRenewalNotices
choices:
never: never
preferences: according to patron messaging preferences
- cron: (Deprecated) according to cron switch
+ cron: (Deprecated) according to --send-notices cron switch
Patron forms:
-
- "The following database columns must be filled in on the patron entry screen:"
--
2.39.5