Commit 2d847cec authored by Alexis Thinardon's avatar Alexis Thinardon

Multi fix on users collectivity show, domain are now counted on bilan and fix...

Multi fix on users collectivity show, domain are now counted on bilan and fix mesurement actions list
parent 13449384
Pipeline #11335 passed with stages
in 5 minutes and 26 seconds
CHANGELOG
=========
## [1.7.11] - 2020-10-16
### Changement
- Correctif bug utilisateur archivé visible dans la liste "Ma collectivité" #295
- Dans le bilan chapitre 4.1 le nombre de domaine est désormais calculé
- Correctif sur la liste des plans d'actions qui affiche bien les actions de protections non planifiées et non appliquées
## [1.7.10] - 2020-10-12
### Changement
- Correctif des cases à cocher (Mesures de sécurité et confidentialité) lors de la modification d'un traitement.
......
parameters:
app.version: 1.7.10
app.version: 1.7.11
framework:
secret: '%env(APP_SECRET)%'
......
......@@ -191,12 +191,9 @@ class MesurementController extends CRUDController
public function actionPlanAction()
{
$request = $this->requestStack->getCurrentRequest();
// Since we have to display planified & not-applied mesurement, filter
$criteria = $this->getRequestCriteria($request);
$criteria = $criteria + ['status' => MesurementStatusDictionary::STATUS_NOT_APPLIED];
return $this->render('Registry/Mesurement/action_plan.html.twig', [
'totalItem' => $this->repository->count($criteria),
'totalItem' => $this->repository->count($this->getRequestCriteria($request)),
'route' => $this->router->generate('registry_mesurement_list_datatables', ['action_plan' => true]),
]);
}
......@@ -302,7 +299,9 @@ class MesurementController extends CRUDController
}
if ($request->query->getBoolean('action_plan')) {
// Since we have to display planified & not-applied mesurement, filter
$criteria['planificationDate'] = 'null';
$criteria['status'] = MesurementStatusDictionary::STATUS_NOT_APPLIED;
}
return $criteria;
......
......@@ -40,13 +40,33 @@ class MaturityGenerator extends AbstractGenerator implements ImpressionGenerator
public function addGlobalOverview(Section $section, array $data): void
{
if (empty($data)) {
$section->addTextBreak(2);
$section->addText("Aucune évaluation de la mise en conformité n'a pour l'heure été effectuée.", ['italic' => true]);
return;
}
$maturityList = [];
$domainsName = [];
if (isset($data['old'])) {
foreach ($data['old']->getMaturity() as $maturity) {
$maturityList[$maturity->getDomain()->getPosition()]['old'] = $maturity->getScore();
if (!isset($domainsName[$maturity->getDomain()->getPosition()])) {
$domainsName[$maturity->getDomain()->getPosition()] = $maturity->getDomain()->getName();
}
}
}
foreach ($data['new']->getMaturity() as $maturity) {
$maturityList[$maturity->getDomain()->getPosition()]['new'] = $maturity->getScore();
if (!isset($domainsName[$maturity->getDomain()->getPosition()])) {
$domainsName[$maturity->getDomain()->getPosition()] = $maturity->getDomain()->getName();
}
}
$section->addTitle('Évaluation de la mise en conformité', 2);
$section->addText('Afin de répondre aux objectifs du RGPD, la gestion des données à caractère personnel est structurée en 6 domaines.');
$section->addText('Chacun des 6 domaines a été évalué par la collectivité selon l’échelle de maturité ci-après.');
$section->addText('Afin de répondre aux objectifs du RGPD, la gestion des données à caractère personnel est structurée en ' . \count($domainsName) . ' domaines.');
$section->addText('Chacun des ' . \count($domainsName) . ' domaines a été évalué par la collectivité selon l’échelle de maturité ci-après.');
$table = $section->addTable($this->tableStyle);
$row = $table->addRow(200, ['valign' => 'center']);
......@@ -87,60 +107,39 @@ class MaturityGenerator extends AbstractGenerator implements ImpressionGenerator
$serie2 = [];
// Radar
if (empty($data)) {
$section->addTextBreak(2);
$section->addText("Aucune évaluation de la mise en conformité n'a pour l'heure été effectuée.", ['italic' => true]);
} else {
$maturityList = [];
$domainsName = [];
if (isset($data['old'])) {
foreach ($data['old']->getMaturity() as $maturity) {
$maturityList[$maturity->getDomain()->getPosition()]['old'] = $maturity->getScore();
if (!isset($domainsName[$maturity->getDomain()->getPosition()])) {
$domainsName[$maturity->getDomain()->getPosition()] = $maturity->getDomain()->getName();
}
}
}
foreach ($data['new']->getMaturity() as $maturity) {
$maturityList[$maturity->getDomain()->getPosition()]['new'] = $maturity->getScore();
if (!isset($domainsName[$maturity->getDomain()->getPosition()])) {
$domainsName[$maturity->getDomain()->getPosition()] = $maturity->getDomain()->getName();
}
}
\ksort($maturityList);
\ksort($domainsName);
\ksort($maturityList);
\ksort($domainsName);
foreach ($maturityList as $score) {
if (isset($score['old'])) {
$serie2[] = $score['old'] / 10;
}
$serie1[] = $score['new'] / 10;
foreach ($maturityList as $score) {
if (isset($score['old'])) {
$serie2[] = $score['old'] / 10;
}
// Display
$section->addTitle("Résultat de l'évaluation du {$data['new']->getCreatedAt()->format('d/m/Y')}", 2);
$serie1[] = $score['new'] / 10;
}
// Display
$section->addTitle("Résultat de l'évaluation du {$data['new']->getCreatedAt()->format('d/m/Y')}", 2);
$chart = $section->addChart(
'radar',
$domainsName,
$serie1,
[
'height' => Converter::cmToEmu(11),
'width' => Converter::cmToEmu(15),
'3d' => true,
]
);
if (!empty($serie2)) {
$chart->addSeries(\array_keys($maturityList), $serie2, $data['old']->getCreatedAt()->format('d/m/Y'));
}
$table = $section->addTable(['unit' => TblWidth::PERCENT, 'width' => 5000]);
$row = $table->addRow();
if (!empty($serie2)) {
$cell = $row->addCell(2500);
$cell->addText(" {$data['old']}", ['color' => 'b30000']);
}
$chart = $section->addChart(
'radar',
$domainsName,
$serie1,
[
'height' => Converter::cmToEmu(11),
'width' => Converter::cmToEmu(15),
'3d' => true,
]
);
if (!empty($serie2)) {
$chart->addSeries(\array_keys($maturityList), $serie2, $data['old']->getCreatedAt()->format('d/m/Y'));
}
$table = $section->addTable(['unit' => TblWidth::PERCENT, 'width' => 5000]);
$row = $table->addRow();
if (!empty($serie2)) {
$cell = $row->addCell(2500);
$cell->addText("{$data['new']}", ['align' => 'right', 'color' => '3c8dbc']);
$cell->addText("{$data['old']}", ['color' => 'b30000']);
}
$cell = $row->addCell(2500);
$cell->addText("{$data['new']}", ['align' => 'right', 'color' => '3c8dbc']);
}
/**
......
......@@ -386,7 +386,7 @@
</tr>
</thead>
<tbody>
{% for user in object.users %}
{% for user in object.users|filter(u => u.deletedAt is null) %}
<tr>
<td>{{ user.firstName }}</td>
<td>{{ user.lastName }}</td>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment