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

Allow all logged in users to submit attachments to view feedback


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 6f83497f
......@@ -289,7 +289,7 @@ class ArtefactTypeComment extends ArtefactType {
$data->pagination_js = $pagination['javascript'];
}
public static function add_comment_form($attachments=false) {
public static function add_comment_form() {
global $USER;
$form = array(
'name' => 'add_feedback_form',
......@@ -321,7 +321,7 @@ class ArtefactTypeComment extends ArtefactType {
'type' => 'checkbox',
'title' => get_string('makepublic', 'artefact.comment'),
);
if ($attachments) {
if ($USER->is_logged_in()) {
$form['elements']['attachments'] = array(
'type' => 'files',
'title' => get_string('attachfile', 'artefact.comment'),
......
......@@ -93,8 +93,7 @@ $title = hsc(TITLE);
$submittedgroup = (int)$view->get('submittedgroup');
if ($USER->is_logged_in() && $submittedgroup && group_user_can_assess_submitted_views($submittedgroup, $USER->get('id'))) {
// The user is a tutor of the group that this view has
// been submitted to, and is entitled to release the view, and to
// upload an additional file when submitting feedback.
// been submitted to, and is entitled to release the view
$submittedgroup = get_record('group', 'id', $submittedgroup);
$releaseform = pieform(array(
'name' => 'releaseview',
......@@ -113,11 +112,9 @@ if ($USER->is_logged_in() && $submittedgroup && group_user_can_assess_submitted_
),
),
));
$allowattachments = true;
}
else {
$releaseform = '';
$allowattachments = false;
}
......@@ -140,7 +137,7 @@ $feedback = ArtefactTypeComment::get_comments($limit, $offset, false, $view);
$anonfeedback = !$USER->is_logged_in() && ($usertoken || $viewid == get_view_from_token(get_cookie('viewaccess:'.$viewid)));
if ($USER->is_logged_in() || $anonfeedback) {
$addfeedbackform = pieform(ArtefactTypeComment::add_comment_form($allowattachments));
$addfeedbackform = pieform(ArtefactTypeComment::add_comment_form());
}
if ($USER->is_logged_in()) {
$objectionform = pieform(objection_form());
......
Supports Markdown
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