mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 08:56:36 +02:00
MDL-70552 core_message: Show popup for teachers when anonymous
user completed feedback.
This commit is contained in:
parent
a2fda1289f
commit
d208bc5353
3 changed files with 15 additions and 5 deletions
|
@ -49,12 +49,15 @@ class message_output_popup extends message_output {
|
|||
global $DB;
|
||||
|
||||
// Prevent users from getting popup notifications from themselves (happens with forum notifications).
|
||||
if ($eventdata->userfrom->id != $eventdata->userto->id && $eventdata->notification) {
|
||||
if (!$DB->record_exists('message_popup_notifications', ['notificationid' => $eventdata->savedmessageid])) {
|
||||
$record = new stdClass();
|
||||
$record->notificationid = $eventdata->savedmessageid;
|
||||
if ($eventdata->notification) {
|
||||
if (($eventdata->userfrom->id != $eventdata->userto->id) ||
|
||||
(isset($eventdata->anonymous) && $eventdata->anonymous)) {
|
||||
if (!$DB->record_exists('message_popup_notifications', ['notificationid' => $eventdata->savedmessageid])) {
|
||||
$record = new stdClass();
|
||||
$record->notificationid = $eventdata->savedmessageid;
|
||||
|
||||
$DB->insert_record('message_popup_notifications', $record);
|
||||
$DB->insert_record('message_popup_notifications', $record);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue