FIX total line for extrafields
This commit is contained in:
parent
7ec32d2458
commit
235641e2df
@ -1028,6 +1028,18 @@ function projectLinesa(&$inc, $parent, &$lines, &$level, $var, $showproject, &$t
|
||||
if (count($arrayfields) > 0 && !empty($arrayfields['c.assigned']['checked'])) {
|
||||
print '<td></td>';
|
||||
}
|
||||
|
||||
//Check if Extrafields is totalizable
|
||||
foreach ($extrafields->attributes['projet_task']['totalizable'] as $key=>$value){
|
||||
if ($arrayfields['ef.'.$key]['checked'] == 1){
|
||||
print '<td align="right">';
|
||||
if ($value == 1){
|
||||
print $totalarray['totalizable'][$key]['total'];
|
||||
}
|
||||
print '</td>';
|
||||
}
|
||||
}
|
||||
|
||||
print '<td class=""></td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@ -1342,6 +1342,13 @@ while ($i < $imaxinloop) {
|
||||
}
|
||||
|
||||
// Show total line
|
||||
if (!empty($totalarray['totalizable']) && is_array($totalarray['totalizable'])) {
|
||||
foreach ($totalarray['totalizable'] as $keytotalizable => $valtotalizable) {
|
||||
$totalarray['pos'][$valtotalizable['pos']] = $keytotalizable;
|
||||
$totalarray['val'][$keytotalizable] = $valtotalizable['total'];
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['totalplannedworkloadfield']) || isset($totalarray['totalprogress_calculatedfield'])
|
||||
|| isset($totalarray['totaltobill']) || isset($totalarray['totalbilled']) || isset($totalarray['totalbudget'])) {
|
||||
print '<tr class="liste_total">';
|
||||
@ -1368,7 +1375,15 @@ if (isset($totalarray['totaldurationeffectivefield']) || isset($totalarray['tota
|
||||
print '<td class="center">'.convertSecondToTime($totalarray['totalbilled'], $plannedworkloadoutputformat).'</td>';
|
||||
} elseif ($totalarray['totalbudget_amountfield'] == $i) {
|
||||
print '<td class="center">'.price($totalarray['totalbudgetamount'], 0, $langs, 1, 0, 0, $conf->currency).'</td>';
|
||||
} else {
|
||||
} else if (!empty($totalarray['pos'][$i])) {
|
||||
print '<td class="right">';
|
||||
if (isset($totalarray['type']) && $totalarray['type'][$i] == 'duration') {
|
||||
print (!empty($totalarray['val'][$totalarray['pos'][$i]])?convertSecondToTime($totalarray['val'][$totalarray['pos'][$i]], 'allhourmin'):0);
|
||||
} else {
|
||||
print price(!empty($totalarray['val'][$totalarray['pos'][$i]])?$totalarray['val'][$totalarray['pos'][$i]]:0);
|
||||
}
|
||||
print '</td>';
|
||||
}else {
|
||||
print '<td></td>';
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user