diff --git a/htdocs/langs/en_US/projects.lang b/htdocs/langs/en_US/projects.lang index 57406704bf4..cec985584a0 100644 --- a/htdocs/langs/en_US/projects.lang +++ b/htdocs/langs/en_US/projects.lang @@ -213,3 +213,5 @@ AllowCommentOnTask=Allow user comments on tasks TaskCommentLinks=Comments TaskNbComments=Number of comments TaskComment=Task's comments space +CommentAdded=Comment added +CommentDeleted=Comment deleted diff --git a/htdocs/langs/fr_FR/projects.lang b/htdocs/langs/fr_FR/projects.lang index ece3272c743..154c1138ab9 100644 --- a/htdocs/langs/fr_FR/projects.lang +++ b/htdocs/langs/fr_FR/projects.lang @@ -212,3 +212,5 @@ AllowCommentOnTask=Autoriser les commentaires entre utilisateurs sur les tâches TaskCommentLinks=Commentaires TaskNbComments=Nombre de commentaires TaskComment=Tâches espace commentaires +CommentAdded=Commentaire ajouté avec succès +CommentDeleted=Commentaire supprimé avec succès diff --git a/htdocs/projet/tasks/comment.php b/htdocs/projet/tasks/comment.php index 69f5125d899..3ee3cf2593b 100644 --- a/htdocs/projet/tasks/comment.php +++ b/htdocs/projet/tasks/comment.php @@ -81,6 +81,7 @@ if ($action == 'addcomment') $object->entity = $conf->entity; if ($object->create($user) > 0) { + setEventMessages($langs->trans("CommentAdded"), null, 'mesgs'); header('Location: '.DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$id.($withproject?'&withproject=1':'')); exit; } @@ -97,6 +98,7 @@ if ($action == 'deletecomment') { if ($object->delete($user) > 0) { + setEventMessages($langs->trans("CommentDeleted"), null, 'mesgs'); header('Location: '.DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$id.($withproject?'&withproject=1':'')); exit; } @@ -366,24 +368,35 @@ if ($id > 0 || ! empty($ref)) print '
 
'; } - print '
'; - print '
'; - print $comment->description; - print '
'; - 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 '
'; + print '
'; + print $comment->description; + print '
'; // End comment-description if(($first && $fk_user == $user->id) || $user->admin == 1) { - print '
'.$langs->trans('Delete').''; + print ''; + print img_picto('', 'delete.png'); + print ''; } - print '
'; - print '
'; + print '
'; // End comment-table + print '
'; // End comment-right + print '
'; // End comment if($comment->fk_user != $user->id) { print '
 
'; } print '
'; - print ''; + print ''; // end 100p $first = false; } diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 1fb99bbdc07..8a0e4002fb4 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3817,19 +3817,46 @@ pre#editfilecontentaceeditorid { #comment div { box-sizing:border-box; } - #comment .comment { border-radius:7px; - padding:7px 10px; margin-bottom:10px; + overflow:hidden; +} +#comment .comment-table { + display:table; + height:100%; +} +#comment .comment-cell { + display:table-cell; } #comment .comment-info { font-size:0.8em; - margin-top:5px; + border-right:1px solid #dedede; + margin-right:10px; + width:160px; + text-align:center; + background:rgba(255,255,255,0.5); + vertical-align:middle; + padding:10px 2px; } #comment .comment-info a { color:inherit; } +#comment .comment-right { + vertical-align:top; +} +#comment .comment-description { + padding:10px; + vertical-align:top; +} +#comment .comment-delete { + width: 100px; + text-align:center; + vertical-align:middle; +} +#comment .comment-delete:hover { + background:rgba(250,20,20,0.8); +} #comment textarea { width: 100%; }