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

(-)a/installer/data/mysql/atomicupdate/bug_24499-add_EnhancedMessaging_syspref.pl (+11 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
        bug_number => "BUG_24499",
5
            description => "Add new system preference EnhancedMessaging",
6
                up => sub {
7
                            my ($args) = @_;
8
                                    my ($dbh, $out) = @$args{qw(dbh out)};
9
                                            $dbh->do(q{INSERT IGNORE INTO systempreferences (variable,value,options,explanation,type) VALUES ('EnhancedMessaging', '1', NULL, "Send/Don't send notifications througt misc/cronjobs/advance_notices.pl", 'YesNo') });
10
                                                },
11
                                            };
(-)a/installer/data/mysql/mandatory/sysprefs.sql (+1 lines)
Lines 259-264 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
259
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
259
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
260
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
260
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
261
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
261
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
262
('EnhancedMessaging','1','NULL','If ON, send notifications throught the misc/cronjobs/advance_notices.pl.','YesNo'),
262
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
263
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
263
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
264
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
264
('ERMModule', '0', NULL, 'Enable the e-resource management module', 'YesNo'),
265
('ERMModule', '0', NULL, 'Enable the e-resource management module', 'YesNo'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-4 / +12 lines)
Lines 159-179 Patrons: Link Here
159
         - "<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> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it."
160
         - "<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."
160
         - "<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."
161
    Notices and notifications:
161
    Notices and notifications:
162
     -
163
         - pref: EnhancedMessaging
164
           choices:
165
               1: Send
166
               0: Don't send
167
         - "notifications throught <code>misc/cronjobs/advance_notices.pl</code>."
168
         - '<br><strong>NOTE:</strong> This only applies to courtesy notices.'
169
170
         - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/process_message_queue.pl</code> and the <code>misc/cronjobs/advance_notices.pl</code> cronjob. Ask your system administrator to schedule them."
162
     -
171
     -
163
         - pref: EnhancedMessagingPreferences
172
         - pref: EnhancedMessagingPreferences
164
           choices:
173
           choices:
165
               1: Allow
174
               1: Allow
166
               0: "Don't allow"
175
               0: "Don't allow"
167
         - "staff to manage which notices patrons will receive and when they will receive them."
176
         - "staff to manage which notices patrons when they will receive them."
168
         - '<br><strong>NOTE:</strong> This only applies to courtesy notices. To manage if patrons have also access to these settings, use <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferencesOPAC">EnhancedMessagingPreferencesOPAC</a>.'
177
         - '<br><strong>NOTE:</strong> To manage if patrons have also access to these settings, use <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferencesOPAC">EnhancedMessagingPreferencesOPAC</a>.'
169
         - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/process_message_queue.pl</code> and the <code>misc/cronjobs/advance_notices.pl</code> cronjob. Ask your system administrator to schedule them."
170
     -
178
     -
171
         - pref: EnhancedMessagingPreferencesOPAC
179
         - pref: EnhancedMessagingPreferencesOPAC
172
           choices:
180
           choices:
173
               1: Show
181
               1: Show
174
               0: "Don't show"
182
               0: "Don't show"
175
         - "patron messaging setting on the OPAC."
183
         - "patron messaging setting on the OPAC."
176
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferences">EnhancedMessagingPreferences</a> must be enabled.'
184
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessaging">EnhancedMessaging</a> must be enabled.'
177
     -
185
     -
178
         - pref: AutoEmailNewUser
186
         - pref: AutoEmailNewUser
179
           choices:
187
           choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+5 lines)
Lines 424-429 Link Here
424
                    [% IF CAN_user_borrowers_edit_borrowers %]
424
                    [% IF CAN_user_borrowers_edit_borrowers %]
425
                        <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=3"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
425
                        <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=3"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
426
                    [% END %]
426
                    [% END %]
427
                    [% IF ( Koha.Preference('EnhancedMessaging') == 0 ) %]
428
                        <div class="dialog alert">
429
                        <i class="fa fa-warning"></i> Notifications actually disabled
430
                        </div>
431
                    [% END %]
427
                </div>
432
                </div>
428
                <div class="rows">
433
                <div class="rows">
429
                    <ol>
434
                    <ol>
(-)a/misc/cronjobs/advance_notices.pl (-5 / +4 lines)
Lines 206-219 pod2usage( -verbose => 2 ) if $man; Link Here
206
# Since advance notice options are not visible in the web-interface
206
# Since advance notice options are not visible in the web-interface
207
# unless EnhancedMessagingPreferences is on, let the user know that
207
# unless EnhancedMessagingPreferences is on, let the user know that
208
# this script probably isn't going to do much
208
# this script probably isn't going to do much
209
if ( !C4::Context->preference('EnhancedMessagingPreferences') && $verbose ) {
209
if ( ! C4::Context->preference('EnhancedMessaging') ) {
210
    warn <<'END_WARN';
210
    warn <<'END_WARN';
211
211
212
The "EnhancedMessagingPreferences" syspref is off.
212
The "EnhancedMessaging" syspref is off.
213
Therefore, it is unlikely that this script will actually produce any messages to be sent.
213
This syspref must set to "Send" to use this script.
214
To change this, edit the "EnhancedMessagingPreferences" syspref.
215
214
216
END_WARN
215
END_WARN
216
    exit
217
}
217
}
218
unless ($confirm) {
218
unless ($confirm) {
219
    pod2usage(1);
219
    pod2usage(1);
220
- 

Return to bug 24499