From f6b6317ecbc5ba7771b66be89cf0d6d996fc9a89 Mon Sep 17 00:00:00 2001 From: cherif Date: Thu, 28 Dec 2023 18:23:43 +0100 Subject: [PATCH] 28/12/2023- 19h --- src/components/AddClassManual.js | 258 +++++++++-- src/components/Apprenant.js | 84 +++- src/components/DisplayPartnerSession.js | 429 ++++++++++-------- src/components/DisplayPartnerStagiaires.js | 241 +++++++--- .../DisplayPartnerTrainingsPagination.js | 2 +- src/styles/components/_addclassmanual.scss | 114 +++-- 6 files changed, 785 insertions(+), 343 deletions(-) diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index 3d6e83b..c1a0a61 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -28,6 +28,7 @@ import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; import GestionAdministrative from "./GestionAdministrative"; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; +import Autocomplete from '@mui/material/Autocomplete'; const AddClassManual = (props) => { const history = useHistory(); @@ -298,6 +299,8 @@ const AddClassManual = (props) => { }); } + 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(); @@ -323,6 +326,33 @@ const AddClassManual = (props) => { //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); + + 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); + }); + + if (new_data2.length > 0) + setNew_Getall_Training_Employee_No_Filter_result(new_data2); + } else { setGetall_Training_Employee_No_Filter_api("false"); @@ -422,7 +452,7 @@ const AddClassManual = (props) => { setmyApiResponse("True"); setResult(res.data.message); - + var mylocaltraining = JSON.parse(res.data.message); @@ -459,10 +489,11 @@ const AddClassManual = (props) => { setfield_description(mylocaltraining.description); - + setp_formateur_label("-"); if (mylocaltraining.formateur_id) { setp_formateur_id(mylocaltraining.formateur_id); setp_formateur_label(mylocaltraining.formateur_nom_prenom); + //console.log(" #### mylocaltraining.formateur_nom_prenom = ", mylocaltraining.formateur_nom_prenom); } else { setp_formateur_id(""); @@ -511,9 +542,13 @@ const AddClassManual = (props) => { if (mylocaltraining.class_level) { setp_class_level(mylocaltraining.class_level); + setp_class_level_label(mylocaltraining.class_level_description); + } - else + else { setp_class_level("2"); + setp_class_level_label("Aucune certification"); + } if (mylocaltraining.price) @@ -527,7 +562,7 @@ const AddClassManual = (props) => { //console.log(" ### mylocaltraining.domaine = ", mylocaltraining.domaine); } else - setmytrainingdomaine(""); + setmytrainingdomaine("-"); if (mylocaltraining.metier) { @@ -535,7 +570,7 @@ const AddClassManual = (props) => { //console.log(" ### mylocaltraining.metier = ", mylocaltraining.metier); } else - setmytrainingmetier(""); + setmytrainingmetier("-"); @@ -699,7 +734,7 @@ const AddClassManual = (props) => { var url = document.getElementsByName("url")[0].value; var lms_class_code = document.getElementsByName("lms_class_code")[0].value; var class_inscription_url = document.getElementsByName("class_inscription_url")[0].value; - var mymetier = document.getElementsByName("metier")[0].value; + var mymetier = mytrainingmetier; var mynote = document.getElementsByName("note")[0].value; var mycpf = document.getElementsByName("cpf")[0].value; var mycertif = document.getElementsByName("certif")[0].value; @@ -941,7 +976,10 @@ const AddClassManual = (props) => { } - const [mytrainingmetier, setmytrainingmetier] = useState(""); + const [mytrainingmetier, setmytrainingmetier] = useState("-"); + + const [New_Get_List_Metiers_result, setNew_Get_List_Metiers_result] = useState([]); + const [Get_List_Metiers_api, setGet_List_Metiers_api] = useState(); const [Get_List_Metiers_message, setGet_List_Metiers_message] = useState(); const [Get_List_Metiers_result, setGet_List_Metiers_result] = useState(); @@ -963,6 +1001,28 @@ const AddClassManual = (props) => { setGet_List_Metiers_api("true"); setGet_List_Metiers_result(data['message']); + var new_data2 = []; + const new_data = data['message'].map((x) => { + + //--- + var localid = x.id; + var local_metier = x.metier; + + + //--- + var node = { + "id": localid, + "label": local_metier, + "metier": local_metier, + + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Get_List_Metiers_result(new_data2); + + } else { setGet_List_Metiers_api("false"); @@ -988,7 +1048,10 @@ const AddClassManual = (props) => { } - const [mytrainingdomaine, setmytrainingdomaine] = useState(""); + const [mytrainingdomaine, setmytrainingdomaine] = useState("-"); + + const [New_Get_List_Domaines_result, setNew_Get_List_Domaines_result] = useState([]); + const [Get_List_Domaines_api, setGet_List_Domaines_api] = useState(); const [Get_List_Domaines_message, setGet_List_Domaines_message] = useState(); const [Get_List_Domaines_result, setGet_List_Domaines_result] = useState(); @@ -1009,6 +1072,29 @@ const AddClassManual = (props) => { setGet_List_Domaines_api("true"); setGet_List_Domaines_result(data['message']); + var new_data2 = []; + const new_data = data['message'].map((x) => { + + //--- + var localid = x.id; + var local_domaine = x.domaine; + + + //--- + var node = { + "id": localid, + "label": local_domaine, + "domaine": local_domaine, + + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Get_List_Domaines_result(new_data2); + + + } else { setGet_List_Domaines_api("false"); @@ -1400,6 +1486,7 @@ const AddClassManual = (props) => { }) } + const [New_Get_List_Niveau_Formation_result, setNew_Get_List_Niveau_Formation_result] = useState([]); const [Get_List_Niveau_Formation_api, setGet_List_Niveau_Formation_api] = useState(); const [Get_List_Niveau_Formation_message, setGet_List_Niveau_Formation_message] = useState(); @@ -1425,6 +1512,34 @@ const AddClassManual = (props) => { setGet_List_Niveau_Formation_api("true"); setGet_List_Niveau_Formation_result(data['message']); + var new_data2 = []; + const new_data = data['message'].map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_code = JSON.parse(x).code; + var local_description = JSON.parse(x).description; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_description, + "description": local_description, + "code": local_code, + + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Get_List_Niveau_Formation_result(new_data2); + + + + } else { setGet_List_Niveau_Formation_api("false"); @@ -1521,9 +1636,10 @@ const AddClassManual = (props) => { const [p_formateur_id, setp_formateur_id] = useState(""); - const [p_formateur_label, setp_formateur_label] = useState(""); + const [p_formateur_label, setp_formateur_label] = useState("-"); - const [p_class_level, setp_class_level] = useState(""); + const [p_class_level, setp_class_level] = useState("2"); + const [p_class_level_label, setp_class_level_label] = useState("Aucune certification"); return ( @@ -1596,7 +1712,7 @@ const AddClassManual = (props) => { -
+ {/*
{ ))} +
*/} + + +
+ { + if (value && value._id) { + setp_formateur_id(value._id); + DataUpdated(); + + } + }} + + renderInput={(params) => + } + /> + + +
{/*String(datamodification) === "1" &&
@@ -1686,36 +1829,28 @@ const AddClassManual = (props) => {
-
- { - setp_class_level(e.target.value); - DataUpdated(); + options={New_Get_List_Niveau_Formation_result} + value={p_class_level_label} + onChange={(event, value) => { + if (value && value.code) { + setp_class_level(value.code); + setp_class_level_label(value.description) + DataUpdated(); + + } + }} + + renderInput={(params) => } - } - > - - {Get_List_Niveau_Formation_result && - Get_List_Niveau_Formation_result.map((niveau) => ( - - {JSON.parse(niveau).description}  - - - ))} - - + />
@@ -1806,7 +1941,7 @@ const AddClassManual = (props) => {
-
+ {/*}
{ ))} +
*/} + +
+ { + if (value && value.domaine) { + setmytrainingdomaine(value.domaine); + setdatamodification("1"); + } + }} + + renderInput={(params) => + } + /> +
+ { + if (value && value.metier) { + + setmytrainingmetier(value.metier); + setdatamodification("1"); + } + }} + + renderInput={(params) => + } + /> + +
+ + {/*
{ ))} -
+
*/}
{ { 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: 'class_internal_url', headerName: 'class_internal_url', hide: true, Width: 1 }, - { field: 'status', headerName: 'Statut', hide: false, flex: 1, minWidth: 50, maxWidth: 70 }, + { + field: 'status', headerName: 'Statut', hide: false, flex: 1, minWidth: 50, maxWidth: 70, + valueFormatter: (params) => { + if (String(params.value) === "0") + return "Pré."; + else if (String(params.value) === "1") + return "Ins"; + else if (String(params.value) === "-1") + return "Ann"; + else if (String(params.value) === "2") + return "Enc"; + else + return "???"; + } + }, + + { 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: '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: 'presentiel', headerName: 'Présentiel', hide: false, flex: 1, minWidth: 50, maxWidth: 70 }, @@ -1473,7 +1491,7 @@ const Apprenant = (props) => { console.log(" selected_id = ", selected_id, " -- selected_email = ", selected_email) Clear_Detail_Apprenant_Fields(); - + setadd_One_Apprenant(''); setdisplay_detail_apprenant('1'); @@ -1860,6 +1878,9 @@ const Apprenant = (props) => { }) } + + const [New_Get_List_Partner_Clients_result, setNew_Get_List_Partner_Clients_result] = useState([]); + const [Get_List_Partner_Clients_api, setGet_List_Partner_Clients_api] = useState(); const [Get_List_Partner_Clients_message, setGet_List_Partner_Clients_message] = useState(); const [Get_List_Partner_Clients_result, setGet_List_Partner_Clients_result] = useState(); @@ -1873,13 +1894,40 @@ const Apprenant = (props) => { var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_List_Partner_Client/"; + setLoading(true); axios.post(myurl, form).then(res => { //console.log(" In Get_List_Partner_Clients res.data.status = " + res.data.status); //console.log(" In Get_List_Partner_Clients res.data.message r_class = " + res.data.message); + setLoading(false); + if (String(res.data.status) === String("true")) { setGet_List_Partner_Clients_api("true"); setGet_List_Partner_Clients_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_raison_sociale = JSON.parse(x).raison_sociale; + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom, + "nom": local_nom, + "raison_sociale": local_raison_sociale, + + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Get_List_Partner_Clients_result(new_data2); } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -1892,6 +1940,7 @@ const Apprenant = (props) => { } }).catch((error) => { + setLoading(false); console.warn('Not good man :( Get_List_Partner_Clients = ', error); setGet_List_Partner_Clients_api("false"); alert('Erreur: Impossible de recuperer la liste des clients'); @@ -2062,7 +2111,7 @@ const Apprenant = (props) => { Getall_TrainingSession(); - + if (props.object_key && props.subdata && String(props.object_key).length > 3) { setLoading(true); handleClick_edit_apprenant_From_Props(props.object_key, props.subdata); @@ -2682,6 +2731,7 @@ const Apprenant = (props) => { const [p_dialog_session_id, setp_dialog_session_id] = useState(""); const [p_dialog_type_apprenant, setp_dialog_type_apprenant] = useState(""); const [p_dialog_financement, setp_dialog_financement] = useState(""); + const [p_dialog_client_rattachement_id, setp_dialog_client_rattachement_id] = useState(""); @@ -2697,6 +2747,7 @@ const Apprenant = (props) => { form.append("session_id", p_dialog_session_id); form.append("type_apprenant", p_dialog_type_apprenant); form.append("modefinancement", p_dialog_financement); + form.append("client_rattachement_id", p_dialog_client_rattachement_id); @@ -2870,7 +2921,7 @@ const Apprenant = (props) => { form.append("session_id", p_dialog_session_id); form.append("type_apprenant", p_dialog_type_apprenant); form.append("modefinancement", p_dialog_financement); - + form.append("client_rattachement_id", p_dialog_client_rattachement_id); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Apprenant_Inscrire_Session_List/"; @@ -3397,7 +3448,7 @@ const Apprenant = (props) => { var token = stored_cookie; - var url = process.env.REACT_APP_API_URL + "myclass/api/Print_Apprenant_PDF/" + token + "/" + selected_apprenant_id+"/"+fiche_apprenant_id; + var url = process.env.REACT_APP_API_URL + "myclass/api/Print_Apprenant_PDF/" + token + "/" + selected_apprenant_id + "/" + fiche_apprenant_id; setLoading(true); axios.get(url, { responseType: 'blob', },) @@ -3947,6 +3998,27 @@ const Apprenant = (props) => {
+
Client + { + if (value && value._id) { + setp_dialog_client_rattachement_id(value._id); + + } + + }} + + renderInput={(params) => + } + /> + +
+ @@ -5661,6 +5733,8 @@ const Apprenant = (props) => { presentiel: JSON.parse(item).distantiel, distanciel: JSON.parse(item).presentiel, class_internal_url: JSON.parse(item).class_internal_url, + client_rattachement_nom: JSON.parse(item).client_rattachement_nom, + client_rattachement_id: JSON.parse(item).client_rattachement_id, } ))} diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 1600f04..ee69f43 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -285,13 +285,14 @@ const DisplayPartnerSession = (props) => { const columns_preinscrit = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, - { field: 'email', headerName: 'email', width: 200, hideable: false, flex: 1 }, - { field: 'nom', headerName: 'nom', width: 150, hide: false, editable: true }, - { field: 'prenom', headerName: 'prenom', width: 150, hide: false, editable: true }, - { field: 'employeur', headerName: 'Employeur', width: 200, hide: false, editable: true }, - { field: 'opco', headerName: 'Centre Opco', width: 150, hide: false, editable: true }, - { field: 'modefinancement', headerName: 'Financement', width: 150, hide: false, editable: true }, - { field: 'amount', headerName: 'Montant Formation', width: 150, type: 'number', hideable: false, flex: 1, editable: true }, + { field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false }, + { field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: true }, + { field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: true }, + { field: 'email', headerName: 'email', minWidth: 150, flex: 1, hideable: false, flex: 1 }, + { field: 'employeur', headerName: 'Employeur', minWidth: 150, flex: 1, maxWidth: 200, hide: false, editable: true }, + { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: true }, + { field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: true }, + { field: 'amount', headerName: 'Montant Formation', minWidth: 100, flex: 1, maxWidth: 150, type: 'number', hideable: false, flex: 1, editable: true }, { field: "update", headerName: 'Mise à jour', renderCell: (cellValues) => { @@ -542,13 +543,14 @@ const DisplayPartnerSession = (props) => { const columns_inscrit = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, - { field: 'email', headerName: 'emails', width: 200, hideable: false, flex: 1, minWidth: 150, maxWidth: 300 }, - { field: 'nom', headerName: 'nom', width: 150, hide: false, editable: true, resizable: true }, - { field: 'prenom', headerName: 'prenom', width: 150, hide: false, editable: true }, - { field: 'employeur', headerName: 'Employeur', width: 200, hide: false, editable: true }, - { field: 'opco', headerName: 'Centre Opco', width: 150, hide: false, editable: true }, - { field: 'modefinancement', headerName: 'Financement', width: 150, hide: false, editable: true }, - { field: 'amount', headerName: 'Montant Formation', width: 150, type: 'number', hideable: false, flex: 1, editable: true }, + { field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false }, + { field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: true }, + { field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: true }, + { field: 'email', headerName: 'email', minWidth: 150, flex: 1, hideable: false, flex: 1 }, + { field: 'employeur', headerName: 'Employeur', minWidth: 150, flex: 1, maxWidth: 200, hide: false, editable: true }, + { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: true }, + { field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: true }, + { field: 'amount', headerName: 'Montant Formation', minWidth: 100, flex: 1, maxWidth: 150, type: 'number', hideable: false, flex: 1, editable: true }, { field: "sendmail", headerName: 'Email Confirmation', renderCell: (cellValues) => { @@ -1099,6 +1101,8 @@ const DisplayPartnerSession = (props) => { const [selected_class_external_code, setselected_class_external_code] = useState(""); function handleClick_edit_session_From_Line(selected_row_id) { + setLoading(true); + setaddOneSession("0"); setEdite_session("0"); setnb_stagiaire_Preinscrit("0"); @@ -1135,6 +1139,7 @@ const DisplayPartnerSession = (props) => { GetListeInscrit(line._id, line.class_internal_url); GetListeEmargement(line._id, line.class_internal_url); + setLoading(false); } @@ -1171,6 +1176,8 @@ const DisplayPartnerSession = (props) => { } + const [New_Get_List_Partner_Clients_result, setNew_Get_List_Partner_Clients_result] = useState([]); + const [Get_List_Partner_Clients_api, setGet_List_Partner_Clients_api] = useState(); const [Get_List_Partner_Clients_message, setGet_List_Partner_Clients_message] = useState(); const [Get_List_Partner_Clients_result, setGet_List_Partner_Clients_result] = useState(); @@ -1191,6 +1198,31 @@ const DisplayPartnerSession = (props) => { if (String(res.data.status) === String("true")) { setGet_List_Partner_Clients_api("true"); setGet_List_Partner_Clients_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_raison_sociale = JSON.parse(x).raison_sociale; + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom, + "nom": local_nom, + "raison_sociale": local_raison_sociale, + + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Get_List_Partner_Clients_result(new_data2); + } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -1374,7 +1406,7 @@ const DisplayPartnerSession = (props) => { setdatagrid_columns_size_model2(50); } - + if (props.object_key && String(props.object_key).length > 3) { @@ -2134,6 +2166,17 @@ const DisplayPartnerSession = (props) => { var prix_session; + var one_civilite_part = ""; + if (p_one_civilite_part) + one_civilite_part = p_one_civilite_part; + + if (one_civilite_part.trim() == "") { + alert(" Vous devez saisir la civilité du participant"); + return; + } + + + var one_nom_part = ""; if (p_one_nom_part) one_nom_part = p_one_nom_part; @@ -2192,6 +2235,7 @@ const DisplayPartnerSession = (props) => { form.append("token", stored_cookie); form.append("class_internal_url", selected_internal_url); form.append("session_id", selected_session_id); + form.append("civilite", one_civilite_part); form.append("nom", one_nom_part); form.append("prenom", one_prenom_part); form.append("email", one_email_part.trim()); @@ -2773,10 +2817,11 @@ const DisplayPartnerSession = (props) => { var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/"; - + setLoading(true); 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); + setLoading(false); + // 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")) { setUpdateStagiaireData_api("true"); @@ -2800,7 +2845,7 @@ const DisplayPartnerSession = (props) => { } }).catch((error) => { - + setLoading(false); console.warn('UpdateStagiaireData : Not good man :( mysearchtext = ' + error); setUpdateStagiaireData_api("false"); alert(" Impossible de mettre à jour le participant"); @@ -3385,6 +3430,10 @@ const DisplayPartnerSession = (props) => { function One_clearParticipantFields() { + + if (document.getElementsByName("one_civilite_part")[0]) + document.getElementsByName("one_civilite_part")[0].value = ""; + if (document.getElementsByName("one_nom_part")[0]) document.getElementsByName("one_nom_part")[0].value = ""; @@ -3401,7 +3450,7 @@ const DisplayPartnerSession = (props) => { document.getElementsByName("one_status_part")[0].value = ""; - + setp_one_civilite_part(); setp_one_nom_part(); setp_one_prenom_part(); setp_one_email_part(); @@ -4561,8 +4610,9 @@ const DisplayPartnerSession = (props) => { form.append("client_rattachement_id", p_detail_client_rattachement_id); var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/"; - + setLoading(true); axios.post(myurl, form).then(res => { + setLoading(false); //console.log(" In UpdateStagiaireData res.data.status = " + res.data.status); //console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message); @@ -4677,6 +4727,7 @@ const DisplayPartnerSession = (props) => { } + const [p_one_civilite_part, setp_one_civilite_part] = useState(); const [p_one_nom_part, setp_one_nom_part] = useState(); const [p_one_prenom_part, setp_one_prenom_part] = useState(); const [p_one_email_part, setp_one_email_part] = useState(); @@ -4732,11 +4783,13 @@ const DisplayPartnerSession = (props) => { var url = process.env.REACT_APP_API_URL + "myclass/api/PrintAttendeeDetail_perSession/" + stored_cookie + "/" + selected_code_session + "/" + selectedattendeeemail + "/" + selected_internal_url; - + setLoading(true); axios.get(url, { responseType: 'blob', },) .then((res) => { + setLoading(false); fileDownload(res.data, nom_fiche_detaillee) }).catch((error) => { + setLoading(false); console.error('Error:', error); }); @@ -4757,9 +4810,9 @@ const DisplayPartnerSession = (props) => { form.append("session_id", local_mysession); form.append("email", local_email); - + setLoading(true); axios.post(myurl, form).then(res => { - + setLoading(false); //console.log(" getStagiaireImages : In test res.data.status = " + res.data.status); // console.log(" getStagiaireImages: res.data.message.img = " + res.data.message); @@ -4786,6 +4839,7 @@ const DisplayPartnerSession = (props) => { } }).catch((error) => { + setLoading(false); console.warn('getStagiaireImages ee: Not good man :( = ', error); setgetPartnerImages_api("false"); setgetPartnerImages_message(" Impossible de recuperer les images/médias du partenaire") @@ -5074,12 +5128,12 @@ const DisplayPartnerSession = (props) => { formData.append("session_id", selected_session_id); formData.append("email", selectedattendeeemail); - console.log(" ### userimgclassprofilchanged =", userimgclassprofilchanged) + //console.log(" ### userimgclassprofilchanged =", userimgclassprofilchanged) formData.append('file_img', isimgclassSelected); formData.append('file_img_recid', isimgclassSelected_recid); - + setLoading(true); //console.log(" ### formData = ", formData); fetch( @@ -5091,7 +5145,8 @@ const DisplayPartnerSession = (props) => { ) .then((response) => response.json()) .then((result) => { - console.log('Success:', result['message'], "result['status'] = ", result['status']); + setLoading(false); + //console.log('Success:', result['message'], "result['status'] = ", result['status']); if (String(result['status']) === String("true")) { setrecord_Stagiaire_Image_api("true"); @@ -5108,6 +5163,7 @@ const DisplayPartnerSession = (props) => { }) .catch((error) => { + setLoading(false); console.error('Error:', error); setrecord_Stagiaire_Image_api("false"); alert(" Erreur : Impossible d'enregistrer l'image "); @@ -5129,7 +5185,7 @@ const DisplayPartnerSession = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); form.append("image_recid", isimgclassSelected_recid); - + setLoading(true); fetch( process.env.REACT_APP_API_URL + "myclass/api/DeleteImage_Stagiaire_v2/", { @@ -5138,9 +5194,9 @@ const DisplayPartnerSession = (props) => { } ).then((response) => response.json()) .then((result) => { - - console.log(' removeRecodedClassImage : status:', result['status']); - console.log('removeRecodedClassImage : Success:', result['message']); + setLoading(false); + //console.log(' removeRecodedClassImage : status:', result['status']); + //console.log('removeRecodedClassImage : Success:', result['message']); if (String(result['status']) === String("true")) { @@ -5163,6 +5219,7 @@ const DisplayPartnerSession = (props) => { }) .catch((error) => { + setLoading(false); console.error('Error:', error); alert(" Impossible de supprimer l'image "); }); @@ -5195,7 +5252,7 @@ const DisplayPartnerSession = (props) => { formData.append("email", local_mail.trim()); formData.append("class_internal_url", selected_internal_url); //console.log("token = " + stored_cookie); - + setLoading(true); fetch( process.env.REACT_APP_API_URL + "myclass/api/LMS_Credential_Sending_mail/", { @@ -5205,6 +5262,7 @@ const DisplayPartnerSession = (props) => { ) .then((response) => response.json()) .then((result) => { + setLoading(false); if (String(result['status']) === String("true")) { //console.log('Success:', result['message']); setResend_LMS_Credentials_result(result['message']); @@ -5222,6 +5280,7 @@ const DisplayPartnerSession = (props) => { }) .catch((error) => { + setLoading(false); console.error('Error:', error); setResend_LMS_Credentials_api("false"); }); @@ -5385,9 +5444,9 @@ const DisplayPartnerSession = (props) => { var myurl = process.env.REACT_APP_API_URL + "myclass/api/SendTrainingEvaluationEmail/"; - + setLoading(true); axios.post(myurl, form).then(res => { - + setLoading(false); if (String(res.data.status) === String("true")) { //console.log(" In SendEvaluationEmail res.data.status = " + res.data.status); //console.log(" In SendEvaluationEmail res.data.message r_class = " + res.data.message); @@ -5406,6 +5465,7 @@ const DisplayPartnerSession = (props) => { } }).catch((error) => { + setLoading(false); console.warn('Not good man :( SendEvaluationEmail = ', error); setSendEvaluationEmail_api("false"); @@ -5427,9 +5487,9 @@ const DisplayPartnerSession = (props) => { form.append("class_internal_url", selected_internal_url); var myurl = process.env.REACT_APP_API_URL + "myclass/api/SendAttendeeCertification/"; - + setLoading(true); axios.post(myurl, form).then(res => { - + setLoading(false); if (String(res.data.status) === String("true")) { //console.log(" In SendAttendeeAttestation res.data.status = " + res.data.status); //console.log(" In SendAttendeeAttestation res.data.message r_class = " + res.data.message); @@ -5446,6 +5506,7 @@ const DisplayPartnerSession = (props) => { } }).catch((error) => { + setLoading(false); console.warn('Not good man :( SendAttendeeAttestation = ', error); setSendAttendeeAttestation_api("false"); @@ -5906,7 +5967,7 @@ const DisplayPartnerSession = (props) => { 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"); @@ -5926,34 +5987,6 @@ const DisplayPartnerSession = (props) => { return; - fetch( - process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation_mass/", - { - 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']); - setsessions_file_change_1_result(result['message']); - setsessions_file_change_1_api("true"); - //GetCurrentClass_trainingsession(); - - } - else { - setsessions_file_change_1_message(result['message']); - setsessions_file_change_1_api("false"); - } - - }) - .catch((error) => { - console.error('Error:', error); - setsessions_file_change_1_api("false"); - }); }; @@ -5968,7 +6001,7 @@ const DisplayPartnerSession = (props) => { 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); @@ -5990,34 +6023,6 @@ const DisplayPartnerSession = (props) => { return; - fetch( - process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation_mass/", - { - 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']); - setsessions_file_change_2_result(result['message']); - setsessions_file_change_2_api("true"); - //GetCurrentClass_trainingsession(); - - } - else { - setsessions_file_change_2_message(result['message']); - setsessions_file_change_2_api("false"); - } - - }) - .catch((error) => { - console.error('Error:', error); - setsessions_file_change_2_api("false"); - }); }; const [Record_All_PJ_api, setRecord_All_PJ_api] = useState(); @@ -6048,7 +6053,7 @@ const DisplayPartnerSession = (props) => { //formData.append("class_internal_url", internal_url); //console.log("token = " + stored_cookie); - + setLoading(true); fetch( process.env.REACT_APP_API_URL + "myclass/api/Store_User_Downloaded_File/", @@ -6059,7 +6064,7 @@ const DisplayPartnerSession = (props) => { ) .then((response) => response.json()) .then((result) => { - + setLoading(false); //console.log(" ## result['status'] = ", result['status']) if (String(result['status']) === String("true")) { //console.log('Success:', result['message']); @@ -6080,6 +6085,7 @@ const DisplayPartnerSession = (props) => { }) .catch((error) => { + setLoading(false); console.error(' Record_All_PJ Error:', error); setRecord_All_PJ_api("false"); }); @@ -6087,7 +6093,7 @@ const DisplayPartnerSession = (props) => { } if (file_2_name && file_2_name.name) { - console.log(" ### Traitement de : ", file_2_name.name); + //console.log(" ### Traitement de : ", file_2_name.name); } } @@ -6110,7 +6116,7 @@ const DisplayPartnerSession = (props) => { var url = process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/"; - + setLoading(true); fetch( process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/", { @@ -6120,7 +6126,7 @@ const DisplayPartnerSession = (props) => { ) .then((response) => response.json()) .then((result) => { - + setLoading(false); //console.log(" ## result['status'] = ", result['status']) if (String(result['status']) === String("true")) { //console.log('Success:', result['message']); @@ -6137,6 +6143,7 @@ const DisplayPartnerSession = (props) => { }) .catch((error) => { + setLoading(false); console.error(' Record_All_PJ Error:', error); setDelete_one_attached_document_api("false"); alert(" Impossible de supprimer le document") @@ -6464,9 +6471,9 @@ const DisplayPartnerSession = (props) => { form.append("object_name", local_collection_obj_metier); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Object_Specific_Valide_Displayed_Fields/"; - + setLoading(true); axios.post(myurl, form).then(res => { - + setLoading(false); if (String(res.data.status) === String("true")) { //console.log(" In Get_Partner_Object_Specific_Fields res.data.status = " + res.data.status); //console.log(" In Get_Partner_Object_Specific_Fields res.data.message r_class = " + res.data.message); @@ -6486,6 +6493,7 @@ const DisplayPartnerSession = (props) => { } }).catch((error) => { + setLoading(false); console.warn('Not good man :( Get_Partner_Object_Specific_Fields = ', error); setGet_Partner_Object_Specific_Fields_api("false"); alert(" Impossible de recuperer la liste des collection et champs personnalisables"); @@ -6581,9 +6589,9 @@ const DisplayPartnerSession = (props) => { form.append("object_name", "inscription"); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Object_Specific_Valide_Displayed_Fields/"; - + setLoading(true); axios.post(myurl, form).then(res => { - + setLoading(false); if (String(res.data.status) === String("true")) { //console.log(" In Get_Partner_Object_Specific_Fields res.data.status = " + res.data.status); //console.log(" In Get_Partner_Object_Specific_Fields res.data.message r_class = " + res.data.message); @@ -6603,6 +6611,7 @@ const DisplayPartnerSession = (props) => { } }).catch((error) => { + setLoading(false); console.warn('Not good man :( Get_Partner_Object_Specific_Fields = ', error); setGet_Partner_Object_Specific_Fields_stagiaire_api("false"); alert(" Impossible de recuperer la liste des collection et champs personnalisables"); @@ -7792,10 +7801,12 @@ const DisplayPartnerSession = (props) => { //form.append("inscription_id", selected_id); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Conventions_Stagiaire/"; + setLoading(true); axios.post(myurl, form).then(res => { - + setLoading(false); if (String(res.data.status) === String("true")) { + //console.log(" In Get_List_Stagiaire_Conventions res.data.status = " + res.data.status); //console.log(" In Get_List_Stagiaire_Conventions res.data.message r_class = " + res.data.message); setGet_List_Stagiaire_Conventions_api("true"); @@ -7870,6 +7881,7 @@ const DisplayPartnerSession = (props) => { } }).catch((error) => { + setLoading(false); console.warn('Not good man :( Get_List_Stagiaire_Conventions = ', error); setGet_List_Stagiaire_Conventions_api("false"); alert("Impossible de récupérer les modèles de convention"); @@ -7947,7 +7959,7 @@ const DisplayPartnerSession = (props) => { var url = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_PDF/" + stored_cookie + "/" + selected_session_id + "/" + selected_convention_id; - + if (String(selected_convention_id) === "default_pdf") { // Il s'agit d'envoyer les convention par defaut de type mail @@ -8637,7 +8649,7 @@ const DisplayPartnerSession = (props) => { MySy Information - +
Choisir une convention @@ -8653,7 +8665,7 @@ const DisplayPartnerSession = (props) => { if (value && value._id) { setselected_convention_id(value._id); - + if (String(value._id) === "default_mail") { setselected_convention_type("email"); } @@ -8663,7 +8675,7 @@ const DisplayPartnerSession = (props) => { var result2 = Get_List_Stagiaire_Conventions_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(value._id)) setselected_convention_type(JSON.parse(result2).type_doc); - + } settab_convention_pieces_jointes_result([]); } @@ -11435,6 +11447,29 @@ const DisplayPartnerSession = (props) => { {String(addOneParticipant) === "1" &&
Ajout d'un nouveau participant à la session {selected_code_session} de la formation {selected_class_title}
+
Civilité
+ setp_one_civilite_part(e.target.value)} + + > + Mme.   + M.   + Neutre   + + + +
+
Nom
{
-
Client
- Client
+ { + if (value && value._id) { + setp_one_detail_client_rattachement_id(value._id); + setp_one_detail_client_rattachement_nom(value.nom); + + } + }} value={p_one_detail_client_rattachement_nom} - onChange={(e) => { - setp_one_detail_client_rattachement_id(e.target.value); - setp_one_detail_client_rattachement_nom(e.target.value); + renderInput={(params) => } - } - - > - -    - - {Get_List_Partner_Clients_result && - Get_List_Partner_Clients_result.map((myclient) => ( - - {JSON.parse(myclient).nom}   - - - ))} - - + />
Type apprenant
@@ -11691,6 +11712,7 @@ const DisplayPartnerSession = (props) => { amount: JSON.parse(item).price, opco: JSON.parse(item).opco, modefinancement: JSON.parse(item).modefinancement, + civilite: JSON.parse(item).civilite, } @@ -11821,6 +11843,30 @@ const DisplayPartnerSession = (props) => { {String(addOneParticipant) === "1" &&
Ajout d'un nouveau participant
+
Civilité
+ setp_one_civilite_part(e.target.value)} + + > + Mme.   + M.   + Neutre   + + + +
+ +
Nom
{ {String(addOneParticipant) === "1" &&
Ajout d'un nouveau participant a la session {selected_code_session} de la formation {selected_class_title}
+
Civilité
+ setp_one_civilite_part(e.target.value)} + + > + Mme.   + M.   + Neutre   + + + +
+ +
Nom
{
Client
- { + if (value && value._id) { + setp_one_detail_client_rattachement_id(value._id); + setp_one_detail_client_rattachement_nom(value.nom); + + } + }} value={p_one_detail_client_rattachement_nom} - onChange={(e) => { - setp_one_detail_client_rattachement_id(e.target.value); - setp_one_detail_client_rattachement_nom(e.target.value); + renderInput={(params) => } - } - - > - -    - - {Get_List_Partner_Clients_result && - Get_List_Partner_Clients_result.map((myclient) => ( - - {JSON.parse(myclient).nom}   - - - ))} - - + />
Type apprenant
@@ -12241,6 +12295,7 @@ const DisplayPartnerSession = (props) => { amount: JSON.parse(item).price, opco: JSON.parse(item).opco, modefinancement: JSON.parse(item).modefinancement, + civilite: JSON.parse(item).civilite, } ))} @@ -12490,36 +12545,28 @@ const DisplayPartnerSession = (props) => { {String(participant_data_edit_mode) === "1" &&
Client
- { + if (value && value._id) { + setp_detail_client_rattachement_id(value._id); + setp_detail_client_rattachement_nom(value.nom); + setparticipant_data_changed("1"); + Dialog_1_handle_change_participant_session(" Attention, vous allez modifier le client de rattachement du participant"); + + + } + }} value={p_detail_client_rattachement_nom} - onChange={(e) => { - 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}   + renderInput={(params) => + } + /> - - ))} -
} {String(participant_data_edit_mode) !== "1" &&
Client
diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js index d93ef77..3e8feec 100644 --- a/src/components/DisplayPartnerStagiaires.js +++ b/src/components/DisplayPartnerStagiaires.js @@ -89,6 +89,7 @@ const DisplayPartnerStagiaires = (props) => { { field: 'id', headerName: 'id', hide: true }, { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, editable: false }, + { field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false }, { field: 'nom', headerName: 'Nom', minWidth: 150, flex: 1, hide: false, editable: false, editable: false }, { field: 'prenom', headerName: 'Prénom', minWidth: 150, flex: 1, hide: false, editable: false }, @@ -583,6 +584,10 @@ const DisplayPartnerStagiaires = (props) => { setDeleteStagiaireData_result(res.data.message); Getall_TrainingParticipant(); + setaddOneParticipant(''); + setdisplay_detail_stagiaire(''); + setselected_code_session(''); + setsubmenu(''); alert(" La mise à jour été correctement faite.") } @@ -1028,6 +1033,11 @@ const DisplayPartnerStagiaires = (props) => { if (document.getElementsByName("detail_session_class") && document.getElementsByName("detail_session_class")[0]) document.getElementsByName("detail_session_class")[0].value = ""; + + if (document.getElementsByName("detail_civilite") && document.getElementsByName("detail_nom")[0]) + document.getElementsByName("detail_civilite")[0].value = ""; + + if (document.getElementsByName("detail_nom") && document.getElementsByName("detail_nom")[0]) document.getElementsByName("detail_nom")[0].value = ""; @@ -1076,6 +1086,7 @@ const DisplayPartnerStagiaires = (props) => { if (document.getElementsByName("certif_date") && document.getElementsByName("certif_date")[0]) document.getElementsByName("certif_date")[0].value = ""; + setp_detail_civilite(); setp_detail_nom(); setp_detail_prenom(); setp_detail_mail(); @@ -1448,6 +1459,11 @@ const DisplayPartnerStagiaires = (props) => { } + if (document.getElementsByName("detail_civilite")[0]) { + document.getElementsByName("detail_civilite")[0].disabled = true; + document.getElementsByName("detail_civilite")[0].style.backgroundColor = "#ECEFF1"; + } + if (document.getElementsByName("detail_nom")[0]) { document.getElementsByName("detail_nom")[0].disabled = true; document.getElementsByName("detail_nom")[0].style.backgroundColor = "#ECEFF1"; @@ -2205,7 +2221,7 @@ const DisplayPartnerStagiaires = (props) => { ]; - + const [p_detail_civilite, setp_detail_civilite] = useState(); const [p_detail_nom, setp_detail_nom] = useState(); const [p_detail_prenom, setp_detail_prenom] = useState(); const [p_detail_mail, setp_detail_mail] = useState(); @@ -2257,6 +2273,7 @@ const DisplayPartnerStagiaires = (props) => { //--- + const [p_one_civilite_part, setp_one_civilite_part] = useState(); const [p_one_formation, setp_one_formation] = useState(); const [p_one_detail_session_class, setp_one_detail_session_class] = useState(); const [p_one_nom_part, setp_one_nom_part] = useState(); @@ -2397,9 +2414,16 @@ const DisplayPartnerStagiaires = (props) => { } + if (mylocalattendee.civilite) + setp_detail_civilite(mylocalattendee.civilite); + else + setp_detail_civilite(""); + + if (mylocalattendee.nom) setp_detail_nom(mylocalattendee.nom); + if (mylocalattendee.apprenant_id) setp_detail_apprenant_id(mylocalattendee.apprenant_id); else @@ -2741,7 +2765,12 @@ const DisplayPartnerStagiaires = (props) => { var nb_participant = "0"; var prix_session; + + if (!p_one_civilite_part || p_one_civilite_part.trim() == "") { + alert(" Vous devez saisir la civilité du participant"); + return; + } if (!p_one_nom_part || p_one_nom_part.trim() == "") { alert(" Vous devez saisir le nom du participant"); @@ -2785,11 +2814,17 @@ const DisplayPartnerStagiaires = (props) => { form.append("token", stored_cookie); form.append("class_internal_url", p_one_formation); form.append("session_id", p_one_detail_session_class); + form.append("civilite", p_one_civilite_part.trim()); form.append("nom", p_one_nom_part.trim()); form.append("prenom", p_one_prenom_part.trim()); form.append("email", p_one_email_part.trim()); form.append("telephone", p_one_phone_part.trim()); + if (String(p_one_civilite_part).trim().length == 0) { + alert("La civilité est invalide."); + return; + } + if (String(p_one_nom_part).trim().length < 2) { alert("Le nom est invalide."); return; @@ -2937,30 +2972,38 @@ const DisplayPartnerStagiaires = (props) => { alert(" Vous devez choisir une session"); return; } + const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); form.append("class_internal_url", selected_internal_url); form.append("session_id", p_detail_session_class_id); + form.append("civilite", p_detail_civilite); form.append("nom", p_detail_nom); form.append("prenom", p_detail_prenom); form.append("email", p_detail_mail); form.append("telephone", p_detail_tel); - if (String(p_detail_nom).trim().length < 2) { + if (!p_detail_nom || String(p_detail_nom).trim().length < 2) { alert("Le nom est invalide."); return; } - if (String(p_detail_prenom).trim().length < 2) { + if (!p_detail_prenom || String(p_detail_prenom).trim().length < 2) { alert("Le prenom est invalide."); return; } - if (String(p_detail_tel).trim().length < 2) { + if (!p_detail_civilite || String(p_detail_civilite).trim().length < 2) { + alert("La civilité est invalide."); + return; + } + + if (!p_detail_tel || String(p_detail_tel).trim().length < 2) { alert("Le numéro de téléphone est invalide."); return; } + var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!p_detail_mail.trim().match(validRegex)) { alert("L'adresse email est invalide."); @@ -3134,6 +3177,7 @@ const DisplayPartnerStagiaires = (props) => { + const [New_Get_List_Partner_Clients_result, setNew_Get_List_Partner_Clients_result] = useState([]); const [Get_List_Partner_Clients_api, setGet_List_Partner_Clients_api] = useState(); const [Get_List_Partner_Clients_message, setGet_List_Partner_Clients_message] = useState(); @@ -3155,6 +3199,30 @@ const DisplayPartnerStagiaires = (props) => { if (String(res.data.status) === String("true")) { setGet_List_Partner_Clients_api("true"); setGet_List_Partner_Clients_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_raison_sociale = JSON.parse(x).raison_sociale; + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom, + "nom": local_nom, + "raison_sociale": local_raison_sociale, + + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) + setNew_Get_List_Partner_Clients_result(new_data2); } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -6016,6 +6084,7 @@ const DisplayPartnerStagiaires = (props) => { date_debut: JSON.parse(item).date_du, date_fin: JSON.parse(item).date_au, class_internal_url: JSON.parse(item).class_internal_url, + civilite: JSON.parse(item).civilite, } ))} @@ -6352,6 +6421,33 @@ const DisplayPartnerStagiaires = (props) => {
*/} +
Civilité
+ { + setp_one_civilite_part(e.target.value); + + } + } + + > + Mme.   + M.   + Neutre   + +
+
Nom
{
-
Client
- Client a
+ + { - setp_one_detail_client_rattachement_id(e.target.value); - } + options={New_Get_List_Partner_Clients_result} + onChange={(event, value) => { + if (value && value._id) { + setp_one_detail_client_rattachement_id(value._id); + setp_one_detail_client_rattachement_nom(value.nom); + + } + }} + + renderInput={(params) => } + /> - > - -    - - {Get_List_Partner_Clients_result && - Get_List_Partner_Clients_result.map((myclient) => ( - - {JSON.parse(myclient).nom}   - - - ))} - -
Type apprenant
@@ -6858,36 +6941,30 @@ const DisplayPartnerStagiaires = (props) => { {String(participant_data_edit_mode) === "1" &&
Client
- { + if (value && value._id) { + setp_detail_client_rattachement_id(value._id); + setp_detail_client_rattachement_nom(value.nom); + + setparticipant_data_changed("1"); + Dialog_1_handle_change_participant_session(" Attention, vous allez modifier le client de rattachement du participant"); + + + } }} - disabled={false} - className="disabled_style " value={p_detail_client_rattachement_nom} - onChange={(e) => { - 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}   + renderInput={(params) => + } + /> - - ))} -
} {String(participant_data_edit_mode) !== "1" &&
Client
@@ -7023,6 +7100,52 @@ const DisplayPartnerStagiaires = (props) => {
} + {String(participant_data_edit_mode) === "1" &&
Civilité
+ { + setp_detail_civilite(e.target.value); + setparticipant_data_changed("1"); + } + } + + > + Mme.   + M.   + Neutre   + +
} + + {String(participant_data_edit_mode) !== "1" &&
Civilité
+ + +
} +
Nom
{ {selected_id_status && String(selected_id_status) === "1" && p_detail_apprenant_id && String(p_detail_apprenant_id).trim().length > 3 && } diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index 0a75fc5..3474cb5 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -1226,7 +1226,7 @@ const DistplayPartnerTraningsPage = (props) => {
- } + } {createtraining &&
diff --git a/src/styles/components/_addclassmanual.scss b/src/styles/components/_addclassmanual.scss index 671eaee..ef8b328 100644 --- a/src/styles/components/_addclassmanual.scss +++ b/src/styles/components/_addclassmanual.scss @@ -12,9 +12,9 @@ z-index: 1; top: 0px; opacity: 80%; -} + } -.spinner { + .spinner { width: 20rem; height: 10rem; border: 8px solid; @@ -23,16 +23,16 @@ animation: spin-anim 1.2s linear infinite; background-color: red; color: black; -} + } -.mysy_spinner { + .mysy_spinner { border-radius: 5px; border: 1px solid black; opacity: 100%; -} + } - .css-1d6wzja-MuiButton-startIcon{ + .css-1d6wzja-MuiButton-startIcon { margin-left: 4px !important; } @@ -40,7 +40,7 @@ display: none !important; } - .css-1v4ccyo{ + .css-1v4ccyo { height: 3rem !important; } @@ -107,6 +107,7 @@ color: red; font-style: italic; } + .parter_div_filtrer_row_gauche { float: left; border-width: 0.1rem; @@ -129,7 +130,7 @@ font-size: small; cursor: pointer; } - + .disabled_style { //background-color: #ECEFF1; font-size: medium !important; @@ -164,6 +165,7 @@ .css-7gyl3q-MuiButtonBase-root-MuiButton-root { font-size: small !important; } + .img_class_logo { display: block; width: 128px; @@ -198,6 +200,7 @@ border-radius: 1rem; text-align: left; } + .div_row_droite_image { float: left; //border:0px solid black; @@ -554,6 +557,7 @@ border-radius: 1rem; text-align: left; } + .div_row_droite_image { float: left; //border:0px solid black; @@ -622,6 +626,7 @@ .bton_supprime_image_class:hover { box-shadow: 5px 1px 5px 1px rgb(0 0 0 / 25%); } + .plus_produit_desabled { width: 100% !important; margin-right: 0.1rem !important; @@ -724,7 +729,7 @@ padding-left: 5px; } - .div_row_ch{ + .div_row_ch { width: 100%; display: flex; flex-direction: row; @@ -739,12 +744,12 @@ } - .row_block{ + .row_block { width: 50%; } - - .zone_gestion_admin{ + + .zone_gestion_admin { border-radius: 5rem; font-size: small; text-align: right; @@ -752,10 +757,10 @@ } - .bton_gestion_admin{ + .bton_gestion_admin { border-radius: 5rem; font-size: small; - background: #81BC3A!important; + background: #81BC3A !important; text-align: right; height: 2.5rem; width: 80%; @@ -763,8 +768,8 @@ } - - .zone_retour_liste{ + + .zone_retour_liste { border-radius: 5rem; font-size: small; text-align: left; @@ -772,10 +777,10 @@ } - .bton_retour_list{ + .bton_retour_list { border-radius: 5rem; font-size: small; - background: white!important; + background: white !important; text-align: left; border: solid 1px; height: 2.5rem; @@ -783,7 +788,7 @@ color: black; } - + } @media only screen and (min-width: 992px) and (max-width: 1199px) { @@ -817,7 +822,7 @@ border-radius: 1rem; } - + .div_row_gauche { float: left; @@ -886,6 +891,7 @@ background-color: white; margin-right: 5px; } + .div_gauche { float: left; border: 1px solid black; @@ -969,6 +975,7 @@ border-radius: 1rem; text-align: left; } + .div_row_droite_image { float: left; //border:0px solid black; @@ -1140,7 +1147,7 @@ padding-left: 5px; } - .div_row_ch{ + .div_row_ch { width: 100%; display: flex; flex-direction: row; @@ -1155,12 +1162,12 @@ } - .row_block{ + .row_block { width: 50%; } - - .zone_gestion_admin{ + + .zone_gestion_admin { border-radius: 5rem; font-size: small; text-align: right; @@ -1168,10 +1175,10 @@ } - .bton_gestion_admin{ + .bton_gestion_admin { border-radius: 5rem; font-size: small; - background: #81BC3A!important; + background: #81BC3A !important; text-align: right; height: 2.5rem; width: 60%; @@ -1179,8 +1186,8 @@ } - - .zone_retour_liste{ + + .zone_retour_liste { border-radius: 5rem; font-size: small; text-align: left; @@ -1188,10 +1195,10 @@ } - .bton_retour_list{ + .bton_retour_list { border-radius: 5rem; font-size: small; - background: white!important; + background: white !important; text-align: left; border: solid 1px; height: 2.5rem; @@ -1199,7 +1206,7 @@ color: black; } - + } @media only screen and (min-width: 1200px) { @@ -1241,6 +1248,7 @@ border-radius: 1rem; text-align: left; } + .div_row_droite { float: right; //border:0px solid black; @@ -1387,6 +1395,7 @@ border-radius: 1rem; text-align: left; } + .div_row_droite_image { float: left; //border:0px solid black; @@ -1397,7 +1406,7 @@ font-size: small; padding-left: 0.2rem; } - + .bton_suppr2 { background: transparent; color: red; @@ -1406,7 +1415,7 @@ text-align: center; height: 2.5rem; width: 50%; - } + } .bton_enreg2 { border-radius: 5rem; @@ -1538,7 +1547,7 @@ margin-bottom: 10px; padding-top: 10px; padding-bottom: 10px; - } + } .training_caract { width: 30%; @@ -1561,7 +1570,7 @@ padding-left: 5px; } - .div_row_ch{ + .div_row_ch { width: 100%; display: flex; flex-direction: row; @@ -1576,12 +1585,12 @@ } - .row_block{ + .row_block { width: 50%; } - - .zone_gestion_admin{ + + .zone_gestion_admin { border-radius: 5rem; font-size: small; text-align: right; @@ -1589,10 +1598,10 @@ } - .bton_gestion_admin{ + .bton_gestion_admin { border-radius: 5rem; font-size: small; - background: #81BC3A!important; + background: #81BC3A !important; text-align: right; height: 2.5rem; width: 50%; @@ -1600,8 +1609,8 @@ } - - .zone_retour_liste{ + + .zone_retour_liste { border-radius: 5rem; font-size: small; text-align: left; @@ -1609,10 +1618,10 @@ } - .bton_retour_list{ + .bton_retour_list { border-radius: 5rem; font-size: small; - background: white!important; + background: white !important; text-align: left; border: solid 1px; height: 2.5rem; @@ -1620,7 +1629,16 @@ color: black; } - + + } + + .MuiOutlinedInput-root { + height: 3rem !important; + } + + .MuiAutocomplete-input { + height: 2rem !important; + padding: 0px !important; } // - end media @@ -1629,7 +1647,7 @@ .MuiMenuItem-root { color: black !important; } -.mce-content-body{ - line-height: 1.2rem !important; -} +.mce-content-body { + line-height: 1.2rem !important; +} \ No newline at end of file