View | Details | Raw Unified | Return to bug 23787
Collapse All | Expand All

(-)a/installer/data/mysql/atomicupdate/add_auto_renewals.perl (+35 lines)
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( q{
5
        INSERT INTO letter (module, code, name, title, content, message_transport_type) VALUES ('circulation', 'AUTO_RENEWALS', 'Notification of automatic renewal', 'Automatic renewal notice',
6
"Dear [% borrower.firstname %] [% borrower.surname %],
7
[% IF checkout.auto_renew_error %]
8
The following item, [% biblio.title %], has not been renewed because:
9
[% IF checkout.auto_renew_error == 'too_many' %]
10
You have reached the maximum number of checkouts possible.
11
[% ELSIF checkout.auto_renew_error == 'on_reserve' %]
12
This item is on hold for another patron.
13
[% ELSIF checkout.auto_renew_error == 'restriction' %]
14
You are currently restricted.
15
[% ELSIF checkout.auto_renew_error == 'overdue' %]
16
You have overdue items.
17
[% ELSIF checkout.auto_renew_error == 'auto_too_late' %]
18
It\'s too late to renew this item.
19
[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %]
20
Your total unpaid fines are too high.
21
[% END %]
22
[% ELSE %]
23
The following item, [% biblio.title %], has correctly been renewed and is now due on [% checkout.date_due %]
24
[% END %]", 'email');
25
    } );
26
27
    # or perform some test and warn
28
    # if( !column_exists( 'biblio', 'biblionumber' ) ) {
29
    #    warn "There is something wrong";
30
    # }
31
32
    # Always end with this (adjust the bug info)
33
    SetVersion( $DBversion );
34
    print "Upgrade to $DBversion done (Bug 23787 - add AUTO_RENEWALS to sample_notices)\n";
35
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (-1 / +29 lines)
Lines 1145-1147 tables: Link Here
1145
            - "Thank you,"
1145
            - "Thank you,"
1146
            - ""
1146
            - ""
1147
            - "<<branches.branchname>>"
1147
            - "<<branches.branchname>>"
1148
- 
1148
1149
        - module: circulation
1150
          code: AUTO_RENEWALS
1151
          branchcode: ""
1152
          name: "Notification of automatic renewal"
1153
          is_html: 0
1154
          title: "Automatic renewal notice"
1155
          message_transport_type: email
1156
          lang: default
1157
          content:
1158
            - "Dear [% borrower.firstname %] [% borrower.surname %],"
1159
            - "[% IF checkout.auto_renew_error %]"
1160
            - "The following item, [% biblio.title %], has not been renewed because:"
1161
            - "[% IF checkout.auto_renew_error == 'too_many' %]"
1162
            - "You have reached the maximum number of checkouts possible."
1163
            - "[% ELSIF checkout.auto_renew_error == 'on_reserve' %]"
1164
            - "This item is on hold for another patron."
1165
            - "[% ELSIF checkout.auto_renew_error == 'restriction' %]"
1166
            - "You are currently restricted."
1167
            - "[% ELSIF checkout.auto_renew_error == 'overdue' %]"
1168
            - "You have overdue items."
1169
            - "[% ELSIF checkout.auto_renew_error == 'auto_too_late' %]"
1170
            - "It\'s too late to renew this item."
1171
            - "[% ELSIF checkout.auto_renew_error == 'auto_too_much_oweing' %]"
1172
            - "Your total unpaid fines are too high."
1173
            - "[% END %]"
1174
            - "[% ELSE %]"
1175
            - "The following item, [% biblio.title %], has correctly been renewed and is now due on [% checkout.date_due %]"
1176
            - "[% END %]"

Return to bug 23787