diff --git a/main/forum/viewthread_flat.inc.php b/main/forum/viewthread_flat.inc.php
index 10a24939fa..d7812a995e 100644
--- a/main/forum/viewthread_flat.inc.php
+++ b/main/forum/viewthread_flat.inc.php
@@ -26,6 +26,7 @@
if (isset($current_thread['thread_id'])){
$rows=get_posts($current_thread['thread_id']);
+$increment=0;
foreach ($rows as $row) {
echo "
\n";
// the style depends on the status of the message: approved or not
@@ -64,7 +65,9 @@ foreach ($rows as $row) {
echo "".icon('../img/delete.gif',get_lang('Delete'))."\n";
display_visible_invisible_icon('post', $row['post_id'], $row['visible'],array('forum'=>Security::remove_XSS($_GET['forum']),'thread'=>Security::remove_XSS($_GET['thread']), 'origin'=>$origin ));
echo "\n";
- echo "".icon('../img/deplacer_fichier.gif',get_lang('MovePost'))."";
+ if ($increment>0) {
+ echo "".icon('../img/deplacer_fichier.gif',get_lang('MovePost'))."";
+ }
}
$userinf=api_get_user_info($row['user_id']);
@@ -138,5 +141,6 @@ foreach ($rows as $row) {
unset($_SESSION['whatsnew_post_info'][$current_forum['forum_id']][$current_thread['thread_id']][$row['post_id']]);
unset($_SESSION['whatsnew_post_info'][$current_forum['forum_id']][$current_thread['thread_id']]);
echo "
";
+ $increment++;
}
}
\ No newline at end of file
diff --git a/main/gradebook/lib/be/forumthreadlink.class.php b/main/gradebook/lib/be/forumthreadlink.class.php
index f4e73a35e0..7d7871a7c9 100755
--- a/main/gradebook/lib/be/forumthreadlink.class.php
+++ b/main/gradebook/lib/be/forumthreadlink.class.php
@@ -246,8 +246,15 @@ class ForumThreadLink extends AbstractLink
}
public function get_link() {
+ //it was extracts the forum id
+ $tbl_name=$this->get_forum_thread_table();
+ $sql = 'SELECT * FROM '.$this->get_forum_thread_table()." WHERE thread_id = '".$this->get_ref_id()."'";
+ $result = api_sql_query($sql,__FILE__,__LINE__);
+ $row = Database::fetch_array($result,'ASSOC');
+ $forum_id=$row['forum_id'];
+
$url = api_get_path(WEB_PATH)
- .'main/forum/viewthread.php?cidReq='.$this->get_course_code().'&thread='.$this->get_ref_id().'&gradebook=view';
+ .'main/forum/viewthread.php?cidReq='.$this->get_course_code().'&thread='.$this->get_ref_id().'&gradebook=view&forum='.$forum_id;
return $url;
}
private function get_exercise_data() {
@@ -261,4 +268,5 @@ class ForumThreadLink extends AbstractLink
}
return $this->exercise_data;
}
+
}
\ No newline at end of file