From 49334cee17f7c34e4846d6b8d80037a80c6acc57 Mon Sep 17 00:00:00 2001 From: cherif Date: Sun, 17 Dec 2023 21:06:45 +0100 Subject: [PATCH] 17/12/2023 - 21h12 --- src/components/AddPartnerClient.js | 120 ++++++---- src/components/Config_Document.js | 120 ++++++---- src/components/DisplayPartnerSession.js | 173 +++++++++++---- src/components/DisplayPartnerStagiaires.js | 234 ++++++++++++++++---- src/styles/components/_config_document.scss | 4 + 5 files changed, 466 insertions(+), 185 deletions(-) diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js index b9bab62..52e5fb3 100644 --- a/src/components/AddPartnerClient.js +++ b/src/components/AddPartnerClient.js @@ -1200,6 +1200,13 @@ const AddParnerClient = (props) => { if (document.getElementsByName("client_email")) { client_email = document.getElementsByName("client_email")[0].value; } + var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; + + if (!client_email.match(validRegex)) { + alert("L'adresse email est invalide."); + return; + } + form.append("email", client_email); @@ -1208,6 +1215,11 @@ const AddParnerClient = (props) => { client_nom = document.getElementsByName("client_nom")[0].value; } form.append("nom", client_nom); + if (String(client_nom).trim() === "") { + alert("Le nom du client est invalide."); + return; + } + var client_raison_sociale = "" if (document.getElementsByName("client_raison_sociale")) { @@ -1332,6 +1344,12 @@ const AddParnerClient = (props) => { if (document.getElementsByName("client_email")) { client_email = document.getElementsByName("client_email")[0].value; } + var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; + if (!client_email.match(validRegex)) { + alert("L'adresse email est invalide."); + return; + } + form.append("email", client_email); @@ -1339,6 +1357,11 @@ const AddParnerClient = (props) => { if (document.getElementsByName("client_nom")) { client_nom = document.getElementsByName("client_nom")[0].value; } + if (String(client_nom).trim() === "") { + alert("Le nom du client est invalide."); + return; + } + form.append("nom", client_nom); var client_raison_sociale = "" @@ -2151,25 +2174,23 @@ const AddParnerClient = (props) => { -
- Email
+ + +
Raison sociale
setclient_email(e.target.value)} - + value={p_client_raison_sociale} + onChange={(e) => setclient_raison_sociale(e.target.value)} />
- - -
Nom
+
Nom
{
-
Raison sociale
- setclient_raison_sociale(e.target.value)} - /> -
+
Type client
{ />
-
N° TVA
+
N° TVA
{ />
+
+ Email
+ setclient_email(e.target.value)} + + /> +
Adresse
{ {String(submenu).trim() === "submenu_donnee_client" &&
-
Email
+ +
Raison sociale
setclient_email(e.target.value)} - + value={p_client_raison_sociale} + onChange={(e) => setclient_raison_sociale(e.target.value)} />
-
Nom
+
Nom
{
-
Raison sociale
- setclient_raison_sociale(e.target.value)} - /> -
- + {String(formedit_mode) !== "1" &&
Type client
{ />
+
Email
+ setclient_email(e.target.value)} + + /> +
+
Adresse
{ const history = useHistory(); @@ -75,14 +77,14 @@ const Config_Documents = (props) => { const columns = [ { field: '_id', headerName: '_id', hide: true }, { field: 'id', headerName: 'id', hide: true }, - { field: 'nom', headerName: 'nom', hideable: false, minWidth: 150, flex:1, }, - { field: 'ref_interne', headerName: 'ref_interne', hideable: false, minWidth: 50, maxWidth :200,flex:1, }, - { field: 'type_doc', headerName: 'type_doc', minWidth: 50, maxWidth :100,flex:1, hideable: false, }, - { field: 'cible', headerName: 'cible', minWidth: 100, maxWidth :150,flex:1, hide: false, editable: false }, - { field: 'default', headerName: 'par default', minWidth: 100, maxWidth :100,flex:1, hide: false, editable: false }, - { field: 'sujet', headerName: 'sujet', hide: false, editable: false, minWidth: 150,flex:1, }, + { field: 'nom', headerName: 'nom', hideable: false, minWidth: 150, flex: 1, }, + { field: 'ref_interne', headerName: 'ref_interne', hideable: false, minWidth: 50, maxWidth: 200, flex: 1, }, + { field: 'type_doc', headerName: 'type_doc', minWidth: 50, maxWidth: 100, flex: 1, hideable: false, }, + { field: 'cible', headerName: 'cible', minWidth: 100, maxWidth: 150, flex: 1, hide: false, editable: false }, + { field: 'default', headerName: 'par default', minWidth: 100, maxWidth: 100, flex: 1, hide: false, editable: false }, + { field: 'sujet', headerName: 'sujet', hide: false, editable: false, minWidth: 150, flex: 1, }, { - field: 'duplicate', headerName: 'Dupliquer', hide: false, editable: false, minWidth: 50, maxWidth :100,flex:1, + field: 'duplicate', headerName: 'Dupliquer', hide: false, editable: false, minWidth: 50, maxWidth: 100, flex: 1, renderCell: (cellValues) => { return ( @@ -858,21 +860,26 @@ const Config_Documents = (props) => { const [p_collection, setp_collection] = useState(); function add_selected_fields() { - if( String(partner_document_data_edit_mode) === "1" ){ + if(!p_champ_table || String(p_champ_table) === "undefined"){ + alert(" vous devez choisir un champ "); + return; + } + + if (String(partner_document_data_edit_mode) === "1") { // Cas d'un update - if( document_principal_ou_corp_mail && String(document_principal_ou_corp_mail) == "2"){ + if (document_principal_ou_corp_mail && String(document_principal_ou_corp_mail) == "2") { one_editorRef_corp_mail.current.insertContent(String(p_champ_table)); - }else{ - one_editorRef_programme.current.insertContent(String(p_champ_table)); + } else { + one_editorRef_programme.current.insertContent(String(p_champ_table)); } - }else if( String(display_add_one_document) === "1" ){ + } else if (String(display_add_one_document) === "1") { // Cas de la creation d'un nouveau document - if( document_principal_ou_corp_mail && String(document_principal_ou_corp_mail) == "2"){ + if (document_principal_ou_corp_mail && String(document_principal_ou_corp_mail) == "2") { one_editorRef_corp_mail.current.insertContent(String(p_champ_table)); - }else{ - one_editorRef_programme.current.insertContent(String(p_champ_table)); + } else { + one_editorRef_programme.current.insertContent(String(p_champ_table)); } } @@ -1117,7 +1124,7 @@ const Config_Documents = (props) => { setAdd_one_Partner_Document_api("true"); setAdd_one_Partner_Document_result(res.data.message); - + clear_one_detail_fields(); setadd_one_document(); setdisplay_add_one_document(); @@ -1146,6 +1153,9 @@ const Config_Documents = (props) => { } + const [New_Get_Given_Personnalisable_Collection_and_Fields_result, setNew_Get_Given_Personnalisable_Collection_and_Fields_result] = useState([]); + + const [Get_Given_Personnalisable_Collection_and_Fields_api, setGet_Given_Personnalisable_Collection_and_Fields_api] = useState(); const [Get_Given_Personnalisable_Collection_and_Fields_message, setGet_Given_Personnalisable_Collection_and_Fields_message] = useState(); const [Get_Given_Personnalisable_Collection_and_Fields_result, setGet_Given_Personnalisable_Collection_and_Fields_result] = useState(); @@ -1172,6 +1182,30 @@ const Config_Documents = (props) => { setGet_Given_Personnalisable_Collection_and_Fields_api("true"); setGet_Given_Personnalisable_Collection_and_Fields_result(res.data.message); + const new_data = res.data.message.map((x) => { + + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + + //--- + var local_courrier_template_ref_interne = JSON.parse(x).courrier_template_ref_interne; + var local_nom_champ_technique = JSON.parse(x).nom_champ_technique; + var local_nom_champ_fonctionel = JSON.parse(x).nom_champ_fonctionel; + + //--- + return { + "id": localid, "_id": String(local_id), "label": local_nom_champ_fonctionel, "courrier_template_ref_interne": local_courrier_template_ref_interne, + "nom_champ_technique": local_nom_champ_technique, "nom_champ_fonctionel": local_nom_champ_fonctionel + } + + // return {"_id": " + str(local_id) + ", "label": " + local_courrier_template_ref_interne + '" , "courrier_template_ref_interne": "' + local_courrier_template_ref_interne + '", "nom_champ_technique": "' + local_nom_champ_technique + '", "nom_champ_fonctionel": "' + local_nom_champ_fonctionel + '","valide": "1" }; + + }); + + setNew_Get_Given_Personnalisable_Collection_and_Fields_result(new_data); + + + } else { setGet_Given_Personnalisable_Collection_and_Fields_api("false"); @@ -1594,6 +1628,8 @@ const Config_Documents = (props) => { clear_one_detail_fields(); setadd_one_document(); setdisplay_add_one_document(); + setp_champ_table(""); + } @@ -2576,45 +2612,31 @@ const Config_Documents = (props) => {
{String(partner_document_data_edit_mode) === "1" && -
Choisir un champ
- { - setp_champ_table(e.target.value); - }} - > + { + setp_champ_table(value.nom_champ_technique); + }} - {Get_Given_Personnalisable_Collection_and_Fields_result && - Get_Given_Personnalisable_Collection_and_Fields_result.filter((local_mymanager) => JSON.parse(local_mymanager).courrier_template_ref_interne === p_detail_ref_interne).map((mycollection) => ( - - {JSON.parse(mycollection).nom_champ_fonctionel}   + + renderInput={(params) => + } + /> + } - - ))} - + {String(partner_document_data_edit_mode) === "1" && +
+
} - {String(partner_document_data_edit_mode) === "1" && -
- -
} -
+ {p_detail_type_doc && String(p_detail_type_doc).toLocaleLowerCase() === "email" &&
@@ -3114,7 +3136,7 @@ const Config_Documents = (props) => {
- {String(p_one_detail_type_doc) === "email" &&
+ {String(p_one_detail_type_doc) === "email" &&
Joindre en PDF
{ const history = useHistory(); @@ -1689,7 +1691,7 @@ const DisplayPartnerSession = (props) => { } } - console.log("4"); + if (document.getElementById('detail_session')) { //myRef.current.scrollIntoView({ behavior: "smooth" }); @@ -1803,9 +1805,9 @@ const DisplayPartnerSession = (props) => { form.append("status", "1"); /* - -/!\ : Cette fonction a besoin d'un token actif -*/ + + /!\ : Cette fonction a besoin d'un token actif + */ if (String(stored_cookie) === String("")) { alert(" La session n'est plus valide "); @@ -1987,7 +1989,7 @@ const DisplayPartnerSession = (props) => { //console.log(" ### localsessionid = ", localsessionid, " -- class_internal_url = ", class_internal_url); /* - + /!\ : Cette fonction a besoin d'un token actif */ @@ -2069,7 +2071,7 @@ const DisplayPartnerSession = (props) => { if (one_prenom_part.trim() == "") { - alert(" Vous devez saisir le prenom du participant"); + alert(" Vous devez saisir le prénom du participant"); return; } @@ -2602,6 +2604,29 @@ const DisplayPartnerSession = (props) => { 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) { + alert("Le nom est invalide."); + return; + } + + if (String(p_detail_prenom).trim().length < 2) { + alert("Le prénom est invalide."); + return; + } + + if (String(p_detail_tel).trim().length < 2) { + alert("Le Téléphone est invalide."); + return; + } + + var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; + if (!p_detail_mail.match(validRegex)) { + alert("L'adresse email est invalide."); + return; + } + if (p_detail_employeur) form.append("employeur", p_detail_employeur); @@ -2627,14 +2652,15 @@ const DisplayPartnerSession = (props) => { form.append("opco", ""); form.append("_id", selected_inscription_id); - if (p_detail_client_rattachement_nom) + + if (p_detail_client_rattachement_id) form.append("client_rattachement_id", p_detail_client_rattachement_id); else form.append("client_rattachement_id", ""); /* -Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenaire -*/ + Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenaire + */ for (let i = 0; i < spec_field_updated_values_hooks_stagiaire.length; i++) { var local_value = String(spec_field_updated_values_hooks_stagiaire[i].field_value); @@ -3639,7 +3665,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair /*var formateur = ""; if (document.getElementById("one_formateur") && document.getElementById("one_formateur").value != "") formateur = document.getElementById("one_formateur").value; -*/ + */ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); const stored_cookie = getCookie('tokenmysypart'); @@ -4266,9 +4292,11 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair } const [SessionendDateInscription, setSessionendDateInscription] = useState(); + const [New_GetCurrentPartnerClass_result, setNew_GetCurrentPartnerClass_result] = useState([]); + const [GetCurrentPartnerClass_api, setGetCurrentPartnerClass_api] = useState(); const [GetCurrentPartnerClass_message, setGetCurrentPartnerClass_message] = useState(); - const [GetCurrentPartnerClass_result, setGetCurrentPartnerClass_result] = useState(); + const [GetCurrentPartnerClass_result, setGetCurrentPartnerClass_result] = useState([]); function GetCurrentPartnerClass(event) { var form = new FormData(); @@ -4308,10 +4336,38 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair if (String(res.data.status) === String("true")) { //console.log(" In GetCurrentPartnerClass res.data.status = " + res.data.status); - //console.log(" In GetCurrentPartnerClass res.data.message r_class = " + res.data.message); + console.log(" In GetCurrentPartnerClass res.data.message r_class = " + res.data.message); setGetCurrentPartnerClass_api("true"); setGetCurrentPartnerClass_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_internal_url = JSON.parse(x).internal_url; + var local_title = JSON.parse(x).title; + + + //--- + var node = { + "_id": local_id, "id": localid, + "label": local_title, "internal_url": local_internal_url, + "title": local_title + }; + new_data2.push(node); + + // return {"_id": " + str(local_id) + ", "label": " + local_courrier_template_ref_interne + '" , "courrier_template_ref_interne": "' + local_courrier_template_ref_interne + '", "nom_champ_technique": "' + local_nom_champ_technique + '", "nom_champ_fonctionel": "' + local_nom_champ_fonctionel + '","valide": "1" }; + + }); + + + if (new_data2.length > 0) + setNew_GetCurrentPartnerClass_result(new_data2); + } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -4348,11 +4404,11 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair /* -# status : 0 ==> Preinscription -# status : 1 ==> Inscription validée -# status : -1 ==> Inscription annulée -""" -*/ + # status : 0 ==> Preinscription + # status : 1 ==> Inscription validée + # status : -1 ==> Inscription annulée + """ + */ function handleClick_accept(event, cellValues) { var montant = String(cellValues.row.amount); @@ -6298,12 +6354,12 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair 1 - Récuperer la liste des champs specifiques de la collection concernée - Array : list_nom_champs_spec 2 - Récupérer les caracteristiques de champs champs spécifique : "id, nom, label, type valeur, etc" - avec un champ 'value' à vide. Mettre dans le tableau JSON, 'spec_champs_valeur' - + 3 - Créer une nouvelle table qui permettra de gerer les hook : const [rows_champs_specifics, setrows_champs_specifics] = useState([]); 4 - Afficher en html les elements 'rows_champs_specifics' 5 - Gerer la modification avec la fonction 'change_champs_spec_handle' 6 - On recuperer les valeur lors du click d'enregistrement. - + */ @@ -7154,7 +7210,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair form.append("session_id", localsessionid); /* - + /!\ : Cette fonction a besoin d'un token actif */ @@ -7796,9 +7852,17 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair } //form.append("File", list_files); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_Email/"; + + if (String(selected_convention_id) === "default_mail") { + // Il s'agit d'envoyer les convention par defaut de type mail + myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Default_Convention_From_Session_By_Email/"; + } + + setLoading(true); fetch( - process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_Email/", + myurl, { method: 'POST', body: form, @@ -9266,7 +9330,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair setselected_convention_email_test(); ///Get_Stagiaire_List_Email_Com(); setDialog_convention_open(true); - }} >Editer une convention
+ }} > Editer une convention
@@ -10134,7 +10198,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair {String(addOneSession) === "1" &&
Ajout d'une session de formation
-
Choisir une formation *
+ {/*
Choisir une formation *
+
*/} + +
Choisir une formation
+ + { + // setp_champ_table(value.nom_champ_technique); + setone_selected_internal_url(value.internal_url); + setp_one_myclass_title(value.internal_url) + Get_Class_Data(value.internal_url); + }} + + + renderInput={(params) => + } + /> +
-
Code Session *
+
Code Session
Ajout d'un nouveau participant à la session {selected_code_session} de la formation {selected_class_title}
-
Nom *
+
Nom
-
Prenom *
+
Prenom
-
Email *
+
Email
-
téléphone *
+
téléphone
Ajout d'un nouveau participant
-
Nom *
+
Nom
-
Prenom *
+
Prénom
-
Email *
+
Email
-
téléphone *
+
Téléphone
-
Statut Inscription ss*
+
Statut Inscription
Ajout d'un nouveau participant a la session {selected_code_session} de la formation {selected_class_title}
-
Nom *
+
Nom
-
Prenom *
+
Prénom
-
Email *
+
Email
-
téléphone *
+
Téléphone
{ - //setp_detail_client_rattachement_id(e.target.value); - setp_detail_client_rattachement_nom(e.target.value); + 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"); } @@ -12299,7 +12384,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
} -
Nom
+
Nom
-
Prenom
+
Prénom
-
Email
+
Email
-
Téléphone
+
Téléphone
{ const history = useHistory(); @@ -1032,7 +1034,7 @@ const DisplayPartnerStagiaires = (props) => { setp_detail_client_rattachement_nom(); setp_detail_client_rattachement_id(); - setp_detail_type_apprenant(); + setp_detail_type_apprenant(); setp_detail_type_apprenant_label(); setfield_evaluation(); @@ -1073,7 +1075,7 @@ const DisplayPartnerStagiaires = (props) => { if (document.getElementsByName("one_pays_part") && document.getElementsByName("one_pays_part")[0]) document.getElementsByName("one_pays_part")[0].value = ""; - if (document.getElementsByName("one_detail_type_apprenant") && document.getElementsByName("one_pays_part")[0]) + if (document.getElementsByName("one_detail_type_apprenant") && document.getElementsByName("one_pays_part")[0]) document.getElementsByName("one_detail_type_apprenant")[0].value = ""; if (document.getElementsByName("one_status_part") && document.getElementsByName("one_status_part")[0]) @@ -1969,7 +1971,7 @@ const DisplayPartnerStagiaires = (props) => { } - + const [New_Getall_TrainingSession_result, setNew_Getall_TrainingSession_result] = useState(); const [Getall_TrainingSession_api, setGetall_TrainingSession_api] = useState(); const [Getall_TrainingSession_message, setGetall_TrainingSession_message] = useState(); @@ -1987,10 +1989,41 @@ const DisplayPartnerStagiaires = (props) => { if (String(res.data.status) === String("true")) { //console.log(" In Getall_TrainingSession res.data.status = " + res.data.status); - //console.log(" In Getall_TrainingSession res.data.message r_class = " + res.data.message); + console.log(" In Getall_TrainingSession res.data.message r_class = " + res.data.message); setGetall_TrainingSession_api("true"); setGetall_TrainingSession_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_internal_url = JSON.parse(x).internal_url; + var local_title_session = JSON.parse(x).titre; + var local_code_session = JSON.parse(x).code_session; + + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_code_session, + "class_internal_url": local_internal_url, + "titre": local_title_session + }; + new_data2.push(node); + + // return {"_id": " + str(local_id) + ", "label": " + local_courrier_template_ref_interne + '" , "courrier_template_ref_interne": "' + local_courrier_template_ref_interne + '", "nom_champ_technique": "' + local_nom_champ_technique + '", "nom_champ_fonctionel": "' + local_nom_champ_fonctionel + '","valide": "1" }; + + }); + + + if (new_data2.length > 0) + setNew_Getall_TrainingSession_result(new_data2); + + } else { setGetall_TrainingSession_api("false"); @@ -2215,7 +2248,7 @@ const DisplayPartnerStagiaires = (props) => { if (mylocalattendee.type_apprenant) { setp_detail_type_apprenant(mylocalattendee.type_apprenant); - // console.log(" ### mylocalattendee.type_apprenant = ", mylocalattendee.type_apprenant); + // console.log(" ### mylocalattendee.type_apprenant = ", mylocalattendee.type_apprenant); if (String(mylocalattendee.type_apprenant) === "0") setp_detail_type_apprenant_label("Autre"); @@ -2635,6 +2668,28 @@ const DisplayPartnerStagiaires = (props) => { form.append("email", p_one_email_part); form.append("telephone", p_one_phone_part); + if (String(p_one_nom_part).trim().length < 2) { + alert("Le nom est invalide."); + return; + } + + if (String(p_one_prenom_part).trim().length < 2) { + alert("Le prenom est invalide."); + return; + } + + if (String(p_one_phone_part).trim().length < 2) { + alert("Le Téléphone est invalide."); + return; + } + + var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; + if (!p_one_email_part.match(validRegex)) { + alert("L'adresse email est invalide."); + return; + } + + if (p_one_adresse_part) form.append("adresse", p_one_adresse_part); else @@ -2772,6 +2827,30 @@ const DisplayPartnerStagiaires = (props) => { 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) { + alert("Le nom est invalide."); + return; + } + + if (String(p_detail_prenom).trim().length < 2) { + alert("Le prenom est invalide."); + return; + } + + if (String(p_detail_tel).trim().length < 2) { + alert("Le Téléphone est invalide."); + return; + } + + var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; + if (!p_detail_mail.match(validRegex)) { + alert("L'adresse email est invalide."); + return; + } + + if (p_detail_employeur) form.append("employeur", p_detail_employeur); @@ -2836,7 +2915,8 @@ const DisplayPartnerStagiaires = (props) => { form.append("_id", selected_id); - if (p_detail_client_rattachement_nom) + + if (p_detail_client_rattachement_id) form.append("client_rattachement_id", p_detail_client_rattachement_id); else form.append("client_rattachement_id", ""); @@ -4153,7 +4233,7 @@ const DisplayPartnerStagiaires = (props) => { else form.append("tuteur1_prenom", ""); - if (p_detail_tuteur1_email && String(p_detail_tuteur2_email).trim() !== "") { + if (p_detail_tuteur1_email && String(p_detail_tuteur1_email).trim() !== "") { var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!p_detail_tuteur1_email.match(validRegex)) { alert("L'adresse email est invalide."); @@ -4828,11 +4908,43 @@ const DisplayPartnerStagiaires = (props) => { />
-
Inclure Communication + {/*
Inclure Communication { setp_detail_tuteur1_include_com(e.target.checked) }} /> -
+
*/} + + + +
+ + + +
+
} @@ -4958,11 +5070,44 @@ const DisplayPartnerStagiaires = (props) => { />
-
Inclure Communication + {/*
Inclure Communication { setp_detail_tuteur2_include_com(e.target.checked) }} /> -
+
*/} + + + +
+ + + +
+
+ } @@ -5093,23 +5238,23 @@ const DisplayPartnerStagiaires = (props) => {
} {String(selected_convention_type) === "email" && @@ -5621,10 +5766,10 @@ const DisplayPartnerStagiaires = (props) => {
-
+
-
+
  @@ -5689,7 +5834,7 @@ const DisplayPartnerStagiaires = (props) => { > { setSelectionModel(newSelectionModel); /*if (newSelectionModel.length === 1) @@ -5913,8 +6058,8 @@ const DisplayPartnerStagiaires = (props) => {
 
- - {( (selected_id && String(selected_id).length > 2) || (String(addOneParticipant) === "1" ) ) &&
+ + {((selected_id && String(selected_id).length > 2) || (String(addOneParticipant) === "1")) &&
@@ -5957,7 +6102,7 @@ const DisplayPartnerStagiaires = (props) => {
-
Session
+
Session
{
- -
Nom *
+
Nom
{
-
Prenom *
+
Prenom
{ />
-
Email *
+
Email
{ />
-
téléphone *
+
Téléphone
{
-
Client
+
Client 2
{
- {String(participant_data_edit_mode) !== "1" &&
Session
+ {String(participant_data_edit_mode) !== "1" &&
Session
{
} - {String(participant_data_edit_mode) === "1" &&
Session
+ {String(participant_data_edit_mode) === "1" &&
Session
{ 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); + 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"); } @@ -6622,7 +6766,7 @@ const DisplayPartnerStagiaires = (props) => {
} -
Nom
+
Nom
{ />
-
Prenom
+
Prenom
{ />
-
Email
+
Email
{ />
-
Téléphone
+
Téléphone
{
-
Téléphone
+
Téléphone
{
-
Téléphone
+
Téléphone