{% extends 'base.html.twig' %}
{% block title %}
{{ parent() }} - {{ 'accueil'|trans }}
{% endblock %}
{% block body %}
{{ parent() }}
{% endblock %}
{% block content %}
<div class="bg-dark">
<div class="container m-b-30">
<div class="row">
<div class="col-md-8 text-white p-t-40 p-b-90">
<h5>{{ 'outil_daide_la_mise_en_conformit_au'|trans }}</h5>
{% if app.request.locale == "fr" %}
<h3><span class="text-primary">R</span>èglement <span class="text-primary">G</span>énéral sur la <span class="text-primary">P</span>rotection des <span class="text-primary">D</span>onnées</h3>
<a href="https://www.cnil.fr/fr/reglement-europeen-protection-donnees" target="_blank">Consulter le règlement</a>
{% else %}
<h3><span class="text-primary">G</span>eneral <span class="text-primary">D</span>ata <span class="text-primary">P</span>rotection <span class="text-primary">R</span>egulation</h3>
<a href="https://www.cnil.fr/fr/reglement-europeen-protection-donnees" target="_blank">Consult GDPR</a>
{% endif %}
<br/>
<br/>
<p class="h5 mt-2">{{ 'crdit_temps_expert_heures'|trans({'%credit%': app.user.user.credit|format_credit_number}) }}</p>
{% if formChildrenUsers %}
{{ form_start(formChildrenUsers) }}
{{ form_widget(formChildrenUsers.comptes, {"attr": {"onchange": "selectAccount(this)"}}) }}
{{ form_end(formChildrenUsers) }}
{% endif %}
<button class="btn btn-warning mt-2" data-toggle="modal" data-target="#ExportModal"><i class="mdi mdi-printer"></i> {{ 'imprimer_le_tableau_de_bord'|trans }}</button>
</div>
<div class="col-md-4 my-auto text-md-right p-t-20 p-b-90 d-none d-md-block">
<div>
<div class="avatar mr-3 avatar-xxl">
{{ get_user_avatar(app.user.user)|raw }}
{#<span class="avatar-title rounded-circle">{{ app.user.user.contactFirstName|slice(0,1)|upper }}{{ app.user.user.contactLastName|slice(0,1)|upper }}</span>#}
</div>
</div>
<h5 class="text-white m-t-1 pr-4">
{{ app.user.user.companyName }}
</h5>
</div>
</div>
</div>
</div>
<div class="container pull-up">
<div class="row">
<div class="col-md-3 col-sm-6 col-12 m-b-30">
<div class="card">
<div class="card-header">
<div class="card-title m-b-0">{{ 'traitements'|trans }}</div>
</div>
<div class="card-body">
{% if treatmentsStats.total > 0 %}
<div class="chart">
<canvas id="chartjs-01" class="chart-canvas" height="250"></canvas>
</div>
{% else %}
<p><a href="{{ path("user_treatments_add") }}">{{ 'aucun_traitement_identifi_cliquezici_pour_crer_vot'|trans }}</a></p>
{% endif %}
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-12 m-b-30">
<div class="card">
<div class="card-header">
<div class="card-title m-b-0">{{ 'pia'|trans }}</div>
</div>
<div class="card-body">
{% if treatmentsPiaStats.total > 0 %}
<div class="chart">
<canvas id="chartjs-02" class="chart-canvas" height="250"></canvas>
</div>
{% else %}
{% if treatmentsStats.total > 0 %}
<p><a href="{{ path("user_treatments_add") }}">{{ 'vous_navez_pas_rdig_de_pia_analyse_dimpact'|trans }}</a></p>
{% else %}
<p><a href="{{ path("user_treatments_add") }}">{{ 'aucun_traitement_identifi_cliquezici_pour_crer_vot'|trans }}</a></p>
{% endif %}
{% endif %}
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-12 m-b-30">
<div class="card">
<div class="card-header">
<div class="card-title m-b-0">{{ 'sous_traitants'|trans }}</div>
</div>
<div class="card-body">
{% if subcontractorsStats.total > 0 %}
<div class="chart">
<canvas id="chartjs-03" class="chart-canvas" height="250"></canvas>
</div>
{% else %}
<p><a href="{{ path("user_subcontractors_add") }}">{{ 'aucun_soustraitant_identifi_cliquezici_pour_crer_v'|trans }}</a></p>
{% endif %}
</div>
</div>
</div>
<div class="col-md-3 col-sm-6 col-12 m-b-30">
<div class="card">
<div class="card-header">
<div class="card-title m-b-0">{{ 'actions'|trans }}</div>
</div>
<div class="card-body">
{% if actionsStats.total > 0 %}
<div class="chart">
<canvas id="chartjs-04" class="chart-canvas" height="250"></canvas>
</div>
{% else %}
<p><a href="{{ path("user_actions_add") }}">{{ 'aucune_action_identifie_cliquezici_pour_crer_votre'|trans }}</a></p>
{% endif %}
</div>
</div>
</div>
<div class="col-sm-6 col-12 m-b-30">
<div class="card card-dashboard">
<div class="card-header card-header-dashboard">
<div class="card-title m-b-0">{{ 'actions_raliser_sous_30_jours'|trans }}</div>
</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>{{ 'action'|trans }}</th>
<th>{{ 'responsable'|trans }}</th>
<th>{{ 'date_de_mise_en_place'|trans }}</th>
</tr>
</thead>
<tbody>
{% for action in actionsToTreat %}
<tr>
<td><a href="{{ path('user_actions_edit', {"id": action.id}) }}">{{ action.name }}</a></td>
<td><a href="{{ path('user_actions_edit', {"id": action.id}) }}">{{ action.accountantLastName }} {{ action.accountantFirstName }}</a></td>
<td><a href="{{ path('user_actions_edit', {"id": action.id}) }}">{{ action.setUpDate|date('d/m/Y') }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-6 col-12 m-b-30">
<div class="card card-dashboard">
<div class="card-header card-header-dashboard">
<div class="card-title m-b-0">{{ 'incidents_traiter'|trans }}</div>
</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>{{ 'dlai_de_72h'|trans }}</th>
<th>{{ 'nature'|trans }}</th>
<th>{{ 'date'|trans }}</th>
</tr>
</thead>
<tbody>
{% for incident in incidentsToTreat %}
<tr>
<td><a href="{{ path('user_incidents_edit', {"id": incident.id}) }}">{% if incident.notice72H %}{{ 'oui'|trans }}{% else %}{{ 'non'|trans }}{% endif %}</a></td>
<td><a href="{{ path('user_incidents_edit', {"id": incident.id}) }}">{{ incident.type }}</a></td>
<td><a href="{{ path('user_incidents_edit', {"id": incident.id}) }}">{{ incident.date|date('d/m/Y') }}</a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-6 col-12 m-b-30">
<div class="card card-dashboard">
<div class="card-header card-header-dashboard">
<div class="card-title m-b-0">{{ 'demandes_dexercices_de_droits_traiter'|trans }}</div>
</div>
<div class="card-body">
<table class="table">
<thead>
<tr>
<th>{{ 'date_de_la_demande'|trans }}</th>
<th>{{ 'droit'|trans }}</th>
<th>{{ 'personne_concerne'|trans }}</th>
<th>{{ 'dlai_de_30_jours'|trans }}</th>
</tr>
</thead>
<tbody>
{% for exercisingclaim in exercisingClaimRequestsToTreat %}
<tr>
<td>
<a href="{{ path('user_exercisingclaims_edit', {"id": exercisingclaim.id}) }}">
{% if exercisingclaim.requestDate %}{{ exercisingclaim.requestDate|date('d/m/Y H:i') }}{% endif %}
</a>
</td>
<td>
<a href="{{ path('user_exercisingclaims_edit', {"id": exercisingclaim.id}) }}">
{% if exercisingclaim.rights == "acces" %}
{{ 'accs'|trans }}
{% elseif exercisingclaim.rights == "rectification" %}
{{ 'rectification'|trans }}
{% elseif exercisingclaim.rights == "effacement" %}
{{ 'effacement'|trans }}
{% elseif exercisingclaim.rights == "limitation" %}
{{ 'limitation'|trans }}
{% elseif exercisingclaim.rights == "portabilite" %}
{{ 'portabilit'|trans }}
{% elseif exercisingclaim.rights == "opposition" %}
{{ 'opposition'|trans }}
{% endif %}
</a>
</td>
<td><a href="{{ path('user_exercisingclaims_edit', {"id": exercisingclaim.id}) }}">{{ exercisingclaim.customer }}</a></td>
<td>
<a href="{{ path('user_exercisingclaims_edit', {"id": exercisingclaim.id}) }}">
{% if exercisingclaim.answerDate %}
<span class="badge badge-success">{{ 'valid'|trans }}</span>
{% else %}
<span class="badge badge-danger">{{ 'en_cours'|trans }}</span>
{% if exercisingclaim.requestDate %}
{% set difference = date().diff(date(exercisingclaim.requestDate)) %}
{% set leftDays = difference.days %}
{% if leftDays > 30 %}
<span class="badge badge-warning">{{ 'dpass'|trans }}</span>
{% endif %}
{% endif %}
{% endif %}
</a>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
<div class="col-sm-6 col-12 m-b-30">
<div class="card card-dashboard">
<div class="card-header card-header-dashboard">
<div class="card-title m-b-0">{{ 'niveau_de_sensibilisation_des_quipes'|trans }}</div>
</div>
{% if trainingsTotal > 0 %}
<div class="card-body ">
<div class="p-t-15 p-b-15 border-bottom border-bottom-dashed">
<div class="row ">
<div class="col-md-7">
<h6 class="">{{ 'personnes_sensibilises'|trans }}</h6>
</div>
<div class="col-md-5 my-auto text-right">
<h4 class="text-primary m-0">{{ trainingsSensibilized }}</h4>
</div>
</div>
</div>
<div class="p-t-15 p-b-15 border-bottom border-bottom-dashed">
<div class="row ">
<div class="col-md-7">
<h6 class="">{{ 'questionnaires_envoys'|trans }}</h6>
</div>
<div class="col-md-5 my-auto text-right">
<h4 class="text-primary m-0">{{ trainingsTotal }}</h4>
</div>
</div>
</div>
<div class="p-t-15 p-b-15 border-bottom border-bottom-dashed">
<div class="row ">
<div class="col-md-7">
<h6 class="">{{ 'rponses_au_questionnaire'|trans }}</h6>
</div>
<div class="col-md-5 my-auto text-right">
<h4 class="text-success m-0">{{ trainingsAnswered }}</h4>
</div>
</div>
</div>
<div class="p-t-15 p-b-15 border-bottom border-bottom-dashed">
<div class="row ">
<div class="col-md-7">
<h6 class="">{{ 'note_moyenne_questionnaires'|trans }}</h6>
</div>
<div class="col-md-5 my-auto text-right">
{% set percentColor = "text-primary" %}
{% if trainingsAvgNote == 1 %}
{% set percentColor = "text-success" %}
{% elseif trainingsAvgNote >= 0.5 %}
{% set percentColor = "text-warning" %}
{% else %}
{% set percentColor = "text-danger" %}
{% endif %}
<h4 class="{{ percentColor}} m-0">{{ (trainingsAvgNote * 100)|number_format(2) }}%</h4>
</div>
</div>
</div>
</div>
{% else %}
<div class="card-body">
<p><a href="{{ path("user_trainings") }}">{{ 'aucun_questionnaire_de_sensibilisation_envoy_cliqu'|trans }}</a></p>
</div>
{% endif %}
</div>
</div>
<div class="col-lg-6">
<div class="card h-100 m-b-30">
<div class="card-header">
<div class="card-title">{{ 'infos_mydigitplace'|trans }}</div>
</div>
<div class="card-body">
{% for info in infos %}
<div class="row p-t-20 p-b-20">
<div class="my-auto col-md-7 d-flex align-items-center">
<div class="mr-5">
<div class="avatar avatar-lg mt-2">
{% if info.picture %}
<img src="/uploads/pictures/{{ info.picture }}" class="avatar-img avatar-lg rounded-circle" alt="">
{% endif %}
</div>
</div>
<div>
<h4 class="m-0">{{ info.title }}</h4>
<p class="m-0 text-muted">
{{ info.date|date('d/m/Y') }}
</p>
</div>
</div>
<div class="my-auto text-md-right col-md-5">
{% if info.link %}
<a href="{{ info.link }}" target="_blank" class="btn btn-rounded-circle btn-lg btn-white text-danger">
<i class="mdi mdi-open-in-new"></i>
</a>
{% else %}
<div class="btn btn-rounded-circle btn-lg btn-white text-danger" style="cursor: pointer;" data-info="{{ info.id }}" onclick="readInformation(this)">
<i class="mdi mdi-open-in-new"></i>
</div>
{% endif %}
</div>
</div>
<hr/>
{% endfor %}
</div>
</div>
</div>
<div class="col-lg-6">
<div class="card h-100 m-b-30">
<div class="card-header">
<div class="card-title">{{ 'sites_institutionnels'|trans }}</div>
</div>
<div class="card-body">
<div class="row p-t-20 p-b-20">
<div class="my-auto col-md-7 d-flex align-items-center">
<div class="mr-5">
<div class="avatar avatar-lg mt-2"><img src="{{ asset('/assets/img/cnil.jpg') }}" class="avatar-img avatar-lg rounded-circle" alt=""></div>
</div>
<div>
<h3 class="m-0">{{ 'plainte_information'|trans }}</h3>
<p class="m-0 text-muted">
{{ 'site_officiel_de_la_cnil'|trans }}
</p>
</div>
</div>
<div class="my-auto text-md-right col-md-5">
<a href="https://www.cnil.fr/fr" target="_blank" class="btn btn-rounded-circle btn-lg btn-white text-danger">
<i class="mdi mdi-open-in-new"></i>
</a>
</div>
</div>
<hr/>
<div class="row p-t-20 p-b-20">
<div class="my-auto col-md-7 d-flex align-items-center">
<div class="mr-5">
<div class="avatar avatar-lg mt-2"><img src="{{ asset('/assets/img/cybermalveillance.png') }}" class="avatar-img avatar-lg rounded-circle" alt=""></div>
</div>
<div>
<h3 class="m-0">{{ 'piratage_sensibilisation'|trans }}</h3>
<p class="m-0 text-muted">
{{ 'site_officiel_cybermalveillancegouv'|trans }}
</p>
</div>
</div>
<div class="my-auto text-md-right col-md-5">
<a href="https://www.cybermalveillance.gouv.fr/" target="_blank" class="btn btn-rounded-circle btn-lg btn-white text-danger">
<i class="mdi mdi-open-in-new"></i>
</a>
</div>
</div>
<hr/>
<div class="row p-t-20 p-b-20">
<div class="my-auto col-md-7 d-flex align-items-center">
<div class="mr-5">
<div class="avatar avatar-lg mt-2"><img src="{{ asset('/assets/img/anssi.png') }}" class="avatar-img avatar-lg rounded-circle" alt=""></div>
</div>
<div>
<h3 class="m-0">{{ 'conseils_outils'|trans }}</h3>
<p class="m-0 text-muted">
{{ 'anssi'|trans }}
</p>
</div>
</div>
<div class="my-auto text-md-right col-md-5">
<a href="https://www.ssi.gouv.fr/" target="_blank" class="btn btn-rounded-circle btn-lg btn-white text-danger">
<i class="mdi mdi-open-in-new"></i>
</a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="ExportModal" tabindex="-1" role="dialog"
aria-labelledby="ExportModal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title text-black" id="ExportModalTitle">Imprimer le tableau de bord</h5>
<button type="button" class="close" data-dismiss="modal"
aria-label="Fermer">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
{{ form_start(printForm, {"attr": {"target": "_blank"}}) }}
{{ form_label(printForm.types) }}
{% for chk in printForm.types %}
<div class="custom-control custom-checkbox">
{{ form_widget(chk, {'attr': {'class': 'custom-control-input'} }) }}
{{ form_label(chk, null, {'label_attr': {'class': 'custom-control-label'}}) }}
</div>
{% endfor %}
<div class="invalid-feedback">{{ form_errors(printForm.types) | striptags }}</div>
<div class="form-group mt-4 d-flex justify-content-end">
<button type="submit" class="btn btn-primary">Imprimer</button>
</div>
{{ form_end(printForm) }}
</div>
</div>
</div>
</div>
<div class="modal fade" id="informationModal" tabindex="-1" role="dialog" aria-labelledby="informationModalTitle" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="informationModalTitle"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="{{ 'fermer'|trans }}">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" id="informationModalContent">
</div>
<div class="modal-footer">
<button type="button" class="btn btn-light-secondary" data-dismiss="modal">
<i class="bx bx-x d-block d-sm-none"></i>
<span class="d-none d-sm-block">{{ 'fermer'|trans }}</span>
</button>
</div>
</div>
</div>
</div>
{% endblock %}
{% block javascripts %}
{{ parent() }}
<script src="{{ asset('/assets/vendor/chartjs/Chart.bundle.min.js') }}"></script>
<script src="{{ asset('/assets/js/chartjs-util.js') }}"></script>
<script>
(function ($) {
'use strict';
window.onload = function (e) {
if ($("#chartjs-01").length) {
new Chart(document.getElementById("chartjs-01"), {
type: 'doughnut',
data: {
labels: ["{{'En cours'|trans}}", "{{'À auditer DPO'|trans}}", "{{'Validés'|trans}}"],
datasets: [{
data: [{{ treatmentsStats.inProgress }}, {{ treatmentsStats.toAudit }}, {{ treatmentsStats.valid }}],
backgroundColor: ["#f2545b", "#ffb700", "#00e08b"],
}]
},
options: {
maintainAspectRatio: true,
rotation: 1 * Math.PI,
circumference: 1 * Math.PI,
cutoutPercentage: 60,
legend: {
display: false
},
}
});
}
if ($("#chartjs-02").length) {
new Chart(document.getElementById("chartjs-02"), {
type: 'doughnut',
data: {
labels: ["{{'À réaliser'|trans}}", "{{'Recommandés'|trans}}", "{{'Réalisés'|trans}}"],
datasets: [{
data: [{{ treatmentsPiaStats.inProgress }}, {{ treatmentsPiaStats.reco }}, {{ treatmentsPiaStats.valid }}],
backgroundColor: ["#f2545b", "#ffb700", "#00e08b"],
}]
},
options: {
maintainAspectRatio: true,
rotation: 1 * Math.PI,
circumference: 1 * Math.PI,
cutoutPercentage: 60,
legend: {
display: false
},
}
});
}
if ($("#chartjs-03").length) {
new Chart(document.getElementById("chartjs-03"), {
type: 'doughnut',
data: {
labels: ["{{'Non conformes'|trans}}", "{{'En cours'|trans}}", "{{'Conformes'|trans}}"],
datasets: [{
data: [{{ subcontractorsStats.invalid }}, {{ subcontractorsStats.inProgress }}, {{ subcontractorsStats.valid }}],
backgroundColor: ["#f2545b", "#ffb700", "#00e08b"],
}]
},
options: {
maintainAspectRatio: true,
rotation: 1 * Math.PI,
circumference: 1 * Math.PI,
cutoutPercentage: 60,
legend: {
display: false
},
}
});
}
if ($("#chartjs-04").length) {
new Chart(document.getElementById("chartjs-04"), {
type: 'doughnut',
data: {
labels: ["{{'Non réalisés'|trans}}", "{{'Réalisés'|trans}}"],
datasets: [{
data: [{{ actionsStats.invalid }}, {{ actionsStats.valid }}],
backgroundColor: ["#f2545b", "#00e08b"],
}]
},
options: {
maintainAspectRatio: true,
rotation: 1 * Math.PI,
circumference: 1 * Math.PI,
cutoutPercentage: 60,
legend: {
display: false
},
}
});
}
}
})(window.jQuery);
function readInformation(element) {
$.ajax({
type: "GET",
async: true,
url: "{{ path('user_json_info') }}",
data: {id: element.dataset.info},
success: function (content) {
document.getElementById('informationModalTitle').innerText = content.title;
document.getElementById('informationModalContent').innerHTML = content.content;
if (element.classList.contains("text-warning")) {
element.classList.remove("text-warning");
element.classList.add("text-success");
}
$('#informationModal').modal('show');
}
});
}
function selectAccount(e) {
if (e.value === "0") {
window.location.href = "/?_switch_user=_exit";
} else {
window.location.href = "/user/switch/" + e.value;
}
}
</script>
{% endblock %}