page.list.{{entity.readable}}.php 3.5 KB

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