Fix: Bad calculation of total
Fix: Warning message not translated
This commit is contained in:
parent
f0ebd7721d
commit
015b0d8036
1
htdocs/.gitignore
vendored
1
htdocs/.gitignore
vendored
@ -2,6 +2,7 @@
|
||||
/custom*
|
||||
/extensions*
|
||||
/nltechno*
|
||||
/teclib*
|
||||
/bootstrap*
|
||||
/google*
|
||||
/multicompany*
|
||||
|
||||
@ -228,7 +228,14 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
|
||||
$numlines=count($lines);
|
||||
|
||||
$total=0;
|
||||
// We declare counter as global because we want to edit them into recursive call
|
||||
global $total_projectlinesa_spent,$total_projectlinesa_planned,$total_projectlinesa_spent_if_planned;
|
||||
if ($level == 0)
|
||||
{
|
||||
$total_projectlinesa_spent=0;
|
||||
$total_projectlinesa_planned=0;
|
||||
$total_projectlinesa_spent_if_planned=0;
|
||||
}
|
||||
|
||||
for ($i = 0 ; $i < $numlines ; $i++)
|
||||
{
|
||||
@ -293,8 +300,8 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
|
||||
if ($showproject)
|
||||
{
|
||||
// Project ref
|
||||
print "<td>";
|
||||
//var_dump($taskrole);
|
||||
if ($showlineingray) print '<i>';
|
||||
$projectstatic->id=$lines[$i]->fk_project;
|
||||
$projectstatic->ref=$lines[$i]->projectref;
|
||||
@ -390,7 +397,9 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
$level++;
|
||||
if ($lines[$i]->id) projectLinesa($inc, $lines[$i]->id, $lines, $level, $var, $showproject, $taskrole, $projectsListId, $addordertick);
|
||||
$level--;
|
||||
$total += $lines[$i]->duration;
|
||||
$total_projectlinesa_spent += $lines[$i]->duration;
|
||||
$total_projectlinesa_planned += $lines[$i]->planned_workload;
|
||||
if ($lines[$i]->planned_workload) $total_projectlinesa_spent_if_planned += $lines[$i]->duration;
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -399,7 +408,7 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
}
|
||||
}
|
||||
|
||||
if ($total>0 && $level==0)
|
||||
if (($total_projectlinesa_planned > 0 || $total_projectlinesa_spent > 0) && $level==0)
|
||||
{
|
||||
print '<tr class="liste_total">';
|
||||
print '<td class="liste_total">'.$langs->trans("Total").'</td>';
|
||||
@ -407,10 +416,16 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td align="center" class="nowrap liste_total">';
|
||||
print convertSecondToTime($total_projectlinesa_planned, 'allhourmin');
|
||||
print '</td>';
|
||||
print '<td></td>';
|
||||
print '<td></td>';
|
||||
print '<td align="right" class="nowrap liste_total">'.convertSecondToTime($total, 'allhourmin').'</td>';
|
||||
print '<td></td>';
|
||||
print '<td align="right" class="nowrap liste_total">';
|
||||
print convertSecondToTime($total_projectlinesa_spent, 'allhourmin');
|
||||
print '</td>';
|
||||
print '<td align="right" class="nowrap liste_total">';
|
||||
if ($total_projectlinesa_planned) print round(100 * $total_projectlinesa_spent_if_planned / $total_projectlinesa_planned,2).' %';
|
||||
print '</td>';
|
||||
if ($addordertick) print '<td class="hideonsmartphone"></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -146,3 +146,5 @@ WarningCloseAlways=Warning, closing is done even if amount differs between sourc
|
||||
WarningUsingThisBoxSlowDown=Warning, using this box slow down seriously all pages showing the box.
|
||||
WarningClickToDialUserSetupNotComplete=Setup of ClickToDial information for your user are not complete (see tab ClickToDial onto your user card).
|
||||
WarningNotRelevant=Irrelevant operation for this dataset
|
||||
WarningTooManyDataPleaseUseMoreFilters=Too many data. Please use more filters
|
||||
|
||||
|
||||
@ -164,9 +164,10 @@ if ( $resql )
|
||||
|
||||
if ($num > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
|
||||
{
|
||||
/* print '<tr '.$bc[0].'>';
|
||||
/* $langs->load("errors");
|
||||
print '<tr '.$bc[0].'>';
|
||||
print '<td colspan="9">';
|
||||
print $langs->trans("TooManyDataPleaseUseMoreFilters");
|
||||
print $langs->trans("WarningTooManyDataPleaseUseMoreFilters");
|
||||
print '</td></tr>';*/
|
||||
}
|
||||
else
|
||||
|
||||
@ -121,9 +121,10 @@ print "</tr>\n";
|
||||
|
||||
if (count($tasksarray) > (empty($conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA)?1000:$conf->global->PROJECT_LIMIT_TASK_PROJECT_AREA))
|
||||
{
|
||||
$langs->load("errors");
|
||||
print '<tr '.$bc[0].'>';
|
||||
print '<td colspan="9">';
|
||||
print $langs->trans("TooManyDataPleaseUseMoreFilters");
|
||||
print $langs->trans("WarningTooManyDataPleaseUseMoreFilters");
|
||||
print '</td></tr>';
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user