setting.right.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. global $myUser;
  3. User::check_access('rank','configure');
  4. $rank = Rank::getById($_['rank']);
  5. $firms = Firm::loadAll();
  6. $firms[] = Firm::anonymous_firm();
  7. ?>
  8. <div class="row">
  9. <div class="col-md-12">
  10. <br>
  11. <h3 id="targetUid" data-rank="<?php echo $rank->id ?>">Droits pour le rang <span class="text-success"><?php echo $rank->label ?></span> :</h3>
  12. <hr>
  13. <div class="row">
  14. <div class="col-md-12">
  15. <label class="mb-1">Établissement concerné :</label>
  16. <select onchange="core_right_search();" class="form-control" id="firm">
  17. <option value="0">Tous</option>
  18. <?php foreach($firms as $firm) : ?>
  19. <option value="<?php echo $firm->id; ?>"><?php echo $firm->label; ?></option>
  20. <?php endforeach; ?>
  21. </select>
  22. </div>
  23. </div>
  24. <br>
  25. <div class="panel panel-default">
  26. <table id="rights" class="table table-striped">
  27. <thead class="bg-secondary text-white">
  28. <tr>
  29. <th>Libellé</th>
  30. <th class="text-center"></th>
  31. <th class="text-center">Consultation</th>
  32. <th class="text-center">Édition</th>
  33. <th class="text-center">Suppression</th>
  34. <th class="text-center">Configuration</th>
  35. </tr>
  36. </thead>
  37. <tbody>
  38. <tr class="hidden" data-scope="{{scope}}">
  39. <td class="align-middle">{{description}} <code>({{scope}})</code></td>
  40. <td class="align-middle text-center"><div class="btn btn-mini btn-warning" onclick="right_switch(this);"><i class="fas fa-redo"></i> Tout switcher</div></td>
  41. <td class="align-middle text-center">
  42. <input data-right="read" data-result="{{read}}" onchange="core_right_toggle(this)" type="checkbox" autocomplete="off" name="read-{{scope}}" id="read-{{scope}}" data-type="checkbox">
  43. </td>
  44. <td class="align-middle text-center">
  45. <input data-right="edit" data-result="{{edit}}" onchange="core_right_toggle(this)" type="checkbox" autocomplete="off" name="edit-{{scope}}" id="edit-{{scope}}" data-type="checkbox">
  46. </td>
  47. <td class="align-middle text-center">
  48. <input data-right="delete" data-result="{{delete}}" onchange="core_right_toggle(this)" type="checkbox" autocomplete="off" name="delete-{{scope}}" id="delete-{{scope}}" data-type="checkbox">
  49. </td>
  50. <td class="align-middle text-center">
  51. <input data-right="configure" data-result="{{configure}}" onchange="core_right_toggle(this)" type="checkbox" autocomplete="off" name="configure-{{scope}}" id="configure-{{scope}}" data-type="checkbox">
  52. </td>
  53. </tr>
  54. </tbody>
  55. </table>
  56. </div>
  57. </div>
  58. </div>