From ff905d2e677b3b6d2d01f9facb0fff911d3d5ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Loguercio?= Date: Tue, 9 Feb 2016 11:07:35 -0500 Subject: [PATCH] Fix Forum Student evaluation doesn't give the list of posts anymore - Refs #8061 --- main/forum/forumqualify.php | 71 ++++++++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/main/forum/forumqualify.php b/main/forum/forumqualify.php index 6b10e525a6..0a32b45700 100755 --- a/main/forum/forumqualify.php +++ b/main/forum/forumqualify.php @@ -234,7 +234,76 @@ if ($allowToQualify) { $qualify ); - include 'viewpost.inc.php'; + $course = api_get_course_info(); + + $rows = get_thread_user_post($course['code'], $currentThread['thread_id'], $_GET['user']); + if (isset($rows)) { + $counter = 1; + foreach ($rows as $row) { + if ($row['status']=='0') { + $style =" id = 'post".$post_en."' class=\"hide-me\" style=\"border:1px solid red; display:none; background-color:#F7F7F7; width:95%; margin: 0px 0px 4px 40px; \" "; + } else { + $style = ""; + $post_en = $row['post_parent_id']; + } + + if ($row['user_id'] == '0') { + $name = prepare4display($row['poster_name']); + } else { + $name = api_get_person_name($row['firstname'], $row['lastname']); + } + if ($counter == 1) { + echo Display::page_subheader($name); + } + + echo "
"; + + if ($row['visible']=='0') { + $titleclass='forum_message_post_title_2_be_approved'; + $messageclass='forum_message_post_text_2_be_approved'; + $leftclass='forum_message_left_2_be_approved'; + } else { + $titleclass='forum_message_post_title'; + $messageclass='forum_message_post_text'; + $leftclass='forum_message_left'; + } + + echo ""; + echo ""; + + // The post title + echo ""; + echo ""; + + // The post message + echo ""; + echo ""; + echo ""; + + // The check if there is an attachment + $attachment_list = get_attachment($row['post_id']); + + if (!empty($attachment_list)) { + echo ''; + } + + echo "
"; + + echo '
'. api_convert_and_format_date($row['post_date'], DATE_TIME_FORMAT_LONG).'
'; + + echo "
".prepare4display($row['post_title'])."
".prepare4display($row['post_text'])."
'; + $realname = $attachment_list['path']; + $user_filename = $attachment_list['filename']; + + echo Display::return_icon('attachment.gif',get_lang('Attachment')); + echo ' '.$user_filename.' '; + echo ''.$attachment_list['comment'].'
'; + echo '
"; + $counter++; + } + } $form->addButtonSave(get_lang('QualifyThisThread')); $form->setDefaults(array('idtextqualify' => $qualify));