Invert left and right (my own comment on left)
This commit is contained in:
parent
85606126a9
commit
9b3826a54c
@ -35,13 +35,13 @@ $comment = new Comment($db);
|
|||||||
|
|
||||||
if ($action == 'addcomment')
|
if ($action == 'addcomment')
|
||||||
{
|
{
|
||||||
$description = GETPOST('comment_description');
|
$description = GETPOST('comment_description', 'none');
|
||||||
if (!empty($description))
|
if (!empty($description))
|
||||||
{
|
{
|
||||||
$comment->description = $description;
|
$comment->description = $description;
|
||||||
$comment->datec = time();
|
$comment->datec = time();
|
||||||
$comment->fk_element = GETPOST('id');
|
$comment->fk_element = GETPOST('id','int');
|
||||||
$comment->element_type = GETPOST('comment_element_type');
|
$comment->element_type = GETPOST('comment_element_type','alpha');
|
||||||
$comment->fk_user_author = $user->id;
|
$comment->fk_user_author = $user->id;
|
||||||
$comment->entity = $conf->entity;
|
$comment->entity = $conf->entity;
|
||||||
if ($comment->create($user) > 0)
|
if ($comment->create($user) > 0)
|
||||||
|
|||||||
@ -68,17 +68,6 @@ function project_prepare_head($object)
|
|||||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'project');
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'project');
|
||||||
|
|
||||||
|
|
||||||
// Manage discussion
|
|
||||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT))
|
|
||||||
{
|
|
||||||
$nbComments = $object->getNbComments();
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/projet/comment.php?id='.$object->id;
|
|
||||||
$head[$h][1] = $langs->trans("CommentLink");
|
|
||||||
if ($nbComments > 0) $head[$h][1].= ' <span class="badge">'.$nbComments.'</span>';
|
|
||||||
$head[$h][2] = 'project_comment';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
||||||
{
|
{
|
||||||
$nbNote = 0;
|
$nbNote = 0;
|
||||||
@ -122,6 +111,17 @@ function project_prepare_head($object)
|
|||||||
$h++;
|
$h++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Manage discussion
|
||||||
|
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT))
|
||||||
|
{
|
||||||
|
$nbComments = $object->getNbComments();
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/projet/comment.php?id='.$object->id;
|
||||||
|
$head[$h][1] = $langs->trans("CommentLink");
|
||||||
|
if ($nbComments > 0) $head[$h][1].= ' <span class="badge">'.$nbComments.'</span>';
|
||||||
|
$head[$h][2] = 'project_comment';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/projet/info.php?id='.$object->id;
|
||||||
$head[$h][1].= $langs->trans("Events");
|
$head[$h][1].= $langs->trans("Events");
|
||||||
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
if (! empty($conf->agenda->enabled) && (!empty($user->rights->agenda->myactions->read) || !empty($user->rights->agenda->allactions->read) ))
|
||||||
@ -188,17 +188,6 @@ function task_prepare_head($object)
|
|||||||
// $this->tabs = array('entity:-tabname); to remove a tab
|
// $this->tabs = array('entity:-tabname); to remove a tab
|
||||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'task');
|
||||||
|
|
||||||
// Manage discussion
|
|
||||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK))
|
|
||||||
{
|
|
||||||
$nbComments = $object->getNbComments();
|
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
|
|
||||||
$head[$h][1] = $langs->trans("CommentLink");
|
|
||||||
if ($nbComments > 0) $head[$h][1].= ' <span class="badge">'.$nbComments.'</span>';
|
|
||||||
$head[$h][2] = 'task_comment';
|
|
||||||
$h++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
if (empty($conf->global->MAIN_DISABLE_NOTES_TAB))
|
||||||
{
|
{
|
||||||
$nbNote = 0;
|
$nbNote = 0;
|
||||||
@ -222,6 +211,17 @@ function task_prepare_head($object)
|
|||||||
$head[$h][2] = 'task_document';
|
$head[$h][2] = 'task_document';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
|
// Manage discussion
|
||||||
|
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_TASK))
|
||||||
|
{
|
||||||
|
$nbComments = $object->getNbComments();
|
||||||
|
$head[$h][0] = DOL_URL_ROOT.'/projet/tasks/comment.php?id='.$object->id.(GETPOST('withproject')?'&withproject=1':'');
|
||||||
|
$head[$h][1] = $langs->trans("CommentLink");
|
||||||
|
if ($nbComments > 0) $head[$h][1].= ' <span class="badge">'.$nbComments.'</span>';
|
||||||
|
$head[$h][2] = 'task_comment';
|
||||||
|
$h++;
|
||||||
|
}
|
||||||
|
|
||||||
complete_head_from_modules($conf,$langs,$object,$head,$h,'task','remove');
|
complete_head_from_modules($conf,$langs,$object,$head,$h,'task','remove');
|
||||||
|
|
||||||
return $head;
|
return $head;
|
||||||
|
|||||||
@ -29,10 +29,9 @@ print '<td width="25%"></td>';
|
|||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
print '<tr class="oddeven">';
|
print '<tr class="oddeven">';
|
||||||
print '<td></td>';
|
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
print '<td colspan="2">';
|
print '<td colspan="3">';
|
||||||
|
|
||||||
$desc = GETPOST('comment_description');
|
$desc = GETPOST('comment_description');
|
||||||
|
|
||||||
@ -47,13 +46,16 @@ print '</td></tr>';
|
|||||||
print '</table></form>';
|
print '</table></form>';
|
||||||
|
|
||||||
// List of comments
|
// List of comments
|
||||||
if(!empty($object->comments)) {
|
if (!empty($object->comments))
|
||||||
|
{
|
||||||
// Default color for current user
|
// Default color for current user
|
||||||
$TColors = array($user->id => array('bgcolor'=>'efefef','color'=>'555'));
|
$TColors = array($user->id => array('bgcolor'=>'efefef','color'=>'555'));
|
||||||
$first = true;
|
$first = true;
|
||||||
foreach($object->comments as $comment) {
|
foreach($object->comments as $comment)
|
||||||
|
{
|
||||||
$fk_user = $comment->fk_user_author;
|
$fk_user = $comment->fk_user_author;
|
||||||
$userstatic->fetch($fk_user);
|
$userstatic->fetch($fk_user);
|
||||||
|
|
||||||
if(empty($TColors[$fk_user])) {
|
if(empty($TColors[$fk_user])) {
|
||||||
$bgcolor = random_color(180,240);
|
$bgcolor = random_color(180,240);
|
||||||
if(!empty($userstatic->color)) {
|
if(!empty($userstatic->color)) {
|
||||||
@ -63,7 +65,7 @@ if(!empty($object->comments)) {
|
|||||||
$TColors[$fk_user] = array('bgcolor'=>$bgcolor,'color'=>$color);
|
$TColors[$fk_user] = array('bgcolor'=>$bgcolor,'color'=>$color);
|
||||||
}
|
}
|
||||||
print '<div class="width100p" style="color:#'.$TColors[$fk_user]['color'].'">';
|
print '<div class="width100p" style="color:#'.$TColors[$fk_user]['color'].'">';
|
||||||
if($fk_user == $user->id) {
|
if ($fk_user != $user->id) {
|
||||||
print '<div class="width25p float"> </div>';
|
print '<div class="width25p float"> </div>';
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,7 +93,7 @@ if(!empty($object->comments)) {
|
|||||||
print '</div>'; // End comment-right
|
print '</div>'; // End comment-right
|
||||||
print '</div>'; // End comment
|
print '</div>'; // End comment
|
||||||
|
|
||||||
if($fk_user != $user->id) {
|
if($fk_user == $user->id) {
|
||||||
print '<div class="width25p float"> </div>';
|
print '<div class="width25p float"> </div>';
|
||||||
}
|
}
|
||||||
print '<div class="clearboth"></div>';
|
print '<div class="clearboth"></div>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user