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)
|
||||
{
|
||||
@ -706,11 +709,11 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $
|
||||
if($jour_semaine == 0 || $jour_semaine == 6) $ferie=true;
|
||||
//Samedi (6) et dimanche (0)
|
||||
}
|
||||
|
||||
|
||||
if ($countrycode == 'AT')
|
||||
{
|
||||
$countryfound=1;
|
||||
|
||||
|
||||
// Definition des dates feriees fixes
|
||||
if($jour == 1 && $mois == 1) $ferie=true; // Neujahr
|
||||
if($jour == 6 && $mois == 1) $ferie=true; // Hl. 3 Koenige
|
||||
@ -723,14 +726,14 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $
|
||||
if($jour == 25 && $mois == 12) $ferie=true; // Christtag
|
||||
if($jour == 26 && $mois == 12) $ferie=true; // Stefanietag
|
||||
if($jour == 31 && $mois == 12) $ferie=true; // Silvester
|
||||
|
||||
|
||||
// Easter calculation
|
||||
$date_paques = easter_date($annee);
|
||||
$jour_paques = date("d", $date_paques);
|
||||
$mois_paques = date("m", $date_paques);
|
||||
if($jour_paques == $jour && $mois_paques == $mois) $ferie=true;
|
||||
// Easter sunday
|
||||
|
||||
|
||||
// Monday after easter
|
||||
$date_eastermonday = mktime(
|
||||
date("H", $date_paques),
|
||||
@ -744,7 +747,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $
|
||||
$mois_eastermonday = date("m", $date_eastermonday);
|
||||
if($jour_eastermonday == $jour && $mois_eastermonday == $mois) $ferie=true;
|
||||
// Easter monday
|
||||
|
||||
|
||||
// Christi Himmelfahrt (39 days after easter sunday)
|
||||
$date_ch = mktime(
|
||||
date("H", $date_paques),
|
||||
@ -758,7 +761,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $
|
||||
$mois_ch = date("m", $date_ch);
|
||||
if($jour_ch == $jour && $mois_ch == $mois) $ferie=true;
|
||||
// Christi Himmelfahrt
|
||||
|
||||
|
||||
// Pfingsten (50 days after easter sunday)
|
||||
$date_pentecote = mktime(
|
||||
date("H", $date_paques),
|
||||
@ -772,7 +775,7 @@ function num_public_holiday($timestampStart, $timestampEnd, $countrycode='FR', $
|
||||
$mois_pentecote = date("m", $date_pentecote);
|
||||
if($jour_pentecote == $jour && $mois_pentecote == $mois) $ferie=true;
|
||||
// Pfingsten
|
||||
|
||||
|
||||
// Fronleichnam (60 days after easter sunday)
|
||||
$date_fronleichnam = mktime(
|
||||
date("H", $date_paques),
|
||||
|
||||
@ -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