From 9313aabd5c65707b25e60df0763bedf4fe5c7885 Mon Sep 17 00:00:00 2001 From: kadogo Date: Tue, 28 Jan 2020 19:28:09 +0100 Subject: [PATCH] NEW Add duration information for fichinter --- htdocs/projet/element.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index 50942b8b363..38d078321e1 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -826,6 +826,14 @@ foreach ($listofreferent as $key => $value) elseif (in_array($tablename, array('expensereport_det', 'don', 'projet_task', 'stock_mouvement', 'payment_salary'))) print $langs->trans("User"); else print $langs->trans("ThirdParty"); print ''; + // Duration of intervention + if($tablename == 'fichinter') + { + print ''; + print $langs->trans("TotalDuration"); + $total_duration = 0; + print ''; + } // Amount HT //if (empty($value['disableamount']) && ! in_array($tablename, array('projet_task'))) print ''.$langs->trans("AmountHT").''; //elseif (empty($value['disableamount']) && in_array($tablename, array('projet_task'))) print ''.$langs->trans("Amount").''; @@ -1024,6 +1032,15 @@ foreach ($listofreferent as $key => $value) } print ''; + // Add duration and store it in counter for fichinter + if($tablename == 'fichinter') + { + print ''; + print convertSecondToTime($element->duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY); + $total_duration += $element->duration; + print ''; + } + // Amount without tax $warning = ''; if (empty($value['disableamount'])) @@ -1201,6 +1218,8 @@ foreach ($listofreferent as $key => $value) } //if (empty($value['disableamount']) && ! in_array($tablename, array('projet_task'))) print ''.$langs->trans("TotalHT").' : '.price($total_ht).''; //elseif (empty($value['disableamount']) && in_array($tablename, array('projet_task'))) print ''.$langs->trans("Total").' : '.price($total_ht).''; + // If fichinter add the total_duration + if($tablename == 'fichinter') print ''.convertSecondToTime($total_duration, 'all', $conf->global->MAIN_DURATION_OF_WORKDAY).''; print ''; if (empty($value['disableamount'])) {