From 422feb8ce45988f745569a42c1f28d768a492172 Mon Sep 17 00:00:00 2001 From: KONE SOREL Date: Fri, 23 Jan 2026 16:20:53 +0000 Subject: [PATCH] fd --- Js/fonctions.js | 1100 ++++++++++++++++++++++++++++++----------------- Vue/gabarit.php | 2 +- 2 files changed, 706 insertions(+), 396 deletions(-) diff --git a/Js/fonctions.js b/Js/fonctions.js index a9a5804..38453f8 100755 --- a/Js/fonctions.js +++ b/Js/fonctions.js @@ -78,9 +78,10 @@ function raffraichier_gabarit() const msg = "Votre session a expiré. Vous serez déconnecté."; const msgEng = "Your session has expired. You will be disconnected."; - alert_ebene(msg, msgEng); - - window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/"); + alert_ebene(msg, msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + window.location.assign($("#racineWeb" ).val()+"Connexion/deconnecter/"); + }); } }, error: function(errorData) @@ -222,12 +223,12 @@ function closeSwal() { * Affiche une information bilingue. */ -function alert_ebene(msgFr, msgEn) { +async function alert_ebene(msgFr, msgEn) { const codeLangue = document.querySelector("#codeLangue")?.value || "fr_FR"; const message = (codeLangue === "en_US") ? msgEn : msgFr; - // Appel via baseSwal - return baseSwal({ + // On attend que l'utilisateur clique sur OK avant de sortir + await baseSwal({ text: message, icon: 'info', confirmButtonText: (codeLangue === "en_US") ? "OK" : "D'accord", @@ -237,6 +238,7 @@ function alert_ebene(msgFr, msgEn) { } + /* function alert_ebene(msgFr, msgEn) { const codeLangue = document.querySelector("#codeLangue")?.value || "fr_FR"; @@ -577,7 +579,11 @@ function ajax_context_police_afficher(idPolice) { const msg = "Erreur lors de la préparation du dossier police."; const msgEng = "Error while preparing the policy file."; - alert_ebene(msg, msgEng); + alert_ebene(msg, msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); + }, complete: function() { @@ -666,9 +672,10 @@ function imprimer_quittance_client(idQuittance) { const v_msg = "Rien à imprimer !"; const v_msgEng = "Nothing to print!"; - alert_ebene(v_msg, v_msgEng); - - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } /* =================================================== @@ -749,9 +756,11 @@ function assurance_familiale() { v_msg="Ce n\'est pas une police FAMILIALE!"; v_msgEng="This is not a FAMILIY policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } window.location.assign($("#racineWeb" ).val()+"Assuranceindividuelle/"); @@ -781,9 +790,11 @@ function creer_adherents() { v_msg="Ce n\'est pas une police GROUPE!"; v_msgEng="This is not a GROUP policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } etat=$("#codeEtatPolice_C").val(); @@ -792,27 +803,33 @@ function creer_adherents() { v_msg="Attention! Police résiliée!"; v_msgEng="Warning! Terminated policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="SU") { v_msg="Attention! Police suspendue!"; v_msgEng="Warning! Suspended policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="AN") { v_msg="Attention! Police annulée!"; v_msgEng="Warning! Canceled policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } window.location.assign($("#racineWeb" ).val()+"Creeradherent/"); @@ -828,9 +845,11 @@ function prorater_prime_adherent() { v_msg="Veuillez sélectionner un collège!"; v_msgEng="Please select a college!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } donnees = 'idCollege='+idCollege; @@ -1226,9 +1245,11 @@ function prorater_prime_adherent() { v_msg="Veuillez sélectionner un collège!"; v_msgEng="Please select a college!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } donnees = 'idCollege='+idCollege; @@ -1257,10 +1278,14 @@ function changer_avenant_incorporation() { v_msg="Veuillez sélectionner un avenant!"; v_msgEng="Please select an Amendment!"; - alert_ebene(v_msg, v_msgEng); - $("#idAvenant").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idAvenant").focus(); + return; + }); + + } donnees = 'idAvenant='+idAvenant; @@ -1310,27 +1335,35 @@ function controle_age(dater, codeLienParente) { v_msg="Âge "+age+" supérieur à 65 ans!"; v_msgEng="Age "+age+" over 65!"; - alert_ebene(v_msg, v_msgEng); - return false; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return false; + }); } if ( (codeLienParente=="E")&& (age>21) ) { v_msg="Âge "+age+" => Enfant âgé de plus de 21 ans!"; v_msgEng="Âge "+age+" => Child over 21 years old!"; - alert_ebene(v_msg, v_msgEng); - return false; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + + return false; + }); } if ( (codeLienParente=="O")&& (age>21) ) { v_msg="Âge "+age+" => Enfant âgé de plus de 21 ans!"; v_msgEng="Âge "+age+" => Child over 21 years old!"; - alert_ebene(v_msg, v_msgEng); - return false; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + + return false; + }); } return true; @@ -1344,10 +1377,14 @@ function controler_piece_beneficiaire() { v_msg="Veuillez sélection la nature de la pièce!"; v_msgEng="Please select the type of document!"; - alert_ebene(v_msg, v_msgEng); - $("#codeNaturePiece").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeNaturePiece").focus(); + return; + }); + + } $('#numeroPiece').removeAttr('minlength'); @@ -1463,18 +1500,22 @@ function creer_avenant() { v_msg="Attention! Police résiliée!"; v_msgEng="Warning! Terminated policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="AN") { v_msg="Attention! Police annulée!"; v_msgEng="Warning! Canceled policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } window.location.assign($("#racineWeb" ).val()+"Creeravenant/"); @@ -1489,9 +1530,11 @@ function enregistrer_avenant() { v_msg="Veuillez sélectionner le type d\'avenant!"; v_msgEng="Please select the type of amendment!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } var d_effet = new Date($("#dateEffetSql").val()); @@ -1513,9 +1556,11 @@ function enregistrer_avenant() { v_msg="Veuillez revoir la date!"; v_msgEng="Please review the date!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } motifavenant=$("#motifavenant").val(); @@ -1524,9 +1569,11 @@ function enregistrer_avenant() { v_msg="Veuillez fournir le motif!"; v_msgEng="Please provide the reason"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } v_msg="Confirmez-vous cet avenant?"; @@ -1675,9 +1722,12 @@ function enregistrer_retrait() { v_msg="Veuillez sélectionner les personnes à retirer!"; v_msgEng="Please select the people to remove!"; - alert_ebene(v_msg, v_msgEng); + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); - return; } v_msg="Confirmez-vous le retrait des personnes sélectionnées de cette police?"; @@ -1719,8 +1769,11 @@ function init_import_assures() { v_msg="Aucun collège!"; v_msgEng="No college!"; - alert_ebene(v_msg, v_msgEng); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } nbAdh = $("#nbAdh_C").val(); @@ -1730,8 +1783,11 @@ function init_import_assures() { v_msg="Ce n\'est pas une police GROUPE!"; v_msgEng="This is not a GROUP policy!"; - alert_ebene(v_msg, v_msgEng); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } window.location.assign($("#racineWeb" ).val()+"Importassure/"); @@ -1827,27 +1883,33 @@ function creer_beneficiaires() { v_msg="Attention! Police résiliée!"; v_msgEng="Warning! Terminated policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="SU") { v_msg="Attention! Police suspendue!"; v_msgEng="Warning! Suspended policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="AN") { v_msg="Attention! Police annulée!"; v_msgEng="Warning! Canceled policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } // etatadh=$("#codeEtatAdherent_C").val(); @@ -1856,9 +1918,11 @@ function creer_beneficiaires() { v_msg="Attention! cette famille n\'est pas en vigueur!"; v_msgEng="Warning! this family is not in force!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } window.location.assign($("#racineWeb" ).val()+"Creerbeneficiaire/"); @@ -1890,9 +1954,12 @@ function ebene_init_photo_face() // OK { v_msg="Cettte personne a déjà une face dans le système!"; v_msgEng="This person already has a face in the system!"; - alert_ebene(v_msg, v_msgEng); - $('#message_face').html(""); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $('#message_face').html(""); + return; + }); } re_init_photo_face(); $("#btn_pop_save_face").click(); @@ -1922,8 +1989,11 @@ function ebene_enregistrer_photo_face() // OK { v_msg="Veuillez prendre une photo!"; v_msgEng="Please take a photo!"; - alert_ebene(v_msg, v_msgEng); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } $("#div_wait_face_ebene").html('
' + '' + '
'); @@ -1948,7 +2018,7 @@ function ebene_enregistrer_photo_face() // OK v_msg="Enrôlement effectué avec succès!"; v_msgEng="Enrollment completed successfully!!"; - //alert_ebene(v_msg, v_msgEng); + setTimeout(() => { window.location.assign($("#racineWeb" ).val()+"Fichebeneficiaire/"+v_idBeneficiaire); }, 1000) @@ -1986,9 +2056,12 @@ function ebene_init_confirm_photo_face() // OK { v_msg="Cettte personne n'a pas encore de face dans le système!"; v_msgEng="This person doesn't have a face in the system yet!"; - alert_ebene(v_msg, v_msgEng); - $('#message_face').html(""); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $('#message_face').html(""); + return; + }); } re_init_photo_face(); @@ -2017,9 +2090,12 @@ function ebene_confirmer_photo_face() // OK { v_msg="Cette personne n'a pas encore de photo dans le système!"; v_msgEng="This person does not have a photo in the system yet!"; - alert_ebene(v_msg, v_msgEng); - $('#message_face').html(""); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $('#message_face').html(""); + return; + }); } image_face = $("#image_face").val(); @@ -2027,9 +2103,12 @@ function ebene_confirmer_photo_face() // OK { v_msg="Veuillez prendre une photo!"; v_msgEng="Please take a photo!"; - alert_ebene(v_msg, v_msgEng); - $('#message_face').html(""); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $('#message_face').html(""); + return; + }); } $("#div_wait_face_ebene").html(` @@ -2061,7 +2140,7 @@ function ebene_confirmer_photo_face() // OK $("#okId_face").val("1"); v_msg="Face confirmée!"; v_msgEng="Face confirmed!"; - //alert_ebene(v_msg, v_msgEng); + setTimeout(() => { prestations(); }, 2000) @@ -2093,10 +2172,12 @@ function ebene_supprimer_photo_face() // OK { v_msg="Veuillez saisir un motif!"; v_msgEng="Please enter a reaon!"; - alert_ebene(v_msg, v_msgEng); - - $("#motif").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#motif").focus(); + return; + }); } $("#del_face").val("1"); @@ -2106,9 +2187,11 @@ function ebene_supprimer_photo_face() // OK { v_msg="Cette personne n'a pas encore de photo dans le système!"; v_msgEng="This person does not have a photo in the system yet!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } image_face = $("#image_face").val(); @@ -2116,8 +2199,11 @@ function ebene_supprimer_photo_face() // OK { v_msg="Veuillez prendre une photo!"; v_msgEng="Please take a photo!"; - alert_ebene(v_msg, v_msgEng); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } v_msg="Confirmez-vous cette suppression?"; @@ -2178,7 +2264,7 @@ function ebene_supprimer_photo_face() // OK v_msg="Face supprimée avec succès!"; v_msgEng="Face removed successfully!"; - //alert_ebene(v_msg, v_msgEng); + setTimeout(() => { prestations(); }, 2000) @@ -2616,7 +2702,11 @@ function trouve_coordonnees_geo_ip(ip) { v_msg="Impossible de trouver les coordonnées géographiques de l'adresse IP: "+ip; v_msgEng="Unable to find the geographic coordinates of the IP address: "+ip; - alert_ebene(v_msg, v_msgEng); + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } }, @@ -2634,10 +2724,12 @@ function changer_avenant_incorporation_beneficiaire() { v_msg="Veuillez sélectionner un avenant!"; v_msgEng="Please select an Amendment!"; - alert_ebene(v_msg, v_msgEng); - - $("#idAvenant").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idAvenant").focus(); + return; + }); } donnees = 'idAvenant='+idAvenant; @@ -2688,10 +2780,12 @@ function prorater_prime_beneficiaire() { v_msg="Veuillez sélectionner un avenant!"; v_msgEng="Please select an Amendment!"; - alert_ebene(v_msg, v_msgEng); - $("#idAvenant").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idAvenant").focus(); + return; + }); } codeLienParente=$("#codeLienParente").val(); @@ -2700,9 +2794,12 @@ function prorater_prime_beneficiaire() { v_msg="Veuillez revoir le lien de parenté!"; v_msgEng="Please review the relationship"; - alert_ebene(v_msg, v_msgEng); - $("#codeLienParente").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeLienParente").focus(); + return; + }); } dateEntree=$("#dateEntree").val(); @@ -2822,8 +2919,10 @@ function init_importer_modele_assure() { if (statusEtape2 !== "1") { // Message d'alerte stylisé - alert_ebene("L'étape 2 (Chargement du fichier) n'est pas finalisée.", "Step 2 is not completed!"); - return; + alert_ebene("L'étape 2 (Chargement du fichier) n'est pas finalisée.", "Step 2 is not completed!").then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } // Si OK, on continue le workflow @@ -2852,8 +2951,11 @@ function importer_modele_assure(idAvenant) { // On re-vérifie la présence du fichier par sécurité var cheminFichier = $("#cheminFichier").val(); if (!cheminFichier || cheminFichier === "") { - alert_ebene("Erreur: Aucun fichier trouvé.", "Error: No file found."); - return; + + alert_ebene("Erreur: Aucun fichier trouvé.", "Error: No file found.").then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } var div_export = $('#div_exporter_liste_assures'); @@ -2883,18 +2985,20 @@ function importer_modele_assure(idAvenant) { console.log("Valeur détectée :", isSuccess); // Pour votre débogage if (isSuccess === "1") { - alert_ebene("Opération terminée avec succès!", "Operation completed successfully!"); - // On attend un tout petit peu que le DOM soit stable avant de passer à la suite - setTimeout(function(){ + alert_ebene("Opération terminée avec succès!", "Operation completed successfully!").then(() => { + // Ce code ne s’exécute qu’après clic sur OK maj_etape_3_import_assures(); - }, 1000); + }); } else { div_export.html(''); // On cache le spinner // Le message d'erreur est déjà affiché par $("#div_erreur_excel").html(data) } }, error: function() { - alert_ebene("Erreur technique lors de l'importation.", "Technical error during import."); + alert_ebene("Erreur technique lors de l'importation.", "Technical error during import.").then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } }); } @@ -2930,9 +3034,11 @@ function calculer_prime_inmportation() { v_msg="Veuillez lier toutes les famille à leur collège!"; v_msgEng="Please link all the family to their college!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } var div_attente = $('#div_liste_assure_importe'); @@ -2956,8 +3062,11 @@ function calculer_prime_inmportation() v_msg="Calcul de primes terminée avec succès!"; v_msgEng="Premium calculation completed successfully!"; - alert_ebene(v_msg, v_msgEng); - //alert("Calcul de primes terminée avec succès!"); + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + //afficher_liste_assures_a_importer(); + }); }, error: function(data) { @@ -2976,10 +3085,12 @@ function incorporer_assures_inmportes() if (nb_adh>"0") { v_msg="Veuillez revoir les collèges et relancer le calcul des primes!"; - v_msgEng="Please review the colleges and restart the premium calculation!!"; - alert_ebene(v_msg, v_msgEng); + v_msgEng="Please review the colleges and restart the premium calculation!"; - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } nb_ligne_ass=$("#nb_ligne_ass").val(); @@ -2988,9 +3099,11 @@ function incorporer_assures_inmportes() { v_msg="Rien à importer!"; v_msgEng="Nothing to import!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } v_msg="Avez-vous fait l\'étape 2 => calcul des primes?"; @@ -3015,7 +3128,10 @@ function incorporer_assures_inmportes() v_msg="Notez que vous avez accepté l\'incorporation sans primes!"; v_msgEng="Note that you accepted the incorporation without premium!"; - alert_ebene(v_msg, v_msgEng); + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + }); } v_msg="Confirmez-vous l\'incorporation de cette liste?"; @@ -3043,7 +3159,11 @@ function incorporer_assures_inmportes() success: function(data) { v_msg="Incorporation terminée avec succès!"; v_msgEng="Incorporation completed successfully!"; - alert_ebene(v_msg, v_msgEng); + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + //return; + }); }, error: function(data) { }, @@ -3062,9 +3182,11 @@ function traiter_lignes_importees() { v_msg="Etape 2 incomplète!"; v_msgEng="Incomplete step 2!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } etape3=$("#etape3").val(); @@ -3073,9 +3195,11 @@ function traiter_lignes_importees() { v_msg="Etape 3 incomplète!"; v_msgEng="Incomplete step 3!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } afficher_liste_assures_a_importer(); @@ -3089,9 +3213,11 @@ function afficher_adherent_importee() { v_msg="Veuillez sélectionner un collège!"; v_msgEng="Please select a college!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } donnees = 'idCollege='+idCollege; @@ -3149,9 +3275,11 @@ function ajouter_un_adherent_importe_college(idBeneficiairemodel) { v_msg="Veuillez sélectionner un collège!"; v_msgEng="Please select a college!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } donnees = 'idBeneficiairemodel='+idBeneficiairemodel+'&idCollege='+idCollege; @@ -3179,9 +3307,11 @@ function ajouter_tous_adherent_importe_college() { v_msg="Veuillez sélectionner un collège!"; v_msgEng="Please select a college!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } donnees = 'idCollege='+idCollege; @@ -3215,9 +3345,11 @@ function ajouter_sans_college_adherent_importe_college() { v_msg="Veuillez sélectionner un collège!"; v_msgEng="Please select a college!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } donnees = 'idCollege='+idCollege; @@ -3253,9 +3385,11 @@ function retirer_tous_adherent_importe_college() { v_msg="Veuillez sélectionner un collège!"; v_msgEng="Please select a college!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } donnees = 'idCollege='+idCollege; @@ -3288,10 +3422,12 @@ function incorporer_assures_inmportes() if (nb_adh>"0") { v_msg="Veuillez revoir les collèges et relancer le calcul des primes!"; - v_msgEng="Please review the colleges and restart the premium calculation!!"; - alert_ebene(v_msg, v_msgEng); + v_msgEng="Please review the colleges and restart the premium calculation!"; - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } nb_ligne_ass=$("#nb_ligne_ass").val(); @@ -3300,9 +3436,11 @@ function incorporer_assures_inmportes() { v_msg="Rien à importer!"; v_msgEng="Nothing to import!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } v_msg="Avez-vous fait l\'étape 2 => calcul des primes?"; @@ -3335,7 +3473,11 @@ function incorporer_assures_inmportes() v_msg="Notez que vous avez accepté l\'incorporation sans primes!"; v_msgEng="Note that you accepted the incorporation without premium!"; - alert_ebene(v_msg, v_msgEng); + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + //return; + }); } v_msg="Confirmez-vous l\'incorporation de cette liste?"; @@ -3364,7 +3506,11 @@ function incorporer_assures_inmportes() success: function(data) { v_msg="Incorporation terminée avec succès!"; v_msgEng="Incorporation completed successfully!"; - alert_ebene(v_msg, v_msgEng); + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + //return; + }); }, error: function(data) { }, @@ -3420,13 +3566,13 @@ function afficher_garantieadherent_entete_contrat() { v_msg="Veuillez sélectionner une période!"; v_msgEng="Please select a period!"; - alert_ebene(v_msg, v_msgEng); - $("#idEntetecontrat").focus(); - - div_attente.html(''); - - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idEntetecontrat").focus(); + div_attente.html(''); + return; + }); } // donnees = 'exercieReference='+exercieReference; @@ -3465,27 +3611,33 @@ function changer_etat_adherent() { v_msg="Attention! Police résiliée!"; v_msgEng="Warning! Terminated policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="SU") { v_msg="Attention! Police suspendue!"; v_msgEng="Warning! Suspended policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="AN") { v_msg="Attention! Police annulée!"; v_msgEng="Warning! Canceled policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } window.location.assign($("#racineWeb" ).val()+"Changeretatadherent/"); @@ -3764,10 +3916,12 @@ function imprimer_liste_assures_date() { v_msg="Veuillez indiquer une date!"; v_msgEng="Please enter a date!"; - alert_ebene(v_msg, v_msgEng); - $("#dateAnalyse").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#dateAnalyse").focus(); + return; + }); } donnees = 'dateAnalyse='+dateAnalyse; @@ -3817,10 +3971,12 @@ function exporter_liste_assures_date() { v_msg="Veuillez indiquer une date!"; v_msgEng="Please enter a date!"; - alert_ebene(v_msg, v_msgEng); - $("#dateAnalyse").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#dateAnalyse").focus(); + return; + }); } donnees = 'dateAnalyse='+dateAnalyse; @@ -3930,9 +4086,11 @@ function liste_mouvemements_assures_client() { v_msg="Veuillez sélectionner une police!"; v_msgEng="Please select a policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } codeSensMouvement=$("#codeSensMouvement").val(); @@ -3995,11 +4153,13 @@ function consulter_facture_pop(idFacture) { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; - alert_ebene(v_msg, v_msgEng); - - $("#idFacture").val("0"); - $("#idFacture").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + }); } $.ajax({ @@ -4038,11 +4198,13 @@ function consulterfacturefeuillemaladie_pop() { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; - alert_ebene(v_msg, v_msgEng); - $("#idFacture").val("0"); - $("#idFacture").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + }); } $.ajax({ @@ -4079,11 +4241,13 @@ function consulterfactureprestationactes_pop() { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; - alert_ebene(v_msg, v_msgEng); - $("#idFacture").val("0"); - $("#idFacture").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + }); } $.ajax({ @@ -4121,11 +4285,13 @@ function consulterfacturemedicaments_pop() { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; - alert_ebene(v_msg, v_msgEng); - $("#idFacture").val("0"); - $("#idFacture").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + }); } $.ajax({ @@ -4163,11 +4329,13 @@ function consulterfactureverres_pop() { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; - alert_ebene(v_msg, v_msgEng); - $("#idFacture").val("0"); - $("#idFacture").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + }); } $.ajax({ @@ -4205,11 +4373,13 @@ function consulterfactureged_pop() { v_msg="Valeur numérique exigée!"; v_msgEng="Numeric value required!"; - alert_ebene(v_msg, v_msgEng); - $("#idFacture").val("0"); - $("#idFacture").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#idFacture").val("0"); + $("#idFacture").focus(); + return; + }); } $.ajax({ @@ -4361,30 +4531,36 @@ function enregistrer_modif_user_rh() { v_msg="Veuillez saisir le nom!"; v_msgEng="Please enter the name!"; - alert_ebene(v_msg, v_msgEng); - - $("#nom").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#nom").focus(); + return; + }); } if (actif<=" ") { v_msg="Utilisateur actif oui ou non?"; v_msgEng="Is the user active yes or no?"; - alert_ebene(v_msg, v_msgEng); - $("#actif").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#actif").focus(); + return; + }); } if(codeLangue<=" ") { v_msg="Veuillez indiquer la langue!"; v_msgEng="Please select the language"; - alert_ebene(v_msg, v_msgEng); - $("#codeLangueUser").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeLangueUser").focus(); + return; + }); } @@ -4393,10 +4569,11 @@ function enregistrer_modif_user_rh() v_msg="Le profil utilisateur est obligatoire!"; v_msgEng="The user profile is required!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } @@ -4404,10 +4581,12 @@ function enregistrer_modif_user_rh() { v_msg="Veuillez revoir l'adresse mail!"; v_msgEng="Please review the email address!"; - alert_ebene(v_msg, v_msgEng); - $("#email").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#email").focus(); + return; + }); } donnees = 'idUtilisateur=' + idUtilisateur; @@ -4475,10 +4654,12 @@ function creer_user_rh_client() { v_msg="Veuillez indiquer le nom!"; v_msgEng="Please enter the name!"; - alert_ebene(v_msg, v_msgEng); - $("#nom").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#nom").focus(); + return; + }); } @@ -4486,10 +4667,12 @@ function creer_user_rh_client() { v_msg="Veuillez indiquer le login!"; v_msgEng="Please enter the login!"; - alert_ebene(v_msg, v_msgEng); - $("#codeUtilisateur").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeUtilisateur").focus(); + return; + }); } @@ -4497,10 +4680,12 @@ function creer_user_rh_client() { v_msg="Veuillez indiquer la langue!"; v_msgEng="Please select the language"; - alert_ebene(v_msg, v_msgEng); - $("#codeLangueUser").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeLangueUser").focus(); + return; + }); } if (codeProfil<=" ") @@ -4508,10 +4693,11 @@ function creer_user_rh_client() v_msg="Le profil utilisateur est obligatoire!"; v_msgEng="The user profile is required!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } @@ -4519,20 +4705,24 @@ function creer_user_rh_client() { v_msg="Veuillez revoir le téléphone!"; v_msgEng="Please review the phone!"; - alert_ebene(v_msg, v_msgEng); - $("#telephone").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#telephone").focus(); + return; + }); } if ((codeModeEnvoiPass=="0" || codeModeEnvoiPass=="2") && (email <=" ") ) { v_msg="Veuillez revoir l'adresse mail!"; v_msgEng="Please review the email address!"; - alert_ebene(v_msg, v_msgEng); - $("#email").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#email").focus(); + return; + }); } if(codeModeGenerationPass=="0") @@ -4541,20 +4731,24 @@ function creer_user_rh_client() { v_msg="Veuillez indiquer le mot de passe!"; v_msgEng="Please enter the password!"; - alert_ebene(v_msg, v_msgEng); - $("#nvmdp").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#nvmdp").focus(); + return; + }); } if(nvmdp != cfnvmdp) { v_msg="Veuillez confirmer votre mot de passe!"; v_msgEng="Please confirm your password!"; - alert_ebene(v_msg, v_msgEng); - $("#cfnvmdp").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#cfnvmdp").focus(); + return; + }); } } @@ -4562,10 +4756,12 @@ function creer_user_rh_client() { v_msg="Veuillez revoir l'adresse mail!"; v_msgEng="Please review the email address!"; - alert_ebene(v_msg, v_msgEng); - $("#email").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#email").focus(); + return; + }); } motPass = nvmdp; @@ -4600,17 +4796,22 @@ function creer_user_rh_client() { v_msg="Utilisateur ( "+codeUtilisateur+" ) créé avec succès!"; v_msgEng="User ( "+codeUtilisateur+" ) created succssfully!"; - alert_ebene(v_msg, v_msgEng); - retour_a_users_rh_client(); + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + retour_a_users_rh_client(); + }); } else { v_msg="Login " + codeUtilisateur +" déjà utilisé!"; v_msgEng="Login " + codeUtilisateur +" already in use!"; - alert_ebene(v_msg, v_msgEng); - $("#codeUtilisateur").focus(); + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeUtilisateur").focus(); + return; + }); } } }); @@ -4642,9 +4843,11 @@ function reinitpaswd_user_rh(codeUtilisateur) complete: function() { v_msg="Opération effectuée avec succès!"; v_msgEng="Operation successfully completed"; - alert_ebene(v_msg, v_msgEng); - users_gc(); + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + users_gc(); + }); } }); return; @@ -4652,9 +4855,11 @@ function reinitpaswd_user_rh(codeUtilisateur) // L'utilisateur a annulé v_msg="Opération annulée!"; v_msgEng="Operation canceled!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } }); } @@ -4687,9 +4892,11 @@ function desactiver_user_rh_client(codeUtilisateur) complete: function() { v_msg="Opération effectuée avec succès!"; v_msgEng="Operation successfully completed"; - alert_ebene(v_msg, v_msgEng); - users_rh_client(); + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + users_rh_client(); + }); } }); return; @@ -4697,9 +4904,11 @@ function desactiver_user_rh_client(codeUtilisateur) // L'utilisateur a annulé v_msg="Opération annulée!"; v_msgEng="Operation canceled!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } }); @@ -4727,9 +4936,11 @@ function activer_user_rh_client(codeUtilisateur) complete: function() { v_msg="Opération effectuée avec succès!"; v_msgEng="Operation successfully completed"; - alert_ebene(v_msg, v_msgEng); - users_rh_client(); + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + users_rh_client(); + }); } }); return; @@ -4737,9 +4948,11 @@ function activer_user_rh_client(codeUtilisateur) // L'utilisateur a annulé v_msg="Opération annulée!"; v_msgEng="Operation canceled!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } }); @@ -4798,11 +5011,13 @@ function controle_longeur_passe(controle) { v_msg="8 caractères minimum exigé!"; v_msgEng="8 characters minmum required!"; - alert_ebene(v_msg, v_msgEng); - - controle.value=""; - controle.focus(); - return false; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + controle.value=""; + controle.focus(); + return false; + }); } } @@ -4812,10 +5027,12 @@ function controle_new_pass() { v_msg="Veuillez saisir un mot de passe!"; v_msgEng="Please enter a password!"; - alert_ebene(v_msg, v_msgEng); - $("#nvmdp").focus(); - return false; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#nvmdp").focus(); + return false; + }); } longueur = $("#nvmdp").val().length; @@ -4824,20 +5041,24 @@ function controle_new_pass() { v_msg="8 caractères minimum exigé!"; v_msgEng="8 characters minmum required!"; - alert_ebene(v_msg, v_msgEng); - - $("#nvmdp").focus(); - return false; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#nvmdp").focus(); + return false; + }); } if ($("#cfnvmdp" ).val()!=$("#nvmdp" ).val()) { v_msg="Veuillez confirmer votre mot de passe!"; v_msgEng="Please confirm your password!"; - alert_ebene(v_msg, v_msgEng); - $("#nvmdp").focus(); - return false; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#nvmdp").focus(); + return false; + }); } } @@ -4857,10 +5078,12 @@ function afficher_menu_principal_profil_rh() { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -4900,10 +5123,12 @@ function ajouter_tous_menus_principal_profil_rh() { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -4930,10 +5155,12 @@ function ajouter_un_menu_principal_profil_rh(codeMenu) { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil+'&codeMenu='+codeMenu; @@ -4960,10 +5187,12 @@ function retirer_tous_menus_principal_profil_rh() { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -4990,10 +5219,12 @@ function retirer_un_menu_principal_profil_rh(codeMenu) { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil+'&codeMenu='+codeMenu; @@ -5056,10 +5287,12 @@ function ajax_menus_profil() { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -5087,11 +5320,12 @@ function afficher_menu_vue_profil() { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } codeVue = $("#codeVue").val(); @@ -5100,11 +5334,13 @@ function afficher_menu_vue_profil() { v_msg="Veuillez sélectionner une vue!"; v_msgEng="Please select a view!"; - alert_ebene(v_msg, v_msgEng); - $("#codeVue").focus(); - $('#div_menu_profil').html(data); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeVue").focus(); + $('#div_menu_profil').html(data); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -5146,10 +5382,12 @@ function ajouter_tous_menu_vue_profil() { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } codeVue=$("#codeVue").val(); @@ -5158,10 +5396,12 @@ function ajouter_tous_menu_vue_profil() { v_msg="Veuillez sélectionner une vue!"; v_msgEng="Please select a view!"; - alert_ebene(v_msg, v_msgEng); - $("#codeVue").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeVue").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -5189,10 +5429,12 @@ function ajouter_un_menu_vue_profil(codeMenu) { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } codeVue=$("#codeVue").val(); @@ -5201,10 +5443,12 @@ function ajouter_un_menu_vue_profil(codeMenu) { v_msg="Veuillez sélectionner une vue!"; v_msgEng="Please select a view!"; - alert_ebene(v_msg, v_msgEng); - $("#codeVue").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeVue").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -5233,10 +5477,12 @@ function retirer_tous_menu_vue_profil() { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } codeVue=$("#codeVue").val(); @@ -5245,10 +5491,12 @@ function retirer_tous_menu_vue_profil() { v_msg="Veuillez sélectionner une vue!"; v_msgEng="Please select a view!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeVue").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeVue").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -5278,10 +5526,12 @@ function retirer_un_menu_vue_profil(codeMenu) { v_msg="Veuillez sélectionner un profil!"; v_msgEng="Please select a user profile!"; - alert_ebene(v_msg, v_msgEng); - $("#codeProfil").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeProfil").focus(); + return; + }); } codeVue=$("#codeVue").val(); @@ -5290,10 +5540,12 @@ function retirer_un_menu_vue_profil(codeMenu) { v_msg="Veuillez sélectionner une vue!"; v_msgEng="Please select a view!"; - alert_ebene(v_msg, v_msgEng); - $("#codeVue").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeVue").focus(); + return; + }); } donnees = 'codeProfil='+codeProfil; @@ -5406,7 +5658,11 @@ function ControlerEcheanceRen() if (ech>eff.addMonths(12)) { v_msg="Période supérieur à un an!"; v_msgEng="Period greater than one year!"; - alert_ebene(v_msg, v_msgEng); + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } } } @@ -5546,9 +5802,10 @@ function lister_dossiers_classiques_export() v_msg="Aucune données à exporter!"; v_msgEng="No data to export!"; - alert_ebene(v_msg, v_msgEng); - - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } donnees = 'd1='+d1+'&d2='+d2+'&filtre='+filtre; @@ -5730,18 +5987,24 @@ function enregistrer_validation_rd(idDemande){ const msg = "Une décision de validation est obligatoire."; const msgEng = "A validation approval is required."; - alert_ebene(msg, msgEng); - $("#codeStatutPaiementAjax").focus(); - return; + alert_ebene(msg, msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeStatutPaiementAjax").focus(); + return; + }); + } if(codeStatutPaiement=="9" && motifRejetRh <=" "){ const msg = "Un motif est obligatoire en cas de refus."; const msgEng = "A reason is required in case of refusal."; - alert_ebene(msg, msgEng); - $("#motifRejetRh").focus(); - return; + alert_ebene(msg, msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#motifRejetRh").focus(); + return; + }); + } donnees = 'idDemande='+idDemande; @@ -5775,18 +6038,22 @@ function remplacer_adherent() { v_msg="Ce n\'est pas une police GROUPE!"; v_msgEng="This is not a GROUP policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if ($("#idAdherent_C" ).val()<= " ") { v_msg="Veuillez sélectionner une famille!"; v_msgEng="Please select a family!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } remplacementAdherent=$("#remplacementAdherent").val(); @@ -5794,9 +6061,11 @@ function remplacer_adherent() { v_msg="Remplacement de famille non actif pour cette police!"; v_msgEng="Family replacement inactive for this policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } remplace=$("#remplace").val(); @@ -5808,9 +6077,11 @@ function remplacer_adherent() { v_msg="Famille déjà remplacée!"; v_msgEng="Family already replaced!"; - alert_ebene(v_msg, v_msgEng); - consulter_remplacement_adherent(); + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + consulter_remplacement_adherent(); + }); } else { @@ -5834,9 +6105,11 @@ function remplacer_adherent() { v_msg="Famille déjà remplacée!"; v_msgEng="Family already replaced!"; - alert_ebene(v_msg, v_msgEng); - consulter_remplacement_adherent(); + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + consulter_remplacement_adherent(); + }); } else { @@ -5863,27 +6136,33 @@ function fiche_remplacer_adherent() { v_msg="Attention! Police résiliée!"; v_msgEng="Warning! Terminated policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="SU") { v_msg="Attention! Police suspendue!"; v_msgEng="Warning! Suspended policy!"; - alert_ebene(v_msg, v_msgEng); - - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } if (etat=="AN") { v_msg="Attention! Police annulée!"; v_msgEng="Warning! Canceled policy!"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } window.location.assign($("#racineWeb" ).val()+"Remplaceradherent/"); @@ -5915,16 +6194,22 @@ function init_remplacement_adherent() { v_msg="Attention! Veuillez revoir vos dates!"; v_msgEng="Warning! Please review your dates!"; - alert_ebene(v_msg, v_msgEng); - return false; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return false; + }); } if (dt1>dt2 || dt1 { + // Ce code ne s’exécute qu’après clic sur OK + return false; + }); } etatRetrait = $("#etatRetrait").val(); @@ -5936,8 +6221,11 @@ function init_remplacement_adherent() { v_msg="Attention! cette personne a été retirée avec une ristourne!"; v_msgEng=" Warning! this person was withdrawn with premium!"; - alert_ebene(v_msg, v_msgEng); - return false; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return false; + }); } motifavenant=$("#motifavenant").val(); @@ -5946,9 +6234,11 @@ function init_remplacement_adherent() { v_msg="Veuillez fournir le motif!"; v_msgEng="Please provide the reason"; - alert_ebene(v_msg, v_msgEng); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + return; + }); } dateS = $("#dateSortieAdh").val(); @@ -5983,10 +6273,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez saisir le nom de famille!"; v_msgEng="Please enter the last name!"; - alert_ebene(v_msg, v_msgEng); - $("#nom").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#nom").focus(); + return; + }); } prenoms = $("#prenoms").val(); @@ -5994,10 +6286,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez saisir le prénom!"; v_msgEng="Please enter the first name!"; - alert_ebene(v_msg, v_msgEng); - - $("#prenoms").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#prenoms").focus(); + return; + }); } codeNaturePiece = $("#codeNaturePiece").val(); @@ -6005,10 +6299,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez saisir la nature de pièce d\'identité!"; v_msgEng="Please enter the nature of ID!"; - alert_ebene(v_msg, v_msgEng); - $("#codeNaturePiece").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeNaturePiece").focus(); + return; + }); } numeroPiece = $("#numeroPiece").val(); @@ -6016,10 +6312,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez saisir le No de la pièce d\'identité!"; v_msgEng="Please enter the ID number!"; - alert_ebene(v_msg, v_msgEng); - - $("#numeroPiece").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#numeroPiece").focus(); + return; + }); } sexe = $("#sexe").val(); @@ -6027,10 +6325,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez saisir le sexe!"; v_msgEng="Please enter the sex!"; - alert_ebene(v_msg, v_msgEng); - $("#sexe").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#sexe").focus(); + return; + }); } dateNaissance = $("#dateNaissance").val(); @@ -6038,10 +6338,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez saisir la date de naissance!"; v_msgEng="Please enter the date of birth!"; - alert_ebene(v_msg, v_msgEng); - - $("#dateNaissance").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#dateNaissance").focus(); + return; + }); } codeGroupeSanguin = $("#codeGroupeSanguin").val(); @@ -6049,10 +6351,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez saisir le groupe sanguin!"; v_msgEng="Please enter the blood type!"; - alert_ebene(v_msg, v_msgEng); - - $("#codeGroupeSanguin").focus(); - return; + + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeGroupeSanguin").focus(); + return; + }); } codeSituationFamille = $("#codeSituationFamille").val(); @@ -6060,10 +6364,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez saisir la situation familiale!"; v_msgEng="Please enter the family situation!"; - alert_ebene(v_msg, v_msgEng); - $("#codeSituationFamille").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codeSituationFamille").focus(); + return; + }); } nombreEnfants = $("#nombreEnfants").val(); @@ -6075,10 +6381,12 @@ function enregistrer_remplacement_adherent() { v_msg="Veuillez indiquer le pays!"; v_msgEng="Please indicate the country!"; - alert_ebene(v_msg, v_msgEng); - $("#codePays").focus(); - return; + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + $("#codePays").focus(); + return; + }); } telephonFixe = $("#telephonFixe").val(); @@ -6119,9 +6427,11 @@ function enregistrer_remplacement_adherent() { v_msg="Opération effectuée avec succès!"; v_msgEng="Operation successfully completed"; - alert_ebene(v_msg, v_msgEng); - consulter_remplacement_adherent(); + alert_ebene(v_msg, v_msgEng).then(() => { + // Ce code ne s’exécute qu’après clic sur OK + consulter_remplacement_adherent(); + }); } }); } diff --git a/Vue/gabarit.php b/Vue/gabarit.php index 9a6b2d3..e782ac3 100755 --- a/Vue/gabarit.php +++ b/Vue/gabarit.php @@ -663,7 +663,7 @@ $photoAssureCrypte = $_SESSION['photoAssureCrypte']; - +