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 (-7 / +2 lines)
Lines 218-231 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
218
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
218
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
219
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
219
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
220
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
220
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
221
('EnableItemGroups','0','','Enable the item groups feature','YesNo'),
221
('EnhancedMessaging','1','NULL','If ON, send notifications throught the misc/cronjobs/advance_notices.pl.','YesNo'),
222
('EnableItemGroupHolds','0','','Enable item groups holds feature','YesNo'),
223
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
222
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
224
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
223
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC. Requires EnhancedMessaging is ON', 'YesNo'),
225
('ERMModule', '0', NULL, 'Enable the e-resource management module', 'YesNo'),
226
('ERMProviders', 'local', 'local|ebsco', 'Set the providers for the ERM module', 'Choice'),
227
('ERMProviderEbscoApiKey', '', '', 'API key for EBSCO', 'free'),
228
('ERMProviderEbscoCustomerID', '', '', 'Customer ID for EBSCO', 'free'),
229
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
224
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
230
('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'),
225
('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'),
231
('ExpireReservesAutoFillEmail','', NULL,'Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply-to address','Free'),
226
('ExpireReservesAutoFillEmail','', NULL,'Send email notification of hold filled from automatically expired/cancelled hold to this address. If not defined, Koha will fallback to the library reply-to address','Free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-4 / +12 lines)
Lines 138-158 Patrons: Link Here
138
         - days.
138
         - days.
139
         - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it."
139
         - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it."
140
    Notices and notifications:
140
    Notices and notifications:
141
     -
142
         - pref: EnhancedMessaging
143
           choices:
144
               1: Send
145
               0: Don't send
146
         - "notifications throught <code>misc/cronjobs/advance_notices.pl</code>."
147
         - '<br><strong>NOTE:</strong> This only applies to courtesy notices.'
148
149
         - "<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."
141
     -
150
     -
142
         - pref: EnhancedMessagingPreferences
151
         - pref: EnhancedMessagingPreferences
143
           choices:
152
           choices:
144
               1: Allow
153
               1: Allow
145
               0: "Don't allow"
154
               0: "Don't allow"
146
         - "staff to manage which notices patrons will receive and when they will receive them."
155
         - "staff to manage which notices patrons when they will receive them."
147
         - '<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>.'
156
         - '<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>.'
148
         - "<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."
149
     -
157
     -
150
         - pref: EnhancedMessagingPreferencesOPAC
158
         - pref: EnhancedMessagingPreferencesOPAC
151
           choices:
159
           choices:
152
               1: Show
160
               1: Show
153
               0: "Don't show"
161
               0: "Don't show"
154
         - "patron messaging setting on the OPAC."
162
         - "patron messaging setting on the OPAC."
155
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferences">EnhancedMessagingPreferences</a> must be enabled.'
163
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessaging">EnhancedMessaging</a> must be enabled.'
156
     -
164
     -
157
         - pref: AutoEmailNewUser
165
         - pref: AutoEmailNewUser
158
           choices:
166
           choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-2 / +5 lines)
Lines 337-347 Link Here
337
                                    </div> [% # /div#patron-extended-attributes %]
337
                                    </div> [% # /div#patron-extended-attributes %]
338
                                [% END %]
338
                                [% END %]
339
                            [% END %]
339
                            [% END %]
340
341
                            [% IF ( EnhancedMessagingPreferences ) %]
340
                            [% IF ( EnhancedMessagingPreferences ) %]
342
                                <div id="patron-messaging-prefs" class="patroninfo-section">
341
                                <div id="patron-messaging-prefs" class="patroninfo-section">
343
                                    <div class="patroninfo-heading">
342
                                    <div class="patroninfo-heading">
344
                                        <h3>Patron messaging preferences</h3>
343
                                        <h3>Patron messaging preferences</h3>
344
                                        [% IF ( Koha.Preference('EnhancedMessaging') == 0 ) %]
345
                                            <div class="dialog alert">
346
                                            <i class="fa fa-warning"></i> Notifications actually disabled
347
                                            </div>
348
                                        [% END %]
345
                                        <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>
349
                                        <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>
346
                                    </div>
350
                                    </div>
347
                                    [% INCLUDE 'messaging-preference-form.inc' %]
351
                                    [% INCLUDE 'messaging-preference-form.inc' %]
Lines 363-369 Link Here
363
                                    [% END %]
367
                                    [% END %]
364
                                </div> [% # /div#patron-messaging-prefs %]
368
                                </div> [% # /div#patron-messaging-prefs %]
365
                            [% END %]
369
                            [% END %]
366
367
                        </div> <!-- /.col-sm-6 -->
370
                        </div> <!-- /.col-sm-6 -->
368
371
369
                        <div class="col-sm-6">
372
                        <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