Commit 11d3a812 authored by Robert Lyon's avatar Robert Lyon Committed by Gerrit Code Review
Browse files

Merge "Bug 1197197: Admin notification to change private comment to public"

parents 3e31e8de 48fbd286
......@@ -179,7 +179,7 @@ function edit_annotation_feedback_submit(Pieform $form, $values) {
}
else if (!empty($group)) {
$group_admins = group_get_admin_ids($group);
// TODO: need to notify the group admins bug #1197197
edit_annotation_feedback_notify($view, $annotationfeedback->get('author'), $group_admins);
}
}
......@@ -192,6 +192,10 @@ function edit_annotation_feedback_submit(Pieform $form, $values) {
function edit_annotation_feedback_notify($view, $author, $owner) {
global $annotation, $SESSION;
if (!is_array($owner)) {
$owner = array($owner);
}
$data = (object) array(
'subject' => false,
'message' => false,
......@@ -211,11 +215,17 @@ function edit_annotation_feedback_notify($view, $author, $owner) {
'section' => 'artefact.annotation',
),
),
'users' => array($owner),
'users' => $owner,
'url' => $annotation->get_view_url($view->get('id'), true, false),
);
if (!empty($owner)) {
$SESSION->add_ok_msg(get_string('makepublicrequestsent', 'artefact.annotation', display_name($owner)));
if ( count($owner) > 1) {
$displayname = get_string('groupadmins', 'artefact.annotation');
}
else {
$displayname = display_name($owner[0]);
}
$SESSION->add_ok_msg(get_string('makepublicrequestsent', 'artefact.annotation', $displayname));
}
activity_occurred('maharamessage', $data);
}
......
......@@ -50,6 +50,7 @@ $string['makepublic'] = 'Make public';
$string['makepublicnotallowed'] = 'You are not allowed to make this feedback public.';
$string['makepublicrequestsubject'] = 'Request to change private feedback to public.';
$string['makepublicrequestbyownermessage'] = '%s has requested that you make your feedback public.';
$string['groupadmins'] = 'Group Administrators';
$string['makepublicrequestsent'] = 'A message has been sent to %s to request that the feedback be made public.';
$string['makepublicrequestbyauthormessage'] = '%s has requested that you make their feedback public.';
......
......@@ -138,7 +138,7 @@ function edit_comment_submit(Pieform $form, $values) {
}
else if (!empty($group)) {
$group_admins = group_get_admin_ids($group);
// TODO: need to notify the group admins bug #1197197
edit_comment_notify($view, $comment->get('author'), $group_admins);
}
}
......@@ -151,6 +151,10 @@ function edit_comment_submit(Pieform $form, $values) {
function edit_comment_notify($view, $author, $owner) {
global $comment, $SESSION;
if (!is_array($owner)) {
$owner = array($owner);
}
$data = (object) array(
'subject' => false,
'message' => false,
......@@ -170,12 +174,20 @@ function edit_comment_notify($view, $author, $owner) {
'section' => 'artefact.comment',
),
),
'users' => array($owner),
'users' => $owner,
'url' => $comment->get_view_url($view->get('id'), true, false),
);
if (!empty($owner)) {
$SESSION->add_ok_msg(get_string('makepublicrequestsent', 'artefact.comment', display_name($owner)));
if (count($owner) > 1) {
$displayname = get_string('groupadmins', 'artefact.comment');
}
else {
$displayname = display_name($owner[0]);
}
$SESSION->add_ok_msg(get_string('makepublicrequestsent', 'artefact.comment', $displayname));
}
activity_occurred('maharamessage', $data);
}
......
......@@ -54,6 +54,7 @@ $string['makepublicrequestsubject'] = 'Request to change private comment to publ
$string['makepublicrequestbyauthormessage'] = '%s has requested that you make their comment public.';
$string['makepublicrequestbyownermessage'] = '%s has requested that you make your comment public.';
$string['makepublicrequestsent'] = 'A message has been sent to %s to request that the comment be made public.';
$string['groupadmins'] = 'Group Administrators';
$string['messageempty'] = 'Your message is empty. Please enter a message or attach a file.';
$string['Moderate'] = 'Moderate';
$string['moderatecomments'] = 'Moderate comments';
......
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