@@ -, +, @@ redirect to 404 if at least 1 pref is off --- installer/data/mysql/atomicupdate/sysprefs_Bug12528.sql | 2 +- .../intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref | 4 ++-- koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc | 2 +- koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt | 8 -------- opac/opac-messaging.pl | 4 ++++ 5 files changed, 8 insertions(+), 12 deletions(-) --- a/installer/data/mysql/atomicupdate/sysprefs_Bug12528.sql +++ a/installer/data/mysql/atomicupdate/sysprefs_Bug12528.sql @@ -1,2 +1,2 @@ INSERT INTO systempreferences ( value, variable, options, explanation,type ) -select value ,'OPACEnhancedMessagingPreferences', NULL, 'If ON, allows patrons to select to receive additional messages about items due or nearly due.', 'YesNo' from systempreferences where variable='EnhancedMessagingPreferences'; +select value ,'EnhancedMessagingPreferencesOPAC', NULL, 'If ON, allows patrons to select to receive additional messages about items due or nearly due.', 'YesNo' from systempreferences where variable='EnhancedMessagingPreferences'; --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref @@ -54,7 +54,7 @@ Patrons: choices: yes: Allow no: "Don't allow" - - "Staff to manage which notices patrons will receive and when they will receive them. Note: this only applies to courtesy notices. To manage if patrons have also access to these settings, use OPACEnhancedMessagingPreferences." + - "Staff to manage which notices patrons will receive and when they will receive them. Note: this only applies to courtesy notices. To manage if patrons have also access to these settings, use EnhancedMessagingPreferencesOPAC." - - pref: ExtendedPatronAttributes choices: @@ -160,7 +160,7 @@ Patrons: no: "Don't" - charge a fee when a patron changes to a category with an enrollment fee. - - - pref: OPACEnhancedMessagingPreferences + - pref: EnhancedMessagingPreferencesOPAC choices: yes: Show no: "Don't show" --- a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc +++ a/koha-tmpl/opac-tmpl/bootstrap/en/includes/usermenu.inc @@ -77,7 +77,7 @@ [% END %] [% IF ( EnhancedMessagingPreferences ) %] - [% IF Koha.Preference( 'OPACEnhancedMessagingPreferences' ) %] + [% IF Koha.Preference( 'EnhancedMessagingPreferencesOPAC' ) %] [% IF ( messagingview ) %]
  • [% ELSE %] --- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt +++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-messaging.tt @@ -22,8 +22,6 @@
    - [% IF Koha.Preference( 'EnhancedMessagingPreferences' ) %] - [% IF Koha.Preference( 'OPACEnhancedMessagingPreferences' ) %]

    Your messaging settings

    [% IF ( settings_updated ) %] @@ -131,12 +129,6 @@
    - [% ELSE %] -

    You are not allowed to call this page directly

    - [% END %] - [% ELSE %] -

    You are not allowed to call this page directly

    - [% END %]
    --- a/opac/opac-messaging.pl +++ a/opac/opac-messaging.pl @@ -34,6 +34,10 @@ use C4::Form::MessagingPreferences; my $query = CGI->new(); +unless ( C4::Context->preference('EnhancedMessagingPreferencesOPAC') && C4::Context->preference('EnhancedMessagingPreferences') ) { + print $query->redirect("/cgi-bin/koha/errors/404.pl"); + exit; +} my ( $template, $borrowernumber, $cookie ) = get_template_and_user( { template_name => 'opac-messaging.tt', --