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 (+16 lines)
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 44-49 return { Link Here
44
46
45
            );
47
            );
46
            say $out "MEMBERSHIP_EXPIRY added to message_transports";
48
            say $out "MEMBERSHIP_EXPIRY added to message_transports";
49
50
            my $days_notice = C4::Context->preference('MembershipExpiryDaysNotice');
51
            if($days_notice) {
52
                my $patrons = Koha::Patrons->search();
53
                while ( my $patron = $patrons->next ) {
54
                    C4::Members::Messaging::SetMessagingPreference(
55
                        {
56
                            borrowernumber          => $patron->borrowernumber,
57
                            message_attribute_id    => $message_attribute_id,
58
                            message_transport_types => ['email'],
59
                        }
60
                    );
61
                }
62
            }
47
        } else {
63
        } else {
48
            say $out "Patron_Expiry message attribute exists, skipping update";
64
            say $out "Patron_Expiry message attribute exists, skipping update";
49
        }
65
        }
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/messaging-preference-form.inc (+1 lines)
Lines 17-22 Link Here
17
    <tbody>
17
    <tbody>
18
    [% FOREACH messaging_preference IN messaging_preferences %]
18
    [% FOREACH messaging_preference IN messaging_preferences %]
19
    [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %]
19
    [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %]
20
    [% NEXT IF !Koha.Preference('MembershipExpiryDaysNotice') && messaging_preference.Patron_Expiry %]
20
    [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
21
    [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
21
    [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %]
22
    [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %]
22
    <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
23
    <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+1 lines)
Lines 156-161 Patrons: Link Here
156
           class: integer
156
           class: integer
157
         - days.
157
         - days.
158
         - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it."
158
         - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it."
159
         - "<br><strong>NOTE:</strong> The parameters you use to select patrons when running the cronjob will supersede a user's messaging preferences. For example, a user may have opted to receive the expiry notice but if they are not included in the search parameters on the cronjob then they will not receive the notice."
159
    Notices and notifications:
160
    Notices and notifications:
160
     -
161
     -
161
         - pref: EnhancedMessagingPreferences
162
         - pref: EnhancedMessagingPreferences
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt (-1 / +1 lines)
Lines 59-64 Link Here
59
                                    <tbody>
59
                                    <tbody>
60
                                    [% FOREACH messaging_preference IN messaging_preferences %]
60
                                    [% FOREACH messaging_preference IN messaging_preferences %]
61
                                        [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %]
61
                                        [% NEXT IF !Koha.Preference( 'ILLModule' ) && messaging_preference.message_name.match('^Ill_') %]
62
                                        [% NEXT IF !Koha.Preference('MembershipExpiryDaysNotice') && messaging_preference.Patron_Expiry %]
62
                                        [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
63
                                        [% NEXT IF messaging_preference.Auto_Renewals && Koha.Preference('AutoRenewalNotices') != 'preferences' %]
63
                                        [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %]
64
                                        [% NEXT IF !Koha.Preference('UseRecalls') && messaging_preference.message_name.match('^Recall_') %]
64
                                        <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
65
                                        <tr id="[% messaging_preference.message_name _ "_message" | lower | html %]">
65
- 

Return to bug 30300