diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index c09ffab..f77a38e 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -771,7 +771,7 @@ const AddClassManual = (props) => { setLoading(false); if (String(res.data.status) === String("true")) { //console.log(" In Getall_Class_List_UE res.data.status = " + res.data.status); - // console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message); + // console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message); setGetall_Class_List_UE_api("true"); setGetall_Class_List_UE_result(res.data.message); @@ -802,7 +802,6 @@ const AddClassManual = (props) => { var local_diplome_code = JSON.parse(x).diplome_code; - //--- var node = { "_id": local_id, @@ -4704,7 +4703,10 @@ const AddClassManual = (props) => { const [selected_ue_coefficient, setselected_ue_coefficient] = useState("1"); const [selected_ue_seuil_validation, setselected_ue_seuil_validation] = useState(""); + const [selected_ue_semestre, setselected_ue_semestre] = useState("1"); + const [selected_ue_diplome_id, setselected_ue_diplome_id] = useState(""); + const [selected_ue_domaine_competence_id, setselected_ue_domaine_competence_id] = useState(""); const [selected_class_note_calculation_id, setselected_class_note_calculation_id] = useState(""); @@ -4737,6 +4739,7 @@ const AddClassManual = (props) => { setselected_ue_coefficient("1"); setselected_ue_seuil_validation(""); setselected_ue_diplome_id("") + setselected_ue_semestre(""); }; @@ -4745,6 +4748,7 @@ const AddClassManual = (props) => { setselected_ue_id(""); setselected_ue_credit_ects(""); setselected_ue_seuil_validation(""); + setselected_ue_semestre(""); setselected_ue_is_noted("1"); setselected_ue_pres_dist_hyp("0"); setadd_one_eu_to_class(""); @@ -4758,6 +4762,7 @@ const AddClassManual = (props) => { setselected_ue_id(""); setselected_ue_credit_ects(""); setselected_ue_seuil_validation(""); + setselected_ue_semestre(""); setselected_ue_is_noted("1"); setselected_ue_pres_dist_hyp("0"); setadd_one_eu_to_class(""); @@ -4851,6 +4856,7 @@ const AddClassManual = (props) => { form.append("ponderation_type_eval", p_detail_ponderation_type_eval); form.append("type_notation", p_detail_type_notation); form.append("diplome_id", selected_ue_diplome_id); + form.append("domaine_competence_id", selected_ue_domaine_competence_id); var myurl = ""; @@ -4883,6 +4889,7 @@ const AddClassManual = (props) => { setselected_ue_diplome_id(""); setselected_eu_evalution_id(""); setsetgridline_evaluation_ue_id(""); + setselected_ue_domaine_competence_id(""); setp_detail_max_note("20"); setp_detail_type_notation("num"); setp_detail_ponderation_type_eval("1"); @@ -6884,6 +6891,7 @@ const AddClassManual = (props) => { setselected_ue_diplome_id(""); setselected_ue_credit_ects(""); setselected_ue_seuil_validation(""); + setselected_ue_semestre(""); setselected_ue_is_noted("1"); setselected_ue_pres_dist_hyp("0"); setadd_one_eu_to_class(""); @@ -6985,7 +6993,7 @@ const AddClassManual = (props) => {
+
Est Evalué
@@ -7822,8 +7831,9 @@ const AddClassManual = (props) => { setselected_ue_id(value._id); setselected_ue_diplome_id(value.diplome_id); - console.log('#### value.diplome_id == ', value.diplome_id); - console.log('#### EU._id == ', value._id); + setselected_ue_domaine_competence_id(value.domaine_competence_id); + //console.log('#### value.diplome_id == ', value.diplome_id); + //console.log('#### EU._id == ', value._id); } else { setselected_ue_id(""); diff --git a/src/components/DisplayPartnerPromotion.js b/src/components/DisplayPartnerPromotion.js index 4d3b690..d8dc8bb 100644 --- a/src/components/DisplayPartnerPromotion.js +++ b/src/components/DisplayPartnerPromotion.js @@ -2157,10 +2157,14 @@ const DisplayPartnerPromotion = (props) => { { field: '_id', headerName: '_id', hide: true }, { field: 'formateur_id', headerName: 'formateur_id', hide: true }, { field: 'diplome_id', headerName: 'diplome_id', hide: true, }, + { field: 'domaine_competence_id', headerName: 'domaine_competence_id', hide: true, }, + { field: 'diplome_code', headerName: 'Diplome', minWidth: 150, flex: 1, renderCell: (params) => , }, + { field: 'domaine_competence_code', headerName: 'Domaine Compte.', minWidth: 150, flex: 1, renderCell: (params) => , }, { field: 'code', headerName: 'Code', minWidth: 150, flex: 1, renderCell: (params) => , }, { field: 'titre', headerName: 'Titre', minWidth: 150, flex: 1, renderCell: (params) => , }, { field: 'formateur_prenom_nom', headerName: 'Formateur', minWidth: 150, flex: 1, renderCell: (params) => , }, + { field: 'semestre', headerName: 'semestre', Width: 100, renderCell: (params) => , }, { field: 'couleur', headerName: 'Couleur', Width: 100, maxWidth: 250, hide: false, editable: false, renderCell: (cellValues) => { @@ -15613,6 +15617,10 @@ const DisplayPartnerPromotion = (props) => { var local_diplome_code = JSON.parse(x).diplome_code; var local_couleur = JSON.parse(x).couleur; + var local_domaine_competence_id = JSON.parse(x).domaine_competence_id; + var local_domaine_competence_code = JSON.parse(x).domaine_competence_code; + + var local_semestre = JSON.parse(x).semestre; //--- var node = { @@ -15627,6 +15635,10 @@ const DisplayPartnerPromotion = (props) => { "diplome_code": local_diplome_code, "couleur": local_couleur, + "domaine_competence_id": local_domaine_competence_id, + "domaine_competence_code": local_domaine_competence_code, + "semestre": local_semestre, + }; new_data2.push(node); }); @@ -15643,6 +15655,9 @@ const DisplayPartnerPromotion = (props) => { "diplome_id": "", "diplome_code": "", "couleur": "", + "domaine_competence_id": "", + "domaine_competence_code": "", + "semestre": "", }; new_data2.push(node); @@ -15698,7 +15713,7 @@ const DisplayPartnerPromotion = (props) => { setLoading(false); if (String(res.data.status) === String("true")) { //console.log(" In Getall_Class_List_UE res.data.status = " + res.data.status); - // console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message); + console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message); setGetall_Class_List_UE_api("true"); setGetall_Class_List_UE_result(res.data.message); @@ -15763,8 +15778,9 @@ const DisplayPartnerPromotion = (props) => { }; new_data2.push(node); - if (new_data2.length > 0) - setNew_Getall_Class_List_UE_result(new_data2); + + setNew_Getall_Class_List_UE_result(new_data2); + console.log(" ### new_data2 = ", new_data2) } else { setGetall_Class_List_UE_api("false"); @@ -30085,6 +30101,12 @@ const DisplayPartnerPromotion = (props) => { diplome_id: JSON.parse(item).diplome_id, diplome_code: JSON.parse(item).diplome_code, couleur: JSON.parse(item).couleur, + + domaine_competence_id: JSON.parse(item).domaine_competence_id, + domaine_competence_code: JSON.parse(item).domaine_competence_code, + + semestre: JSON.parse(item).semestre, + } ))} diff --git a/src/components/Module_Ent_Mes_Formations.js b/src/components/Module_Ent_Mes_Formations.js index 819871e..dc11dfc 100644 --- a/src/components/Module_Ent_Mes_Formations.js +++ b/src/components/Module_Ent_Mes_Formations.js @@ -1890,7 +1890,7 @@ const Module_Ent_Mes_Formations = (props) => { //formData.append("class_internal_url", internal_url); //console.log("token = " + stored_cookie); - console.log( "### formData = ", formData) + console.log("### formData = ", formData) setLoading(true); fetch( @@ -2280,13 +2280,13 @@ const Module_Ent_Mes_Formations = (props) => { setdeclare_absence("1"); - }} className="bton_enreg_dialog" >Déclater une absence + }} className="bton_enreg_dialog" >Déclater une absence
} {declare_absence === "1" && <>
- +
@@ -2495,7 +2495,7 @@ const Module_Ent_Mes_Formations = (props) => {
+ }} className="bton_enreg_dialog" > Envoyer l'absence
} @@ -2914,7 +2914,7 @@ const Module_Ent_Mes_Formations = (props) => { height={550} locales={allLocales} locale={'fr'} - + initialDate={new Date()} selectable //events={events} events={Getall_Sequence_Of_Session_result_planning_view} @@ -3253,7 +3253,7 @@ const Module_Ent_Mes_Formations = (props) => { - + } diff --git a/src/components/Module_Ent_Mon_Planning.js b/src/components/Module_Ent_Mon_Planning.js index dde0a75..efdec1f 100644 --- a/src/components/Module_Ent_Mon_Planning.js +++ b/src/components/Module_Ent_Mon_Planning.js @@ -552,7 +552,7 @@ const Module_Ent_Mon_Planning = (props) => { local_session_color = "#4ea860"; } - + else if (JSON.parse(x).sequence_code_couleur_setup && JSON.parse(x).sequence_code_couleur_setup === "grp_apprenant") { // On affiche les couleurs par couleur de bloc de compétence aux quel est rattaché l'UE local_session_color = JSON.parse(x).grp_apprenant_color @@ -565,7 +565,7 @@ const Module_Ent_Mon_Planning = (props) => { local_session_color = couleur_seq; } - if (JSON.parse(x).sequence_code_couleur_setup && JSON.parse(x).sequence_code_couleur_setup === "ue") { + if (JSON.parse(x).sequence_code_couleur_setup && JSON.parse(x).sequence_code_couleur_setup === "ue") { // On affiche les couleurs par couleur de bloc de compétence aux quel est rattaché l'UE local_session_color = JSON.parse(x).domaine_competence_color } @@ -577,7 +577,7 @@ const Module_Ent_Mon_Planning = (props) => { var local_session_ue_code = JSON.parse(x).ue_code; var local_session_grp_apprenant_id = JSON.parse(x).grp_apprenant_id; - var local_session_ue_planif_line_id = JSON.parse(x).unite_enseignement_planif_id; + var local_session_ue_planif_line_id = JSON.parse(x).unite_enseignement_planif_id; var local_session_grp_code = JSON.parse(x).grp_apprenant_code; var local_mode_animation = JSON.parse(x).mode_animation; @@ -588,7 +588,7 @@ const Module_Ent_Mon_Planning = (props) => { local_tab_grp_apprenant_ids = JSON.parse(x).tab_grp_apprenant_ids } - var local_tab_ressource_humaine = "" + var local_tab_ressource_humaine = "" if (JSON.parse(x).tab_ressource_humaine) { local_tab_ressource_humaine = JSON.parse(x).tab_ressource_humaine; @@ -629,7 +629,7 @@ const Module_Ent_Mon_Planning = (props) => { "tab_grp_apprenant_ids": local_tab_grp_apprenant_ids, "liste_groupe_code": local_liste_groupe_code, - "local_tab_ressource_humaine": local_tab_ressource_humaine.toString(), + "local_tab_ressource_humaine": local_tab_ressource_humaine.toString(), "local_tab_ressource_materiel": local_tab_ressource_materiel.toString(), }; @@ -640,7 +640,7 @@ const Module_Ent_Mon_Planning = (props) => { if (new_data2.length > 0) { setGetall_Sequence_Of_Session_result_planning_view(new_data2); - console.log(" ### ENT - new_data2 = ", new_data2); + //console.log(" ### ENT - new_data2 = ", new_data2); } @@ -1107,7 +1107,8 @@ const Module_Ent_Mon_Planning = (props) => { displayEventEnd={true} eventContent={renderEventContent} eventClick={handleEventClick} - hiddenDays={[0]} + hiddenDays={[0]} + initialDate={new Date()} /> diff --git a/src/components/Module_Session_Notes_Classement.js b/src/components/Module_Session_Notes_Classement.js index 90880cd..bc9fdbf 100644 --- a/src/components/Module_Session_Notes_Classement.js +++ b/src/components/Module_Session_Notes_Classement.js @@ -339,9 +339,15 @@ const Module_Session_Notes_Classement = (props) => { { field: '_id', headerName: '_id', hide: true }, { field: 'inscription_id', headerName: 'inscription_id', hide: true }, { field: 'session_id', headerName: 'session_id', hide: true }, + { field: 'diplome_id', headerName: 'diplome_id', hide: true }, + { field: 'domaine_competence_id', headerName: 'domaine_competence_id', hide: true }, + { field: 'ue_id', headerName: 'ue_id', hide: true }, { field: 'class_id', headerName: 'class_id', hide: true }, { field: 'class_id_external_code', headerName: 'Code Formation', hide: true }, + { field: 'diplome_code', headerName: 'Diplome', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'domaine_competence_code', headerName: 'Dom. Compt.', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'ue_id_code', headerName: 'UE/Matière', minwidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { field: 'inscription_id_nom', headerName: 'Nom', minwidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { field: 'inscription_id_prenom', headerName: 'Prenom', minwidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, @@ -548,7 +554,7 @@ const Module_Session_Notes_Classement = (props) => { if (String(res.data.status) === String("true")) { // console.log(" In Getall_Session_Detail_Final_Note_Classement res.data.status = " + res.data.status); - // console.log(" In Getall_Session_Detail_Final_Note_Classement res.data.message r_class = " + res.data.message); + console.log(" In Getall_Session_Detail_Final_Note_Classement res.data.message r_class = " + res.data.message); setGetall_Session_Detail_Final_Note_Classement_api("true"); setGetall_Session_Detail_Final_Note_Classement_result(res.data.message); @@ -574,6 +580,12 @@ const Module_Session_Notes_Classement = (props) => { var inscription_id_nom = JSON.parse(x).inscription_id_nom; var inscription_id_prenom = JSON.parse(x).inscription_id_prenom; + var local_diplome_id = JSON.parse(x).diplome_id; + var local_diplome_code = JSON.parse(x).diplome_code; + + var local_domaine_competence_id = JSON.parse(x).domaine_competence_id; + var local_domaine_competence_code = JSON.parse(x).domaine_competence_code; + //--- @@ -596,6 +608,12 @@ const Module_Session_Notes_Classement = (props) => { "inscription_id_nom": inscription_id_nom, "inscription_id_prenom": inscription_id_prenom, + "diplome_id": local_diplome_id, + "diplome_code": local_diplome_code, + + "domaine_competence_id": local_domaine_competence_id, + "domaine_competence_code": local_domaine_competence_code, + }; new_data2.push(node); }); @@ -618,6 +636,10 @@ const Module_Session_Notes_Classement = (props) => { "inscription_id_mail": "", "inscription_id_nom": "", "inscription_id_prenom": "", + "diplome_id": "", + "diplome_code": "", + "domaine_competence_id": "", + "domaine_competence_code": "", }; new_data2.push(node); @@ -2552,19 +2574,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -2607,7 +2629,7 @@ const Module_Session_Notes_Classement = (props) => {
Type apprenant - {/*} { id="one_detail_type_apprenant" className="session_caract_Dialog" options={New_Get_List_Type_Apprenant_result} - onChange={(event, value) => { + onChange={(event, value) => { if (value && value._id) { setp_dialog_type_apprenant(value._id); @@ -2659,19 +2681,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -2681,7 +2703,7 @@ const Module_Session_Notes_Classement = (props) => {
Mode Financement - {/*} { }} renderInput={(params) => @@ -3159,20 +3181,20 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -3241,19 +3263,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -3282,19 +3304,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -3319,19 +3341,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -3384,19 +3406,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -3420,19 +3442,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -3455,19 +3477,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -3524,19 +3546,19 @@ const Module_Session_Notes_Classement = (props) => { }} renderInput={(params) => @@ -3936,6 +3958,12 @@ const Module_Session_Notes_Classement = (props) => { inscription_id_nom: JSON.parse(item).inscription_id_nom, inscription_id_prenom: JSON.parse(item).inscription_id_prenom, + domaine_competence_id: JSON.parse(item).domaine_competence_id, + domaine_competence_code: JSON.parse(item).domaine_competence_code, + diplome_id: JSON.parse(item).diplome_id, + diplome_code: JSON.parse(item).diplome_code, + + } ))} diff --git a/src/components/Module_Session_Planification.js b/src/components/Module_Session_Planification.js index 316ddb8..29bf93b 100644 --- a/src/components/Module_Session_Planification.js +++ b/src/components/Module_Session_Planification.js @@ -718,7 +718,8 @@ const Module_Session_Planification = (props) => { const value = event.target.value; - if (String(value) === "ajout_ressource" || String(value) === "supprimer" || String(value) === "valide_sequence") { + if (String(value) === "ajout_ressource" || String(value) === "supprimer" || String(value) === "valide_sequence" + || String(value) === "devalide_sequence") { setactionmass_sequence_val(value); } else { @@ -977,6 +978,73 @@ const Module_Session_Planification = (props) => { }) } + + const [Unconfirme_Valide_Sequence_Session_Data_Mass_api, setUnconfirme_Valide_Sequence_Session_Data_Mass_api] = useState(); + const [Unconfirme_Valide_Sequence_Session_Data_Mass_message, setUnconfirme_Valide_Sequence_Session_Data_Mass_message] = useState(); + const [Unconfirme_Valide_Sequence_Session_Data_Mass_result, setUnconfirme_Valide_Sequence_Session_Data_Mass_result] = useState(); + function Unconfirme_Valide_Sequence_Session_Data_Mass(local_tab_ids) { + + + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("tab_id", local_tab_ids); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Unconfirme_Valide_Given_Session_Sequence_Mass/"; + setLoading(true); + + axios.post(myurl, form).then(res => { + //console.log(" In Unconfirme_Valide_Sequence_Session_Data_Mass res.data.status = " + res.data.status); + //console.log(" In Unconfirme_Valide_Sequence_Session_Data_Mass res.data.message r_class = " + res.data.message); + + setLoading(false); + + if (String(res.data.status) === String("true")) { + setUnconfirme_Valide_Sequence_Session_Data_Mass_api("true"); + setUnconfirme_Valide_Sequence_Session_Data_Mass_result(res.data.message); + + setDialog_seq_ressource_1_selected_type_ressource(""); + setDialog_seq_ressource_1_selected_ressource_id(""); + setDialog_seq_ressource_1_selected_ressource_poste(""); + setdisplay_detail_sequence(); + setselected_sequence_id(""); + setupdate_sequence(); + + setAdd_One_Sequence_Session_mass(""); + settab_selected_sequence_id([]); + setselectionModel_sequence([]); + setGetall_Sequence_Of_Session_result_planning_view([]); + + Getall_Sequence_Of_Session(selected_session_id); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); + } + else { + setUnconfirme_Valide_Sequence_Session_Data_Mass_api("false"); + setUnconfirme_Valide_Sequence_Session_Data_Mass_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + + } + + }).catch((error) => { + setLoading(false); + console.warn('Unconfirme_Valide_Sequence_Session_Data_Mass : Not good man :( mysearchtext = ' + error); + setUnconfirme_Valide_Sequence_Session_Data_Mass_api("false"); + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de dévalider les séquences "); + setalert_type("error"); + }) + } + + function GetSelectedRows_Sequence_Ids() { @@ -1019,7 +1087,10 @@ const Module_Session_Planification = (props) => { else if (String(actionmass_sequence_val) === "valide_sequence") { Confirme_Valide_Sequence_Session_Data_Mass(tab_seq_mongo_ids); + } + else if (String(actionmass_sequence_val) === "devalide_sequence") { + Unconfirme_Valide_Sequence_Session_Data_Mass(tab_seq_mongo_ids); } setactionmass_sequence_val(""); @@ -3533,6 +3604,16 @@ const Module_Session_Planification = (props) => { const [New_Getall_Class_List_UE_result, setNew_Getall_Class_List_UE_result] = useState([]); + const [Distinct_UE_New_Getall_Class_List_UE_result, setDistinct_UE_New_Getall_Class_List_UE_result] = useState([{ + "_id": "", + "id": "", + "label": "", + "code": "", + "titre": "", + + }]); + + const [Getall_Class_List_UE_api, setGetall_Class_List_UE_api] = useState(); const [Getall_Class_List_UE_message, setGetall_Class_List_UE_message] = useState(); const [Getall_Class_List_UE_result, setGetall_Class_List_UE_result] = useState(); @@ -3558,6 +3639,9 @@ const Module_Session_Planification = (props) => { setGetall_Class_List_UE_api("true"); setGetall_Class_List_UE_result(res.data.message); + var tab_tmp_storage_ue_id = [] + var new_data2_Distinct_UE = []; + var new_data2 = []; const new_data = res.data.message.map((x) => { @@ -3586,6 +3670,21 @@ const Module_Session_Planification = (props) => { "is_noted": local_is_noted, }; + + if (!tab_tmp_storage_ue_id.includes(local_id)) { + + var node_distinct = { + "_id": local_id, + "id": localid, + "label": local_code + " - " + String(local_titre).substring(0, 50), + "code": local_code, + "titre": local_titre, + + }; + tab_tmp_storage_ue_id.push(local_id) + new_data2_Distinct_UE.push(node_distinct) + } + new_data2.push(node); }); @@ -3603,8 +3702,19 @@ const Module_Session_Planification = (props) => { }; new_data2.push(node); - if (new_data2.length > 0) - setNew_Getall_Class_List_UE_result(new_data2); + var node_distinct = { + "_id": "", + "id": "", + "label": "", + "code": "", + "titre": "", + }; + new_data2_Distinct_UE.push(node_distinct) + + + + setNew_Getall_Class_List_UE_result(new_data2); + setDistinct_UE_New_Getall_Class_List_UE_result(new_data2_Distinct_UE); // console.log(" ### new_data2 = ", new_data2); } @@ -3622,7 +3732,12 @@ const Module_Session_Planification = (props) => { setLoading(false); console.warn('Not good man :( Getall_Class_List_UE = ', error); setGetall_Class_List_UE_api("false"); - alert(" Impossible de recuperer la liste des UE de la formation"); + + + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de recuperer la liste des UE de la formation"); + setalert_type("error"); + //setmyApimyApiMessage("") }) } @@ -3630,6 +3745,15 @@ const Module_Session_Planification = (props) => { const [New_Getall_Session_List_UE_result, setNew_Getall_Session_List_UE_result] = useState([]); + const [Distinct_UE_New_Getall_Session_List_UE_result, setDistinct_UE_New_Getall_Session_List_UE_result] = useState([{ + "_id": "", + "id": "", + "label": "", + "code": "", + "titre": "", + + }]); + const [Getall_Session_List_UE_api, setGetall_Session_List_UE_api] = useState(); const [Getall_Session_List_UE_message, setGetall_Session_List_UE_message] = useState(); const [Getall_Session_List_UE_result, setGetall_Session_List_UE_result] = useState(); @@ -3640,7 +3764,6 @@ const Module_Session_Planification = (props) => { form.append("token", stored_cookie); form.append("session_id", props.related_collection_recid); - var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Unite_Enseignement_Of_Given_Session_Id/"; setLoading(true); @@ -3656,6 +3779,9 @@ const Module_Session_Planification = (props) => { setGetall_Session_List_UE_result(res.data.message); var new_data2 = []; + var new_data2_Distinct_UE = []; + var tab_tmp_storage_ue_id = [] + const new_data = res.data.message.map((x) => { //--- @@ -3692,6 +3818,29 @@ const Module_Session_Planification = (props) => { "couleur": local_couleur, }; + + if (!tab_tmp_storage_ue_id.includes(local_id)) { + + var node_distinct = { + "_id": local_id, + "id": localid, + "label": local_code + " - " + String(local_titre).substring(0, 20), + "code": local_code, + "titre": local_titre, + "credit": local_credit, + "pres_dist_hyp": local_pres_dist_hyp, + "is_noted": local_is_noted, + "couleur": local_couleur, + "domaine_competence_id": local_domaine_competence_id, + "competence_id": local_competence_id, + "couleur": local_couleur, + + }; + tab_tmp_storage_ue_id.push(local_id) + new_data2_Distinct_UE.push(node_distinct) + } + + new_data2.push(node); }); @@ -3713,10 +3862,28 @@ const Module_Session_Planification = (props) => { }; new_data2.push(node); - if (new_data2.length > 0) - setNew_Getall_Session_List_UE_result(new_data2); + var node_distinct = { + "_id": "", + "id": "", + "label": "", + "code": "", + "titre": "", + "credit": "", + "pres_dist_hyp": "", + "is_noted": "", + "couleur": "", + "domaine_competence_id": "", + "competence_id": "", + "couleur": "", + }; + new_data2_Distinct_UE.push(node_distinct) - // console.log(" ### new_data2 = ", new_data2); + + + setNew_Getall_Session_List_UE_result(new_data2); + setDistinct_UE_New_Getall_Session_List_UE_result(new_data2_Distinct_UE); + + // console.log(" ### new_data2_Distinct_UE = ", new_data2_Distinct_UE); } else { setGetall_Session_List_UE_api("false"); @@ -5294,7 +5461,7 @@ const Module_Session_Planification = (props) => {