Bugzilla – Attachment 145356 Details for
Bug 24499
System preference EnhancedMessagingPreferences if set to 'Don't allow' doesn't even show within patron categories
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
New syspref EnhancedMessaging for clearer functionality
New-syspref-EnhancedMessaging-for-clearer-function.patch (text/plain), 9.34 KB, created by
Marius
on 2023-01-17 14:47:18 UTC
(
hide
)
Description:
New syspref EnhancedMessaging for clearer functionality
Filename:
MIME Type:
Creator:
Marius
Created:
2023-01-17 14:47:18 UTC
Size:
9.34 KB
patch
obsolete
>From d3ec77d9ca8aaeb917639b8de063e3ea8d96ba72 Mon Sep 17 00:00:00 2001 >From: Thibaud Guillot <thibaud.guillot@biblibre.com> >Date: Wed, 26 Jan 2022 16:13:16 +0100 >Subject: [PATCH] New syspref EnhancedMessaging for clearer functionality > >Everything is fine in this pache. >https://bugs.koha-community.org/show_bug.cgi?id=24499 >Signed-off-by: Marius Mandrescu <marius.mandrescu@inLibro.com> >--- > .../bug_24499-add_EnhancedMessaging_syspref.pl | 11 +++++++++++ > installer/data/mysql/mandatory/sysprefs.sql | 9 ++------- > .../en/modules/admin/preferences/patrons.pref | 16 ++++++++++++---- > .../prog/en/modules/members/moremember.tt | 7 +++++-- > misc/cronjobs/advance_notices.pl | 8 ++++---- > 5 files changed, 34 insertions(+), 17 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_24499-add_EnhancedMessaging_syspref.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_24499-add_EnhancedMessaging_syspref.pl b/installer/data/mysql/atomicupdate/bug_24499-add_EnhancedMessaging_syspref.pl >new file mode 100755 >index 0000000000..50bd5ecc47 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_24499-add_EnhancedMessaging_syspref.pl >@@ -0,0 +1,11 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => "BUG_24499", >+ description => "Add new system preference EnhancedMessaging", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ $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') }); >+ }, >+ }; >diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql >index beebd27a6f..8a27a19a69 100644 >--- a/installer/data/mysql/mandatory/sysprefs.sql >+++ b/installer/data/mysql/mandatory/sysprefs.sql >@@ -218,14 +218,9 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('EnableOpacSearchHistory','1','YesNo','Enable or disable opac search history',''), > ('EnablePointOfSale','0',NULL,'Enable the point of sale feature to allow anonymous transactions with the accounting system. (Requires UseCashRegisters)','YesNo'), > ('EnableSearchHistory','0','','Enable or disable search history','YesNo'), >-('EnableItemGroups','0','','Enable the item groups feature','YesNo'), >-('EnableItemGroupHolds','0','','Enable item groups holds feature','YesNo'), >+('EnhancedMessaging','1','NULL','If ON, send notifications throught the misc/cronjobs/advance_notices.pl.','YesNo'), > ('EnhancedMessagingPreferences','1','','If ON, allows patrons to select to receive additional messages about items due or nearly due.','YesNo'), >-('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC.', 'YesNo'), >-('ERMModule', '0', NULL, 'Enable the e-resource management module', 'YesNo'), >-('ERMProviders', 'local', 'local|ebsco', 'Set the providers for the ERM module', 'Choice'), >-('ERMProviderEbscoApiKey', '', '', 'API key for EBSCO', 'free'), >-('ERMProviderEbscoCustomerID', '', '', 'Customer ID for EBSCO', 'free'), >+('EnhancedMessagingPreferencesOPAC', '1', NULL, 'If ON, show patrons messaging setting on the OPAC. Requires EnhancedMessaging is ON', 'YesNo'), > ('expandedSearchOption','0',NULL,'If ON, set advanced search to be expanded by default','YesNo'), > ('ExpireReservesAutoFill','0',NULL,'Automatically fill the next hold with a automatically canceled expired waiting hold.','YesNo'), > ('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'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index fd91a8576a..707c397342 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -138,21 +138,29 @@ Patrons: > - days. > - "<br><strong>NOTE:</strong> This system preference requires the <code>misc/cronjobs/membership_expiry.pl</code> cronjob. Ask your system administrator to schedule it." > Notices and notifications: >+ - >+ - pref: EnhancedMessaging >+ choices: >+ 1: Send >+ 0: Don't send >+ - "notifications throught <code>misc/cronjobs/advance_notices.pl</code>." >+ - '<br><strong>NOTE:</strong> This only applies to courtesy notices.' >+ >+ - "<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." > - > - pref: EnhancedMessagingPreferences > choices: > 1: Allow > 0: "Don't allow" >- - "staff to manage which notices patrons will receive and when they will receive them." >- - '<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>.' >- - "<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." >+ - "staff to manage which notices patrons when they will receive them." >+ - '<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>.' > - > - pref: EnhancedMessagingPreferencesOPAC > choices: > 1: Show > 0: "Don't show" > - "patron messaging setting on the OPAC." >- - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessagingPreferences">EnhancedMessagingPreferences</a> must be enabled.' >+ - '<br><strong>NOTE:</strong> <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=EnhancedMessaging">EnhancedMessaging</a> must be enabled.' > - > - pref: AutoEmailNewUser > choices: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >index ef0a906c90..9b10bf12ac 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt >@@ -337,11 +337,15 @@ > </div> [% # /div#patron-extended-attributes %] > [% END %] > [% END %] >- > [% IF ( EnhancedMessagingPreferences ) %] > <div id="patron-messaging-prefs" class="patroninfo-section"> > <div class="patroninfo-heading"> > <h3>Patron messaging preferences</h3> >+ [% IF ( Koha.Preference('EnhancedMessaging') == 0 ) %] >+ <div class="dialog alert"> >+ <i class="fa fa-warning"></i> Notifications actually disabled >+ </div> >+ [% END %] > <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&borrowernumber=[% patron.borrowernumber | html %]&step=5"><i class="fa fa-pencil"></i> Edit</a> > </div> > [% INCLUDE 'messaging-preference-form.inc' %] >@@ -363,7 +367,6 @@ > [% END %] > </div> [% # /div#patron-messaging-prefs %] > [% END %] >- > </div> <!-- /.col-sm-6 --> > > <div class="col-sm-6"> >diff --git a/misc/cronjobs/advance_notices.pl b/misc/cronjobs/advance_notices.pl >index efa0f49e17..f1cd1bba08 100755 >--- a/misc/cronjobs/advance_notices.pl >+++ b/misc/cronjobs/advance_notices.pl >@@ -205,14 +205,14 @@ pod2usage( -verbose => 2 ) if $man; > # Since advance notice options are not visible in the web-interface > # unless EnhancedMessagingPreferences is on, let the user know that > # this script probably isn't going to do much >-if ( ! C4::Context->preference('EnhancedMessagingPreferences') && $verbose ) { >+if ( ! C4::Context->preference('EnhancedMessaging') ) { > warn <<'END_WARN'; > >-The "EnhancedMessagingPreferences" syspref is off. >-Therefore, it is unlikely that this script will actually produce any messages to be sent. >-To change this, edit the "EnhancedMessagingPreferences" syspref. >+The "EnhancedMessaging" syspref is off. >+This syspref must set to "Send" to use this script. > > END_WARN >+ exit > } > unless ($confirm) { > pod2usage(1); >-- >2.34.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 24499
:
129834
|
145356
|
147411
|
147412
|
147413