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 / +2 lines)
Lines 200-207 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
200
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
200
('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''),
201
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
201
('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'),
202
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
202
('EnableSearchHistory','0','','Enable or disable search history','YesNo'),
203
('EnhancedMessaging','1','NULL','If ON, send notifications throught the misc/cronjobs/advance_notices.pl.','YesNo'),
203
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
204
('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'),
204
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'),
205
('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC. Requires EnhancedMessaging is ON', 'YesNo'),
205
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
206
('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'),
206
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
207
('ExpireReservesMaxPickUpDelay','0','','Enabling this allows holds to expire automatically if they have not been picked by within the time period specified in ReservesMaxPickUpDelay','YesNo'),
207
('ExpireReservesMaxPickUpDelayCharge','0',NULL,'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.','free'),
208
('ExpireReservesMaxPickUpDelayCharge','0',NULL,'If ExpireReservesMaxPickUpDelay is enabled, and this field has a non-zero value, than a borrower whose waiting hold has expired will be charged this amount.','free'),
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (-4 / +12 lines)
Lines 127-147 Patrons: Link Here
127
         - days.
127
         - days.
128
         - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it."
128
         - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it."
129
    Notices and notifications:
129
    Notices and notifications:
130
     -
131
         - pref: EnhancedMessaging
132
           choices:
133
               1: Send
134
               0: Don't send
135
         - "notifications throught <code>misc/cronjobs/advance_notices.pl</code>."
136
         - '<br><strong>NOTE:</strong> This only applies to courtesy notices.'
137
138
         - "<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."
130
     -
139
     -
131
         - pref: EnhancedMessagingPreferences
140
         - pref: EnhancedMessagingPreferences
132
           choices:
141
           choices:
133
               1: Allow
142
               1: Allow
134
               0: "Don't allow"
143
               0: "Don't allow"
135
         - "staff to manage which notices patrons will receive and when they will receive them."
144
         - "staff to manage which notices patrons when they will receive them."
136
         - '<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>.'
145
         - '<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>.'
137
         - "<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."
138
     -
146
     -
139
         - pref: EnhancedMessagingPreferencesOPAC
147
         - pref: EnhancedMessagingPreferencesOPAC
140
           choices:
148
           choices:
141
               1: Show
149
               1: Show
142
               0: "Don't show"
150
               0: "Don't show"
143
         - "patron messaging setting on the OPAC."
151
         - "patron messaging setting on the OPAC."
144
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferences">EnhancedMessagingPreferences</a> must be enabled.'
152
         - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessaging">EnhancedMessaging</a> must be enabled.'
145
     -
153
     -
146
         - pref: AutoEmailOpacUser
154
         - pref: AutoEmailOpacUser
147
           choices:
155
           choices:
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-2 / +5 lines)
Lines 368-378 Link Here
368
                                    </div> [% # /div#patron-extended-attributes %]
368
                                    </div> [% # /div#patron-extended-attributes %]
369
                                [% END %]
369
                                [% END %]
370
                            [% END %]
370
                            [% END %]
371
372
                            [% IF ( EnhancedMessagingPreferences ) %]
371
                            [% IF ( EnhancedMessagingPreferences ) %]
373
                                <div id="patron-messaging-prefs" class="patroninfo-section">
372
                                <div id="patron-messaging-prefs" class="patroninfo-section">
374
                                    <div class="patroninfo-heading">
373
                                    <div class="patroninfo-heading">
375
                                        <h3>Patron messaging preferences</h3>
374
                                        <h3>Patron messaging preferences</h3>
375
                                        [% IF ( Koha.Preference('EnhancedMessaging') == 0 ) %]
376
                                            <div class="dialog alert">
377
                                            <i class="fa fa-warning"></i> Notifications actually disabled
378
                                            </div>
379
                                        [% END %]
376
                                        <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>
380
                                        <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>
377
                                    </div>
381
                                    </div>
378
                                    [% INCLUDE 'messaging-preference-form.inc' %]
382
                                    [% INCLUDE 'messaging-preference-form.inc' %]
Lines 392-398 Link Here
392
                                    [% END %]
396
                                    [% END %]
393
                                </div> [% # /div#patron-messaging-prefs %]
397
                                </div> [% # /div#patron-messaging-prefs %]
394
                            [% END %]
398
                            [% END %]
395
396
                        </div> <!-- /.col-sm-6 -->
399
                        </div> <!-- /.col-sm-6 -->
397
400
398
                        <div class="col-sm-6">
401
                        <div class="col-sm-6">
(-)a/misc/cronjobs/advance_notices.pl (-5 / +4 lines)
Lines 203-216 pod2usage( -verbose => 2 ) if $man; Link Here
203
# Since advance notice options are not visible in the web-interface
203
# Since advance notice options are not visible in the web-interface
204
# unless EnhancedMessagingPreferences is on, let the user know that
204
# unless EnhancedMessagingPreferences is on, let the user know that
205
# this script probably isn't going to do much
205
# this script probably isn't going to do much
206
if ( ! C4::Context->preference('EnhancedMessagingPreferences') && $verbose ) {
206
if ( ! C4::Context->preference('EnhancedMessaging') ) {
207
    warn <<'END_WARN';
207
    warn <<'END_WARN';
208
208
209
The "EnhancedMessagingPreferences" syspref is off.
209
The "EnhancedMessaging" syspref is off.
210
Therefore, it is unlikely that this script will actually produce any messages to be sent.
210
This syspref must set to "Send" to use this script.
211
To change this, edit the "EnhancedMessagingPreferences" syspref.
212
211
213
END_WARN
212
END_WARN
213
    exit
214
}
214
}
215
unless ($confirm) {
215
unless ($confirm) {
216
     pod2usage(1);
216
     pod2usage(1);
217
- 

Return to bug 24499