setting.dictionnary.php 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. global $myUser;
  3. if(!$myUser->can('dictionnary','configure')) throw new Exception("Permissions insuffisantes",403);
  4. ?>
  5. <div class="row">
  6. <div class="col-md-12">
  7. <br>
  8. <h3>Réglages Listes</h3>
  9. <hr/>
  10. <div class="panel panel-default lists-settings">
  11. <div class="form-inline">
  12. <div class="lists-navigation-block">
  13. <div id="prev-button" class="btn btn-info hide" onclick="previous_list_dictionnary(this)">
  14. <i class="fas fa-angle-left pointer noPrint"></i>
  15. </div>
  16. <span>Voir les éléments de la liste &nbsp;&nbsp;</span>
  17. <select id="parent" class="form-control lists-selector" onchange="search_dictionnary();">
  18. <span class="hidden"><option value="{{id}}" class="hidden">{{label}}</option></span>
  19. <option value="" selected>-</option>
  20. <?php foreach(Dictionnary::loadAll(array('parent'=>0, 'state'=>Dictionnary::ACTIVE), array('id')) as $list): ?>
  21. <option value="<?php echo $list->id; ?>"><?php echo $list->label; ?></option>
  22. <?php endforeach; ?>
  23. </select>
  24. <?php if($myUser->superadmin == 1): ?>
  25. <code>Pour ajouter une liste racine, ne rien sélectionner dans cette liste</code><br/>
  26. <?php endif; ?>
  27. </div>
  28. </div>
  29. <br/>
  30. <table id="dictionnaries" class="table table-striped table-dictionaries">
  31. <thead>
  32. <tr>
  33. <th style="width: 5%;">#</th>
  34. <th>Valeur</th>
  35. <?php if($myUser->superadmin == 1): ?>
  36. <th style="width: 15%;">Slug</th>
  37. <th style="width: 30%;">Libellé de sous-liste</th>
  38. <?php endif; ?>
  39. <th style="width: 10%;"></th>
  40. </tr>
  41. <tr id="dictionnaryForm" data-action="save_dictionnary">
  42. <th>#</th>
  43. <th><input id="label" class="form-control" placeholder="Valeur" type="text"></th>
  44. <?php if($myUser->superadmin == 1): ?>
  45. <th><input id="slug" class="form-control" placeholder="slug" type="text"></th>
  46. <th><input id="sublistlabel" class="form-control" placeholder="Libellé de sous-liste" type="text"></th>
  47. <?php endif; ?>
  48. <th><div onclick="save_dictionnary();" class="btn btn-success "><i class="fas fa-check"></i> Enregistrer</div></th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <tr data-id="{{id}}" data-parent="{{parent}}" class="hidden">
  53. <td>{{id}}</td>
  54. <td class="itemLabel">{{label}}</td>
  55. <?php if($myUser->superadmin == 1): ?>
  56. <td>{{slug}}</td>
  57. <td>{{sublistlabel}}</td>
  58. <?php endif; ?>
  59. <td class="text-center">
  60. <div onclick="add_sub_dictionnary(this)" class="btn btn-success btn-squarred btn-mini"><i class="fas fa-search-plus"></i></div>
  61. <div onclick="edit_dictionnary(this)" class="btn btn-info btn-squarred btn-mini"><i class="fas fa-pencil-alt"></i></div>
  62. <div onclick="delete_dictionnary(this)" class="btn btn-danger btn-squarred btn-mini"><i class="fas fa-times"></i></div>
  63. </td>
  64. </tr>
  65. </tbody>
  66. </table>
  67. </div>
  68. </div>
  69. </div>