);
}
const [isLoading, setLoading] = useState();
const New_Option_Filter = [
{ "id": "user", "label": "Lié a la Formation (code externe) ", "value": "class_external_code" },
{ "id": "user_group", "label": "Lié a la Classe (code Classe) ", "value": "code_session" },
{ "id": "ty", "label": "Lié a l'UE (code UE) ", "value": "code_ue" },
{ "id": "", "label": "", "value": "" },
{ "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
]
const New_Option_type_user = [
{ "id": "user", "label": "Personnes Inscrites", "value": "user" },
{ "id": "user_group", "label": "Groupe ", "value": "user_group" },
{ "id": "", "label": "", "value": "" },
]
const New_Option_type_goupe = [
{ "id": "td", "label": "Groupe TD", "value": "td" },
{ "id": "tp", "label": "Groupe TP", "value": "tp" },
{ "id": "", "label": "", "value": "" },
]
const [New_Getall_Groupe_Membres_result, setNew_Getall_Groupe_Membres_result] = useState([]);
const [Getall_Groupe_Membres_api, setGetall_Groupe_Membres_api] = useState();
const [Getall_Groupe_Membres_message, setGetall_Groupe_Membres_message] = useState();
const [Getall_Groupe_Membres_result, setGetall_Groupe_Membres_result] = useState([]);
function Getall_Groupe_Membres(local_groupe_id) {
var evalutaion_id = "";
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("_id", local_groupe_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Groupe_Membres/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Groupe_Membres res.data.status = " + res.data.status);
//console.log(" In Getall_Groupe_Membres res.data.message r_class = " + res.data.message);
setGetall_Groupe_Membres_api("true");
setGetall_Groupe_Membres_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
// /!\ : ici on met l'inscription dans le '_id' exceptionnellement.
// Ca permet de rester cohérent avec la recherche venant de la collection 'inscription', pas de recherche depuis un groupe de TD ou TP...
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x).inscription_id;
var local_nom = JSON.parse(x).nom;
var local_prenom = JSON.parse(x).prenom;
var local_email = JSON.parse(x).email;
var local_inscription_id = JSON.parse(x).inscription_id;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom,
"nom": local_nom,
"prenom": local_prenom,
"email": local_email,
"groupe": "",
"inscription_id": local_inscription_id,
};
new_data2.push(node);
});
if (new_data2) {
setNew_Getall_Groupe_Membres_result(new_data2);
setNew_GetListePreinscrit_insc_result(new_data2);
}
}
else {
setGetall_Groupe_Membres_api("false");
setGetall_Groupe_Membres_message(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
console.warn('Not good man :( Getall_Groupe_Membres = ', error);
setGetall_Groupe_Membres_api("false");
alert(" Impossible de recuperer la liste des membres du groupe");
//setmyApimyApiMessage("")
})
}
const [New_GetListePreinscrit_insc_result, setNew_GetListePreinscrit_insc_result] = useState([]);
const [GetListePreinscrit_insc_api, setGetListePreinscrit_insc_api] = useState();
const [GetListePreinscrit_insc_meassage, setGetListePreinscrit_insc_meassage] = useState();
const [GetListePreinscrit_insc_result, setGetListePreinscrit_insc_result] = useState([])
function GetListeInscrit() {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("session_id", props.session_id);
setLoading(true);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Accepted_Insription_From_Session_id_Reduice_Fields/";
fetch(myurl,
{
method: 'POST',
body: form,
})
.then((data) => data.json())
.then((data) => {
setLoading(false);
//console.log(' GetListeInscrit : Success:', data['message'], "data['status'] = ", data['status']);
setGetListePreinscrit_insc_result(data['message']);
if (String(data['status']) === String("true")) {
//console.log("erreur rrrr:" + data['status'])
setGetListePreinscrit_insc_api("true");
var new_data2 = [];
const new_data = data['message'].map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_nom = JSON.parse(x).apprenant_nom;
var local_prenom = JSON.parse(x).apprenant_prenom;
var local_email = JSON.parse(x).apprenant_email;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom + " " + local_prenom,
"nom": local_nom,
"prenom": local_prenom,
"email": local_email,
"groupe": "",
};
new_data2.push(node);
});
if (new_data2) {
setNew_GetListePreinscrit_insc_result(new_data2);
}
} else if (String(data['status']) === String("Err_Connexion")) {
alert('Erreur: ' + data['message']);
history.push("/Connexion");
}
else {
setGetListePreinscrit_insc_api("false");
}
}).catch((error) => {
setLoading(false);
console.error('Error:', error);
setGetListePreinscrit_insc_api("false");
});
}
const myRef_head = useRef(null);
function get_attendee_list_data() {
if (String(p_filtre1_value) === "user") {
GetListeInscrit();
}
if (String(p_filtre1_value) === "user_group") {
Getall_Groupe_Membres(p_filtre2_value);
}
}
const [gridline_id, setgridline_id] = useState("");
const New_Option_PreInscription = [
{ "id": "inscr", "label": "Inscrire", "value": "inscr" },
]
const [actionmass_preinsc_val, setactionmass_preinsc_val] = useState();
function GetSelectedRows_PreInsc_Ids() {
var tab_tmp = []
for (var i = 0; i < selectionModel_participants.length; i++) {
//console.log(" ### selectionModel_insc[i] = ", selectionModel_insc[i]);
var myid = parseInt(String(selectionModel_participants[i]));
//var line = JSON.parse(rowss[myid]);
tab_tmp.push(myid);
}
return tab_tmp;
}
async function actionmass_preinsc_Traitemet() {
var liste_preinscr_id = GetSelectedRows_PreInsc_Ids();
var tab_mongo_preins_ids = [];
for (var i = 0; i < liste_preinscr_id.length; i++) {
var line = New_GetListePreinscrit_insc_result[liste_preinscr_id[i]]
var line_json = line;
console.log(" line_json = ", line_json);
//console.log(" line_json['_id'] = ", line_json['_id']);
tab_mongo_preins_ids.push(line_json._id)
}
if (String(actionmass_preinsc_val) === String("inscr")) {
Record_Inscrit_To_Evaluation(tab_mongo_preins_ids);
}
}
const [Record_Inscrit_To_Evaluation_api, setRecord_Inscrit_To_Evaluation_api] = useState();
const [Record_Inscrit_To_Evaluation_message, setRecord_Inscrit_To_Evaluation_message] = useState();
const [Record_Inscrit_To_Evaluation_result, setRecord_Inscrit_To_Evaluation_result] = useState();
function Record_Inscrit_To_Evaluation(list_inscription_id) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("evaluation_id", props.evaluation_selected_id);
form.append("tab_inscription_id", list_inscription_id);
form.append("tab_group_inscription_id", "");
setLoading(true);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Record_Participant_To_Evaluation/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
setLoading(false);
//console.log(" In UpdateStagiaireData res.data.status = " + res.data.status);
//console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message);
setRecord_Inscrit_To_Evaluation_api("true");
setRecord_Inscrit_To_Evaluation_result(res.data.message);
setselectionModel_participants([]);
setactionmass_preinsc_val("");
// alert(res.data.message)
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
} else if (String(res.data.status) === String("Err_Connexion")) {
setLoading(false);
alert('Erreur: ' + res.data.message);
history.push("/Connexion");
}
else {
setLoading(false);
setRecord_Inscrit_To_Evaluation_api("false");
setRecord_Inscrit_To_Evaluation_message(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
setLoading(false);
console.warn('Record_Inscrit_To_Evaluation : Not good man :( mysearchtext = ' + error);
setRecord_Inscrit_To_Evaluation_api("false");
alert(" Impossible de faire les inscriptions ");
})
}
const [New_Get_List_UE_From_Class_Id_result, setNew_Get_List_UE_From_Class_Id_result] = useState([]);
const [Get_List_UE_From_Class_Id_api, setGet_List_UE_From_Class_Id_api] = useState();
const [Get_List_UE_From_Class_Id_message, setGet_List_UE_From_Class_Id_message] = useState();
const [Get_List_UE_From_Class_Id_result, setGet_List_UE_From_Class_Id_result] = useState();
function Get_List_UE_From_Class_Id(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 Get_List_UE_From_Class_Id res.data.status = " + res.data.status);
//console.log(" In Get_List_UE_From_Class_Id res.data.message r_class = " + res.data.message);
setGet_List_UE_From_Class_Id_api("true");
setGet_List_UE_From_Class_Id_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_class_id = JSON.parse(x).class_id;
var local_internal_url = JSON.parse(x).internal_url;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"titre": local_titre,
"class_id": local_class_id,
"internal_url": local_internal_url,
};
new_data2.push(node);
});
//---
/* var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"titre": "",
"class_id": "",
"internal_url": "",
};
new_data2.push(node);*/
if (new_data2.length > 0) {
setNew_Get_List_UE_From_Class_Id_result(new_data2);
// console.log("### setNew_Get_List_UE_From_Class_Id_result = ", new_data2);
}
}
else {
setGet_List_UE_From_Class_Id_api("false");
setGet_List_UE_From_Class_Id_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 :( Get_List_UE_From_Class_Id = ', error);
setGet_List_UE_From_Class_Id_api("false");
alert(" Impossible de recuperer la liste des UE de la formation");
//setmyApimyApiMessage("")
})
}
const [New_Getall_Class_List_Evalution_result, setNew_Getall_Class_List_Evalution_result] = useState([]);
const [Getall_Class_List_Evalution_api, setGetall_Class_List_Evalution_api] = useState();
const [Getall_Class_List_Evalution_message, setGetall_Class_List_Evalution_message] = useState();
const [Getall_Class_List_Evalution_result, setGetall_Class_List_Evalution_result] = useState([]);
function Getall_Class_List_Evalution(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_Class_Evaluation/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Class_List_Evalution res.data.status = " + res.data.status);
//console.log(" In Getall_Class_List_Evalution res.data.message r_class = " + res.data.message);
setGetall_Class_List_Evalution_api("true");
setGetall_Class_List_Evalution_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_class_id = JSON.parse(x).class_id;
var local_class_ue_id = JSON.parse(x).class_ue_id;
var local_class_ue_code = JSON.parse(x).class_ue_code;
var local_type_evaluation_id = JSON.parse(x).type_evaluation_id;
var local_type_evaluation_code = JSON.parse(x).type_evaluation_code;
var local_max_note = JSON.parse(x).max_note;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_type_evaluation_code + "-" + local_class_ue_code,
"class_id": local_class_id,
"class_ue_id": local_class_ue_id,
"class_ue_code": local_class_ue_code,
"type_evaluation_id": local_type_evaluation_id,
"type_evaluation_code": local_type_evaluation_code,
"max_note": local_max_note,
};
new_data2.push(node);
});
//---
/* var node = {
"_id": "",
"id": "",
"label": "",
"class_id": "",
"class_ue_id": "",
"class_ue_code": "",
"type_evaluation_id": "",
"type_evaluation_code": "",
"max_note": "",
};
new_data2.push(node);*/
if (new_data2.length > 0) {
setNew_Getall_Class_List_Evalution_result(new_data2);
//console.log(" setNew_Getall_Class_List_Evalution_result = ", new_data2);
}
}
else {
setGetall_Class_List_Evalution_api("false");
setGetall_Class_List_Evalution_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_Evalution = ', error);
setGetall_Class_List_Evalution_api("false");
alert(" Impossible de recuperer la liste des évaluations de la formatio");
//setmyApimyApiMessage("")
})
}
const [New_Get_Inscrit_List_UE_result, setNew_Get_Inscrit_List_UE_result] = useState([]);
const [tab_inscrit_ue_id, settab_inscrit_ue_id] = useState([]);
const [Get_Inscrit_List_UE_api, setGet_Inscrit_List_UE_api] = useState();
const [Get_Inscrit_List_UE_message, setGet_Inscrit_List_UE_message] = useState();
const [Get_Inscrit_List_UE_result, setGet_Inscrit_List_UE_result] = useState();
function Get_Inscrit_List_UE(local_inscription_id) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("inscription_id", local_inscription_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Inscrit_List_EU/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Get_Inscrit_List_UE res.data.status = " + res.data.status);
// console.log(" In Get_Inscrit_List_UE res.data.message r_class = " + res.data.message);
setGet_Inscrit_List_UE_api("true");
setGet_Inscrit_List_UE_result(res.data.message);
var new_data2 = [];
var tab_tmp = []
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_class_id = JSON.parse(x).class_id;
var local_class_eu_id = JSON.parse(x).class_eu_id;
var local_ue_code = JSON.parse(x).code;
var local_ue_titre = JSON.parse(x).titre;
tab_tmp.push(local_class_eu_id);
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_ue_code,
"class_id": local_class_id,
"class_eu_id": local_class_eu_id,
"ue_code": local_ue_code,
"ue_titre": local_ue_titre,
};
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" };
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"class_id": "",
"class_eu_id": "",
"ue_code": "",
"ue_titre": "",
};
new_data2.push(node);
if (new_data2.length > 0) {
setNew_Get_Inscrit_List_UE_result(new_data2);
settab_inscrit_ue_id(tab_tmp);
if (New_Getall_Class_List_Evalution_result && New_Getall_Class_List_Evalution_result.length > 0) {
var local_defaultValue = New_Getall_Class_List_Evalution_result.filter((data) => {
if (tab_inscrit_evaluation_ue_id.includes(String(data.type_evaluation_id))) {
return data;
}
});
setinscription_list_ue_eval(local_defaultValue);
}
}
}
else {
setGet_Inscrit_List_UE_api("false");
setGet_Inscrit_List_UE_message(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Get_Inscrit_List_UE = ', error);
setGet_Inscrit_List_UE_api("false");
//setmyApimyApiMessage("")
})
}
const [tab_inscrit_evaluation_ue_id, settab_inscrit_evaluation_ue_id] = useState([]);
const [inscription_list_ue, setinscription_list_ue] = useState([]);
const [inscription_list_ue_eval, setinscription_list_ue_eval] = useState([]);
const [New_Getall_Partner_Session_Reduice_Fields_result, setNew_Getall_Partner_Session_Reduice_Fields_result] = useState([]);
const [Getall_Partner_Session_Reduice_Fields_api, setGetall_Partner_Session_Reduice_Fields_api] = useState();
const [Getall_Partner_Session_Reduice_Fields_message, setGetall_Partner_Session_Reduice_Fields_message] = useState();
const [Getall_Partner_Session_Reduice_Fields_result, setGetall_Partner_Session_Reduice_Fields_result] = useState();
function Getall_Partner_Session_Reduice_Fields(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/Get_Partner_Session_Ftion_Reduice_Fields/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Session_Reduice_Fields res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Session_Reduice_Fields res.data.message r_class = " + res.data.message);
setGetall_Partner_Session_Reduice_Fields_api("true");
setGetall_Partner_Session_Reduice_Fields_result(res.data.message);
setRows(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_session = JSON.parse(x).code_session;
var local_titre = JSON.parse(x).titre;
var local_class_internal_url = JSON.parse(x).class_internal_url;
var local_date_debut = JSON.parse(x).date_debut;
var local_date_fin = JSON.parse(x).date_fin;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code_session,
"code_session": local_code_session,
"titre": local_titre,
"class_internal_url": local_class_internal_url,
"date_debut": local_date_debut,
"date_fin": local_date_fin,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code_session": "",
"titre": "",
"class_internal_url": "",
"date_debut": "",
"date_fin": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Session_Reduice_Fields_result(new_data2);
}
else {
setGetall_Partner_Session_Reduice_Fields_api("false");
setGetall_Partner_Session_Reduice_Fields_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_Partner_Session_Reduice_Fields = ', error);
setGetall_Partner_Session_Reduice_Fields_api("false");
alert(" Impossible de recuperer la liste des sessions de formation (classe)");
//setmyApimyApiMessage("")
})
}
const [New_Getall_Partner_Class_Reduice_Fields_result, setNew_Getall_Partner_Class_Reduice_Fields_result] = useState([]);
const [Getall_Partner_Class_Reduice_Fields_api, setGetall_Partner_Class_Reduice_Fields_api] = useState();
const [Getall_Partner_Class_Reduice_Fields_message, setGetall_Partner_Class_Reduice_Fields_message] = useState();
const [Getall_Partner_Class_Reduice_Fields_result, setGetall_Partner_Class_Reduice_Fields_result] = useState();
function Getall_Partner_Class_Reduice_Fields(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/Get_Partner_All_Class_Few_Fields/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Class_Reduice_Fields res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Class_Reduice_Fields res.data.message r_class = " + res.data.message);
setGetall_Partner_Class_Reduice_Fields_api("true");
setGetall_Partner_Class_Reduice_Fields_result(res.data.message);
setRows(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_external_code = JSON.parse(x).external_code;
var local_internal_code = JSON.parse(x).internal_code;
var local_internal_url = JSON.parse(x).internal_url;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_external_code,
"external_code": local_external_code,
"internal_code": local_internal_code,
"internal_url": local_internal_url
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"external_code": "",
"internal_code": "",
"internal_url": ""
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Class_Reduice_Fields_result(new_data2);
}
else {
setGetall_Partner_Class_Reduice_Fields_api("false");
setGetall_Partner_Class_Reduice_Fields_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_Partner_Class_Reduice_Fields = ', error);
setGetall_Partner_Class_Reduice_Fields_api("false");
alert(" Impossible de recuperer la liste des formations");
//setmyApimyApiMessage("")
})
}
const [New_Getall_Partner_Groupe_Inscrit_result, setNew_Getall_Partner_Groupe_Inscrit_result] = useState([]);
const [Getall_Partner_Groupe_Inscrit_api, setGetall_Partner_Groupe_Inscrit_api] = useState();
const [Getall_Partner_Groupe_Inscrit_message, setGetall_Partner_Groupe_Inscrit_message] = useState();
const [Getall_Partner_Groupe_Inscrit_result, setGetall_Partner_Groupe_Inscrit_result] = useState([]);
function Getall_Partner_Groupe_Inscrit(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("session_id", props.session_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Groupe_Inscrit_With_Filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Groupe_Inscrit res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Groupe_Inscrit res.data.message r_class = " + res.data.message);
setGetall_Partner_Groupe_Inscrit_api("true");
setGetall_Partner_Groupe_Inscrit_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_nom = JSON.parse(x).nom;
var local_type_groupe_code = JSON.parse(x).type_groupe_code;
var local_class_id = JSON.parse(x).class_id;
var local_session_id = JSON.parse(x).session_id;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"nom": local_nom,
"type_groupe_code": local_type_groupe_code,
"class_id": local_class_id,
"session_id": local_session_id,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"nom": "",
"type_groupe_code": "",
"class_id": "",
"session_id": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Groupe_Inscrit_result(new_data2);
}
else {
setGetall_Partner_Groupe_Inscrit_api("false");
setGetall_Partner_Groupe_Inscrit_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_Partner_Groupe_Inscrit = ', error);
setGetall_Partner_Groupe_Inscrit_api("false");
alert(" Impossible de recuperer la liste des groupes d'inscrits");
//setmyApimyApiMessage("")
})
}
useEffect(() => {
Get_List_UE_From_Class_Id(props.class_id);
Getall_Class_List_Evalution(props.class_id);
Getall_Partner_Class_Reduice_Fields();
Getall_Partner_Session_Reduice_Fields();
Getall_Groupe_Apprenant_Type();
Getall_Partner_Groupe_Inscrit();
}, []);
const [New_Getall_Groupe_Apprenant_Type_result, setNew_Getall_Groupe_Apprenant_Type_result] = useState([]);
const [Getall_Groupe_Apprenant_Type_api, setGetall_Groupe_Apprenant_Type_api] = useState();
const [Getall_Groupe_Apprenant_Type_message, setGetall_Groupe_Apprenant_Type_message] = useState();
const [Getall_Groupe_Apprenant_Type_result, setGetall_Groupe_Apprenant_Type_result] = useState();
function Getall_Groupe_Apprenant_Type(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/Get_Type_Groupe_Apprenant/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Groupe_Apprenant_Type res.data.status = " + res.data.status);
//console.log(" In Getall_Groupe_Apprenant_Type res.data.message r_class = " + res.data.message);
setGetall_Groupe_Apprenant_Type_api("true");
setGetall_Groupe_Apprenant_Type_result(res.data.message);
setRows(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_description = JSON.parse(x).description;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code + " - " + local_description,
"code": local_code,
"description": local_description,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"description": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Groupe_Apprenant_Type_result(new_data2);
}
else {
setGetall_Groupe_Apprenant_Type_api("false");
setGetall_Groupe_Apprenant_Type_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_Groupe_Apprenant_Type = ', error);
setGetall_Groupe_Apprenant_Type_api("false");
alert(" Impossible de recuperer la liste des type de groupe d'apprenants");
//setmyApimyApiMessage("")
})
}
const icon = ;
const checkedIcon = ;
const [ueChanged, setueChanged] = 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("");
}
return (
{isLoading &&
}
{/*** Affichage des messages d'alerte*/}
{display_alert_mysy && String(display_alert_mysy) === "1" &&
}
{/*** FIN Affichage des messages d'alerte*/}
Selection des Apprenants & Groupe d'apprenants
{' '}
{String(actionmass_preinsc_val) === "inscr" &&
Confirmer la validation des inscriptions en masse pour {selectionModel_participants.length} lignes.
}