Bug 18532: DBRev 20.12.00.024

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
This commit is contained in:
Jonathan Druart 2021-03-16 16:07:37 +01:00
parent 42483f651a
commit e01bff1135
3 changed files with 59 additions and 58 deletions

View File

@ -29,7 +29,7 @@ use vars qw{ $VERSION };
# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
$VERSION = "20.12.00.023";
$VERSION = "20.12.00.024";
sub version {
return $VERSION;

View File

@ -1,57 +0,0 @@
$DBversion = 'XXX'; # will be replaced by the RM
if( CheckVersion( $DBversion ) ) {
# you can use $dbh here like:
$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 renewed.
[% END %]
[% IF success %]
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%]
[% 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');
});
$dbh->do( q{
INSERT IGNORE INTO `message_attributes`
(`message_attribute_id`, message_name, `takes_days`)
VALUES (9, 'Auto_Renewals', 0)
});
$dbh->do( q{
INSERT IGNORE INTO `message_transports`
(`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`)
VALUES (9, 'email', 0, 'circulation', 'AUTO_RENEWALS'),
(9, 'sms', 0, 'circulation', 'AUTO_RENEWALS'),
(9, 'email', 1, 'circulation', 'AUTO_RENEWALS_DGST'),
(9, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST')
});
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
VALUES ('AutoRenewalNotices','cron','cron|preferences|never','How should Koha determine whether to end autorenewal notices','Choice')
});
NewVersion( $DBversion, 18532, 'Messaging preferences for auto renewals' );
}

View File

@ -23670,6 +23670,64 @@ if( CheckVersion( $DBversion ) ) {
NewVersion( $DBversion, 27652, "Separate values for OPACHoldsIfAvailableAtPickupExceptions and BatchCheckoutsValidCategories with comma");
}
$DBversion = '20.12.00.024';
if( CheckVersion( $DBversion ) ) {
$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 renewed.
[% END %]
[% IF success %]
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%]
[% 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');
});
$dbh->do( q{
INSERT IGNORE INTO `message_attributes`
(`message_attribute_id`, message_name, `takes_days`)
VALUES (9, 'Auto_Renewals', 0)
});
$dbh->do( q{
INSERT IGNORE INTO `message_transports`
(`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`)
VALUES (9, 'email', 0, 'circulation', 'AUTO_RENEWALS'),
(9, 'sms', 0, 'circulation', 'AUTO_RENEWALS'),
(9, 'email', 1, 'circulation', 'AUTO_RENEWALS_DGST'),
(9, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST')
});
$dbh->do(q{
INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type)
VALUES ('AutoRenewalNotices','cron','cron|preferences|never','How should Koha determine whether to end autorenewal notices','Choice')
});
NewVersion( $DBversion, 18532, 'Messaging preferences for auto renewals' );
}
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.
my $update_dir = C4::Context->config('intranetdir') . '/installer/data/mysql/atomicupdate/';