Line 0
Link Here
|
|
|
1 |
$DBversion = 'XXX'; # will be replaced by the RM |
2 |
if( CheckVersion( $DBversion ) ) { |
3 |
# you can use $dbh here like: |
4 |
$dbh->do( "INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS', 'Notification of automatic renewal', 'Automatic renewal notice', |
5 |
"Dear [% borrower.firstname %] [% borrower.surname %], |
6 |
[% IF checkout.auto_renew_error %] |
7 |
The following item, [% biblio.title %], has not been renewed because: |
8 |
[% IF checkout.auto_renew_error == 'too_many' %] |
9 |
You have reached the maximum of checkouts possible. |
10 |
[% ELSIF checkout.auto_renew_error == 'on_reserve' %] |
11 |
This item is on hold for another patron. |
12 |
[% ELSIF checkout.auto_renew_error == 'restriction' %] |
13 |
You are currently restricted. |
14 |
[% ELSIF checkout.auto_renew_error == 'overdue' %] |
15 |
You have overdue items. |
16 |
[% ELSIF checkout.auto_renew_error == 'auto_too_late' %] |
17 |
It\'s too late to renew this item. |
18 |
[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %] |
19 |
Your total unpaid fines are too high. |
20 |
[% END %] |
21 |
[% ELSE %] |
22 |
The following item, [% biblio.title %], has correctly been renewed and is now due on [% checkout.date_due %] |
23 |
[% END %]", 'email');" ); |
24 |
|
25 |
# or perform some test and warn |
26 |
# if( !column_exists( 'biblio', 'biblionumber' ) ) { |
27 |
# warn "There is something wrong"; |
28 |
# } |
29 |
|
30 |
# Always end with this (adjust the bug info) |
31 |
SetVersion( $DBversion ); |
32 |
print "Upgrade to $DBversion done (Bug 23787 - Add AUTO_RENEWALS in sample_notices.sql)\n"; |
33 |
} |