This commit is contained in:
KANE LAZENI 2026-01-04 09:19:38 +00:00
parent 0264278e8f
commit d8ddaeeae8
2 changed files with 5 additions and 63 deletions

View File

@ -52,68 +52,6 @@ $(function() {
});
/**
* Fonction principale de rafraîchissement du gabarit (UI et Session)
* Gère la mise à jour des données et la redirection forcée en cas de déconnexion.
*/
/*
function raffraichier_gabarit() {
const racine = $("#racineWeb").val() || "/";
const vueActuelle = $("#vue").val();
const codeLangue = $("#codeLangue").val() || "fr_FR";
$.ajax({
url: racine + "Ajaxgabarit/",
type: 'GET',
cache: false,
success: function(data) {
// 1. On transforme la chaîne 'data' en objet jQuery pour manipulation
const $dataFrag = $(data);
// 2. Injection dans le DOM
$("#div_ajaxgabarit").html($data);
// 3. RECUPERATION SECURISEE DU CODE SOCIETE
// On essaie d'abord dans le DOM, puis dans le fragment reçu si le DOM est lent
let codeSociete = $("#div_ajaxgabarit").find("#codeSociete").val()
|| $dataFrag.filter("#codeSociete").val()
|| $("#codeSociete").val();
// Debug en console pour vérifier la capture
console.log("Check Session - codeSociete trouvé :", codeSociete);
// 4. VERIFICATION DE LA SESSION
if ((!codeSociete || codeSociete.trim() === "") && vueActuelle !== "Connexion") {
const msg = "Votre session a expiré. Veuillez vous reconnecter.";
const msgEng = "Your session has expired. Please log in again.";
// On bloque l'écran avec confirm_ebene
confirm_ebene(msg, msgEng).then(() => {
window.location.assign(racine + "Connexion/deconnecter/");
});
return;
}
// Si on arrive ici, la session est valide
},
error: function(xhr) {
// Si le serveur renvoie une erreur HTTP (401, 403, 500)
if (xhr.status === 401 && vueActuelle !== "Connexion") {
window.location.assign(racine + "Connexion/deconnecter/");
}
},
complete: function() {
// Ré-initialisation des composants sur le nouveau HTML
if ($.isFunction($.fn.datepicker)) {
$(".datepicker").datepicker();
}
}
});
}
*/
function raffraichier_gabarit()
{
$.ajax({

View File

@ -612,7 +612,11 @@ $activeChildId = $menuData['child'];
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<!-- Application Scripts -->
<script src="/Js/fonctions.js?ver=2026.01.04.20"></script>
<script src="/Js/fonctions.js?ver=2026.01.04.21"></script>
<script type="text/javascript">
raffraichier_gabarit();
</script>
<script type="text/javascript">
setInterval(function() {