MDL-61255 core_message: add notification when data not migrated

This commit is contained in:
Mark Nelson 2018-02-20 14:12:20 +08:00
parent 5cc6b3eeb5
commit 7022b8d9e4
2 changed files with 9 additions and 0 deletions

View File

@ -71,6 +71,7 @@ $string['messagepreferences'] = 'Message preferences';
$string['message'] = 'Message';
$string['messagepreferences'] = 'Message preferences';
$string['messages'] = 'Messages';
$string['messagingdatahasnotbeenmigrated'] = 'Your messages are temporarily unavailable due to upgrades in the messaging infrastructure. Please wait for them to be migrated.';
$string['messagingdisabled'] = 'Messaging is disabled on this site, emails will be sent instead';
$string['newonlymsg'] = 'Show only new';
$string['newmessage'] = 'New message';

View File

@ -147,6 +147,14 @@ $messagearea = new \core_message\output\messagearea\message_area($user1->id, $us
// Now the page contents.
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('messages', 'message'));
// Display a message if the messages have not been migrated yet.
if (!get_user_preferences('core_message_migrate_data', false, $user1id)) {
$notify = new \core\output\notification(get_string('messagingdatahasnotbeenmigrated', 'message'),
\core\output\notification::NOTIFY_WARNING);
echo $OUTPUT->render($notify);
}
// Display a message that the user is viewing someone else's messages.
if (!$currentuser) {
$notify = new \core\output\notification(get_string('viewinganotherusersmessagearea', 'message'),