@@ -, +, @@ automatic_renewals script --- .../data/mysql/en/mandatory/sample_notices.yml | 16 ++++++++++++++-- .../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, 105 insertions(+), 21 deletions(-) --- a/installer/data/mysql/en/mandatory/sample_notices.yml +++ a/installer/data/mysql/en/mandatory/sample_notices.yml @@ -1499,7 +1499,19 @@ tables: - "[% 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 %]" --- a/installer/data/mysql/fr-CA/obligatoire/sample_notices.sql +++ a/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'); --- a/installer/data/mysql/fr-FR/1-Obligatoire/sample_notices.sql +++ a/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'); --- a/installer/data/mysql/nb-NO/1-Obligatorisk/sample_notices.sql +++ a/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'); --- a/installer/data/mysql/pl-PL/mandatory/sample_notices.sql +++ a/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'); --- a/installer/data/mysql/ru-RU/mandatory/sample_notices.sql +++ a/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'); --- a/installer/data/mysql/uk-UA/mandatory/sample_notices.sql +++ a/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'); --- a/misc/cronjobs/automatic_renewals.pl +++ a/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'; --