templates/formations/formationsAfficherPlanning.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block content %}
  3.     <h5 class="text-uppercase fw-bold">
  4.         <a href="{{ path('formations') }}"><button type="button" class="btn btn-secondary text-uppercase" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Retour"><i class="bi bi-arrow-bar-left"></i> Liste Formations</button></a> 
  5.         <i class="bi bi-caret-right"></i> Fiche formation
  6.         <i class="bi bi-caret-right"></i> <span class="text-decoration-underline">{{ formation.intitule }}</span>
  7.     </h5>
  8.     {% block navFormation %}
  9.         {# MENU DE NAVIGATION ONGLETS #}
  10.         {% include "navigation_onglets_formations.twig" %}
  11.     {% endblock %}
  12.     <div class="row">
  13.         <div class="col-12 mt-3">
  14.             <div class="card m-auto" style="width: 100%">
  15.                 <h5 class="p-3 text-uppercase fw-bold bg-dark text-white">
  16.                     <i class="bi bi-calendar-week"></i> Planning de la formation
  17.                     <span class="float-end badge bg-{{ formationEtat.colors }}">{{ formationEtat.intitule }}</span>
  18.                 </h5>
  19.                 <div class="card-body">
  20.                     <p class="card-text">
  21.                             
  22.                         {% if plannings %}
  23.                             <div class="row justify-content-end">
  24.                                 <div class="col-3 text-end">
  25.                                     <a href="{{ path('planning_formateurs_generer_pdf', {'idFormation': formation.id})}}" class="btn btn-secondary btn-sm" target="_blank"><i class="bi bi-printer"></i> Imprimer le planning (PDF)</a>
  26.                                 </div>
  27.                                 {% if app.user.roles[0] != 'ROLE_CD' or app.user.roles[0] == 'ROLE_CFC' %}
  28.                                     <div class="col-3 text-end">
  29.                                         <a href="{{ path('planning_formateurs_mail', {'idFormation': formation.id})}}" class="btn btn-primary btn-sm"><i class="bi bi-envelope"></i> Envoyer le planning aux formateurs</a>
  30.                                     </div>
  31.                                 {% endif %}
  32.                             </div>
  33.                         {% endif %}
  34.                         <div class="mt-3">
  35.                             {% if plannings %}
  36.                                 <table class="table table-striped table-hover" style="font-size: 14px;">
  37.                                     <thead>
  38.                                         <th></th>
  39.                                         <th></th>
  40.                                         <th>Domaine</th>
  41.                                         <th>Intitulé</th>
  42.                                         <th>Durée</th>
  43.                                         <th>Date</th>
  44.                                         <th>MA Début</th>
  45.                                         <th>MA Fin</th>
  46.                                         <th>AP Fin</th>
  47.                                         <th>AP Fin</th>
  48.                                         <th>Salle</th>
  49.                                         <th>Formateur(trice)</th>
  50.                                     </thead>
  51.                                     <tbody>
  52.                                         {% for planning in plannings %}
  53.                                         {% if planning.etat == 2 %}
  54.                                             {% set textBarre = 'text-decoration:line-through;' %}
  55.                                         {% else %}
  56.                                             {% set textBarre = '' %}
  57.                                         {% endif %}
  58.                                         <tr style="{{ textBarre }}">
  59.                                             <td>
  60.                                                 {% if app.user.roles[0] != 'ROLE_CD' or app.user.roles[0] == 'ROLE_CFC' %}  
  61.                                                     {% if formation.etat == 1 %}
  62.                                                         <a href="{{ path('formations_plannings_modifier', {'idFormation': formation.id, 'idPlanning': planning.id}) }}" class="btn btn-secondary btn-sm">Modifier</a>
  63.                                                     {% elseif formation.etat == 2 and planning.etat == 1 %}
  64.                                                         <a href="{{ path('formations_plannings_annuler', {'idFormation': formation.id, 'idPlanning': planning.id}) }}" class="btn btn-danger btn-sm">Annuler</a>
  65.                                                     {% endif %}
  66.                                                 {% endif %}
  67.                                             </td>
  68.                                             <td>{# {{ loop.index }} #}</td>
  69.                                             <td><span class="badge {{ domainesColors[planning.domaine] }}">{{ planning.domaine }}</span></td>
  70.                                             <td>{{ planning.intitule }}</td>
  71.                                             <td style="white-space: nowrap;">{{ planning.duree }} h</td>
  72.                                             <td style="white-space: nowrap;">{{ planning.dateDebut|date("d/m/Y") }}</td>
  73.                                             <td style="white-space: nowrap;" class="text-center">
  74.                                                 {% if planning.matinHoraireDebut|date('H:i') != '00:00' %}
  75.                                                     {{ planning.matinHoraireDebut|date("H:i") }}
  76.                                                 {% else %}
  77.                                                     ---
  78.                                                 {% endif %}
  79.                                             </td>
  80.                                             <td style="white-space: nowrap;" class="text-center">
  81.                                                 {% if planning.matinHoraireFin|date('H:i') != '00:00' %}
  82.                                                     {{ planning.matinHoraireFin|date("H:i") }}
  83.                                                 {% else %}
  84.                                                     ---
  85.                                                 {% endif %}
  86.                                             </td>
  87.                                             <td style="white-space: nowrap;" class="text-center">
  88.                                                 {% if planning.apresMidiHoraireDebut|date('H:i') != '00:00' %}
  89.                                                     {{ planning.apresMidiHoraireDebut|date("H:i") }}
  90.                                                 {% else %}
  91.                                                     ---
  92.                                                 {% endif %}
  93.                                             </td>
  94.                                             <td style="white-space: nowrap;" class="text-center">
  95.                                                 {% if planning.apresMidiHoraireFin|date('H:i') != '00:00' %}
  96.                                                     {{ planning.apresMidiHoraireFin|date("H:i") }}
  97.                                                 {% else %}
  98.                                                     ---
  99.                                                 {% endif %}
  100.                                             </td>
  101.                                             <td style="white-space: nowrap;">
  102.                                                 {{ planning.salle.intitule }}
  103.                                             </td>
  104.                                             <td style="white-space: nowrap;">{{ planning.formateur.nom|upper }} {{ planning.formateur.prenom }}</td>
  105.                                         </tr>
  106.                                         {% endfor %}
  107.                                     </tbody>
  108.                                     <!-- <tfoot>
  109.                                         <td colspan="5"></td>
  110.                                     </tfoot> -->
  111.                                 </table>
  112.                             {% else %}
  113.                                 <div class="alert alert-secondary fst-italic">Aucun planning</div>
  114.                             {% endif %}
  115.                         </div>
  116.                         {% if not plannings %}
  117.                             <div class="text-end">
  118.                                 <a href="{{ path('formations_plannings', {'idFormation': formation.id}) }}" class="btn btn-primary btn-sm">Construire</a>
  119.                             </div>
  120.                         {% else %}
  121.                             <div class="text-end">
  122.                                 <a href="{{ path('formations_plannings_supprimer', {'idFormation': formation.id})}}" class="btn btn-danger btn-sm" target="_blank">Supprimer le planning</a>
  123.                             </div>
  124.                         {% endif %}
  125.                     </p>  
  126.                 </div>
  127.             </div>
  128.         </div>
  129.     </div>
  130.     <div class="mb-5"></div>
  131.     
  132. {% endblock %}