page.list.employee.php 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. <?php
  2. global $myUser;
  3. User::check_access('employee','read');
  4. require_once(__DIR__.SLASH.'Employee.class.php');
  5. ?>
  6. <div class="plugin-employee">
  7. <div class="row">
  8. <div class="col-md-12">
  9. <div class="d-flex my-2 w-100">
  10. <h4 class="d-inline-block my-auto mx-0 text-uppercase">Liste des fiche employés</h4>
  11. <div class="text-left ml-3 d-inline-block noPrint">
  12. <div onclick="window.print();" class="btn btn-info rounded-0 btn-squarred" title="Imprimer la page"><i class="fas fa-print"></i></div>
  13. <div onclick="employee_search(null,true);" id="export-employees-btn" class="btn btn-info btn-export rounded-0 btn-squarred ml-1" title="Exporter les résultats"><i class="fas fa-file-export"></i></div>
  14. </div>
  15. <div class="my-auto ml-auto mr-0 noPrint">
  16. <?php if($myUser->can('employee', 'edit')) : ?>
  17. <a href="index.php?module=employee&page=sheet.employee" class="btn btn-success right"><i class="fas fa-plus"></i> Ajouter</a>
  18. <?php endif; ?>
  19. </div>
  20. </div>
  21. <div class="clear noPrint"></div>
  22. </div>
  23. <div class="col-md-12">
  24. <select id="filters" data-type="filter" data-label="Recherche" data-slug="employee_search" data-function="employee_search" data-user-shortcut="#employee-user-shortcuts">
  25. <option value="main.label" data-filter-type="text">Libellé</option>
  26. <option value="main.birthName" data-filter-type="text">Nom de naissance</option>
  27. <option value="main.name" data-filter-type="text">Nom marital</option>
  28. <option value="main.firstname" data-filter-type="text">Prénom</option>
  29. <option value="main.job" data-filter-type="dictionary">Poste</option>
  30. <?php if($myUser->can('employee','configure')): ?>
  31. <option value="man.account" data-filter-type="user">Responsable</option>
  32. <?php endif; ?>
  33. <option value="main.workplace" data-filter-type="address">Lieu de travail</option>
  34. </select>
  35. <div id="employee-user-shortcuts">
  36. <h5 class="has-shortcut">MES RECHERCHES</h5>
  37. <ul class="no-chip p-0 m-0 mb-2">
  38. <li class="hidden d-inline-block">
  39. <div class="btn btn-square mr-1"
  40. title="Lancer la recherche"
  41. onclick="$('#filters').data('componentObject').filter_search_execute('{{uid}}');"
  42. ><i class="fas fa-search"></i> {{label}}
  43. </div>
  44. </li>
  45. </ul>
  46. </div>
  47. </div>
  48. </div>
  49. <h5 class="results-count"><span></span> Résultat(s)</h5>
  50. <div class="row">
  51. <!-- search results -->
  52. <div class="col-xl-12">
  53. <table id="employees" class="table table-striped " data-entity-search="employee_search">
  54. <thead>
  55. <tr>
  56. <!--<th>#</th>-->
  57. <th data-sortable="main.photo">Photo</th>
  58. <th data-sortable="main.name">Nom marital</th>
  59. <th data-sortable="main.firstname">Prénom</th>
  60. <th data-sortable="main.job">Poste</th>
  61. <th data-sortable="main.manager">Responsable</th>
  62. <th data-sortable="main.workplace">Lieu de travail</th>
  63. <th></th>
  64. </tr>
  65. </thead>
  66. <tbody>
  67. <tr data-id="{{id}}" class="hidden item-line">
  68. <!--<td class="align-middle">{{id}}</td>-->
  69. <td class="align-middle">{{#photo}}<img class="shadow-sm rounded-sm" style="max-width: 100px;height: auto;" src="{{photo}}">{{/photo}}</td>
  70. <td class="align-middle">{{name}} {{#birthName}}<br><span class="text-muted">Anc. ({{birthName}})</span>{{/birthName}}</td>
  71. <td class="align-middle">{{firstname}}</td>
  72. <td class="align-middle">{{job.label}}</td>
  73. <td class="align-middle text-center">
  74. {{#manager}}
  75. <img src="{{manager.photo}}" class="avatar-mini avatar-rounded avatar-login" data-tooltip title="{{manager.fullName}}"> <br><small class="text-muted">{{manager.fullName}}</small>
  76. {{/manager}}
  77. </td>
  78. <td class="align-middle">{{workplace}}</td>
  79. <td class="align-middle text-right">
  80. <div class="btn-group btn-group-sm" role="group">
  81. <a class="btn text-info" title="Éditer employee" href="index.php?module=employee&page=sheet.employee&id={{id}}"><i class="fas fa-pencil-alt"></i></a>
  82. <div class="btn text-danger" title="Supprimer employee" onclick="employee_delete(this);"><i class="far fa-trash-alt"></i></div>
  83. </div>
  84. </td>
  85. </tr>
  86. </tbody>
  87. </table><br>
  88. <!-- Pagination (data-range définit le nombre de pages max affichées avant et après la page courante) -->
  89. <ul class="pagination justify-content-center" data-range="5">
  90. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');employee_search();">
  91. <span class="page-link">{{label}}</span>
  92. </li>
  93. </ul>
  94. </div>
  95. </div>
  96. </div>