forked from Evarisk/Digirisk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Evarisk#3682 [Class] fix: add gauge on widgets on legal display and i…
…nformation sharing
- Loading branch information
1 parent
4d3e0d9
commit 006f9a3
Showing
4 changed files
with
172 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
core/tpl/digiriskdolibarr_informationssharing_percentages.tpl.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
<?php | ||
/* Copyright (C) 2024 EVARISK <[email protected]> | ||
* | ||
* 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 | ||
* the Free Software Foundation; either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <https://www.gnu.org/licenses/>. | ||
* or see https://www.gnu.org/ | ||
*/ | ||
|
||
// foreach to recolt all the values | ||
foreach ($labourDoctor as $value) { | ||
$labourDoctorTotal++; | ||
if (dol_strlen($value) > 0) { | ||
$LabourDoctorCheck++; | ||
} | ||
} | ||
|
||
foreach ($detectiveWork as $value) { | ||
$detectiveWorkTotal++; | ||
if (dol_strlen($value) > 0) { | ||
$detectiveWorkCheck++; | ||
} | ||
} | ||
|
||
foreach ($harassmentOfficer as $value) { | ||
$harassmentOfficerTotal++; | ||
if (dol_strlen($value) > 0) { | ||
$harassmentOfficerCheck++; | ||
} | ||
} | ||
|
||
foreach ($deleguePersonnel as $value) { | ||
$deleguePersonnelTotal++; | ||
if (dol_strlen($value) > 0) { | ||
$deleguePersonnelCheck++; | ||
} | ||
} | ||
|
||
foreach ($membreComitee as $value) { | ||
$membreComiteeTotal++; | ||
if (dol_strlen($value) > 0) { | ||
$membreComiteeCheck++; | ||
} | ||
} | ||
|
||
// calculs for the percentage of the gauge | ||
$percentageLabourDoctor = $LabourDoctorCheck / $labourDoctorTotal * 100; | ||
$percentageDetectiveWork = $detectiveWorkCheck / $detectiveWorkTotal * 100; | ||
$percentageHarassmentOfficer = $harassmentOfficerCheck / $harassmentOfficerTotal * 100; | ||
$percentageDeleguePersonnel = $deleguePersonnelCheck / $deleguePersonnelTotal * 100; | ||
$percentageMembreComitee = $membreComiteeCheck / $membreComiteeTotal * 100; |
Oops, something went wrong.