Fix missing worload
This commit is contained in:
parent
6b77dc3b5d
commit
e10a9912dc
@ -148,6 +148,7 @@ function dol_time_plus_duree($time, $duration_value, $duration_unit)
|
||||
* @param int $iMinutes Minutes
|
||||
* @param int $iSeconds Seconds
|
||||
* @return int Time into seconds
|
||||
* @see convertSecondToTime
|
||||
*/
|
||||
function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
|
||||
{
|
||||
@ -156,7 +157,8 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
|
||||
}
|
||||
|
||||
|
||||
/** Return, in clear text, value of a number of seconds in days, hours and minutes
|
||||
/** Return, in clear text, value of a number of seconds in days, hours and minutes.
|
||||
* Can be used to show a duration.
|
||||
*
|
||||
* @param int $iSecond Number of seconds
|
||||
* @param string $format Output format ('all': total delay days hour:min like "2 days 12:30", 'allwithouthour': total delay days without hour part like "2 days", 'allhourmin': total delay with format hours:min like "60:30", 'allhour': total delay hours without min/sec like "60:30", 'fullhour': total delay hour decimal like "60.5" for 60:30, 'hour': only hours part "12", 'min': only minutes part "30", 'sec': only seconds part, 'month': only month part, 'year': only year part);
|
||||
@ -164,6 +166,7 @@ function convertTime2Seconds($iHours=0,$iMinutes=0,$iSeconds=0)
|
||||
* @param int $lengthOfWeek Length of week (default 7)
|
||||
* @return string Formated text of duration
|
||||
* Example: 0 return 00:00, 3600 return 1:00, 86400 return 1d, 90000 return 1 Day 01:00
|
||||
* @see convertTime2Seconds
|
||||
*/
|
||||
function convertSecondToTime($iSecond, $format='all', $lengthOfDay=86400, $lengthOfWeek=7)
|
||||
{
|
||||
|
||||
@ -126,8 +126,10 @@ if (g.getDivId() != null)
|
||||
$projecttmp=new Project($db);
|
||||
$projecttmp->fetch($t['task_project_id']);
|
||||
$tmpt = array(
|
||||
'task_id'=> '-'.$t['task_project_id'], 'task_alternate_id'=> '-'.$t['task_project_id'], 'task_name'=>$projecttmp->ref.' '.$projecttmp->title, 'task_resources'=>'', 'task_start_date'=>'', 'task_end_date'=>'',
|
||||
'task_is_group'=>1, 'task_position'=>0, 'task_css'=>'ggroupblack', 'task_milestone'=> 0, 'task_parent'=>0, 'task_parent_alternate_id'=>0, 'task_notes'=>''
|
||||
'task_id'=> '-'.$t['task_project_id'], 'task_alternate_id'=> '-'.$t['task_project_id'], 'task_name'=>$projecttmp->ref.' '.$projecttmp->title, 'task_resources'=>'',
|
||||
'task_start_date'=>'', 'task_end_date'=>'',
|
||||
'task_is_group'=>1, 'task_position'=>0, 'task_css'=>'ggroupblack', 'task_milestone'=> 0, 'task_parent'=>0, 'task_parent_alternate_id'=>0, 'task_notes'=>'',
|
||||
'task_planned_workload'=>0
|
||||
);
|
||||
constructGanttLine($tasks, $tmpt, array(), 0, $t['task_project_id']);
|
||||
$old_project_id = $t['task_project_id'];
|
||||
@ -168,6 +170,7 @@ else
|
||||
*/
|
||||
function constructGanttLine($tarr, $task, $task_dependencies, $level=0, $project_id=null)
|
||||
{
|
||||
global $langs;
|
||||
global $dateformatinput2;
|
||||
|
||||
$start_date = $task["task_start_date"];
|
||||
@ -262,7 +265,11 @@ function constructGanttLine($tarr, $task, $task_dependencies, $level=0, $project
|
||||
$taskid = $task["task_alternate_id"];
|
||||
//$taskid = $task['task_id'];
|
||||
|
||||
$s.= "g.AddTaskItem(new JSGantt.TaskItem('".$taskid."', '".dol_escape_js(trim($name))."', '".$start_date."', '".$end_date."', '".$css."', '".$link."', ".$task['task_milestone'].", '".dol_escape_js($resources)."', ".($percent >= 0 ? $percent : 0).", ".$line_is_auto_group.", '".$parent."', 1, '".$dependency."', '".(empty($task["task_is_group"]) ? (($percent >= 0 && $percent != '') ? $percent.'%' : '') : '')."', '".dol_escape_js($task['note'])."', g));";
|
||||
$note = $task['note'];
|
||||
|
||||
$note = dol_concatdesc($note, $langs->trans("Workload").' : '.($task['task_planned_workload'] ? convertSecondToTime($task['task_planned_workload'], 'allhourmin') : ''));
|
||||
|
||||
$s.= "g.AddTaskItem(new JSGantt.TaskItem('".$taskid."', '".dol_escape_js(trim($name))."', '".$start_date."', '".$end_date."', '".$css."', '".$link."', ".$task['task_milestone'].", '".dol_escape_js($resources)."', ".($percent >= 0 ? $percent : 0).", ".$line_is_auto_group.", '".$parent."', 1, '".$dependency."', '".(empty($task["task_is_group"]) ? (($percent >= 0 && $percent != '') ? $percent.'%' : '') : '')."', '".dol_escape_js($note)."', g));";
|
||||
echo $s;
|
||||
|
||||
|
||||
|
||||
@ -260,6 +260,7 @@ if (count($tasksarray)>0)
|
||||
$tasks[$taskcursor]['task_is_group'] = 0;
|
||||
$tasks[$taskcursor]['task_css'] = 'gtaskblue';
|
||||
$tasks[$taskcursor]['task_position'] = $val->rang;
|
||||
$tasks[$taskcursor]['task_planned_workload'] = $val->planned_workload;
|
||||
|
||||
if ($val->fk_parent != 0 && $task->hasChildren()> 0){
|
||||
$tasks[$taskcursor]['task_is_group']=1;
|
||||
@ -280,6 +281,7 @@ if (count($tasksarray)>0)
|
||||
$tasks[$taskcursor]['task_start_date']=$val->date_start;
|
||||
$tasks[$taskcursor]['task_end_date']=$val->date_end;
|
||||
$tasks[$taskcursor]['task_color']='b4d1ea';
|
||||
|
||||
$idofusers=$task->getListContactId('internal');
|
||||
$idofcontacts=$task->getListContactId('external');
|
||||
$s='';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user