2
0

cms.parametres-general.php 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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. <?php if (session::accessUserByType(1) and session::getId() == 1 and (ENVIRONNEMENT == "DEV" or ENVIRONNEMENT == "PREPROD")) { ?>
  31. <h4>Développement</h4>
  32. <div class="element-parametres">
  33. <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>
  34. </div>
  35. <div class="element-parametres">
  36. <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#modalPHPInfo">PHP Infos</button>
  37. </div>
  38. <div class="modal fade" id="modalPHPInfo" tabindex="-1" role="dialog" aria-hidden="true">
  39. <div class="modal-dialog" role="document">
  40. <div class="modal-content">
  41. <div class="modal-header">
  42. <h5 class="modal-title" id="exampleModalLabel">PHP Info</h5>
  43. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  44. <span aria-hidden="true">&times;</span>
  45. </button>
  46. </div>
  47. <div class="modal-body">
  48. <iframe width="970" height="800" src="/parametres-debug-info.vue"></iframe>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <?php } ?>
  54. <script>
  55. $(document).ready(function() {
  56. $('#checkMaintenance').on('change', function() {
  57. window.location.href = "/submit.php?from=parametres-maintenance-activation&actif=" + $("#checkMaintenance").prop('checked');
  58. });
  59. $('#checkDebug').on('change', function() {
  60. window.location.href = "/submit.php?from=parametres-debug-activation&actif=" + $("#checkDebug").prop('checked');
  61. });
  62. $('#checkLogSuccess').on('change', function() {
  63. window.location.href = "/submit.php?from=parametres-config&name=LOG_SUCCESS&value=" + $("#checkLogSuccess").prop('checked');
  64. });
  65. $('#checkLogWarning').on('change', function() {
  66. window.location.href = "/submit.php?from=parametres-config&name=LOG_WARNING&value=" + $("#checkLogWarning").prop('checked');
  67. });
  68. $('#checkLogError').on('change', function() {
  69. window.location.href = "/submit.php?from=parametres-config&name=LOG_ERROR&value=" + $("#checkLogError").prop('checked');
  70. });
  71. $('#modalPHPInfo').on('show.bs.modal', function() {
  72. $(this).find('.modal-body').css({
  73. width: 'auto', //probably not needed
  74. height: 'auto', //probably not needed
  75. 'max-height': '100%'
  76. });
  77. });
  78. });
  79. </script>
  80. <style>
  81. h4 {
  82. margin-top: 15px;
  83. }
  84. .element-parametres {
  85. margin-top: 5px;
  86. }
  87. .modal-body {
  88. position: relative;
  89. overflow-y: auto;
  90. max-height: 400px;
  91. padding: 15px;
  92. }
  93. .modal-dialog{
  94. width: 1005px !important;
  95. }
  96. .modal {
  97. --bs-modal-width: none;
  98. }
  99. .autoModal.modal .modal-body {
  100. max-height: 100%;
  101. }
  102. </style>