templates/formations/formationsAfficherPresences2.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> Présences
  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.                         {% if formation.etat >= 2 %}
  22.                         <div class="row text-start">
  23.                             <div class="col-4">
  24.                                 <div class="btn-group" role="group">
  25.                                     <button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
  26.                                         <i class="bi bi-filetype-pdf"></i> Feuilles de présences signées
  27.                                     </button>
  28.                                     <ul class="dropdown-menu">
  29.                                         <li><a href="{{ path('presences_download', {'idFormation': formation.id, 'message': 0 }) }}" class="dropdown-item"><i class="bi bi-download"></i> Télécharger le fichier</a></li>
  30.                                         <li><a href="{{ path('presences_upload', {'idFormation': formation.id, 'message': 0}) }}" class="dropdown-item"><i class="bi bi-upload"></i> Uploader le fichier</a></li>
  31.                                     </ul>
  32.                                 </div>
  33.                             </div>
  34.                             <div class="col-4 text-center">
  35.                                 <a href="{{ path('formations_presences_plages_stagiaires', {'idFormation':formation.id}) }}" class="btn btn-secondary"><i class="bi bi-person-workspace"></i> Afficher l'état des présences d'un stagiaire</a>
  36.                             </div>
  37.                             <div class="col-4 text-end">
  38.                                 <a href="{{ path('presences_generate_all_pdf', {'idFormation':formation.id}) }}" class="btn btn-primary" target="_blank"><i class="bi bi-file-earmark-pdf"></i> Générer toutes les feuilles de présences</a>
  39.                             </div>
  40.                         </div>
  41.                         <div class="mt-3">
  42.                             {% if plannings %}
  43.                                 <table class="table table-hover table-striped">
  44.                                     <thead>
  45.                                         <th></th>
  46.                                         <th></th>
  47.                                         <th>Absences</th>
  48.                                         <th>Date</th>
  49.                                         <th>Matin</th>
  50.                                         <th>Après-midi</th>
  51.                                         <th>Domaine</th>
  52.                                         <th>Intitulé</th>
  53.                                         <th>Formateur(trice)</th>
  54.                                         <th></th>
  55.                                     </thead>
  56.                                     <tbody>
  57.                                     {% for planning in plannings %}
  58.                                         {% if planning.etat == 2 %}
  59.                                             {% set textBarre = 'text-decoration:line-through;' %}
  60.                                         {% else %}
  61.                                             {% set textBarre = '' %}
  62.                                         {% endif %}
  63.                                         <tr style="{{ textBarre }}">
  64.                                             <td style="white-space: nowrap">
  65.                                                 
  66.                                                 {% if app.user.roles[0] != 'ROLE_CD' or app.user.roles[0] == 'ROLE_CFC' %}
  67.                                                     {% if formation.etat == 2  and planning.etat == 1 %}
  68.                                                         <a href="{{path('formations_presences_plages', {'idPlanning':planning.id})}}" class="btn btn-success btn-sm">Saisir présences</a>
  69.                                                     {% endif %}
  70.                                                 {% endif %}
  71.                                             </td>
  72.                                             <td>
  73.                                                 {%  if planning.validationPresences == true %}
  74.                                                     <span class="fw-bold fs-5" data-bs-toggle="tooltip" data-bs-placement="bottom" title="La saisie des presences est validée"><i class="bi bi-check2-circle"></i></span>
  75.                                                 {% endif %}
  76.                                             </td>
  77.                                             <td style="white-space: nowrap">
  78.                                                 <span data-bs-toggle="tooltip" data-bs-placement="bottom" title="Absences / Nbre total de plages">{{ tabAbsences[planning.id][0]}} / {{ tabAbsences[planning.id][1]}}</span>
  79.                                             </td>
  80.                                             
  81.                                             <td style="white-space: nowrap">{{ planning.dateDebut|date('d/m/Y') }}</td>
  82.                                             <td style="white-space: nowrap">{{ planning.matinHoraireDebut|date('H:i') }} - {{ planning.matinHoraireFin|date('H:i') }}</td>
  83.                                             <td style="white-space: nowrap">{{ planning.apresMidiHoraireDebut|date('H:i') }} - {{ planning.apresMidiHoraireFin|date('H:i') }}</td>
  84.                                             <td><span class="badge {{ domainesColors[planning.domaine] }}">{{ planning.domaine }}</span></td>
  85.                                             <td>{{ planning.intitule }}</td>
  86.                                             <td style="white-space: nowrap">{{ planning.formateur.nom }} {{ planning.formateur.prenom }}</td>
  87.                                             <td>
  88.                                                 {% if planning.etat == 1 %}
  89.                                                     <a href="{{ path('presences_generate_one_pdf', {'idPlanning':planning.id}) }}" class="btn btn-primary btn-sm" target="_blank"><i class="bi bi-file-earmark-pdf"></i> Générer feuille présences</a>
  90.                                                 {% endif %}
  91.                                             </td>
  92.                                         </tr>
  93.                                         {% endfor %}
  94.                                     </tbody>
  95.                                 </table>
  96.                             {% endif %}
  97.                         </div>
  98.                     {% else %}
  99.                         <div class="alert alert-secondary">Le traitement des présences pourront être effectué uniquement lorsque la formation sera dans l'état "FORMATION EN COURS"</div>
  100.                     {% endif %}
  101.                     </p>  
  102.                 </div>
  103.             </div>
  104.         </div>
  105.     </div>
  106.     {# <div id="resultats" class="mt-5">
  107.         toto
  108.     </div> #}
  109.     <div class="mb-5"></div>
  110.     <script>
  111.     
  112.     $(document).ready(function(){
  113.         
  114.         $('.presence').click(function(){
  115.             var idPlage = $(this).attr('idPlage');
  116.             var presence = $(this).prop('checked');
  117.             // alert(idPlage+' | '+presence);
  118.             $.ajax({
  119.                 method: "POST",
  120.                 url: "{{ path('formations_presences_ajax') }}",
  121.                 data: { 
  122.                     idPlage: idPlage,
  123.                     presence: presence
  124.                 }
  125.             })
  126.             .done(function( msg ) {
  127.                 // $('#resultats').html(msg);
  128.             });
  129.         });
  130.     });
  131.     </script>
  132.     
  133. {% endblock %}