From 10050539a79a19eb45f25dbf305b5260d2f1fb72 Mon Sep 17 00:00:00 2001 From: cherif Date: Sat, 8 Jun 2024 19:32:25 +0200 Subject: [PATCH] ssd --- src/components/Apprenant.js | 1312 +++++++++++++++++++- src/components/DisplayPartnerStagiaires.js | 58 +- src/components/Notes_Evaluation.js | 3 +- 3 files changed, 1315 insertions(+), 58 deletions(-) diff --git a/src/components/Apprenant.js b/src/components/Apprenant.js index 13ecef4..d43e5bc 100644 --- a/src/components/Apprenant.js +++ b/src/components/Apprenant.js @@ -20,7 +20,7 @@ import { FcInfo } from "react-icons/fc"; import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; -import { FcAcceptDatabase, } from "react-icons/fc"; +import { FcAcceptDatabase, } from "react-icons/fc"; import { format } from 'date-fns' import InputAdornment from '@mui/material/InputAdornment'; import { AiFillCloseCircle, AiOutlineConsoleSql } from "react-icons/ai"; @@ -36,7 +36,7 @@ import DialogTitle from '@mui/material/DialogTitle'; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; import { Fab } from "@material-ui/core"; import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io"; -import { AiTwotoneSave } from "react-icons/ai"; +import { AiTwotoneSave } from "react-icons/ai"; import { FcEditImage } from "react-icons/fc"; import ToggleSwitch from "./ToggleSwitch"; @@ -50,6 +50,9 @@ import "react-datepicker/dist/react-datepicker.css"; import moment from "moment"; import 'moment/locale/fr'; import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; +import { gridClasses } from '@mui/x-data-grid'; +import Link from '@mui/material/Link'; +import { PiDotsThree } from "react-icons/pi"; const Apprenant = (props) => { @@ -68,13 +71,58 @@ const Apprenant = (props) => { const [selectedfilt2, setselectedfilt2] = useState(""); const [selectedfilt3, setselectedfilt3] = useState(""); + + function ExpandableCell_50({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + + + + function Display_Colunm_text({ value }) { + + return ( +
+ {value}  + +
+ ); + } + + + + const columns = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, - { field: 'civilite', headerName: 'Civ.', hide: false, flex: 1, minWidth: 50, maxWidth: 70 }, - { field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 250 }, - { field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 250 }, - { field: 'email', headerName: 'Email', hide: false, flex: 1, minWidth: 250 }, + { field: 'civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, renderCell: (params) => , }, + { field: 'nom', headerName: 'Nom', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'prenom', headerName: 'Prénom', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'email', headerName: 'Email', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, { field: 'telephone', headerName: 'Téléphone', hide: true, editable: false, Width: 0 }, { field: 'date_naissance', headerName: 'date_naissance', hide: true, editable: false, Width: 0 }, { field: 'adresse', headerName: 'adresse', hide: true, editable: false, Width: 0 }, @@ -172,8 +220,8 @@ const Apprenant = (props) => { { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, { field: 'session_id', headerName: 'session_id', hide: true, Width: 1 }, - { field: 'session_code', headerName: 'Code Session', hide: false, flex: 1, minWidth: 100, }, - { field: 'class_title', headerName: 'Titre Formation', hide: false, flex: 1, minWidth: 150, }, + { field: 'session_code', headerName: 'Code Session', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'class_title', headerName: 'Titre Formation', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, Width: 1 }, { field: 'status', headerName: 'Statut', hide: false, flex: 1, minWidth: 50, maxWidth: 70, @@ -192,10 +240,10 @@ const Apprenant = (props) => { }, { field: 'client_rattachement_id', headerName: 'client__id', hide: true, Width: 1 }, - { field: 'client_rattachement_nom', headerName: 'Client', hide: false, flex: 1, minWidth: 150, maxWidth: 200 }, + { field: 'client_rattachement_nom', headerName: 'Client', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, - { field: 'date_debut', headerName: 'Début', hide: false, flex: 1, minWidth: 150, maxWidth: 200 }, - { field: 'date_fin', headerName: 'Fin', hide: false, flex: 1, minWidth: 150, maxWidth: 200 }, + { field: 'date_debut', headerName: 'Début', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'date_fin', headerName: 'Fin', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, { field: 'presentiel', headerName: 'Présentiel', hide: false, flex: 1, minWidth: 50, maxWidth: 70 }, { field: 'distanciel', headerName: 'Distantiel', hide: false, flex: 1, minWidth: 50, maxWidth: 70 }, @@ -291,6 +339,125 @@ const Apprenant = (props) => { ] + const columns_suivi_pedagogique = [ + { field: 'id', headerName: 'id', hide: true }, + { field: '_id', headerName: '_id', hide: true }, + { field: 'apprenant_id', headerName: 'apprenant_id', hide: true, Width: 1 }, + { field: 'class_id', headerName: 'class_id', hide: true, Width: 1 }, + { field: 'session_id', headerName: 'session_id', hide: true, Width: 1 }, + { field: 'class_eu_id', headerName: 'class_eu_id', hide: true, Width: 1 }, + { field: 'responsable_id', headerName: 'responsable_id', hide: true, Width: 1 }, + + { field: 'date_debut', headerName: 'Début', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'date_fin', headerName: 'Fin', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + + { + field: 'responsable', headerName: 'responsable', hide: false, minWidth: 200, flex: 1, + + + renderCell: (cellValues) => { + return ( +
+ {New_Getall_Training_Employee_No_Filter_result && New_Getall_Training_Employee_No_Filter_result.length > 0 && } +
+ + ); + } + + + }, + + { field: 'class_title', headerName: 'Titre Formation', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'session_code', headerName: 'Code Session', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'ue_code', headerName: 'UE Code', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'ue_titre', headerName: 'UE Titre', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + + + + { + field: "Detail", headerName: 'Voir detail', + renderCell: (cellValues) => { + return ( + + + + ); + } + }, + + { + field: "delete", headerName: 'Supprimer', + renderCell: (cellValues) => { + return ( + + + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, le suivi pédagogique sera définitivement supprimé.
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+ + + ); + } + }, + + + ] + + function handleClick_delete_Apprenant(event, cellValues) { setgridline_id(''); @@ -634,7 +801,7 @@ const Apprenant = (props) => { } else { if (document.getElementById(String(field_name))) - document.getElementById(String(field_name)).value = ""; + document.getElementById(String(field_name)).value = ""; } } @@ -1893,6 +2060,17 @@ const Apprenant = (props) => { 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); @@ -2171,6 +2349,155 @@ const Apprenant = (props) => { }) } + + const [Get_Appenant_List_Suivi_Pedagogique_api, setGet_Appenant_List_Suivi_Pedagogique_api] = useState(); + const [Get_Appenant_List_Suivi_Pedagogique_message, setGet_Appenant_List_Suivi_Pedagogique_message] = useState(); + const [Get_Appenant_List_Suivi_Pedagogique_result, setGet_Appenant_List_Suivi_Pedagogique_result] = useState([]); + function Get_Appenant_List_Suivi_Pedagogique(local_selecte_apprenant_id) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + form.append("token", stored_cookie); + form.append("apprenant_id", local_selecte_apprenant_id); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Suivi_Pedagogique_No_Filter/"; + + axios.post(myurl, form).then(res => { + //console.log(" In Get_Appenant_List_Suivi_Pedagogique res.data.status = " + res.data.status); + //console.log(" In Get_Appenant_List_Suivi_Pedagogique res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + setGet_Appenant_List_Suivi_Pedagogique_api("true"); + setGet_Appenant_List_Suivi_Pedagogique_result(res.data.message); + } + else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setGet_Appenant_List_Suivi_Pedagogique_api("false"); + setGet_Appenant_List_Suivi_Pedagogique_message(res.data.message); + alert('Erreur: ' + res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( Get_Appenant_List_Suivi_Pedagogique = ', error); + setGet_Appenant_List_Suivi_Pedagogique_api("false"); + alert('Erreur: Impossible de recuperer le suivi pédagogique'); + }) + } + + + const [p_detail_suivi_ped_comment, setp_detail_suivi_ped_comment] = React.useState(""); + const [p_detail_suivi_ped_observation, setp_detail_suivi_ped_observation] = React.useState(""); + const [p_detail_suivi_ped_responsable_id, setp_detail_suivi_ped_responsable_id] = React.useState(""); + const [p_detail_suivi_ped_class_id, setp_detail_suivi_ped_class_id] = React.useState(""); + const [p_detail_suivi_ped_class_internal_url, setp_detail_suivi_ped_class_internal_url] = React.useState(""); + const [p_detail_suivi_ped_class_eu_id, setp_detail_suivi_ped_class_eu_id] = React.useState(""); + const [p_detail_suivi_ped_session_id, setp_detail_suivi_ped_session_id] = React.useState(""); + const [p_detail_suivi_ped_eval_date_heure_debut, setp_detail_suivi_ped_eval_date_heure_debut] = useState(new Date()); + const [p_detail_suivi_ped_eval_date_heure_fin, setp_detail_suivi_ped_eval_date_heure_fin] = useState(new Date()); + const [selected_suivi_pedagogique_id, setselected_suivi_pedagogique_id] = useState(""); + + + function Clear_Suivi_Pedago_Field() { + setp_detail_suivi_ped_comment(""); + setp_detail_suivi_ped_observation(""); + setp_detail_suivi_ped_responsable_id(""); + setp_detail_suivi_ped_class_id(""); + setp_detail_suivi_ped_class_eu_id(""); + setp_detail_suivi_ped_session_id(""); + + setp_detail_suivi_ped_eval_date_heure_debut(new Date()); + setp_detail_suivi_ped_eval_date_heure_fin(new Date()); + setselected_suivi_pedagogique_id(""); + } + + + const [Add_Update_Suiv_Pedagogique_api, setAdd_Update_Suiv_Pedagogique_api] = useState(); + const [Add_Update_Suiv_Pedagogique_message, setAdd_Update_Suiv_Pedagogique_message] = useState(); + const [Add_Update_Suiv_Pedagogique_result, setAdd_Update_Suiv_Pedagogique_result] = useState(); + function Add_Update_Suiv_Pedagogique() { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + + + form.append("apprenant_id", selected_apprenant_id); + form.append("responsable_id", p_detail_suivi_ped_responsable_id); + form.append("class_id", p_detail_suivi_ped_class_id); + form.append("class_eu_id", p_detail_suivi_ped_class_eu_id); + form.append("session_id", p_detail_suivi_ped_session_id); + form.append("date_heure_debut", p_detail_suivi_ped_eval_date_heure_debut); + form.append("date_heure_fin", p_detail_suivi_ped_eval_date_heure_fin); + form.append("observation", p_detail_suivi_ped_observation); + form.append("commentaire", p_detail_suivi_ped_comment); + + + + var myurl = ""; + + if (selected_suivi_pedagogique_id && String(selected_suivi_pedagogique_id).length > 5) { + form.append("_id", selected_suivi_pedagogique_id); + myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Suivi_Pedagogique/"; + } else { + myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Suivi_Pedagogique/"; + } + + + + setLoading(true); + axios.post(myurl, form).then(res => { + //console.log(" In Add_Update_Suiv_Pedagogique res.data.status = " + res.data.status); + //console.log(" In Add_Update_Suiv_Pedagogique res.data.message r_class = " + res.data.message); + + setLoading(false); + + if (String(res.data.status) === String("true")) { + setAdd_Update_Suiv_Pedagogique_api("true"); + setAdd_Update_Suiv_Pedagogique_result(res.data.message); + Clear_Suivi_Pedago_Field(); + Dialog_Suivi_Pedago_handleClose_buton(); + + Get_Appenant_List_Suivi_Pedagogique(selected_apprenant_id); + + 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_Suiv_Pedagogique_api("false"); + setAdd_Update_Suiv_Pedagogique_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + + console.log('UpdateStagiaireData : Not good man :( Add_Update_Suiv_Pedagogique = ' + error); + setAdd_Update_Suiv_Pedagogique_api("false"); + alert(" Impossible d'ajouter ou mettre à jour le suivi pédagogique"); + + }) + } + + + + + const myRef_details = useRef(null) @@ -2244,8 +2571,353 @@ const Apprenant = (props) => { }) } + 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); + + + 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); + + + 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("") + }) + } + + + useEffect(() => { + Getall_Partner_Class_Reduice_Fields(); + Getall_Partner_Session_Reduice_Fields(); + Getall_Partner_List_UE(); + + Get_Partner_Object_Specific_Fields_apprenant(); Getall_Training_Employee_No_Filter(); Getall_Training_Materiel_No_Filter(); @@ -2302,6 +2974,7 @@ const Apprenant = (props) => { const [selectionModel, setSelectionModel] = React.useState([]); const [selectionModel_apprenant_inscription, setselectionModel_apprenant_inscription] = React.useState([]); + const [selectionModel_suivi_pedagogique, setselectionModel_suivi_pedagogique] = React.useState([]); const [p_filtre1, setp_filtre1] = useState(); const [p_filtre1_value, setp_filtre1_value] = useState(); @@ -2455,6 +3128,7 @@ const Apprenant = (props) => { const [display_detail_absence, setdisplay_detail_absence] = useState(""); const [display_detail_historique, setdisplay_detail_historique] = useState(""); const [display_detail_piece_joint, setdisplay_detail_piece_joint] = useState(""); + const [display_menu_suivi_pedagogique, setdisplay_menu_suivi_pedagogique] = useState(""); async function submenu_add_one_inscription() { @@ -2490,19 +3164,52 @@ const Apprenant = (props) => { } } + function submenu_color_management(current_menu) { + const list_sous_menu = ['detail_apprenant', 'inscriptions', 'absences', 'suivi_pedagogique', 'historique', 'piece_jointe', 'piece_jointe'] + for (let i = 0; i < list_sous_menu.length; i++) { + + var sous_menu = list_sous_menu[i]; + if (String(sous_menu) !== current_menu) { + if (document.getElementById(sous_menu)) { + document.getElementById(sous_menu).style.backgroundColor = "#d8edfc"; + document.getElementById(sous_menu).style.color = "black"; + document.getElementById(sous_menu).style.fontWeight = "normal"; + } + } + + if (String(sous_menu) === "editique") { + if (document.getElementById(sous_menu)) { + document.getElementById(sous_menu).style.backgroundColor = "#6C3483"; + document.getElementById(sous_menu).style.color = "#FFFFFF"; + document.getElementById(sous_menu).style.fontWeight = "bold"; + } + } + + } + + if (document.getElementById(current_menu)) { + document.getElementById(current_menu).style.backgroundColor = "#104277"; + document.getElementById(current_menu).style.color = "white"; + document.getElementById(current_menu).style.fontWeight = "bold"; + } + + } async function submenu_detail_apprenant() { setsubmenu("detail_apprenant"); //await sleep(5); + submenu_color_management("detail_apprenant"); + setdisplay_detail_apprenant("1"); setadd_One_Apprenant(""); setdisplay_detail_inscriptions(""); setdisplay_detail_absence(""); setdisplay_detail_historique(""); setdisplay_detail_piece_joint(""); + setdisplay_menu_suivi_pedagogique("") } @@ -2510,6 +3217,8 @@ const Apprenant = (props) => { async function submenu_inscriptions() { setsubmenu("inscriptions"); + submenu_color_management("inscriptions"); + //await sleep(5); setdisplay_detail_inscriptions("1"); @@ -2518,11 +3227,13 @@ const Apprenant = (props) => { setdisplay_detail_absence(""); setdisplay_detail_historique(""); setdisplay_detail_piece_joint(""); + setdisplay_menu_suivi_pedagogique("") } async function submenu_absence() { setsubmenu("absences"); + submenu_color_management("absences"); //await sleep(5); setdisplay_detail_absence("1"); @@ -2531,12 +3242,30 @@ const Apprenant = (props) => { setdisplay_detail_inscriptions(""); setdisplay_detail_historique(""); setdisplay_detail_piece_joint(""); + setdisplay_menu_suivi_pedagogique("") + } + + async function submenu_suivi_pedagogique() { + setsubmenu("suivi_pedagogique"); + + submenu_color_management("suivi_pedagogique"); + + //await sleep(5); + setdisplay_menu_suivi_pedagogique('1') + setdisplay_detail_absence(""); + setadd_One_Apprenant(""); + setdisplay_detail_apprenant(""); + setdisplay_detail_inscriptions(""); + setdisplay_detail_historique(""); + setdisplay_detail_piece_joint(""); + + Get_Appenant_List_Suivi_Pedagogique(selected_apprenant_id); } async function submenu_historique() { setsubmenu("historique"); - + submenu_color_management("historique"); //await sleep(5); setdisplay_detail_historique("1"); @@ -2551,7 +3280,9 @@ const Apprenant = (props) => { async function submenu_piece_jointe() { setsubmenu("piece_jointe"); + submenu_color_management("piece_jointe"); //await sleep(5); + setdisplay_detail_piece_joint("1") setdisplay_detail_historique(""); setadd_One_Apprenant(""); @@ -2576,7 +3307,7 @@ const Apprenant = (props) => { Get_Appenant_List_Inscription(selected_apprenant_id); - Get_Appenant_List_Inscription(selected_apprenant_id); + Get_Appenant_List_Suivi_Pedagogique(selected_apprenant_id); } @@ -3000,7 +3731,7 @@ const Apprenant = (props) => { setDelete_Apprenant_Data_result(res.data.message); setSelectionModel([]); - + setadd_One_Apprenant(''); setdisplay_detail_apprenant(''); Clear_Detail_Apprenant_Fields(); @@ -3698,6 +4429,46 @@ const Apprenant = (props) => { ] + + + + const [Dialog_Suivi_Pedago_message, setDialog_Suivi_Pedago_message] = React.useState(false); + const [Dialog_Suivi_Pedago_open, setDialog_Suivi_Pedago_open] = React.useState(false); + function Dialog_Suivi_Pedago_handle_change_participant_session(message) { + setDialog_Suivi_Pedago_message(message); + setDialog_Suivi_Pedago_open(true); + } + + const Dialog_Suivi_Pedago_handleClose = () => { + + }; + + const Dialog_Suivi_Pedago_handleClose_buton = () => { + setDialog_Suivi_Pedago_open(false); + }; + + + + const [display_given_suivi_ped, setdisplay_given_suivi_ped] = useState(""); + const [given_suivi_ped_changed, setgiven_suivi_ped_changed] = useState(""); + const [add_one_suivi_ped, setadd_one_suivi_ped] = useState(""); + + function add_suivi_ped_funct() { + Clear_Suivi_Pedago_Field(); + + setdisplay_given_suivi_ped(""); + setgiven_suivi_ped_changed(""); + setadd_one_suivi_ped("1"); + + } + + function Annule_Add_One_Suiv_Pedagogique() { + Clear_Suivi_Pedago_Field(); + setdisplay_given_suivi_ped(""); + setgiven_suivi_ped_changed(""); + setadd_one_suivi_ped(""); + } + return (
@@ -3705,6 +4476,73 @@ const Apprenant = (props) => {
} + {/***** Dialog Suivi Pedagogique */} + + + MySy Information + + + {Dialog_Suivi_Pedago_message} + + +
Civilité
+ (data).value === String(p_detail_tuteur1_civilite))[0].label} + + fullWidth + + options={New_civilite} + onChange={(event, value) => { + if (value && value.value) { + setp_detail_tuteur1_civilite(value.value); + } else { + setp_detail_tuteur1_civilite(""); + } + }} + renderInput={(params) => + } + /> +
Nom + { + setp_detail_tuteur1_nom(e.target.value); + } + } + + /> + +
+ + +
+ +
+ + + + + +
+ + {/***** FIN Dialog Suivi Pedagogique */} + + { + + {/****** Dialog synthèse apprenant */} { + {/****** FIN Dialog synthèse apprenant */} { } + Clear_Suivi_Pedago_Field(); + setdisplay_given_suivi_ped(""); setDialog_apprenant_message(String(JSON.parse(Get_All_Apprenant_result[newSelectionModel.row.id]).title)); setDialog_apprenant_open(true); @@ -4795,7 +5638,7 @@ const Apprenant = (props) => { /> } /> - + {actionmass_ftion_val &&