Lines 1-19
Link Here
|
1 |
$DBversion = 'XXX'; # will be replaced by the RM |
1 |
$DBversion = 'XXX'; # will be replaced by the RM |
2 |
if( CheckVersion( $DBversion ) ) { |
2 |
if( CheckVersion( $DBversion ) ) { |
3 |
# you can use $dbh here like: |
3 |
# you can use $dbh here like: |
4 |
$dbh->do( qq{ |
4 |
$dbh->do( q{ |
5 |
INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'notification on auto renewing', 'Auto renewals (Digest)', |
5 |
INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS_DGST', 'Notification on auto renewals', 'Auto renewals (Digest)', |
6 |
"Dear [% borrower.firstname %] [% borrower.surname %], |
6 |
"Dear [% borrower.firstname %] [% borrower.surname %], |
7 |
[% IF error %] |
7 |
[% IF error %] |
8 |
There were [% error %] items that were not correctly renewed. |
8 |
There were [% error %] items that were not renewed. |
9 |
[% END %] |
9 |
[% END %] |
10 |
[% IF success %] |
10 |
[% IF success %] |
11 |
There were [% success %] items that where correctly renewed. |
11 |
There were [% success %] items that where renewed. |
12 |
[% END %] |
12 |
[% END %] |
13 |
[% FOREACH checkout IN checkouts %] |
13 |
[% FOREACH checkout IN checkouts %] |
14 |
[% checkout.item.biblio.title %] : [% checkout.item.barcode %] |
14 |
[% checkout.item.biblio.title %] : [% checkout.item.barcode %] |
15 |
[% IF !checkout.auto_renew_error %] |
15 |
[% IF !checkout.auto_renew_error %] |
16 |
was renewed until [% checkout.date_due %] |
16 |
was renewed until [% checkout.date_due | $KohaDates as_due_date => 1%] |
17 |
[% ELSE %] |
17 |
[% ELSE %] |
18 |
was not renewed with error: [% checkout.auto_renew_error %] |
18 |
was not renewed with error: [% checkout.auto_renew_error %] |
19 |
[% END %] |
19 |
[% END %] |
Lines 21-33
if( CheckVersion( $DBversion ) ) {
Link Here
|
21 |
", 'email'); |
21 |
", 'email'); |
22 |
}); |
22 |
}); |
23 |
|
23 |
|
24 |
$dbh->do( qq{ |
24 |
$dbh->do( q{ |
25 |
INSERT IGNORE INTO `message_attributes` |
25 |
INSERT IGNORE INTO `message_attributes` |
26 |
(`message_attribute_id`, message_name, `takes_days`) |
26 |
(`message_attribute_id`, message_name, `takes_days`) |
27 |
VALUES (7, 'Auto_Renewals', 0) |
27 |
VALUES (7, 'Auto_Renewals', 0) |
28 |
}); |
28 |
}); |
29 |
|
29 |
|
30 |
$dbh->do( qq{ |
30 |
$dbh->do( q{ |
31 |
INSERT IGNORE INTO `message_transports` |
31 |
INSERT IGNORE INTO `message_transports` |
32 |
(`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) |
32 |
(`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`) |
33 |
VALUES (7, 'email', 0, 'circulation', 'AUTO_RENEWALS'), |
33 |
VALUES (7, 'email', 0, 'circulation', 'AUTO_RENEWALS'), |
Lines 36-42
if( CheckVersion( $DBversion ) ) {
Link Here
|
36 |
(7, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST') |
36 |
(7, 'sms', 1, 'circulation', 'AUTO_RENEWALS_DGST') |
37 |
}); |
37 |
}); |
38 |
|
38 |
|
39 |
$dbh->do( qq{ |
39 |
$dbh->do( q{ |
40 |
insert into borrower_message_transport_preferences (borrower_message_preference_id, message_transport_type) |
40 |
insert into borrower_message_transport_preferences (borrower_message_preference_id, message_transport_type) |
41 |
select p.borrower_message_preference_id, 'email' |
41 |
select p.borrower_message_preference_id, 'email' |
42 |
from borrower_message_preferences p |
42 |
from borrower_message_preferences p |