Fix travis
This commit is contained in:
parent
1ffb013371
commit
b193f1b34e
@ -1953,12 +1953,11 @@ function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $task Task
|
* @param task $task Task the task object
|
||||||
* @param $label string|bool true = auto, false = dont display, string = replace output
|
* @param label $label bool|string true = auto, false = dont display, string = replace output
|
||||||
* @param $progressNumber string|bool true = auto, false = dont display, string = replace output
|
* @param progressNumber $progressNumber bool|string true = auto, false = dont display, string = replace output
|
||||||
* @param $hideOnProgressNull bool
|
* @param hideOnProgressNull $hideOnProgressNull bool hide if progress is null
|
||||||
* @param $showPercent bool
|
* @param spaced $spaced bool used to add space at bottom (made by css)
|
||||||
* @param $spaced bool
|
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getTaskProgressView($task, $label = true, $progressNumber = true, $hideOnProgressNull = false, $spaced = false)
|
function getTaskProgressView($task, $label = true, $progressNumber = true, $hideOnProgressNull = false, $spaced = false)
|
||||||
@ -2062,9 +2061,9 @@ function getTaskProgressView($task, $label = true, $progressNumber = true, $hide
|
|||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @param $task Task
|
* @param task $task Task the task object
|
||||||
* @param $label string empty = auto (progress), string = replace output
|
* @param label $label string empty = auto (progress), string = replace output
|
||||||
* @param $tooltip string empty = auto , string = replace output
|
* @param tooltip $tooltip string empty = auto , string = replace output
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function getTaskProgressBadge($task, $label = '', $tooltip = '')
|
function getTaskProgressBadge($task, $label = '', $tooltip = '')
|
||||||
@ -2072,14 +2071,13 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '')
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
$out = '';
|
$out = '';
|
||||||
$label = '';
|
$badgeClass = '';
|
||||||
$badgeColorClass = '';
|
|
||||||
if ($task->progress != '')
|
if ($task->progress != '')
|
||||||
{
|
{
|
||||||
// TODO : manage 100%
|
// TODO : manage 100%
|
||||||
|
|
||||||
// define color according to time spend vs workload
|
// define color according to time spend vs workload
|
||||||
$badgeColorClass = 'badge ';
|
$badgeClass = 'badge ';
|
||||||
if ($task->planned_workload){
|
if ($task->planned_workload){
|
||||||
$progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2);
|
$progressCalculated = round(100 * doubleval($task->duration_effective) / doubleval($task->planned_workload), 2);
|
||||||
|
|
||||||
@ -2087,24 +2085,30 @@ function getTaskProgressBadge($task, $label = '', $tooltip = '')
|
|||||||
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01;
|
$warningRatio = !empty($conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT) ? (1 + $conf->global->PROJECT_TIME_SPEND_WARNING_PERCENT / 100) : 1.01;
|
||||||
|
|
||||||
if($progressCalculated > doubleval($task->progress)){
|
if($progressCalculated > doubleval($task->progress)){
|
||||||
$badgeColorClass.= 'badge-danger';
|
$badgeClass.= 'badge-danger';
|
||||||
}
|
}
|
||||||
elseif($progressCalculated * $warningRatio >= doubleval($task->progress)){ // warning if close at 1%
|
elseif($progressCalculated * $warningRatio >= doubleval($task->progress)){ // warning if close at 1%
|
||||||
$badgeColorClass.= 'badge-warning';
|
$badgeClass.= 'badge-warning';
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
$badgeColorClass.= 'badge-success';
|
$badgeClass.= 'badge-success';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$title = '';
|
||||||
|
if(!empty($tooltip)){
|
||||||
|
$badgeClass.= ' classfortooltip';
|
||||||
|
$title = 'title="'.dol_htmlentities($tooltip).'"';
|
||||||
|
}
|
||||||
|
|
||||||
if(empty($label)){
|
if(empty($label)){
|
||||||
$label = $task->progress.' %';
|
$label = $task->progress.' %';
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!empty($label)){
|
if(!empty($label)){
|
||||||
$out = '<span class="'.$badgeColorClass.'" >'.$label.'</span>';
|
$out = '<span class="'.$badgeClass.'" '.$title.' >'.$label.'</span>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $out;
|
return $out;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -86,4 +86,3 @@ $badgeStatus6='#cad2d2';
|
|||||||
$badgeStatus7='#baa32b';
|
$badgeStatus7='#baa32b';
|
||||||
$badgeStatus8='#be3013';
|
$badgeStatus8='#be3013';
|
||||||
$badgeStatus9='#e7f0f0';
|
$badgeStatus9='#e7f0f0';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user