diff --git a/htdocs/projet/ganttchart.inc.php b/htdocs/projet/ganttchart.inc.php index 2600fbd02fc..47ad04d1dc7 100644 --- a/htdocs/projet/ganttchart.inc.php +++ b/htdocs/projet/ganttchart.inc.php @@ -131,7 +131,7 @@ else /** * Add a gant chart line * - * @param string $tarr tarr + * @param array $tarr Array of all tasks * @param array $task Array with properties of one task * @param Project $project_dependencies Project object * @param int $level Level @@ -206,7 +206,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_ $s = "\n// Add taks id=".$task["task_id"]." level = ".$level."\n"; // $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js($name)."','".$start_date."', '".$end_date."', '".$task['task_color']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]>0?1:0).", '".$parent."', 1, '".($depend?$depend:"")."', '".$note."'));"; // For JSGanttImproved - $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js(trim($name))."','".$start_date."', '".$end_date."', '".$task['task_css']."', '".$link."', ".$task['task_milestone'].", '".$resources."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]).", '".$parent."', 1, '".($depend?$depend:$parent."SS")."', '".($percent >= 0 ? $percent.'%' : '0%')."','".dol_escape_js($task['note'])."'));"; + $s.= "g.AddTaskItem(new JSGantt.TaskItem(".$task['task_id'].",'".dol_escape_js(trim($name))."','".$start_date."', '".$end_date."', '".$task['task_css']."', '".$link."', ".$task['task_milestone'].", '".dol_escape_js($resources)."', ".($percent >= 0 ? $percent : 0).", ".($task["task_is_group"]).", '".$parent."', 1, '".($depend?$depend:$parent."SS")."', '".($percent >= 0 ? $percent.'%' : '0%')."','".dol_escape_js($task['note'])."'));"; echo $s; @@ -215,7 +215,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_ /** * Find child Gantt line * - * @param string $tarr tarr + * @param array $tarr tarr * @param int $parent Parent * @param Project $project_dependencies Project object * @param int $level Level diff --git a/htdocs/projet/ganttview.php b/htdocs/projet/ganttview.php index 16f719a3a8f..eb24c58a211 100644 --- a/htdocs/projet/ganttview.php +++ b/htdocs/projet/ganttview.php @@ -28,6 +28,8 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php'; $id=GETPOST('id','int'); @@ -65,6 +67,7 @@ $form=new Form($db); $formother=new FormOther($db); $userstatic=new User($db); $companystatic=new Societe($db); +$contactstatic=new Contact($db); $task = new Task($db); $arrayofcss=array('/includes/jsgantt/jsgantt.css'); @@ -239,6 +242,7 @@ if (count($tasksarray)>0) foreach($tasksarray as $key => $val) { $task->fetch($val->id); + $tasks[$taskcursor]['task_id']=$val->id; $tasks[$taskcursor]['task_parent']=$val->fk_parent; $tasks[$taskcursor]['task_is_group'] = 0; @@ -261,7 +265,7 @@ if (count($tasksarray)>0) $tasks[$taskcursor]['task_end_date']=$val->date_end; $tasks[$taskcursor]['task_color']='b4d1ea'; $idofusers=$task->getListContactId('internal'); - $idofthirdparty=$task->getListContactId('external'); + $idofcontacts=$task->getListContactId('external'); $s=''; if (count($idofusers)>0) { @@ -275,18 +279,26 @@ if (count($tasksarray)>0) $i++; } } - //if (count($idofusers)>0 && (count($idofthirdparty)>0)) $s.=' - '; - if (count($idofthirdparty)>0) + //if (count($idofusers)>0 && (count($idofcontacts)>0)) $s.=' - '; + if (count($idofcontacts)>0) { if ($s) $s.=' - '; $s.=$langs->trans("Externals").': '; $i=0; - foreach($idofthirdparty as $valid) + $contactidfound=array(); + foreach($idofcontacts as $valid) { - $companystatic->fetch($valid); - if ($i) $s.=','; - $s.=$companystatic->name; - $i++; + if (empty($contactidfound[$valid])) + { + $res = $contactstatic->fetch($valid); + if ($res > 0) + { + if ($i) $s.=', '; + $s.=$contactstatic->getFullName($langs); + $contactidfound[$valid]=1; + $i++; + } + } } } //if ($s) $tasks[$taskcursor]['task_resources']=''.$langs->trans("List").''; diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index 96c7c91de2b..4529896746c 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -3453,6 +3453,10 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; } /* Gantt /* ============================================================================== */ +div.gTaskInfo { + background: #f0f0f0 !important; +} + td.gtaskname { overflow: hidden; text-overflow: ellipsis;