Skip to content

Commit

Permalink
[Accident] fix: porgress bar and accident_type
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-eoxia committed Dec 14, 2021
1 parent 4666ec9 commit 2fcb255
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion accident_list.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,15 @@
$arrayAccident = array();
$arrayAccident[] = $accident->ref;
$arrayAccident[] = $accident->label;
$arrayAccident[] = $accident->accident_type;
$arrayAccident[] = $accident->accident_date;
$arrayAccident[] = $accident->description;
$arrayAccident[] = $accident->photo;
$arrayAccident[] = $accident->fk_element;
if (empty($accident->external_accident)) {
$arrayAccident[] = $accident->fk_element;
} else {
$arrayAccident[] = $accident->fk_soc;
}
$arrayAccident[] = $accident->fk_user_victim;

$maxnumber = count($arrayAccident);
Expand All @@ -453,6 +458,13 @@
elseif ($key == 'accident_date') {
print dol_print_date($accident->accident_date, 'dayhour', 'tzserver'); // We suppose dates without time are always gmt (storage of course + output)
}
elseif ($key == 'accident_type') {
if ($accident->accident_type == 0) {
print $langs->trans('WorkAccidentStatement');
} elseif ($accident->accident_type == 1) {
print $langs->trans('CommutingAccident');
}
}
else print $accident->showOutputField($val, $key, $accident->$key, '');
print '</td>';
if (!$i) $totalarray['nbfield']++;
Expand Down

0 comments on commit 2fcb255

Please sign in to comment.