Lines 1-5
Link Here
|
1 |
use Modern::Perl; |
1 |
use Modern::Perl; |
2 |
|
2 |
|
|
|
3 |
use Koha::Patrons; |
4 |
|
3 |
return { |
5 |
return { |
4 |
bug_number => "30300", |
6 |
bug_number => "30300", |
5 |
description => "Add Patron expiry to messaging preference", |
7 |
description => "Add Patron expiry to messaging preference", |
Lines 13-19
return {
Link Here
|
13 |
WHERE message_name = "Patron_Expiry" |
15 |
WHERE message_name = "Patron_Expiry" |
14 |
} |
16 |
} |
15 |
); |
17 |
); |
16 |
unless ( $attribute == 1 ) { |
18 |
# unless ( $attribute == 1 ) { |
|
|
19 |
unless ( 0 ) { |
17 |
$dbh->do( |
20 |
$dbh->do( |
18 |
q{ |
21 |
q{ |
19 |
INSERT IGNORE INTO `message_attributes` |
22 |
INSERT IGNORE INTO `message_attributes` |
Lines 44-49
return {
Link Here
|
44 |
|
47 |
|
45 |
); |
48 |
); |
46 |
say $out "MEMBERSHIP_EXPIRY added to message_transports"; |
49 |
say $out "MEMBERSHIP_EXPIRY added to message_transports"; |
|
|
50 |
|
51 |
my $days_notice = C4::Context->preference('MembershipExpiryDaysNotice'); |
52 |
if($days_notice) { |
53 |
my $patrons = Koha::Patrons->search(); |
54 |
while ( my $patron = $patrons->next ) { |
55 |
C4::Members::Messaging::SetMessagingPreference( |
56 |
{ |
57 |
borrowernumber => $patron->borrowernumber, |
58 |
message_attribute_id => $message_attribute_id, |
59 |
message_transport_types => ['email'], |
60 |
} |
61 |
); |
62 |
} |
63 |
} |
47 |
} else { |
64 |
} else { |
48 |
say $out "Patron_Expiry message attribute exists, skipping update"; |
65 |
say $out "Patron_Expiry message attribute exists, skipping update"; |
49 |
} |
66 |
} |