This commit is contained in:
KONE SOREL 2026-03-18 13:22:04 +00:00
parent e0f3887eb8
commit 92fbfcd770

View File

@ -49491,46 +49491,64 @@ function dataTableServeur(){
}
}
function rattacher_prestataires_reseau(){
var nbcoche = $('#nbcoche').val();
var nomReseau = $('#nomReseau').val();
var msg_fr = "Aucun prestataire n'est sélectionné pour être rattaché au reséau de soins : "+nomReseau+"!";
var msg_en = "No provider is selected to be attached to the care network: "+nomReseau+"'";
if(nbcoche == '0' || nbcoche =='' || nbcoche ==undefined){
alert_ebene(msg_fr,msg_en);
return;
}else{
msg_fr = "Confirmez-vous le rattachement des "+ nbcoche +" prestataires sélectionnés au reséau de soins :"+nomReseau+"?";
msg_en = "Do you confirm the attachment of the "+ nbcoche +" selected providers to the care network"+nomReseau+"?";
confirm_ebene(msg_fr, msg_en)
.then((isConfirmed) => {
if (isConfirmed) {
// L'utilisateur a confirmé
donnees = "";
function rattacher_prestataires_reseau() {
const racine = $("#racineWeb").val();
const lang = $("#codeLangue").val();
const nomReseau = $('#nomReseau').val();
// 1. Extraction propre du nombre (on ne garde que les chiffres)
// Utile si le champ contient "Lignes Cochées : 5"
let nbcocheRaw = $('#nbcoche').val();
let nbcoche = parseInt(nbcocheRaw.replace(/[^0-9]/g, ''), 10) || 0;
$.ajax({
url: $("#racineWeb").val()+"Ajaxlisteprestataireparlot/rattacher/",
type : 'post',
data: donnees,
error: function(errorData) {
//alert("Erreur : "+errorData);
},
success: function(data) {
//alert("Success : "+data);
},
complete: function() {
afficher_lite_prestataire_lot();
}
});
} else {
// L'utilisateur a annulé
console.log("Confirmation refusée");
}
});
}
// 2. Vérification si sélection vide
if (nbcoche === 0) {
const msg_fr = "Aucun prestataire n'est sélectionné pour être rattaché au réseau de soins : " + nomReseau + " !";
const msg_en = "No provider is selected to be attached to the care network: " + nomReseau + " !";
alert_ebene(msg_fr, msg_en);
return;
}
// 3. Confirmation de l'action
const conf_fr = "Confirmez-vous le rattachement des " + nbcoche + " prestataires sélectionnés au réseau de soins : " + nomReseau + " ?";
const conf_en = "Do you confirm the attachment of the " + nbcoche + " selected providers to the care network: " + nomReseau + " ?";
confirm_ebene(conf_fr, conf_en).then((isConfirmed) => {
if (isConfirmed) {
// 4. Loader de traitement Neutral Pro
const loader = `
<div class="d-flex justify-content-center align-items-center p-5" style="min-height:200px;">
<div class="text-center">
<div class="spinner-border text-success" role="status" style="width: 3rem; height: 3rem;"></div>
<div class="mt-3 text-success fw-bold text-uppercase small">
${(lang === 'en_US') ? 'Processing attachment...' : 'Rattachement en cours...'}
</div>
</div>
</div>`;
$("#div_liste_prestataire").html(loader);
$.ajax({
url: racine + "Ajaxlisteprestataireparlot/rattacher/",
type: 'POST',
data: { codeReseau: $("#codeReseau").val() }, // On passe l'ID du réseau par sécurité
success: function(data) {
// Optionnel : Notification de succès
const s_msg = (lang === 'en_US') ? "Attachment completed successfully!" : "Rattachement effectué avec succès !";
// toast_ebene(s_msg); // Si vous avez un système de toast
},
error: function(xhr) {
console.error("Erreur Rattachement INTER-SANTE:", xhr.statusText);
alert_ebene("Erreur technique lors du rattachement.", "Technical error during attachment.");
},
complete: function() {
// 5. Rafraîchissement de la liste (pour vider les déjà rattachés)
afficher_lite_prestataire_lot();
}
});
}
});
}
function modifier_college_type(idTable)