FIX multiple comments not reset on fetch

This commit is contained in:
arnaud 2017-09-08 09:14:34 +02:00
parent 680fab313c
commit 7f5950c958
2 changed files with 2 additions and 2 deletions

View File

@ -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";

View File

@ -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 '<div class="comment-info">';
print $langs->trans('User').' : '.$userstatic->getNomUrl().'<br/>';
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 '<br/> <a href="?action=deletecomment&id='.$id.'&withproject=1&idcomment='.$comment->id.'">'.$langs->trans('Delete').'</a>';
}
print '</div>';