Skip to content

Commit

Permalink
Merge pull request #17 from evarisk-kilyan/fix_php_8
Browse files Browse the repository at this point in the history
#16 [Digiboard] fix: array not created and key not set
  • Loading branch information
nicolas-eoxia authored Dec 19, 2024
2 parents 602c34a + 09e7313 commit 0f0d0d4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions class/digiboarddashboard.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function getDigiRiskStatsList(): array
$arrayDigiRiskStatsList = [];
$filter = '';
$riskAssessmentCotation = [1 => 'GreyRisk', 2 => 'OrangeRisk', 3 => 'RedRisk', 4 => 'BlackRisk'];
$sharingEntities = $mc->sharings['digiriskstats'];
$sharingEntities = $mc->sharings['digiriskstats'] ?? [];
$entities = $mc->getEntitiesList(false, false, true);
if (!empty($sharingEntities)) {
$currentEntity[] = 1;
Expand Down Expand Up @@ -138,7 +138,7 @@ public function getDigiRiskStatsList(): array
for ($i = 1; $i <= 4; $i++) {
if ($i == 4) {
$percent = $getRisksByCotation[$i] > 0 ? round($getRisksByCotation[$i] * 100 / array_sum($getRisksByCotation), 1) : 0;
$arrayDigiRiskStatsList[$entityID][$riskAssessmentCotation[$i]]['value'] .= "
$arrayDigiRiskStatsList[$entityID][$riskAssessmentCotation[$i]]['value'] = "
<div class='flex justify-center items-center' style='gap: 0.2em;'>
<span class='width50p right'>$getRisksByCotation[$i]</span>
<span class='width50p left' style='font-size: 0.75em;'>($percent%)</span>
Expand Down

0 comments on commit 0f0d0d4

Please sign in to comment.