FIX Bad ressource list in popup in gantt view
This commit is contained in:
parent
74b401b70d
commit
3e43e164ae
@ -131,7 +131,7 @@ else
|
|||||||
/**
|
/**
|
||||||
* Add a gant chart line
|
* 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 array $task Array with properties of one task
|
||||||
* @param Project $project_dependencies Project object
|
* @param Project $project_dependencies Project object
|
||||||
* @param int $level Level
|
* @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 = "\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."'));";
|
// $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
|
// 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;
|
echo $s;
|
||||||
|
|
||||||
|
|
||||||
@ -215,7 +215,7 @@ function constructGanttLine($tarr,$task,$project_dependencies,$level=0,$project_
|
|||||||
/**
|
/**
|
||||||
* Find child Gantt line
|
* Find child Gantt line
|
||||||
*
|
*
|
||||||
* @param string $tarr tarr
|
* @param array $tarr tarr
|
||||||
* @param int $parent Parent
|
* @param int $parent Parent
|
||||||
* @param Project $project_dependencies Project object
|
* @param Project $project_dependencies Project object
|
||||||
* @param int $level Level
|
* @param int $level Level
|
||||||
|
|||||||
@ -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.'/projet/class/task.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.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.'/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';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
|
|
||||||
$id=GETPOST('id','int');
|
$id=GETPOST('id','int');
|
||||||
@ -65,6 +67,7 @@ $form=new Form($db);
|
|||||||
$formother=new FormOther($db);
|
$formother=new FormOther($db);
|
||||||
$userstatic=new User($db);
|
$userstatic=new User($db);
|
||||||
$companystatic=new Societe($db);
|
$companystatic=new Societe($db);
|
||||||
|
$contactstatic=new Contact($db);
|
||||||
$task = new Task($db);
|
$task = new Task($db);
|
||||||
|
|
||||||
$arrayofcss=array('/includes/jsgantt/jsgantt.css');
|
$arrayofcss=array('/includes/jsgantt/jsgantt.css');
|
||||||
@ -239,6 +242,7 @@ if (count($tasksarray)>0)
|
|||||||
foreach($tasksarray as $key => $val)
|
foreach($tasksarray as $key => $val)
|
||||||
{
|
{
|
||||||
$task->fetch($val->id);
|
$task->fetch($val->id);
|
||||||
|
|
||||||
$tasks[$taskcursor]['task_id']=$val->id;
|
$tasks[$taskcursor]['task_id']=$val->id;
|
||||||
$tasks[$taskcursor]['task_parent']=$val->fk_parent;
|
$tasks[$taskcursor]['task_parent']=$val->fk_parent;
|
||||||
$tasks[$taskcursor]['task_is_group'] = 0;
|
$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_end_date']=$val->date_end;
|
||||||
$tasks[$taskcursor]['task_color']='b4d1ea';
|
$tasks[$taskcursor]['task_color']='b4d1ea';
|
||||||
$idofusers=$task->getListContactId('internal');
|
$idofusers=$task->getListContactId('internal');
|
||||||
$idofthirdparty=$task->getListContactId('external');
|
$idofcontacts=$task->getListContactId('external');
|
||||||
$s='';
|
$s='';
|
||||||
if (count($idofusers)>0)
|
if (count($idofusers)>0)
|
||||||
{
|
{
|
||||||
@ -275,18 +279,26 @@ if (count($tasksarray)>0)
|
|||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if (count($idofusers)>0 && (count($idofthirdparty)>0)) $s.=' - ';
|
//if (count($idofusers)>0 && (count($idofcontacts)>0)) $s.=' - ';
|
||||||
if (count($idofthirdparty)>0)
|
if (count($idofcontacts)>0)
|
||||||
{
|
{
|
||||||
if ($s) $s.=' - ';
|
if ($s) $s.=' - ';
|
||||||
$s.=$langs->trans("Externals").': ';
|
$s.=$langs->trans("Externals").': ';
|
||||||
$i=0;
|
$i=0;
|
||||||
foreach($idofthirdparty as $valid)
|
$contactidfound=array();
|
||||||
|
foreach($idofcontacts as $valid)
|
||||||
{
|
{
|
||||||
$companystatic->fetch($valid);
|
if (empty($contactidfound[$valid]))
|
||||||
if ($i) $s.=',';
|
{
|
||||||
$s.=$companystatic->name;
|
$res = $contactstatic->fetch($valid);
|
||||||
$i++;
|
if ($res > 0)
|
||||||
|
{
|
||||||
|
if ($i) $s.=', ';
|
||||||
|
$s.=$contactstatic->getFullName($langs);
|
||||||
|
$contactidfound[$valid]=1;
|
||||||
|
$i++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//if ($s) $tasks[$taskcursor]['task_resources']='<a href="'.DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$val->id.'&withproject=1" title="'.dol_escape_htmltag($s).'">'.$langs->trans("List").'</a>';
|
//if ($s) $tasks[$taskcursor]['task_resources']='<a href="'.DOL_URL_ROOT.'/projet/tasks/contact.php?id='.$val->id.'&withproject=1" title="'.dol_escape_htmltag($s).'">'.$langs->trans("List").'</a>';
|
||||||
|
|||||||
@ -3453,6 +3453,10 @@ table.cal_event td.cal_event_right { padding: 4px 4px !important; }
|
|||||||
/* Gantt
|
/* Gantt
|
||||||
/* ============================================================================== */
|
/* ============================================================================== */
|
||||||
|
|
||||||
|
div.gTaskInfo {
|
||||||
|
background: #f0f0f0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
td.gtaskname {
|
td.gtaskname {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user