{' '}
En confirmant cette opération, l'inscrit sera définitivement supprimé.
)}
);
}
}
]
const [Delete_List_Participant_From_Evaluation_api, setDelete_List_Participant_From_Evaluation_api] = useState();
const [Delete_List_Participant_From_Evaluation_message, setDelete_List_Participant_From_Evaluation_message] = useState();
const [Delete_List_Participant_From_Evaluation_result, setDelete_List_Participant_From_Evaluation_result] = useState();
function Delete_List_Participant_From_Evaluation(local_tab_ids) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("evaluation_id", selected_id);
form.append("tab_inscription_id", local_tab_ids);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Participant_From_Evaluation/";
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Delete_List_Participant_From_Evaluation res.data.status = " + res.data.status);
//console.log(" In Delete_List_Participant_From_Evaluation res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setDelete_List_Participant_From_Evaluation_api("true");
setDelete_List_Participant_From_Evaluation_result(res.data.message);
setnoted_changed("");
setselectionModel_evalutions_participant([]);
settab_convention_pieces_jointes_result([]);
Getall_Evaluation_Participant_List(selected_id);
alert(res.data.message)
}
else {
setDelete_List_Participant_From_Evaluation_api("false");
setDelete_List_Participant_From_Evaluation_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Delete_List_Participant_From_Evaluation : Not good man :( mysearchtext = ' + error);
setDelete_List_Participant_From_Evaluation_api("false");
alert(" Impossible de supprimer les données");
})
}
const [selectionModel_evalutions, setselectionModel_evalutions] = React.useState([]);
const [selectionModel_evalutions_participant, setselectionModel_evalutions_participant] = React.useState([]);
const [selected_id, setselected_id] = React.useState("");
const [display_evaluation, setdisplay_evaluation] = React.useState("");
const [evaluation_data_changed, setevaluation_data_changed] = React.useState("");
const [evaluation_data_edit_mode, setevaluation_data_edit_mode] = useState("");
const [add_one_evaluation, setadd_one_evaluation] = React.useState("");
function handleClick_edit_evaluation_From_Line(selected_row_id) {
var line = JSON.parse(Getall_Partner_Evaluation_result[selected_row_id]);
setselected_id(line._id);
setgridline_id(selected_row_id);
Get_Given_Evaluation_Data(line._id);
Get_List_UE_From_Class_Id(line.class_id);
setdisplay_evaluation("1");
setadd_one_evaluation("");
setevaluation_data_changed("");
setevaluation_data_edit_mode("");
setsubmenu("detail_evaluation");
//Getall_Evaluation_Participant_List();
}
const [GetAttendee_api, setGetAttendee_api] = useState();
const [GetAttendee_message, setGetAttendee_message] = useState();
const [GetAttendee_result, setGetAttendee_result] = useState();
function Get_Given_Evaluation_Data(evaluation_id) {
setevaluation_data_changed("");
setevaluation_data_edit_mode("");
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("evaluation_id", evaluation_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Evaluation_Planification/";
setLoading(true);
axios.post(myurl, form).then(res => {
if (String(res.data.status) === "true") {
setLoading(false);
//console.log(" In Get_Given_Evaluation_Data res.data.status = " + res.data.status);
//console.log(" In Get_Given_Evaluation_Data res.data.message r_class = " + res.data.message);
setGetAttendee_api("true");
setGetAttendee_result(res.data.message);
if (res.data.message.length > 0) {
var mylocal_evaluation = JSON.parse(res.data.message);
if (mylocal_evaluation.code)
setp_detail_code(mylocal_evaluation.code);
else
setp_detail_code("");
if (mylocal_evaluation.titre) {
setp_detail_titre(mylocal_evaluation.titre);
} else {
setp_detail_titre("");
}
if (mylocal_evaluation.description) {
setp_detail_description(mylocal_evaluation.description);
} else {
setp_detail_description("");
}
if (mylocal_evaluation.comment) {
setp_detail_comment(mylocal_evaluation.comment);
} else {
setp_detail_comment("");
}
if (mylocal_evaluation.class_id) {
setp_detail_class_id(mylocal_evaluation.class_id);
} else {
setp_detail_class_id("");
}
if (mylocal_evaluation.class_internal_url) {
setp_detail_class_internal_url(mylocal_evaluation.class_internal_url);
} else {
setp_detail_class_internal_url("");
}
if (mylocal_evaluation.class_eu_id) {
setp_detail_class_eu_id(mylocal_evaluation.class_eu_id);
} else {
setp_detail_class_eu_id("");
}
if (mylocal_evaluation.type_eval_id) {
setp_detail_type_eval_id(mylocal_evaluation.type_eval_id);
} else {
setp_detail_type_eval_id("");
}
if (mylocal_evaluation.eval_date_heure_debut) {
setp_detail_eval_date_heure_debut(mylocal_evaluation.eval_date_heure_debut);
}
if (mylocal_evaluation.eval_date_heure_fin)
setp_detail_eval_date_heure_fin(mylocal_evaluation.eval_date_heure_fin);
if (mylocal_evaluation.statut) {
setp_detail_statut(mylocal_evaluation.statut);
} else {
setp_detail_statut("");
}
if (mylocal_evaluation.adress) {
setp_detail_adress(mylocal_evaluation.adress);
} else {
setp_detail_adress("");
}
if (mylocal_evaluation.cp) {
setp_detail_cp(mylocal_evaluation.cp);
} else {
setp_detail_cp("");
}
if (mylocal_evaluation.ville) {
setp_detail_ville(mylocal_evaluation.ville);
} else {
setp_detail_ville("");
}
if (mylocal_evaluation.pays) {
setp_detail_pays(mylocal_evaluation.pays);
} else {
setp_detail_pays("");
}
if (mylocal_evaluation.responsable_id) {
setp_detail_responsable_id(mylocal_evaluation.responsable_id);
} else {
setp_detail_responsable_id("");
}
if (mylocal_evaluation.session_id) {
setp_detail_session_id(mylocal_evaluation.session_id);
} else {
setp_detail_session_id("");
}
if (document.getElementById('myRef')) {
var divh = document.getElementById('myRef').offsetTop;
window.scrollTo({
top: divh,
behavior: "smooth",
});
}
Disable_Evaluation_DetailFields();
} else {
alert(" Aucune donnée recuperée");
}
} else if (String(res.data.status) === String("Err_Connexion")) {
alert('Erreur: ' + res.data.message);
history.push("/Connexion");
}
else {
setLoading(false);
setGetAttendee_api("false");
setGetAttendee_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Get_Given_Evaluation_Data = ', error);
setGetAttendee_api("false");
alert(" Impossible de recuperer les données de l'évaluation");
//setmyApimyApiMessage("")
})
}
const New_Option_Filter = [
{ "id": "class_external_code", "label": "Lié a la Formation (code externe) ", "value": "class_external_code" },
{ "id": "code_session", "label": "Lié a la Classe (code Classe) ", "value": "code_session" },
{ "id": "code_ue", "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_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]);
const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState();
const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState();
const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState([]);
function Getall_Training_Employee_No_Filter(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_List_Ressource_Humaine_no_filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Training_Employee_No_Filter res.data.status = " + res.data.status);
//console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message);
setGetall_Training_Employee_No_Filter_api("true");
setGetall_Training_Employee_No_Filter_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_nom = JSON.parse(x).nom;
var local_prenom = JSON.parse(x).prenom;
var local_ismanager = JSON.parse(x).ismanager;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom + " " + local_prenom,
"nom": local_nom,
"prenom": local_prenom,
"ismanager": local_ismanager
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"nom": "",
"prenom": "",
"ismanager": ""
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Training_Employee_No_Filter_result(new_data2);
}
else {
setGetall_Training_Employee_No_Filter_api("false");
setGetall_Training_Employee_No_Filter_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_Training_Employee_No_Filter = ', error);
setGetall_Training_Employee_No_Filter_api("false");
alert(" Impossible de recuperer la liste des employés");
//setmyApimyApiMessage("")
})
}
const [New_Getall_Training_Materiel_No_Filter_result, setNew_Getall_Training_Materiel_No_Filter_result] = useState([]);
const [Getall_Training_Materiel_No_Filter_api, setGetall_Training_Materiel_No_Filter_api] = useState();
const [Getall_Training_Materiel_No_Filter_message, setGetall_Training_Materiel_No_Filter_message] = useState();
const [Getall_Training_Materiel_No_Filter_result, setGetall_Training_Materiel_No_Filter_result] = useState();
function Getall_Training_Materiel_No_Filter(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_List_Ressource_Materielle_no_filter/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Training_Materiel_No_Filter res.data.status = " + res.data.status);
//console.log(" In Getall_Training_Materiel_No_Filter res.data.message r_class = " + res.data.message);
setGetall_Training_Materiel_No_Filter_api("true");
setGetall_Training_Materiel_No_Filter_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_nom = JSON.parse(x).nom;
var local_ref_interne = JSON.parse(x).ref_interne;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom,
"nom": local_nom,
"ref_interne": local_ref_interne,
};
new_data2.push(node);
});
if (new_data2.length > 0)
setNew_Getall_Training_Materiel_No_Filter_result(new_data2);
}
else {
setGetall_Training_Materiel_No_Filter_api("false");
setGetall_Training_Materiel_No_Filter_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Training_Materiel_No_Filter = ', error);
setGetall_Training_Materiel_No_Filter_api("false");
alert(" Impossible de recuperer la liste du materiel");
//setmyApimyApiMessage("")
})
}
const [New_Getall_Evaluation_Participant_List_result, setNew_Getall_Evaluation_Participant_List_result] = useState([]);
const [Getall_Evaluation_Participant_List_api, setGetall_Evaluation_Participant_List_api] = useState();
const [Getall_Evaluation_Participant_List_message, setGetall_Evaluation_Participant_List_message] = useState();
const [Getall_Evaluation_Participant_List_result, setGetall_Evaluation_Participant_List_result] = useState([]);
function Getall_Evaluation_Participant_List(local_evalutaion_id) {
var evalutaion_id = "";
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("evaluation_id", local_evalutaion_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Participant_To_Evaluation/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Evaluation_Participant_List res.data.status = " + res.data.status);
//console.log(" In Getall_Evaluation_Participant_List res.data.message r_class = " + res.data.message);
setGetall_Evaluation_Participant_List_api("true");
setGetall_Evaluation_Participant_List_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_nom = JSON.parse(x).nom;
var local_prenom = JSON.parse(x).prenom;
var local_email = JSON.parse(x).email;
var local_note = JSON.parse(x).note;
var local_inscription_id = JSON.parse(x).inscription_id;
var local_group_inscription_id = JSON.parse(x).group_inscription_id;
var local_convocation_send_date = JSON.parse(x).convocation_send_date;
var local_convocation_send_type = JSON.parse(x).convocation_send_type;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom,
"nom": local_nom,
"prenom": local_prenom,
"email": local_email,
"note": local_note,
"note_changed": "0",
"inscription_id": local_inscription_id,
"group_inscription_id": local_group_inscription_id,
"convocation_send_date": String(local_convocation_send_date).substring(0, 10),
"convocation_send_type": String(local_convocation_send_type).substring(0, 10),
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"nom": "",
"prenom": "",
"email": "",
"note": "",
"note_changed": "0",
"inscription_id": "",
"group_inscription_id": "",
"convocation_send_date": "",
"convocation_send_type": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Evaluation_Participant_List_result(new_data2);
}
else {
setGetall_Evaluation_Participant_List_api("false");
setGetall_Evaluation_Participant_List_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_Evaluation_Participant_List = ', error);
setGetall_Evaluation_Participant_List_api("false");
alert(" Impossible de recuperer la liste des inscrits à l'évaluation");
//setmyApimyApiMessage("")
})
}
const [New_Getall_Partner_Evaluation_result, setNew_Getall_Partner_Evaluation_result] = useState([]);
const [Getall_Partner_Evaluation_api, setGetall_Partner_Evaluation_api] = useState();
const [Getall_Partner_Evaluation_message, setGetall_Partner_Evaluation_message] = useState();
const [Getall_Partner_Evaluation_result, setGetall_Partner_Evaluation_result] = useState([]);
function Getall_Partner_Evaluation(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_List_Evaluation_Planification_No_Filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Evaluation res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Evaluation res.data.message r_class = " + res.data.message);
setGetall_Partner_Evaluation_api("true");
setGetall_Partner_Evaluation_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_class_eu_id = JSON.parse(x).class_eu_id;
var local_type_eval_id = JSON.parse(x).type_eval_id;
var local_eval_date_heure_debut = JSON.parse(x).eval_date_heure_debut;
var local_eval_date_heure_fin = JSON.parse(x).eval_date_heure_fin;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"titre": local_titre,
"class_id": local_class_id,
"class_eu_id": local_class_eu_id,
"type_eval_id": local_type_eval_id,
"eval_date_heure_debut": local_eval_date_heure_debut,
"eval_date_heure_fin": local_eval_date_heure_fin,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"titre": "",
"class_id": "",
"class_eu_id": "",
"type_eval_id": "",
"eval_date_heure_debut": "",
"eval_date_heure_fin": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Evaluation_result(new_data2);
}
else {
setGetall_Partner_Evaluation_api("false");
setGetall_Partner_Evaluation_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_Partner_Evaluation = ', error);
setGetall_Partner_Evaluation_api("false");
alert(" Impossible de recuperer la liste des évaluations");
//setmyApimyApiMessage("")
})
}
const [gridline_id, setgridline_id] = useState("");
const [gridline_inscrit_id, setgridline_inscrit_id] = useState("");
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);
}
}).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_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);
}
}).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_List_UE_result, setNew_Getall_Partner_List_UE_result] = useState([]);
const [Getall_Partner_List_UE_api, setGetall_Partner_List_UE_api] = useState();
const [Getall_Partner_List_UE_message, setGetall_Partner_List_UE_message] = useState();
const [Getall_Partner_List_UE_result, setGetall_Partner_List_UE_result] = useState();
function Getall_Partner_List_UE(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_List_Unite_Enseignement_no_filter/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_List_UE res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_List_UE res.data.message r_class = " + res.data.message);
setGetall_Partner_List_UE_api("true");
setGetall_Partner_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 node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"titre": local_titre,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"titre": "",
"credit": "",
"pres_dist_hyp": "",
"is_noted": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_List_UE_result(new_data2);
}
else {
setGetall_Partner_List_UE_api("false");
setGetall_Partner_List_UE_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Partner_List_UE = ', error);
setGetall_Partner_List_UE_api("false");
alert(" Impossible de recuperer la liste des UE de la formation");
//setmyApimyApiMessage("")
})
}
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);
}
else {
setGet_List_UE_From_Class_Id_api("false");
setGet_List_UE_From_Class_Id_message(res.data.message);
alert(res.data.message);
}
}).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_Partner_Type_Evalution_List_result, setNew_Getall_Partner_Type_Evalution_List_result] = useState([]);
const [Getall_Partner_Type_Evalution_List_api, setGetall_Partner_Type_Evalution_List_api] = useState();
const [Getall_Partner_Type_Evalution_List_message, setGetall_Partner_Type_Evalution_List_message] = useState();
const [Getall_Partner_Type_Evalution_List_result, setGetall_Partner_Type_Evalution_List_result] = useState([]);
function Getall_Partner_Type_Evalution_List(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_List_Type_Evaluation/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Type_Evalution_List res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Type_Evalution_List res.data.message r_class = " + res.data.message);
setGetall_Partner_Type_Evalution_List_api("true");
setGetall_Partner_Type_Evalution_List_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 node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"nom": local_nom,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"nom": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Type_Evalution_List_result(new_data2);
}
else {
setGetall_Partner_Type_Evalution_List_api("false");
setGetall_Partner_Type_Evalution_List_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Partner_Type_Evalution_List = ', error);
setGetall_Partner_Type_Evalution_List_api("false");
alert(" Impossible de recuperer la liste des types d'evaluation");
//setmyApimyApiMessage("")
})
}
useEffect(() => {
Getall_Partner_Class_Reduice_Fields();
Getall_Partner_Session_Reduice_Fields();
Getall_Partner_List_UE();
Getall_Partner_Type_Evalution_List();
Getall_Training_Employee_No_Filter();
Getall_Training_Materiel_No_Filter();
Getall_Partner_Evaluation();
window.scrollTo({
top: 0,
behavior: "smooth",
});
Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc("EVALUATION_CONVOCATION");
}, [])
const myRef_head = useRef(null);
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("");
Getall_Partner_Evaluation();
}
const [Getall_Training_Employee_With_Filter_api, setGetall_Training_Employee_With_Filter_api] = useState();
const [Getall_Training_Employee_With_Filter_message, setGetall_Training_Employee_With_Filter_message] = useState();
const [Getall_Training_Employee_With_Filter_result, setGetall_Training_Employee_With_Filter_result] = useState();
function Getall_Training_Employee_With_Filter(event) {
var form = new FormData();
// Recuperation des parametres
var filtre1 = p_filtre1;
var filtre2 = p_filtre2;
var filtre3 = p_filtre3;
var filtre4 = p_filtre4;
var filtre1_value = "";
var filtre2_value = "";
var filtre3_value = "";
var filtre4_value = "";
// Recuperation des valeurs de filtres
if (p_filtre1_value) {
filtre1_value = p_filtre1_value;
form.append(filtre1, filtre1_value);
}
if (p_filtre2_value) {
filtre2_value = p_filtre2_value;
form.append(filtre2, filtre2_value);
}
if (p_filtre3_value) {
filtre3_value = p_filtre3_value;
form.append(filtre3, p_filtre3_value);
}
if (p_filtre4_value) {
filtre4_value = p_filtre4_value;
form.append(filtre4, p_filtre4_value);
}
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Evaluation_Planification_With_Filter/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Training_Employee_With_Filter res.data.status = " + res.data.status);
//console.log(" In Getall_Training_Employee_With_Filter res.data.message r_class = " + res.data.message);
setGetall_Training_Employee_With_Filter_api("true");
setGetall_Training_Employee_With_Filter_result(res.data.message);
setGetall_Partner_Evaluation_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_class_eu_id = JSON.parse(x).class_eu_id;
var local_type_eval_id = JSON.parse(x).type_eval_id;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code,
"code": local_code,
"titre": local_titre,
"class_id": local_class_id,
"local_class_eu_id": local_class_eu_id,
"local_type_eval_id": local_type_eval_id,
};
new_data2.push(node);
});
//---
var node = {
"_id": "",
"id": "",
"label": "",
"code": "",
"titre": "",
"class_id": "",
"local_class_eu_id": "",
"local_type_eval_id": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Evaluation_result(new_data2);
}
else {
setGetall_Training_Employee_With_Filter_api("false");
setGetall_Training_Employee_With_Filter_message(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Getall_Training_Employee_With_Filter = ', error);
setGetall_Training_Employee_With_Filter_api("false");
//setmyApimyApiMessage("")
})
}
const [Add_Update_Evaluation_Data_api, setAdd_Update_Evaluation_Data_api] = useState();
const [Add_Update_Evaluation_Data_message, setAdd_Update_Evaluation_Data_message] = useState();
const [Add_Update_Evaluation_Data_result, setAdd_Update_Evaluation_Data_result] = useState();
function Add_Update_Evaluation_Data() {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("code", p_detail_code);
form.append("titre", p_detail_titre);
form.append("description", p_detail_description);
form.append("comment", p_detail_comment);
form.append("class_id", p_detail_class_id);
form.append("class_eu_id", p_detail_class_eu_id);
form.append("type_eval_id", p_detail_type_eval_id);
var new_p_detail_eval_date_heure_debut = "";
if (typeof p_detail_eval_date_heure_debut == "object") {
var act_deadline = format(p_detail_eval_date_heure_debut, 'dd/MM/yyyy HH:mm');
new_p_detail_eval_date_heure_debut = act_deadline;
} else {
new_p_detail_eval_date_heure_debut = p_detail_eval_date_heure_debut;
}
form.append("eval_date_heure_debut", new_p_detail_eval_date_heure_debut);
var new_p_detail_eval_date_heure_fin = "";
if (typeof p_detail_eval_date_heure_fin == "object") {
var act_deadline = format(p_detail_eval_date_heure_fin, 'dd/MM/yyyy HH:mm');
new_p_detail_eval_date_heure_fin = act_deadline;
} else {
new_p_detail_eval_date_heure_fin = p_detail_eval_date_heure_fin;
}
form.append("eval_date_heure_fin", new_p_detail_eval_date_heure_fin);
form.append("statut", p_detail_statut);
form.append("adress", p_detail_adress);
form.append("cp", p_detail_cp);
form.append("ville", p_detail_ville);
form.append("pays", p_detail_pays);
form.append("responsable_id", p_detail_responsable_id);
form.append("session_id", p_detail_session_id);
var myurl = "";
if (selected_id && String(selected_id).length > 5) {
form.append("evaluation_id", selected_id);
myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Evaluation_Planification/";
} else {
myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Evaluation_Planification/";
}
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Add_Update_Evaluation_Data res.data.status = " + res.data.status);
//console.log(" In Add_Update_Evaluation_Data res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setAdd_Update_Evaluation_Data_api("true");
setAdd_Update_Evaluation_Data_result(res.data.message);
Disable_Evaluation_DetailFields();
setevaluation_data_changed("");
setevaluation_data_edit_mode("");
if (selected_id && String(selected_id).length > 5) {
Disable_Evaluation_DetailFields();
setevaluation_data_changed("");
setevaluation_data_edit_mode("");
setdisplay_evaluation('1');
} else {
Disable_Evaluation_DetailFields();
setevaluation_data_changed("");
setevaluation_data_edit_mode("");
setdisplay_evaluation("");
setadd_one_evaluation("");
setsubmenu("");
}
Getall_Partner_Evaluation();
alert(res.data.message);
if (document.getElementById('myRef')) {
// myRef.current.scrollIntoView({ behavior: "smooth" });
var divh = document.getElementById('myRef').offsetTop;
window.scrollTo({
top: divh,
behavior: "smooth",
});
}
}
else {
setAdd_Update_Evaluation_Data_api("false");
setAdd_Update_Evaluation_Data_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.log('UpdateStagiaireData : Not good man :( Add_Update_Evaluation_Data = ' + error);
setAdd_Update_Evaluation_Data_api("false");
alert(" Impossible d'ajouter ou mettre à jour l'évaluation");
})
}
function Annule_Evaluaton_DetailFields() {
Get_Given_Evaluation_Data(selected_id);
setevaluation_data_changed("");
setevaluation_data_edit_mode("");
}
const [p_detail_code, setp_detail_code] = React.useState("");
const [p_detail_titre, setp_detail_titre] = React.useState("");
const [p_detail_description, setp_detail_description] = React.useState("");
const [p_detail_comment, setp_detail_comment] = React.useState("");
const [p_detail_class_id, setp_detail_class_id] = React.useState("");
const [p_detail_class_internal_url, setp_detail_class_internal_url] = React.useState("");
const [p_detail_class_eu_id, setp_detail_class_eu_id] = React.useState("");
const [p_detail_type_eval_id, setp_detail_type_eval_id] = React.useState("");
const [p_detail_eval_date_heure_debut, setp_detail_eval_date_heure_debut] = useState(new Date());
const [p_detail_eval_date_heure_fin, setp_detail_eval_date_heure_fin] = useState(new Date());
const [p_detail_statut, setp_detail_statut] = React.useState("");
const [p_detail_adress, setp_detail_adress] = React.useState("");
const [p_detail_cp, setp_detail_cp] = React.useState("");
const [p_detail_ville, setp_detail_ville] = React.useState("");
const [p_detail_pays, setp_detail_pays] = React.useState("");
const [p_detail_responsable_id, setp_detail_responsable_id] = React.useState("");
const [p_detail_session_id, setp_detail_session_id] = React.useState("");
function clear_DetailFieds() {
setp_detail_code("");
setp_detail_titre("");
setp_detail_description("");
setp_detail_comment("");
setp_detail_class_id("");
setp_detail_class_eu_id("");
setp_detail_type_eval_id("");
setp_detail_eval_date_heure_debut(new Date());
setp_detail_eval_date_heure_fin(new Date());
setp_detail_statut("");
setp_detail_adress("");
setp_detail_cp("");
setp_detail_ville("");
setp_detail_pays("");
setp_detail_responsable_id("");
setp_detail_session_id("");
}
const myRef = useRef(null)
function Enable_Evaluation_DetailFields() {
setevaluation_data_edit_mode("1");
var liste_champs = ['detail_code', 'detail_titre', 'detail_description', 'detail_classe',
'detail_ftion', 'detail_ue', 'detail_type_eval', 'detail_debut', 'detail_fin', 'detail_adresse',
'detail_cp', 'detail_ville', 'detail_pays', 'detail_responsable']
for (let i = 0; i < liste_champs.length; i++) {
if (document.getElementsByName(String(liste_champs[i])) && document.getElementsByName(String(liste_champs[i]))[0]) {
document.getElementsByName(String(liste_champs[i]))[0].disabled = false;
document.getElementsByName(String(liste_champs[i]))[0].style.backgroundColor = "#FFFFFF";
}
}
}
const sleep = (milliseconds) => {
return new Promise(resolve => setTimeout(resolve, milliseconds))
}
async function Disable_Evaluation_DetailFields() {
await sleep(5);
setevaluation_data_edit_mode("0");
var liste_champs = ['detail_code', 'detail_titre', 'detail_description', 'detail_classe',
'detail_ftion', 'detail_ue', 'detail_type_eval', 'detail_debut', 'detail_fin', 'detail_adresse',
'detail_cp', 'detail_ville', 'detail_pays', 'detail_responsable', 'detail_titre_01']
for (let i = 0; i < liste_champs.length; i++) {
if (document.getElementsByName(String(liste_champs[i])) && document.getElementsByName(String(liste_champs[i]))[0]) {
document.getElementsByName(String(liste_champs[i]))[0].disabled = true;
document.getElementsByName(String(liste_champs[i]))[0].style.backgroundColor = "#ECEFF1";
}
}
if (document.getElementsByName("detail_titre_01") && document.getElementsByName("detail_titre_01")[0]) {
document.getElementsByName("detail_titre_01")[0].disabled = true;
document.getElementsByName("detail_titre_01")[0].style.backgroundColor = "#ECEFF1";
}
}
function planifier_one_evaluation() {
clear_DetailFieds();
setevaluation_data_edit_mode("");
setevaluation_data_changed("");
setdisplay_evaluation("");
setselected_id("");
setgridline_id("");
setadd_one_evaluation("1");
setsubmenu("detail_evaluation");
if (document.getElementById('myRef')) {
// myRef.current.scrollIntoView({ behavior: "smooth" });
var divh = document.getElementById('myRef').offsetTop;
window.scrollTo({
top: divh,
behavior: "smooth",
});
}
}
function Annule_Add_One_Evaluaton_DetailFields() {
setevaluation_data_edit_mode("");
setevaluation_data_changed("");
setdisplay_evaluation("");
setselected_id("");
setadd_one_evaluation("");
setsubmenu("");
}
async function submenu_detail() {
await sleep(5);
setsubmenu("detail_evaluation");
inactive_active_menu_header("detail_evaluation");
if (String(evaluation_data_edit_mode) !== "1") {
Disable_Evaluation_DetailFields();
}
}
async function submenu_apprenant() {
await sleep(5);
setsubmenu("apprenant");
inactive_active_menu_header("apprenant");
}
async function submenu_piece_jointe() {
await sleep(5);
setsubmenu("piece_jointe");
inactive_active_menu_header("piece_jointe");
// Refresh affichage des pièces jointes
Get_List_Of_All_PJ(props.client_id);
}
async function submenu_ressources() {
Getall_List_note_evaluation_Ressource(selected_id);
await sleep(5);
setsubmenu("ressources");
inactive_active_menu_header("ressources");
}
async function submenu_selection() {
await sleep(5);
setsubmenu("selection");
inactive_active_menu_header("selection");
}
// Cette fontion desactive tous les menu header et reactive just le menu_header concerné
function inactive_active_menu_header(current_menu_header) {
const list_menu_header_names = ['detail_evaluation', 'apprenant', 'piece_jointe', 'selection', 'ressources']
for (let i = 0; i < list_menu_header_names.length; i++) {
if (document.getElementsByName(String(list_menu_header_names[i])) && document.getElementsByName(String(list_menu_header_names[i]))[0]) {
document.getElementsByName(String(list_menu_header_names[i]))[0].style.fontWeight = "400";
}
}
if (document.getElementsByName(String(current_menu_header)) && document.getElementsByName(String(current_menu_header))[0]) {
document.getElementsByName(String(current_menu_header))[0].style.fontWeight = "700";
}
}
function GetSelectedRows_Apprenant_Evaluation_Ids() {
var tab_tmp = []
for (var i = 0; i < selectionModel_evalutions_participant.length; i++) {
//console.log(" ### selectionModel_insc[i] = ", selectionModel_insc[i]);
var myid = parseInt(String(selectionModel_evalutions_participant[i]));
//var line = JSON.parse(rowss[myid]);
tab_tmp.push(myid);
}
return tab_tmp;
}
async function actionmass_evaluation_apprenant_Traitemet() {
var liste_apprenant_id = GetSelectedRows_Apprenant_Evaluation_Ids();
var tab_mongo_preins_ids = [];
for (var i = 0; i < liste_apprenant_id.length; i++) {
var line = Getall_Evaluation_Participant_List_result[liste_apprenant_id[i]]
var line_json = JSON.parse(line)
//console.log(" line_json['prenom'] = ", line_json['prenom']);
//console.log(" line_json['_id'] = ", line_json['_id']);
tab_mongo_preins_ids.push(line_json['_id'])
}
if (String(actionmass_eval_inscr_val) === String("delete_inscr")) {
Delete_List_Participant_From_Evaluation(tab_mongo_preins_ids);
setactionmass_eval_inscr_val("");
}
if (String(actionmass_eval_inscr_val) === String("send_convocation")) {
setDialog_CONVOCATION_EVAL_open(true); //zzzz
setactionmass_eval_inscr_val("");
}
}
const [actionmass_eval_inscr_val, setactionmass_eval_inscr_val] = useState();
const New_Option_PreInscription = [
{ "id": "send_convocation", "label": "Envoyer Convocation", "value": "send_convocation" },
{ "id": "delete_inscr", "label": "Supprimer", "value": "delete_inscr" },
{ "id": "", "label": "", "value": "" },
]
const [Record_Evaluation_Participants_Notes_api, setRecord_Evaluation_Participants_Notes_api] = useState();
const [Record_Evaluation_Participants_Notes_message, setRecord_Evaluation_Participants_Notes_message] = useState();
const [Record_Evaluation_Participants_Notes_result, setRecord_Evaluation_Participants_Notes_result] = useState([]);
function Record_Evaluation_Participants_Notes() {
var form = new FormData();
const new_partcipant_notes_JSON = JSON.stringify(New_Getall_Evaluation_Participant_List_result);
// console.log(" Record_Evaluation_Participants_Notes New_Getall_TrainingParticipant_result = ", New_Getall_TrainingParticipant_result);
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("evaluation_id", selected_id);
form.append("tab_participant_note", new_partcipant_notes_JSON);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Participant_Evaluation_Note/";
setLoading(true);
axios.post(myurl, form).then(res => {
console.log(" In Record_Evaluation_Participants_Notes res.data.status = " + res.data.status);
console.log(" In Record_Evaluation_Participants_Notes res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setnoted_changed("");
Getall_Evaluation_Participant_List(selected_id);
setselectionModel_evalutions_participant([]);
settab_convention_pieces_jointes_result([]);
alert(res.data.message);
}
else {
setRecord_Evaluation_Participants_Notes_api("false");
setRecord_Evaluation_Participants_Notes_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Record_Evaluation_Participants_Notes : Not good man :( Record_Evaluation_Participants_Notes = ' + error);
setRecord_Evaluation_Participants_Notes_api("false");
alert(" Impossible de mettre à jour les données des participants ");
})
}
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
setnoted_changed("1");
const updatedData = New_Getall_Evaluation_Participant_List_result.map((x) => {
var localid = (x).id;
if (String(num_line) === String(localid) && colomn === "note") {
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['email'] = (x).email;
tmp['groupe'] = (x).groupe;
tmp['note_changed'] = "1";
tmp['note'] = new_value;
return tmp;
}
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['email'] = (x).email;
tmp['groupe'] = (x).groupe;
tmp['note_changed'] = (x).note_changed;
tmp['note'] = (x).note;
return tmp;
});
//console.log(" ### updatedData = ", updatedData);
setNew_Getall_Evaluation_Participant_List_result([]);
setNew_Getall_Evaluation_Participant_List_result(updatedData);
}
const [line_changed_color, setline_changed_color] = useState("red");
const [noted_changed, setnoted_changed] = useState("");
function Annuler_change_note() {
Getall_Evaluation_Participant_List(selected_id);
setnoted_changed("");
submenu_apprenant();
}
// -- Gestion pièces jointes
const [Download_one_attached_document_api, setDownload_one_attached_document_api] = useState();
const [Download_one_attached_document_result, setDownload_one_attached_document_result] = useState();
const [Download_one_attached_document_message, setDownload_one_attached_document_message] = useState();
const Download_one_attached_document = (event) => {
const stored_cookie = getCookie('tokenmysypart');
var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
var token = stored_cookie;
var file_name = event.target.id;
var url = process.env.REACT_APP_API_URL + "myclass/api/Get_Stored_Downloaded_File/" + token + "/" + file_name;
setLoading(true);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
setLoading(false);
fileDownload(res.data, nom_fiche_detaillee);
setDownload_one_attached_document_api("true");
}).catch((error) => {
setLoading(false);
console.error('Error:', error);
setDownload_one_attached_document_api("false");
});
}
const editorRef_competence = useRef(null);
const [editorRef_competence_limite, seteditorRef_competence_limite] = useState(800);
const [file_1_name, setfile_1_name] = useState();
const [sessions_file_change_1_api, setsessions_file_change_1_api] = useState();
const [sessions_file_change_1_result, setsessions_file_change_1_result] = useState();
const [sessions_file_change_1_message, setsessions_file_change_1_message] = useState();
const sessions_file_change_1 = event => {
const fileUploaded = event.target.files[0];
let file_size = event.target.files[0].size;
let file_type = event.target.files[0].type;
console.log("file_size = ", file_size, " file_type = ", file_type);
if (file_size > 10000000) {
alert("Le fichier ne doit pas depasser un 1 Méga octets");
console.log("Le fichier ne doit pas depasser un 1 Méga octets");
return;
}
setfile_1_name(event.target.files[0]);
const formData = new FormData();
formData.append('File', fileUploaded);
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
const stored_cookie = getCookie('tokenmysypart');
//formData.append("token", stored_cookie);
//formData.append("class_internal_url", internal_url);
//console.log("token = " + stored_cookie);
return;
};
const [file_2_name, setfile_2_name] = useState();
const [sessions_file_change_2_api, setsessions_file_change_2_api] = useState();
const [sessions_file_change_2_result, setsessions_file_change_2_result] = useState();
const [sessions_file_change_2_message, setsessions_file_change_2_message] = useState();
const sessions_file_change_2 = event => {
const fileUploaded = event.target.files[0];
let file_size = event.target.files[0].size;
let file_type = event.target.files[0].type;
console.log("file_size = ", file_size, " file_type = ", file_type);
if (file_size > 10000000) {
alert("Le fichier ne doit pas depasser un 1 Méga octets");
console.log("Le fichier ne doit pas depasser un 1 Méga octets");
return;
}
setfile_2_name(event.target.files[0]);
const formData = new FormData();
formData.append('File', fileUploaded);
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
const stored_cookie = getCookie('tokenmysypart');
//formData.append("token", stored_cookie);
//formData.append("class_internal_url", internal_url);
//console.log("token = " + stored_cookie);
return;
};
const [Record_All_PJ_api, setRecord_All_PJ_api] = useState();
const [Record_All_PJ_result, setRecord_All_PJ_result] = useState();
const [Record_All_PJ_message, setRecord_All_PJ_message] = useState();
function Record_All_PJ() {
if (!p_detail_one_file_to_download_type_name) {
alert(" Vous devez donner un nom à la pièce jointe");
return;
}
if (file_1_name && file_1_name.name) {
console.log(" ### Traitement de : ", file_1_name.name);
const formData = new FormData();
formData.append('File', file_1_name);
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
const stored_cookie = getCookie('tokenmysypart');
formData.append("token", stored_cookie);
formData.append("file_business_object", p_detail_one_file_to_download_type_name);
formData.append("file_name", file_1_name.name);
formData.append("status", "0");
formData.append("object_owner_collection", "note_evaluation");
formData.append("object_owner_id", selected_id);
//formData.append("class_internal_url", internal_url);
//console.log("token = " + stored_cookie);
fetch(
process.env.REACT_APP_API_URL + "myclass/api/Store_User_Downloaded_File/",
{
method: 'POST',
body: formData,
}
)
.then((response) => response.json())
.then((result) => {
//console.log(" ## result['status'] = ", result['status'])
if (String(result['status']) === String("true")) {
//console.log('Success:', result['message']);
setRecord_All_PJ_result(result['message']);
setRecord_All_PJ_api("true");
Get_List_Of_All_PJ(props.client_id);
setfile_1_name();
setp_detail_one_file_to_download_type_name();
//GetCurrentClass_trainingsession();
alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée")
}
else {
setRecord_All_PJ_message(result['message']);
setRecord_All_PJ_api("false");
}
})
.catch((error) => {
console.error(' Record_All_PJ Error:', error);
setRecord_All_PJ_api("false");
});
}
if (file_2_name && file_2_name.name) {
console.log(" ### Traitement de : ", file_2_name.name);
}
}
const [Delete_one_attached_document_api, setDelete_one_attached_document_api] = useState();
const [Delete_one_attached_document_result, setDelete_one_attached_document_result] = useState();
const [Delete_one_attached_document_message, setDelete_one_attached_document_message] = useState();
const Delete_one_attached_document = (event) => {
const stored_cookie = getCookie('tokenmysypart');
var formData = new FormData();
var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
var file_name = event.target.id;
formData.append("token", stored_cookie);
formData.append("file_name", file_name);
var url = process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/";
fetch(
process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/",
{
method: 'POST',
body: formData,
}
)
.then((response) => response.json())
.then((result) => {
//console.log(" ## result['status'] = ", result['status'])
if (String(result['status']) === String("true")) {
//console.log('Success:', result['message']);
setDelete_one_attached_document_result(result['message']);
setDelete_one_attached_document_api("true");
Get_List_Of_All_PJ(props.client_id);
alert(result['message'])
}
else {
setDelete_one_attached_document_message(result['message']);
setDelete_one_attached_document_api("false");
}
})
.catch((error) => {
console.error(' Record_All_PJ Error:', error);
setDelete_one_attached_document_api("false");
alert(" Impossible de supprimer le document")
});
}
const [Get_List_Of_All_PJ_api, setGet_List_Of_All_PJ_api] = useState();
const [Get_List_Of_All_PJ_result, setGet_List_Of_All_PJ_result] = useState();
const [Get_List_Of_All_PJ_message, setGet_List_Of_All_PJ_message] = useState();
function Get_List_Of_All_PJ(local_employee_id) {
const formData = new FormData();
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
const stored_cookie = getCookie('tokenmysypart');
formData.append("token", stored_cookie);
formData.append("object_owner_collection", "note_evaluation");
formData.append("object_owner_id", selected_id);
//formData.append("class_internal_url", internal_url);
//console.log("token = " + stored_cookie);
fetch(
process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files/",
{
method: 'POST',
body: formData,
}
)
.then((response) => response.json())
.then((result) => {
//console.log(" ## result['status'] = ", result['status'])
if (String(result['status']) === String("true")) {
//console.log('Message :', result['message']);
setGet_List_Of_All_PJ_result(result['message']);
setGet_List_Of_All_PJ_api("true");
}
else {
setGet_List_Of_All_PJ_message(result['message']);
setGet_List_Of_All_PJ_api("false");
}
})
.catch((error) => {
console.error(' Get_List_Of_All_PJ Error:', error);
setGet_List_Of_All_PJ_api("false");
});
}
function Delete_file_1_name() {
setfile_1_name();
}
function Delete_file_2_name() {
setfile_2_name();
}
const [p_detail_one_file_to_download_type_name, setp_detail_one_file_to_download_type_name] = useState();
// -- end gestion pièces jointes
function Export_evaluation_note_exel() {
const stored_cookie = getCookie('tokenmysypart');
var nom_fichier_cmd = "export_notes.xlsx";
var url = process.env.REACT_APP_API_URL + "myclass/api/Export_To_Excel_List_Participant_To_Evaluation/" + stored_cookie + "/" + selected_id + "/";
setLoading(true);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
setLoading(false);
//console.log(" In Export_Dashbord_to_CSV res.data = " + res.data);
if (String(res.data) === String("false")) {
alert("Impossible d'exporter les notes (2) ");
} else {
fileDownload(res.data, nom_fichier_cmd)
}
}).catch((error) => {
setLoading(false);
console.error('Error:', error);
alert(" Impossible d'exporter les notes ")
});
setLoading(false);
}
// -- Debut gestion des ressources
const [event_start_date, setevent_start_date] = useState("");
const [event_end_date, setevent_end_date] = useState("");
const [Get_Ressource_Avabilities_avability_check, setGet_Ressource_Avabilities_avability_check] = useState("");
const [Get_Ressource_Avabilities_api, setGet_Ressource_Avabilities_api] = useState();
const [Get_Ressource_Avabilities_message, setGet_Ressource_Avabilities_message] = useState();
const [Get_Ressource_Avabilities_result, setGet_Ressource_Avabilities_result] = useState([]);
function Get_Ressource_Avabilities(local_related_collection_recid) {
var form = new FormData();
var line = New_Getall_Partner_Evaluation_result.filter((data) => (data)._id === String(selected_id))
var event_start = String(line[0].eval_date_heure_debut);
setevent_start_date(String(line[0].eval_date_heure_debut));
var event_end = String(line[0].eval_date_heure_fin);
setevent_end_date(String(line[0].eval_date_heure_fin));
//var event_start = format(String(line[0].eval_date_heure_debut), 'dd/MM/yyyy HH:mm');
//var event_end = format(String(line[0].eval_date_heure_fin), 'dd/MM/yyyy HH:mm');
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("related_collection", Dialog_seq_ressource_1_selected_type_ressource);
form.append("related_collection_recid", local_related_collection_recid);
form.append("event_start", String(event_start));
form.append("event_end", String(event_end));
//console.log(" ### form = ", form)
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Is_Ressource_Available/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
/*console.log(" In Get_Ressource_Avabilities res.data.status = " + res.data.status);
console.log(" In Get_Ressource_Avabilities res.data.message r_class = " + res.data.message);
console.log(" In Get_Ressource_Avabilities res.data.avability_check r_class = " + res.data.avability_check);
*/
setGet_Ressource_Avabilities_api("true");
setGet_Ressource_Avabilities_result(res.data.message);
setGet_Ressource_Avabilities_avability_check(res.data.avability_check);
}
else {
setGet_Ressource_Avabilities_api("false");
setGet_Ressource_Avabilities_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Get_Ressource_Avabilities = ', error);
setGet_Ressource_Avabilities_api("false");
alert("Impossible de récuperer la liste des ressources de la sequence")
//setmyApimyApiMessage("")
})
}
const [Getall_List_note_evaluation_Ressource_api, setGetall_List_note_evaluation_Ressource_api] = useState();
const [Getall_List_note_evaluation_Ressource_message, setGetall_List_note_evaluation_Ressource_message] = useState();
const [Getall_List_note_evaluation_Ressource_result, setGetall_List_note_evaluation_Ressource_result] = useState([]);
function Getall_List_note_evaluation_Ressource(local_note_evaluation_id) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("note_evaluation_id", local_note_evaluation_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_note_evaluation_Ressource_Affectation/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_List_note_evaluation_Ressource res.data.status = " + res.data.status);
//console.log(" In Getall_List_note_evaluation_Ressource res.data.message r_class = " + res.data.message);
setGetall_List_note_evaluation_Ressource_api("true");
setGetall_List_note_evaluation_Ressource_result(res.data.message);
}
else {
setGetall_List_note_evaluation_Ressource_api("false");
setGetall_List_note_evaluation_Ressource_message(res.data.message);
alert(res.data.message)
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_List_note_evaluation_Ressource = ', error);
setGetall_List_note_evaluation_Ressource_api("false");
alert("Impossible de récuperer la liste des ressources de la sequence")
//setmyApimyApiMessage("")
})
}
const [selectionModel_ressource, setselectionModel_ressource] = React.useState([]);
function submenu_add_one_Ressource() {
setevent_start_date("");
setevent_end_date("");
setGet_Ressource_Avabilities_avability_check("");
setDialog_seq_ressource_1_open(true);
}
const [Dialog_seq_ressource_1_message, setDialog_seq_ressource_1_message] = React.useState(false);
const [Dialog_seq_ressource_1_open, setDialog_seq_ressource_1_open] = React.useState(false);
function Dialog_1_handle_change_participant_session(message) {
setDialog_seq_ressource_1_message(message);
setDialog_seq_ressource_1_open(true);
}
const Dialog_seq_ressource_1_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_seq_ressource_1_handleClose_buton = () => {
setevent_start_date("");
setevent_end_date("");
setDialog_seq_ressource_1_open(false);
};
const New_Option_Type_Ressource = [
{ "id": "0", "label": "Employe", "value": "ressource_humaine" },
{ "id": "1", "label": "Materiel", "value": "ressource_materielle" },
]
const [Dialog_seq_ressource_1_selected_type_ressource, setDialog_seq_ressource_1_selected_type_ressource] = React.useState();
const [Dialog_seq_ressource_1_selected_ressource_id, setDialog_seq_ressource_1_selected_ressource_id] = React.useState();
const [Dialog_seq_ressource_1_selected_ressource_poste, setDialog_seq_ressource_1_selected_ressource_poste] = React.useState();
const datagridSx = {
borderRadius: 2,
marginRight: 1,
marginLeft: 1,
border: 0,
"& .MuiDataGrid-main": { borderRadius: 0 },
"& .MuiDataGrid-virtualScrollerRenderZone": {
"& .MuiDataGrid-row": {
"&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
}
},
"& .MuiDataGrid-columnHeaders": {
backgroundColor: "#c8cfd5",
color: "black",
fontSize: 16
}
};
const [Add_One_Sequence_Session_mass, setAdd_One_Sequence_Session_mass] = useState();
const [Add_One_Sequence_Session_Ressource_api, setAdd_One_Sequence_Session_Ressource_api] = useState();
const [Add_One_Sequence_Session_Ressource_message, setAdd_One_Sequence_Session_Ressource_message] = useState();
const [Add_One_Sequence_Session_Ressource_result, setAdd_One_Sequence_Session_Ressource_result] = useState();
const Add_One_Sequence_Session_Ressource = event => {
var new_ressource_type = Dialog_seq_ressource_1_selected_type_ressource;
var new_ressource_id = Dialog_seq_ressource_1_selected_ressource_id;
var new_ressource_poste = Dialog_seq_ressource_1_selected_ressource_poste;
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("note_evaluation_id", selected_id);
form.append("poste", new_ressource_poste);
form.append("related_target_collection", new_ressource_type);
form.append("related_target_collection_id", new_ressource_id);
if (String("new_ressource_type") === "ressource_humaine" && String(new_ressource_poste).trim() === "") {
alert(" Vous devez préciser le poste occupé pour cette ressrouce");
return;
}
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Note_Evaluation_Affectation_Ressource_Poste/";
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Add_One_Sequence_Session_Ressource res.data.status = " + res.data.status);
//console.log(" In Add_One_Sequence_Session_Ressource res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setAdd_One_Sequence_Session_Ressource_api("true");
setAdd_One_Sequence_Session_Ressource_result(res.data.message);
Getall_List_note_evaluation_Ressource(selected_id);
setDialog_seq_ressource_1_selected_type_ressource();
setDialog_seq_ressource_1_selected_ressource_id();
setDialog_seq_ressource_1_selected_ressource_poste();
alert(res.data.message);
Dialog_seq_ressource_1_handleClose_buton();
}
else {
setAdd_One_Sequence_Session_Ressource_api("false");
setAdd_One_Sequence_Session_Ressource_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('UpdateStagiaireData : Not good man :( Add_One_Sequence_Session_Ressource = ' + error);
setAdd_One_Sequence_Session_Ressource_api("false");
alert(" Impossible d'ajouter la ressource à la séquence");
})
}
const [Delete_Sequence_Session_Ressource_Data_api, setDelete_Sequence_Session_Ressource_Data_api] = useState();
const [Delete_Sequence_Session_Ressource_Data_message, setDelete_Sequence_Session_Ressource_Data_message] = useState();
const [Delete_Sequence_Session_Ressource_Data_result, setDelete_Sequence_Session_Ressource_Data_result] = useState();
function Delete_Sequence_Session_Ressource_Data(local_seq_ressource_id) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("_id", local_seq_ressource_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Note_Evaluation_Ressource_Poste/";
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Delete_Sequence_Session_Ressource_Data res.data.status = " + res.data.status);
//console.log(" In Delete_Sequence_Session_Ressource_Data res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setDelete_Sequence_Session_Ressource_Data_api("true");
setDelete_Sequence_Session_Ressource_Data_result(res.data.message);
Getall_List_note_evaluation_Ressource(selected_id);
alert(res.data.message)
}
else {
setDelete_Sequence_Session_Ressource_Data_api("false");
setDelete_Sequence_Session_Ressource_Data_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Delete_Sequence_Session_Ressource_Data : Not good man :( mysearchtext = ' + error);
setDelete_Sequence_Session_Ressource_Data_api("false");
alert(" Impossible de supprimer la ressource");
})
}
const [tab_selected_sequence_id, settab_selected_sequence_id] = useState([]);
function GetSelectedRows_Sequence_Ids() {
var tab_tmp = []
for (var i = 0; i < selectionModel_evalutions.length; i++) {
var myid = parseInt(String(selectionModel_evalutions[i]));
//var line = JSON.parse(rowss[myid]);
tab_tmp.push(myid);
}
return tab_tmp;
}
async function actionmass_sequence_Traitement() {
setAdd_One_Sequence_Session_mass("1");
var liste_formation = GetSelectedRows_Sequence_Ids();
var tab_seq_mongo_ids = [];
/* 22/05/24 : Retravailler ce code pour le module note_evaluation.
for (var i = 0; i < selectionModel_evalutions.length; i++) {
var line_id = selectionModel_evalutions[i];
var mongo_id = JSON.parse(Getall_Sequence_Of_Session_result[line_id])._id;
tab_seq_mongo_ids.push(mongo_id);
}
*/
settab_selected_sequence_id(tab_seq_mongo_ids);
if (String(actionmass_sequence_val) === "ajout_ressource") {
setDialog_seq_ressource_1_open(true);
}
else if (String(actionmass_sequence_val) === "supprimer") {
// Delete_Sequence_Session_Data_Mass(tab_seq_mongo_ids);
}
}
const [actionmass_sequence_val, setactionmass_sequence_val] = useState();
const [Add_One_Sequence_Session_Ressource_Mass_api, setAdd_One_Sequence_Session_Ressource_Mass_api] = useState();
const [Add_One_Sequence_Session_Ressource_Mass_message, setAdd_One_Sequence_Session_Ressource_Mass_message] = useState();
const [Add_One_Sequence_Session_Ressource_Mass_result, setAdd_One_Sequence_Session_Ressource_Mass_result] = useState();
const Add_One_Sequence_Session_Ressource_Mass = tab_ids => {
var new_ressource_type = Dialog_seq_ressource_1_selected_type_ressource;
var new_ressource_id = Dialog_seq_ressource_1_selected_ressource_id;
var new_ressource_poste = Dialog_seq_ressource_1_selected_ressource_poste;
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("tab_sequence_session_id", tab_selected_sequence_id);
form.append("poste", new_ressource_poste);
form.append("related_target_collection", new_ressource_type);
form.append("related_target_collection_id", new_ressource_id);
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Sequence_Affectation_Ressource_Poste_Mass/";
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Add_One_Sequence_Session_Ressource_Mass res.data.status = " + res.data.status);
//console.log(" In Add_One_Sequence_Session_Ressource_Mass res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setAdd_One_Sequence_Session_Ressource_Mass_api("true");
setAdd_One_Sequence_Session_Ressource_Mass_result(res.data.message);
Getall_List_note_evaluation_Ressource(selected_id);
setDialog_seq_ressource_1_selected_type_ressource();
setDialog_seq_ressource_1_selected_ressource_id();
setDialog_seq_ressource_1_selected_ressource_poste();
setAdd_One_Sequence_Session_mass();
//settab_selected_sequence_id([]);
alert(res.data.message);
Dialog_seq_ressource_1_handleClose_buton();
}
else {
setAdd_One_Sequence_Session_Ressource_Mass_api("false");
setAdd_One_Sequence_Session_Ressource_Mass_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('UpdateStagiaireData : Not good man :( Add_One_Sequence_Session_Ressource_Mass = ' + error);
setAdd_One_Sequence_Session_Ressource_Mass_api("false");
alert(" Impossible d'ajouter la ressource à la séquence");
})
}
// -- end gestion des ressources
const [New_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result, setNew_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result] = useState([]);
const [Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api, setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api] = useState();
const [Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_message, setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_message] = useState();
const [Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result, setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result] = useState([]);
function Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc(ref_interne_document) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("ref_interne", ref_interne_document);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Document_with_filter/";
setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc res.data.status = " + res.data.status);
//console.log(" In Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api("true");
setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_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_ref_interne = JSON.parse(x).ref_interne;
var local_nom = JSON.parse(x).nom;
var local_sujet = JSON.parse(x).sujet;
var local_type_doc = JSON.parse(x).type_doc;
var local_cible = JSON.parse(x).cible;
var local_joint_pdf = JSON.parse(x).joint_pdf;
var local_contenu_doc = JSON.parse(x).contenu_doc;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom + " - " + local_type_doc,
"ref_interne": local_ref_interne,
"nom": local_nom,
"sujet": local_sujet,
"type_doc": local_type_doc,
"cible": local_cible,
"joint_pdf": local_joint_pdf,
"contenu_doc": local_contenu_doc,
};
new_data2.push(node);
// console.log(" ## node = ", node)
});
if (new_data2.length > 0)
setNew_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result(new_data2);
}
else {
setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api("false");
setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc = ', error);
setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api("false");
alert("Impossible de récupérer les modèles de convocations");
//setmyApimyApiMessage("")
})
}
const New_Option_Type_Document = [
{ "id": "email", "label": "Email", "value": "email" },
{ "id": "pdf", "label": "PDF", "value": "pdf" },
]
const [Convocation_Eval_Type_doc, setConvocation_Eval_Type_doc] = React.useState("pdf");
const [Convocation_Eval_model_doc_id, setConvocation_Eval_model_doc_id] = React.useState("pdf");
const [Dialog_CONVOCATION_EVAL_open, setDialog_CONVOCATION_EVAL_open] = React.useState(false);
const Dialog_CONVOCATION_EVAL_handleClose_buton = () => {
setDialog_CONVOCATION_EVAL_open(false);
settab_convention_pieces_jointes_result([]);
};
function Download_Evaluation_Convocation_PDF() {
const stored_cookie = getCookie('tokenmysypart');
var nom_fichier = "Convocation_Evaluation.zip";
var liste_apprenant_id = GetSelectedRows_Apprenant_Evaluation_Ids();
var tab_mongo_preins_ids = [];
for (var i = 0; i < liste_apprenant_id.length; i++) {
var line = Getall_Evaluation_Participant_List_result[liste_apprenant_id[i]]
var line_json = JSON.parse(line);
tab_mongo_preins_ids.push(line_json['_id'])
}
var list_ids = tab_mongo_preins_ids.toString()
var url = process.env.REACT_APP_API_URL + "myclass/api/Send_Evaluation_Convocation_Participant_By_PDF/" + stored_cookie + "/" + selected_id + "/" + list_ids + "/" + Convocation_Eval_model_doc_id;
//console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id);
setLoading(true);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
setLoading(false);
//console.log(" In Download_Stagiaire_Conventions_PDF res.data = " + res.data);
if (String(res.data) === String("false")) {
alert("Impossible de télécharger le fichier (2) ");
} else {
fileDownload(res.data, nom_fichier);
setselectionModel_evalutions_participant([]);
settab_convention_pieces_jointes_result([]);
}
}).catch((error) => {
setLoading(false);
console.error('Error:', error);
alert(" Impossible de télécharger la convention ")
});
}
const [Send_Eval_Convocation_By_Email_api, setSend_Eval_Convocation_By_Email_api] = useState();
const [Send_Eval_Convocation_By_Email_message, setSend_Eval_Convocation_By_Email_message] = useState();
const [Send_Eval_Convocation_By_Email_result, setSend_Eval_Convocation_By_Email_result] = useState();
function Send_Eval_Convocation_By_Email(event) {
var liste_apprenant_id = GetSelectedRows_Apprenant_Evaluation_Ids();
var tab_mongo_preins_ids = [];
for (var i = 0; i < liste_apprenant_id.length; i++) {
var line = Getall_Evaluation_Participant_List_result[liste_apprenant_id[i]]
var line_json = JSON.parse(line);
tab_mongo_preins_ids.push(line_json['_id'])
}
var list_ids = tab_mongo_preins_ids.toString()
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("evaluation_id", selected_id);
form.append("tab_eval_inscription_id", list_ids);
form.append("courrier_template_id", Convocation_Eval_model_doc_id);
for (let i = 0; i < tab_convention_pieces_jointes_result.length; i++) {
form.append('File', tab_convention_pieces_jointes_result[i]);
}
//form.append("File", list_files);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Send_Evaluation_Convocation_Participant_By_Email/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Send_Eval_Convocation_By_Email res.data.status = " + res.data.status);
//console.log(" In Send_Eval_Convocation_By_Email res.data.message r_class = " + res.data.message);
setSend_Eval_Convocation_By_Email_api("true");
setSend_Eval_Convocation_By_Email_result(res.data.message);
setselectionModel_evalutions_participant([]);
settab_convention_pieces_jointes_result([]);
Dialog_CONVOCATION_EVAL_handleClose_buton();
alert(res.data.message);
}
else {
setSend_Eval_Convocation_By_Email_api("false");
setSend_Eval_Convocation_By_Email_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Send_Eval_Convocation_By_Email = ', error);
setSend_Eval_Convocation_By_Email_api("false");
alert("Impossible d'envoyer la convocation par email");
//setmyApimyApiMessage("")
})
}
function Delete_Convention_Attached_Doc(event) {
var doc_to_del_name = event.target.id;
const myArray = tab_convention_pieces_jointes_result;
let new_myArray = myArray.filter(file => file.name !== String(doc_to_del_name));
var new_tab = []
for (let i = 0; i < new_myArray.length; i++) {
new_tab.push(new_myArray[i]);
}
settab_convention_pieces_jointes_result(new_tab);
}
const [sessions_file_change_1_convention_api, setsessions_file_change_1_convention_api] = useState();
const [sessions_file_change_1_convention_result, setsessions_file_change_1_convention_result] = useState();
const [sessions_file_change_1_convention_message, setsessions_file_change_1_convention_message] = useState();
const sessions_file_change_1_convention = event => {
const fileUploaded = event.target.files[0];
let file_size = event.target.files[0].size;
let file_type = event.target.files[0].type;
if (file_type !== "application/pdf") {
alert("Le fichier n'est pas de type PDF");
return;
}
if (file_size > 10000000) {
alert("Le fichier ne doit pas depasser un 1 Méga octets");
console.log("Le fichier ne doit pas depasser un 1 Méga octets");
return;
}
//var new_node = {'name':event.target.files[0].name, 'type':event.target.files[0].type}
var new_tmp = [];
if (tab_convention_pieces_jointes_result && tab_convention_pieces_jointes_result.length > 0) {
tab_convention_pieces_jointes_result.map((x) => {
new_tmp.push(x);
});
}
new_tmp.push(event.target.files[0])
settab_convention_pieces_jointes_result(new_tmp);
//console.log(" tab_convention_pieces_jointes_result = ", tab_convention_pieces_jointes_result)
return;
};
const [tab_convention_pieces_jointes_result, settab_convention_pieces_jointes_result] = useState([]);
return (
{isLoading &&
}
{/* Dialog pour gerer les CONVOCATION_EVAL */}
{/* FIN Dialog pour gerer les CONVOCATION_EVAL */}
{/*** Dialog Ajout Ressources */}
{/*** Fin ajout ressource */}
{' '}
{String(actionmass_eval_inscr_val) === "delete_inscr" &&
Confirmer la supprression des inscriptions en masse pour {selectionModel_evalutions_participant.length} lignes.
}
{String(actionmass_eval_inscr_val) === "send_convocation" &&
Confirmer la l'envoi des convocations en masse pour {selectionModel_evalutions_participant.length} lignes.
}
)}
}
}
{String(noted_changed) === "1" &&
/!\ Pensez à enregistrer les modifications
}
Mettre à jour les notes
}
modal
nested
position="center center"
>
{close => (
MySy Information
{' '}
En confirmant cette opération, les notes seront mises à jour.