From e36d5dd99723e190f7336d81f1c7210ba942bbeb Mon Sep 17 00:00:00 2001 From: cherif Date: Sun, 20 Aug 2023 23:56:43 +0200 Subject: [PATCH] 20/08/23 - 23h30 --- src/components/DisplayDetailClass_new.js | 2 + .../DisplayDetailClass_new_Action.js | 2 + src/components/DisplayDetailClass_new_v2.js | 2 + src/components/DisplayPartnerSession.js | 15 +- src/components/DisplayPartnerStagiaires.js | 67 ++- src/components/Formation - Copie.js | 4 +- src/components/Formation.js | 2 + src/components/Formation_Cartouche_Com.js | 2 + src/components/GestionAdministrative.js | 547 +++++++++++++++++- src/components/Inscription_Information.js | 2 +- src/components/Partner.js | 3 + 11 files changed, 590 insertions(+), 58 deletions(-) diff --git a/src/components/DisplayDetailClass_new.js b/src/components/DisplayDetailClass_new.js index d4e716f..6626ce5 100644 --- a/src/components/DisplayDetailClass_new.js +++ b/src/components/DisplayDetailClass_new.js @@ -469,6 +469,8 @@ const DisplayDetailClass = (props) => { form.append("class_internal_url", classId); + form.append("token", stored_partner); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/"; axios.post(myurl, form).then(res => { diff --git a/src/components/DisplayDetailClass_new_Action.js b/src/components/DisplayDetailClass_new_Action.js index 740182d..b61ed91 100644 --- a/src/components/DisplayDetailClass_new_Action.js +++ b/src/components/DisplayDetailClass_new_Action.js @@ -494,6 +494,8 @@ const DisplayDetailClassAction = (props) => { form.append("class_internal_url", classId); + form.append("token", stored_partner); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/"; axios.post(myurl, form).then(res => { diff --git a/src/components/DisplayDetailClass_new_v2.js b/src/components/DisplayDetailClass_new_v2.js index a7d224c..b3e5f5b 100644 --- a/src/components/DisplayDetailClass_new_v2.js +++ b/src/components/DisplayDetailClass_new_v2.js @@ -894,6 +894,8 @@ const DisplayDetailClass_new_v2 = (props) => { form.append("class_internal_url", classId); + form.append("token", stored_partner); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/"; axios.post(myurl, form).then(res => { diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index d4e23d4..aeef3e5 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -987,7 +987,8 @@ const DisplayPartnerSession = (props) => { .then((response) => response.json()) .then((result) => { - //console.log(" ## result['status'] = ", result['status']) + console.log(" ## result['status'] = ", result['status']) + if (String(result['status']) === String("Err_Connexion")) { alert('Erreur: ' + result['message']); history.push("/Connexion"); @@ -1029,6 +1030,8 @@ const DisplayPartnerSession = (props) => { var form = new FormData(); form.append("class_internal_url", selected_internal_url); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionFormation_List/"; @@ -2823,7 +2826,7 @@ const DisplayPartnerSession = (props) => { return; } - + var _id = cellValues.row._id; var nom = cellValues.row.nom; @@ -3623,8 +3626,8 @@ const DisplayPartnerSession = (props) => { return (
-

Vos sessions de formation

- +

Vos sessions de formation

+
Utilisez les filtres !
@@ -3791,8 +3794,8 @@ const DisplayPartnerSession = (props) => {
-   - { var form = new FormData(); form.append("class_internal_url", selected_internal_url); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionFormation_List/"; @@ -1235,7 +1237,7 @@ const DisplayPartnerStagiaires = (props) => { //console.log('Success:', result['message']); setliste_sessions_file_change_result(result['message']); setliste_sessions_file_change_api("true"); - + Getall_TrainingParticipant(); alert(" Les stagiaires ont été correctement importés"); @@ -1367,6 +1369,7 @@ const DisplayPartnerStagiaires = (props) => { const [p_date_evaluation, setp_date_evaluation] = useState(); const [p_note_eval, setp_note_eval] = useState(); const [p_detail_session_class, setp_detail_session_class] = useState(); + const [p_detail_session_class_id, setp_detail_session_class_id] = useState(); const [p_detail_status_inscrit, setp_detail_status_inscrit] = useState(); const [p_detail_status_inscrit_label, setp_detail_status_inscrit_label] = useState(); const [p_detail_opco, setp_detail_opco] = useState(); @@ -1408,8 +1411,8 @@ const DisplayPartnerStagiaires = (props) => { axios.post(myurl, form).then(res => { if (String(res.data.status) === "true") { - //console.log(" In GetAttendee res.data.status = " + res.data.status); - //console.log(" In GetAttendee res.data.message r_class = " + res.data.message); + console.log(" In GetAttendee res.data.status = " + res.data.status); + console.log(" In GetAttendee res.data.message r_class = " + res.data.message); setGetAttendee_api("true"); setGetAttendee_result(res.data.message); var mylocalattendee = JSON.parse(res.data.message); @@ -1422,8 +1425,12 @@ const DisplayPartnerStagiaires = (props) => { document.getElementsByName("detail_session")[0].value = ""; + if (mylocalattendee.code_session) + setp_detail_session_class(mylocalattendee.code_session); + if (mylocalattendee.session_id) - setp_detail_session_class(mylocalattendee.session_id); + setp_detail_session_class_id(mylocalattendee.session_id); + document.getElementsByName("detail_status_inscript")[0].value = ""; if (mylocalattendee.status) { @@ -1768,14 +1775,37 @@ const DisplayPartnerStagiaires = (props) => { form.append("nom", p_detail_nom); form.append("prenom", p_detail_prenom); form.append("email", p_detail_mail); - form.append("employeur", p_detail_employeur); + + if (p_detail_employeur) + form.append("employeur", p_detail_employeur); + else + form.append("employeur", ""); + form.append("status", p_detail_status_inscrit); - form.append("price", p_detail_cout); - form.append("modefinancement", p_detail_mode_fin); + + if (p_detail_cout) + form.append("price", p_detail_cout); + else + form.append("price", ""); + + if (p_detail_mode_fin) + form.append("modefinancement", p_detail_mode_fin); + else + form.append("modefinancement", ""); + + + if (p_detail_opco) + form.append("opco", p_detail_opco); + else + form.append("opco", ""); form.append("_id", selected_id); - form.append("client_rattachement_id", p_detail_client_rattachement_nom); + if (p_detail_client_rattachement_nom) + form.append("client_rattachement_id", p_detail_client_rattachement_nom); + else + form.append("client_rattachement_id", ""); + //console.log(" form == ", form); var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/"; @@ -2467,7 +2497,7 @@ const DisplayPartnerStagiaires = (props) => { > {GetCurrentPartnerClass_result && GetCurrentPartnerClass_result.map((myclass) => ( - + {JSON.parse(myclass).title} @@ -2497,7 +2527,7 @@ const DisplayPartnerStagiaires = (props) => { > {p_one_formation && Getall_TrainingSession_result && Getall_TrainingSession_result.filter((session_ch) => JSON.parse(session_ch).class_internal_url === p_one_formation).map((mysession) => ( - {JSON.parse(mysession).code_session}   @@ -2505,7 +2535,7 @@ const DisplayPartnerStagiaires = (props) => { ))} {!p_one_formation && Getall_TrainingSession_result && Getall_TrainingSession_result.map((mysession) => ( - {JSON.parse(mysession).code_session}   @@ -2622,7 +2652,7 @@ const DisplayPartnerStagiaires = (props) => { className="disabled_style enable_style" > {status_inscription.map((option) => ( - + {option.label}  
))} @@ -2652,7 +2682,7 @@ const DisplayPartnerStagiaires = (props) => { > {Get_List_Partner_Clients_result && Get_List_Partner_Clients_result.map((myclient) => ( - {JSON.parse(myclient).nom}   @@ -2777,7 +2807,7 @@ const DisplayPartnerStagiaires = (props) => { - {String(participant_data_edit_mode) === "1" &&
Session
+ {String(participant_data_edit_mode) === "1" &&
Session aa
{ }} disabled={false} className="disabled_style" - value={p_detail_session_class} + value={p_detail_session_class_id} onChange={(e) => { setp_detail_session_class(e.target.value); setparticipant_data_changed("1"); + setp_detail_session_class_id(e.target.value); Dialog_1_handle_change_participant_session(" Attention, vous allez modifier la session d'affectation du participant"); } } @@ -2800,7 +2831,7 @@ const DisplayPartnerStagiaires = (props) => { > {Getall_TrainingSession_result && Getall_TrainingSession_result.map((mysession) => ( - {JSON.parse(mysession).code_session}   @@ -2834,7 +2865,7 @@ const DisplayPartnerStagiaires = (props) => { > {Get_List_Partner_Clients_result && Get_List_Partner_Clients_result.map((myclient) => ( - {JSON.parse(myclient).nom}   @@ -3222,8 +3253,6 @@ const DisplayPartnerStagiaires = (props) => {
- - {String(participant_data_edit_mode) !== "1" &&
diff --git a/src/components/Formation - Copie.js b/src/components/Formation - Copie.js index 2dce705..6e937ce 100644 --- a/src/components/Formation - Copie.js +++ b/src/components/Formation - Copie.js @@ -166,7 +166,9 @@ const Formation_copie = (props) => { var form = new FormData(); form.append("class_internal_url", props.formation.internal_url); - + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/"; axios.post(myurl, form).then(res => { diff --git a/src/components/Formation.js b/src/components/Formation.js index c6c7845..637945e 100644 --- a/src/components/Formation.js +++ b/src/components/Formation.js @@ -186,6 +186,8 @@ const Formation = (props) => { form.append("class_internal_url", props.formation.internal_url); + form.append("token", stored_partner); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/"; axios.post(myurl, form).then(res => { diff --git a/src/components/Formation_Cartouche_Com.js b/src/components/Formation_Cartouche_Com.js index 8913d96..a76cc23 100644 --- a/src/components/Formation_Cartouche_Com.js +++ b/src/components/Formation_Cartouche_Com.js @@ -169,6 +169,8 @@ const Formation_Cartouche_Com = (props) => { form.append("class_internal_url", props.formation.internal_url); + form.append("token", stored_partner); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/"; axios.post(myurl, form).then(res => { diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js index 02bd1cc..00f0b76 100644 --- a/src/components/GestionAdministrative.js +++ b/src/components/GestionAdministrative.js @@ -36,7 +36,11 @@ import add_plus from "../mysy_img/plus.png"; import excel_icone from "../mysy_img/excel_icone.png"; import participants from "../mysy_img/participants.png"; import { useHistory } from "react-router-dom"; - +import Dialog from '@mui/material/Dialog'; +import DialogActions from '@mui/material/DialogActions'; +import DialogContent from '@mui/material/DialogContent'; +import DialogContentText from '@mui/material/DialogContentText'; +import DialogTitle from '@mui/material/DialogTitle'; import { CiTrash } from "react-icons/ci"; @@ -883,8 +887,7 @@ function GestionAdministrative(props) { form.append("_id", object_id); form.append("_id", selected_id); - form.append("client_rattachement_id", p_detail_client_rattachement_nom); - + form.append("client_rattachement_id", p_detail_client_rattachement_id); var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/"; @@ -1047,7 +1050,9 @@ function GestionAdministrative(props) { var form = new FormData(); form.append("class_internal_url", internal_url); - + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionFormation_List/"; axios.post(myurl, form).then(res => { @@ -1453,6 +1458,7 @@ function GestionAdministrative(props) { var tab_date = []; + setp_detail_session_class(event.target.value); setmysession(event.target.value); GetListePreinscrit(event.target.value); GetListeInscrit(event.target.value); @@ -1940,8 +1946,8 @@ function GestionAdministrative(props) { if (String(res.data.status) === "true") { //console.log(" In GetCurrentSession res.data.status = " + res.data.status); - console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message); - console.log(" In GetCurrentSession res.data.message len = " + String(res.data.message).length); + //console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message); + //console.log(" In GetCurrentSession res.data.message len = " + String(res.data.message).length); setGetCurrentSession_api("true"); if (String(res.data.message).length > 0) { @@ -3100,15 +3106,15 @@ function GestionAdministrative(props) { document.getElementsByName("detail_nom")[0].value = ""; if (mylocalattendee.nom) - document.getElementsByName("detail_nom")[0].value = mylocalattendee.nom; + setp_detail_nom(mylocalattendee.nom); document.getElementsByName("detail_prenom")[0].value = ""; if (mylocalattendee.prenom) - document.getElementsByName("detail_prenom")[0].value = mylocalattendee.prenom; + setp_detail_prenom(mylocalattendee.prenom); document.getElementsByName("detail_mail")[0].value = ""; if (mylocalattendee.email) { - document.getElementsByName("detail_mail")[0].value = mylocalattendee.email; + setp_detail_mail(mylocalattendee.email); setattendee_lms_login(mylocalattendee.email); } @@ -3130,42 +3136,47 @@ function GestionAdministrative(props) { setp_detail_status_inscrit_label("Annulé"); } + + document.getElementsByName("detail_opco")[0].value = ""; + if (mylocalattendee.opco) + setp_detail_opco(mylocalattendee.opco); + document.getElementsByName("detail_tel")[0].value = ""; if (mylocalattendee.telephone) { - document.getElementsByName("detail_tel")[0].value = mylocalattendee.telephone; + setp_detail_tel(mylocalattendee.telephone); } document.getElementsByName("detail_adresse")[0].value = ""; if (mylocalattendee.adresse) { - document.getElementsByName("detail_adresse")[0].value = mylocalattendee.adresse; + setp_detail_adresse(mylocalattendee.adresse); } document.getElementsByName("detail_code_postal")[0].value = ""; if (mylocalattendee.code_postal) { - document.getElementsByName("detail_code_postal")[0].value = mylocalattendee.code_postal; + setp_detail_code_postal(mylocalattendee.code_postal); } document.getElementsByName("detail_ville")[0].value = ""; if (mylocalattendee.ville) { - document.getElementsByName("detail_ville")[0].value = mylocalattendee.ville; + setp_detail_ville(mylocalattendee.ville); } document.getElementsByName("detail_cout")[0].value = ""; if (mylocalattendee.price) { - document.getElementsByName("detail_cout")[0].value = mylocalattendee.price; + setp_detail_cout(mylocalattendee.price); } document.getElementsByName("detail_mode_fin")[0].value = ""; if (mylocalattendee.modefinancement) { - document.getElementsByName("detail_mode_fin")[0].value = mylocalattendee.modefinancement; + setp_detail_mode_fin(mylocalattendee.modefinancement); } document.getElementsByName("detail_employeur")[0].value = ""; if (mylocalattendee.employeur) { - document.getElementsByName("detail_employeur")[0].value = mylocalattendee.employeur; + setp_detail_employeur(mylocalattendee.employeur); } document.getElementsByName("date_evaluation")[0].value = ""; @@ -3200,7 +3211,7 @@ function GestionAdministrative(props) { setattendee_lms_pwd("xxxxxx"); } - desableAttendeeDetailFields(); + var myelement; if (document.getElementById('ajout_participant')) { @@ -3211,6 +3222,7 @@ function GestionAdministrative(props) { myelement.scrollIntoView({ behavior: 'smooth' }); } + disableAttendeeDetailFields(); } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -3220,12 +3232,13 @@ function GestionAdministrative(props) { else { setGetAttendee_api("false"); setGetAttendee_message(res.data.message); + alert('Erreur: ' + res.data.message); } }).catch((error) => { console.warn('Not good man :( GetAttendee = ', error); setGetAttendee_api("false"); - //setmyApimyApiMessage("") + alert(" Impossible de recuperer les données de l'apprenant"); }) } @@ -3891,12 +3904,14 @@ function GestionAdministrative(props) { else { setOne_Create_Participant_api("false"); setOne_Create_Participant_message(res.data.message); + alert('Erreur: ' + res.data.message); } }).catch((error) => { console.warn('One_Create_Participant : Not good man :( = ' + error); setOne_Create_Participant_api("false"); + alert(" Imposible d'ajouter l'apprenant") }) } @@ -4145,9 +4160,234 @@ function GestionAdministrative(props) { const [p_detail_client_rattachement_nom, setp_detail_client_rattachement_nom] = useState(); const [p_detail_client_rattachement_id, setp_detail_client_rattachement_id] = useState(); + let [participant_data_changed, setparticipant_data_changed] = useState(); + let [participant_data_edit_mode, setparticipant_data_edit_mode] = useState(); + + function EnableAttendeeDetailFields() { + setparticipant_data_edit_mode("1"); + + document.getElementsByName("detail_session_class")[0].disabled = false; + document.getElementsByName("detail_session_class")[0].style.backgroundColor = "#FFFFFF"; + + document.getElementsByName("detail_client_rattachement")[0].disabled = false; + document.getElementsByName("detail_client_rattachement")[0].style.backgroundColor = "#FFFFFF"; + + document.getElementsByName("detail_nom")[0].disabled = false; + document.getElementsByName("detail_nom")[0].style.backgroundColor = "#FFFFFF"; + + document.getElementsByName("detail_status_inscript")[0].disabled = false; + document.getElementsByName("detail_status_inscript")[0].style.backgroundColor = "#FFFFFF"; + + document.getElementsByName("detail_opco")[0].disabled = false; + document.getElementsByName("detail_opco")[0].style.backgroundColor = "#FFFFFF"; + + + document.getElementsByName("detail_prenom")[0].disabled = false; + document.getElementsByName("detail_prenom")[0].style.backgroundColor = "#FFFFFF"; + + + document.getElementsByName("detail_mail")[0].disabled = false; + document.getElementsByName("detail_mail")[0].style.backgroundColor = "#FFFFFF"; + + + document.getElementsByName("detail_tel")[0].disabled = false; + document.getElementsByName("detail_tel")[0].style.backgroundColor = "#FFFFFF"; + + + document.getElementsByName("detail_adresse")[0].disabled = false; + document.getElementsByName("detail_adresse")[0].style.backgroundColor = "#FFFFFF"; + + document.getElementsByName("detail_code_postal")[0].disabled = false; + document.getElementsByName("detail_code_postal")[0].style.backgroundColor = "#FFFFFF"; + + document.getElementsByName("detail_ville")[0].disabled = false; + document.getElementsByName("detail_ville")[0].style.backgroundColor = "#FFFFFF"; + + document.getElementsByName("detail_cout")[0].disabled = false; + document.getElementsByName("detail_cout")[0].style.backgroundColor = "#FFFFFF"; + + + document.getElementsByName("detail_mode_fin")[0].disabled = false; + document.getElementsByName("detail_mode_fin")[0].style.backgroundColor = "#FFFFFF"; + + document.getElementsByName("detail_employeur")[0].disabled = false; + document.getElementsByName("detail_employeur")[0].style.backgroundColor = "#FFFFFF"; + + } + + function disableAttendeeDetailFields() { + setparticipant_data_edit_mode("0"); + + + + document.getElementsByName("detail_session_class")[0].disabled = true; + document.getElementsByName("detail_session_class")[0].style.backgroundColor = "#ECEFF1"; + + document.getElementsByName("detail_client_rattachement")[0].disabled = true; + document.getElementsByName("detail_client_rattachement")[0].style.backgroundColor = "#ECEFF1"; + + + + document.getElementsByName("detail_nom")[0].disabled = true; + document.getElementsByName("detail_nom")[0].style.backgroundColor = "#ECEFF1"; + + document.getElementsByName("detail_status_inscript")[0].disabled = true; + document.getElementsByName("detail_status_inscript")[0].style.backgroundColor = "#ECEFF1"; + + document.getElementsByName("detail_opco")[0].disabled = true; + document.getElementsByName("detail_opco")[0].style.backgroundColor = "#ECEFF1"; + + + document.getElementsByName("detail_prenom")[0].disabled = true; + document.getElementsByName("detail_prenom")[0].style.backgroundColor = "#ECEFF1"; + + + document.getElementsByName("detail_mail")[0].disabled = true; + document.getElementsByName("detail_mail")[0].style.backgroundColor = "#ECEFF1"; + + + document.getElementsByName("detail_tel")[0].disabled = true; + document.getElementsByName("detail_tel")[0].style.backgroundColor = "#ECEFF1"; + + + document.getElementsByName("detail_adresse")[0].disabled = true; + document.getElementsByName("detail_adresse")[0].style.backgroundColor = "#ECEFF1"; + + document.getElementsByName("detail_code_postal")[0].disabled = true; + document.getElementsByName("detail_code_postal")[0].style.backgroundColor = "#ECEFF1"; + + document.getElementsByName("detail_ville")[0].disabled = true; + document.getElementsByName("detail_ville")[0].style.backgroundColor = "#ECEFF1"; + + document.getElementsByName("detail_cout")[0].disabled = true; + document.getElementsByName("detail_cout")[0].style.backgroundColor = "#ECEFF1"; + + + document.getElementsByName("detail_mode_fin")[0].disabled = true; + document.getElementsByName("detail_mode_fin")[0].style.backgroundColor = "#ECEFF1"; + + document.getElementsByName("detail_employeur")[0].disabled = true; + document.getElementsByName("detail_employeur")[0].style.backgroundColor = "#ECEFF1"; + + document.getElementsByName("date_evaluation")[0].disabled = true; + document.getElementsByName("date_evaluation")[0].style.backgroundColor = "#ECEFF1"; + + + document.getElementsByName("detail_incr_date")[0].disabled = true; + document.getElementsByName("detail_incr_date")[0].style.backgroundColor = "#ECEFF1"; + + + document.getElementsByName("certif_date")[0].disabled = true; + document.getElementsByName("certif_date")[0].style.backgroundColor = "#ECEFF1"; + } + + function AnnuleAttendeeDetailFields() { + GetAttendee_Data(selectedattendeeemail, mysession); + disableAttendeeDetailFields(); + setparticipant_data_changed(); + setparticipant_data_edit_mode(); + } + + const [Update_One_StagiaireData_api, setUpdate_One_StagiaireData_api] = useState(); + const [Update_One_StagiaireData_message, setUpdate_One_StagiaireData_message] = useState(); + const [Update_One_StagiaireData_result, setUpdate_One_StagiaireData_result] = useState(); + function Update_One_StagiaireData() { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + if (p_detail_session_class.length <= 0) { + alert(" Vous devez choisir une session"); + return; + } + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("class_internal_url", internal_url); + form.append("session_id", p_detail_session_class); + form.append("nom", p_detail_nom); + form.append("prenom", p_detail_prenom); + form.append("email", p_detail_mail); + form.append("employeur", p_detail_employeur); + form.append("status", p_detail_status_inscrit); + form.append("price", p_detail_cout); + form.append("modefinancement", p_detail_mode_fin); + form.append("opco", p_detail_opco); + + form.append("_id", selected_id); + form.append("client_rattachement_id", p_detail_client_rattachement_id); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/"; + + axios.post(myurl, form).then(res => { + //console.log(" In UpdateStagiaireData res.data.status = " + res.data.status); + //console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + setUpdate_One_StagiaireData_api("true"); + setUpdate_One_StagiaireData_result(res.data.message); + disableAttendeeDetailFields(); + setparticipant_data_changed(); + setparticipant_data_edit_mode(); + GetAttendee_Data(p_detail_mail, p_detail_session_class); + GetCurrentClass_trainingsession(); + GetAttestation_Certif(); + Get_List_Partner_Clients(); + alert(" La mise à jour été correctement faite."); + } + else { + setUpdate_One_StagiaireData_api("false"); + setUpdate_One_StagiaireData_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + + console.warn('UpdateStagiaireData : Not good man :( mysearchtext = ' + error); + setUpdate_One_StagiaireData_api("false"); + alert(" Impossible de mettre à jour le participant"); + + }) + } + + const [Dialog_1_message, setDialog_1_message] = React.useState(false); + const [Dialog_1_open, setDialog_1_open] = React.useState(false); + function Dialog_1_handle_change_participant_session(message) { + setDialog_1_message(message); + setDialog_1_open(true); + } + + const Dialog_1_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_1_handleClose_buton = () => { + setDialog_1_open(false); + }; + + return (
+ + + MySy Information + + + {Dialog_1_message} + + + + + + + + + Partenaires editeurs formations @@ -4578,9 +4818,46 @@ function GestionAdministrative(props) { {String(addOneSession) !== "1" &&

+ {/*--- + Choisir une session v 2
+ + {GetCurrentClass_trainingsession_result && + GetCurrentClass_trainingsession_result.map((session) => ( + + {(JSON.parse(session).code_session) && (JSON.parse(session).code_session) + " - "} + {(JSON.parse(session).session_ondemande) === "1" && " A la Demande - "} + {(!JSON.parse(session).session_ondemande || JSON.parse(session).session_ondemande === "0") && + (JSON.parse(session).date_debut).substring(0, 10) + " au " + (JSON.parse(session).date_fin).substring(0, 10)} + + + {/*(JSON.parse(session).date_debut).substring(0, 10)} au {(JSON.parse(session).date_fin).substring(0, 10) * /} - + {(JSON.parse(session).distantiel) === "1" && " A Distance - "} + {(JSON.parse(session).presentiel) === "1" && (JSON.parse(session).adresse) && " En Présentiel - " + (JSON.parse(session).adresse)} + {(JSON.parse(session).presentiel) === "1" && (!JSON.parse(session).adresse) && " En Présentiel - "} + {(JSON.parse(session).code_postal) && " " + (JSON.parse(session).code_postal)} + + + ))} + + ---*/} Choisir une session
- @@ -5808,6 +6085,58 @@ function GestionAdministrative(props) {
+ {String(participant_data_edit_mode) !== "1" &&
Session
+ + +
} + + {String(participant_data_edit_mode) === "1" &&
Session
+ { + setp_detail_session_class(e.target.value); + setparticipant_data_changed("1"); + Dialog_1_handle_change_participant_session(" Attention, vous allez modifier la session d'affectation du participant"); + } + } + + > + {GetCurrentClass_trainingsession_result && + GetCurrentClass_trainingsession_result.map((mysession) => ( + + {JSON.parse(mysession).code_session}   + + + ))} + +
} + +
Nom
{ + setp_detail_nom(e.target.value); + setparticipant_data_changed("1"); + }} />
@@ -5836,7 +6170,11 @@ function GestionAdministrative(props) { }} disabled={false} className="disabled_style" - + value={p_detail_prenom} + onChange={(e) => { + setp_detail_prenom(e.target.value); + setparticipant_data_changed("1"); + }} />
@@ -5852,11 +6190,15 @@ function GestionAdministrative(props) { }} disabled={false} className="disabled_style" - + value={p_detail_mail} + onChange={(e) => { + setp_detail_mail(e.target.value); + setparticipant_data_changed("1"); + }} />
-
Client
+ {String(participant_data_edit_mode) !== "1" &&
Client
-
+
} -
Statut
+ {String(participant_data_edit_mode) === "1" &&
Client
+ { + setp_detail_client_rattachement_id(e.target.value); + setp_detail_client_rattachement_nom(e.target.value); + setparticipant_data_changed("1"); + Dialog_1_handle_change_participant_session(" Attention, vous allez modifier le client de rattachement du participant"); + } + } + + > + {Get_List_Partner_Clients_result && + Get_List_Partner_Clients_result.map((myclient) => ( + + {JSON.parse(myclient).nom}   + + ))} + +
} + + {String(participant_data_edit_mode) !== "1" &&
Statut
-
+
} + + {String(participant_data_edit_mode) === "1" &&
Statut
+ { + setp_detail_status_inscrit(e.target.value); + setparticipant_data_changed("1"); + } + } + + > + Inscrit    + Preinscrit   + Annule   + +
}
Téléphone
{ + setp_detail_tel(e.target.value); + setparticipant_data_changed("1"); + }} />
@@ -5919,7 +6323,11 @@ function GestionAdministrative(props) { }} disabled={false} className="disabled_style" - + value={p_detail_adresse} + onChange={(e) => { + setp_detail_adresse(e.target.value); + setparticipant_data_changed("1"); + }} />
Code postal
@@ -5934,7 +6342,11 @@ function GestionAdministrative(props) { }} disabled={false} className="disabled_style" - + value={p_detail_code_postal} + onChange={(e) => { + setp_detail_code_postal(e.target.value); + setparticipant_data_changed("1"); + }} />
Ville
@@ -5949,7 +6361,11 @@ function GestionAdministrative(props) { }} disabled={false} className="disabled_style" - + value={p_detail_ville} + onChange={(e) => { + setp_detail_ville(e.target.value); + setparticipant_data_changed("1"); + }} />
@@ -5981,10 +6397,34 @@ function GestionAdministrative(props) { inputProps={{ min: "1", max: "999999", step: "1" }} disabled={false} className="disabled_style" + value={p_detail_cout} + onChange={(e) => { + setp_detail_cout(e.target.value); + setparticipant_data_changed("1"); + }} />
+
Opco
+ { + setp_detail_opco(e.target.value); + setparticipant_data_changed("1"); + }} + /> +
Mode Financement
{ + setp_detail_mode_fin(e.target.value); + setparticipant_data_changed("1"); + }} />
@@ -6015,7 +6459,11 @@ function GestionAdministrative(props) { }} disabled={false} className="disabled_style" - + value={p_detail_employeur} + onChange={(e) => { + setp_detail_employeur(e.target.value); + setparticipant_data_changed("1"); + }} />
{is_lms_class_code &&
@@ -6066,6 +6514,43 @@ function GestionAdministrative(props) {
} + + + {String(participant_data_changed) === "1" && String(participant_data_edit_mode) === "1" &&
+ /!\ Pensez à enregistrer les modifications +
} + + +
+ + {String(participant_data_changed) === "1" && String(participant_data_edit_mode) === "1" &&
+ + + +
} + + {String(participant_data_edit_mode) === "1" &&
+ +
} +
+ + + {String(participant_data_edit_mode) !== "1" &&
+ +
+   +
+ +
+ + +
+ +
} +

diff --git a/src/components/Inscription_Information.js b/src/components/Inscription_Information.js index 0b4423e..d5f6075 100644 --- a/src/components/Inscription_Information.js +++ b/src/components/Inscription_Information.js @@ -259,7 +259,7 @@ function Inscription_Information(props) { //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); const stored_cookie = getCookie('tokenmysych'); form.append("class_internal_url", props.internal_url); - + form.append("token", stored_cookie); var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/"; axios.post(myurl, form).then(res => { diff --git a/src/components/Partner.js b/src/components/Partner.js index 4020bcf..cb66373 100644 --- a/src/components/Partner.js +++ b/src/components/Partner.js @@ -159,6 +159,7 @@ const Partner = (props) => { setapiexcelimportmessage(result['status']); if (String(result['status']) === String("true")) { sethandleSubmission_api("true"); + alert(result['message']); } else if (String(result['status']) === String("Err_Connexion")) { alert('Erreur: ' + result['message']); history.push("/Connexion"); @@ -167,6 +168,7 @@ const Partner = (props) => { else { sethandleSubmission_api("false"); sethandleSubmission_message(result['message']); + alert(result['message']); } //alert("result['status'] " + result['status']); }) @@ -175,6 +177,7 @@ const Partner = (props) => { setmyApiResponse("false"); setapiexcelimportmessage("-1"); sethandleSubmission_api("false"); + alert(" Impossible d'importer/mettre à jour les formations"); }); };