templates/user/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}
  3.     {{ parent() }} - {{ 'accueil'|trans }}
  4. {% endblock %}
  5. {% block body %}
  6.     {{ parent() }}
  7. {% endblock %}
  8. {% block content %}
  9.     <div class="bg-dark">
  10.         <div class="container m-b-30">
  11.             <div class="row">
  12.                 <div class="col-md-8 text-white p-t-40 p-b-90">
  13.                     <h5>{{ 'outil_daide_la_mise_en_conformit_au'|trans }}</h5>
  14.                     {% if app.request.locale == "fr" %}
  15.                         <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>
  16.                         <a href="https://www.cnil.fr/fr/reglement-europeen-protection-donnees" target="_blank">Consulter le règlement</a>
  17.                     {% else %}
  18.                         <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>
  19.                         <a href="https://www.cnil.fr/fr/reglement-europeen-protection-donnees" target="_blank">Consult GDPR</a>
  20.                     {% endif %}
  21.                     <br/>
  22.                     <br/>
  23.                     <p class="h5 mt-2">{{ 'crdit_temps_expert_heures'|trans({'%credit%': app.user.user.credit|format_credit_number}) }}</p>
  24.                     {% if formChildrenUsers %}
  25.                         {{ form_start(formChildrenUsers) }}
  26.                         {{ form_widget(formChildrenUsers.comptes, {"attr": {"onchange": "selectAccount(this)"}}) }}
  27.                         {{ form_end(formChildrenUsers) }}
  28.                     {% endif %}
  29.                     <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>
  30.                 </div>
  31.                 <div class="col-md-4 my-auto text-md-right p-t-20 p-b-90 d-none d-md-block">
  32.                     <div>
  33.                         <div class="avatar mr-3 avatar-xxl">
  34.                             {{ get_user_avatar(app.user.user)|raw }}
  35.                             {#<span class="avatar-title rounded-circle">{{ app.user.user.contactFirstName|slice(0,1)|upper }}{{ app.user.user.contactLastName|slice(0,1)|upper }}</span>#}
  36.                         </div>
  37.                     </div>
  38.                     <h5 class="text-white m-t-1 pr-4">
  39.                         {{ app.user.user.companyName }}
  40.                     </h5>
  41.                 </div>
  42.             </div>
  43.         </div>
  44.     </div>
  45.     <div class="container pull-up">
  46.         <div class="row">
  47.             <div class="col-md-3 col-sm-6 col-12 m-b-30">
  48.                 <div class="card">
  49.                     <div class="card-header">
  50.                         <div class="card-title m-b-0">{{ 'traitements'|trans }}</div>
  51.                     </div>
  52.                     <div class="card-body">
  53.                         {% if treatmentsStats.total > 0 %}
  54.                             <div class="chart">
  55.                                 <canvas id="chartjs-01" class="chart-canvas" height="250"></canvas>
  56.                             </div>
  57.                         {% else %}
  58.                             <p><a href="{{ path("user_treatments_add") }}">{{ 'aucun_traitement_identifi_cliquezici_pour_crer_vot'|trans }}</a></p>
  59.                         {% endif %}
  60.                     </div>
  61.                 </div>
  62.             </div>
  63.             <div class="col-md-3 col-sm-6 col-12 m-b-30">
  64.                 <div class="card">
  65.                     <div class="card-header">
  66.                         <div class="card-title m-b-0">{{ 'pia'|trans }}</div>
  67.                     </div>
  68.                     <div class="card-body">
  69.                         {% if treatmentsPiaStats.total > 0 %}
  70.                             <div class="chart">
  71.                                 <canvas id="chartjs-02" class="chart-canvas" height="250"></canvas>
  72.                             </div>
  73.                         {% else %}
  74.                             {% if treatmentsStats.total > 0 %}
  75.                                 <p><a href="{{ path("user_treatments_add") }}">{{ 'vous_navez_pas_rdig_de_pia_analyse_dimpact'|trans }}</a></p>
  76.                             {% else %}
  77.                                 <p><a href="{{ path("user_treatments_add") }}">{{ 'aucun_traitement_identifi_cliquezici_pour_crer_vot'|trans }}</a></p>
  78.                             {% endif %}
  79.                         {% endif %}
  80.                     </div>
  81.                 </div>
  82.             </div>
  83.             <div class="col-md-3 col-sm-6 col-12 m-b-30">
  84.                 <div class="card">
  85.                     <div class="card-header">
  86.                         <div class="card-title m-b-0">{{ 'sous_traitants'|trans }}</div>
  87.                     </div>
  88.                     <div class="card-body">
  89.                         {% if subcontractorsStats.total > 0 %}
  90.                             <div class="chart">
  91.                                 <canvas id="chartjs-03" class="chart-canvas" height="250"></canvas>
  92.                             </div>
  93.                         {% else %}
  94.                             <p><a href="{{ path("user_subcontractors_add") }}">{{ 'aucun_soustraitant_identifi_cliquezici_pour_crer_v'|trans }}</a></p>
  95.                         {% endif %}
  96.                     </div>
  97.                 </div>
  98.             </div>
  99.             <div class="col-md-3 col-sm-6 col-12 m-b-30">
  100.                 <div class="card">
  101.                     <div class="card-header">
  102.                         <div class="card-title m-b-0">{{ 'actions'|trans }}</div>
  103.                     </div>
  104.                     <div class="card-body">
  105.                         {% if actionsStats.total > 0 %}
  106.                             <div class="chart">
  107.                                 <canvas id="chartjs-04" class="chart-canvas" height="250"></canvas>
  108.                             </div>
  109.                         {% else %}
  110.                             <p><a href="{{ path("user_actions_add") }}">{{ 'aucune_action_identifie_cliquezici_pour_crer_votre'|trans }}</a></p>
  111.                         {% endif %}
  112.                     </div>
  113.                 </div>
  114.             </div>
  115.             <div class="col-sm-6 col-12 m-b-30">
  116.                 <div class="card card-dashboard">
  117.                     <div class="card-header card-header-dashboard">
  118.                         <div class="card-title m-b-0">{{ 'actions_raliser_sous_30_jours'|trans }}</div>
  119.                     </div>
  120.                     <div class="card-body">
  121.                         <table class="table">
  122.                             <thead>
  123.                                 <tr>
  124.                                     <th>{{ 'action'|trans }}</th>
  125.                                     <th>{{ 'responsable'|trans }}</th>
  126.                                     <th>{{ 'date_de_mise_en_place'|trans }}</th>
  127.                                 </tr>
  128.                             </thead>
  129.                             <tbody>
  130.                                 {% for action in actionsToTreat %}
  131.                                     <tr>
  132.                                         <td><a href="{{ path('user_actions_edit', {"id": action.id}) }}">{{ action.name }}</a></td>
  133.                                         <td><a href="{{ path('user_actions_edit', {"id": action.id}) }}">{{ action.accountantLastName }} {{ action.accountantFirstName }}</a></td>
  134.                                         <td><a href="{{ path('user_actions_edit', {"id": action.id}) }}">{{ action.setUpDate|date('d/m/Y') }}</a></td>
  135.                                     </tr>
  136.                                 {% endfor %}
  137.                             </tbody>
  138.                         </table>
  139.                     </div>
  140.                 </div>
  141.             </div>
  142.             <div class="col-sm-6 col-12 m-b-30">
  143.                 <div class="card card-dashboard">
  144.                     <div class="card-header card-header-dashboard">
  145.                         <div class="card-title m-b-0">{{ 'incidents_traiter'|trans }}</div>
  146.                     </div>
  147.                     <div class="card-body">
  148.                         <table class="table">
  149.                             <thead>
  150.                                 <tr>
  151.                                     <th>{{ 'dlai_de_72h'|trans }}</th>
  152.                                     <th>{{ 'nature'|trans }}</th>
  153.                                     <th>{{ 'date'|trans }}</th>
  154.                                 </tr>
  155.                             </thead>
  156.                             <tbody>
  157.                             {% for incident in incidentsToTreat %}
  158.                                 <tr>
  159.                                     <td><a href="{{ path('user_incidents_edit', {"id": incident.id}) }}">{% if incident.notice72H %}{{ 'oui'|trans }}{% else %}{{ 'non'|trans }}{% endif %}</a></td>
  160.                                     <td><a href="{{ path('user_incidents_edit', {"id": incident.id}) }}">{{ incident.type }}</a></td>
  161.                                     <td><a href="{{ path('user_incidents_edit', {"id": incident.id}) }}">{{ incident.date|date('d/m/Y') }}</a></td>
  162.                                 </tr>
  163.                             {% endfor %}
  164.                             </tbody>
  165.                         </table>
  166.                     </div>
  167.                 </div>
  168.             </div>
  169.             <div class="col-sm-6 col-12 m-b-30">
  170.                 <div class="card card-dashboard">
  171.                     <div class="card-header card-header-dashboard">
  172.                         <div class="card-title m-b-0">{{ 'demandes_dexercices_de_droits_traiter'|trans }}</div>
  173.                     </div>
  174.                     <div class="card-body">
  175.                         <table class="table">
  176.                             <thead>
  177.                             <tr>
  178.                                 <th>{{ 'date_de_la_demande'|trans }}</th>
  179.                                 <th>{{ 'droit'|trans }}</th>
  180.                                 <th>{{ 'personne_concerne'|trans }}</th>
  181.                                 <th>{{ 'dlai_de_30_jours'|trans }}</th>
  182.                             </tr>
  183.                             </thead>
  184.                             <tbody>
  185.                             {% for exercisingclaim in exercisingClaimRequestsToTreat %}
  186.                                 <tr>
  187.                                     <td>
  188.                                         <a href="{{ path('user_exercisingclaims_edit', {"id": exercisingclaim.id}) }}">
  189.                                             {% if exercisingclaim.requestDate %}{{ exercisingclaim.requestDate|date('d/m/Y H:i') }}{% endif %}
  190.                                         </a>
  191.                                     </td>
  192.                                     <td>
  193.                                         <a href="{{ path('user_exercisingclaims_edit', {"id": exercisingclaim.id}) }}">
  194.                                             {% if exercisingclaim.rights == "acces" %}
  195.                                                 {{ 'accs'|trans }}
  196.                                             {% elseif exercisingclaim.rights == "rectification" %}
  197.                                                 {{ 'rectification'|trans }}
  198.                                             {% elseif exercisingclaim.rights == "effacement" %}
  199.                                                 {{ 'effacement'|trans }}
  200.                                             {% elseif exercisingclaim.rights == "limitation" %}
  201.                                                 {{ 'limitation'|trans }}
  202.                                             {% elseif exercisingclaim.rights == "portabilite" %}
  203.                                                 {{ 'portabilit'|trans }}
  204.                                             {% elseif exercisingclaim.rights == "opposition" %}
  205.                                                 {{ 'opposition'|trans }}
  206.                                             {% endif %}
  207.                                         </a>
  208.                                     </td>
  209.                                     <td><a href="{{ path('user_exercisingclaims_edit', {"id": exercisingclaim.id}) }}">{{ exercisingclaim.customer }}</a></td>
  210.                                     <td>
  211.                                         <a href="{{ path('user_exercisingclaims_edit', {"id": exercisingclaim.id}) }}">
  212.                                             {% if exercisingclaim.answerDate %}
  213.                                                 <span class="badge badge-success">{{ 'valid'|trans }}</span>
  214.                                             {% else %}
  215.                                                 <span class="badge badge-danger">{{ 'en_cours'|trans }}</span>
  216.                                                 {% if exercisingclaim.requestDate %}
  217.                                                     {% set difference = date().diff(date(exercisingclaim.requestDate)) %}
  218.                                                     {% set leftDays = difference.days %}
  219.                                                     {% if leftDays > 30 %}
  220.                                                         <span class="badge badge-warning">{{ 'dpass'|trans }}</span>
  221.                                                     {% endif %}
  222.                                                 {% endif %}
  223.                                             {% endif %}
  224.                                         </a>
  225.                                     </td>
  226.                                 </tr>
  227.                             {% endfor %}
  228.                             </tbody>
  229.                         </table>
  230.                     </div>
  231.                 </div>
  232.             </div>
  233.             <div class="col-sm-6 col-12 m-b-30">
  234.                 <div class="card card-dashboard">
  235.                     <div class="card-header card-header-dashboard">
  236.                         <div class="card-title m-b-0">{{ 'niveau_de_sensibilisation_des_quipes'|trans }}</div>
  237.                     </div>
  238.                     {% if trainingsTotal > 0 %}
  239.                         <div class="card-body ">
  240.                             <div class="p-t-15 p-b-15  border-bottom border-bottom-dashed">
  241.                                 <div class="row ">
  242.                                     <div class="col-md-7">
  243.                                         <h6 class="">{{ 'personnes_sensibilises'|trans }}</h6>
  244.                                     </div>
  245.                                     <div class="col-md-5 my-auto  text-right">
  246.                                         <h4 class="text-primary m-0">{{ trainingsSensibilized }}</h4>
  247.                                     </div>
  248.                                 </div>
  249.                             </div>
  250.                             <div class="p-t-15 p-b-15  border-bottom border-bottom-dashed">
  251.                                 <div class="row ">
  252.                                     <div class="col-md-7">
  253.                                         <h6 class="">{{ 'questionnaires_envoys'|trans }}</h6>
  254.                                     </div>
  255.                                     <div class="col-md-5 my-auto  text-right">
  256.                                         <h4 class="text-primary m-0">{{ trainingsTotal }}</h4>
  257.                                     </div>
  258.                                 </div>
  259.                             </div>
  260.                             <div class="p-t-15 p-b-15  border-bottom border-bottom-dashed">
  261.                                 <div class="row ">
  262.                                     <div class="col-md-7">
  263.                                         <h6 class="">{{ 'rponses_au_questionnaire'|trans }}</h6>
  264.                                     </div>
  265.                                     <div class="col-md-5 my-auto  text-right">
  266.                                         <h4 class="text-success m-0">{{ trainingsAnswered }}</h4>
  267.                                     </div>
  268.                                 </div>
  269.                             </div>
  270.                             <div class="p-t-15 p-b-15  border-bottom border-bottom-dashed">
  271.                                 <div class="row ">
  272.                                     <div class="col-md-7">
  273.                                         <h6 class="">{{ 'note_moyenne_questionnaires'|trans }}</h6>
  274.                                     </div>
  275.                                     <div class="col-md-5 my-auto text-right">
  276.                                         {% set percentColor = "text-primary" %}
  277.                                         {% if trainingsAvgNote == 1 %}
  278.                                             {% set percentColor = "text-success" %}
  279.                                         {% elseif trainingsAvgNote >= 0.5 %}
  280.                                             {% set percentColor = "text-warning" %}
  281.                                         {% else %}
  282.                                             {% set percentColor = "text-danger" %}
  283.                                         {% endif %}
  284.                                         <h4 class="{{ percentColor}} m-0">{{ (trainingsAvgNote * 100)|number_format(2) }}%</h4>
  285.                                     </div>
  286.                                 </div>
  287.                             </div>
  288.                         </div>
  289.                     {% else %}
  290.                         <div class="card-body">
  291.                             <p><a href="{{ path("user_trainings") }}">{{ 'aucun_questionnaire_de_sensibilisation_envoy_cliqu'|trans }}</a></p>
  292.                         </div>
  293.                     {% endif %}
  294.                 </div>
  295.             </div>
  296.             <div class="col-lg-6">
  297.                 <div class="card h-100 m-b-30">
  298.                     <div class="card-header">
  299.                         <div class="card-title">{{ 'infos_mydigitplace'|trans }}</div>
  300.                     </div>
  301.                     <div class="card-body">
  302.                         {% for info in infos %}
  303.                         <div class="row p-t-20 p-b-20">
  304.                             <div class="my-auto col-md-7 d-flex align-items-center">
  305.                                 <div class="mr-5">
  306.                                     <div class="avatar avatar-lg mt-2">
  307.                                         {% if info.picture %}
  308.                                             <img src="/uploads/pictures/{{ info.picture }}" class="avatar-img avatar-lg rounded-circle" alt="">
  309.                                         {% endif %}
  310.                                     </div>
  311.                                 </div>
  312.                                 <div>
  313.                                     <h4 class="m-0">{{ info.title }}</h4>
  314.                                     <p class="m-0 text-muted">
  315.                                         {{ info.date|date('d/m/Y') }}
  316.                                     </p>
  317.                                 </div>
  318.                             </div>
  319.                             <div class="my-auto text-md-right col-md-5">
  320.                                 {% if info.link %}
  321.                                     <a href="{{ info.link }}" target="_blank" class="btn btn-rounded-circle btn-lg btn-white text-danger">
  322.                                         <i class="mdi mdi-open-in-new"></i>
  323.                                     </a>
  324.                                 {% else %}
  325.                                     <div class="btn btn-rounded-circle btn-lg btn-white text-danger" style="cursor: pointer;" data-info="{{ info.id }}" onclick="readInformation(this)">
  326.                                         <i class="mdi mdi-open-in-new"></i>
  327.                                     </div>
  328.                                 {% endif %}
  329.                             </div>
  330.                         </div>
  331.                         <hr/>
  332.                         {% endfor %}
  333.                     </div>
  334.                 </div>
  335.             </div>
  336.             <div class="col-lg-6">
  337.                 <div class="card h-100 m-b-30">
  338.                     <div class="card-header">
  339.                         <div class="card-title">{{ 'sites_institutionnels'|trans }}</div>
  340.                     </div>
  341.                     <div class="card-body">
  342.                         <div class="row p-t-20 p-b-20">
  343.                             <div class="my-auto col-md-7 d-flex align-items-center">
  344.                                 <div class="mr-5">
  345.                                     <div class="avatar avatar-lg mt-2"><img src="{{ asset('/assets/img/cnil.jpg') }}" class="avatar-img avatar-lg rounded-circle" alt=""></div>
  346.                                 </div>
  347.                                 <div>
  348.                                     <h3 class="m-0">{{ 'plainte_information'|trans }}</h3>
  349.                                     <p class="m-0 text-muted">
  350.                                         {{ 'site_officiel_de_la_cnil'|trans }}
  351.                                     </p>
  352.                                 </div>
  353.                             </div>
  354.                             <div class="my-auto text-md-right col-md-5">
  355.                                 <a href="https://www.cnil.fr/fr" target="_blank" class="btn btn-rounded-circle btn-lg btn-white text-danger">
  356.                                     <i class="mdi mdi-open-in-new"></i>
  357.                                 </a>
  358.                             </div>
  359.                         </div>
  360.                         <hr/>
  361.                         <div class="row p-t-20 p-b-20">
  362.                             <div class="my-auto col-md-7 d-flex align-items-center">
  363.                                 <div class="mr-5">
  364.                                     <div class="avatar avatar-lg mt-2"><img src="{{ asset('/assets/img/cybermalveillance.png') }}" class="avatar-img avatar-lg rounded-circle" alt=""></div>
  365.                                 </div>
  366.                                 <div>
  367.                                     <h3 class="m-0">{{ 'piratage_sensibilisation'|trans }}</h3>
  368.                                     <p class="m-0 text-muted">
  369.                                         {{ 'site_officiel_cybermalveillancegouv'|trans }}
  370.                                     </p>
  371.                                 </div>
  372.                             </div>
  373.                             <div class="my-auto text-md-right col-md-5">
  374.                                 <a href="https://www.cybermalveillance.gouv.fr/" target="_blank" class="btn btn-rounded-circle btn-lg btn-white text-danger">
  375.                                     <i class="mdi mdi-open-in-new"></i>
  376.                                 </a>
  377.                             </div>
  378.                         </div>
  379.                         <hr/>
  380.                         <div class="row p-t-20 p-b-20">
  381.                             <div class="my-auto col-md-7 d-flex align-items-center">
  382.                                 <div class="mr-5">
  383.                                     <div class="avatar avatar-lg mt-2"><img src="{{ asset('/assets/img/anssi.png') }}" class="avatar-img avatar-lg rounded-circle" alt=""></div>
  384.                                 </div>
  385.                                 <div>
  386.                                     <h3 class="m-0">{{ 'conseils_outils'|trans }}</h3>
  387.                                     <p class="m-0 text-muted">
  388.                                         {{ 'anssi'|trans }}
  389.                                     </p>
  390.                                 </div>
  391.                             </div>
  392.                             <div class="my-auto text-md-right col-md-5">
  393.                                 <a href="https://www.ssi.gouv.fr/" target="_blank" class="btn btn-rounded-circle btn-lg btn-white text-danger">
  394.                                     <i class="mdi mdi-open-in-new"></i>
  395.                                 </a>
  396.                             </div>
  397.                         </div>
  398.                     </div>
  399.                 </div>
  400.             </div>
  401.         </div>
  402.     </div>
  403.     <div class="modal fade" id="ExportModal" tabindex="-1" role="dialog"
  404.          aria-labelledby="ExportModal" aria-hidden="true">
  405.         <div class="modal-dialog modal-dialog-centered" role="document">
  406.             <div class="modal-content">
  407.                 <div class="modal-header">
  408.                     <h5 class="modal-title text-black" id="ExportModalTitle">Imprimer le tableau de bord</h5>
  409.                     <button type="button" class="close" data-dismiss="modal"
  410.                             aria-label="Fermer">
  411.                         <span aria-hidden="true">&times;</span>
  412.                     </button>
  413.                 </div>
  414.                 <div class="modal-body">
  415.                     {{ form_start(printForm, {"attr": {"target": "_blank"}}) }}
  416.                     {{ form_label(printForm.types) }}
  417.                     {% for chk in printForm.types %}
  418.                         <div class="custom-control custom-checkbox">
  419.                             {{ form_widget(chk, {'attr': {'class': 'custom-control-input'} }) }}
  420.                             {{ form_label(chk, null, {'label_attr': {'class': 'custom-control-label'}}) }}
  421.                         </div>
  422.                     {% endfor %}
  423.                     <div class="invalid-feedback">{{ form_errors(printForm.types) | striptags  }}</div>
  424.                     <div class="form-group mt-4 d-flex justify-content-end">
  425.                         <button type="submit" class="btn btn-primary">Imprimer</button>
  426.                     </div>
  427.                     {{ form_end(printForm) }}
  428.                 </div>
  429.             </div>
  430.         </div>
  431.     </div>
  432.     <div class="modal fade" id="informationModal" tabindex="-1" role="dialog" aria-labelledby="informationModalTitle" aria-hidden="true">
  433.         <div class="modal-dialog" role="document">
  434.             <div class="modal-content">
  435.                 <div class="modal-header">
  436.                     <h5 class="modal-title" id="informationModalTitle"></h5>
  437.                     <button type="button" class="close" data-dismiss="modal" aria-label="{{ 'fermer'|trans }}">
  438.                         <span aria-hidden="true">×</span>
  439.                     </button>
  440.                 </div>
  441.                 <div class="modal-body" id="informationModalContent">
  442.                 </div>
  443.                 <div class="modal-footer">
  444.                     <button type="button" class="btn btn-light-secondary" data-dismiss="modal">
  445.                         <i class="bx bx-x d-block d-sm-none"></i>
  446.                         <span class="d-none d-sm-block">{{ 'fermer'|trans }}</span>
  447.                     </button>
  448.                 </div>
  449.             </div>
  450.         </div>
  451.     </div>
  452. {% endblock %}
  453. {% block javascripts %}
  454.     {{ parent() }}
  455.     <script src="{{ asset('/assets/vendor/chartjs/Chart.bundle.min.js') }}"></script>
  456.     <script src="{{ asset('/assets/js/chartjs-util.js') }}"></script>
  457.     <script>
  458.         (function ($) {
  459.             'use strict';
  460.             window.onload = function (e) {
  461.                 if ($("#chartjs-01").length) {
  462.                     new Chart(document.getElementById("chartjs-01"), {
  463.                         type: 'doughnut',
  464.                         data: {
  465.                             labels: ["{{'En cours'|trans}}", "{{'À auditer DPO'|trans}}", "{{'Validés'|trans}}"],
  466.                             datasets: [{
  467.                                 data: [{{ treatmentsStats.inProgress }}, {{ treatmentsStats.toAudit }}, {{ treatmentsStats.valid }}],
  468.                                 backgroundColor: ["#f2545b", "#ffb700", "#00e08b"],
  469.                             }]
  470.                         },
  471.                         options: {
  472.                             maintainAspectRatio: true,
  473.                             rotation: 1 * Math.PI,
  474.                             circumference: 1 * Math.PI,
  475.                             cutoutPercentage: 60,
  476.                             legend: {
  477.                                 display: false
  478.                             },
  479.                         }
  480.                     });
  481.                 }
  482.                 if ($("#chartjs-02").length) {
  483.                     new Chart(document.getElementById("chartjs-02"), {
  484.                         type: 'doughnut',
  485.                         data: {
  486.                             labels: ["{{'À réaliser'|trans}}", "{{'Recommandés'|trans}}", "{{'Réalisés'|trans}}"],
  487.                             datasets: [{
  488.                                 data: [{{ treatmentsPiaStats.inProgress }}, {{ treatmentsPiaStats.reco }}, {{ treatmentsPiaStats.valid }}],
  489.                                 backgroundColor: ["#f2545b", "#ffb700", "#00e08b"],
  490.                             }]
  491.                         },
  492.                         options: {
  493.                             maintainAspectRatio: true,
  494.                             rotation: 1 * Math.PI,
  495.                             circumference: 1 * Math.PI,
  496.                             cutoutPercentage: 60,
  497.                             legend: {
  498.                                 display: false
  499.                             },
  500.                         }
  501.                     });
  502.                 }
  503.                 if ($("#chartjs-03").length) {
  504.                     new Chart(document.getElementById("chartjs-03"), {
  505.                         type: 'doughnut',
  506.                         data: {
  507.                             labels: ["{{'Non conformes'|trans}}", "{{'En cours'|trans}}", "{{'Conformes'|trans}}"],
  508.                             datasets: [{
  509.                                 data: [{{ subcontractorsStats.invalid }}, {{ subcontractorsStats.inProgress }}, {{ subcontractorsStats.valid }}],
  510.                                 backgroundColor: ["#f2545b", "#ffb700", "#00e08b"],
  511.                             }]
  512.                         },
  513.                         options: {
  514.                             maintainAspectRatio: true,
  515.                             rotation: 1 * Math.PI,
  516.                             circumference: 1 * Math.PI,
  517.                             cutoutPercentage: 60,
  518.                             legend: {
  519.                                 display: false
  520.                             },
  521.                         }
  522.                     });
  523.                 }
  524.                 if ($("#chartjs-04").length) {
  525.                     new Chart(document.getElementById("chartjs-04"), {
  526.                         type: 'doughnut',
  527.                         data: {
  528.                             labels: ["{{'Non réalisés'|trans}}", "{{'Réalisés'|trans}}"],
  529.                             datasets: [{
  530.                                 data: [{{ actionsStats.invalid }}, {{ actionsStats.valid }}],
  531.                                 backgroundColor: ["#f2545b", "#00e08b"],
  532.                             }]
  533.                         },
  534.                         options: {
  535.                             maintainAspectRatio: true,
  536.                             rotation: 1 * Math.PI,
  537.                             circumference: 1 * Math.PI,
  538.                             cutoutPercentage: 60,
  539.                             legend: {
  540.                                 display: false
  541.                             },
  542.                         }
  543.                     });
  544.                 }
  545.             }
  546.         })(window.jQuery);
  547.         function readInformation(element) {
  548.             $.ajax({
  549.                 type: "GET",
  550.                 async: true,
  551.                 url: "{{ path('user_json_info') }}",
  552.                 data: {id: element.dataset.info},
  553.                 success: function (content) {
  554.                     document.getElementById('informationModalTitle').innerText = content.title;
  555.                     document.getElementById('informationModalContent').innerHTML = content.content;
  556.                     if (element.classList.contains("text-warning")) {
  557.                         element.classList.remove("text-warning");
  558.                         element.classList.add("text-success");
  559.                     }
  560.                     $('#informationModal').modal('show');
  561.                 }
  562.             });
  563.         }
  564.         function selectAccount(e) {
  565.             if (e.value === "0") {
  566.                 window.location.href = "/?_switch_user=_exit";
  567.             } else {
  568.                 window.location.href = "/user/switch/" + e.value;
  569.             }
  570.         }
  571.     </script>
  572. {% endblock %}