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

(-)a/C4/Members/Messaging.pm (-1 / +4 lines)
Lines 230-236 END_SQL Link Here
230
        'Auto_Renewals'    => 9,
230
        'Auto_Renewals'    => 9,
231
        'Advance_Notice'   => 10,
231
        'Advance_Notice'   => 10,
232
        'Item_Due'         => 11,
232
        'Item_Due'         => 11,
233
        'Item_Check_in'    => 12
233
        'Item_Check_in'    => 12,
234
        'Overdue1'         => 13,
235
        'Overdue2'         => 14,
236
        'Overdue3'         => 15,
234
    );
237
    );
235
238
236
    @return =
239
    @return =
(-)a/installer/data/mysql/atomicupdate/bug_30515-add_system_preferences.pl (-16 lines)
Lines 1-16 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "30515",
5
    description => "Add system preferences for patron specific overdue notice preferences",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(q{INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('UsePatronPreferencesForOverdueNotices', '0', NULL, 'Use patron specific messaging preferences for overdue notices if available', 'YesNo')});
11
        say $out "UsePatronPreferencesForOverdueNotices system preference added";
12
13
        $dbh->do(q{INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`) VALUES ('UsePatronPreferencesForOverdueNoticesPrint', 'always', 'always|fallback|never', 'When to send print notices when using patron specific messaging preferences for overdue notices', 'Choice')});
14
        say $out "UsePatronPreferencesForOverdueNoticesPrint system preference added";
15
    },
16
};
(-)a/installer/data/mysql/atomicupdate/bug_30515-move_overdue_transports_to_patron_messaging_preferences.pl (+66 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => "30515",
5
    description => "Add system preferences for patron specific overdue notice preferences",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
10
        $dbh->do(
11
            q{
12
                INSERT IGNORE INTO `message_attributes`
13
                    (`message_attribute_id`, `message_name`, `takes_days`)
14
                VALUES
15
                    (15, 'Overdue1', 0),
16
                    (16, 'Overdue2', 0),
17
                    (17, 'Overdue3', 0)
18
            }
19
        );
20
        say $out "Message attributes for overdue notices added";
21
22
        $dbh->do(
23
            q{
24
                INSERT IGNORE INTO `message_transports`
25
                    (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`)
26
                VALUES
27
                    (15, 'email', 0, 'circulation', 'ODUE'),
28
                    (15, 'sms', 0, 'circulation', 'ODUE'),
29
                    (16, 'email', 0, 'circulation', 'ODUE2'),
30
                    (16, 'sms', 0, 'circulation', 'ODUE2'),
31
                    (17, 'email', 0, 'circulation', 'ODUE3'),
32
                    (17, 'sms', 0, 'circulation', 'ODUE3')
33
            }
34
        );
35
        say $out "Message transports for overdue notices added";
36
37
        $dbh->do(
38
            q{
39
                INSERT IGNORE INTO systempreferences
40
                    (`variable`, `value`, `options`, `explanation`, `type`)
41
                VALUES (
42
                    'UsePatronPreferencesForOverdueNotices',
43
                    '0',
44
                    NULL,
45
                    'Use patron specific messaging preferences for overdue notices if available',
46
                    'YesNo'
47
                )
48
            }
49
        );
50
        say $out "UsePatronPreferencesForOverdueNotices system preference added";
51
52
        $dbh->do(
53
            q{
54
                INSERT IGNORE INTO systempreferences (`variable`, `value`, `options`, `explanation`, `type`)
55
                VALUES (
56
                    'UsePatronPreferencesForOverdueNoticesPrint',
57
                    'always',
58
                    'always|fallback|never',
59
                    'When to send print notices when using patron specific messaging preferences for overdue notices',
60
                    'Choice'
61
                )
62
            }
63
        );
64
        say $out "UsePatronPreferencesForOverdueNoticesPrint system preference added";
65
    },
66
}
(-)a/installer/data/mysql/en/mandatory/sample_notices.yml (+63 lines)
Lines 885-890 tables: Link Here
885
            - ""
885
            - ""
886
            - "According to our current records, you have items that are overdue."
886
            - "According to our current records, you have items that are overdue."
887
            - "Please return or renew your overdue items at the library as soon as possible."
887
            - "Please return or renew your overdue items at the library as soon as possible."
888
            - ""
889
            - "<<branches.branchname>>"
890
            - "<<branches.branchaddress1>>"
891
            - "<<branches.branchaddress2>> <<branches.branchaddress3>>"
892
            - "Phone: <<branches.branchphone>>"
893
            - "Fax: <<branches.branchfax>>"
894
            - "Email: <<branches.branchemail>>"
895
            - ""
896
            - "If you have registered a password with the library, and you have a renewal available, you may renew online. If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned."
897
            - ""
898
            - "The following item(s) is/are currently overdue:"
899
            - ""
900
            - "<item>\"<<biblio.title>>\" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>> Fine: <<items.fine>></item>"
901
            - ""
902
            - "Thank-you for your prompt attention to this matter."
903
            - ""
904
            - "<<branches.branchname>> Staff"
905
            - ""
906
907
        - module: circulation
908
          code: ODUE2
909
          branchcode: ""
910
          name: "Overdue notice"
911
          is_html: 0
912
          title: "Item overdue"
913
          message_transport_type: email
914
          lang: default
915
          content:
916
            - "Dear <<borrowers.firstname>> <<borrowers.surname>>,"
917
            - ""
918
            - "According to our current records, you have items that are overdue. This is the second reminder. Your library does not charge late fines, but please return or renew them at the branch below as soon as possible."
919
            - ""
920
            - "<<branches.branchname>>"
921
            - "<<branches.branchaddress1>>"
922
            - "<<branches.branchaddress2>> <<branches.branchaddress3>>"
923
            - "Phone: <<branches.branchphone>>"
924
            - "Fax: <<branches.branchfax>>"
925
            - "Email: <<branches.branchemail>>"
926
            - ""
927
            - "If you have registered a password with the library, and you have a renewal available, you may renew online. If an item becomes more than 30 days overdue, you will be unable to use your library card until the item is returned."
928
            - ""
929
            - "The following item(s) is/are currently overdue:"
930
            - ""
931
            - "<item>\"<<biblio.title>>\" by <<biblio.author>>, <<items.itemcallnumber>>, Barcode: <<items.barcode>> Fine: <<items.fine>></item>"
932
            - ""
933
            - "Thank-you for your prompt attention to this matter."
934
            - ""
935
            - "<<branches.branchname>> Staff"
936
            - ""
937
938
        - module: circulation
939
          code: ODUE3
940
          branchcode: ""
941
          name: "Overdue notice"
942
          is_html: 0
943
          title: "Item overdue"
944
          message_transport_type: email
945
          lang: default
946
          content:
947
            - "Dear <<borrowers.firstname>> <<borrowers.surname>>,"
948
            - ""
949
            - "According to our current records, you have items that are overdue. This is the final reminder. Your library does not charge late fines, but please return or renew them at the branch below as soon as possible."
950
>>>>>>> Bug 30515: Fix messaging options order and add database changes
888
            - ""
951
            - ""
889
            - "[% branch.branchname %]"
952
            - "[% branch.branchname %]"
890
            - "[% branch.branchaddress1 %]"
953
            - "[% branch.branchaddress1 %]"
(-)a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql (-1 / +4 lines)
Lines 13-16 values Link Here
13
(11, 'Ill_update', 0),
13
(11, 'Ill_update', 0),
14
(12, 'Recall_Waiting', 0),
14
(12, 'Recall_Waiting', 0),
15
(13, 'Recall_Requested', 0),
15
(13, 'Recall_Requested', 0),
16
(14, 'Patron_Expiry', 0);
16
(14, 'Patron_Expiry', 0)
17
(15, 'Overdue1', 0),
18
(16, 'Overdue2', 0),
19
(17, 'Overdue3', 0);
(-)a/installer/data/mysql/mandatory/sample_notices_message_transports.sql (-2 / +7 lines)
Lines 55-58 values Link Here
55
(13, "phone",   0, "circulation", "RETURN_RECALLED_ITEM"),
55
(13, "phone",   0, "circulation", "RETURN_RECALLED_ITEM"),
56
(14, "email", 0, "members", "MEMBERSHIP_EXPIRY"),
56
(14, "email", 0, "members", "MEMBERSHIP_EXPIRY"),
57
(14, "sms",   0, "members", "MEMBERSHIP_EXPIRY"),
57
(14, "sms",   0, "members", "MEMBERSHIP_EXPIRY"),
58
(14, "phone",   0, "members", "MEMBERSHIP_EXPIRY");
58
(14, "phone",   0, "members", "MEMBERSHIP_EXPIRY")
59
(15, 'email', 0, 'circulation', 'ODUE'),
60
(15, 'sms', 0, 'circulation', 'ODUE'),
61
(16, 'email', 0, 'circulation', 'ODUE2'),
62
(16, 'sms', 0, 'circulation', 'ODUE2'),
63
(17, 'email', 0, 'circulation', 'ODUE3'),
64
(17, 'sms', 0, 'circulation', 'ODUE3'),;
59
- 

Return to bug 30515