cms.parametres-general.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. <?php
  2. $checkMaintenance = core::isMaintenance();
  3. $checkDebug = core::isDebug();
  4. $checkLogSuccess = core::getConfig("LOG_SUCCESS");
  5. $checkLogWarning = core::getConfig("LOG_WARNING");
  6. $checkLogError = core::getConfig("LOG_ERROR");
  7. ?>
  8. <h4>Général</h4>
  9. <div class="element-parametres form-check form-switch">
  10. <input class="form-check-input" type="checkbox" role="switch" id="checkMaintenance" <?php core::checkboxSelecter($checkMaintenance) ?>>
  11. <label class="form-check-label" for="checkMaintenance">Site en mode maintenance (les salariés ne pourront plus faire d'action sur le site)</label>
  12. </div>
  13. <div class="element-parametres form-check form-switch">
  14. <input class="form-check-input" type="checkbox" role="switch" id="checkDebug" <?php core::checkboxSelecter($checkDebug) ?>>
  15. <label class="form-check-label" for="checkDebug">Afficher les erreurs (débug)</label>
  16. </div>
  17. <h4>Historique</h4>
  18. <div class="element-parametres form-check form-switch">
  19. <input class="form-check-input" type="checkbox" role="switch" id="checkLogSuccess" <?php core::checkboxSelecter($checkLogSuccess) ?>>
  20. <label class="form-check-label" for="checkLogSuccess">Historiser les actions réalisées avec succès</label>
  21. </div>
  22. <div class="element-parametres form-check form-switch">
  23. <input class="form-check-input" type="checkbox" role="switch" id="checkLogWarning" <?php core::checkboxSelecter($checkLogWarning) ?>>
  24. <label class="form-check-label" for="checkLogWarning">Historiser les actions réalisées avec warning</label>
  25. </div>
  26. <div class="element-parametres form-check form-switch">
  27. <input class="form-check-input" type="checkbox" role="switch" id="checkLogError" <?php core::checkboxSelecter($checkLogError) ?>>
  28. <label class="form-check-label" for="checkLogError">Historiser les actions en erreur</label>
  29. </div>
  30. <h4>Rechargement</h4>
  31. <div class="element-parametres">
  32. <a href="/submit.php?from=parametres-json-refresh" onclick="return confirm('Etes-vous certain de vouloir réinitialiser les JSON ?')"><button type="button" class="btn btn-warning">Réinitialisation des JSON</button></a>
  33. </div>
  34. <?php if (session::accessUserByType(1) and session::getId() == 1 and (ENVIRONNEMENT == "DEV" or ENVIRONNEMENT == "PREPROD")) { ?>
  35. <h4>Développement</h4>
  36. <div class="element-parametres">
  37. <a href="/submit.php?from=parametres-reset-datas" onclick="return confirm('Etes-vous certain de vouloir supprimer les données ?')"><button type="button" class="btn btn-warning">Nettoyer les données</button></a>
  38. </div>
  39. <div class="element-parametres">
  40. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalPHPInfo">PHP Infos</button>
  41. </div>
  42. <div class="modal fade" id="modalPHPInfo" tabindex="-1" role="dialog" aria-hidden="true">
  43. <div class="modal-dialog" role="document">
  44. <div class="modal-content">
  45. <div class="modal-header">
  46. <h5 class="modal-title" id="exampleModalLabel">PHP Info</h5>
  47. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  48. <span aria-hidden="true">&times;</span>
  49. </button>
  50. </div>
  51. <div class="modal-body">
  52. <iframe width="970" height="800" src="/parametres-debug-info.vue"></iframe>
  53. </div>
  54. </div>
  55. </div>
  56. </div>
  57. <?php } ?>
  58. <script>
  59. $(document).ready(function() {
  60. $('#checkMaintenance').on('change', function() {
  61. window.location.href = "/submit.php?from=parametres-maintenance-activation&actif=" + $("#checkMaintenance").prop('checked');
  62. });
  63. $('#checkDebug').on('change', function() {
  64. window.location.href = "/submit.php?from=parametres-debug-activation&actif=" + $("#checkDebug").prop('checked');
  65. });
  66. $('#checkLogSuccess').on('change', function() {
  67. window.location.href = "/submit.php?from=parametres-config&name=LOG_SUCCESS&value=" + $("#checkLogSuccess").prop('checked');
  68. });
  69. $('#checkLogWarning').on('change', function() {
  70. window.location.href = "/submit.php?from=parametres-config&name=LOG_WARNING&value=" + $("#checkLogWarning").prop('checked');
  71. });
  72. $('#checkLogError').on('change', function() {
  73. window.location.href = "/submit.php?from=parametres-config&name=LOG_ERROR&value=" + $("#checkLogError").prop('checked');
  74. });
  75. $('#modalPHPInfo').on('show.bs.modal', function() {
  76. $(this).find('.modal-body').css({
  77. width: 'auto', //probably not needed
  78. height: 'auto', //probably not needed
  79. 'max-height': '100%'
  80. });
  81. });
  82. });
  83. </script>
  84. <style>
  85. h4 {
  86. margin-top: 15px;
  87. }
  88. .element-parametres {
  89. margin-top: 5px;
  90. }
  91. .modal-body {
  92. position: relative;
  93. overflow-y: auto;
  94. max-height: 400px;
  95. padding: 15px;
  96. }
  97. .modal-dialog{
  98. width: 1005px !important;
  99. }
  100. .modal {
  101. --bs-modal-width: none;
  102. }
  103. .autoModal.modal .modal-body {
  104. max-height: 100%;
  105. }
  106. </style>