);
},
},
{ field: 'type_eval', headerName: 'Type eval', hide: true },
{ field: 'regle_calcul', headerName: 'regle_calcul', hide: true },
]
const myRef_head = useRef(null);
const [New_Getall_Session_Detail_Final_Note_Classement_result, setNew_Getall_Session_Detail_Final_Note_Classement_result] = useState([]);
const [Getall_Session_Detail_Final_Note_Classement_api, setGetall_Session_Detail_Final_Note_Classement_api] = useState();
const [Getall_Session_Detail_Final_Note_Classement_message, setGetall_Session_Detail_Final_Note_Classement_message] = useState();
const [Getall_Session_Detail_Final_Note_Classement_result, setGetall_Session_Detail_Final_Note_Classement_result] = useState([]);
function Getall_Session_Detail_Final_Note_Classement(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("tab_session_id", props.related_collection_recid);
if (props.jury_seance_agenda_id)
form.append("jury_apprenant_agenda_id", props.jury_seance_agenda_id);
if (props.jury_seance_ue_id)
form.append("tab_ue_id", props.jury_seance_ue_id);
// Recuperation des parametres
var filtre1 = p_filtre1;
var filtre2 = p_filtre2;
var filtre1_value = "";
var filtre2_value = "";
// Recuperation des valeurs de filtres
if (p_filtre1_value && String(p_filtre1) === "ue_id") {
filtre1_value = p_filtre1_value;
form.append("tab_ue_id", filtre1_value);
}
else if (p_filtre1_value && String(p_filtre1) === "inscrit_id") {
filtre1_value = p_filtre1_value;
form.append("tab_inscrit_id", filtre1_value);
}
if (p_filtre2_value && String(p_filtre2) === "ue_id") {
filtre2_value = p_filtre2_value;
form.append("tab_ue_id", filtre2_value);
}
else if (p_filtre2_value && String(p_filtre2) === "inscrit_id") {
filtre2_value = p_filtre2_value;
form.append("tab_inscrit_id", filtre2_value);
}
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Evaluation_Final_Note_Classement_Detail_With_Filter";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
// console.log(" In Getall_Session_Detail_Final_Note_Classement res.data.status = " + res.data.status);
// console.log(" In Getall_Session_Detail_Final_Note_Classement res.data.message r_class = " + res.data.message);
setGetall_Session_Detail_Final_Note_Classement_api("true");
setGetall_Session_Detail_Final_Note_Classement_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var inscription_id = JSON.parse(x).inscription_id;
var session_id = JSON.parse(x).session_id;
var type_eval = JSON.parse(x).type_eval;
var ue_id = JSON.parse(x).ue_id;
var class_id = JSON.parse(x).class_id;
var moyenne = JSON.parse(x).moyenne;
var somme = JSON.parse(x).somme;
var nb_evaluation = JSON.parse(x).nb_evaluation;
var ue_id_code = JSON.parse(x).ue_id_code;
var class_id_external_code = JSON.parse(x).class_id_external_code;
var inscription_id_mail = JSON.parse(x).inscription_id_mail;
var inscription_id_nom = JSON.parse(x).inscription_id_nom;
var inscription_id_prenom = JSON.parse(x).inscription_id_prenom;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_id,
"inscription_id": inscription_id,
"session_id": session_id,
"type_eval": type_eval,
"ue_id": ue_id,
"class_id": class_id,
"moyenne": moyenne,
"somme": somme,
"nb_evaluation": nb_evaluation,
"ue_id_code": ue_id_code,
"class_id_external_code": class_id_external_code,
"inscription_id_mail": inscription_id_mail,
"inscription_id_nom": inscription_id_nom,
"inscription_id_prenom": inscription_id_prenom,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"inscription_id": "",
"session_id": "",
"type_eval": "",
"ue_id": "",
"class_id": "",
"moyenne": "",
"somme": "",
"nb_evaluation": "",
"ue_id_code": "",
"class_id_external_code": "",
"inscription_id_mail": "",
"inscription_id_nom": "",
"inscription_id_prenom": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Session_Detail_Final_Note_Classement_result(new_data2);
}
else {
setGetall_Session_Detail_Final_Note_Classement_api("false");
setGetall_Session_Detail_Final_Note_Classement_message(res.data.message);
// alert(res.data.message)
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
console.warn('Not good man :( Getall_Session_Detail_Final_Note_Classement = ', error);
setGetall_Session_Detail_Final_Note_Classement_api("false");
// alert(" Impossible de recuperer la liste des évaluations");
setdisplay_alert_mysy("1");
setalert_message(" Impossible de recuperer la liste des évaluations");
setalert_type("error");
//setmyApimyApiMessage("")
})
}
const [dialogOpen_push_lms, setdialogOpen_push_lms] = useState(false);
const Dialog_menuitem_close_push_lms = () => {
setdialogOpen_push_lms(false)
};
const [working_cellValues, setworking_cellValues] = useState(false);
const [dialogOpen_supp, setdialogOpen_supp] = useState(false);
const Dialog_menuitem_close_supp = () => {
setdialogOpen_supp(false)
};
const options_menu_vertical = [
'',
'Jury Edit',
];
const ITEM_HEIGHT = 48;
const [anchorEl, setAnchorEl] = React.useState(null);
const open = Boolean(anchorEl);
const handleClick_option_button_vertical = (event) => {
setAnchorEl(event.currentTarget);
};
const handleClose_option_button_vertical = (event, value) => {
if (value && String(value) === "Jury Edit") {
console.log("### Jury Edit= ", value);
}
else if (value && String(value) === "Editer") {
}
else if (value && String(value) === "Pub. E-Learning") {
}
else if (value && String(value) === "Supprimer") {
}
setAnchorEl(null);
};
const [Calcul_Note_Classement_Session_api, setCalcul_Note_Classement_Session_api] = useState();
const [Calcul_Note_Classement_Session_message, setCalcul_Note_Classement_Session_message] = useState();
const [Calcul_Note_Classement_Session_result, setCalcul_Note_Classement_Session_result] = useState([]);
function Calcul_Note_Classement_Session(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("session_id", props.related_collection_recid);
setLoading(false);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Calcul_Note_Classement_Session";
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
// console.log(" In Calcul_Note_Classement_Session res.data.status = " + res.data.status);
// console.log(" In Calcul_Note_Classement_Session res.data.message r_class = " + res.data.message);
setCalcul_Note_Classement_Session_api("true");
setCalcul_Note_Classement_Session_result(res.data.message);
Getall_Session_Detail_Final_Note_Classement();
Getall_Session_UE_Final_Note_Classement();
Getall_Session_Final_Note_Classement();
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else {
setCalcul_Note_Classement_Session_api("false");
setCalcul_Note_Classement_Session_message(res.data.message);
// alert(res.data.message)
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Calcul_Note_Classement_Session = ', error);
setCalcul_Note_Classement_Session_api("false");
// alert(" Impossible de recuperer la liste des évaluations");
setdisplay_alert_mysy("1");
setalert_message(" Impossible de recuperer la liste des évaluations");
setalert_type("error");
//setmyApimyApiMessage("")
})
}
const [New_Getall_Session_UE_Final_Note_Classement_result, setNew_Getall_Session_UE_Final_Note_Classement_result] = useState([]);
const [Getall_Session_UE_Final_Note_Classement_api, setGetall_Session_UE_Final_Note_Classement_api] = useState();
const [Getall_Session_UE_Final_Note_Classement_message, setGetall_Session_UE_Final_Note_Classement_message] = useState();
const [Getall_Session_UE_Final_Note_Classement_result, setGetall_Session_UE_Final_Note_Classement_result] = useState([]);
function Getall_Session_UE_Final_Note_Classement(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("tab_session_id", props.related_collection_recid);
if (props.jury_seance_agenda_id)
form.append("jury_apprenant_agenda_id", props.jury_seance_agenda_id);
if (props.jury_seance_ue_id)
form.append("tab_ue_id", props.jury_seance_ue_id);
// Recuperation des parametres
var filtre1 = p_filtre1;
var filtre2 = p_filtre2;
var filtre1_value = "";
var filtre2_value = "";
// Recuperation des valeurs de filtres
if (p_filtre1_value && String(p_filtre1) === "ue_id") {
filtre1_value = p_filtre1_value;
form.append("tab_ue_id", filtre1_value);
}
else if (p_filtre1_value && String(p_filtre1) === "inscrit_id") {
filtre1_value = p_filtre1_value;
form.append("tab_inscrit_id", filtre1_value);
}
if (p_filtre2_value && String(p_filtre2) === "ue_id") {
filtre2_value = p_filtre2_value;
form.append("tab_ue_id", filtre2_value);
}
else if (p_filtre2_value && String(p_filtre2) === "inscrit_id") {
filtre2_value = p_filtre2_value;
form.append("tab_inscrit_id", filtre2_value);
}
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Evaluation_UE_Note_Classement_With_Filter";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
// console.log(" In Getall_Session_UE_Final_Note_Classement res.data.status = " + res.data.status);
//console.log(" In Getall_Session_UE_Final_Note_Classement res.data.message r_class = " + res.data.message);
setGetall_Session_UE_Final_Note_Classement_api("true");
setGetall_Session_UE_Final_Note_Classement_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var inscription_id = JSON.parse(x).inscription_id;
var session_id = JSON.parse(x).session_id;
var type_eval = JSON.parse(x).type_eval;
var ue_id = JSON.parse(x).ue_id;
var class_id = JSON.parse(x).class_id;
var note_td = JSON.parse(x).note_td;
var note_tp = JSON.parse(x).note_tp;
var note_examen = JSON.parse(x).note_examen;
var regle_calcul = JSON.parse(x).regle_calcul;
var note_finale = JSON.parse(x).note_finale;
var regle_calcul = JSON.parse(x).regle_calcul;
var seuil_validation = JSON.parse(x).seuil_validation;
var ue_coefficient = JSON.parse(x).ue_coefficient;
var ue_validation = JSON.parse(x).ue_validation;
var ue_id_code = JSON.parse(x).ue_id_code;
var class_id_external_code = JSON.parse(x).class_id_external_code;
var inscription_id_mail = JSON.parse(x).inscription_id_mail;
var inscription_id_nom = JSON.parse(x).inscription_id_nom;
var inscription_id_prenom = JSON.parse(x).inscription_id_prenom;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_id,
"inscription_id": inscription_id,
"session_id": session_id,
"type_eval": type_eval,
"ue_id": ue_id,
"class_id": class_id,
"note_td": note_td,
"note_tp": note_tp,
"note_examen": note_examen,
"regle_calcul": regle_calcul,
"note_finale": note_finale,
"regle_calcul": regle_calcul,
"seuil_validation": seuil_validation,
"ue_coefficient": ue_coefficient,
"ue_validation": ue_validation,
"ue_id_code": ue_id_code,
"class_id_external_code": class_id_external_code,
"inscription_id_mail": inscription_id_mail,
"inscription_id_nom": inscription_id_nom,
"inscription_id_prenom": inscription_id_prenom,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"inscription_id": "",
"session_id": "",
"type_eval": "",
"ue_id": "",
"note_td": "",
"note_tp": "",
"note_examen": "",
"regle_calcul": "",
"note_finale": "",
"ue_id_code": "",
"class_id_external_code": "",
"inscription_id_mail": "",
"inscription_id_nom": "",
"inscription_id_prenom": "",
"regle_calcul": "",
"seuil_validation": "",
"ue_coefficient": "",
"ue_validation": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Session_UE_Final_Note_Classement_result(new_data2);
}
else {
setGetall_Session_UE_Final_Note_Classement_api("false");
setGetall_Session_UE_Final_Note_Classement_message(res.data.message);
// alert(res.data.message)
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
console.warn('Not good man :( Getall_Session_UE_Final_Note_Classement = ', error);
setGetall_Session_UE_Final_Note_Classement_api("false");
// alert(" Impossible de recuperer la liste des évaluations");
setdisplay_alert_mysy("1");
setalert_message(" Impossible de recuperer la liste des évaluations");
setalert_type("error");
//setmyApimyApiMessage("")
})
}
const [New_Getall_Session_Final_Note_Classement_result, setNew_Getall_Session_Final_Note_Classement_result] = useState([]);
const [Getall_Session_Final_Note_Classement_api, setGetall_Session_Final_Note_Classement_api] = useState();
const [Getall_Session_Final_Note_Classement_message, setGetall_Session_Final_Note_Classement_message] = useState();
const [Getall_Session_Final_Note_Classement_result, setGetall_Session_Final_Note_Classement_result] = useState([]);
function Getall_Session_Final_Note_Classement(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("session_id", props.related_collection_recid);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Evaluation_Inscriptio_Note_Classement_With_Filter";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
// console.log(" In Getall_Session_Final_Note_Classement res.data.status = " + res.data.status);
//console.log(" In Getall_Session_Final_Note_Classement res.data.message r_class = " + res.data.message);
setGetall_Session_Final_Note_Classement_api("true");
setGetall_Session_Final_Note_Classement_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var session_id = JSON.parse(x).session_id;
var apprenant_id = JSON.parse(x).apprenant_id;
var class_id = JSON.parse(x).class_id;
var nom = JSON.parse(x).nom;
var prenom = JSON.parse(x).prenom;
var rang = JSON.parse(x).rang;
var note_finale = JSON.parse(x).note_finale;
var rang_calculation_date = JSON.parse(x).rang_calculation_date;
var credit_acquis = JSON.parse(x).credit_acquis;
var jury_note = JSON.parse(x).jury_note;
var jury_observation = JSON.parse(x).jury_observation;
var jury_validation = JSON.parse(x).jury_validation;
//---
var node = {
"_id": local_id,
"id": localid,
"apprenant_id": apprenant_id,
"label": local_id,
"session_id": session_id,
"class_id": class_id,
"nom": nom,
"prenom": prenom,
"rang": rang,
"note_finale": note_finale,
"rang_calculation_date": rang_calculation_date,
"credit_acquis": credit_acquis,
"jury_note": jury_note,
"jury_observation": jury_observation,
"jury_validation": jury_validation,
};
new_data2.push(node);
});
if (new_data2.length > 0)
setNew_Getall_Session_Final_Note_Classement_result(new_data2);
}
else {
setGetall_Session_Final_Note_Classement_api("false");
setGetall_Session_Final_Note_Classement_message(res.data.message);
// alert(res.data.message)
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
console.warn('Not good man :( Getall_Session_Final_Note_Classement = ', error);
setGetall_Session_Final_Note_Classement_api("false");
// alert(" Impossible de recuperer la liste des évaluations");
setdisplay_alert_mysy("1");
setalert_message(" Impossible de recuperer la liste des évaluations");
setalert_type("error");
//setmyApimyApiMessage("")
})
}
useEffect(() => {
Getall_Session_Detail_Final_Note_Classement();
Getall_Session_UE_Final_Note_Classement();
Getall_Session_Final_Note_Classement();
Getall_Class_List_UE();
GetListeInscrit(props.related_collection_recid);
Getall_TrainingSession();
}, [])
const [New_Getall_TrainingSession_result, setNew_Getall_TrainingSession_result] = useState();
const [Getall_TrainingSession_api, setGetall_TrainingSession_api] = useState();
const [Getall_TrainingSession_message, setGetall_TrainingSession_message] = useState();
const [Getall_TrainingSession_result, setGetall_TrainingSession_result] = useState();
function Getall_TrainingSession(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_TrainingSession res.data.status = " + res.data.status);
//console.log(" In Getall_TrainingSession res.data.message r_class = " + res.data.message);
setGetall_TrainingSession_api("true");
setGetall_TrainingSession_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_internal_url = JSON.parse(x).class_internal_url;
var local_title_session = JSON.parse(x).titre;
var local_code_session = JSON.parse(x).code_session;
var local_invoiced_statut = JSON.parse(x).invoiced_statut;
var local_class_id = JSON.parse(x).class_id;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code_session,
"class_internal_url": local_internal_url,
"titre": local_title_session,
"code_session": local_code_session,
"invoiced_statut": local_invoiced_statut,
"class_id": local_class_id,
};
new_data2.push(node);
// return {"_id": " + str(local_id) + ", "label": " + local_courrier_template_ref_interne + '" , "courrier_template_ref_interne": "' + local_courrier_template_ref_interne + '", "nom_champ_technique": "' + local_nom_champ_technique + '", "nom_champ_fonctionel": "' + local_nom_champ_fonctionel + '","valide": "1" };
});
if (new_data2.length > 0)
setNew_Getall_TrainingSession_result(new_data2);
//console.log(" ### new_data2 = ", new_data2)
}
else {
setGetall_TrainingSession_api("false");
setGetall_TrainingSession_message(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_TrainingSession = ', error);
setGetall_TrainingSession_api("false");
//setmyApimyApiMessage("")
})
}
const [nb_stagiaire_Inscrit, setnb_stagiaire_Inscrit] = useState("0");
const [rowss_insc, setRows_insc] = useState([]);
const [New_GetListeInscrit_result, setNew_GetListeInscrit_result] = useState([]);
const [GetListeInscrit_insc_api, setGetListeInscrit_insc_api] = useState();
const [GetListeInscrit_insc_meassage, setGetListeInscrit_insc_meassage] = useState();
const [GetListeInscrit_insc_result, setGetListeInscrit_insc_result] = useState([])
function GetListeInscrit(localsessionid) {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("session_id", localsessionid);
form.append("status", "1");
/*
/!\ : Cette fonction a besoin d'un token actif
*/
if (String(stored_cookie) === String("")) {
alert(" La session n'est plus valide ");
history.push("/Connexion");
return;
}
setLoading(true);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllClassStagiaire/";
fetch(myurl,
{
method: 'POST',
body: form,
})
.then((data) => data.json())
.then((data) => {
setLoading(false);
//console.log(' GetListeInscrit : Success:', data['message'], "data['status'] = ", data['status']);
setGetListeInscrit_insc_result(data['message']);
if (String(data['status']) === String("true")) {
//console.log("erreur rrrr:" + data['status'])
setGetListeInscrit_insc_api("true");
setnb_stagiaire_Inscrit(data['message'].length);
//console.log(" ### setnb_stagiaire_Inscrit = ", data['message'].length);
var new_data2 = [];
const new_data = data['message'].map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var email = JSON.parse(x).email;
var civilite = JSON.parse(x).civilite;
var prenom = JSON.parse(x).prenom;
var nom = JSON.parse(x).nom;
var label = JSON.parse(x).nom + " " + JSON.parse(x).prenom;
//---
var node = {
"_id": local_id,
"id": localid,
"email": email,
"civilite": civilite,
"prenom": prenom,
"nom": nom,
"label": label,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"email": "",
"civilite": "",
"prenom": "",
"label": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_GetListeInscrit_result(new_data2);
else
setNew_GetListeInscrit_result([])
//console.log(" ## new_data2 = ", new_data2)
} else if (String(data['status']) === String("Err_Connexion")) {
alert('Erreur: ' + data['message']);
history.push("/Connexion");
}
else {
setGetListeInscrit_insc_api("false");
}
}).catch((error) => {
setLoading(false);
console.error('Error:', error);
setGetListeInscrit_insc_api("false");
});
}
const [New_Getall_Class_List_UE_result, setNew_Getall_Class_List_UE_result] = useState([]);
const [Getall_Class_List_UE_api, setGetall_Class_List_UE_api] = useState();
const [Getall_Class_List_UE_message, setGetall_Class_List_UE_message] = useState();
const [Getall_Class_List_UE_result, setGetall_Class_List_UE_result] = useState([]);
function Getall_Class_List_UE(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
if (props.session_class_id)
form.append("class_id", props.session_class_id);
else {
setdisplay_alert_mysy("1");
setalert_message(" Paramètres incomplets");
setalert_type("error");
return;
}
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Unite_Enseignement_Of_Given_Class/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Class_List_UE res.data.status = " + res.data.status);
// console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message);
setGetall_Class_List_UE_api("true");
setGetall_Class_List_UE_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_code = JSON.parse(x).code;
var local_titre = JSON.parse(x).titre;
var local_credit = JSON.parse(x).credit;
var local_pres_dist_hyp = JSON.parse(x).pres_dist_hyp;
var local_is_noted = JSON.parse(x).is_noted;
var local_coefficient = JSON.parse(x).coefficient;
var local_seuil_validation = JSON.parse(x).seuil_validation;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"titre": local_titre,
"credit": local_credit,
"pres_dist_hyp": local_pres_dist_hyp,
"is_noted": local_is_noted,
"coefficient": local_coefficient,
"seuil_validation": local_seuil_validation,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"titre": "",
"credit": "",
"pres_dist_hyp": "",
"is_noted": "",
"coefficient": "",
"seuil_validation": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Class_List_UE_result(new_data2);
}
else {
setGetall_Class_List_UE_api("false");
setGetall_Class_List_UE_message(res.data.message);
//alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Class_List_UE = ', error);
setGetall_Class_List_UE_api("false");
alert(" Impossible de recuperer la liste des UE de la formation");
//setmyApimyApiMessage("")
})
}
const [New_Reinscription_Getall_Class_List_UE_Given_Class_result, setNew_Reinscription_Getall_Class_List_UE_Given_Class_result] = useState([]);
const [Reinscription_Getall_Class_List_UE_Given_Class_api, setReinscription_Getall_Class_List_UE_Given_Class_api] = useState();
const [Reinscription_Getall_Class_List_UE_Given_Class_message, setReinscription_Getall_Class_List_UE_Given_Class_message] = useState();
const [Reinscription_Getall_Class_List_UE_Given_Class_result, setReinscription_Getall_Class_List_UE_Given_Class_result] = useState([]);
function Reinscription_Getall_Class_List_UE_Given_Class(local_class_id) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("class_id", local_class_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Unite_Enseignement_Of_Given_Class/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
// console.log(" In Reinscription_Getall_Class_List_UE_Given_Class res.data.status = " + res.data.status);
// console.log(" In Reinscription_Getall_Class_List_UE_Given_Class res.data.message r_class = " + res.data.message);
setReinscription_Getall_Class_List_UE_Given_Class_api("true");
setReinscription_Getall_Class_List_UE_Given_Class_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_code = JSON.parse(x).code;
var local_titre = JSON.parse(x).titre;
var local_credit = JSON.parse(x).credit;
var local_pres_dist_hyp = JSON.parse(x).pres_dist_hyp;
var local_is_noted = JSON.parse(x).is_noted;
var local_coefficient = JSON.parse(x).coefficient;
var local_seuil_validation = JSON.parse(x).seuil_validation;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"titre": local_titre,
"credit": local_credit,
"pres_dist_hyp": local_pres_dist_hyp,
"is_noted": local_is_noted,
"coefficient": local_coefficient,
"seuil_validation": local_seuil_validation,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"titre": "",
"credit": "",
"pres_dist_hyp": "",
"is_noted": "",
"coefficient": "",
"seuil_validation": "",
};
new_data2.push(node);
//console.log(" ### node =", node);
if (new_data2.length > 0)
setNew_Reinscription_Getall_Class_List_UE_Given_Class_result(new_data2);
}
else {
setReinscription_Getall_Class_List_UE_Given_Class_api("false");
setReinscription_Getall_Class_List_UE_Given_Class_message(res.data.message);
//alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Reinscription_Getall_Class_List_UE_Given_Class = ', error);
setReinscription_Getall_Class_List_UE_Given_Class_api("false");
alert(" Impossible de recuperer la liste des UE de la formation");
//setmyApimyApiMessage("")
})
}
const [gridline_session_inscrit_id, setgridline_session_inscrit_id] = useState("");
const [selectionModel_note_Session_classement, setselectionModel_note_Session_classement] = React.useState([]);
const [gridline_id, setgridline_id] = useState("");
const [selectionModel_note_UE_classement, setselectionModel_note_UE_classement] = React.useState([]);
const [gridline_detail_id, setgridline_detail_id] = useState("");
const [selectionModel_detail_note_finale_classement, setselectionModel_detail_note_finale_classement] = React.useState([]);
const [display_alert_mysy, setdisplay_alert_mysy] = useState("");
const [alert_message, setalert_message] = useState("");
const [alert_type, setalert_type] = useState("");
function clear_alert_message() {
setalert_message("");
}
function clear_alert_type() {
setalert_type("");
}
function clear_display_alert_mysy() {
setdisplay_alert_mysy("");
}
const [p_filtre1, setp_filtre1] = useState("");
const [p_filtre1_value, setp_filtre1_value] = useState("");
const [p_filtre2, setp_filtre2] = useState("");
const [p_filtre2_value, setp_filtre2_value] = useState("");
const [p_filtre3, setp_filtre3] = useState("");
const [p_filtre3_value, setp_filtre3_value] = useState("");
const [p_filtre4, setp_filtre4] = useState("");
const [p_filtre4_value, setp_filtre4_value] = useState("");
function clean_all_filters() {
setgridline_id('');
setp_filtre1("");
setp_filtre1_value("");
setp_filtre2("");
setp_filtre2_value("");
setp_filtre3("");
setp_filtre3_value("");
setp_filtre4("");
setp_filtre4_value("");
// Annule_Add_One_Jury_DetailFields();
// Getall_Partner_Jury();
}
const New_Option_Valisation_Jury = [
{ "id": "1", "label": "Oui", "value": "1" },
{ "id": "0", "label": "Non ", "value": "0" },
{ "id": "", "label": "", "value": "" },
]
const New_Option_Filter = [
{ "id": "ue_id", "label": "Code UE", "value": "ue_id" },
{ "id": "inscrit_id", "label": "Apprenant ", "value": "inscrit_id" },
{ "id": "", "label": "", "value": "" },
{ "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
]
function clean_all_filters() {
setp_filtre1("");
setp_filtre1_value("");
setp_filtre2("");
setp_filtre2_value("");
setp_filtre3("");
setp_filtre3_value("");
setp_filtre4("");
setp_filtre4_value("");
Getall_Session_Detail_Final_Note_Classement();
Getall_Session_UE_Final_Note_Classement();
Getall_Session_Final_Note_Classement();
Getall_Class_List_UE();
}
function Jury_Update_Final_Session() {
const new_note_session_with_jury_JSON = JSON.stringify(New_Getall_Session_Final_Note_Classement_result);
console.log(" new_note_session_with_jury_JSON = ", new_note_session_with_jury_JSON);
console.log(" New_Getall_Session_Final_Note_Classement_result = ", New_Getall_Session_Final_Note_Classement_result);
}
function OnchangeCellDataGrid(params) {
// params = la nouvelle lignes
var num_line = params.id; // ==> Id de la ligne changé
var colomn = params.field; // ==> colonne de la ligne changé
var new_value = params.value; // ==> la nouvelle valeur
const updatedData = New_Getall_Session_Final_Note_Classement_result.map((x) => {
var localid = (x).id;
if (String(num_line) === String(localid) && colomn === "jury_note") {
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['session_id'] = (x).session_id;
tmp['class_id'] = (x).class_id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['rang'] = (x).rang;
tmp['note_finale'] = (x).note_finale;
tmp['credit_acquis'] = (x).credit_acquis;
tmp['rang_calculation_date'] = (x).rang_calculation_date;
tmp['jury_note'] = new_value;
tmp['jury_observation'] = (x).jury_observation;
tmp['jury_validation'] = (x).jury_validation;
tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique;
return tmp;
}
if (String(num_line) === String(localid) && colomn === "jury_observation") {
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['session_id'] = (x).session_id;
tmp['class_id'] = (x).class_id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['rang'] = (x).rang;
tmp['note_finale'] = (x).note_finale;
tmp['credit_acquis'] = (x).credit_acquis;
tmp['rang_calculation_date'] = (x).rang_calculation_date;
tmp['jury_note'] = (x).jury_note;
tmp['jury_observation'] = new_value;
tmp['jury_validation'] = (x).jury_validation;
tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique;
return tmp;
}
if (String(num_line) === String(localid) && colomn === "jury_validation") {
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['session_id'] = (x).session_id;
tmp['class_id'] = (x).class_id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['rang'] = (x).rang;
tmp['note_finale'] = (x).note_finale;
tmp['credit_acquis'] = (x).credit_acquis;
tmp['rang_calculation_date'] = (x).rang_calculation_date;
tmp['jury_note'] = (x).jury_note;
tmp['jury_observation'] = (x).jury_observation;
tmp['jury_validation'] = new_value;
tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique;
return tmp;
}
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['session_id'] = (x).session_id;
tmp['class_id'] = (x).class_id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['rang'] = (x).rang;
tmp['note_finale'] = (x).note_finale;
tmp['credit_acquis'] = (x).credit_acquis;
tmp['rang_calculation_date'] = (x).rang_calculation_date;
tmp['jury_note'] = (x).jury_note;
tmp['jury_observation'] = (x).jury_observation;
tmp['jury_validation'] = (x).jury_validation;
tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique;
return tmp;
});
// console.log(" ### updatedData = ", updatedData);
setNew_Getall_Session_Final_Note_Classement_result([]);
setNew_Getall_Session_Final_Note_Classement_result(updatedData);
}
function mysy_onchange_list(num_line, colomn, new_value) {
// params = la nouvelle lignes
/*
var num_line = params.id; // ==> Id de la ligne changé
var colomn = params.field; // ==> colonne de la ligne changé
var new_value = params.value; // ==> la nouvelle valeur
console.log("## colomn = ", colomn, " ### new_value = ", new_value);
*/
const updatedData = New_Getall_Session_Final_Note_Classement_result.map((x) => {
var localid = (x).id;
if (String(num_line) === String(localid) && colomn === "jury_validation_champ_technique") {
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['session_id'] = (x).session_id;
tmp['class_id'] = (x).class_id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['rang'] = (x).rang;
tmp['note_finale'] = (x).note_finale;
tmp['credit_acquis'] = (x).credit_acquis;
tmp['rang_calculation_date'] = (x).rang_calculation_date;
tmp['jury_note'] = (x).jury_note;
tmp['jury_observation'] = (x).jury_observation;
tmp['jury_validation'] = String(new_value);
tmp['jury_validation_champ_technique'] = String(new_value);
return tmp;
}
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['session_id'] = (x).session_id;
tmp['class_id'] = (x).class_id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['rang'] = (x).rang;
tmp['note_finale'] = (x).note_finale;
tmp['credit_acquis'] = (x).credit_acquis;
tmp['rang_calculation_date'] = (x).rang_calculation_date;
tmp['jury_note'] = (x).jury_note;
tmp['jury_observation'] = (x).jury_observation;
tmp['jury_validation'] = (x).jury_validation;
tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique;
return tmp;
});
//console.log(" ### updatedData = ", updatedData);
setNew_Getall_Session_Final_Note_Classement_result([]);
setNew_Getall_Session_Final_Note_Classement_result(updatedData);
}
const [Dialog_1_message, setDialog_1_message] = React.useState(false);
const [Dialog_JURY_INFO_open, setDialog_JURY_INFO_open] = React.useState(false);
const Dialog_JURY_INFO_handleClose_buton = () => {
setDialog_JURY_INFO_open(false);
setp_detail_jury_observation("");
setp_detail_jury_note("");
setp_detail_jury_validation("");
setsession_formation_final_note_classement_id("");
setselected_jury_type_for_observation("");
};
const [p_detail_jury_ue_observation, setp_detail_jury_ue_observation] = useState("");
const [p_detail_jury_ue_note, setp_detail_jury_ue_note] = useState("");
const [p_detail_jury_ue_validation, setp_detail_jury_ue_validation] = useState("");
const [selected_jury_type_for_observation, setselected_jury_type_for_observation] = useState("");
const [session_formation_final_note_classement_id, setsession_formation_final_note_classement_id] = useState("");
const [p_detail_jury_observation, setp_detail_jury_observation] = useState("");
const [p_detail_jury_note, setp_detail_jury_note] = useState("");
const [p_detail_jury_validation, setp_detail_jury_validation] = useState("");
const [selected_inscription_id_for_jury, setselected_inscription_id_for_jury] = useState("");
const [Update_Jury_Promo_List_Inscrit_api, setUpdate_Jury_Promo_List_Inscrit_api] = useState();
const [Update_Jury_Promo_List_Inscrit_message, setUpdate_Jury_Promo_List_Inscrit_message] = useState();
const [Update_Jury_Promo_List_Inscrit_result, setUpdate_Jury_Promo_List_Inscrit_result] = useState([]);
function Update_Jury_Promo_List_Inscrit() {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("jury_id", props.jury_id);
form.append("tab_inscriptions_ids", selected_inscription_id_for_jury);
form.append("jury_observation", p_detail_jury_observation);
form.append("jury_note", p_detail_jury_note);
form.append("jury_validation", p_detail_jury_validation);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Inscrit_Juy_Promo_Decision/";
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Update_Jury_Promo_List_Inscrit res.data.status = " + res.data.status);
//console.log(" In Update_Jury_Promo_List_Inscrit res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setUpdate_Jury_Promo_List_Inscrit_api("true");
setUpdate_Jury_Promo_List_Inscrit_result(res.data.message);
Getall_Session_Final_Note_Classement();
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else {
setUpdate_Jury_Promo_List_Inscrit_api("false");
setUpdate_Jury_Promo_List_Inscrit_message(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
setLoading(false);
console.log('UpdateStagiaireData : Not good man :( Update_Jury_Promo_List_Inscrit = ' + error);
setUpdate_Jury_Promo_List_Inscrit_api("false");
alert(" Impossible d'ajouter ou mettre à jour la décision du jury ");
})
}
const [Update_Jury_UE_List_Inscrit_api, setUpdate_Jury_UE_List_Inscrit_api] = useState();
const [Update_Jury_UE_List_Inscrit_message, setUpdate_Jury_UE_List_Inscrit_message] = useState();
const [Update_Jury_UE_List_Inscrit_result, setUpdate_Jury_UE_List_Inscrit_result] = useState([]);
function Update_Jury_UE_List_Inscrit() {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("tab_ids", session_formation_final_note_classement_id);
form.append("jury_observation", p_detail_jury_observation);
form.append("jury_note", p_detail_jury_note);
form.append("jury_validation", p_detail_jury_validation);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_UE_Jury_Observation/";
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Update_Jury_UE_List_Inscrit res.data.status = " + res.data.status);
//console.log(" In Update_Jury_UE_List_Inscrit res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setUpdate_Jury_UE_List_Inscrit_api("true");
setUpdate_Jury_UE_List_Inscrit_result(res.data.message);
Getall_Session_UE_Final_Note_Classement();
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else {
setUpdate_Jury_UE_List_Inscrit_api("false");
setUpdate_Jury_UE_List_Inscrit_message(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
setLoading(false);
console.log('UpdateStagiaireData : Not good man :( Update_Jury_UE_List_Inscrit = ' + error);
setUpdate_Jury_UE_List_Inscrit_api("false");
setdisplay_alert_mysy("1");
setalert_message(" Impossible d'ajouter ou mettre à jour la décision du jury ");
setalert_type("error");
})
}
// DEBUT EXPORT EXCEL DATAGRID
function CustomToolbar(props) {
return (
);
}
function getExcelData(apiRef) {
// Select rows and columns
const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
// Format the data. Here we only keep the value
const data = filteredSortedRowIds.map((id) => {
const row = {};
visibleColumnsField.forEach((field) => {
row[field] = apiRef.current.getCellParams(id, field).value;
});
return row;
});
return data;
}
function ExportButton(props) {
return (
);
}
function handleExport(apiRef, data_colums) {
const data = getExcelData(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
const local_config = {
keys: visibleColumnsField,
columnNames: data_colums.filter((mydata) => (mydata).disableExport !== true).map(function (mydata) {
if (mydata.headerName && visibleColumnsField.includes(mydata.field)) {
if (mydata.headerName) {
return mydata.headerName;
}
}
}),
fileName: 'data_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_") + '.xlsx',
sheetName: 'Export_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_"),
};
local_config.columnNames = local_config.columnNames.filter(function (element) {
return element !== undefined;
});
const rows = data.map((row) => {
const mRow = {};
for (const key of local_config.keys) {
mRow[key] = row[key];
}
return mRow;
});
const worksheet = XLSX.utils.json_to_sheet(rows);
XLSX.utils.sheet_add_aoa(worksheet, [[...local_config.columnNames]], {
origin: 'A1',
});
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, local_config.sheetName);
XLSX.writeFile(workbook, local_config.fileName, { compression: true });
}
function ExportMenuItem(props) {
const apiRef = useGridApiContext();
const { hideMenu } = props;
return (
);
}
// FIN EXPORT EXCEL DATAGRID
const [vue_note, setvue_note] = useState("classement");
const [actionmass_ftion_val, setactionmass_ftion_val] = useState();
const New_Option = [
{ "id": "0", "label": "(R)Inscrire", "value": "inscription" },
{ "id": "2", "label": "", "value": "" },
]
const [Dialog_add_inscription_message, setDialog_add_inscription_message] = React.useState(false);
const [Dialog_add_inscription_open, setDialog_add_inscription_open] = React.useState(false);
function Dialog_add_inscription_handle_change_participant_session(message) {
setDialog_add_inscription_message(message);
setDialog_add_inscription_open(true);
}
const Dialog_add_inscription_handleClose = () => {
};
const Dialog_add_inscription_handleClose_buton = () => {
setDialog_add_inscription_open(false);
};
const New_Type_apprenant = [
{ "id": "0", "label": "Autre" },
{ "id": "1", "label": "Salariés" },
{ "id": "2", "label": "Apprentis" },
{ "id": "3", "label": "Particuliers" },
{ "id": "4", "label": "Sans Emploi" }
]
const New_civilite = [
{ "id": "mme", "label": "Mme", "value": "mme" },
{ "id": "m", "label": "M", "value": "m" },
{ "id": "neutre", "label": "Neutre", "value": "neutre" },
{ "id": "", "label": "", "value": "" },
]
const New_Financement = [
{
value: 'cpf',
label: 'CPF',
},
{
value: 'perso',
label: 'Fonds Propres',
},
{
value: 'entreprise',
label: 'Votre entreprise',
},
{
value: 'mixte_cpf_perso',
label: 'CPF & Fonds Propres',
},
{
value: 'modefinancement',
label: 'modefinancement',
},
{
value: 'autre',
label: 'Autre',
},
];
const [selected_apprenant_id, setselected_apprenant_id] = useState("");
const [selected_apprenant_row_id, setselected_apprenant_row_id] = useState("");
const [p_dialog_session_id, setp_dialog_session_id] = useState("");
const [p_dialog_type_apprenant, setp_dialog_type_apprenant] = useState("");
const [p_dialog_financement, setp_dialog_financement] = useState("");
const [p_dialog_client_rattachement_id, setp_dialog_client_rattachement_id] = useState("");
const [p_dialog_eu_id, setp_dialog_eu_id] = useState("");
const [Add_Inscription_Apprenant_api, setAdd_Inscription_Apprenant_api] = useState();
const [Add_Inscription_Apprenant_message, setAdd_Inscription_Apprenant_message] = useState();
const [Add_Inscription_Apprenant_result, setAdd_Inscription_Apprenant_result] = useState();
function Add_Inscription_Apprenant() {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("_id", selected_apprenant_id);
form.append("session_id", p_dialog_session_id);
form.append("type_apprenant", p_dialog_type_apprenant);
form.append("modefinancement", p_dialog_financement);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Apprenant_Inscrire_Session/";
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Add_Inscription_Apprenant res.data.status = " + res.data.status);
//console.log(" In Add_Inscription_Apprenant res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setAdd_Inscription_Apprenant_api("true");
setAdd_Inscription_Apprenant_result(res.data.message);
Dialog_add_inscription_handleClose_buton();
// Get_Appenant_List_Inscription(selected_apprenant_id);
setp_dialog_session_id('');
setp_dialog_type_apprenant('');
setp_dialog_financement('');
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
window.scrollTo({
top: divh,
behavior: "smooth",
});
}
}
else {
setAdd_Inscription_Apprenant_api("false");
setAdd_Inscription_Apprenant_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Add_Inscription_Apprenant : Not good man :( Add_Inscription_Apprenant = ' + error);
setAdd_Inscription_Apprenant_api("false");
alert(" Impossible d'ajouter l'inscription ");
})
}
function GetSelectedRowsSession() {
///alert(" les lignes slected sont : " + selectionModel + " nb item = " + selectionModel.length);
//const selectedRowsData = selectionModel.map((id) => rowss.find((row) => row.id === id));
//console.log(rowss[0]);
var tab_tmp = []
for (var i = 0; i < selectionModel_note_Session_classement.length; i++) {
var myid = parseInt(String(selectionModel_note_Session_classement[i]));
var line = New_Getall_Session_Final_Note_Classement_result[myid];
tab_tmp.push(line.apprenant_id);
//console.log(rowss[myid]['external_code']);
}
return tab_tmp;
}
const [Add_Inscription_List_Apprenant_api, setAdd_Inscription_List_Apprenant_api] = useState();
const [Add_Inscription_List_Apprenant_message, setAdd_Inscription_List_Apprenant_message] = useState();
const [Add_Inscription_List_Apprenant_result, setAdd_Inscription_List_Apprenant_result] = useState();
function Add_Inscription_List_Apprenant() {
var liste_apprenant = GetSelectedRowsSession();
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("list_apprenant_id", liste_apprenant);
form.append("session_id", p_dialog_session_id);
form.append("type_apprenant", p_dialog_type_apprenant);
form.append("modefinancement", p_dialog_financement);
form.append("tab_ue_ids", p_dialog_eu_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Apprenant_Inscrire_Session_List/";
Dialog_add_inscription_handleClose_buton();
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Add_Inscription_List_Apprenant res.data.status = " + res.data.status);
//console.log(" In Add_Inscription_List_Apprenant res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setAdd_Inscription_List_Apprenant_api("true");
setAdd_Inscription_List_Apprenant_result(res.data.message);
Dialog_add_inscription_handleClose_buton();
setp_dialog_session_id('');
setp_dialog_eu_id("");
setp_dialog_type_apprenant('');
setp_dialog_financement('');
setselectionModel_note_Session_classement([]);
setactionmass_ftion_val('');
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
window.scrollTo({
top: divh,
behavior: "smooth",
});
}
}
else {
setAdd_Inscription_List_Apprenant_api("false");
setAdd_Inscription_List_Apprenant_message(res.data.message);
//alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
setLoading(false);
console.warn('Add_Inscription_List_Apprenant : Not good man :( Add_Inscription_List_Apprenant = ' + error);
setAdd_Inscription_List_Apprenant_api("false");
alert(" Impossible d'inscrire les apprenant à cette session ");
})
}
return (
{isLoading &&
}
{/*** Affichage des messages d'alerte*/}
{display_alert_mysy && String(display_alert_mysy) === "1" &&
}
{/*** FIN Affichage des messages d'alerte*/}
{/*** Dialog pour reinscrire un apprenant à une session */}
{/*** Fin Dialog pour reinscrire un apprenant à une session */}
{/* Dialog pour gerer les JURY_INFO */}
{/* FIN Dialog pour gerer les JURY_INFO */}