From bb0206ee20ff67a671c18d696258773feb593691 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 --- .../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 1c75ca19fc..e06295d337 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 22385cac31..9f427fb75a 100644 --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ b/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1442,3 +1442,28 @@ tables: - "[% ELSE %]" - "The following item, [% biblio.title %], has correctly been renewed and is now due on [% checkout.date_due | $KohaDates as_due_date => 1 %]" - "[% 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 %]" \ No newline at end of file diff --git a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql index b18d65998b..a9db7ee561 100644 --- a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql @@ -302,3 +302,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 7a6a858bca..5a3360af08 100644 --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ b/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql @@ -413,3 +413,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 30083c98aa..d281808b2f 100644 --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ b/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql @@ -431,3 +431,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 cc4c82ee52..191351086a 100644 --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ b/installer/data/mysql/pl-PL/mandatory/sample_notices.sql @@ -414,15 +414,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 465e5f1ad5..ab261b9b72 100644 --- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql +++ b/installer/data/mysql/ru-RU/mandatory/sample_notices.sql @@ -412,3 +412,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 3c79c2866d..7b33ba6355 100644 --- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql +++ b/installer/data/mysql/uk-UA/mandatory/sample_notices.sql @@ -503,3 +503,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 bebb2a24ba..6ee196b923 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 @@ -186,12 +186,12 @@ Patrons: no: 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.20.1