Bug 15705 - DBRev 16.12.00.035

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
This commit is contained in:
Kyle M Hall 2017-05-09 21:16:05 +00:00
parent 10b94f676d
commit c6367282da
3 changed files with 42 additions and 24 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 = "16.12.00.034";
$VERSION = "16.12.00.035";
sub version {
return $VERSION;

View File

@ -1,23 +0,0 @@
ALTER TABLE issues ADD COLUMN auto_renew_error VARCHAR(32) DEFAULT NULL AFTER auto_renew;
ALTER TABLE old_issues ADD COLUMN auto_renew_error VARCHAR(32) DEFAULT NULL AFTER auto_renew;
INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS', 'notification on auto renewing', 'Auto renewals',
"Dear [% borrower.firstname %] [% borrower.surname %],
[% IF checkout.auto_renew_error %]
The following item [% biblio.title %] has not been correctly renewed
[% IF checkout.auto_renew_error == 'too_many' %]
You have reach the maximum 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 overdues.
[% ELSIF checkout.auto_renew_error == 'auto_too_late' %]
It\'s too late to renew this checkout.
[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %]
You have too much unpaid fines.
[% END %]
[% ELSE %]
The following item [% biblio.title %] has correctly been renewed and is now due [% checkout.date_due %]
[% END %]", 'email');

View File

@ -14421,6 +14421,47 @@ if( CheckVersion( $DBversion ) ) {
print "Upgrade to $DBversion done (Bug 15582 - Ability to block auto renewals if the OPACFineNoRenewals amount is reached)\n";
}
$DBversion = '16.12.00.035';
if( CheckVersion( $DBversion ) ) {
if( !column_exists( 'issues', 'auto_renew_error' ) ) {
$dbh->do(q{
ALTER TABLE issues ADD COLUMN auto_renew_error VARCHAR(32) DEFAULT NULL AFTER auto_renew;
});
}
if( !column_exists( 'old_issues', 'auto_renew_error' ) ) {
$dbh->do(q{
ALTER TABLE old_issues ADD COLUMN auto_renew_error VARCHAR(32) DEFAULT NULL AFTER auto_renew;
});
}
$dbh->do(q{
INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS', 'notification on auto renewing', 'Auto renewals',
"Dear [% borrower.firstname %] [% borrower.surname %],
[% IF checkout.auto_renew_error %]
The following item [% biblio.title %] has not been correctly renewed
[% IF checkout.auto_renew_error == 'too_many' %]
You have reach the maximum 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 overdues.
[% ELSIF checkout.auto_renew_error == 'auto_too_late' %]
It\'s too late to renew this checkout.
[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %]
You have too much unpaid fines.
[% END %]
[% ELSE %]
The following item [% biblio.title %] has correctly been renewed and is now due [% checkout.date_due %]
[% END %]", 'email');
});
SetVersion( $DBversion );
print "Upgrade to $DBversion done (Bug 15705 - Notify the user on auto renewing)\n";
}
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.