page.list.application.access.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <?php
  2. global $myUser;
  3. User::check_access('host','read');
  4. require_once(__DIR__.SLASH.'ApplicationAccess.class.php');
  5. $defaultAccessFilters = array();
  6. if($application->id != 0){
  7. $defaultAccessFilters = filters_default(array(
  8. "",
  9. array('main.application' => $application->id)
  10. ));
  11. }
  12. ?>
  13. <div class="plugin-host plugin-host-access-list <?php echo ($application->id == 0?'':'embedded') ?>">
  14. <div class="row ">
  15. <div class="col-md-12">
  16. <div class="d-flex mb-2 w-100">
  17. <h6 class="d-inline-block my-auto mx-0 text-uppercase"> <span class="results-count"><span></span></span> Accès</h6>
  18. <div class="text-left ml-3 d-inline-block noPrint">
  19. <div onclick="window.print();" class="btn btn-small px-1" title="Imprimer la page"><i class="fas fa-print"></i></div>
  20. <div onclick="host_application_access_search(null,true);" id="export-hosts-btn" class="btn btn-small px-1 btn-export" title="Exporter les résultats"><i class="fas fa-file-export"></i></div>
  21. </div>
  22. </div>
  23. <div class="clear noPrint"></div>
  24. </div>
  25. <div class="col-md-12">
  26. <select id="application_access_filters" data-urlsearch data-type="filter" <?php echo $application->id!=0 ? 'data-hide-filters' : ''; ?> data-default='<?php echo json_encode($defaultAccessFilters); ?>' data-label="Recherche" data-function="host_application_access_search">
  27. <option value="main.application" data-filter-type="integer">Application</option>
  28. </select>
  29. </div>
  30. </div>
  31. <div class="row">
  32. <!-- search results -->
  33. <div class="col-xl-12">
  34. <table id="application-accesss" class="table table-striped " data-entity-search="host_application_access_search">
  35. <thead>
  36. <tr>
  37. <!--<th>#</th>-->
  38. <th data-sortable="label">Libellé</th>
  39. <th data-sortable="login">Identifiant</th>
  40. <th data-sortable="password">Mot de passe</th>
  41. <th class="no-embedded" data-sortable="application">Application liée</th>
  42. <th></th>
  43. </tr>
  44. </thead>
  45. <thead class="noReadOnly">
  46. <tr id="application-access-form" data-action="host_application_access_save" data-id="">
  47. <th><input value="" class="form-control form-control-sm machine-application" type="text" value id="label" ></th>
  48. <th><input value="" class="form-control form-control-sm machine-application" type="text" value id="login" ></th>
  49. <th><input value="" class="form-control form-control-sm machine-application" type="text" data-type="password" data-generator autocomplete="new-password" value id="password" ></th>
  50. <th class="no-embedded" ><input value="<?php echo $application->id; ?>" class="form-control" type="number" value id="application" ></th>
  51. <th class="text-right align-top"><div onclick="host_application_access_save();" class="btn btn-success btn-mini"><i class="fas fa-check"></i></div></th>
  52. </tr>
  53. </thead>
  54. <tbody>
  55. <tr data-id="{{id}}" class="hidden item-line">
  56. <td class="align-middle">{{label}}</td>
  57. <td class="align-middle"><div class="pointer" onclick="copy_string($(this).text());$.message('info','Copié!')">{{login}}</div></td>
  58. <td class="align-middle"><code class="pointer" onclick="copy_string($(this).text());$.message('info','Copié!')">{{password}}</code></td>
  59. <?php if($application->id == 0): ?> <td class="align-middle">{{application}}</td> <?php endif; ?>
  60. <td class="align-middle text-right">
  61. <div class="btn-group btn-group-sm" role="group">
  62. <div class="btn text-info noReadOnly" title="Éditer application_access" onclick="host_application_access_edit(this);"><i class="fas fa-pencil-alt"></i></div>
  63. <div class="btn text-danger noReadOnly" title="Supprimer application_access" onclick="host_application_access_delete(this);"><i class="far fa-trash-alt"></i></div>
  64. </div>
  65. </td>
  66. </tr>
  67. </tbody>
  68. </table>
  69. <!-- Pagination (data-range définit le nombre de pages max affichées avant et après la page courante) -->
  70. <ul class="pagination justify-content-center" data-range="5">
  71. <li class="page-item hidden" data-value="{{value}}" title="Voir la page {{label}}" onclick="$(this).parent().find('li').removeClass('active');$(this).addClass('active');host_application_access_search();">
  72. <span class="page-link">{{label}}</span>
  73. </li>
  74. </ul>
  75. </div>
  76. </div>
  77. </div>