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

(-)a/installer/data/mysql/atomicupdate/bug_30300-add_expiration_to_messaging_preferences.pl (+51 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "30300",
5
    description => "Add Patron expiry to messaging preference",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
        my $attribute = $dbh->do(
10
            q{
11
                SELECT message_attribute_id
12
                FROM message_attributes
13
                WHERE message_name = "Patron_Expiry"
14
        }
15
        );
16
        unless ( $attribute == 1 ) {
17
            $dbh->do(
18
                q{
19
                INSERT IGNORE INTO `message_attributes`
20
                    (message_name, `takes_days`)
21
                VALUES ('Patron_Expiry', 0)
22
            }
23
            );
24
            say $out "Message attribute added";
25
            my $query = q{
26
                SELECT message_attribute_id
27
                FROM message_attributes
28
                WHERE message_name = "Patron_Expiry"
29
        };
30
            my $sth = $dbh->prepare($query);
31
            $sth->execute();
32
            my $results              = $sth->fetchrow_hashref;
33
            my $message_attribute_id = $results->{message_attribute_id};
34
35
            $dbh->do(
36
                q{
37
                INSERT IGNORE INTO `message_transports`
38
                    (`message_attribute_id`, `message_transport_type`, `is_digest`, `letter_module`, `letter_code`)
39
                VALUES  (?, 'email', 0, 'circulation', 'MEMBERSHIP_EXPIRY'),
40
                        (?, 'sms', 0, 'circulation', 'MEMBERSHIP_EXPIRY'),
41
                        (?, 'phone', 0, 'circulation', 'MEMBERSHIP_EXPIRY'),
42
                        ( ?, 'itiva', 0, 'circulation', 'MEMBERSHIP_EXPIRY' )
43
            }, {}, $message_attribute_id, $message_attribute_id, $message_attribute_id, $message_attribute_id
44
45
            );
46
            say $out "MEMBERSHIP_EXPIRY added to message_transports";
47
        } else {
48
            say $out "Patron_Expiry message attribute exists, skipping update";
49
        }
50
    },
51
    }
(-)a/installer/data/mysql/mandatory/sample_notices_message_attributes.sql (-1 / +2 lines)
Lines 12-15 values Link Here
12
(10, 'Hold_Reminder', 0),
12
(10, 'Hold_Reminder', 0),
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);
(-)a/installer/data/mysql/mandatory/sample_notices_message_transports.sql (-1 / +4 lines)
Lines 50-53 values Link Here
50
(12, "phone",   0, "circulation", "PICKUP_RECALLED_ITEM"),
50
(12, "phone",   0, "circulation", "PICKUP_RECALLED_ITEM"),
51
(13, "email", 0, "circulation", "RETURN_RECALLED_ITEM"),
51
(13, "email", 0, "circulation", "RETURN_RECALLED_ITEM"),
52
(13, "sms",   0, "circulation", "RETURN_RECALLED_ITEM"),
52
(13, "sms",   0, "circulation", "RETURN_RECALLED_ITEM"),
53
(13, "phone",   0, "circulation", "RETURN_RECALLED_ITEM");
53
(13, "phone",   0, "circulation", "RETURN_RECALLED_ITEM"),
54
(14, "email", 0, "members", "MEMBERSHIP_EXPIRY"),
55
(14, "sms",   0, "members", "MEMBERSHIP_EXPIRY"),
56
(14, "phone",   0, "members", "MEMBERSHIP_EXPIRY");
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc (+1 lines)
Lines 31-36 Link Here
31
            [% ELSE %]
31
            [% ELSE %]
32
                <span>Item checkout</span>
32
                <span>Item checkout</span>
33
            [% END %]
33
            [% END %]
34
          [% ELSIF ( messaging_preference.Patron_Expiry ) %]<span>Patron expiry</span>
34
          [% ELSIF ( messaging_preference.Ill_ready ) %]<span>Interlibrary loan ready</span>
35
          [% ELSIF ( messaging_preference.Ill_ready ) %]<span>Interlibrary loan ready</span>
35
          [% ELSIF ( messaging_preference.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span>
36
          [% ELSIF ( messaging_preference.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span>
36
          [% ELSIF ( messaging_preference.Ill_update ) %]<span>Interlibrary loan updated</span>
37
          [% ELSIF ( messaging_preference.Ill_update ) %]<span>Interlibrary loan updated</span>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/categories.tt (+1 lines)
Lines 680-685 Link Here
680
                                                [% ELSIF ( prefs.Ill_update ) %]<span>Interlibrary loan updated</span>
680
                                                [% ELSIF ( prefs.Ill_update ) %]<span>Interlibrary loan updated</span>
681
                                                [% ELSIF ( prefs.Auto_Renewals ) %]<span>Auto renewal</span>
681
                                                [% ELSIF ( prefs.Auto_Renewals ) %]<span>Auto renewal</span>
682
                                                [% ELSIF ( prefs.Hold_Reminder ) %]<span>Hold reminder</span>
682
                                                [% ELSIF ( prefs.Hold_Reminder ) %]<span>Hold reminder</span>
683
                                                [% ELSIF ( prefs.Patron_Expiry ) %]<span>Patron expiry</span>
683
                                                [% ELSE %]<span>Unknown</span>
684
                                                [% ELSE %]<span>Unknown</span>
684
                                                [% END %]:
685
                                                [% END %]:
685
                                                <strong>[% transport.transport | html %]</strong><br />
686
                                                <strong>[% transport.transport | html %]</strong><br />
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-1 / +1 lines)
Lines 73-78 Link Here
73
                                                    [% ELSE %]
73
                                                    [% ELSE %]
74
                                                        <span>Item checkout</span>
74
                                                        <span>Item checkout</span>
75
                                                    [% END %]
75
                                                    [% END %]
76
                                                [% ELSIF ( messaging_preference.Patron_Expiry ) %]<span>Patron expiry</span>
76
                                                [% ELSIF ( messaging_preference.Ill_ready ) %]<span>Interlibrary loan ready</span>
77
                                                [% ELSIF ( messaging_preference.Ill_ready ) %]<span>Interlibrary loan ready</span>
77
                                                [% ELSIF ( messaging_preference.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span>
78
                                                [% ELSIF ( messaging_preference.Ill_unavailable ) %]<span>Interlibrary loan unavailable</span>
78
                                                [% ELSIF ( messaging_preference.Ill_update ) %]<span>Interlibrary loan updated</span>
79
                                                [% ELSIF ( messaging_preference.Ill_update ) %]<span>Interlibrary loan updated</span>
79
- 

Return to bug 30300