setting.dictionnary.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?php
  2. global $myUser;
  3. User::check_access('dictionary','configure');
  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 hidden" data-tooltip title="Revenir à la liste parente" onclick="previous_list_dictionary(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="core_dictionary_search();">
  18. <span class="hidden"><option value="{{id}}" class="hidden">{{label}}</option></span>
  19. <option value="" selected> - </option>
  20. <?php foreach(Dictionary::loadAll(array('parent'=>0, 'state'=>Dictionary::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 class="bg-secondary text-light">
  32. <tr>
  33. <th class="py-2 text-right" style="width: 5%;">#</th>
  34. <th class="py-2">Valeur</th>
  35. <?php if($myUser->superadmin == 1): ?>
  36. <th class="py-2" style="width: 15%;">Slug</th>
  37. <th class="py-2" style="width: 30%;">Libellé de sous-liste</th>
  38. <?php endif; ?>
  39. <th class="py-2" style="width: 150px;"></th>
  40. </tr>
  41. <tr id="dictionaryForm" data-action="core_dictionary_save">
  42. <th class="py-2"></th>
  43. <th class="py-2"><input id="label" class="form-control form-control-sm" placeholder="Valeur" type="text"></th>
  44. <?php if($myUser->superadmin == 1): ?>
  45. <th class="py-2"><input id="slug" class="form-control form-control-sm" placeholder="slug" type="text"></th>
  46. <th class="py-2"><input id="sublistlabel" class="form-control form-control-sm" placeholder="Libellé de sous-liste" type="text"></th>
  47. <?php endif; ?>
  48. <th class="py-2 text-center"><div onclick="core_dictionary_save();" class="btn btn-small btn-success" data-tooltip title="Enregistrer"><i class="fas fa-check"></i></div></th>
  49. </tr>
  50. </thead>
  51. <tbody>
  52. <tr data-id="{{id}}" data-parent="{{parent}}" class="hidden">
  53. <td class="text-right">{{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_dictionary(this)" class="btn btn-success btn-squarred btn-mini" title="Consulter les sous-listes"><i class="fas fa-search-plus"></i></div>
  61. <div onclick="core_dictionary_edit(this)" class="btn btn-info btn-squarred btn-mini" title="Éditer la liste"><i class="fas fa-pencil-alt"></i></div>
  62. <div onclick="core_dictionary_delete(this)" class="btn btn-danger btn-squarred btn-mini" title="Supprimer la liste et ses enfants"><i class="fas fa-times"></i></div>
  63. </td>
  64. </tr>
  65. </tbody>
  66. </table>
  67. </div>
  68. </div>
  69. </div>