From eb6b78b7b2be55ab7193ae3e3dbd7e2a1afc58ea Mon Sep 17 00:00:00 2001 From: Cherif Date: Thu, 5 Jun 2025 19:52:09 +0200 Subject: [PATCH] 05/06/2025 - 20h --- src/App.js | 24 +- src/components/Account.js | 6 +- src/components/AddClassManual.js | 3 +- src/components/Apprenant.js | 1101 +++--- src/components/Config_Champs_Personnalise.js | 629 ++-- src/components/DisplayPartnerSession.js | 309 +- src/components/DisplayPartnerStagiaires.js | 10 +- src/components/Employes.js | 21 +- src/components/Ent_Intranet.js | 2957 +++++++++++++++++ src/components/GestionAdministrative.js | 4 +- src/components/Inscription_Information.js | 8 +- .../Module_Connexion_Ent_Student.js | 534 +++ .../Module_Connexion_Intranet_Client.js | 9 +- src/components/Mon_Intranet_Public.js | 55 +- src/components/New_C_Formation_2025.js | 26 +- src/components/Pricing.js | 44 +- src/components/Student_Account.js | 552 +++ .../new_detail_formation_2025.js | 33 +- .../new_s_detail_formation_2025.css | 23 +- src/pages/mon_ent_student.js | 14 + src/pages/mon_intranet_public.js | 9 +- src/pages/student_account.js | 21 + .../_config_champs_personnalise.scss | 52 +- .../components/_new_s_formation_2025.scss | 10 +- 24 files changed, 5333 insertions(+), 1121 deletions(-) create mode 100644 src/components/Ent_Intranet.js create mode 100644 src/components/Module_Connexion_Ent_Student.js create mode 100644 src/components/Student_Account.js create mode 100644 src/pages/mon_ent_student.js create mode 100644 src/pages/student_account.js diff --git a/src/App.js b/src/App.js index 8a16a9f..e2d2b10 100644 --- a/src/App.js +++ b/src/App.js @@ -13,15 +13,15 @@ import Recherche_new_v4 from "./pages/recherche_new_v4"; import Mon_Catalogue_Public from "./pages/mon_catalogue_public"; import Mon_Intranet_Public from "./pages/mon_intranet_public"; +import Mon_Ent_Student from "./pages/mon_ent_student"; + + import TestUrl from "./pages/testurl"; import Account from "./pages/account"; -import DisplayDetailClass_new_v2 from "./pages/displaydetailclass_new_v2"; -import DisplayDetailClass_new_v3 from "./pages/displaydetailclass_new_v3"; +import Student_Account from "./pages/student_account"; import Display_Partner_Catalog_DetailClass_new_v2 from "./pages/display_partner_catalog_detailclass_new_v2" - -import DisplayDetailArticle from "./pages/displaydetailarticle"; import AddArticleAvis from "./pages/addarticleavis"; import Acceuil from "./pages/acceuil"; import Partner from "./pages/partner"; @@ -34,9 +34,6 @@ import RechecheArticles from "./pages/recherchearticles"; import AddArticle from "./pages/addarticle"; import ResetUserPwd from "./pages/resetuserpwd"; import DeleteUserAccount from "./pages/deleteuseraccount"; - -import ContactezNous from "./pages/contactez_nous"; -import CoupDeCoeur from "./pages/coupdecoeur"; import AccountUserActivated from "./pages/accountuseractivated"; import ProduitsService from "./pages/produitservice"; @@ -50,8 +47,6 @@ import SeDesabonner from './pages/sedesabonner'; import OrderConfirmation_3DS from "./pages/orderconfirmation_3DS"; import Training_Inactive_Or_Not_Found from "./pages/Traning_Inactif_Or_Not_Exist"; import TestUrl_New from "./pages/testurl_new"; -import QuiSommesNous_v3 from "./pages/quisommesnous_v3"; -import Fonctionnalites from "./pages/fonctionnalite"; import Test_Drag_Drop from "./pages/test_drag_drop"; import Test_Drag_Drop2 from "./pages/test_dnd"; import ESign from "./pages/eSigne"; @@ -123,8 +118,7 @@ function App() { var tab_action = ['/moncatalog', '/Display-Partner-Catalog-Detail-formation', 'Display-Partner-Catalog-Detail-formation', 'moncatalog']; - - + if (tab_myurl_pathname.length > 0 && !tab_action.includes(tab_myurl_pathname[1]) && !tab_reserved_subdomain.includes(subdomain)) { var new_url = window.location.protocol + "//" + domain.split('.')[0] + "." + domain.split('.')[1] + "/moncatalog"; @@ -156,12 +150,13 @@ function App() { - + + @@ -184,9 +179,6 @@ function App() { - - - {/* */} @@ -284,7 +276,7 @@ function App() { - + {/* Fin Migration */} diff --git a/src/components/Account.js b/src/components/Account.js index c1bf3f1..3f85aa9 100644 --- a/src/components/Account.js +++ b/src/components/Account.js @@ -398,7 +398,7 @@ function Account() { {isSelected &&
} - +
{username && {username} } {!username && xxxx }
@@ -443,7 +443,7 @@ function Account() { {/** Menu pour un utilisateur NON type 'user' exemple un apprenant */} {connected_user_data && connected_user_data.type && - String(connected_user_data.type) !== "user" && + String(connected_user_data.type) !== "student" &&
INFORMATIONS PERSONNELLES

@@ -568,8 +568,6 @@ function Account() { />} - - {String(menu) === String("mes_documents") && } diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index 9926a02..0ca7041 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -6801,7 +6801,8 @@ const AddClassManual = (props) => { rows_champs_specifics.map((champ_spec) => (
- {String(JSON.parse(champ_spec).field_type) === "float" && { } } + + + // Pour les champs spécifiques + for (let i = 0; i < rows_champs_specifics.length; i++) { + + var field_name = JSON.parse(rows_champs_specifics[i]).field_name; + + if (document.getElementsByName(String(field_name))[0]) { + document.getElementsByName(String(field_name))[0].disabled = true; + document.getElementsByName(String(field_name))[0].style.backgroundColor = "#ECEFF1"; + } + } } function Enable_Detail_Apprenant_Fields() { @@ -1865,6 +1877,17 @@ const Apprenant = (props) => { } } + // Pour les champs spécifiques + for (let i = 0; i < rows_champs_specifics.length; i++) { + + var field_name = JSON.parse(rows_champs_specifics[i]).field_name; + + if (document.getElementsByName(String(field_name))[0]) { + document.getElementsByName(String(field_name))[0].disabled = false; + document.getElementsByName(String(field_name))[0].style.backgroundColor = "#FFFFFF"; + } + } + } @@ -2217,10 +2240,6 @@ const Apprenant = (props) => { }) } - - const spec_field_updated_values = [] - const [spec_field_updated_values_hooks, setspec_field_updated_values_hooks] = useState([]); - const [selected_apprenant_email, setselected_apprenant_email] = useState(""); @@ -2444,9 +2463,6 @@ const Apprenant = (props) => { setLoading(false); } - - const [rows_champs_specifics_stagiaire, setrows_champs_specifics_stagiaire] = useState([]); - function GetSelectedRowsSession() { ///alert(" les lignes slected sont : " + selectionModel + " nb item = " + selectionModel.length); //const selectedRowsData = selectionModel.map((id) => rowss.find((row) => row.id === id)); @@ -2492,8 +2508,7 @@ const Apprenant = (props) => { setGet_Partner_Object_Specific_Fields_apprenant_api("true"); setGet_Partner_Object_Specific_Fields_apprenant_result(res.data.message); - - setrows_champs_specifics_stagiaire(res.data.message); + setrows_champs_specifics(res.data.message); } @@ -2514,8 +2529,6 @@ const Apprenant = (props) => { }) } - const [rows_champs_specifics, setrows_champs_specifics] = useState([]); - 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(); @@ -2779,46 +2792,6 @@ const Apprenant = (props) => { }) } - const [Get_Partner_Object_Specific_Fields_api, setGet_Partner_Object_Specific_Fields_api] = useState(); - const [Get_Partner_Object_Specific_Fields_message, setGet_Partner_Object_Specific_Fields_message] = useState(); - const [Get_Partner_Object_Specific_Fields_result, setGet_Partner_Object_Specific_Fields_result] = useState(); - function Get_Partner_Object_Specific_Fields(local_collection_obj_metier) { - - var form = new FormData(); - const stored_cookie = getCookie('tokenmysypart'); - form.append("token", stored_cookie); - 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/"; - - axios.post(myurl, form).then(res => { - - 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); - - setGet_Partner_Object_Specific_Fields_api("true"); - setGet_Partner_Object_Specific_Fields_result(res.data.message); - - - setrows_champs_specifics(res.data.message); - - - } - else { - setGet_Partner_Object_Specific_Fields_api("false"); - setGet_Partner_Object_Specific_Fields_message(res.data.message); - alert(res.data.message) - } - - }).catch((error) => { - 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"); - //setmyApimyApiMessage("") - }) - } - const [Get_Appenant_List_Inscription_api, setGet_Appenant_List_Inscription_api] = useState(); const [Get_Appenant_List_Inscription_message, setGet_Appenant_List_Inscription_message] = useState(); @@ -3516,6 +3489,7 @@ const Apprenant = (props) => { Getall_TrainingSession(); + Get_Partner_Object_Specific_Fields("apprenant"); if (props.object_key && props.subdata && String(props.object_key).length > 3) { setLoading(true); @@ -3637,7 +3611,10 @@ const Apprenant = (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"); + + setdisplay_alert_mysy("1"); + setalert_message("Le fichier ne doit pas dépasser un 1 Méga octets"); + setalert_type("error"); return; } @@ -3679,7 +3656,12 @@ const Apprenant = (props) => { setliste_apprenants_file_change_api("true"); Get_All_Apprenant(); - alert(result['message']); + // alert(result['message']); + + setdisplay_alert_mysy("1"); + setalert_message(result['message']); + setalert_type("success"); + } @@ -3687,7 +3669,10 @@ const Apprenant = (props) => { setLoading(false); setliste_apprenants_file_change_message(result['message']); setliste_apprenants_file_change_api("false"); - alert(result['message']); + + setdisplay_alert_mysy("1"); + setalert_message(result['message']); + setalert_type("error"); } @@ -3747,9 +3732,9 @@ const Apprenant = (props) => { - if (document.getElementById('detail_apprenant')) { + if (document.getElementById('myRef_details')) { // myRef.current.scrollIntoView({ behavior: "smooth" }); - var divh = document.getElementById('detail_apprenant').offsetTop; + var divh = document.getElementById('myRef_details').offsetTop; window.scrollTo({ top: divh, behavior: "smooth", @@ -3941,28 +3926,9 @@ const Apprenant = (props) => { const myRef_detail_suivi_ped = useRef(null) const myRef_detail_apprenant = useRef(null) - /* - *** ALGORITHME - 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. - - */ - - - const list_nom_champs_spec = [] - const [spec_champs_valeur, setspec_champs_valeur] = useState([]); - - //const spec_champs_valeur = "" - const [display_champs_specifics, setdisplay_champs_specifics] = useState("0"); function afficher_champs_spec() { @@ -4042,36 +4008,49 @@ const Apprenant = (props) => { // Controle sur les champs if (p_one_nom.trim() == "") { - alert(" Vous devez saisir le nom de l'apprenant"); + setdisplay_alert_mysy("1"); + setalert_message("Vous devez saisir le nom de l'apprenant"); + setalert_type("error"); return; } if (p_one_prenom.trim() == "") { - alert(" Vous devez saisir le prenom de l'apprenant"); + setdisplay_alert_mysy("1"); + setalert_message("Vous devez saisir le prenom de l'apprenant"); + setalert_type("error"); return; } if (p_one_email.trim() == "") { - alert(" Vous devez saisir l'email de l'apprenant"); + setdisplay_alert_mysy("1"); + setalert_message("Vous devez saisir l'email de l'apprenant"); + setalert_type("error"); return; } if (p_one_naissance.trim() == "") { - alert(" Vous devez saisir la date de naissance de l'apprenant"); + setdisplay_alert_mysy("1"); + setalert_message("Vous devez saisir la date de naissance de l'apprenant"); + setalert_type("error"); return; } if (p_one_civilite.trim() == "") { - alert(" Vous devez saisir la civilité de l'apprenant"); + setdisplay_alert_mysy("1"); + setalert_message("Vous devez saisir la civilité de l'apprenant"); + setalert_type("error"); return; } var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!p_one_email.trim().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; } @@ -4183,6 +4162,72 @@ const Apprenant = (props) => { form.append("tuteur2_telephone", ""); + // 04/06/2025 + if (p_one_is_handicap) + form.append("is_handicap", "1"); + else + form.append("is_handicap", "0"); + + if (p_one_is_droit_image) + form.append("is_droit_image", "1"); + else + form.append("is_droit_image", "0"); + + if (p_one_is_rgpd) + form.append("is_rgpd", "1"); + else + form.append("is_rgpd", "0"); + + + if (p_one_nationalite) + form.append("nationalite", p_one_nationalite); + else + form.append("nationalite", ""); + + if (p_one_situation_famille) + form.append("situation_famille", p_one_situation_famille); + else + form.append("situation_famille", ""); + + if (p_one_naissance_lieu) + form.append("naissance_lieu", p_one_naissance_lieu); + else + form.append("naissance_lieu", ""); + + if (p_one_naissance_departement) + form.append("naissance_departement", p_one_naissance_departement); + else + form.append("naissance_departement", ""); + + if (p_one_naissance_pays) + form.append("naissance_pays", p_one_naissance_pays); + else + form.append("naissance_pays", ""); + + if (p_one_num_secu) + form.append("num_secu", p_one_num_secu); + else + form.append("num_secu", ""); + + if (p_one_piece_identite_type) + form.append("identite_type", p_one_piece_identite_type); + else + form.append("identite_type", ""); + + if (p_one_piece_identite_num) + form.append("piece_identite_num", p_one_piece_identite_num); + else + form.append("piece_identite_num", ""); + + if (p_one_type_mobilite) + form.append("type_mobilite", p_one_type_mobilite); + else + form.append("type_mobilite", ""); + + if (p_one_telephone_bis) + form.append("telephone_bis", p_one_telephone_bis); + else + form.append("telephone_bis", ""); /* @@ -4254,7 +4299,11 @@ const Apprenant = (props) => { else { setAdd_One_Apprenant_Data_api("false"); setAdd_One_Apprenant_Data_message(res.data.message); - alert(res.data.message); + + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } }).catch((error) => { @@ -5582,8 +5631,157 @@ const Apprenant = (props) => { setp_detail_is_rgpd(event.target.checked); }; + const handleChange_one_is_handicap_checked = (event) => { + setp_one_is_handicap(event.target.checked); + }; + const handleChange_one_droit_image_checked = (event) => { + setp_one_is_droit_image(event.target.checked); + }; + + const handleChange_one_is_rgpd_checked = (event) => { + setp_one_is_rgpd(event.target.checked); + }; + + // Gestion champs specifiques + + /* + *** ALGORITHME + 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. + + */ + + + const list_nom_champs_spec = [] + const [spec_champs_valeur, setspec_champs_valeur] = useState([]); + + //const spec_champs_valeur = "" + + const [Get_Partner_Object_Specific_Fields_api, setGet_Partner_Object_Specific_Fields_api] = useState(); + const [Get_Partner_Object_Specific_Fields_message, setGet_Partner_Object_Specific_Fields_message] = useState(); + const [Get_Partner_Object_Specific_Fields_result, setGet_Partner_Object_Specific_Fields_result] = useState(); + function Get_Partner_Object_Specific_Fields(local_collection_obj_metier) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + 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/"; + + axios.post(myurl, form).then(res => { + + 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); + + setGet_Partner_Object_Specific_Fields_api("true"); + setGet_Partner_Object_Specific_Fields_result(res.data.message); + + + setrows_champs_specifics(res.data.message); + + + } + else { + setGet_Partner_Object_Specific_Fields_api("false"); + setGet_Partner_Object_Specific_Fields_message(res.data.message); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + 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"); + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de recuperer la liste des collection et champs personnalisables"); + setalert_type("error"); + //setmyApimyApiMessage("") + }) + } + + + const [rows_champs_specifics, setrows_champs_specifics] = useState([]); + const [display_champs_specifics, setdisplay_champs_specifics] = useState("0"); + + function afficher_champs_spec() { + + setdisplay_champs_specifics("1"); + + } + + function findIndexByProperty(data, key, value) { + for (var i = 0; i < data.length; i++) { + + if (data[i][key] == value) { + return i; + } + } + return -1; + } + + + function findValueByProperty(data, key, value) { + for (var i = 0; i < data.length; i++) { + if (data[i][key] == value) { + + var tmp_val = JSON.parse(data[i]); + + return tmp_val.field_value + + } + } + return ""; + } + + + const spec_field_updated_values = [] + const [spec_field_updated_values_hooks, setspec_field_updated_values_hooks] = useState([]); + + + function change_champs_spec_handle() { + + for (let i = 0; i < rows_champs_specifics.length; i++) { + + var field_name = JSON.parse(rows_champs_specifics[i]).field_name; + var field_type = JSON.parse(rows_champs_specifics[i]).field_type; + var field_label = JSON.parse(rows_champs_specifics[i]).field_label; + var is_mandatory = JSON.parse(rows_champs_specifics[i]).is_mandatory; + + + + if (document.getElementsByName(String(field_name))[0]) { + + var field_value = document.getElementsByName(String(field_name))[0].value; + var new_val = { 'field_name': field_name, 'field_value': field_value, 'field_type': field_type, 'field_label': field_label, 'is_mandatory': is_mandatory } + var johnIndex = findIndexByProperty(spec_field_updated_values, 'field_name', field_name); + if (johnIndex > -1) { + spec_field_updated_values[johnIndex] = new_val; + + } else { + spec_field_updated_values.push(new_val); + } + } + + } + + //setrows_champs_specifics(spec_champs_valeur); + + //console.log(" OUTT spec_field_updated_values = ", spec_field_updated_values); + setspec_field_updated_values_hooks(spec_field_updated_values) + } + // -- end champs specifiques return (
@@ -7047,28 +7245,35 @@ const Apprenant = (props) => {
 
- {selected_apprenant_id && String(selected_apprenant_id).length > 2 && String(add_One_Apprenant) !== "1" && -
- - - + {selected_apprenant_id && String(selected_apprenant_id).length > 2 && String(add_One_Apprenant) !== "1" && +
+ + + - - {String(props.formation_initiale) === "1" && } + + {String(props.formation_initiale) === "1" && } - - {/**/} + + {/**/} -
} +
} {String(add_One_Apprenant) === "1" &&
- + + +
+ +
+ Identification
@@ -7168,88 +7373,121 @@ const Apprenant = (props) => { />
-
Date Naissance
- { - setp_one_naissance(format(date, 'd/MM/yyyy')); - - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style enable_style" - locale='fr-FR' - - /> -
- -
Lieu Naissance
+
Num Sécu
{ - setp_detail_naissance_lieu(e.target.value); - setapprenant_data_changed("1"); + setp_one_num_secu(e.target.value); } } />
+
Type Pièce Identité
+ {New_Option_Piece_Identite && New_Option_Piece_Identite.length > 0 && + Dept. Naissance
+ className="disabled_style enable_style" + + options={New_Option_Piece_Identite} + value={New_Option_Piece_Identite.filter((data) => (data).value === String(p_one_piece_identite_type))[0].label} + + onChange={(event, value) => { + if (value && value.value) { + setp_one_piece_identite_type(value.value); + } else { + setp_one_piece_identite_type(""); + } + }} + + renderInput={(params) => + } + />} + + +
+ +
Num Pièce Identité
{ - setp_detail_naissance_departement(e.target.value); - setapprenant_data_changed("1"); + setp_one_piece_identite_num(e.target.value); } } />
-
Pays Naissance
- Situation Maritale
+ {New_Option_Famille_Situation && New_Option_Famille_Situation.length > 0 && + { - setp_detail_naissance_pays(e.target.value); - setapprenant_data_changed("1"); - } - } - /> + className="disabled_style enable_style" + + options={New_Option_Famille_Situation} + value={New_Option_Famille_Situation.filter((data) => (data).value === String(p_one_situation_famille))[0].label} + + onChange={(event, value) => { + + if (value && value.value) { + setp_one_situation_famille(value.value); + } else { + setp_one_situation_famille(""); + } + }} + + renderInput={(params) => + } + />}
+
+   +
+
+
+
+
+ +
+
+
+
Téléphone
{
-
Type Pièce Identité
- {New_Option_Piece_Identite && New_Option_Piece_Identite.length > 0 && - (data).value === String(p_detail_piece_identite_type))[0].label} - - onChange={(event, value) => { - setapprenant_data_changed("1"); - if (value && value.value) { - setp_detail_piece_identite_type(value.value); - } else { - setp_detail_piece_identite_type(""); - } - }} - - renderInput={(params) => - } - />} +
Date Naissance
+ { + setp_one_naissance(format(date, 'd/MM/yyyy')); + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' + />
-
Num PI
+
Lieu Naissance
{ - setp_detail_piece_identite_num(e.target.value); - setapprenant_data_changed("1"); + setp_one_naissance_lieu(e.target.value); } } />
-
Type Mobilité
- {New_Option_Type_Mobilite && New_Option_Type_Mobilite.length > 0 && - Dept. Naissance
+ { + setp_one_naissance_departement(e.target.value); + } + } + /> +
- options={New_Option_Type_Mobilite} - value={New_Option_Type_Mobilite.filter((data) => (data).value === String(p_detail_type_mobilite))[0].label} +
Pays Naissance
+ { - setapprenant_data_changed("1"); - if (value && value.value) { - setp_detail_type_mobilite(value.value); - } else { - setp_detail_type_mobilite(""); - } - }} - - renderInput={(params) => - } - />} + InputLabelProps={{ + shrink: true, + }} + disabled={false} + className="disabled_style enable_style" + value={p_one_naissance_pays} + onChange={(e) => { + setp_one_naissance_pays(e.target.value); + } + } + />
Nationnalité
@@ -7448,15 +7683,44 @@ const Apprenant = (props) => { }} disabled={false} className="disabled_style enable_style" - value={p_detail_nationalite} + value={p_one_nationalite} onChange={(e) => { - setp_detail_nationalite(e.target.value); - setapprenant_data_changed("1"); + setp_one_nationalite(e.target.value); } } />
+ + +
Type Mobilité
+ {New_Option_Type_Mobilite && New_Option_Type_Mobilite.length > 0 && + (data).value === String(p_one_type_mobilite))[0].label} + + onChange={(event, value) => { + if (value && value.value) { + setp_one_type_mobilite(value.value); + } else { + setp_one_type_mobilite(""); + } + }} + + renderInput={(params) => + } + />} +
+

@@ -7475,9 +7739,9 @@ const Apprenant = (props) => {
Situation Handicape
{ - handleChange_is_handicap_checked(e); + handleChange_one_is_handicap_checked(e); } } inputProps={{ 'aria-label': 'controlled' }} @@ -7486,74 +7750,27 @@ const Apprenant = (props) => {
Droit à l'image
{ - handleChange_droit_image_checked(e); + handleChange_one_droit_image_checked(e); } } inputProps={{ 'aria-label': 'controlled' }} />
-
Num Sécu
- { - setp_detail_num_secu(e.target.value); - setapprenant_data_changed("1"); - } - } - /> -
RGPD
{ - handleChange_droit_image_checked(e); + handleChange_one_is_rgpd_checked(e); } } inputProps={{ 'aria-label': 'controlled' }} />
-
Situation Maritale
- {New_Option_Famille_Situation && New_Option_Famille_Situation.length > 0 && - (data).value === String(p_detail_situation_famille))[0].label} - - onChange={(event, value) => { - - if (value && value.value) { - setp_detail_situation_famille(value.value); - } else { - setp_detail_situation_famille(""); - } - }} - - renderInput={(params) => - } - />} -
@@ -7566,7 +7783,7 @@ const Apprenant = (props) => {
+ Champs spécifiques
@@ -7579,8 +7796,8 @@ const Apprenant = (props) => { {rows_champs_specifics && rows_champs_specifics.map((champ_spec) => ( -
{JSON.parse(champ_spec).field_label}
-
+
{String(JSON.parse(champ_spec).is_mandatory) === "1" && {JSON.parse(champ_spec).field_label} } + {String(JSON.parse(champ_spec).is_mandatory) !== "1" && {JSON.parse(champ_spec).field_label} }
{String(JSON.parse(champ_spec).field_type) === "float" && {
+ Identification
@@ -8010,89 +8227,90 @@ const Apprenant = (props) => { />
-
Date Naissance
- { - setp_detail_naissance(format(date, 'd/MM/yyyy')); - setapprenant_data_changed("1"); - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style enable_style" - locale='fr-FR' +
Type Pièce Identité
+ {String(apprenant_data_edit_mode) === "1" && New_Option_Piece_Identite && New_Option_Piece_Identite.length > 0 && + + className="disabled_style enable_style" + + options={New_Option_Piece_Identite} + value={New_Option_Piece_Identite.filter((data) => (data).value === String(p_detail_piece_identite_type))[0].label} + + onChange={(event, value) => { + setapprenant_data_changed("1"); + if (value && value.value) { + setp_detail_piece_identite_type(value.value); + } else { + setp_detail_piece_identite_type(""); + } + }} + + renderInput={(params) => + } + />} + + {String(apprenant_data_edit_mode) !== "1" && New_Option_Piece_Identite && New_Option_Piece_Identite.length > 0 && + + (data).value === String(p_detail_piece_identite_type))[0].label} + + />}
-
Lieu Naissance
+
Num Pièce Identité
{ - setp_detail_naissance_lieu(e.target.value); + setp_detail_piece_identite_num(e.target.value); setapprenant_data_changed("1"); } } />
+
+
+   +
+
+
+
+ +
+
-
Dept. Naissance
- { - setp_detail_naissance_departement(e.target.value); - setapprenant_data_changed("1"); - } - } - /> -
- -
Pays Naissance
- { - setp_detail_naissance_pays(e.target.value); - setapprenant_data_changed("1"); - } - } - /> -
- - +
+
Téléphone
{
+
Date Naissance
+ { + setp_detail_naissance(format(date, 'd/MM/yyyy')); + setapprenant_data_changed("1"); + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' -
Type Pièce Identité
- {String(apprenant_data_edit_mode) === "1" && New_Option_Piece_Identite && New_Option_Piece_Identite.length > 0 && - (data).value === String(p_detail_piece_identite_type))[0].label} - - onChange={(event, value) => { - setapprenant_data_changed("1"); - if (value && value.value) { - setp_detail_piece_identite_type(value.value); - } else { - setp_detail_piece_identite_type(""); - } - }} - - renderInput={(params) => - } - />} - - {String(apprenant_data_edit_mode) !== "1" && New_Option_Piece_Identite && New_Option_Piece_Identite.length > 0 && - - (data).value === String(p_detail_piece_identite_type))[0].label} - - />} + />
-
Num PI
+
Lieu Naissance
{ - setp_detail_piece_identite_num(e.target.value); + setp_detail_naissance_lieu(e.target.value); setapprenant_data_changed("1"); } } />
+
Dept. Naissance
+ { + setp_detail_naissance_departement(e.target.value); + setapprenant_data_changed("1"); + } + } + /> +
+ +
Pays Naissance
+ { + setp_detail_naissance_pays(e.target.value); + setapprenant_data_changed("1"); + } + } + /> +
+ +
Nationnalité
+ { + setp_detail_nationalite(e.target.value); + setapprenant_data_changed("1"); + } + } + /> +
+ +
Type Mobilité
{String(apprenant_data_edit_mode) === "1" && New_Option_Type_Mobilite && New_Option_Type_Mobilite.length > 0 && { />}
-
Nationnalité
- { - setp_detail_nationalite(e.target.value); - setapprenant_data_changed("1"); - } - } - /> -
-
 
+ + + {/* -- début champs specifiques **/} + +
+
+ +
+
+ +
+
+ + {rows_champs_specifics && + rows_champs_specifics.map((champ_spec) => ( + +
{JSON.parse(champ_spec).field_label}
+
+ {String(JSON.parse(champ_spec).field_type) === "float" && { + change_champs_spec_handle(e.target.value); + setapprenant_data_changed("1"); + }} + //onChange={change_champs_spec_handle} + + + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && { + change_champs_spec_handle(e.target.value); + setapprenant_data_changed("1"); + + }} + //onChange={change_champs_spec_handle} + + + />} + +
+ ))} + +
+ +
+ + + +
+   +
+ {/* -- end champs specifiques **/} +
+ + +
@@ -9270,8 +9585,6 @@ const Apprenant = (props) => {
- - {String(add_one_suivi_ped) === "1" && String(display_given_suivi_ped) !== "1" &&
diff --git a/src/components/Config_Champs_Personnalise.js b/src/components/Config_Champs_Personnalise.js index 50a1871..8dd02f8 100644 --- a/src/components/Config_Champs_Personnalise.js +++ b/src/components/Config_Champs_Personnalise.js @@ -4,32 +4,20 @@ import MenuItem from '@mui/material/MenuItem'; import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css import Button from '@mui/material/Button'; import axios from "axios"; -import { getCookie, setCookie } from 'react-use-cookie'; +import { getCookie } from 'react-use-cookie'; import { useHistory } from "react-router-dom"; -import CheckOut from "./CheckOut"; + import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; -import { Editor } from '@tinymce/tinymce-react'; -import parse from 'html-react-parser'; -import { FcViewDetails, FcDisapprove } from "react-icons/fc"; +import Autocomplete from '@mui/material/Autocomplete'; import 'react-tooltip/dist/react-tooltip.css' import { Tooltip } from 'react-tooltip' -import add_plus from "../mysy_img/plus.png"; -import excel_icone from "../mysy_img/excel_icone.png"; -import participants from "../mysy_img/participants.png"; -import fileDownload from 'js-file-download' import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; -import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc"; -import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; -import { format } from 'date-fns' -import moment from "moment"; import InputAdornment from '@mui/material/InputAdornment'; import { AiFillCloseCircle } from "react-icons/ai"; import Box from '@mui/material/Box'; -import { Typography, LinearProgress } from '@mui/material'; -import styled from 'styled-components'; import { CiTrash } from "react-icons/ci"; import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; import Dialog from '@mui/material/Dialog'; @@ -37,12 +25,9 @@ import DialogActions from '@mui/material/DialogActions'; import DialogContent from '@mui/material/DialogContent'; import DialogContentText from '@mui/material/DialogContentText'; import DialogTitle from '@mui/material/DialogTitle'; -import { TransitionProps } from '@mui/material/transitions'; -import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; +import { IoAddCircleOutline } from "react-icons/io5"; import { gridClasses } from '@mui/x-data-grid'; - import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; - import CancelPresentationIcon from '@mui/icons-material/CancelPresentation'; import { makeStyles } from "@material-ui/core/styles"; import Paper from '@material-ui/core/Paper'; @@ -588,6 +573,8 @@ const Config_Champs_Personnalise = (props) => { }) } + const [New_Get_Obj_Metier_Eligible_Cham_Spe_result, setNew_Get_Obj_Metier_Eligible_Cham_Spe_result] = useState([]); + const [Get_Obj_Metier_Eligible_Cham_Spe_api, setGet_Obj_Metier_Eligible_Cham_Spe_api] = useState(); const [Get_Obj_Metier_Eligible_Cham_Spe_message, setGet_Obj_Metier_Eligible_Cham_Spe_message] = useState(); const [Get_Obj_Metier_Eligible_Cham_Spe_result, setGet_Obj_Metier_Eligible_Cham_Spe_result] = useState(); @@ -608,6 +595,37 @@ const Config_Champs_Personnalise = (props) => { setGet_Obj_Metier_Eligible_Cham_Spe_api("true"); setGet_Obj_Metier_Eligible_Cham_Spe_result(res.data.message); + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + var local_objet_metier = JSON.parse(x).objet_metier; + var local_nom = JSON.parse(x).nom; + + + //--- + var node = { + "objet_metier": local_objet_metier, + "label": local_nom, + "local_nom": local_nom, + }; + new_data2.push(node); + }); + + //--- + var node = { + "objet_metier": "", + "label": "", + "local_nom": "", + }; + + new_data2.push(node); + + + if (new_data2.length > 0) + setNew_Get_Obj_Metier_Eligible_Cham_Spe_result(new_data2); + + } else { setGet_Obj_Metier_Eligible_Cham_Spe_api("false"); @@ -635,8 +653,6 @@ const Config_Champs_Personnalise = (props) => { Getall_Partner_Personalised_Fields_No_filter(); // myRef_head.current.scrollIntoView({ behavior: "smooth" }); - - window.scrollTo({ top: 0, behavior: "smooth", @@ -722,25 +738,12 @@ const Config_Champs_Personnalise = (props) => { function Enable_Partner_PersonalFields() { setpersonal_field_data_edit_mode("1"); - if (document.getElementsByName("field_name")[0]) { - document.getElementsByName("field_name")[0].disabled = false; - document.getElementsByName("field_name")[0].style.backgroundColor = "#FFFFFF"; - } if (document.getElementsByName("field_label")[0]) { document.getElementsByName("field_label")[0].disabled = false; document.getElementsByName("field_label")[0].style.backgroundColor = "#FFFFFF"; } - if (document.getElementsByName("related_collection")[0]) { - document.getElementsByName("related_collection")[0].disabled = false; - document.getElementsByName("related_collection")[0].style.backgroundColor = "#FFFFFF"; - } - - if (document.getElementsByName("field_type")[0]) { - document.getElementsByName("field_type")[0].disabled = false; - document.getElementsByName("field_type")[0].style.backgroundColor = "#FFFFFF"; - } if (document.getElementsByName("is_mandatory")[0]) { document.getElementsByName("is_mandatory")[0].disabled = false; @@ -773,6 +776,19 @@ const Config_Champs_Personnalise = (props) => { const [personal_field_data_edit_mode, setpersonal_field_data_edit_mode] = useState(""); + function Annule_Add_One_specific_Fields() { + clear_detail_fields(); + setpersonal_field_data_changed(""); + setpersonal_field_data_edit_mode(""); + setdisplay_personalised_field(""); + setadd_one_personal_field(""); + window.scrollTo({ + top: 0, + behavior: "smooth", + }); + + } + const [add_one_personal_field, setadd_one_personal_field] = React.useState(); function submenu_add_one_personal_field() { @@ -788,6 +804,14 @@ const Config_Champs_Personnalise = (props) => { setdisplay_personalised_field(); setadd_one_personal_field("1"); + if (document.getElementById('myRef_detail')) { + var divh = document.getElementById('myRef_detail').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + } @@ -795,37 +819,37 @@ const Config_Champs_Personnalise = (props) => { const [p_detail_field_label, setp_detail_field_label] = useState(""); const [p_detail_related_collection, setp_detail_related_collection] = useState(""); const [p_detail_related_collection_name, setp_detail_related_collection_name] = useState(""); - const [p_detail_is_displayed, setp_detail_is_displayed] = useState(""); + const [p_detail_is_displayed, setp_detail_is_displayed] = useState("0"); const [p_detail_is_displayed_label, setp_detail_is_displayed_label] = useState(""); - const [p_detail_is_public, setp_detail_is_public] = useState(""); + const [p_detail_is_public, setp_detail_is_public] = useState("0"); const [p_detail_is_public_label, setp_detail_is_public_label] = useState(""); - const [p_detail_field_type, setp_detail_field_type] = useState(""); + const [p_detail_field_type, setp_detail_field_type] = useState("string"); const [p_detail_field_type_label, setp_detail_field_type_label] = useState(""); - const [p_detail_is_mandatory, setp_detail_is_mandatory] = useState(""); + const [p_detail_is_mandatory, setp_detail_is_mandatory] = useState("0"); const [p_detail_is_mandatory_label, setp_detail_is_mandatory_label] = useState(""); const [p_one_detail_field_name, setp_one_detail_field_name] = useState(""); const [p_one_detail_field_label, setp_one_detail_field_label] = useState(""); const [p_one_detail_related_collection, setp_one_detail_related_collection] = useState(""); - const [p_one_detail_is_displayed, setp_one_detail_is_displayed] = useState(""); - const [p_one_detail_is_public, setp_one_detail_is_public] = useState(""); + const [p_one_detail_is_displayed, setp_one_detail_is_displayed] = useState("0"); + const [p_one_detail_is_public, setp_one_detail_is_public] = useState("0"); const [p_one_detail_field_type, setp_one_detail_field_type] = useState(""); - const [p_one_detail_is_mandatory, setp_one_detail_is_mandatory] = useState(""); + const [p_one_detail_is_mandatory, setp_one_detail_is_mandatory] = useState("0"); function clear_detail_fields() { setp_detail_field_name(""); setp_detail_field_label(); setp_detail_related_collection(""); setp_detail_related_collection_name(""); - setp_detail_is_displayed(""); - setp_detail_is_public(""); - setp_detail_field_type(""); + setp_detail_is_displayed("0"); + setp_detail_is_public("0"); + setp_detail_field_type("string"); setp_detail_field_type_label(""); - setp_detail_is_mandatory(""); + setp_detail_is_mandatory("0"); setp_detail_is_mandatory_label(""); setp_detail_is_displayed_label(""); setp_detail_is_public_label(""); @@ -840,10 +864,10 @@ const Config_Champs_Personnalise = (props) => { setp_one_detail_field_name(""); setp_one_detail_field_label(); setp_one_detail_related_collection(""); - setp_one_detail_is_displayed(""); - setp_one_detail_is_public(""); - setp_one_detail_field_type(""); - setp_one_detail_is_mandatory(""); + setp_one_detail_is_displayed("0"); + setp_one_detail_is_public("0"); + setp_one_detail_field_type("string"); + setp_one_detail_is_mandatory("0"); } function Fermer_specific_Fields() { @@ -852,6 +876,10 @@ const Config_Champs_Personnalise = (props) => { clear_one_detail_fields(); setSelectionModel([]); + window.scrollTo({ + top: 0, + behavior: "smooth", + }); } @@ -872,22 +900,34 @@ const Config_Champs_Personnalise = (props) => { form.append("field_name", p_detail_field_name); } else { - alert(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'"); + // alert(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'"); + setalert_type("error"); return; } if (!p_detail_field_name.startsWith('my_')) { - alert(" Le nom technique du champ doit commencer impérativement par 'my_'"); + // alert(" Le nom technique du champ doit commencer impérativement par 'my_'"); + setdisplay_alert_mysy("1"); + setalert_message(" Le nom technique du champ doit commencer impérativement par 'my_'"); + setalert_type("error"); return; } if (String(p_detail_field_name).length < 6) { - alert(" Le nom technique du champ doit au moins 6 caractères"); + // alert(" Le nom technique du champ doit au moins 6 caractères"); + setdisplay_alert_mysy("1"); + setalert_message(" Le nom technique du champ doit au moins 6 caractères"); + setalert_type("error"); return; } var tmp_val = String(p_detail_field_name).replaceAll("my_", ""); if (!tmp_val.match(/^[0-9a-z]+$/)) { - alert(" Sur le nom technique, les information apres le 'my_' doit être alphanumerique. Vous avez saisi : " + String(tmp_val)); + var txt = " Sur le nom technique, les information apres le 'my_' doit être alphanumerique. Vous avez saisi : " + String(tmp_val); + setdisplay_alert_mysy("1"); + setalert_message(txt); + setalert_type("error"); return; } @@ -895,11 +935,17 @@ const Config_Champs_Personnalise = (props) => { if (p_detail_field_label) form.append("field_label", p_detail_field_label); else { - alert(" Vous devez definir le label du champ "); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir le label du champ "); + setalert_type("error"); return; } if (String(p_detail_field_label).length < 3) { - alert(" Le label du champ doit faire au moins 3 caractères"); + + setdisplay_alert_mysy("1"); + setalert_message(" Le label du champ doit faire au moins 3 caractères"); + setalert_type("error"); return; } @@ -907,7 +953,10 @@ const Config_Champs_Personnalise = (props) => { if (p_detail_related_collection) form.append("related_collection", p_detail_related_collection); else { - alert(" Vous devez definir l'entité"); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir l'entité"); + setalert_type("error"); return; } @@ -915,7 +964,10 @@ const Config_Champs_Personnalise = (props) => { if (p_detail_is_displayed) form.append("is_displayed", p_detail_is_displayed); else { - alert(" Vous devez definir si le champ est affichable"); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir si le champ est affichable"); + setalert_type("error"); return; } @@ -929,7 +981,10 @@ const Config_Champs_Personnalise = (props) => { if (p_detail_field_type) form.append("field_type", p_detail_field_type); else { - alert(" Vous devez definir le type du champ"); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir le type du champ"); + setalert_type("error"); return; } @@ -937,7 +992,10 @@ const Config_Champs_Personnalise = (props) => { if (p_detail_is_mandatory) form.append("is_mandatory", p_detail_is_mandatory); else { - alert(" Vous devez definir si le champ est obligatoire"); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir si le champ est obligatoire"); + setalert_type("error"); return; } @@ -1005,15 +1063,24 @@ const Config_Champs_Personnalise = (props) => { form.append("field_name", p_one_detail_field_name); } else { - alert(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'"); + // alert(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'"); + setalert_type("error"); return; } if (!p_one_detail_field_name.startsWith('my_')) { - alert(" Le nom technique du champ doit commencer impérativement par 'my_'"); + // alert(" Le nom technique du champ doit commencer impérativement par 'my_'"); + setdisplay_alert_mysy("1"); + setalert_message(" Le nom technique du champ doit commencer impérativement par 'my_'"); + setalert_type("error"); return; } if (String(p_one_detail_field_name).length < 6) { - alert(" Le nom technique du champ doit au moins 6 caractères"); + // alert(" Le nom technique du champ doit au moins 6 caractères"); + setdisplay_alert_mysy("1"); + setalert_message(" Le nom technique du champ doit au moins 6 caractères"); + setalert_type("error"); return; } @@ -1021,11 +1088,17 @@ const Config_Champs_Personnalise = (props) => { if (p_one_detail_field_label) form.append("field_label", p_one_detail_field_label); else { - alert(" Vous devez definir le label du champ "); + // alert(" Vous devez definir le label du champ "); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir le label du champ "); + setalert_type("error"); return; } if (String(p_one_detail_field_label).length < 3) { - alert(" Le label du champ doit faire au moins 3 caractères"); + // alert(" Le label du champ doit faire au moins 3 caractères"); + setdisplay_alert_mysy("1"); + setalert_message(" Le label du champ doit faire au moins 3 caractères"); + setalert_type("error"); return; } @@ -1033,7 +1106,10 @@ const Config_Champs_Personnalise = (props) => { if (p_one_detail_related_collection) form.append("related_collection", p_one_detail_related_collection); else { - alert(" Vous devez definir l'entité"); + // alert(" Vous devez definir l'entité"); + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir l'entité"); + setalert_type("error"); return; } @@ -1041,7 +1117,10 @@ const Config_Champs_Personnalise = (props) => { if (p_one_detail_is_displayed) form.append("is_displayed", p_one_detail_is_displayed); else { - alert(" Vous devez definir si le champ est affichable"); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir si le champ est affichable"); + setalert_type("error"); return; } @@ -1055,7 +1134,10 @@ const Config_Champs_Personnalise = (props) => { if (p_one_detail_field_type) form.append("field_type", p_one_detail_field_type); else { - alert(" Vous devez definir le type du champ"); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir le type du champ"); + setalert_type("error"); return; } @@ -1063,7 +1145,10 @@ const Config_Champs_Personnalise = (props) => { if (p_one_detail_is_mandatory) form.append("is_mandatory", p_one_detail_is_mandatory); else { - alert(" Vous devez definir si le champ est obligatoire"); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez definir si le champ est obligatoire"); + setalert_type("error"); return; } @@ -1094,6 +1179,7 @@ const Config_Champs_Personnalise = (props) => { setdisplay_alert_mysy("1"); setalert_message(res.data.message); setalert_type("success"); + if (document.getElementById('myRef_head')) { var divh = document.getElementById('myRef_head').offsetTop; window.scrollTo({ @@ -1136,6 +1222,24 @@ const Config_Champs_Personnalise = (props) => { } + + const New_Option_Oui_Non = [ + { + value: '1', + label: 'Oui', + }, + { + value: '0', + label: 'Non', + }, + ]; + + const New_Option_Field_Type = [ + { "id": "float", "label": "Numérique", "value": "float" }, + { "id": "string", "label": "Alphanumérique", "value": "string" }, + + ] + return (
{/*** Affichage des messages d'alerte*/} @@ -1177,7 +1281,7 @@ const Config_Champs_Personnalise = (props) => { > - MySy Information + MySy Information {Dialog_1_message} @@ -1199,7 +1303,7 @@ const Config_Champs_Personnalise = (props) => { -

Configuration documents

+

Configuration champs spécifiques

Utilisez les filtres !
@@ -1540,32 +1644,12 @@ const Config_Champs_Personnalise = (props) => {
{String(display_personalised_field) === "1" && String(add_one_personal_field) !== "1" &&
-

Détail champ personnalisé {selected_field_name}

+

Détail champ personnalisé {selected_field_name}

- - {String(personal_field_data_edit_mode) !== "1" && - -
- Entité métier
- - -
} - - {String(personal_field_data_edit_mode) === "1" &&
Entité métier
+
+ Entité métier
{ InputLabelProps={{ shrink: true, }} - select disabled={false} className="disabled_style" - value={p_detail_related_collection} - onChange={(e) => { - setp_detail_related_collection(e.target.value); - setpersonal_field_data_changed("1"); - }} - > - {Get_Obj_Metier_Eligible_Cham_Spe_result && - Get_Obj_Metier_Eligible_Cham_Spe_result.map((mycollection) => ( - - {JSON.parse(mycollection).nom}   + value={p_detail_related_collection_name} + /> - - ))} - - -
} +
- {String(personal_field_data_edit_mode) !== "1" &&
Type (numérique / Alphanumérique)
- Type (Numérique / Alphanumérique)
+ {New_Option_Field_Type && New_Option_Field_Type.length > 0 && { }} disabled={false} className="disabled_style" - value={p_detail_field_type_label} - /> -
} - - {String(personal_field_data_edit_mode) === "1" &&
Type (numérique / Alphanumérique)
- { - setp_detail_field_type(e.target.value); - setpersonal_field_data_changed("1"); - }} - > - numérique    - Alphanumérique   - - -
} + value={New_Option_Field_Type.filter((data) => (data).value === String(p_detail_field_type))[0].label} + />} +
{String(personal_field_data_edit_mode) !== "1" &&
Obligatoire
- 0 && { }} disabled={false} className="disabled_style" - value={p_detail_is_mandatory_label} - /> + value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_mandatory))[0].label} + />}
} {String(personal_field_data_edit_mode) === "1" &&
Obligatoire
- 0 && { - setp_detail_is_mandatory(e.target.value); - setpersonal_field_data_changed("1"); - }} - > - Oui    - Non   + options={New_Option_Oui_Non} + value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_mandatory))[0].label} + onChange={(event, value) => { + if (value && value.value) { + setp_detail_is_mandatory(value.value); + setpersonal_field_data_changed("1"); - + } + }} + + renderInput={(params) => + } + />}
} {String(personal_field_data_edit_mode) !== "1" &&
Affichable
- 0 && { }} disabled={false} className="disabled_style" - value={p_detail_is_displayed_label} - /> + value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_displayed))[0].label} + />}
} {String(personal_field_data_edit_mode) !== "1" &&
@@ -1747,7 +1791,8 @@ const Config_Champs_Personnalise = (props) => { Champ public
- 0 && { }} disabled={false} className="disabled_style" - value={p_detail_is_public_label} - /> + value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_public))[0].label} + />}
} {String(personal_field_data_edit_mode) === "1" &&
Affichable
- 0 && { - setp_detail_is_displayed(e.target.value); - setpersonal_field_data_changed("1"); + options={New_Option_Oui_Non} + value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_displayed))[0].label} + onChange={(event, value) => { + if (value && value.value) { + setp_detail_is_displayed(value.value); + setpersonal_field_data_changed("1"); + + } }} - > - Oui    - Non   - + + renderInput={(params) => + } + />} +
} {String(personal_field_data_edit_mode) === "1" &&
@@ -1792,27 +1838,28 @@ const Config_Champs_Personnalise = (props) => { Champ public
- 0 && { - setp_detail_is_public(e.target.value); - setpersonal_field_data_changed("1"); + options={New_Option_Oui_Non} + value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_public))[0].label} + onChange={(event, value) => { + if (value && value.value) { + setp_detail_is_public(value.value); + setpersonal_field_data_changed("1"); + } }} - > - Oui    - Non   - + + renderInput={(params) => + } + />} +
} @@ -1865,7 +1912,11 @@ const Config_Champs_Personnalise = (props) => {
 
{String(display_personalised_field) !== "1" && String(add_one_personal_field) === "1" &&
-

Ajout d'un nouveau champ spécifique

+ +
@@ -1901,6 +1952,34 @@ const Config_Champs_Personnalise = (props) => {
+
Entité métier
+ {New_Get_Obj_Metier_Eligible_Cham_Spe_result && New_Get_Obj_Metier_Eligible_Cham_Spe_result.length > 0 && + (data).objet_metier === String(p_one_detail_related_collection))[0].label} + + onChange={(event, value) => { + if (value && value.objet_metier) { + setp_one_detail_related_collection(value.objet_metier); + setpersonal_field_data_changed("1"); + } else { + setp_one_detail_related_collection(""); + setpersonal_field_data_changed("1"); + } + }} + + renderInput={(params) => + } + />} +
+
@@ -1948,81 +2027,80 @@ const Config_Champs_Personnalise = (props) => {
-
Type (numérique / Alphanumérique)
- Type (Numérique / Alphanumérique)
+ { - setp_one_detail_field_type(e.target.value); - setpersonal_field_data_changed("1"); - }} - > - numérique    - Alphanumérique   + options={New_Option_Field_Type} + + onChange={(event, value) => { + if (value && value.value) { + setp_one_detail_field_type(value.value); + setpersonal_field_data_changed("1"); + } + }} + + renderInput={(params) => + } + /> -
Obligatoire
- { - setp_one_detail_is_mandatory(e.target.value); - setpersonal_field_data_changed("1"); - }} - > - Oui    - Non   + options={New_Option_Oui_Non} - + onChange={(event, value) => { + if (value && value.value) { + setp_one_detail_is_mandatory(value.value); + setpersonal_field_data_changed("1"); + + } + }} + + renderInput={(params) => + } + />
Affichable
- { - setp_one_detail_is_displayed(e.target.value); - setpersonal_field_data_changed("1"); + options={New_Option_Oui_Non} + + onChange={(event, value) => { + if (value && value.value) { + setp_one_detail_is_displayed(value.value); + setpersonal_field_data_changed("1"); + + } }} - > - Oui    - Non   - + + renderInput={(params) => + } + />
@@ -2030,27 +2108,28 @@ const Config_Champs_Personnalise = (props) => { Champ public
- { - setp_one_detail_is_public(e.target.value); - setpersonal_field_data_changed("1"); + options={New_Option_Oui_Non} + + onChange={(event, value) => { + if (value && value.value) { + setp_one_detail_is_public(value.value); + setpersonal_field_data_changed("1"); + + } }} - > - Oui    - Non   - + + renderInput={(params) => + } + />
@@ -2071,7 +2150,7 @@ const Config_Champs_Personnalise = (props) => {
-
diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 50264ad..c36f774 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -3887,10 +3887,7 @@ const DisplayPartnerSession = (props) => { submenu_color_management("detail_session"); - - await sleep(2); if (edit_session_form === false) { - desableSessionFields(); } @@ -4166,24 +4163,8 @@ const DisplayPartnerSession = (props) => { setnb_stagiaire_Inscrit("0"); /* Activation des champs spécifiques */ - - // Pour les champs spécifiques - - submenu_detail_session(); - - for (let i = 0; i < rows_champs_specifics.length; i++) { - - var field_name = JSON.parse(rows_champs_specifics[i]).field_name; - var field_type = JSON.parse(rows_champs_specifics[i]).field_type; - var field_label = JSON.parse(rows_champs_specifics[i]).field_label; - var is_mandatory = JSON.parse(rows_champs_specifics[i]).is_mandatory; - - if (document.getElementsByName(String(field_name))) { - - document.getElementsByName(String(field_name)).disabled = false; - document.getElementsByName(String(field_name)).backgroundColor = "#FFFFFF"; - } - } + setsubmenu("detail_session"); + submenu_color_management("detail_session"); setgridline_id(''); setsequence_gridline_id(""); @@ -4195,6 +4176,19 @@ const DisplayPartnerSession = (props) => { behavior: "smooth", }); + for (let i = 0; i < rows_champs_specifics.length; i++) { + + var field_name = JSON.parse(rows_champs_specifics[i]).field_name; + var field_type = JSON.parse(rows_champs_specifics[i]).field_type; + var field_label = JSON.parse(rows_champs_specifics[i]).field_label; + var is_mandatory = JSON.parse(rows_champs_specifics[i]).is_mandatory; + + if (document.getElementsByName(String(field_name))) { + document.getElementsByName(String(field_name)).disabled = false; + document.getElementsByName(String(field_name)).backgroundColor = "#FFFFFF"; + } + } + } @@ -5799,14 +5793,6 @@ const DisplayPartnerSession = (props) => { const [one_editorRef_contenu_ftion_limite, setone_editorRef_description_limite] = useState(800); const [field_contenu_ftion, setfield_contenu_ftion] = useState(""); - function editor_contenu_ftion_keyup() { - setsessionChanged(true); - } - - - function one_editor_contenu_ftion_keyup() { - setsessionChanged(true); - } function One_annuleSessionUpdate() { @@ -5817,8 +5803,16 @@ const DisplayPartnerSession = (props) => { setCreateSessionFormation_message(); setone_CreateSessionFormation_api(); setone_CreateSessionFormation_message(); - setone_CreateSessionFormation_result() - setaddOneSession(); + setone_CreateSessionFormation_result([]) + setaddOneSession(""); + + setsubmenu(""); + setselected_code_session(""); + + window.scrollTo({ + top: 0, + behavior: "smooth", + }); } @@ -5965,9 +5959,7 @@ const DisplayPartnerSession = (props) => { // Pour les champs spécifiques - - - if (String(addOneSession) !== "1") { + if (String(addOneSession) !== "1") { for (let i = 0; i < rows_champs_specifics.length; i++) { var field_name = JSON.parse(rows_champs_specifics[i]).field_name; @@ -5986,6 +5978,7 @@ const DisplayPartnerSession = (props) => { setfields1desabled(true); + } let [edit_session_form, setedit_session_form] = useState(false); @@ -7112,7 +7105,7 @@ const DisplayPartnerSession = (props) => { setnb_valide_inscription_individuelle(""); } - if (mylocaltraining.archive) { + if (mylocaltraining.archive) { setp_detail_archive(mylocaltraining.archive); } else { setp_detail_archive(""); @@ -7583,17 +7576,17 @@ const DisplayPartnerSession = (props) => { return currentDate.getTime() < selectedDate.getTime(); }; - function One_annuleSessionUpdate() { - One_clearSessionFields(); - //GetCurrentSession(selected_code_session); - setsessionChanged(false); - setCreateSessionFormation_api(); - setCreateSessionFormation_message(); - setone_CreateSessionFormation_api(); - setone_CreateSessionFormation_message(); - setone_CreateSessionFormation_result() - setaddOneSession(); - } + /* function One_annuleSessionUpdate() { + One_clearSessionFields(); + //GetCurrentSession(selected_code_session); + setsessionChanged(false); + setCreateSessionFormation_api(); + setCreateSessionFormation_message(); + setone_CreateSessionFormation_api(); + setone_CreateSessionFormation_message(); + setone_CreateSessionFormation_result() + setaddOneSession(); + }*/ const [SessionendDateInscription, setSessionendDateInscription] = useState(); const [New_GetCurrentPartnerClass_result, setNew_GetCurrentPartnerClass_result] = useState([]); @@ -18119,7 +18112,7 @@ const DisplayPartnerSession = (props) => { setinfo_affiche_date_fin(JSON.parse(rowss[session_selected_row_id]).date_fin); setinfo_affiche_etape(JSON.parse(rowss[session_selected_row_id]).session_etape); - var nb_place_dispo = String(parseInt(String(JSON.parse(rowss[session_selected_row_id]).nb_participant)) - parseInt(String(JSON.parse(rowss[session_selected_row_id]).nb_inscrit))) + var nb_place_dispo = String(parseInt(String(JSON.parse(rowss[session_selected_row_id]).nb_participant)) - parseInt(String(JSON.parse(rowss[session_selected_row_id]).nb_inscrit))) //console.log(" ### nb_place_dispo = ", nb_place_dispo); setinfo_affiche_place_disponible(nb_place_dispo); @@ -21148,7 +21141,11 @@ const DisplayPartnerSession = (props) => { - +
+ +
+ +
+ + + + + + +
 
+ + + +
+
+ +
+
+ {currentpawdvisible ? : } +
+ +
+ +
+ + + {String(initpasswd) === String("true") && closepopup === 1 &&
+ La demande reinitialisation a bien ete prise en compte. + Verifiez votre boite email. +
} +
+ {String(initpasswd) !== String("true") && String(closepopup) !== String("1") + && Mot de passe oublié} + position="center" className="signin popup-reset-pwd"> +
+
Modifier le mot de passe
+
+ + +
+ + +
+ + + + + + +
+ Je ne suis pas un robot
+
+ + +
{random1} + {random2} = + + {errors.sommerandom && ( + la sommes est incorrect + )} +
+
+
+ +       + +
+ +
+ } +
+
+ +   + + +
+ +
+ + +
+
+ {isconnected === "false" &&
+
+ {myApimyApiMessage}
+ } + + + +
+ +
+ + +
+ +
+ + {/*
+ +
*/} + +
+ + ); +} + +export default Module_Connexion_Ent_Student; diff --git a/src/components/Module_Connexion_Intranet_Client.js b/src/components/Module_Connexion_Intranet_Client.js index b8cb7b8..58db3bb 100644 --- a/src/components/Module_Connexion_Intranet_Client.js +++ b/src/components/Module_Connexion_Intranet_Client.js @@ -2,9 +2,6 @@ import React, { useState, useEffect } from "react"; import { useForm } from "react-hook-form"; import { useHistory } from "react-router-dom"; import { Button, FormGroup, Label, Input } from "reactstrap"; -import { FacebookLoginButton, GoogleLoginButton } from "react-social-login-buttons"; -//import { getCookie, setCookie, removeCookie } from 'react-use-cookie'; -import { Helmet } from "react-helmet"; import { useCookies } from "react-cookie"; import { confirmAlert } from 'react-confirm-alert'; // Import import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css @@ -12,14 +9,12 @@ import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; import axios from "axios"; import { useParams } from 'react-router-dom' - -import Header from "./Header"; import { useLocation } from "react-router-dom"; import Visibility from '@mui/icons-material/Visibility'; import VisibilityOff from '@mui/icons-material/VisibilityOff'; import 'react-tooltip/dist/react-tooltip.css' import { Tooltip } from 'react-tooltip' -import Fotter_v3 from "./Fotter_v3"; + function Module_Connexion_Intranet_Client() { const [isconnected, setisconnected] = useState(""); @@ -385,7 +380,7 @@ function Module_Connexion_Intranet_Client() {
+ style={{ "float": "left", "textAlign": "center", "height": "3rem" }}>Intranet Client diff --git a/src/components/Mon_Intranet_Public.js b/src/components/Mon_Intranet_Public.js index fad9213..4e27770 100644 --- a/src/components/Mon_Intranet_Public.js +++ b/src/components/Mon_Intranet_Public.js @@ -1,65 +1,18 @@ import React, { useRef, useState, useMemo, useEffect } from "react"; 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'; -import { BsFillXCircleFill } from "react-icons/bs"; -import { IoAppsSharp, IoListSharp } from "react-icons/io5"; -import Formation_Grid_2Col from "./Formation_Grid_2Col"; -import Pagination from "./TestPagination"; -import data from "./data/mock-data.json"; import { useHistory } from "react-router-dom"; -import { getCookie, removeCookie } from 'react-use-cookie'; -import { Helmet } from "react-helmet"; - -import AideRecherche from "./AideRecherche" -import { useParams } from 'react-router-dom' -import Fotter_Catalog_Pub from "./Fotter_Catalog_Pub"; -import Footer from "./Fotter"; -import LogoutOutlinedIcon from '@mui/icons-material/LogoutOutlined'; -import Button from '@mui/material/Button'; -import MenuItem from "@material-ui/core/MenuItem"; -import Menu from "@material-ui/core/Menu"; -import Header from "./Header"; - -import connect_white from "../mysy_img/connect_white_v2.png"; -import connect_green from "../mysy_img/connect_green.png"; +import { getCookie, } from 'react-use-cookie'; +import { useParams } from 'react-router-dom'; import { confirmAlert } from 'react-confirm-alert'; // Import import { useCookies } from "react-cookie"; -import InputRange from 'react-input-range'; import 'react-input-range/lib/css/index.css'; -import tick_ko from "../mysy_img/tick_KO.png"; - - -import { SelectChangeEvent } from '@mui/material/Select'; -import Chip from '@mui/material/Chip'; -import Select, { StylesConfig } from 'react-select'; - import img_header from "../mysy_img2/img_header.png" -import mysy_logo2 from "../mysy_img2/Logo_MySy.png" - -import { AiTwotoneFolder } from "react-icons/ai"; -import serv_img_market_digi from "../mysy_img/market_digi.jpg"; -import serv_img_gestion_admin from "../mysy_img/gestion_admin_2.jpg"; -import serv_img_publication from "../mysy_img/publication.jpg"; - -import mysy_search from "../mysy_img2/mysy_search.jpg"; -import mysy_lms from "../mysy_img2/mysy_e_learning.jpg"; -import mysy_consulting from "../mysy_img2/mysy_consulting.jpg"; -import mysy_datacenter from "../mysy_img2/mysy_datacenter.png"; -import Dialog from '@mui/material/Dialog'; -import DialogActions from '@mui/material/DialogActions'; -import DialogContent from '@mui/material/DialogContent'; -import DialogContentText from '@mui/material/DialogContentText'; -import DialogTitle from '@mui/material/DialogTitle'; - import Module_Connexion_Intranet_Client from "./Module_Connexion_Intranet_Client"; import Fotter_Intranet_Client_Pub from "./Fotter_Intranet_Client_Pub" -import { CiCircleRemove, CiCircleMinus } from "react-icons/ci"; -import Fotter_v3 from "./Fotter_v3"; let PageSize = 10; const Mon_Intranet_Public = (props) => { @@ -119,8 +72,6 @@ const Mon_Intranet_Public = (props) => { const inputEl = useRef(null); - - const url = process.env.REACT_APP_API_URL + "myclass/api/add_user_account/"; const { register, @@ -3060,7 +3011,7 @@ const Mon_Intranet_Public = (props) => { {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt &&
{ setisclassimage(res.data.message.img); var ch_img = "data:image/png;base64," + res.data.message.img; setclass_img_stored_in_bdd(ch_img); - // console.log(" getClassImage_no_token: setclass_img_stored_in_bdd = ", setclass_img_stored_in_bdd); + // console.log(" getClassImage_no_token: setclass_img_stored_in_bdd = ", setclass_img_stored_in_bdd); } else { - // console.log(" In Erreur res.data.status = " + res.data.status); + // console.log(" In Erreur res.data.status = " + res.data.status); //console.log(" In Erreur res.data.message = " + res.data.message); setisclassimage("False"); setuserimgclassprofil(); @@ -140,7 +140,7 @@ const New_C_Formation_2025 = (props) => { useEffect(() => { setmyfilter(props.myfil); - // console.log(" #### useEffect props.formation = ", props.formation); + // console.log(" #### useEffect props.formation = ", props.formation); if (typeof (stored_user) === "undefined" || String(stored_user) === '') { @@ -354,7 +354,7 @@ const New_C_Formation_2025 = (props) => { {class_img_stored_in_bdd && String(class_img_stored_in_bdd).length > 50 && Formation - } + } {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && (!props.formation.img_url || String(props.formation.img_url).length <= 10) && @@ -415,7 +415,7 @@ const New_C_Formation_2025 = (props) => {
} {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && String(ismetiermanaged) === "1" && -
+
autre {/*props.formation.institut_formation &&
Dispensé par :
{String(props.formation.institut_formation)}
*/} @@ -432,7 +432,19 @@ const New_C_Formation_2025 = (props) => {

{String(parse(String(props.formation.title).replace(/(<([^>]+)>)/ig, ''))).substring(0, 50)}

-

{props.formation.price} € HT 

+ {props.formation.discounted_price && props.formation.business_prices &&

{props.formation.discounted_price} € HT  111

} + + {props.formation.business_prices.length <= 0 + &&

{props.formation.price} € HT 22

} + + {props.formation.business_prices && props.formation.business_prices.length > 0 && +

+ +

{props.formation.business_prices[0].discounted_price}€ HT  + {props.formation.price} € HT   + ({props.formation.business_prices[0].discount} %)

+

} +

{String(parse(String(props.formation.description).replace(/(<([^>]+)>)/ig, ''))).substring(0, 80)}...

@@ -619,7 +631,7 @@ const New_C_Formation_2025 = (props) => {
} - +
diff --git a/src/components/Pricing.js b/src/components/Pricing.js index dc1a1b7..0e32ee4 100644 --- a/src/components/Pricing.js +++ b/src/components/Pricing.js @@ -1,38 +1,21 @@ import React, { useState, useEffect } from "react"; -import { useForm } from "react-hook-form"; import { useHistory } from "react-router-dom"; -import { Button, FormGroup, Label, Input } from "reactstrap"; -import { FacebookLoginButton, GoogleLoginButton } from "react-social-login-buttons"; -//import { getCookie, setCookie, removeCookie } from 'react-use-cookie'; -import { Helmet } from "react-helmet"; -import { useCookies } from "react-cookie"; -import { confirmAlert } from 'react-confirm-alert'; // Import +import { Button, } from "reactstrap"; import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css -import bannerimg2 from "../mysy_img/MYSY-LOGO-BLUE.png"; import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; import axios from "axios"; -import { useParams } from 'react-router-dom' -import logowhite from "../mysy_img/MYSY-LOGO-WHITE.png"; -import Footer from "./Fotter"; -import MenuItem from "@material-ui/core/MenuItem"; -import Button2 from "@material-ui/core/Button"; -import Menu from "@material-ui/core/Menu"; -import Header from "./Header"; -import { useLocation } from "react-router-dom"; import { AiOutlineEdit, AiOutlinePlusCircle, AiTwotoneDelete } from "react-icons/ai"; import { getCookie } from 'react-use-cookie'; import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; import Box from '@mui/material/Box'; -import InputLabel from '@mui/material/InputLabel'; import InputAdornment from '@mui/material/InputAdornment'; -import FormControl from '@mui/material/FormControl'; import TextField from '@mui/material/TextField'; import AccountCircle from '@mui/icons-material/AccountCircle'; import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import moment from "moment"; -import { set } from "date-fns"; + function Pricing() { @@ -50,7 +33,7 @@ function Pricing() { { field: 'price_line_id', headerName: '_id', hide: true }, { field: 'client', headerName: 'Client', width: 150, flex: 1 }, { field: 'client_recid', headerName: 'Client Id', width: 150, hide: true }, - { field: 'discount', headerName: 'Réduction (%)', width: 100, flex: 1 }, + { field: 'discount', headerName: 'Réduction (%)', width: 100, flex: 1 }, { field: 'date_debut', headerName: 'Date début', width: 150, flex: 1 }, { field: 'date_fin', headerName: 'Date Fin', width: 150, flex: 1 }, @@ -328,14 +311,14 @@ function Pricing() { if (document.getElementsByName("new_sessiondatedebut") && document.getElementsByName("new_sessiondatedebut")[0]) { document.getElementsByName("new_sessiondatedebut")[0].disabled = true; - document.getElementsByName("new_sessiondatedebut")[0].style.backgroundColor = "#ECEFF1"; + document.getElementsByName("new_sessiondatedebut")[0].style.backgroundColor = "#ECEFF1"; } if (document.getElementById("new_sessiondatefin")) { document.getElementById("new_sessiondatefin").disabled = true; document.getElementById("new_sessiondatefin").style.backgroundColor = "#ECEFF1"; - + } } @@ -395,6 +378,11 @@ function Pricing() { GetClientPrices(); GetClientlinked(); GetClientClass(); + + window.scrollTo({ + top: 0, + behavior: "smooth", + }); }, []); let [sessionStatus, setsessionStatus] = useState(false); @@ -828,8 +816,8 @@ function Pricing() { {String(iseditclientprice) === "1" &&
Modification du prix -   - :not(style)': { m: 1 }, width: '100%', }} onChange={DataUpdated_exist_price}> +   + :not(style)': { m: 1 }, width: '100%', }} onChange={DataUpdated_exist_price}> - +
@@ -951,8 +939,8 @@ function Pricing() { {String(isaddprice) === "1" &&
Creation d'un nouveau prix client -   - :not(style)': { m: 1 }, width: '100%', }} onChange={DataUpdated}> +   + :not(style)': { m: 1 }, width: '100%', }} onChange={DataUpdated}>
@@ -998,7 +986,7 @@ function Pricing() {
- +
diff --git a/src/components/Student_Account.js b/src/components/Student_Account.js new file mode 100644 index 0000000..971f934 --- /dev/null +++ b/src/components/Student_Account.js @@ -0,0 +1,552 @@ +import React, { useState, useEffect } from "react"; +import UpdateUserInfo from "../components/UpdateUserInfo"; +import bannerimg from "../mysy_img/MYSY_banner_compte.png"; +import profileimg from "../mysy_img/MYSY-profil-2.png"; +import Button from '@mui/material/Button'; +import { useHistory } from "react-router-dom"; + +import UserHistoryRecherche from "../components/UserHistoryRecherche"; +import { confirmAlert } from 'react-confirm-alert'; // Import +import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css +import { Helmet } from "react-helmet"; +import { useCookies } from "react-cookie"; +import axios from "axios"; +import { getCookie, } from 'react-use-cookie'; + +import UpgradeToPro from "./UpgradeToPro" +import Profil_Objectif from "./ProfilObjectif"; +import { useLocation } from "react-router-dom"; +import { FaHandPointRight } from "react-icons/fa"; +import Intranet_Factures_Client from "./Intranet_Factures_Client"; +import Intranet_Tous_Documents from "./Intranet_Tous_Documents"; +import Modules_Mes_Documents from "./Modules_Mes_Documents"; +import Intranet_Mes_Stagiaires from "./Intranet_Mes_Stagiaires"; + +function Student_Account() { + const [menu, setmenu] = useState("mes_stagiaires"); + const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']); + const [result, setResult] = useState(""); + const [myApiResponse, setmyApiResponse] = useState(""); + const stored_user = getCookie('tokenmysych'); + const history = useHistory(); + const [country_code, setcountry_code] = useState(""); + const [country_name, setcountry_name] = useState(""); + const [city, setcity] = useState(""); + const [postal, setpostal] = useState(""); + const [latitude, setlatitude] = useState(""); + const [longitude, setlongitude] = useState(""); + const [IPv4, setIPv4] = useState(""); + const [state, setstate] = useState(""); + const [userimgprofil, setuserimgprofil] = useState(); + const [userIp, setuserIp] = useState(""); + const [username, setusername] = useState(""); + const [migratedaccount, setmigratedaccount] = useState("0"); + + const apiUrl = process.env.REACT_APP_API_URL; + const formData = new FormData(); + + //alert("stored_user = "+stored_user); + const location = useLocation(); + useEffect(() => { + + var list_menu = ["affichage", "recherche", "upgradecompte", "profil_objectif", "mes_factures", "mes_documents"] + + // getImage(); + + if (typeof (stored_user) === "undefined" || String(stored_user) === '') { + //alert(" début puch"); + history.push("/Connexion"); + } + + + async function fetchData() { + const result = await axios('https://geolocation-db.com/json/',); + //alert(result.data.IPv4); + setuserIp(result.data.IPv4); + setcountry_code(result.data.country_code); + setcountry_name(result.data.country_name); + setcity(result.data.city); + setpostal(result.data.postal); + setlatitude(result.data.latitude); + setlongitude(result.data.longitude); + setIPv4(result.data.IPv4); + setstate(result.data.state); + setuserIp(result.data.IPv4); + } + GetUserNameFromToken(); + + fetchData(); + + + if (location && location.state && location.state.menu) { + displayProfil_Objectif(); + } + + if (location && location.state && location.state.firstconnexion) { + setfirstConnexion(location.state.firstconnexion); + } + + + + + }, []); + + const [myimage, setmyimage] = useState(); + const [isimage, setisimage] = useState(); + + function getImage(e) { + var myurl = process.env.REACT_APP_API_URL + "myclass/api/getRecodedImage/"; + var form = new FormData(); + form.append("token", stored_user); + form.append("type", "user"); + + axios.post(myurl, form).then(res => { + if (res.data.status != "False") { + //console.log(" getImage : In test res.data.status = " + res.data.status); + //console.log(" getImage: res.data.message.img = " + res.data.message); + if (res.data.message.img.length > 0) { + setisimage("True"); + } + else { + setisimage("False"); + } + setmyimage(res.data.message.img); + var ch_img = "data:image/png;base64," + res.data.message.img; + setuserimgprofil(ch_img); + } + else { + //console.log(" In Erreur res.data.status = " + res.data.status); + //console.log(" In Erreur res.data.message = " + res.data.message); + setisimage("False"); + setuserimgprofil(profileimg); + } + }).catch((error) => { + console.warn('Not good man :( mysearchtext = '); + setisimage("False"); + setuserimgprofil(profileimg); + }) + + } + + const [firstConnexion, setfirstConnexion] = useState(""); + + + function logout_confirmation() { + /* si c'est une connexion partner qui est active */ + if (typeof (stored_user) != "undefined") { + removeCookie('tokenmysych', { path: '/' }); + history.push("/Connexion"); + } + } + + function logout() { + confirmAlert({ + title: 'Deconnexion ?', + message: 'Confirmez la deconnexion', + buttons: [ + { + label: 'Oui', + onClick: () => logout_confirmation() + }, + { + label: 'Non', + onClick: () => { return } + } + ] + }); + } + + + const displayHistory = () => { + setmenu("recherche"); + }; + + + const displayProfil_Objectif = () => { + setmenu("profil_objectif"); + }; + + + const displayProfil_Facture = () => { + setmenu("mes_factures"); + }; + + const displayProfil_Devis = () => { + setmenu("mes_devis"); + }; + + const displayProfil_Convention = () => { + setmenu("mes_conventions"); + }; + + const displayProfil_Convocation = () => { + setmenu("mes_convocations"); + }; + + + const displayProfil_Attestation = () => { + setmenu("mes_attestations"); + }; + + + const displayProfil_Stagiaires = () => { + setmenu("mes_stagiaires"); + }; + + const displayProfil_Tout_Documents = () => { + setmenu("tout_documents"); + }; + + const displayProfil_Modules_Mes_Documents = () => { + setmenu("modules_mes_documents"); + }; + + const upgradetopro = () => { + setmenu("upgradecompte"); + }; + + const displayPersoInfo = () => { + setmenu("affichage"); + }; + + + + const [connected_user_data, setconnected_user_data] = useState(); + + function GetUserNameFromToken(event) { + + var form = new FormData(); + + form.append("token", stored_user); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_user_account/"; + + axios.post(myurl, form).then(res => { + // console.log(" In GetUserNameFromToken res.data.status = " + res.data.status); + // console.log(" In GetUserNameFromToken res.data.message = " + res.data.message); + if (String(res.data.status) === String("true")) { + + setusername(JSON.parse(res.data.message).email); + if (JSON.parse(res.data.message).migrated && + String(JSON.parse(res.data.message).migrated) === String("1")) { + setmigratedaccount(String(JSON.parse(res.data.message).migrated)); + } + + + setconnected_user_data(JSON.parse(res.data.message)); + + } + else { + //console.log(" In GetUserNameFromToken res.data.status = " + res.data.status); + //console.log(" In GetUserNameFromToken res.data.message = " + res.data.message); + //setmyApiResponse("false"); + //setmyApimyApiMessage("") + } + + + }).catch((error) => { + console.warn('In GetUserNameFromToken Not good man :( mysearchtext = ', error); + //setmyApiResponse("false"); + //setmyApimyApiMessage("") + }) + } + + + + function finaldeleteuseraccount(e) { + + var form = new FormData(); + form.append("token", stored_user); + // Ajout des info IP user + form.append("user_ip", IPv4); + form.append("user_country_code", country_code); + form.append("user_country_name", country_name); + form.append("user_city", city); + form.append("user_postal", postal); + form.append("user_latitude", latitude); + form.append("user_longitude", longitude); + form.append("user_state", state); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/send_mail_delete_user/"; + + + axios.post(myurl, form).then(res => { + if (String(res.data.status) != String("false")) { + //console.log(" In test res.data.status = " + res.data.status); + //console.log(" In test res.data.message = " + res.data.message); + setmyApiResponse("true"); + setResult(res.data.message) + alert(res.data.message); + + } + else { + //console.log(" In test res.data.status = " + res.data.status); + //console.log(" In test res.data.message = " + res.data.message); + setmyApiResponse("false"); + //setmyApimyApiMessage("") + } + + + }).catch((error) => { + console.warn('Not good man :( mysearchtext = '); + setmyApiResponse("false"); + //setmyApimyApiMessage("") + }) + + + } + + + function deletemyaccount(e) { + confirmAlert({ + title: 'Suppremier votre compte', + message: 'Cette action va supprimer toutes vos données, Confirmez-vous la suppression du compte ?', + buttons: [ + { + label: 'Oui', + onClick: () => finaldeleteuseraccount() + }, + { + label: 'Non', + onClick: () => { return } + } + ] + }); + } + + const [selectedFile, setSelectedFile] = useState(); + const [isSelected, setIsSelected] = useState(false); + const [isnewimage, setisnewimage] = useState(); + + + const changeHandler = (event) => { + let file_size = event.target.files[0].size; + + //or if you like to have name and type + let file_name = event.target.files[0].name; + let file_type = event.target.files[0].type; + + + //alert("file_size = "+file_size+" file_type = "+file_type+" a = "+a); + if (file_size > 100000) { + alert("L'image doit faire moins de 100 Kilo Octets"); + return; + } + setSelectedFile(event.target.files[0]); + setIsSelected(true); + setuserimgprofil(URL.createObjectURL(event.target.files[0])); + }; + + function sendImage(e) { + formData.append('File', selectedFile); + formData.append("token", stored_user); + formData.append("type", "user"); + fetch( + process.env.REACT_APP_API_URL + "myclass/api/recordImage/", + { + method: 'POST', + body: formData, + } + ).then((response) => response.json()) + .then((result) => { + //console.log('Success:', result['message']); + setIsSelected(false); + + }) + .catch((error) => { + console.error('Error:'); + setIsSelected(true); + }); + }; + + return ( +
+ + Création compte MySy Trainig Technology + + + + + + +

Éditeur Français de logiciels pour organisme de formation. Avec solutions de E-Learning, gestion administrative et gestion relation client nous accompagnons les organismes de formation à réaliser l’audit QUALIOPI en toute sérénité. Nous sommes les moins cher du marché. Nous vous accompagnons automatiser vos process : inscription, évaluation, émargement (qr-code), Check-list QUALIOPI, Personnalisation et édition documents, + Gestion formateurs, Catalogue formations personnalisé

+ + + +
+
+

Intranet Apprenant - Connexion MySy Training Technology

+
+
+
+
+ MySy Training profile image + + {!isSelected &&
+ + +
} + + {isSelected &&
+ +
} + +
+
{username && {username} } + {!username && xxxx }
+
+ + {/** Menu pour un utilisateur de type 'user'. Exemple, l'intranet du client d'un client */} + + + + + {/** Menu pour un utilisateur NON type 'user' exemple un apprenant */} + {connected_user_data && connected_user_data.type && + String(connected_user_data.type) === "student" && +
+ + +
INFORMATIONS PERSONNELLES
+
+
MES FORMATIONS
+
+
MON PLANNING
+
+
MES NOTES
+
+
MES DOCUMENTS
+
+
MODULE TOUS DOCUMENTS
+
+ + {/*
SUPPRIMER MON COMPTE
+
*/} +
} + +
+
+ + {String(firstConnexion) === "1" && +
+
+ Cher Utilisateur, c'est votre première connexion,
 
+ Nous sommes ravis de vous accueillir. Nous vous invitons à modifier votre mot de passe à partir du menu "MES INFORMATIONS" ==> Pavé "SECURITE" puis "MODIFIER"

+
+  
Merci. +
+ +
} + + {String(myApiResponse) === String("true") &&
+ {result} + +
} + + {String(myApiResponse) !== String("true") &&
+ {result} + +
} + + {connected_user_data && connected_user_data.type &&

ESPACE ENT - {connected_user_data.type}

} + + + {String(menu) === String("affichage") && } + + {String(menu) === String("recherche") && } + + {String(menu) === String("upgradecompte") && } + + {String(menu) === String("profil_objectif") && } + + {String(menu) === String("mes_factures") && connected_user_data && connected_user_data.partner_owner_recid && + connected_user_data.partner_client_id && + } + + + + + {String(menu) === String("modules_mes_documents") && connected_user_data && connected_user_data.partner_owner_recid && + connected_user_data.partner_client_id && + } + + {String(menu) === String("mes_devis") && connected_user_data && connected_user_data.partner_owner_recid && + connected_user_data.partner_client_id && + } + + {String(menu) === String("mes_conventions") && connected_user_data && connected_user_data.partner_owner_recid && + connected_user_data.partner_client_id && + } + + + {String(menu) === String("mes_convocations") && connected_user_data && connected_user_data.partner_owner_recid && + connected_user_data.partner_client_id && + } + + {String(menu) === String("mes_attestations") && connected_user_data && connected_user_data.partner_owner_recid && + connected_user_data.partner_client_id && + } + + + {String(menu) === String("mes_stagiaires") && connected_user_data && connected_user_data.partner_owner_recid && + connected_user_data.partner_client_id && + } + + + + + {String(menu) === String("mes_documents") && } + + +
+
+ + +
+
+ ); +} + +export default Student_Account; + diff --git a/src/components/detail_formation_automatic_files/new_detail_formation_2025.js b/src/components/detail_formation_automatic_files/new_detail_formation_2025.js index 7ea4471..7a2cd88 100644 --- a/src/components/detail_formation_automatic_files/new_detail_formation_2025.js +++ b/src/components/detail_formation_automatic_files/new_detail_formation_2025.js @@ -1459,10 +1459,12 @@ const New_C_Detail_Formation_2025 = (props) => { {String(DetailTraining["price"]) && String(DetailTraining["price"]) !== String("0") && DetailTraining.business_prices && Object.keys(DetailTraining.business_prices).length > 0 && DetailTraining["price"] &&
- + - - + {DetailTraining.business_prices && DetailTraining.business_prices.length > 0 &&
+ + +
}
}
@@ -1734,7 +1736,7 @@ const New_C_Detail_Formation_2025 = (props) => { {(JSON.parse(formation).date_fin).substring(0, 10)} A Distance } - {(JSON.parse(formation).mode_animation) === "1" && + {(JSON.parse(formation).mode_animation) === "1" && (JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&