Commit fb950eec authored by Aaron Wells's avatar Aaron Wells

Providing a more specific message for anonymous commenters of private comments

Bug1201052

Change-Id: I10dd1f28eb7b47d7608f9df29a4661300a99e4fb
parent 5e2f3e6d
......@@ -59,6 +59,8 @@ $string['feedbackattachdirdesc'] = 'Files attached to comments on your portfolio
$string['feedbackattachmessage'] = 'The attached file(s) have been added to your %s folder';
$string['feedbackonviewbyuser'] = 'Feedback on %s by %s';
$string['feedbacksubmitted'] = 'Feedback submitted';
$string['feedbacksubmittedmoderatedanon'] = 'Feedback submitted, awaiting moderation';
$string['feedbacksubmittedprivateanon'] = 'Private feedback submitted';
$string['lastcomment'] = 'Last comment';
$string['makepublic'] = 'Make public';
$string['makepublicnotallowed'] = 'You are not allowed to make this comment public';
......
......@@ -993,19 +993,24 @@ function add_feedback_form_submit(Pieform $form, $values) {
}
if ($author = $USER->get('id')) {
$anonymous = false;
$data->author = $author;
}
else {
$anonymous = true;
$data->authorname = $values['authorname'];
}
if (isset($values['moderate']) && $values['ispublic'] && !$USER->can_edit_view($view)) {
$data->private = 1;
$data->requestpublic = 'author';
$moderated = true;
}
else {
$data->private = (int) !$values['ispublic'];
$moderated = false;
}
$private = $data->private;
if (get_config('licensemetadata')) {
$data->license = $values['license'];
......@@ -1124,8 +1129,21 @@ function add_feedback_form_submit(Pieform $form, $values) {
$newlist = ArtefactTypeComment::get_comments(10, 0, 'last', $view, $artefact);
// If you're anonymous and your message is moderated or private, then you won't
// be able to tell what happened to it. So we'll provide some more explanation in
// the feedback message.
if ($anonymous && $moderated) {
$message = get_string('feedbacksubmittedmoderatedanon', 'artefact.comment');
}
else if ($anonymous && $private) {
$message = get_string('feedbacksubmittedprivateanon', 'artefact.comment');
}
else {
$message = get_string('feedbacksubmitted', 'artefact.comment');
}
$form->reply(PIEFORM_OK, array(
'message' => get_string('feedbacksubmitted', 'artefact.comment'),
'message' => $message,
'goto' => $goto,
'data' => $newlist,
));
......
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