utente.welcome.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  1. {% extends 'base.html' %}
  2. {% block headersupplement %}
  3. <script language="JavaScript">
  4. function toggleCSV(source) {
  5. checkboxes = document.getElementsByName('MultipleCSVSelect');
  6. for(var i=0, n=checkboxes.length;i<n;i++) {
  7. checkboxes[i].checked = source.checked;
  8. }
  9. }
  10. {% if listaok or listanotok or listanotass %}
  11. $(window).on('load', function() {
  12. $('#StatoDocumentiCaricatiId').modal('show');
  13. });
  14. {% endif %}
  15. </script>
  16. {% endblock %}
  17. {% block body %}
  18. <form name="inputUtenti" method="POST">
  19. {% csrf_token %}
  20. <div class='form-control'>
  21. {% if "UTENTE.CREA" in permesso %}
  22. <button type='submit' class="btn btn-primary" name='scelta' value='Nuovo Dipendente'>Nuovo Dipendente</button>
  23. <button type='button' class="btn btn-primary" name='TastoCaricaIndici' data-bs-toggle='modal' data-bs-target='#CaricaIndiceModal'>Carica Lista Nuovi Dipendenti</button>
  24. <button type='submit' class="btn btn-primary" name='ScaricaCSVSelezionati' value="Scarica CSV Selezionati"/>Scarica CSV Selezionati</button>
  25. {% endif %}
  26. <input type='text' class='form-inline' name='valoredacercare' id='valoredacercare' value='{{ formcerca.valoredacercare.value }}' >
  27. <button type='submit' class="btn btn-primary" name="cerca" value="Cerca">Cerca</button>
  28. <button type='submit' class="btn btn-primary" name="indietro" value="Indietro">Indietro</button>
  29. </div>
  30. <div class='form-control'>
  31. Numero di dipendenti selezionati {{ numeroRecordAttuali }} su un totale di {{ numeroRecordAzienda }}.
  32. </div>
  33. <table class='table table-striped table-hover'>
  34. <thead class='thead-dark'>
  35. <tr>
  36. {% if "UTENTE.CREA" in permesso %}<th scope='col'>*</th>{% endif %}
  37. <th scope='col' style='white-space: nowrap; width: 1%;'>Dipendente&nbsp;
  38. <button name='utDW' type="submit" class="btn btn-outline-primary btn-sm">&#x2193;</button>
  39. <button name='utUP' type="submit" class="btn btn-outline-primary btn-sm">&#x2191;</button></th>
  40. <th scope='col' style='white-space: nowrap; width: 1%;'>Codice Fiscale</th>
  41. <th scope='col' style='white-space: nowrap; width: 1%;'>Sede&nbsp;
  42. <button name='seDW' type="submit" class="btn btn-outline-primary btn-sm">&#x2193;</button>
  43. <button name="seUP" type="submit" class="btn btn-outline-primary btn-sm">&#x2191;</button></th>
  44. <th scope='col'>Data di Nascita</th>
  45. <th scope='col'>Luogo di Nascita</th>
  46. {% if "DOCUMENTO" in permesso %}
  47. <th scope='col'>documenti</th>
  48. {% endif %}
  49. {% if "UTENTE.EDIT" in permesso %}
  50. <th scope='col'>Mail</th>
  51. <th scope='col'>Pin</th>
  52. {% endif %}
  53. <th scope='col'>Inserimento</th>
  54. <th scope='col'><input class="form-check-input" type="checkbox" id="selectCSVAll" name="selectCSVAll" value='0' onClick="toggleCSV(this);"/></th>
  55. </tr>
  56. </thead>
  57. <tbody>
  58. {% for uu in utenti %}
  59. <tr>
  60. {% if "UTENTE.EDIT" in permesso %}
  61. <td> <button type='submit' class='btn btn-primary ' name='scelta' value='{{ uu.id }}'>Edit</button></td>
  62. {% endif %}
  63. <td {% if not uu.enabled %} class="text-decoration-line-through" {% endif %} > {{ uu.nome }} </td>
  64. <td> {{ uu.codicefiscale }} </td>
  65. <td> {{ uu.sede.nome }} </td>
  66. <td> {{ uu.datanascita|date:'d/m/Y' }} </td>
  67. <td> {{ uu.luogonascita }} </td>
  68. {% if "DOCUMENTO" in permesso %}
  69. <td>{% if uu.documenti %}<a href='{% url 'documento:welcome' uu.id %}'>Download</a>{% else %} N/A {% endif %}</td>
  70. {% endif %}
  71. {% if "UTENTE.EDIT" in permesso %}
  72. <td> {{ uu.mail }} </td>
  73. <td> {{ uu.pin }} </td>
  74. {% endif %}
  75. <td> {{ uu.inserimento|date:'d/m/Y' }} </td>
  76. {% if "DOCUMENTO" in permesso %}
  77. <td>
  78. <input class="form-check-input" type="checkbox" id="MultipleCSVSelect-{{ uu.id }}" name="MultipleCSVSelect" value='{{ uu.id }}'>
  79. </td>
  80. {% endif %}
  81. </tr>
  82. {% endfor %}
  83. </tbody>
  84. </table>
  85. </form>
  86. {% if "UTENTE.CREA" in permesso %}
  87. <!-- Modal -->
  88. <div class="modal fade" id="CaricaIndiceModal" tabindex="-1" role="dialog" aria-labelledby="CaricaIndiceLabel" aria-hidden="false">
  89. <div class="modal-dialog" role="document">
  90. <div class="modal-content">
  91. <form name='formCaricaIndice' method='POST' enctype='multipart/form-data'>
  92. {% csrf_token %}
  93. <div class="modal-header">
  94. <h5 class="modal-title" id="CaricaIndiceLabel">Carica Elenco Dipendenti</h5>
  95. <span aria-hidden="true">&times;</span>
  96. </button>
  97. </div>
  98. <div class="modal-body">
  99. Caricamento Lista Dipendenti<br>
  100. Formato File CSV - obbligatorio <br>
  101. Separatore: ';' - prima riga: "Nome colonna".</br>
  102. <table class='table table-striped table-hover'>
  103. <tbody>
  104. <tr>
  105. <td>Nome Cognome</td>
  106. <td>Codice Fiscale</td>
  107. <td>Data Nascita</td>
  108. <td>Luogo Nascita</td>
  109. <td>email</td>
  110. <td>Sede Indentificativo</td>
  111. </tr>
  112. </tbody>
  113. </table><br>
  114. <label for='indice'>Elenco Dipendenti:&nbsp;</label>
  115. <input type='file' name='indice' id='indice' value='' accept='text/csv'>
  116. </div>
  117. <div class="modal-footer">
  118. <button type="submit" name="CaricaIndice" value='Carica Lista' class="btn btn-primary">Carica Lista Dipendenti</button>
  119. <button type="button" class="btn btn-primary" data-bs-dismiss="modal">Annulla</button>
  120. </div>
  121. </form>
  122. </div>
  123. </div>
  124. </div>
  125. </div>
  126. <!-- end modal -->
  127. {% endif %}
  128. {% endblock %}
  129. {% block bodybottom %}
  130. {% include "utente.stato.html" %}
  131. {% endblock %}