@@ -, +, @@ auto_renewals messaging preference when not needed --- .../data/mysql/atomicupdate/bug-18532.perl | 16 ++++++++++---- .../mysql/pl-PL/mandatory/sample_notices.sql | 22 +++++++++++++------ .../en/includes/messaging-preference-form.inc | 3 +-- .../bootstrap/en/modules/opac-messaging.tt | 2 +- misc/cronjobs/automatic_renewals.pl | 13 +++++++---- 5 files changed, 38 insertions(+), 18 deletions(-) --- a/installer/data/mysql/atomicupdate/bug-18532.perl +++ a/installer/data/mysql/atomicupdate/bug-18532.perl @@ -4,11 +4,19 @@ if( CheckVersion( $DBversion ) ) { $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)', "Dear [% borrower.firstname %] [% borrower.surname %], - [% IF checkout.auto_renew_errors %] - There were [% checkout.auto_renew_errors %] items that where not correctly renewed. + [% IF error %] + There were [% error %] items that were not correctly renewed. [% END %] - [% IF checkout.auto_renew %] - There were [% checkout.auto_renew %] items that where correctly renewed. + [% IF success %] + There were [% success %] items that where correctly renewed. + [% END %] + [% FOREACH checkout IN checkouts %] + [% checkout.item.biblio.title %] : [% checkout.item.barcode %] + [% IF !checkout.auto_renew_error %] + was renewed until [% checkout.date_due %] + [% ELSE %] + was not renewed with error: [% checkout.auto_renew_error %] + [% END %] [% END %] ", 'email'); }); --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql @@ -411,12 +411,20 @@ This item must be renewed at the library. The following item, [% biblio.title %], has correctly been renewed and is now due on [% checkout.date_due | $KohaDates as_due_date => 1 %] [% END %]", 'email'); -INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewing', 'Auto renewals (Digest)', +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 <> %] -There were <> items that where not correctly renewed. +[% IF error %] + There were [% error %] items that were not correctly renewed. [% END %] -[% IF <> %] -There were <> items that where correctly renewed. -[% END %]", 'email'); - +[% IF success %] + There were [% success %] items that where correctly 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 %] + [% ELSE %] + was not renewed with error: [% checkout.auto_renew_error %] + [% END %] +[% END %] +", 'email'); --- a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc @@ -14,10 +14,10 @@ [% FOREACH messaging_preference IN messaging_preferences %] [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] + [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %] [% 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 ) %] @@ -28,7 +28,6 @@ [% 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 ) %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -56,6 +56,7 @@ [% FOREACH messaging_preference IN messaging_preferences %] [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %] + [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %] [% IF ( messaging_preference.Item_Due ) %]Item due [% ELSIF ( messaging_preference.Advance_Notice ) %]Advance notice @@ -69,7 +70,6 @@ [% 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 ) %]