'; print '
'; print '
'; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; if ($action !== 'editcomment') { print ''; // Description print ''; print ''; } print '
'.$langs->trans("Comments").'
'; $desc = GETPOST('comment_description'); $doleditor = new DolEditor('comment_description', $desc, '', 80, 'dolibarr_notes', 'In', 0, true, true, ROWS_3, '100%'); print $doleditor->Create(1); print ''; print ''; print '
'; // List of comments if (!empty($object->comments)) { // Default color for current user $TColors = array($user->id => array('bgcolor'=>'efefef', 'color'=>'555')); $first = true; foreach ($object->comments as $comment) { $fk_user = $comment->fk_user_author; $userstatic->fetch($fk_user); if (empty($TColors[$fk_user])) { $bgcolor = randomColor(180, 240); if (!empty($userstatic->color)) { $bgcolor = $userstatic->color; } $color = (colorIsLight($bgcolor)) ? '555' : 'fff'; $TColors[$fk_user] = array('bgcolor'=>$bgcolor, 'color'=>$color); } print '
'; if ($fk_user != $user->id) { print '
 
'; } print '
'; print '
'; if (!empty($user->photo)) { print Form::showphoto('userphoto', $userstatic, 80, 0, 0, '', 'small', 0, 1).'
'; } print $langs->trans('User').' : '.$userstatic->getNomUrl().'
'; print $langs->trans('Date').' : '.dol_print_date($comment->datec, 'dayhoursec'); print '
'; // End comment-info print '
'; print '
'; if ($action === 'editcomment' && $comment->id == $idcomment) { print '
'; print ''; print ''; print ''; print ''; print ''; } print '
'; if ($action === 'editcomment' && $comment->id == $idcomment) { $doleditor = new DolEditor('comment_description', $comment->description, '', 80, 'dolibarr_notes', 'In', 0, true, true, ROWS_3, '100%'); print $doleditor->Create(1); } else { print $comment->description; } print '
'; // End comment-description if ($action === 'editcomment' && $comment->id == $idcomment) { print ''; print ''; print '
'; } else { if ($fk_user == $user->id || $user->admin == 1) { print ''; print img_picto('', 'edit.png'); print ''; } if (($first && $fk_user == $user->id) || $user->admin == 1) { print ''; print img_picto('', 'delete.png'); print ''; } } print '
'; // End comment-table print '
'; // End comment-right print '
'; // End comment if ($fk_user == $user->id) { print '
 
'; } print '
'; print '
'; // end 100p $first = false; } } print '
'; print '
';