setting.userfirmrank.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. global $myUser;
  3. User::check_access('user','configure');
  4. //Refresh forcé des users pour avoir leurs établissements et rangs
  5. $users = User::getAll(array('right'=>true, 'force'=>true));
  6. $parameters = empty($myUser->superadmin) ? array('superadmin' => 0) : array();
  7. ?>
  8. <div class="row">
  9. <div class="col-md-12">
  10. <br>
  11. <h3>Établissement / Utilisateur / Rang</h3>
  12. <hr/>
  13. <div id="userfirmrankForm" data-action="core_user_savefirmrank">
  14. <div class="form-row">
  15. <div class="form-group col-md-3">
  16. <label for="firm">Établissement :</label>
  17. <select class="form-control" id="firm" placeholder="Etablissement" onchange="core_userfirmrank_search();" required>
  18. <option value="0">Tous</option>
  19. <?php foreach(Firm::loadAll() as $firm) : ?>
  20. <option value="<?php echo $firm->id; ?>"><?php echo $firm->label; ?></option>
  21. <?php endforeach; ?>
  22. </select>
  23. </div>
  24. <div class="form-group col-md-3">
  25. <label for="user">Utilisateur :</label>
  26. <input type="text" data-type="user" placeholder="Nom, prénom..." data-scope="0" class="form-control" id="user" name="user" required/>
  27. </div>
  28. <div class="form-group col-md-3">
  29. <label for="rank">Rang :</label>
  30. <select class="form-control" id="rank" placeholder="Rang" required>
  31. <?php foreach(Rank::loadAll($parameters) as $rank): ?>
  32. <option value="<?php echo $rank->id; ?>"><?php echo $rank->label; ?></option>
  33. <?php endforeach; ?>
  34. </select>
  35. </div>
  36. <div class="form-group col-md-3 text-right">
  37. <div class="btn btn-success noLabel " onclick="core_userfirmrank_save(this)"><i class="fas fa-check"></i> Enregistrer</div>
  38. </div>
  39. </div>
  40. </div>
  41. <br/>
  42. <div class="panel panel-default">
  43. <legend class="panel-heading">Utilisateurs de l'établissement :</legend>
  44. <table id="userfirmranks" class="table table-sm table-striped">
  45. <thead class="bg-secondary text-light">
  46. <tr>
  47. <th></th>
  48. <th>Nom</th>
  49. <th>Prénom</th>
  50. <th>Établissement</th>
  51. <th>Fonction</th>
  52. <th>Rang</th>
  53. <th class="text-right"></th>
  54. </tr>
  55. </thead>
  56. <tbody>
  57. <tr data-id="{{id}}" class="hidden">
  58. <td class="align-middle text-center">{{#avatar}}<img class="avatar-mini avatar-rounded" data-src="{{avatar}}"/>{{/avatar}}</td>
  59. <td class="align-middle">{{user.name}}</td>
  60. <td class="align-middle">{{user.firstname}}</td>
  61. <td class="align-middle">{{firm}}</td>
  62. <td class="align-middle">{{user.function}}</td>
  63. <td class="align-middle">{{rank}} {{#superadmin}}<code class="">(Super Admin)</code>{{/superadmin}}</td>
  64. <td class="align-middle text-right">
  65. <div onclick="core_userfirmrank_edit(this)" class="btn btn-info btn-squarred btn-mini"><i class="fas fa-pencil-alt"></i></div>
  66. <div onclick="core_userfirmrank_delete(this)" class="btn btn-danger btn-squarred btn-mini"><i class="fas fa-times"></i></div>
  67. </td>
  68. </tr>
  69. </tbody>
  70. </table>
  71. </div>
  72. </div>
  73. </div>