page.list.import.php 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. global $myUser;
  3. User::check_access('import','read');
  4. require_once(__DIR__.SLASH.'Import.class.php');
  5. ?>
  6. <div class="plugin-import" data-mode="<?php echo $myUser->can('import','configure') ? 'configure':'execute' ?>">
  7. <div class="row">
  8. <div class="col-md-12">
  9. <div class="d-flex my-2 w-100">
  10. <h4 class="d-inline-block my-auto mx-0 text-uppercase">Liste des imports</h4>
  11. <div class="text-left ml-3 d-inline-block noPrint">
  12. <div onclick="window.print();" class="btn btn-info rounded-0 btn-squarred" title="Imprimer la page"><i class="fas fa-print"></i></div>
  13. <div onclick="import_search(null,true);" id="export-imports-btn" class="btn btn-info rounded-0 btn-squarred ml-1 btn-export" title="Exporter les résultats"><i class="fas fa-file-export"></i></div>
  14. </div>
  15. <div class="my-auto ml-auto mr-0 noPrint configure-only">
  16. <a href="index.php?module=import&page=sheet.import" class="btn btn-success right"><i class="fas fa-plus"></i> Ajouter</a>
  17. </div>
  18. </div>
  19. <div class="clear noPrint"></div>
  20. </div>
  21. <div class="col-md-12">
  22. <select id="import-filters" data-type="filter" data-label="Recherche" data-function="import_search">
  23. <option value="main.label" data-filter-type="text">Libellé</option>
  24. <?php if($myUser->can('import','configure') ): ?><option value="main.entity" data-filter-type="text">Entitée</option><?php endif;?>
  25. <option value="main.hasheader" data-filter-type="boolean">En-tête présentes</option>
  26. </select>
  27. </div>
  28. </div>
  29. <h5 class="results-count my-2"><span></span> Résultat(s)
  30. <!-- bloc de preference de pagination -->
  31. <small class="text-muted right text-muted text-small"><div class="d-inline-block mr-1" data-type="pagination-preference" data-table="#imports" data-value="20" data-max-item="100"></div></small><div class="clear"></div>
  32. </h5>
  33. <div class="row">
  34. <!-- search results -->
  35. <div class="col-xl-12">
  36. <!-- présentation tableau -->
  37. <table id="imports" class="table table-striped " data-entity-search="import_search">
  38. <thead>
  39. <tr>
  40. <!--<th>#</th>-->
  41. <th data-sortable="label">Libellé</th>
  42. <th class="configure-only" data-sortable="entity">Entitée</th>
  43. <!--<th data-sortable="startLine">Ligne de départ</th>
  44. <th data-sortable="startColumn">Colonne de départ</th>-->
  45. <th data-sortable="hasheader">Nom de colonnes présentes</th>
  46. <!--<th data-sortable="file">Excel</th>
  47. <th data-sortable="beforeCode">Code executé avant import</th>
  48. <th data-sortable="afterCode">Code exécuté après import</th>-->
  49. <th></th>
  50. </tr>
  51. </thead>
  52. <tbody>
  53. <tr data-id="{{id}}" class="hidden item-line">
  54. <!--<td class="align-middle">{{id}}</td>-->
  55. <td class="align-middle">{{label}}</td>
  56. <td class="configure-only" class="align-middle">{{entity}}</td>
  57. <!--<td class="align-middle">{{startLine}}</td>
  58. <td class="align-middle">{{startColumn}}</td>-->
  59. <td class="align-middle">{{#hasheader}} <i class="fas fa-check text-success"></i> OUI{{/hasheader}}{{^hasheader}}<i class="fas fa-times text-danger"></i> Non{{/hasheader}}</td>
  60. <!-- <td class="align-middle">
  61. <ul class="list-group list-group-flush shadow-sm">
  62. {{#file}}
  63. <li class="list-group-item p-1"><a href="{{url}}">{{label}}</a></li>
  64. {{/file}}
  65. </ul></td>
  66. <td class="align-middle">{{beforeCode}}</td>
  67. <td class="align-middle">{{afterCode}}</td>-->
  68. <td class="align-middle text-right">
  69. <div class="btn-group btn-group-sm" role="group">
  70. <a class="btn text-info configure-only" title="Éditer import" href="index.php?module=import&page=sheet.import&id={{id}}"><i class="fas fa-pencil-alt"></i></a>
  71. <a class="btn text-success execute-only" title="Utiliser import" href="index.php?module=import&page=sheet.import&id={{id}}"><i class="fas fa-file-import"></i></a>
  72. <div class="btn text-danger configure-only" title="Supprimer import" onclick="import_delete(this);"><i class="far fa-trash-alt"></i></div>
  73. </div>
  74. </td>
  75. </tr>
  76. </tbody>
  77. </table>
  78. <br>
  79. <!-- Pagination (data-range définit le nombre de pages max affichées avant et après la page courante) -->
  80. <ul class="pagination justify-content-center" data-range="5">
  81. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');import_search();">
  82. <span class="page-link">{{label}}</span>
  83. </li>
  84. </ul>
  85. </div>
  86. </div>
  87. </div>