diff --git a/src/App.js b/src/App.js index 380f6b5..6360520 100644 --- a/src/App.js +++ b/src/App.js @@ -109,10 +109,10 @@ function App() { let myurl = window.location.host; let myurl_pathname = window.location.pathname; - // console.log(" ### mysy_domain =", mysy_domain) + // console.log(" ### mysy_domain =", mysy_domain) - // console.log(" ### myurl =", myurl) - // console.log(" ### window.location.hostname =", window.location.hostname) + // console.log(" ### myurl =", myurl) + // console.log(" ### window.location.hostname =", window.location.hostname) var domain = myurl; if (domain.includes('://')) { @@ -262,14 +262,8 @@ function App() { */} - {/*** C'EST TRES TRES CRADE LES 2 LIGNES QUI SUIVENT MAIS C'EST POUR SE DEPANNER EN mode pompier */} - - {String(mysy_domain).length > 5 && String(mysy_domain) !== "colasrail" && } - {String(mysy_domain) === "colasrail" && } - - {/*** FINNN CRADDDDDDDE */} - + {/* Debut Migration */} diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index ee86460..526b5a8 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -98,6 +98,9 @@ const AddClassManual = (props) => { const [mypublished, setmypublished] = useState("0"); const [mypublished_label, setmypublished_label] = useState("-"); + const [mypublished_catalog_prive, setmypublished_catalog_prive] = useState("0"); + const [mypublished_catalog_prive_label, setmypublished_catalog_prive_label] = useState("-"); + const [mytrainingsupport, setmytrainingsupport] = useState("n/a"); const [mytrainingsupport_label, setmytrainingsupport_label] = useState("-"); @@ -1888,6 +1891,21 @@ const AddClassManual = (props) => { setmypublished_label("Non"); } + + if (mylocaltraining.published_catalog_prive) { + + setmypublished_catalog_prive(mylocaltraining.published_catalog_prive); + var result3 = publiee.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.published_catalog_prive))) + if (result3[0]){ + setmypublished_catalog_prive_label(result3[0].label); + } + } + else { + setmypublished_catalog_prive("0"); + setmypublished_catalog_prive_label("Non"); + } + + if (mylocaltraining.cpf) { setmycpf(mylocaltraining.cpf); var result2 = cpf.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.cpf))) @@ -2240,6 +2258,7 @@ const AddClassManual = (props) => { var domaine = mytrainingdomaine; var mypublier = mypublished; + var mypublier_catalog_prive = mypublished_catalog_prive; var niveau_ftion = p_class_level; var price = document.getElementsByName("price")[0].value; var duree = document.getElementsByName("duree")[0].value; @@ -2502,6 +2521,9 @@ const AddClassManual = (props) => { formData.append('note', mynote); formData.append('published', mypublier); + + formData.append('published_catalog_prive', mypublier_catalog_prive); + formData.append('cpf', localmycpf); formData.append('certif', mycertif); @@ -6067,7 +6089,7 @@ const AddClassManual = (props) => { id={(JSON.parse(val).file_name)} onClick={Download_one_attached_document}> Télécharger   - {String(props.check_user_acces_right("formation", "write")) === "1" && Supprimer @@ -6333,7 +6355,38 @@ const AddClassManual = (props) => { } }} - renderInput={(params) => + renderInput={(params) => + } + /> + + + + +
+ + { + if (value && value.value) { + // console.log(" value = ", value); + setmypublished_catalog_prive(value.value); + setmypublished_catalog_prive_label(value.label); + setdatamodification("1"); + + } else { + setmypublished_catalog_prive(""); + setmypublished_catalog_prive_label(""); + setdatamodification("1"); + } + }} + + renderInput={(params) => } /> diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js index e25e0a2..a1f114e 100644 --- a/src/components/AddPartnerClient.js +++ b/src/components/AddPartnerClient.js @@ -113,6 +113,11 @@ const AddParnerClient = (props) => { const [p_client_intranet_account_id, setp_client_intranet_account_id] = useState("0"); const [p_client_type_id, setp_client_type_id] = useState(""); + + const [p_client_goupe_client_id, setp_client_goupe_client_id] = useState(""); + + const [p_client_goupe_client_id_label, setp_client_goupe_client_id_label] = useState(""); + const [p_client_type_label, setp_client_type_label] = useState(""); const [p_client_type_financeur, setp_client_type_financeur] = useState(""); @@ -533,6 +538,82 @@ const AddParnerClient = (props) => { }) } + + const [New_Get_List_Client_Groupe_result, setNew_Get_List_Client_Groupe_result] = useState([]); + + const [Get_List_Client_Groupe_api, setGet_List_Client_Groupe_api] = useState(); + const [Get_List_Client_Groupe_message, setGet_List_Client_Groupe_message] = useState(); + const [Get_List_Client_Groupe_result, setGet_List_Client_Groupe_result] = useState(); + function Get_List_Client_Groupe(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + const related_collection = "partner_client" + + + form.append("token", stored_cookie); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Groupe_Client/"; + + axios.post(myurl, form).then(res => { + //console.log(" In Get_List_Client_Groupe res.data.status = " + res.data.status); + //console.log(" In Get_List_Client_Groupe res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + setGet_List_Client_Groupe_api("true"); + setGet_List_Client_Groupe_result(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_code = JSON.parse(x).code; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_code, + "code": local_code, + + }; + new_data2.push(node); + }); + + //--- + var node = { + "_id": "", + "id": "", + "label": "", + "code": "", + + }; + new_data2.push(node); + if (new_data2.length > 0) + setNew_Get_List_Client_Groupe_result(new_data2); + + } + else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setGet_List_Client_Groupe_api("false"); + setGet_List_Client_Groupe_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( Get_List_Client_Groupe = ', error); + setGet_List_Client_Groupe_api("false"); + alert(" Impossible de récupérer les types de clients"); + }) + } + + const [New_Getall_Partner_Paiement_Condition_result, setNew_Getall_Partner_Paiement_Condition_result] = useState([]); const [Getall_Partner_Paiement_Condition_api, setGetall_Partner_Paiement_Condition_api] = useState(); @@ -619,6 +700,7 @@ const AddParnerClient = (props) => { useEffect(() => { Get_List_Client_Type(); + Get_List_Client_Groupe(); Getall_Partner_Paiement_Condition(); Get_List_Of_All_PJ(props.client_id); Get_List_Type_Financeur(); @@ -752,7 +834,6 @@ const AddParnerClient = (props) => { if (mylocalclient.client_type_id) { - setp_client_type_id(mylocalclient.client_type_id); setp_client_type_label(mylocalclient.client_type_code); } else { @@ -760,6 +841,20 @@ const AddParnerClient = (props) => { setp_client_type_label(""); } + if (mylocalclient.partner_groupe_client_id) { + setp_client_goupe_client_id(mylocalclient.partner_groupe_client_id); + } else { + setp_client_goupe_client_id(""); + + } + + if (mylocalclient.partner_groupe_client_code) { + setp_client_goupe_client_id_label(mylocalclient.partner_groupe_client_code); + } else { + setp_client_goupe_client_id_label(""); + + } + if (mylocalclient.tva) setclient_tva(mylocalclient.tva); else @@ -1208,7 +1303,7 @@ const AddParnerClient = (props) => { } function Disable_fields() { - if (document.getElementsByName("client_email" && document.getElementsByName("client_email")[0])) { + if (document.getElementsByName("client_email") && document.getElementsByName("client_email")[0]) { document.getElementsByName("client_email")[0].disabled = true; document.getElementsByName("client_email")[0].style.backgroundColor = "#ECEFF1"; } @@ -1253,6 +1348,11 @@ const AddParnerClient = (props) => { document.getElementsByName("client_type_id")[0].style.backgroundColor = "#ECEFF1"; } + if (document.getElementsByName("client_groupe_id") && document.getElementsByName("client_groupe_id")[0]) { + document.getElementsByName("client_groupe_id")[0].disabled = true; + document.getElementsByName("client_groupe_id")[0].style.backgroundColor = "#ECEFF1"; + } + if (document.getElementsByName("client_type_financeur_id") && document.getElementsByName("client_type_financeur_id")[0]) { document.getElementsByName("client_type_financeur_id")[0].disabled = true; @@ -1336,6 +1436,11 @@ const AddParnerClient = (props) => { document.getElementsByName("client_type_id")[0].style.backgroundColor = "#FFFFFF"; } + if (document.getElementsByName("client_groupe_id") && document.getElementsByName("client_groupe_id")[0]) { + document.getElementsByName("client_groupe_id")[0].disabled = false; + document.getElementsByName("client_groupe_id")[0].style.backgroundColor = "#FFFFFF"; + } + if (document.getElementsByName("client_type_financeur_id") && document.getElementsByName("client_type_financeur_id")[0]) { document.getElementsByName("client_type_financeur_id")[0].disabled = false; @@ -1621,6 +1726,11 @@ const AddParnerClient = (props) => { else form.append("client_type_id", ""); + if (p_client_goupe_client_id) + form.append("partner_groupe_client_id", p_client_goupe_client_id); + else + form.append("partner_groupe_client_id", ""); + if (String(p_client_is_financeur) === "true") form.append("is_financeur", "1"); else @@ -1713,7 +1823,10 @@ const AddParnerClient = (props) => { } 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."); + // alert("L'adresse email est invalide."); + setdisplay_alert_mysy("1"); + setalert_message("L'adresse email est invalide."); + setalert_type("error"); return; } @@ -1725,7 +1838,10 @@ const AddParnerClient = (props) => { client_nom = document.getElementsByName("client_nom")[0].value; } if (String(client_nom).trim() === "") { - alert("Le nom du client est invalide."); + // alert("Le nom du client est invalide."); + setdisplay_alert_mysy("1"); + setalert_message("Le nom du client est invalide."); + setalert_type("error"); return; } @@ -1800,6 +1916,11 @@ const AddParnerClient = (props) => { else form.append("client_type_id", ""); + if (p_client_goupe_client_id) + form.append("partner_groupe_client_id", p_client_goupe_client_id); + else + form.append("partner_groupe_client_id", ""); + if (String(p_client_is_financeur) === "true") form.append("is_financeur", "1"); @@ -1843,6 +1964,7 @@ const AddParnerClient = (props) => { setalert_type("success"); + } else if (String(res.data.status) === String("Err_Connexion")) { alert('Erreur: ' + res.data.message); @@ -1865,7 +1987,11 @@ const AddParnerClient = (props) => { console.warn('Not good man :( recordPartnerClient = ', error); setrecordPartnerClient_result("false"); setrecordPartnerClient_message(" Impossible de recuperer les informations du client") - alert(" Impossible de recuperer les informations du client"); + // alert(" Impossible de recuperer les informations du client"); + + setdisplay_alert_mysy("1"); + setalert_message("Impossible de recuperer les informations du client"); + setalert_type("error"); }) } @@ -1893,13 +2019,19 @@ const AddParnerClient = (props) => { var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (String(client_invoice_email) === "" || !client_invoice_email.match(validRegex)) { - alert("L'adresse email de facturation est invalide."); + // alert("L'adresse email de facturation est invalide."); + setdisplay_alert_mysy("1"); + setalert_message("L'adresse email de facturation est invalide."); + setalert_type("error"); return; } if (String(p_client_invoice_paiement_condition_id).trim() === "") { - alert(" Vous devez choisir une condition de paiement"); + // alert(" Vous devez choisir une condition de paiement"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez choisir une condition de paiement"); + setalert_type("error"); return; } @@ -1993,7 +2125,10 @@ const AddParnerClient = (props) => { console.warn('Not good man :( recordPartnerClient_Invoice_Data = ', error); setrecordPartnerClient_Invoice_Data_result("false"); setrecordPartnerClient_Invoice_Data_message(" Impossible de recuperer les informations du client") - alert(" Impossible de recuperer les informations du client"); + // alert(" Impossible de recuperer les informations du client"); + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de recuperer les informations du client"); + setalert_type("error"); }) } @@ -2264,7 +2399,11 @@ const AddParnerClient = (props) => { var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!contact_email.match(validRegex)) { - alert("L'adresse email est invalide. Pour créer un contact l'adresse email est obligatoire"); + // alert("L'adresse email est invalide. Pour créer un contact l'adresse email est obligatoire"); + setdisplay_alert_mysy("1"); + setalert_message("L'adresse email est invalide. Pour créer un contact l'adresse email est obligatoire"); + setalert_type("error"); + return; } @@ -2276,7 +2415,11 @@ const AddParnerClient = (props) => { } form.append("nom", contact_nom); if (contact_nom.length < 2) { - alert("Le nom du contact est invalide "); + // alert("Le nom du contact est invalide "); + setdisplay_alert_mysy("1"); + setalert_message("Le nom du contact est invalide "); + setalert_type("error"); + return; } @@ -2401,7 +2544,11 @@ const AddParnerClient = (props) => { console.warn('Not good man :( recordPartnerClient_Contact_Data = ', error); setrecordPartnerClient_Contact_Data_result("false"); setrecordPartnerClient_Contact_Data_message(" Impossible d'enregistrer les doonées du contact") - alert(" Impossible d'enregistrer les doonées du contact"); + // alert(" Impossible d'enregistrer les doonées du contact"); + setdisplay_alert_mysy("1"); + setalert_message(" Impossible d'enregistrer les doonées du contact"); + setalert_type("error"); + }) } @@ -2703,8 +2850,12 @@ const AddParnerClient = (props) => { 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"); - console.log("Le fichier ne doit pas depasser un 1 Méga octets"); + // alert("Le fichier ne doit pas depasser un 1 Méga octets"); + setdisplay_alert_mysy("1"); + setalert_message("Le fichier ne doit pas depasser un 1 Méga octets"); + setalert_type("error"); + + // console.log("Le fichier ne doit pas depasser un 1 Méga octets"); return; } @@ -2739,8 +2890,12 @@ const AddParnerClient = (props) => { 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"); - console.log("Le fichier ne doit pas depasser un 1 Méga octets"); + // alert("Le fichier ne doit pas depasser un 1 Méga octets"); + setdisplay_alert_mysy("1"); + setalert_message("Le fichier ne doit pas depasser un 1 Méga octets"); + setalert_type("error"); + + // console.log("Le fichier ne doit pas depasser un 1 Méga octets"); return; } @@ -2792,7 +2947,11 @@ const AddParnerClient = (props) => { function Record_All_PJ() { if (!p_detail_one_file_to_download_type_name) { - alert(" Vous devez donner un nom à la pièce jointe"); + // alert(" Vous devez donner un nom à la pièce jointe"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez donner un nom à la pièce jointe"); + setalert_type("error"); + return; } @@ -3173,13 +3332,21 @@ const AddParnerClient = (props) => { if (p_new_pwd.trim() == "") { - alert(" Vous devez saisir un mot de passe"); + // alert(" Vous devez saisir un mot de passe"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez saisir un mot de passe"); + setalert_type("error"); + return; } if (p_conf_new_login.trim() == "") { - alert(" Vous devez confirmer le mot de passe"); + // alert(" Vous devez confirmer le mot de passe"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez confirmer le mot de passe"); + setalert_type("error"); + return; } @@ -3207,8 +3374,6 @@ const AddParnerClient = (props) => { myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Pwd_Partner_Client_Intranet_Account/"; // console.log(" ### mise à jour INTRANET "); - } else { - console.log(" ### creation INTRANET "); } setLoading(true); @@ -3545,6 +3710,35 @@ const AddParnerClient = (props) => {
+
Groupe client
+ { + if (value && value._id) { + setp_client_goupe_client_id(value._id); + + } else { + setp_client_goupe_client_id(""); + } + }} + //value={p_one_detail_client_rattachement_nom} + + renderInput={(params) => + } + /> + + +
+ + + {p_client_is_financeur === true &&
Type Financeur
{
 
} + + {String(formedit_mode) !== "1" &&
Groupe client
+ +
} + + {String(formedit_mode) !== "1" && p_client_is_financeur === true && New_Get_List_Type_Financeur_result && New_Get_List_Type_Financeur_result.length > 1 &&
Type Financeur
{ onChange={(event, value) => { if (value && value._id) { setp_client_type_id(value._id); + DataUpdated(); + } else { + setp_client_type_id(""); + DataUpdated(); + } + }} + + renderInput={(params) => + } + /> + +
} + + {New_Get_List_Client_Groupe_result && New_Get_List_Client_Groupe_result.length > 0 && + String(formedit_mode) === "1" &&
Groupe client
+ (data)._id === String(p_client_goupe_client_id))[0].label} + + onChange={(event, value) => { + if (value && value._id) { + setp_client_goupe_client_id(value._id); + setp_client_goupe_client_id_label(New_Get_List_Client_Groupe_result.filter((data) => (data)._id === String(p_client_goupe_client_id))[0].label) DataUpdated(); + } else { + setp_client_goupe_client_id(""); + DataUpdated(); + setp_client_goupe_client_id_label(""); } }} @@ -4671,7 +4917,7 @@ const AddParnerClient = (props) => { {String(submenu).trim() === "submenu_contact" &&
{String(addcontact) !== "1" &&
- {String(props.check_user_acces_right("client", "write")) === "1" &&
Ajouter un contact
} + {String(props.check_user_acces_right("client", "write")) === "1" &&
Ajouter un contact
}
@@ -4698,7 +4944,7 @@ const AddParnerClient = (props) => { - {String(props.check_user_acces_right("client", "write")) === "1" && - {String(props.check_user_acces_right("client", "write")) === "1" && Supprimer diff --git a/src/components/DisplayPartnerPromotion.js b/src/components/DisplayPartnerPromotion.js index 1c4e99a..2cd0118 100644 --- a/src/components/DisplayPartnerPromotion.js +++ b/src/components/DisplayPartnerPromotion.js @@ -730,8 +730,8 @@ const DisplayPartnerPromotion = (props) => { { field: 'nom', headerName: 'nom', minWidth: 200, flex: 1, hide: false, editable: true, renderCell: (params) => , }, { field: 'prenom', headerName: 'prenom', minWidth: 200, flex: 1, hide: false, editable: true, renderCell: (params) => , }, { field: 'email', headerName: 'email', minWidth: 200, flex: 1, flex: 1, renderCell: (params) => , }, - { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => , }, - { field: 'client_rattachement_id', headerName: 'Client_id', Width: 0, hide: true, editable: true, }, + { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'client_rattachement_id', headerName: 'Client_id', Width: 0, hide: true, editable: false, }, { field: 'client_facture', headerName: 'Client Fact.', minWidth: 200, flex: 1, hide: false, editable: false, @@ -749,9 +749,9 @@ const DisplayPartnerPromotion = (props) => { }, { field: 'employeur', headerName: 'Employeur', minWidth: 150, flex: 1, maxWidth: 200, hide: true, editable: true, renderCell: (params) => , }, - { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: true }, + { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: false }, { - field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: true, + field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: false, renderCell: (cellValues) => { return ( @@ -4580,7 +4580,10 @@ const DisplayPartnerPromotion = (props) => { one_civilite_part = p_one_civilite_part; if (!one_civilite_part || one_civilite_part.trim() === "") { - alert(" Vous devez saisir la civilité du participant"); + var txt = " Vous devez saisir la civilité du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4591,7 +4594,10 @@ const DisplayPartnerPromotion = (props) => { one_nom_part = p_one_nom_part; if (!one_nom_part || one_nom_part.trim() === "") { - alert(" Vous devez saisir le nom du participant"); + var txt = " Vous devez saisir le nom du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4601,7 +4607,10 @@ const DisplayPartnerPromotion = (props) => { if (!one_prenom_part || one_prenom_part.trim() === "") { - alert(" Vous devez saisir le prénom du participant"); + var txt = " Vous devez saisir le prénom du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4610,7 +4619,10 @@ const DisplayPartnerPromotion = (props) => { one_naissance_part = p_one_naissance_part; if (!one_naissance_part || one_naissance_part.trim() === "") { - alert(" Vous devez saisir la date de naissance du participant"); + var txt = " Vous devez saisir la date de naissance du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4622,14 +4634,20 @@ const DisplayPartnerPromotion = (props) => { //console.log(" one_email_part = ", one_email_part); if (!one_email_part || one_email_part.trim() === "") { - alert(" Vous devez saisir l'email du participant"); + var txt = " Vous devez saisir l'email du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!one_email_part.trim().match(validRegex)) { - alert("L'adresse email est invalide."); + var txt = "L'adresse email est invalide."; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4639,19 +4657,27 @@ const DisplayPartnerPromotion = (props) => { one_phone_part = p_one_phone_part; if (!one_phone_part || one_phone_part.trim() === "") { - alert(" Vous devez saisir le téléphone du participant"); + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } if (selected_code_session.trim() === "" || selected_internal_url.trim() === "") { - alert(" Vous devez selectionner une session d'abord"); + var txt = " Vous devez selectionner une session d'abord"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } // Gestion du statut d'inscription if (String(myinscript_status) === "") { - alert(" Vous devez choisir un statut d'inscription "); + var txt = " Vous devez choisir un statut d'inscription "; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); } //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); @@ -4705,7 +4731,11 @@ const DisplayPartnerPromotion = (props) => { local_value = local_value.replaceAll(",", "."); if (isNaN(local_value)) { - alert("Le champ " + spec_field_updated_values_hooks_stagiaire[i].field_label + " doit être numérique.") + + var txt = "Le champ " + spec_field_updated_values_hooks_stagiaire[i].field_label + " doit être numérique."; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4716,7 +4746,10 @@ const DisplayPartnerPromotion = (props) => { if (String(spec_field_updated_values_hooks_stagiaire[i].is_mandatory) === "1") { if (String(local_value).trim().length <= 0) { - alert("Le champ " + spec_field_updated_values_hooks_stagiaire[i].field_label + " est obligatoire.") + var txt = "Le champ " + spec_field_updated_values_hooks_stagiaire[i].field_label + " est obligatoire." + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4770,7 +4803,9 @@ const DisplayPartnerPromotion = (props) => { setLoading(false); console.warn('One_Create_Participant : Not good man :( = ' + error); setOne_Create_Participant_api("false"); - alert("Impossible d'ajouter le participant "); + setdisplay_alert_mysy("1"); + setalert_message("Impossible d'ajouter le participant "); + setalert_type("error"); }) } @@ -17177,7 +17212,7 @@ const DisplayPartnerPromotion = (props) => { else if (String(Dialog_seq_planif_periode_type) === "mois") Add_Automatic_Sequence_Session_From_Month_Model(); }} - className="bton_enreg_dialog">Crée en masse + className="bton_enreg_dialog">Créer en masse
@@ -17533,7 +17568,7 @@ const DisplayPartnerPromotion = (props) => { {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) !== "3" && - String(Dialog_seq_choix_model_emargement) !== "4" && } + String(Dialog_seq_choix_model_emargement) !== "4" && } {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) === "3" && @@ -20909,7 +20944,7 @@ const DisplayPartnerPromotion = (props) => { {String(props.check_user_acces_right("session", "write")) === "1" && - } + } {String(props.check_user_acces_right("session", "write")) === "1" && } @@ -22731,7 +22766,7 @@ const DisplayPartnerPromotion = (props) => {
- display_view = {display_view}
+
Affichage : @@ -23301,6 +23336,7 @@ const DisplayPartnerPromotion = (props) => { className="disabled_style" options={New_status_inscription_add} + value={New_status_inscription_add.filter((data) => (data).value === String(myinscript_status))[0].label} onChange={(event, value) => { if (value && value.value) { setmyinscript_status(value.value); @@ -23748,7 +23784,7 @@ const DisplayPartnerPromotion = (props) => { } else if (String(selected_session_invoiced_statut) === "2") { alert(" La promo est déjà facturée ") } else { - + setmyinscript_status("0") submenu_add_one_participant() } @@ -24152,6 +24188,7 @@ const DisplayPartnerPromotion = (props) => { className="disabled_style" options={New_status_inscription_add} + value={New_status_inscription_add.filter((data) => (data).value === String(myinscript_status))[0].label} onChange={(event, value) => { if (value && value.value) { setmyinscript_status(value.value); @@ -24674,6 +24711,7 @@ const DisplayPartnerPromotion = (props) => { alert(" La session est déjà facturée ") } else { + setmyinscript_status("1"); submenu_add_one_participant() } @@ -26842,6 +26880,8 @@ const DisplayPartnerPromotion = (props) => { related_collection_recid={selected_session_id} SessionstartDate={new Date(moment(SessionstartDate, "DD/MM/YYYY"))} SessionendDate={new Date(moment(SessionendDate, "DD/MM/YYYY"))} selected_session_invoiced_statut={selected_session_invoiced_statut} session_class_id={session_selected_class_id} + check_user_acces_right={props.check_user_acces_right} + origin={"session"} />
} @@ -26853,7 +26893,9 @@ const DisplayPartnerPromotion = (props) => { related_collection_recid={selected_session_id} SessionstartDate={new Date(moment(SessionstartDate, "DD/MM/YYYY"))} SessionendDate={new Date(moment(SessionendDate, "DD/MM/YYYY"))} session_formateur_id={p_formateur_id} session_class_id={session_selected_class_id} - selected_session_invoiced_statut={selected_session_invoiced_statut} /> + selected_session_invoiced_statut={selected_session_invoiced_statut} + check_user_acces_right={props.check_user_acces_right} + origin={"session"} />
} @@ -26865,7 +26907,9 @@ const DisplayPartnerPromotion = (props) => { session_class_id={session_selected_class_id} selected_session_invoiced_statut={selected_session_invoiced_statut} jury_cell_editable={false} - jury_id={""} /> + jury_id={""} + check_user_acces_right={props.check_user_acces_right} + origin={"session"} />
} diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 12ed36a..4d7262e 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -733,8 +733,8 @@ const DisplayPartnerSession = (props) => { { field: 'nom', headerName: 'nom', minWidth: 200, flex: 1, hide: false, editable: true, renderCell: (params) => , }, { field: 'prenom', headerName: 'prenom', minWidth: 200, flex: 1, hide: false, editable: true, renderCell: (params) => , }, { field: 'email', headerName: 'email', minWidth: 200, flex: 1, flex: 1, renderCell: (params) => , }, - { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => , }, - { field: 'client_rattachement_id', headerName: 'Client_id', Width: 0, hide: true, editable: true, }, + { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'client_rattachement_id', headerName: 'Client_id', Width: 0, hide: true, editable: false, }, { field: 'client_facture', headerName: 'Client Fact.', minWidth: 200, flex: 1, hide: false, editable: false, @@ -752,9 +752,9 @@ const DisplayPartnerSession = (props) => { }, { field: 'employeur', headerName: 'Employeur', minWidth: 150, flex: 1, maxWidth: 200, hide: true, editable: true, renderCell: (params) => , }, - { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: true }, + { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: false }, { - field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: true, + field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: false, renderCell: (cellValues) => { return ( @@ -4109,7 +4109,7 @@ const DisplayPartnerSession = (props) => { setsequence_gridline_id(""); setent_account_automatic(false); - setlms_account_automatic(false); + setlms_account_automatic(false); //myRef.current.scrollIntoView({ behavior: "smooth" }); var divh = document.getElementById('myRef_add_session').offsetTop; @@ -4581,7 +4581,10 @@ const DisplayPartnerSession = (props) => { one_civilite_part = p_one_civilite_part; if (!one_civilite_part || one_civilite_part.trim() === "") { - alert(" Vous devez saisir la civilité du participant"); + var txt = " Vous devez saisir la civilité du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4592,7 +4595,10 @@ const DisplayPartnerSession = (props) => { one_nom_part = p_one_nom_part; if (!one_nom_part || one_nom_part.trim() === "") { - alert(" Vous devez saisir le nom du participant"); + var txt = " Vous devez saisir le nom du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4602,7 +4608,10 @@ const DisplayPartnerSession = (props) => { if (!one_prenom_part || one_prenom_part.trim() === "") { - alert(" Vous devez saisir le prénom du participant"); + var txt = " Vous devez saisir le prénom du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4611,7 +4620,10 @@ const DisplayPartnerSession = (props) => { one_naissance_part = p_one_naissance_part; if (!one_naissance_part || one_naissance_part.trim() === "") { - alert(" Vous devez saisir la date de naissance du participant"); + var txt = " Vous devez saisir la date de naissance du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4623,14 +4635,20 @@ const DisplayPartnerSession = (props) => { //console.log(" one_email_part = ", one_email_part); if (!one_email_part || one_email_part.trim() === "") { - alert(" Vous devez saisir l'email du participant"); + var txt = " Vous devez saisir l'email du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!one_email_part.trim().match(validRegex)) { - alert("L'adresse email est invalide."); + var txt = "L'adresse email est invalide."; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4640,19 +4658,29 @@ const DisplayPartnerSession = (props) => { one_phone_part = p_one_phone_part; if (!one_phone_part || one_phone_part.trim() === "") { - alert(" Vous devez saisir le téléphone du participant"); + var txt = " Vous devez saisir le téléphone du participant"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } if (selected_code_session.trim() === "" || selected_internal_url.trim() === "") { - alert(" Vous devez selectionner une session d'abord"); + var txt = " Vous devez selectionner une session d'abord"; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } // Gestion du statut d'inscription if (String(myinscript_status) === "") { - alert(" Vous devez choisir un statut d'inscription "); + var txt = " Vous devez choisir un statut d'inscription "; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); + return; } //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); @@ -4706,7 +4734,10 @@ const DisplayPartnerSession = (props) => { local_value = local_value.replaceAll(",", "."); if (isNaN(local_value)) { - alert("Le champ " + spec_field_updated_values_hooks_stagiaire[i].field_label + " doit être numérique.") + var txt = "Le champ " + spec_field_updated_values_hooks_stagiaire[i].field_label + " doit être numérique."; + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4717,7 +4748,10 @@ const DisplayPartnerSession = (props) => { if (String(spec_field_updated_values_hooks_stagiaire[i].is_mandatory) === "1") { if (String(local_value).trim().length <= 0) { - alert("Le champ " + spec_field_updated_values_hooks_stagiaire[i].field_label + " est obligatoire.") + var txt = "Le champ " + spec_field_updated_values_hooks_stagiaire[i].field_label + " est obligatoire." + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -4771,7 +4805,9 @@ const DisplayPartnerSession = (props) => { setLoading(false); console.warn('One_Create_Participant : Not good man :( = ' + error); setOne_Create_Participant_api("false"); - alert("Impossible d'ajouter le participant "); + setdisplay_alert_mysy("1"); + setalert_message("Impossible d'ajouter le participant "); + setalert_type("error"); }) } @@ -17214,7 +17250,7 @@ const DisplayPartnerSession = (props) => { else if (String(Dialog_seq_planif_periode_type) === "mois") Add_Automatic_Sequence_Session_From_Month_Model(); }} - className="bton_enreg_dialog">Crée en masse + className="bton_enreg_dialog">Créer en masse
@@ -17570,7 +17606,7 @@ const DisplayPartnerSession = (props) => { {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) !== "3" && - String(Dialog_seq_choix_model_emargement) !== "4" && } + String(Dialog_seq_choix_model_emargement) !== "4" && } {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) === "3" && @@ -20947,7 +20983,7 @@ const DisplayPartnerSession = (props) => { {String(props.check_user_acces_right("session", "write")) === "1" && - } + } {String(props.check_user_acces_right("session", "write")) === "1" && } @@ -23347,6 +23383,7 @@ const DisplayPartnerSession = (props) => { className="disabled_style" options={New_status_inscription_add} + value={New_status_inscription_add.filter((data) => (data).value === String(myinscript_status))[0].label} onChange={(event, value) => { if (value && value.value) { setmyinscript_status(value.value); @@ -23794,14 +23831,14 @@ const DisplayPartnerSession = (props) => { } else if (String(selected_session_invoiced_statut) === "2") { alert(" La session est déjà facturée ") } else { - + setmyinscript_status("0") submenu_add_one_participant() } }} className="detail_class_submenu bton_add_session" - id='menu_one_participant' name='menu_one_participant'>Ajout 1 participant   + id='menu_one_participant' name='menu_one_participant'>Ajout 1 participant   ajout un participant @@ -24190,7 +24227,7 @@ const DisplayPartnerSession = (props) => { />
-
Statut Inscription
+
Statut Inscription
{ className="disabled_style" options={New_status_inscription_add} + value={New_status_inscription_add.filter((data) => (data).value === String(myinscript_status))[0].label} + onChange={(event, value) => { if (value && value.value) { setmyinscript_status(value.value); @@ -24719,7 +24758,7 @@ const DisplayPartnerSession = (props) => { } else if (String(selected_session_invoiced_statut) === "2") { alert(" La session est déjà facturée ") } else { - + setmyinscript_status("1"); submenu_add_one_participant() } @@ -24727,7 +24766,7 @@ const DisplayPartnerSession = (props) => { className="detail_class_submenu bton_add_session" - id='menu_one_participant' name='menu_one_participant'>Ajout 1 participant   + id='menu_one_participant' name='menu_one_participant'>Ajout 1 participant   ajout un participant diff --git a/src/components/Equipe_Team.js b/src/components/Equipe_Team.js index c3b64df..3d2996f 100644 --- a/src/components/Equipe_Team.js +++ b/src/components/Equipe_Team.js @@ -1574,7 +1574,10 @@ const Equipe_Team = (props) => { function Record_All_PJ() { if (!p_detail_one_file_to_download_type_name) { - alert(" Vous devez donner un nom à la pièce jointe"); + // alert(" Vous devez donner un nom à la pièce jointe"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez donner un nom à la pièce jointe"); + setalert_type("error"); return; } @@ -1617,7 +1620,10 @@ const Equipe_Team = (props) => { setfile_1_name(); setp_detail_one_file_to_download_type_name(); //GetCurrentClass_trainingsession(); - alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée") + // alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée") + setdisplay_alert_mysy("1"); + setalert_message(" La pièce jointe " + file_1_name.name + " a été bien enregistrée"); + setalert_type("success"); } else { diff --git a/src/components/Formation_Partner_Catalog.js b/src/components/Formation_Partner_Catalog.js index c6be14e..b7b1ef0 100644 --- a/src/components/Formation_Partner_Catalog.js +++ b/src/components/Formation_Partner_Catalog.js @@ -410,7 +410,7 @@ const Formation_Partner_Catalog = (props) => {
-
+
{parse(String(props.formation.description).replace(/(<([^>]+)>)/ig, ''))}
diff --git a/src/components/Groupe_Apprenant.js b/src/components/Groupe_Apprenant.js index e639c3b..cd71938 100644 --- a/src/components/Groupe_Apprenant.js +++ b/src/components/Groupe_Apprenant.js @@ -1026,7 +1026,10 @@ const Groupe_Apprenant = (props) => { function Record_All_PJ() { if (!p_detail_one_file_to_download_type_name) { - alert(" Vous devez donner un nom à la pièce jointe"); + // alert(" Vous devez donner un nom à la pièce jointe"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez donner un nom à la pièce jointe"); + setalert_type("error"); return; } @@ -1070,7 +1073,10 @@ const Groupe_Apprenant = (props) => { setfile_1_name(); setp_detail_one_file_to_download_type_name(); //GetCurrentClass_trainingsession(); - alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée") + // alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée") + setdisplay_alert_mysy("1"); + setalert_message(" La pièce jointe " + file_1_name.name + " a été bien enregistrée"); + setalert_type("success"); } else { diff --git a/src/components/Intranet_Mes_Stagiaires.js b/src/components/Intranet_Mes_Stagiaires.js index 89a21ca..9aef117 100644 --- a/src/components/Intranet_Mes_Stagiaires.js +++ b/src/components/Intranet_Mes_Stagiaires.js @@ -59,6 +59,7 @@ import Checkbox from '@mui/material/Checkbox'; import Module_Email_Management from "./Module_Email_Management"; import FormGroup from '@mui/material/FormGroup'; import FormControlLabel from '@mui/material/FormControlLabel'; +import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; import { GridToolbarContainer, GridToolbarExport, GridToolbarColumnsButton, @@ -2220,7 +2221,7 @@ const Intranet_Mes_Stagiaires = (props) => { } - function submenu_detail_stagaire() { + function submenu_detail_stagaire() { submenu_color_management("detail_session"); setsubmenu("detail_session"); setdisplay_detail_stagiaire("1"); @@ -2228,7 +2229,7 @@ const Intranet_Mes_Stagiaires = (props) => { } - function submenu_piece_jointe() { + function submenu_piece_jointe() { submenu_color_management("piece_jointe"); setsubmenu("piece_jointe"); setdisplay_detail_stagiaire(""); @@ -4870,7 +4871,10 @@ const Intranet_Mes_Stagiaires = (props) => { function Record_All_PJ() { if (!p_detail_one_file_to_download_type_name) { - alert(" Vous devez donner un nom à la pièce jointe"); + // alert(" Vous devez donner un nom à la pièce jointe"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez donner un nom à la pièce jointe"); + setalert_type("error"); return; } @@ -4915,7 +4919,11 @@ const Intranet_Mes_Stagiaires = (props) => { setfile_1_name(); setp_detail_one_file_to_download_type_name(); //GetCurrentClass_trainingsession(); - alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée") + // alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée") + setdisplay_alert_mysy("1"); + setalert_message(result['message']); + setalert_type("error"); + } else { @@ -6427,12 +6435,38 @@ const Intranet_Mes_Stagiaires = (props) => { // FIN EXPORT EXCEL DATAGRID + const [display_alert_mysy, setdisplay_alert_mysy] = useState(""); + const [alert_message, setalert_message] = useState(""); + const [alert_type, setalert_type] = useState(""); + + function clear_alert_message() { + setalert_message(""); + } + function clear_alert_type() { + setalert_type(""); + } + function clear_display_alert_mysy() { + setdisplay_alert_mysy(""); + } + + return (
{isLoading &&
} + {/*** Affichage des messages d'alerte*/} + {display_alert_mysy && String(display_alert_mysy) === "1" && + + } + {/*** FIN Affichage des messages d'alerte*/} + diff --git a/src/components/Jurys.js b/src/components/Jurys.js index b7446c5..e00daf2 100644 --- a/src/components/Jurys.js +++ b/src/components/Jurys.js @@ -2701,7 +2701,10 @@ const Jury = (props) => { function Record_All_PJ() { if (!p_detail_one_file_to_download_type_name) { - alert(" Vous devez donner un nom à la pièce jointe"); + // alert(" Vous devez donner un nom à la pièce jointe"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez donner un nom à la pièce jointe"); + setalert_type("error"); return; } @@ -2744,7 +2747,10 @@ const Jury = (props) => { setfile_1_name(); setp_detail_one_file_to_download_type_name(); //GetCurrentClass_trainingsession(); - alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée") + // alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée") + setdisplay_alert_mysy("1"); + setalert_message(" La pièce jointe " + file_1_name.name + " a été bien enregistrée"); + setalert_type("success"); } else { diff --git a/src/components/Module_Session_Planification.js b/src/components/Module_Session_Planification.js index b74c5ba..e3357fe 100644 --- a/src/components/Module_Session_Planification.js +++ b/src/components/Module_Session_Planification.js @@ -5284,7 +5284,7 @@ const Module_Session_Planification = (props) => { else if (String(Dialog_seq_planif_periode_type) === "mois") Add_Automatic_Sequence_Session_From_Month_Model(); }} - className="bton_enreg_dialog">Crée en masse + className="bton_enreg_dialog">Créer en masse
@@ -5381,7 +5381,7 @@ const Module_Session_Planification = (props) => { {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) !== "3" && - String(Dialog_seq_choix_model_emargement) !== "4" && } + String(Dialog_seq_choix_model_emargement) !== "4" && } {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) === "3" && @@ -6646,7 +6646,8 @@ const Module_Session_Planification = (props) => {
} - {!new_planification_lines || new_planification_lines.length <= 0 && String(props.origin) === "session" && + + {(!new_planification_lines || new_planification_lines.length <= 0) && String(props.origin) === "session" && String(props.check_user_acces_right("session", "write")) === "1" &&
@@ -6871,7 +6872,6 @@ const Module_Session_Planification = (props) => { onRowDoubleClick={(newSelectionModel) => { - }} diff --git a/src/components/Mon_Catalogue_Public.js b/src/components/Mon_Catalogue_Public.js index a08a4aa..eeef6b4 100644 --- a/src/components/Mon_Catalogue_Public.js +++ b/src/components/Mon_Catalogue_Public.js @@ -1,5 +1,5 @@ import React, { useRef, useState, useMemo, useEffect } from "react"; -import { useForm } from "react-hook-form"; +import { useForm } from "react-hook-form"; import axios from "axios"; import Formation_Partner_Catalog from "./Formation_Partner_Catalog"; import { FaSearch, FaRegArrowAltCircleDown, FaRegArrowAltCircleUp } from 'react-icons/fa'; @@ -4369,7 +4369,7 @@ const Mon_Catalogue_Public = (props) => { {result && myApiResponse === "True" && !newresult &&
-
+
{ onPageChange={page => setCurrentPage2(page)} />
-
-
+
+
Trier par - { if (trier_par === "1") settrier_par("-1"); diff --git a/src/components/Partner_Client.js b/src/components/Partner_Client.js index 9fd0c98..2542ee6 100644 --- a/src/components/Partner_Client.js +++ b/src/components/Partner_Client.js @@ -348,7 +348,11 @@ const Partner_Client = (props) => { }).catch((error) => { console.warn('Not good man :( Delete_Client_Data = ', error); setDelete_Client_Data_api("false"); - alert(" Impossible de supprimer le client"); + // alert(" Impossible de supprimer le client"); + + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de supprimer le client"); + setalert_type("error"); }) } @@ -449,7 +453,10 @@ const Partner_Client = (props) => { }).catch((error) => { console.warn('Not good man :( Get_List_Partner_Clients_With_Filter = ', error); setGet_List_Partner_Clients_With_Filter_api("false"); - alert(" Impossible de récupérer la liste des client"); + // alert(" Impossible de récupérer la liste des client"); + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de récupérer la liste des client"); + setalert_type("error"); //setmyApimyApiMessage("") }) } @@ -507,7 +514,11 @@ const Partner_Client = (props) => { //console.log("file_size = ",file_size," file_type = ",file_type); if (file_size > 1000000) { - alert("Le fichier ne doit pas dépasser un 1 Méga octets"); + // alert("Le fichier ne doit pas dépasser un 1 Méga octets"); + setdisplay_alert_mysy("1"); + setalert_message("Le fichier ne doit pas dépasser un 1 Méga octets"); + setalert_type("error"); + return; } @@ -1227,7 +1238,7 @@ const Partner_Client = (props) => { - {String(props.check_user_acces_right("client", "write")) === "1" &&
+ {String(props.check_user_acces_right("client", "write")) === "1" &&
} @@ -1277,7 +1288,7 @@ const Partner_Client = (props) => {
 
+ check_user_acces_right={props.check_user_acces_right} />
} diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index 2122eef..576bc48 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -1189,7 +1189,7 @@ const Partner_Commande = (props) => { // alert(res.data.message); setdisplay_alert_mysy("1"); setalert_message(res.data.message); - setalert_type("success"); + setalert_type("error"); } }).catch((error) => { diff --git a/src/components/Partner_Config_Technique.js b/src/components/Partner_Config_Technique.js index 854fbcc..53f1718 100644 --- a/src/components/Partner_Config_Technique.js +++ b/src/components/Partner_Config_Technique.js @@ -118,8 +118,9 @@ const Partner_Configuration_Technique = (props) => { const columns_quotation = [ { field: '_id', headerName: '_id', hide: true }, { field: 'id', headerName: 'id', hide: true }, - { field: 'related_collection', headerName: 'Cible', flex: 1, hide: false, editable: false, - renderCell: (cellValues) => { + { + field: 'related_collection', headerName: 'Cible', flex: 1, hide: false, editable: false, + renderCell: (cellValues) => { return (
@@ -130,7 +131,7 @@ const Partner_Configuration_Technique = (props) => { ); }, - }, + }, { field: 'config_name', headerName: 'Nom Configuration', flex: 1, hide: false, editable: false }, { field: 'config_value', headerName: 'Valeur config', flex: 1, hide: false, editable: false }, ] @@ -247,6 +248,75 @@ const Partner_Configuration_Technique = (props) => { ] + const columns_groupe_client = [ + { field: '_id', headerName: '_id', hide: true }, + { field: 'id', headerName: 'id', hide: true }, + { field: 'code', headerName: 'Nom Configuration', flex: 1, hide: false, editable: false }, + { field: 'description', headerName: 'Valeur config', flex: 1, hide: false, editable: false }, + + + + { + field: "delete", headerName: 'Supprimer', + renderCell: (cellValues) => { + return ( + + + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, le groupe de client sera définitivement supprimé.
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+ + + ); + } + } + + + ] + + const columns_site_formation = [ { field: '_id', headerName: '_id', hide: true }, { field: 'id', headerName: 'id', hide: true }, @@ -584,6 +654,7 @@ const Partner_Configuration_Technique = (props) => { Getall_Parter_config_Points(); Getall_Parter_type_client(); + Getall_Parter_groupe_client(); Getall_Partner_Site_Formation(); Getall_Partner_Paiement_Condition(); Getall_Partner_CRM_Opportunite_Etape(); @@ -963,6 +1034,45 @@ const Partner_Configuration_Technique = (props) => { } + const [Getall_Parter_groupe_client_api, setGetall_Parter_groupe_client_api] = useState(); + const [Getall_Parter_groupe_client_message, setGetall_Parter_groupe_client_message] = useState(); + const [Getall_Parter_groupe_client_result, setGetall_Parter_groupe_client_result] = useState([]); + function Getall_Parter_groupe_client(event) { + + var form = new FormData(); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Groupe_Client/"; + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Parter_groupe_client res.data.status = " + res.data.status); + //console.log(" In Getall_Parter_groupe_client res.data.message r_class = " + res.data.message); + setGetall_Parter_groupe_client_api("true"); + setGetall_Parter_groupe_client_result(res.data.message); + + } + else { + setGetall_Parter_groupe_client_api("false"); + setGetall_Parter_groupe_client_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Parter_groupe_client = ', error); + setGetall_Parter_groupe_client_api("false"); + alert(" Impossible de recuperer la liste des groupe de client"); + //setmyApimyApiMessage("") + }) + } const [New_Getall_Partner_CRM_Opportunite_Etape_result, setNew_Getall_Partner_CRM_Opportunite_Etape_result] = useState([]); @@ -1138,7 +1248,7 @@ const Partner_Configuration_Technique = (props) => { const [selected_row_id_val, setselected_row_id_val] = React.useState(); - const [selected_row__id, setselected_row__id] = React.useState(""); + const [selected_row__id, setselected_row__id] = React.useState(""); const [selected_site_ftion_id, setselected_site_ftion_id] = React.useState(""); @@ -1266,14 +1376,14 @@ const Partner_Configuration_Technique = (props) => { setconfig_quotation_data_edit_mode("1"); - + if (document.getElementsByName("detail_config_valeur")[0]) { document.getElementsByName("detail_config_valeur")[0].disabled = false; document.getElementsByName("detail_config_valeur")[0].style.backgroundColor = "#FFFFFF"; } - + } @@ -1288,7 +1398,7 @@ const Partner_Configuration_Technique = (props) => { document.getElementsByName("detail_config_valeur")[0].style.backgroundColor = "#FFFFFF"; } - + } @@ -1307,7 +1417,7 @@ const Partner_Configuration_Technique = (props) => { document.getElementsByName("detail_config_valeur")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("detail_config_cible")[0]) { + if (document.getElementsByName("detail_config_cible")[0]) { document.getElementsByName("detail_config_cible")[0].disabled = true; document.getElementsByName("detail_config_cible")[0].style.backgroundColor = "#ECEFF1"; } @@ -1757,6 +1867,56 @@ const Partner_Configuration_Technique = (props) => { } + + + + const [p_groupe_client_code, setp_groupe_client_code] = useState(""); + const [p_groupe_client_desc, setp_groupe_client_desc] = useState(""); + const [selected_groupe_client_id, setselected_groupe_client_id] = useState(""); + + const [Dialog_groupe_client_1_message, setDialog_groupe_client_1_message] = React.useState(false); + const [Dialog_groupe_client_1_open, setDialog_groupe_client_1_open] = React.useState(false); + + function Dialog_1_handle_change_groupe_client(message) { + setDialog_groupe_client_1_message(message); + setDialog_groupe_client_1_open(true); + } + + const Dialog_groupe_client_1_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_groupe_client_1_handleClose_buton = () => { + setp_groupe_client_code(""); + setp_groupe_client_desc(""); + setselected_groupe_client_id(""); + setDialog_groupe_client_1_open(false); + }; + + const [display_detail_groupe_client, setdisplay_detail_groupe_client] = React.useState(); + function handleClick_edit_config_From_Client_Groupe(selected_row_id) { + + var line = JSON.parse(Getall_Parter_groupe_client_result[selected_row_id]); + + console.log(" ### line = ", line); + + setdisplay_detail_groupe_client("1"); + + + setselected_groupe_client_id(line._id); + + setp_groupe_client_code(line.code); + setp_groupe_client_desc(line.description); + + + setDialog_groupe_client_1_open(true); + + } + + + + const [Dialog_type_client_1_message, setDialog_type_client_1_message] = React.useState(false); const [Dialog_type_client_1_open, setDialog_type_client_1_open] = React.useState(false); @@ -1778,6 +1938,7 @@ const Partner_Configuration_Technique = (props) => { }; + const [p_type_client_code, setp_type_client_code] = useState(""); const [p_type_client_desc, setp_type_client_desc] = useState(""); const [selected_type_client_id, setselected_type_client_id] = useState(""); @@ -1911,6 +2072,78 @@ const Partner_Configuration_Technique = (props) => { } + + const [Add_Update_Client_Groupe_api, setAdd_Update_Client_Groupe_api] = useState(); + const [Add_Update_Client_Groupe_message, setAdd_Update_Client_Groupe_message] = useState(); + const [Add_Update_Client_Groupe_result, setAdd_Update_Client_Groupe_result] = useState(); + function Add_Update_Client_Groupe(event) { + + var form = new FormData(); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + + + + var myurl = ""; + + if (String(selected_groupe_client_id).trim().length > 2) { + // Il s'agit d'une mise à jour + myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Groupe_Client/"; + form.append("_id", selected_groupe_client_id); + form.append("code", p_groupe_client_code); + form.append("description", p_groupe_client_desc); + + + } else { + // Il s'agit d'une creation + myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Groupe_Client/"; + form.append("code", p_groupe_client_code); + form.append("description", p_groupe_client_desc); + + } + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + + if (String(res.data.status) === String("true")) { + //console.log(" In Add_Update_Client_Groupe res.data.status = " + res.data.status); + //console.log(" In Add_Update_Client_Groupe res.data.message r_class = " + res.data.message); + setAdd_Update_Client_Groupe_api("true"); + setAdd_Update_Client_Groupe_result(res.data.message); + Dialog_groupe_client_1_handleClose_buton(); + Getall_Parter_groupe_client(); + + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); + + } + else { + setAdd_Update_Client_Groupe_api("false"); + setAdd_Update_Client_Groupe_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + + setLoading(false); + console.warn('Not good man :( Add_Update_Client_Groupe = ', error); + setAdd_Update_Client_Groupe_api("false"); + alert(" Impossible d'ajouter / mettre à jour le groupe de client"); + //setmyApimyApiMessage("") + }) + } + + + + const [Add_Update_Site_Formation_api, setAdd_Update_Site_Formation_api] = useState(); const [Add_Update_Site_Formation_message, setAdd_Update_Site_Formation_message] = useState(); const [Add_Update_Site_Formation_result, setAdd_Update_Site_Formation_result] = useState(); @@ -2120,6 +2353,60 @@ const Partner_Configuration_Technique = (props) => { + const [handleClick_delete_Groupe_Client_api, sethandleClick_delete_Groupe_Client_api] = useState(); + const [handleClick_delete_Groupe_Client_message, sethandleClick_delete_Groupe_Client_message] = useState(); + const [handleClick_delete_Groupe_Client_result, sethandleClick_delete_Groupe_Client_result] = useState(); + function handleClick_delete_Groupe_Client(event, cellValues) { + + var type_groupe_id = cellValues.row._id; + + var form = new FormData(); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("_id", type_groupe_id); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Groupe_Client/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In handleClick_delete_Groupe_Client res.data.status = " + res.data.status); + //console.log(" In handleClick_delete_Groupe_Client res.data.message r_class = " + res.data.message); + sethandleClick_delete_Groupe_Client_api("true"); + sethandleClick_delete_Groupe_Client_result(res.data.message); + Dialog_type_client_1_handleClose_buton(); + Getall_Parter_groupe_client(); + + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("success"); + + + } + else { + sethandleClick_delete_Groupe_Client_api("false"); + sethandleClick_delete_Groupe_Client_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( handleClick_delete_Groupe_Client = ', error); + sethandleClick_delete_Groupe_Client_api("false"); + alert(" Impossible de supprimer le groupe de client"); + //setmyApimyApiMessage("") + }) + } + + const [handleClick_delete_Site_Ftion_api, sethandleClick_delete_Site_Ftion_api] = useState(); const [handleClick_delete_Site_Ftion_message, sethandleClick_delete_Site_Ftion_message] = useState(); const [handleClick_delete_Site_Ftion_result, sethandleClick_delete_Site_Ftion_result] = useState(); @@ -2639,10 +2926,14 @@ const Partner_Configuration_Technique = (props) => { function submenu_type_client() { Getall_Parter_type_client(); setsubmenu("type_client"); - submenu_color_management("type_client"); + } + function submenu_groupe_client() { + Getall_Parter_type_client(); + setsubmenu("groupe_client"); + submenu_color_management("groupe_client"); } @@ -2702,7 +2993,7 @@ const Partner_Configuration_Technique = (props) => { function submenu_color_management(current_menu) { const list_sous_menu = ["competence", "technique", "type_client", "site", "condition_paiement", "etape_opportunite", - "devis", "automatic_doc"] + "devis", "automatic_doc", "groupe_client"] for (let i = 0; i < list_sous_menu.length; i++) { @@ -3080,6 +3371,115 @@ const Partner_Configuration_Technique = (props) => { {/*** Fin Type Client */} + {/*** Groupe Client */} + null} + + PaperProps={{ + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '5rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" + + > + + Groupe de client + + + {Dialog_type_client_1_message} + + + +
code + { + setp_groupe_client_code(e.target.value); + } + } + /> + +
+ +
Description + { + setp_groupe_client_desc(e.target.value); + } + } + /> + +
+ + + +
+ + + + + + + + +
+
+ + {String(selected_groupe_client_id).trim().length > 2 && } + {String(selected_groupe_client_id).trim() === "" && } +
+ +
+ +
+
+ +
+ +
+ + {/*** Fin Groupe Client */} + + + + {
+ @@ -3829,25 +4230,25 @@ const Partner_Configuration_Technique = (props) => {
{display_detail_config && String(display_detail_config) === "1" &&
- - -
Point de configuration
- -
+
Point de configuration
+ +
{String(config_data_edit_mode) === "1" &&
Valeur de configuration
{
Point de configuration
- + /> -
+
+ - {String(config_quotation_data_edit_mode) === "1" && String(p_detail_quotation_config_point) !== "frequence_relance_auto" &&
Valeur de configuration
{
} + + {/*** Groupe de clients */} + {String(submenu) === "groupe_client" &&
+
+
+
+
+ +
+   + + { + setselectionModel_type_client(newSelectionModel); + + }} + selectionModel={selectionModel_type_client} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={Getall_Parter_groupe_client_result.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + code: JSON.parse(item).code, + description: JSON.parse(item).description, + + } + ))} + + columns={columns_groupe_client} + pageSize={10} + className="datagridclass" + + onRowDoubleClick={(newSelectionModel) => { + //setgridline_id(newSelectionModel.row.id); + handleClick_edit_config_From_Client_Groupe(newSelectionModel.row.id); + + }} + + + rowsPerPageOptions={[10]} + //disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + //sx={datagridSx} + getCellClassName={(params) => { + + + //field === "order_header_status" + if (params.field === "order_header_status" && String(params.value) == "0") { + return 'cell--status--brouillon'; + } + + if (params.field === "order_header_status" && String(params.value) == "1") { + + return 'cell--status--encours'; + } + + if (params.field === "order_header_status" && String(params.value) == "2") { + return 'cell--status--traite'; + } + + if (params.field === "order_header_status" && String(params.value) == "3") { + return 'cell--status--facture'; + } + + }} + getRowClassName={(params) => { + + if (String(params.row.status) === "-1") { + return 'line--statut--annule'; + } + if (String(params.row.status) === "0") { + return 'line--statut--preinscrit'; + } + if (String(params.row.status) === "1") { + return 'line--statut--inscrit'; + } + + // Pour la gestion de la couleur de zone double cliquée + if (String(params.row.id) === String(gridline_id)) { + return 'line--statut--selected'; + } + else if (parseInt(String(params.row.id)) % 2 === 0) { + return 'line--statut--pair'; + } + else if (parseInt(String(params.row.id)) % 2 !== 0) { + return 'line--statut--impair'; + } + }} + + + /> + +
+ +
+ +
+ +
+
+ +
+ +
+
+
 
+
+ +
+
} +
) } diff --git a/src/components/UpdatePartnerInfo.js b/src/components/UpdatePartnerInfo.js index 8c2e98d..a3ad87a 100644 --- a/src/components/UpdatePartnerInfo.js +++ b/src/components/UpdatePartnerInfo.js @@ -1982,7 +1982,7 @@ function UpdateParnterInfo(props) { setLoading(false); if (String(res.data.status) === "true") { //console.log(" In Get_Partner_Catalog_Pub_Config res.data.status = " + res.data.status); - // console.log(" In Get_Partner_Catalog_Pub_Config res.data.message r_class = " + res.data.message); + // console.log(" In Get_Partner_Catalog_Pub_Config res.data.message r_class = " + res.data.message); setGet_Partner_Catalog_Pub_Config_api("true"); setGet_Partner_Catalog_Pub_Config_result(res.data.message); @@ -2179,6 +2179,16 @@ function UpdateParnterInfo(props) { setp_indicateur4_gras(true); } + setp_contact_public_email(""); + if (JSON.parse(res.data.message).contact_public_email) { + setp_contact_public_email(JSON.parse(res.data.message).contact_public_email); + } + + setp_contact_public_telephone(""); + if (JSON.parse(res.data.message).contact_public_telephone) { + setp_contact_public_telephone(JSON.parse(res.data.message).contact_public_telephone); + } + disable_catalog_pub_fields(); @@ -4718,7 +4728,7 @@ function UpdateParnterInfo(props) {
-
Contacts Publiques
+
Contacts Publiques zzzz
Email