cms.parametres-general.php 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. <h4>Infos Git</h4>
  59. <div class="element-parametres">
  60. <?php echo git::getVersion() ?>
  61. </div>
  62. <script>
  63. $(document).ready(function() {
  64. $('#checkMaintenance').on('change', function() {
  65. window.location.href = "/submit.php?from=parametres-maintenance-activation&actif=" + $("#checkMaintenance").prop('checked');
  66. });
  67. $('#checkDebug').on('change', function() {
  68. window.location.href = "/submit.php?from=parametres-debug-activation&actif=" + $("#checkDebug").prop('checked');
  69. });
  70. $('#checkLogSuccess').on('change', function() {
  71. window.location.href = "/submit.php?from=parametres-config&name=LOG_SUCCESS&value=" + $("#checkLogSuccess").prop('checked');
  72. });
  73. $('#checkLogWarning').on('change', function() {
  74. window.location.href = "/submit.php?from=parametres-config&name=LOG_WARNING&value=" + $("#checkLogWarning").prop('checked');
  75. });
  76. $('#checkLogError').on('change', function() {
  77. window.location.href = "/submit.php?from=parametres-config&name=LOG_ERROR&value=" + $("#checkLogError").prop('checked');
  78. });
  79. $('#modalPHPInfo').on('show.bs.modal', function() {
  80. $(this).find('.modal-body').css({
  81. width: 'auto', //probably not needed
  82. height: 'auto', //probably not needed
  83. 'max-height': '100%'
  84. });
  85. });
  86. });
  87. </script>
  88. <style>
  89. h4 {
  90. margin-top: 15px;
  91. }
  92. .element-parametres {
  93. margin-top: 5px;
  94. }
  95. .modal-body {
  96. position: relative;
  97. overflow-y: auto;
  98. max-height: 400px;
  99. padding: 15px;
  100. }
  101. .modal-dialog{
  102. width: 1005px !important;
  103. }
  104. .modal {
  105. --bs-modal-width: none;
  106. }
  107. .autoModal.modal .modal-body {
  108. max-height: 100%;
  109. }
  110. </style>