Update card.php
This code generates two rows of a table to display the total duration of an employee, one in time format (DD HH:MM) and the other in hour format (HH). The first row (original code) displays the title "TotalDurationTime" using the "trans" method of the $langs object to translate the string. The total time is converted to HH:MM:SS format using the "convertSecondToTime" function, which takes into account the daily work time duration specified in the global variable $conf->global->MAIN_DURATION_OF_WORKDAY. The second row displays the title "TotalDurationHour" using the "trans" method of the $langs object to translate the string. The total duration is converted to hours using the "convertDurationtoHour" function, specifying "s" as the time unit (seconds).
This commit is contained in:
parent
cc17467f3b
commit
f9ed6ff4f3
@ -9,6 +9,7 @@
|
||||
* Copyright (C) 2015-2016 Abbes Bahfir <bafbes@gmail.com>
|
||||
* Copyright (C) 2018-2022 Philippe Grand <philippe.grand@atoo-net.com>
|
||||
* Copyright (C) 2020 Frédéric France <frederic.france@netlogic.fr>
|
||||
* Copyright (C) 2023 Benjamin Grembi <benjamin@oarces.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -1275,10 +1276,14 @@ if ($action == 'create') {
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
|
||||
// Duration
|
||||
print '<tr><td class="titlefield">'.$langs->trans("TotalDuration").'</td>';
|
||||
// Duration in time
|
||||
print '<tr><td class="titlefield">'.$langs->trans("TotalDurationTime").'</td>';
|
||||
print '<td>'.convertSecondToTime($object->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).'</td>';
|
||||
print '</tr>';
|
||||
// Duration in hour format
|
||||
print '<tr><td class="titlefield">'.$langs->trans("TotalDurationHour").'</td>';
|
||||
print '<td>'.convertDurationtoHour($object->duration, "s").' '.$langs->trans("h").'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user