setting.export.php 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. global $myUser;
  3. if(!$myUser->connected()) throw new Exception("Vous devez être connecté pour accéder à cette fonctionnalité",401);
  4. if(!$myUser->can('export','configure')) throw new Exception("Vous n'avez pas la permission pour exécuter cette fonctionnalité",403);
  5. require_once(__DIR__.SLASH.'ExportModel.class.php');
  6. $plugins = Plugin::getAll(true);
  7. foreach ($plugins as $plugin)
  8. $allPlugs[$plugin->folder] = $plugin->name;
  9. ?>
  10. <div class="row">
  11. <div class="col-md-12">
  12. <br>
  13. <?php if($myUser->can('export', 'edit')) : ?>
  14. <a href="index.php?module=export&page=sheet" class="btn btn-success float-right"><i class="fas fa-plus"></i> Créer un modèle d'export</a>
  15. <?php endif; ?>
  16. <h3>Réglages Export Modèle</h3>
  17. <hr>
  18. </div>
  19. <div class="col-md-12">
  20. <select id="filters" data-slug="exportmodel-search" data-join="and" data-type="filter" data-label="Recherche" data-function="export_exportmodel_search">
  21. <option value="description" data-filter-type="text">Description</option>
  22. <option value="filename" data-filter-type="text">Nom de fichier</option>
  23. <option value="plugin" data-filter-type="dictionnary" data-filter-source='<?php echo json_encode($allPlugs); ?>'>Plugin</option>
  24. <option value="privacy" data-filter-type="dictionnary" data-filter-source='<?php echo json_encode(array(ExportModel::PRIVACY_PUBLIC=>'Public', ExportModel::PRIVACY_PRIVATE=>'Privé')); ?>'>Visibilité</option>
  25. </select>
  26. </div>
  27. </div>
  28. <br>
  29. <div class="row">
  30. <!-- search results -->
  31. <div class="col-xl-12">
  32. <table id="exportmodels" class="table table-striped table-exportmodels " data-entity-search="export_exportmodel_search">
  33. <thead>
  34. <tr>
  35. <th data-sortable="id">#</th>
  36. <th data-sortable="label">Libellé</th>
  37. <th data-sortable="description">Description</th>
  38. <th data-sortable="plugin">Plugin</th>
  39. <th style="width: 150px;">Jeu de données</th>
  40. <th data-sortable="filename">Nom de fichier</th>
  41. <th></th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <tr data-id="{{id}}" class="hidden">
  46. <td>{{id}}</td>
  47. <td class="exportmodel-{{class}}" title="Export modèle {{privacy}}">{{label}}</td>
  48. <td>{{description}}</td>
  49. <td>{{pluginName}}</td>
  50. <td>{{datasetName}}</td>
  51. <td>{{filename}}</td>
  52. <td class="text-right">
  53. <a class="btn btn-info btn-squarred btn-mini" href="index.php?module=export&page=sheet&id={{id}}"><i class="fas fa-pencil-alt"></i></a>
  54. <div class="btn btn-danger btn-squarred btn-mini" onclick="export_exportmodel_delete(this);"><i class="fas fa-times"></i></div>
  55. </td>
  56. </tr>
  57. </tbody>
  58. </table>
  59. <!-- Pagination -->
  60. <ul class="pagination justify-content-center">
  61. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');export_exportmodel_search()">
  62. <a class="page-link" href="#">{{label}}</a>
  63. </li>
  64. </ul>
  65. </div>
  66. </div>