Commit bbbe625e authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Show the name of the reporter of objectionable content in the notification message

parent 714c5f93
......@@ -84,13 +84,11 @@ $string['newviewaccessmessage'] = 'You have been added to the access list for th
$string['newviewaccesssubject'] = 'New view access';
$string['viewmodified'] = 'has changed their view';
$string['onview'] = 'on View';
$string['onartefact'] = 'on Artefact';
$string['ongroup'] = 'on Group';
$string['ownedby'] = 'owned by';
$string['objectionablecontentview'] = 'Objectionable content';
$string['objectionablecontentartefact'] = 'Objectionable content';
$string['objectionablecontentview'] = 'Objectionable content on View "%s" reported by %s';
$string['objectionablecontentartefact'] = 'Objectionable content on Artefact "%s" reported by %s';
$string['newgroupmembersubj'] = '%s is now a group member!';
$string['removedgroupmembersubj'] = '%s is no longer a group member';
......
......@@ -404,6 +404,7 @@ class ActivityTypeObjectionable extends ActivityTypeAdmin {
protected $view;
protected $artefact;
protected $reporter;
function __construct($data, $cron=false) {
parent::__construct($data, $cron);
......@@ -420,20 +421,20 @@ class ActivityTypeObjectionable extends ActivityTypeAdmin {
throw new ViewNotFoundException(get_string('viewnotfound', 'error', $this->view));
}
if (empty($this->artefact)) {
return get_string_from_language($user->lang, 'objectionablecontentview', 'activity')
. ' ' . get_string_from_language($user->lang, 'onview', 'activity') . ' ' . $viewtitle;
return get_string_from_language($user->lang, 'objectionablecontentview', 'activity',
$viewtitle, display_name($this->reporter, $user));
}
else {
if (!$artefacttitle = get_field('artefact', 'title', 'id', $this->artefact)) {
throw new ArtefactNotFoundException(get_string('artefactnotfound', 'error', $this->artefact));
}
return get_string_from_language($user->lang, 'objectionablecontentartefact', 'activity')
. ' ' . get_string_from_language($user->lang, 'onartefact', 'activity') . ' ' . $artefacttitle;
return get_string_from_language($user->lang, 'objectionablecontentartefact', 'activity',
$artefacttitle, display_name($this->reporter, $user));
}
}
public function get_required_parameters() {
return array('message', 'view');
return array('message', 'view', 'reporter');
}
}
......
......@@ -36,6 +36,7 @@ $data = new StdClass;
$data->view = param_integer('view');
$data->artefact = param_integer('artefact', null);
$data->message = param_variable('message');
$data->reporter = $USER->get('id');
activity_occurred('objectionable', $data);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment