From e45ef2c8a34fe3ff62bea8dc18d05b641595d675 Mon Sep 17 00:00:00 2001 From: evarisk-kilyan Date: Thu, 5 Dec 2024 11:14:02 +0100 Subject: [PATCH] #18 [Dashboard] add: next generate date and reword total --- class/digiboarddashboard.class.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/class/digiboarddashboard.class.php b/class/digiboarddashboard.class.php index 3c51a61..0ecbc1e 100644 --- a/class/digiboarddashboard.class.php +++ b/class/digiboarddashboard.class.php @@ -75,7 +75,7 @@ public function getDigiRiskStatsList(): array // Graph parameters $array['type'] = 'list'; - $array['labels'] = ['Site', 'Siret', 'RiskAssessmentDocument', 'DelayGenerateDate', 'NbEmployees', 'NbEmployeesInvolved', 'GreyRisk', 'OrangeRisk', 'RedRisk', 'BlackRisk']; + $array['labels'] = ['Site', 'Siret', 'RiskAssessmentDocument', 'NextGenerateDate', 'DelayGenerateDate', 'NbEmployees', 'NbEmployeesInvolved', 'GreyRisk', 'OrangeRisk', 'RedRisk', 'BlackRisk']; if (getDolGlobalInt('DIGIBOARD_DIGIRISIK_STATS_LOAD_ACCIDENT') > 0) { $array['labels'][] = ['NbPresquAccidents', 'NbAccidents', 'NbAccidentsByEmployees', 'NbAccidentInvestigations', 'WorkStopDays', 'FrequencyIndex', 'FrequencyRate', 'GravityRate']; } @@ -123,6 +123,7 @@ public function getDigiRiskStatsList(): array $moreParam['filter'] = $filterEntity; $arrayGetGenerationDateInfos = $riskAssessmentDocument->getGenerationDateInfos($moreParam); $arrayDigiRiskStatsList[$entityID]['RiskAssessmentDocument']['value'] = $arrayGetGenerationDateInfos['lastgeneratedate'] . $arrayGetGenerationDateInfos['moreContent']; + $arrayDigiRiskStatsList[$entityID]['NextGenerateDate']['value'] = $arrayGetGenerationDateInfos['nextgeneratedate']; $arrayDigiRiskStatsList[$entityID]['DelayGenerateDate']['value'] = $arrayGetGenerationDateInfos['delaygeneratedate']; $moreParam['filter'] = ' AND u.entity IN (0,' . $entityID . ')'; @@ -175,17 +176,14 @@ public function getDigiRiskStatsList(): array } } - $totalValue = ['Site' => ['value' => $langs->transnoentities('Total'), 'morecss' => 'bold'], 'Siret' => ['value' => ''], 'RiskAssessmentDocument' => ['value' => ''], 'DelayGenerateDate' => ['value' => ''], 'NbEmployees' => ['value' => ''], 'NbEmployeesInvolved' => ['value' => '']]; + $totalValue = ['Site' => ['value' => $langs->transnoentities('Total'), 'morecss' => 'bold']]; $totalValue['NbEmployees']['value'] = $total['nbEmployees']; for ($i = 1; $i <= 4; $i++) { $totalValue[$riskAssessmentCotation[$i]]['value'] = $total[$i]; $totalValue[$riskAssessmentCotation[$i]]['morecss'] = 'risk-evaluation-cotation'; $totalValue[$riskAssessmentCotation[$i]]['moreAttr'] = 'data-scale=' . $i . ' style="line-height: 0; border-radius: 0;"'; } - if (getDolGlobalInt('DIGIBOARD_DIGIRISIK_STATS_LOAD_ACCIDENT')) { - $totalValue = array_merge($totalValue, ['NbPresquAccidents' => ['value' => ''], 'NbAccidents' => ['value' => ''], 'NbAccidentsByEmployees' => ['value' => ''], 'NbAccidentInvestigations' => ['value' => ''], 'WorkStopDays' => ['value' => ''], 'FrequencyIndex' => ['value' => ''], 'FrequencyRate' => ['value' => ''], 'GravityRate' => ['value' => '']]); - } - $arrayDigiRiskStatsList[] = $totalValue; + $arrayDigiRiskStatsList['Total'] = $totalValue; } $array['data'] = $arrayDigiRiskStatsList;