setting.list.{{plugin}}.{{entity.readable}}.php 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {"label":"Setting liste","syntax":"php"}
  2. <?php
  3. global $myUser;
  4. User::check_access('{{plugin}}','configure');
  5. require_once(__DIR__.SLASH.'{{Entity}}.class.php');
  6. ?>
  7. <br>
  8. <h3>Réglages {{plugin}}</h3>
  9. <hr/>
  10. <div class="row">
  11. {{~! Recherche non avancée}}
  12. <div class="col-md-8">
  13. <select id="filters" data-type="filter" data-label="Recherche" data-function="{{plugin}}_{{entity_readable}}_search">
  14. <option value="label" data-filter-type="text">Libellé</option>
  15. </select>
  16. </div>
  17. {{/~}}
  18. <div class="col-md-4">
  19. <?php if($myUser->can('{{plugin}}', 'edit')) : ?>
  20. <a href="index.php?module={{plugin}}&page=sheet.{{entity.readable}}" class="btn btn-success right"><i class="fas fa-plus"></i> Ajouter</a>
  21. <?php endif; ?>
  22. </div>
  23. </div>
  24. <br/>
  25. <div class="row">
  26. <!-- search results -->
  27. <div class="col-xl-12">
  28. <table id="{{entity-readable}}s" class="table table-striped " data-entity-search="{{plugin}}_{{entity_readable}}_search">
  29. <thead>
  30. <tr>
  31. <th>#</th>{{:fields}}
  32. <th data-sortable="{{key}}">{{value.label}}</th>{{/:fields}}
  33. <th></th>
  34. </tr>
  35. </thead>
  36. {{~ Formulaire dans le tableau de liste }}
  37. <thead>
  38. <tr id="{{entity-readable}}-form" data-action="{{plugin}}_{{entity_readable}}_save" data-id="">
  39. <th>#</th>{{:fields}}
  40. <th><input id="{{key}}" name="{{key}}" class="form-control" placeholder="" value="" type="text"></th>{{/:fields}}
  41. <th><div onclick="{{plugin}}_{{entity_readable}}_save();" class="btn btn-success"><i class="fas fa-check"></i> Enregistrer</div></th>
  42. </tr>
  43. </thead>
  44. {{/~}}
  45. <tbody>
  46. <tr data-id="{{id}}" class="hidden">
  47. <td>{{id}}</td>{{:fields}}
  48. <td>{{{{value.key}}}}</td>{{/:fields}}
  49. <td>
  50. <div class="btn-group btn-group-sm" role="group">
  51. {{~! Formulaire dans le tableau de liste }}
  52. <a class="btn btn-info" href="index.php?module={{plugin}}&page=sheet.{{entity.readable}}&id={{id}}"><i class="fas fa-pencil-alt"></i></a>
  53. {{/~}}
  54. {{~ Formulaire dans le tableau de liste }}
  55. <div class="btn btn-info " onclick="{{plugin}}_{{entity_readable}}_edit(this);"><i class="fas fa-pencil-alt"></i></div>
  56. {{/~}}
  57. <div class="btn btn-danger " onclick="{{plugin}}_{{entity_readable}}_delete(this);"><i class="far fa-trash-alt"></i></div>
  58. </div>
  59. </td>
  60. </tr>
  61. </tbody>
  62. </table>
  63. {{~! Recherche non avancée}}<!-- Pagination -->
  64. <ul class="pagination justify-content-center">
  65. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');{{plugin}}_{{entity_readable}}_search();">
  66. <span class="page-link">{{label}}</span>
  67. </li>
  68. </ul>{{/~}}
  69. </div>
  70. </div>