diff --git a/lang/en/message.php b/lang/en/message.php index 760d904c2a7..24bccaacd14 100644 --- a/lang/en/message.php +++ b/lang/en/message.php @@ -62,7 +62,7 @@ $string['deleteselectedmessagesconfirm'] = 'Are you sure you would like to delet $string['deleteselectedmessagesconfirmselfconversation'] = 'Are you sure you would like to delete the selected personal messages?'; $string['disableall'] = 'Disable notifications'; $string['disabled'] = 'Messaging is disabled on this site'; -$string['disallowed'] = 'Disallowed'; +$string['disallowed'] = 'Locked off'; $string['editmessages'] = 'Edit messages'; $string['emailtagline'] = 'This is a copy of a message sent to you at "{$a->sitename}". Go to {$a->url} to reply.'; $string['enabled'] = 'Enabled'; @@ -81,6 +81,7 @@ $string['eventmessageuserunblocked'] = 'User unblocked'; $string['eventmessageviewed'] = 'Message viewed'; $string['eventmessagesent'] = 'Message sent'; $string['forced'] = 'Locked'; +$string['forcedmessage'] = 'Locked on'; $string['guestnoeditmessage'] = 'Guest user can not edit messaging options'; $string['guestnoeditmessageother'] = 'Guest user can not edit other user messaging options'; $string['groupinfo'] = 'Group info'; @@ -209,8 +210,8 @@ $string['privacy:request:preference:set'] = 'The value of the setting \'{$a->nam $string['privacy:export:conversationprefix'] = 'Conversation: '; $string['processorsettings'] = 'Processor settings'; $string['providerenabled'] = 'Sending "{$a}" enabled status'; -$string['providerprocesorislocked'] = '"{$a->provider}" on "{$a->processor}" is locked'; -$string['providerprocesorisdisallowed'] = '"{$a->provider}" on "{$a->processor}" is disallowed'; +$string['providerprocesorislocked'] = '"{$a->provider}" on "{$a->processor}" is locked on'; +$string['providerprocesorisdisallowed'] = '"{$a->provider}" on "{$a->processor}" is locked off'; $string['removecontact'] = 'Remove contact'; $string['removecontactconfirm'] = 'Are you sure you want to remove {$a} from your contacts?'; $string['removecoursefilter'] = 'Remove filter for course {$a}'; diff --git a/message/classes/output/preferences/notification_list_processor.php b/message/classes/output/preferences/notification_list_processor.php index 0464fb05ba9..544966d64a7 100644 --- a/message/classes/output/preferences/notification_list_processor.php +++ b/message/classes/output/preferences/notification_list_processor.php @@ -157,7 +157,7 @@ class notification_list_processor implements templatable, renderable { // If settings are disallowed or forced, just display the corresponding message, if not use user settings. if ($context['locked']) { if ($context['enabled']) { - $context['lockedmessage'] = get_string('forced', 'message'); + $context['lockedmessage'] = get_string('forcedmessage', 'message'); $context['lockedlabel'] = get_string('providerprocesorislocked', 'message', $labelparams); } else { $context['lockedmessage'] = get_string('disallowed', 'message'); diff --git a/message/templates/notification_preferences_component_notification.mustache b/message/templates/notification_preferences_component_notification.mustache index b81380c6283..1863fbb6b97 100644 --- a/message/templates/notification_preferences_component_notification.mustache +++ b/message/templates/notification_preferences_component_notification.mustache @@ -64,8 +64,7 @@ {{#enabled}}checked{{/enabled}} > diff --git a/message/tests/behat/message_manage_notification_preferences.feature b/message/tests/behat/message_manage_notification_preferences.feature index b66050b81a2..4c562f8e9cd 100644 --- a/message/tests/behat/message_manage_notification_preferences.feature +++ b/message/tests/behat/message_manage_notification_preferences.feature @@ -75,6 +75,19 @@ Feature: Manage notification preferences - Email And I click on "Notification preferences" "link" in the "#page-content" "css_element" And I should not see "Assignment notifications" + Scenario: User can disable email notifications for Assignment notifications + Given I log in as "admin" + And I navigate to "Messaging > Notification settings" in site administration + And I set the field "email" to "1" + And I press "Save changes" + And I follow "Preferences" in the user menu + And I click on "Notification preferences" "link" in the "#page-content" "css_element" + And I should not see "Enabled" in the "Assignment notifications" "table_row" + When I set the field "message_provider_mod_assign_assign_notification_email" to "0" + And I reload the page + Then the field "message_provider_mod_assign_assign_notification_email" matches value "0" + And I should not see "Enabled" in the "Assignment notifications" "table_row" + Scenario: Lock email notifications for Forum providers Given I log in as "admin" When I navigate to "Messaging > Notification settings" in site administration @@ -92,8 +105,8 @@ Feature: Manage notification preferences - Email And the field "mod_forum_digests_locked[email]" matches value "1" And I follow "Preferences" in the user menu And I click on "Notification preferences" "link" in the "#page-content" "css_element" - And I should see "Locked" in the "[data-preference-key=message_provider_mod_forum_posts]" "css_element" - And I should see "Disallowed" in the "[data-preference-key=message_provider_mod_forum_digests]" "css_element" + And I should see "Locked on" in the "[data-preference-key=message_provider_mod_forum_posts]" "css_element" + And I should see "Locked off" in the "[data-preference-key=message_provider_mod_forum_digests]" "css_element" Scenario: User can disable notification preferences Given the following "courses" exist: diff --git a/message/tests/behat/message_preferences.feature b/message/tests/behat/message_preferences.feature index a8e530340e8..7bd77330bc3 100644 --- a/message/tests/behat/message_preferences.feature +++ b/message/tests/behat/message_preferences.feature @@ -21,6 +21,7 @@ Feature: To be able to see and save user message preferences as admin And I click on "Student 1" "link" in the "Student 1" "table_row" And I click on "Preferences" "link" in the "#region-main-box" "css_element" And I click on "Message preferences" "link" in the "#region-main-box" "css_element" + And I should not see "Enabled" in the "Email" "table_row" And I click on "//div[@class='preference-state']" "xpath_element" And I log out And I log in as "student1"