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 252-257 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
252
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
252
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
253
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
253
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
254
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
254
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
255
('EnhancedMessaging','1','NULL','If ON, send notifications throught the misc/cronjobs/advance_notices.pl.','YesNo'),
255
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
256
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
256
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
257
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
257
('ERMModule', '0', NULL, 'Enable the e-resource management module', 'YesNo'),
258
('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 157-177 Patrons: Link Here
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
    Notices and notifications:
159
    Notices and notifications:
160
     -
161
         - pref: EnhancedMessaging
162
           choices:
163
               1: Send
164
               0: Don't send
165
         - "notifications throught <code>misc/cronjobs/advance_notices.pl</code>."
166
         - '<br><strong>NOTE:</strong> This only applies to courtesy notices.'
167
168
         - "<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."
160
     -
169
     -
161
         - pref: EnhancedMessagingPreferences
170
         - pref: EnhancedMessagingPreferences
162
           choices:
171
           choices:
163
               1: Allow
172
               1: Allow
164
               0: "Don't allow"
173
               0: "Don't allow"
165
         - "staff to manage which notices patrons will receive and when they will receive them."
174
         - "staff to manage which notices patrons when they will receive them."
166
         - '<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>.'
175
         - '<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>.'
167
         - "<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."
168
     -
176
     -
169
         - pref: EnhancedMessagingPreferencesOPAC
177
         - pref: EnhancedMessagingPreferencesOPAC
170
           choices:
178
           choices:
171
               1: Show
179
               1: Show
172
               0: "Don't show"
180
               0: "Don't show"
173
         - "patron messaging setting on the OPAC."
181
         - "patron messaging setting on the OPAC."
174
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferences">EnhancedMessagingPreferences</a> must be enabled.'
182
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessaging">EnhancedMessaging</a> must be enabled.'
175
     -
183
     -
176
         - pref: AutoEmailNewUser
184
         - pref: AutoEmailNewUser
177
           choices:
185
           choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-2 / +6 lines)
Lines 363-369 Link Here
363
                                    </div> [% # /div#patron-extended-attributes %]
363
                                    </div> [% # /div#patron-extended-attributes %]
364
                                [% END %]
364
                                [% END %]
365
                            [% END %]
365
                            [% END %]
366
367
                            [% IF ( EnhancedMessagingPreferences ) %]
366
                            [% IF ( EnhancedMessagingPreferences ) %]
368
                                <div id="patron-messaging-prefs" class="patroninfo-section">
367
                                <div id="patron-messaging-prefs" class="patroninfo-section">
369
                                    <div class="patroninfo-heading">
368
                                    <div class="patroninfo-heading">
Lines 371-376 Link Here
371
                                        [% IF CAN_user_borrowers_edit_borrowers %]
370
                                        [% IF CAN_user_borrowers_edit_borrowers %]
372
                                            <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=5"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
371
                                            <a class="btn btn-default btn-xs" href="memberentry.pl?op=edit_form&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=5"><i class="fa-solid fa-pencil" aria-hidden="true"></i> Edit</a>
373
                                        [% END %]
372
                                        [% END %]
373
                                        [% IF ( Koha.Preference('EnhancedMessaging') == 0 ) %]
374
                                            <div class="dialog alert">
375
                                            <i class="fa fa-warning"></i> Notifications actually disabled
376
                                            </div>
377
                                        [% END %]
378
                                        <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=5"><i class="fa fa-pencil"></i> Edit</a>
374
                                    </div>
379
                                    </div>
375
                                    [% INCLUDE 'messaging-preference-form.inc' %]
380
                                    [% INCLUDE 'messaging-preference-form.inc' %]
376
                                    [% IF Koha.Preference('SMSSendDriver') %]
381
                                    [% IF Koha.Preference('SMSSendDriver') %]
Lines 393-399 Link Here
393
                                    [% END %]
398
                                    [% END %]
394
                                </div> [% # /div#patron-messaging-prefs %]
399
                                </div> [% # /div#patron-messaging-prefs %]
395
                            [% END %]
400
                            [% END %]
396
397
                        </div> <!-- /.col-sm-6 -->
401
                        </div> <!-- /.col-sm-6 -->
398
402
399
                        <div class="col-sm-6">
403
                        <div class="col-sm-6">
(-)a/misc/cronjobs/advance_notices.pl (-5 / +4 lines)
Lines 205-218 pod2usage( -verbose => 2 ) if $man; Link Here
205
# Since advance notice options are not visible in the web-interface
205
# Since advance notice options are not visible in the web-interface
206
# unless EnhancedMessagingPreferences is on, let the user know that
206
# unless EnhancedMessagingPreferences is on, let the user know that
207
# this script probably isn't going to do much
207
# this script probably isn't going to do much
208
if ( ! C4::Context->preference('EnhancedMessagingPreferences') && $verbose ) {
208
if ( ! C4::Context->preference('EnhancedMessaging') ) {
209
    warn <<'END_WARN';
209
    warn <<'END_WARN';
210
210
211
The "EnhancedMessagingPreferences" syspref is off.
211
The "EnhancedMessaging" syspref is off.
212
Therefore, it is unlikely that this script will actually produce any messages to be sent.
212
This syspref must set to "Send" to use this script.
213
To change this, edit the "EnhancedMessagingPreferences" syspref.
214
213
215
END_WARN
214
END_WARN
215
    exit
216
}
216
}
217
unless ($confirm) {
217
unless ($confirm) {
218
     pod2usage(1);
218
     pod2usage(1);
219
- 

Return to bug 24499