diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index cf94307a32a..3789759c2e9 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1801,6 +1801,7 @@ class Task extends CommonObject */ public function fetchComments() { + $this->comments = array(); $sql = "SELECT"; $sql.= " c.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."projet_task_comment as c"; diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 0446cc71ea6..3f0cbe0bf47 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -141,7 +141,6 @@ if ($id > 0 || ! empty($ref)) if ($task->fetch($id,$ref) > 0) { $res=$task->fetch_optionals($task->id,$extralabels); - $res = $task->fetchComments(); $result=$projectstatic->fetch($task->fk_project); if (! empty($projectstatic->socid)) $projectstatic->fetch_thirdparty(); @@ -369,7 +368,7 @@ if ($id > 0 || ! empty($ref)) print '
'; print $langs->trans('User').' : '.$userstatic->getNomUrl().'
'; print $langs->trans('Date').' : '.dol_print_date($comment->datec,'dayhoursec'); - if($first && $fk_user == $user->id) { + if(($first && $fk_user == $user->id) || $user->admin == 1) { print '
'.$langs->trans('Delete').''; } print '
';