From fec5fcb31912dc88fea903f03035749cde12dc6a Mon Sep 17 00:00:00 2001 From: cherif Date: Sun, 31 Dec 2023 18:06:20 +0100 Subject: [PATCH] 31/12/2023- 18h --- src/components/Apprenant.js | 205 ++++++++++- src/components/DisplayPartnerSession.js | 81 ++++- src/components/DisplayPartnerStagiaires.js | 326 +++++++++++++++++- .../DisplayPartnerTrainingsPagination.js | 130 ++++++- src/components/Employes.js | 115 +++++- src/components/Materiels.js | 2 + src/styles/components/_apprenant.scss | 44 ++- .../components/_displaypartnersession.scss | 42 +++ src/styles/components/_toggleswitch.scss | 1 + 9 files changed, 906 insertions(+), 40 deletions(-) diff --git a/src/components/Apprenant.js b/src/components/Apprenant.js index 3c94afa..f1fbb8e 100644 --- a/src/components/Apprenant.js +++ b/src/components/Apprenant.js @@ -21,7 +21,7 @@ import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; import { FcSearch } from "react-icons/fc"; import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint, FcAlarmClock, FcMultipleSmartphones, FcWorkflow } from "react-icons/fc"; - +import { format } from 'date-fns' import InputAdornment from '@mui/material/InputAdornment'; import { AiFillCloseCircle, AiOutlineConsoleSql } from "react-icons/ai"; import Box from '@mui/material/Box'; @@ -47,6 +47,10 @@ import Autocomplete from '@mui/material/Autocomplete'; import { FcOpenedFolder } from "react-icons/fc"; import Module_Absence from "./Module_Absence"; import { RiMoreFill } from "react-icons/ri"; +import DatePicker from "react-datepicker"; +import "react-datepicker/dist/react-datepicker.css"; +import moment from "moment"; + const Apprenant = (props) => { const history = useHistory(); @@ -71,6 +75,15 @@ const Apprenant = (props) => { { field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 250 }, { field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 250 }, { field: 'email', headerName: 'Email', hide: false, flex: 1, minWidth: 250 }, + { field: 'telephone', headerName: 'Téléphone', hide: true, editable: false, Width: 0 }, + { field: 'date_naissance', headerName: 'date_naissance', hide: true, editable: false, Width: 0 }, + { field: 'adresse', headerName: 'adresse', hide: true, editable: false, Width: 0 }, + { field: 'code_postal', headerName: 'code_postal', hide: true, editable: false, Width: 0 }, + { field: 'ville', headerName: 'ville', hide: true, editable: false, Width: 0 }, + { field: 'pays', headerName: 'pays', hide: true, editable: false, Width: 0 }, + { field: 'employeur', headerName: 'Employeur', minWidth: 150, hide: true, editable: false }, + { field: 'client_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: false }, + { @@ -294,6 +307,8 @@ const Apprenant = (props) => { const [p_detail_civilite, setp_detail_civilite] = useState(""); const [p_detail_email, setp_detail_email] = useState(""); + const [p_detail_naissance, setp_detail_naissance] = useState(new Date().toLocaleDateString('fr-FR')); + const [p_detail_nom, setp_detail_nom] = useState(""); const [p_detail_prenom, setp_detail_prenom] = useState(""); const [p_detail_telephone, setp_detail_telephone] = useState(""); @@ -326,6 +341,11 @@ const Apprenant = (props) => { const [p_one_civilite, setp_one_civilite] = useState(""); const [p_one_email, setp_one_email] = useState(""); + + const [p_one_naissance, setp_one_naissance] = useState(new Date().toLocaleDateString('fr-FR')); + + + const [p_one_nom, setp_one_nom] = useState(""); const [p_one_prenom, setp_one_prenom] = useState(""); const [p_one_telephone, setp_one_telephone] = useState(""); @@ -440,6 +460,10 @@ const Apprenant = (props) => { setp_detail_email(mylocaltraining.email); } + if (mylocaltraining.date_naissance) { + setp_detail_naissance(mylocaltraining.date_naissance); + } + if (mylocaltraining.nom) { setp_detail_nom(mylocaltraining.nom); } @@ -935,6 +959,7 @@ const Apprenant = (props) => { setp_detail_tuteur2_pays(''); setp_detail_tuteur2_include_com(false); + setp_detail_naissance(new Date().toLocaleDateString('fr-FR')); setisimgclassSelected(""); setuserimgclassprofil(""); @@ -947,6 +972,11 @@ const Apprenant = (props) => { document.getElementsByName("field_detail_civilite")[0].value = ""; } + if (document.getElementsByName("field_detail_naissance") && document.getElementsByName("field_detail_naissance")[0]) { + document.getElementsByName("field_detail_naissance")[0].value = ""; + + } + if (document.getElementsByName("field_detail_email") && document.getElementsByName("field_detail_email")[0]) { document.getElementsByName("field_detail_email")[0].value = ""; @@ -1040,6 +1070,10 @@ const Apprenant = (props) => { setp_one_civilite(''); setp_one_email(''); + + + setp_one_naissance(new Date().toLocaleDateString('fr-FR')); + setp_one_nom(''); setp_one_prenom(''); setp_one_telephone(''); @@ -1076,6 +1110,11 @@ const Apprenant = (props) => { document.getElementsByName("field_detail_email")[0].style.backgroundColor = "#ECEFF1"; } + if (document.getElementsByName("field_detail_naissance") && document.getElementsByName("field_detail_naissance")[0]) { + document.getElementsByName("field_detail_naissance")[0].disabled = true; + document.getElementsByName("field_detail_naissance")[0].style.backgroundColor = "#ECEFF1"; + } + if (document.getElementsByName("field_detail_nom") && document.getElementsByName("field_detail_nom")[0]) { document.getElementsByName("field_detail_nom")[0].disabled = true; document.getElementsByName("field_detail_nom")[0].style.backgroundColor = "#ECEFF1"; @@ -1176,6 +1215,14 @@ const Apprenant = (props) => { document.getElementsByName("field_detail_email")[0].style.backgroundColor = "#FFFFFF"; } + + if (document.getElementsByName("field_detail_naissance") && document.getElementsByName("field_detail_naissance")[0]) { + document.getElementsByName("field_detail_naissance")[0].disabled = false; + document.getElementsByName("field_detail_naissance")[0].style.backgroundColor = "#FFFFFF"; + } + + + if (document.getElementsByName("field_detail_nom") && document.getElementsByName("field_detail_nom")[0]) { document.getElementsByName("field_detail_nom")[0].disabled = false; document.getElementsByName("field_detail_nom")[0].style.backgroundColor = "#FFFFFF"; @@ -1259,6 +1306,12 @@ const Apprenant = (props) => { return; } + + if (p_detail_naissance.trim() == "") { + alert(" Vous devez saisir la date de naissance de l'apprenant"); + return; + } + if (p_detail_civilite.trim() == "") { alert(" Vous devez saisir la civilité de l'apprenant"); return; @@ -1281,6 +1334,8 @@ const Apprenant = (props) => { form.append("prenom", p_detail_prenom); form.append("civilite", p_detail_civilite); + form.append("date_naissance", p_detail_naissance); + if (p_detail_telephone) form.append("telephone", p_detail_telephone); else @@ -1579,6 +1634,10 @@ const Apprenant = (props) => { }; const Dialog_apprenant_handleClose_buton = () => { + + setuserimgclassprofil(""); + setselected_row_data_json_age(""); + setgridline_id(''); setDialog_apprenant_open(false); }; @@ -2004,7 +2063,7 @@ const Apprenant = (props) => { axios.post(myurl, form).then(res => { //console.log(" In Get_Appenant_List_Inscription res.data.status = " + res.data.status); - console.log(" In Get_Appenant_List_Inscription res.data.message r_class = " + res.data.message); + //console.log(" In Get_Appenant_List_Inscription res.data.message r_class = " + res.data.message); if (String(res.data.status) === String("true")) { setGet_Appenant_List_Inscription_api("true"); @@ -2167,6 +2226,15 @@ const Apprenant = (props) => { function clean_all_filters() { + setp_filtre1(); + setp_filtre1_value(); + + setp_filtre2(); + setp_filtre2_value(); + + setgridline_id(''); + + setSelectionModel([]); setGet_All_Apprenant_result([]); @@ -2529,6 +2597,11 @@ const Apprenant = (props) => { return; } + if (p_one_naissance.trim() == "") { + alert(" Vous devez saisir la date de naissance de l'apprenant"); + return; + } + if (p_one_civilite.trim() == "") { alert(" Vous devez saisir la civilité de l'apprenant"); return; @@ -2549,6 +2622,7 @@ const Apprenant = (props) => { form.append("email", p_one_email); form.append("prenom", p_one_prenom); form.append("civilite", p_one_civilite); + form.append("date_naissance", p_one_naissance); @@ -3464,6 +3538,8 @@ const Apprenant = (props) => { }); } + + const [selected_row_data_json_age, setselected_row_data_json_age] = useState(""); const [fiche_apprenant_id, setfiche_apprenant_id] = React.useState(""); const [Dialog_fiche_apprenant_message, setDialog_fiche_apprenant_message] = React.useState(false); @@ -3519,12 +3595,23 @@ const Apprenant = (props) => { Apprenant +
+
+
+
+ +
+ +
+ + +
Civilité
- {Get_All_Apprenant_result && selected_apprenant_row_id && selected_apprenant_id && + {Get_All_Apprenant_result && selected_apprenant_id && String(selected_apprenant_id).length > 0 &&
{JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).civilite}
} @@ -3532,22 +3619,59 @@ const Apprenant = (props) => {
- Nom + Nom & Prénom
- {Get_All_Apprenant_result && selected_apprenant_row_id && selected_apprenant_id && + {Get_All_Apprenant_result && selected_apprenant_id && String(selected_apprenant_id).length > 0 &&
- {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).nom} + + {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).nom.toUpperCase()} {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).prenom.charAt(0).toUpperCase() + JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).prenom.slice(1)} + + +
} +
+ +
+
+ E-mail +
+ {Get_All_Apprenant_result && selected_apprenant_id && + String(selected_apprenant_id).length > 0 &&
+ {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).email}
}
- Prénom + Téléphone
- {Get_All_Apprenant_result && selected_apprenant_row_id && selected_apprenant_id && + {Get_All_Apprenant_result && selected_apprenant_id && String(selected_apprenant_id).length > 0 &&
- {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).prenom} + {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).telephone} +
} +
+ +
+
+ Age +
+ {Get_All_Apprenant_result && selected_apprenant_id && + String(selected_apprenant_id).length > 0 &&
+ {selected_row_data_json_age} ans - {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).date_naissance} +
} + +
+ + +
+
+ Adresse postale +
+ {Get_All_Apprenant_result && selected_apprenant_id && + String(selected_apprenant_id).length > 0 &&
+ {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).adresse}
+ {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).code_postal} {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).ville}
+ {JSON.parse(Get_All_Apprenant_result[selected_apprenant_row_id]).pays.toUpperCase()}
}
@@ -4399,6 +4523,14 @@ const Apprenant = (props) => { nom: JSON.parse(item).nom, prenom: JSON.parse(item).prenom, email: JSON.parse(item).email, + telephone: JSON.parse(item).telephone, + date_naissance: JSON.parse(item).date_naissance, + adresse: JSON.parse(item).adresse, + civilcode_postalite: JSON.parse(item).code_postal, + ville: JSON.parse(item).ville, + pays: JSON.parse(item).pays, + employeur: JSON.parse(item).employeur, + client_nom: JSON.parse(item).client_rattachement_nom, } ))} @@ -4408,11 +4540,26 @@ const Apprenant = (props) => { className="datagridclass" onRowDoubleClick={(newSelectionModel) => { + setuserimgclassprofil(""); + setselected_row_data_json_age(""); setgridline_id(newSelectionModel.row.id); setselected_apprenant_id(newSelectionModel.row._id); setselected_apprenant_row_id(newSelectionModel.row.id); setselected_apprenant_email(newSelectionModel.row.email); + Get_Apprenant_Images(newSelectionModel.row._id); + + var local_date_naissance = newSelectionModel.row.date_naissance; + + if (local_date_naissance) { + var date_eval = new Date(moment(local_date_naissance, "DD/MM/YYYY")); + var diff = Date.now() - date_eval.getTime(); + var age = new Date(diff); + var reel_age = Math.abs(age.getUTCFullYear() - 1970); + setselected_row_data_json_age(reel_age) + + } + setDialog_apprenant_message(String(JSON.parse(Get_All_Apprenant_result[newSelectionModel.row.id]).title)); setDialog_apprenant_open(true); @@ -4708,6 +4855,24 @@ 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' + + /> +
+
Téléphone
{ />
+ + {/* -- debut champs specifiques **/}
@@ -5085,6 +5252,26 @@ 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' + + /> + +
+ +
Téléphone
{ return; } + var one_naissance_part = ""; + if (p_one_naissance_part) + one_naissance_part = p_one_naissance_part; + + if (one_naissance_part.trim() == "") { + alert(" Vous devez saisir la date de naissance du participant"); + return; + } + + + var one_email_part = ""; if (p_one_email_part) one_email_part = p_one_email_part; @@ -2250,6 +2261,10 @@ const DisplayPartnerSession = (props) => { form.append("nom", one_nom_part); form.append("prenom", one_prenom_part); form.append("email", one_email_part.trim()); + + form.append("date_naissance", p_one_naissance_part.trim()); + + form.append("telephone", one_phone_part); form.append("status", myinscript_status); form.append("modefinancement", ""); @@ -3465,6 +3480,7 @@ const DisplayPartnerSession = (props) => { setp_one_nom_part(); setp_one_prenom_part(); setp_one_email_part(); + setp_one_naissance_part(new Date().toLocaleDateString('fr-FR')); setp_one_phone_part(); setp_one_status_part(); @@ -3881,7 +3897,7 @@ const DisplayPartnerSession = (props) => { var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation/"; - + axios.post(myurl, form).then(res => { //console.log(" In One_CreateSessionFormation res.data.status = " + res.data.status); //console.log(" In One_CreateSessionFormation res.data.message r_class = " + res.data.message); @@ -4742,6 +4758,8 @@ const DisplayPartnerSession = (props) => { const [p_one_nom_part, setp_one_nom_part] = useState(); const [p_one_prenom_part, setp_one_prenom_part] = useState(); const [p_one_email_part, setp_one_email_part] = useState(); + const [p_one_naissance_part, setp_one_naissance_part] = useState(new Date().toLocaleDateString('fr-FR')); + const [p_one_phone_part, setp_one_phone_part] = useState(); const [p_one_status_part, setp_one_status_part] = useState(); const [p_one_status_part_lable, setp_one_status_part_lable] = useState(); @@ -5550,6 +5568,7 @@ const DisplayPartnerSession = (props) => { setp_filtre1_value(); setp_filtre2(); setp_filtre2_value(); + setgridline_id(''); setnb_stagiaire_Preinscrit(""); setnb_stagiaire_Inscrit(""); @@ -9329,7 +9348,7 @@ const DisplayPartnerSession = (props) => { // 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) { @@ -11552,6 +11571,26 @@ const DisplayPartnerSession = (props) => { />
+
Date Naissance
+ { + setp_one_naissance_part(format(date, 'd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' + + /> + +
+ +
téléphone
{ />
+
Date Naissance
+ { + setp_one_naissance_part(format(date, 'd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' + + /> + +
+
Téléphone
{ />
+
Date Naissance
+ { + setp_one_naissance_part(format(date, 'd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' + + /> + +
+
Téléphone
{ const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(80); const columns = [ - { field: '_id', headerName: '_id', hide: true, editable: false }, - { field: 'session_id', headerName: 'session_id', hide: true, editable: false }, - { field: 'id', headerName: 'id', hide: true }, - { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, editable: false }, + { field: '_id', headerName: '_id', hide: true, editable: false, Width: 0 }, + { field: 'session_id', headerName: 'session_id', hide: true, editable: false, Width: 0 }, + { field: 'id', headerName: 'id', hide: true, Width: 0 }, + { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, editable: false, Width: 0 }, + + { field: 'telephone', headerName: 'Téléphone', hide: true, editable: false, Width: 0 }, + { field: 'date_naissance', headerName: 'date_naissance', hide: true, editable: false, Width: 0 }, + { field: 'adresse', headerName: 'adresse', hide: true, editable: false, Width: 0 }, + { field: 'code_postal', headerName: 'code_postal', hide: true, editable: false, Width: 0 }, + { field: 'ville', headerName: 'ville', hide: true, editable: false, Width: 0 }, + { field: 'pays', headerName: 'pays', hide: true, editable: false, Width: 0 }, + { field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false }, @@ -148,6 +156,8 @@ const DisplayPartnerStagiaires = (props) => { +
+
+ +
+ + + + + + + + { class_internal_url: JSON.parse(item).class_internal_url, civilite: JSON.parse(item).civilite, + telephone: JSON.parse(item).telephone, + date_naissance: JSON.parse(item).date_naissance, + adresse: JSON.parse(item).adresse, + civilcode_postalite: JSON.parse(item).code_postal, + ville: JSON.parse(item).ville, + pays: JSON.parse(item).pays, + + + } ))} @@ -6197,9 +6439,27 @@ const DisplayPartnerStagiaires = (props) => { className="datagridclass" onRowDoubleClick={(newSelectionModel) => { + ///setuserimgclassprofil(""); + + setselected_row_data_json_age(''); setgridline_id(newSelectionModel.row.id); setselected_id_status(newSelectionModel.row.status); - handleClick_edit_session_From_Line(newSelectionModel.row.id); + + //getStagiaireImages(newSelectionModel.row.class_internal_url, newSelectionModel.row.session_id, newSelectionModel.row.email); + + var al = JSON.parse(rowss[newSelectionModel.row.id]) + if (al.date_naissance) { + var date_eval = new Date(moment(al.date_naissance, "DD/MM/YYYY")); + var diff = Date.now() - date_eval.getTime(); + var age = new Date(diff); + var reel_age = Math.abs(age.getUTCFullYear() - 1970); + setselected_row_data_json_age(reel_age) + + } + + + setselected_row_data_json(JSON.parse(rowss[newSelectionModel.row.id])); + setDialog_stagiaire_open(true); }} @@ -6614,6 +6874,25 @@ const DisplayPartnerStagiaires = (props) => { /> +
Date Naissance
+ { + setp_one_naissance_part(format(date, 'd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' + + /> + +
+
Téléphone
{ />
+
Date Naissance
+ { + setp_detail_naissance(format(date, 'd/MM/yyyy')); + setparticipant_data_changed("1"); + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' + + /> + +
+
Téléphone
{ {String(participant_data_edit_mode) !== "1" &&
- - {String(selected_id_status) !== "1" && (!p_detail_apprenant_id || String(p_detail_apprenant_id).trim().length <= 3 ) && } {selected_id_status && String(selected_id_status) === "1" && p_detail_apprenant_id && diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index c7e17c4..aa5177c 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -32,9 +32,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 ToggleSwitch from "./ToggleSwitch"; const DistplayPartnerTraningsPage = (props) => { - const history = useHistory(); const [myApiResponse, setmyApiResponse] = useState("false"); const filters = [ @@ -234,10 +234,19 @@ const DistplayPartnerTraningsPage = (props) => { const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(120); const columns = [ - { field: 'id', headerName: 'id', hide: true }, - { field: '_id', headerName: '_id', hide: true }, - { field: 'lms_class_code', headerName: 'lms_class_code', hide: true }, - { field: 'zone_diffusion', headerName: 'zone_diffusion', hide: true }, + { field: 'id', headerName: 'id', hide: true, maxWidth: 1, }, + { field: '_id', headerName: '_id', hide: true, maxWidth: 1, }, + { field: 'lms_class_code', headerName: 'lms_class_code', hide: true, Width: 0, }, + { field: 'duration', headerName: 'duration', hide: true, Width: 0, }, + { field: 'presentiel', headerName: 'Présentiel', hide: true, Width: 0, }, + { field: 'distanciel', headerName: 'Distanciel', hide: true, Width: 0, }, + { field: 'cible', headerName: 'Cible', hide: true, Width: 0, }, + { field: 'duration_unit', headerName: 'duration_unit', hide: true, Width: 0, }, + { field: 'duration_in_hour', headerName: 'duration_in_hour', hide: true, Width: 0, }, + { field: 'currency', headerName: 'currency', hide: true, Width: 0, }, + + + { field: 'zone_diffusion', headerName: 'zone_diffusion', hide: true, maxWidth: 1, }, { field: 'internal_url', headerName: 'internal_url', hide: true }, { field: 'external_code', headerName: 'Code Formation', hideable: false, minWidth: 150, flex: 1, maxWidth: 250, editable: false }, { field: 'title', headerName: 'Titre', flex: 1, hideable: false, minWidth: 320, flex: 1, editable: false }, @@ -1231,6 +1240,9 @@ const DistplayPartnerTraningsPage = (props) => { Dialog_formation_handleClose_buton(); } + + const [selected_row_data_json, setselected_row_data_json] = useState([]); + return (
@@ -1250,13 +1262,101 @@ const DistplayPartnerTraningsPage = (props) => {
- Civilité + Code
- ----- + {}
+
+
+ Titre +
+
+ {} +
+
+ +
+
+ Domaine +
+
+ {} +
+
+ +
+
+ Coût +
+
+ + {} +
+
+ +
+
+ Durée +
+
+ {selected_row_data_json.duration_in_hour && String(selected_row_data_json.duration_unit) === "jour" && + } + + {String(selected_row_data_json.duration_unit) !== "jour" && + } +
+
+ +
+
+ Présentiel +
+
+ + + {selected_row_data_json.published && } +
+
+ +
+
+ Distanciel +
+
+ + + {selected_row_data_json.published && } + +
+
+ +
+
+ Publié Web +
+
+ + {selected_row_data_json.published && } + +
+
+
+
+ Cible +
+
+ {} +
+
  @@ -1621,6 +1721,14 @@ const DistplayPartnerTraningsPage = (props) => { description: parse((JSON.parse(item).description).replace(/(<([^>]+)>)/ig, '')), published: JSON.parse(item).published, lms_class_code: JSON.parse(item).lms_class_code, + duration: JSON.parse(item).duration, + duration_unit: JSON.parse(item).duration_unit, + duration_in_hour: JSON.parse(item).duration_in_hour, + presentiel: JSON.parse(item).presentiel.presentiel, + distanciel: JSON.parse(item).presentiel.distantiel, + cible: JSON.parse(item).pourqui, + currecny: JSON.parse(item).currecny, + } ))} @@ -1633,11 +1741,13 @@ const DistplayPartnerTraningsPage = (props) => { Closecreatetraining(); closeTrainingForm(); + var al = JSON.parse(rowss[newSelectionModel.row.id]) + + setselected_row_data_json(JSON.parse(rowss[newSelectionModel.row.id])); + + setreftrainingtoupdate(newSelectionModel.row.internal_url); setexternalcodetraining_toupdate(newSelectionModel.row.external_code); - - - setDialog_formation_open(true); } diff --git a/src/components/Employes.js b/src/components/Employes.js index 995a5f5..8e65f9f 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -583,6 +583,7 @@ const Employes = (props) => { function clean_all_filters() { + setgridline_id(''); setp_filtre1(); setp_filtre1_value(); @@ -802,7 +803,9 @@ const Employes = (props) => { function Display_Detail_Employe(employee_id) { - //clearDetailAttendeFields(); + + + clearEmployeeFields() setadd_One_Employee(); setdisplay_detail_employe("1"); @@ -811,6 +814,35 @@ const Employes = (props) => { } + function clearEmployeeFields() { + + setp_one_detail_nom(''); + setp_one_detail_prenom(''); + setp_one_detail_mail(''); + setp_one_detail_naissance(new Date().toLocaleDateString('fr-FR')); + setp_one_detail_tel(''); + setp_one_detail_adresse(''); + setp_one_detail_code_postal(''); + setp_one_detail_ville(''); + setp_one_detail_resp_hierarchie_id(''); + setp_one_detail_civilite(''); + setp_one_detail_fonction(''); + setp_one_detail_profil(''); + setp_one_detail_profil_label(''); + + setp_one_detail_pays(''); + setp_one_detail_tel_mobile(''); + setp_one_detail_linkedIn(''); + setp_one_detail_facebook(''); + setp_one_detail_twitter(''); + setp_one_detail_ismanager('0'); + + setp_one_detail_ismanager_label(''); + setp_one_detail_resp_hierarchie_nom(''); + setp_one_detail_resp_hierarchie_prenom(''); + + } + function handleClick_delete(event, cellValues) { var local_rh_id = cellValues.row._id; @@ -831,6 +863,10 @@ const Employes = (props) => { const [p_detail_nom, setp_detail_nom] = useState(); const [p_detail_prenom, setp_detail_prenom] = useState(); const [p_detail_mail, setp_detail_mail] = useState(); + + const [p_detail_naissance, setp_detail_naissance] = useState(new Date().toLocaleDateString('fr-FR')); + + const [p_detail_tel, setp_detail_tel] = useState(); const [p_detail_adresse, setp_detail_adresse] = useState(); const [p_detail_code_postal, setp_detail_code_postal] = useState(); @@ -857,6 +893,11 @@ const Employes = (props) => { const [p_one_detail_nom, setp_one_detail_nom] = useState(); const [p_one_detail_prenom, setp_one_detail_prenom] = useState(); const [p_one_detail_mail, setp_one_detail_mail] = useState(); + + const [p_one_detail_naissance, setp_one_detail_naissance] = useState(new Date().toLocaleDateString('fr-FR')); + + + const [p_one_detail_tel, setp_one_detail_tel] = useState(); const [p_one_detail_adresse, setp_one_detail_adresse] = useState(); const [p_one_detail_code_postal, setp_one_detail_code_postal] = useState(); @@ -900,9 +941,11 @@ const Employes = (props) => { var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Ressource_Humaine/"; + setLoading(true); axios.post(myurl, form).then(res => { if (String(res.data.status) === "true") { + setLoading(false); //console.log(" In Get_Employee_Data res.data.status = " + res.data.status); //console.log(" In Get_Employee_Data res.data.message r_class = " + res.data.message); setGetAttendee_api("true"); @@ -923,6 +966,10 @@ const Employes = (props) => { setp_detail_mail(mylocal_employe.email); } + if (mylocal_employe.date_naissance) { + setp_detail_naissance(mylocal_employe.date_naissance); + } + if (mylocal_employe.telephone_mobile) { setp_detail_tel_mobile(mylocal_employe.telephone_mobile); @@ -1060,6 +1107,7 @@ const Employes = (props) => { } else { + setLoading(false); setGetAttendee_api("false"); setGetAttendee_message(res.data.message); alert(res.data.message); @@ -1442,6 +1490,11 @@ const Employes = (props) => { document.getElementsByName("detail_mail")[0].style.backgroundColor = "#ECEFF1"; } + if (document.getElementsByName("detail_naissance")[0]) { + document.getElementsByName("detail_naissance")[0].disabled = true; + document.getElementsByName("detail_naissance")[0].style.backgroundColor = "#ECEFF1"; + } + if (document.getElementsByName("detail_tel")[0]) { document.getElementsByName("detail_tel")[0].disabled = true; @@ -1548,6 +1601,9 @@ const Employes = (props) => { document.getElementsByName("detail_mail")[0].disabled = false; document.getElementsByName("detail_mail")[0].style.backgroundColor = "#FFFFFF"; + document.getElementsByName("detail_naissance")[0].disabled = false; + document.getElementsByName("detail_naissance")[0].style.backgroundColor = "#FFFFFF"; + document.getElementsByName("detail_tel")[0].disabled = false; document.getElementsByName("detail_tel")[0].style.backgroundColor = "#FFFFFF"; @@ -1637,6 +1693,7 @@ const Employes = (props) => { form.append("token", stored_cookie); form.append("nom", p_detail_nom); form.append("email", p_detail_mail); + form.append("date_naissance", p_detail_naissance); if (p_detail_prenom) form.append("prenom", p_detail_prenom); @@ -2100,6 +2157,7 @@ const Employes = (props) => { setDelete_Employee_api("true"); setDelete_Employee_result(res.data.message); clean_all_filters(); + clearEmployeeFields(); alert(res.data.message); } else { @@ -2186,6 +2244,7 @@ const Employes = (props) => { function submenu_add_one_employee() { setdisplay_detail_employe(); + clearEmployeeFields(); setadd_One_Employee("1"); setsubmenu("detail_employe"); @@ -2233,12 +2292,20 @@ const Employes = (props) => { } + if (p_one_detail_naissance.trim() == "") { + alert(" Vous devez saisir la date de naissance l'employé"); + return; + } + + + if (p_one_detail_mail.trim() == "") { alert(" Vous devez saisir l'email de l'employé"); return; } + var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; if (!p_one_detail_mail.trim().match(validRegex)) { alert("L'adresse email est invalide."); @@ -2253,6 +2320,7 @@ const Employes = (props) => { form.append("email", p_one_detail_mail); form.append("prenom", p_one_detail_prenom); form.append("civilite", p_one_detail_civilite); + form.append("date_naissance", p_one_detail_naissance); @@ -5260,6 +5328,29 @@ const Employes = (props) => { />
+ +
Date Naissance
+ { + setp_detail_naissance(format(date, 'd/MM/yyyy')); + setEmployee_data_changed("1"); + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' + + /> + + +
+ + +
Téléphone Mobile
{ />
+
Date Naissance
+ + { + setp_one_detail_naissance(format(date, 'd/MM/yyyy')); + setEmployee_data_changed("1"); + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + locale='fr-FR' + + /> + + +
+ +
Téléphone Mobile
{ } function clean_all_filters() { + + setgridline_id(''); setp_filtre1(); setp_filtre1_value(); diff --git a/src/styles/components/_apprenant.scss b/src/styles/components/_apprenant.scss index a370429..cfd1df9 100644 --- a/src/styles/components/_apprenant.scss +++ b/src/styles/components/_apprenant.scss @@ -377,8 +377,17 @@ .img_class_logo { display: block; - width: 128px; - height: 128px; + width: 96px; + height: 96px; + border-radius: 10px !important; + border: 1px solid black; + float: left; + } + + .img_class_logo_mini { + display: block; + width: 64px; + height: 64px; border-radius: 10px !important; border: 1px solid black; float: left; @@ -1010,8 +1019,17 @@ .img_class_logo { display: block; - width: 168px; - height: 168px; + width: 112px; + height: 112px; + border-radius: 10px !important; + border: 1px solid black; + float: left; + } + + .img_class_logo_mini { + display: block; + width: 96px; + height: 96px; border-radius: 10px !important; border: 1px solid black; float: left; @@ -1686,6 +1704,15 @@ float: left; } + .img_class_logo_mini { + display: block; + width: 112px; + height: 112px; + border-radius: 10px !important; + border: 1px solid black; + float: left; + } + .bton_supprime_image_class { font-size: small; text-align: center; @@ -2319,6 +2346,15 @@ float: left; } + .img_class_logo_mini { + display: block; + width: 112px; + height: 112px; + border-radius: 10px !important; + border: 1px solid black; + float: left; + } + .bton_supprime_image_class { font-size: small; text-align: center; diff --git a/src/styles/components/_displaypartnersession.scss b/src/styles/components/_displaypartnersession.scss index 8267681..48a08bc 100644 --- a/src/styles/components/_displaypartnersession.scss +++ b/src/styles/components/_displaypartnersession.scss @@ -693,6 +693,15 @@ width: 200px !important; } + .img_class_logo_mini { + display: block; + width: 64px; + height: 64px; + border-radius: 10px !important; + border: 1px solid black; + float: left; + } + } @media only screen and (min-width: 601px) and (max-width: 991px) { @@ -1316,6 +1325,15 @@ width: 500px !important; } + .img_class_logo_mini { + display: block; + width: 64px; + height: 64px; + border-radius: 10px !important; + border: 1px solid black; + float: left; + } + } @media only screen and (min-width: 992px) and (max-width: 1199px) { @@ -1862,6 +1880,15 @@ width: 500px !important; } + .img_class_logo_mini { + display: block; + width: 112px; + height: 112px; + border-radius: 10px !important; + border: 1px solid black; + float: left; + } + } @media only screen and (min-width: 1200px) { @@ -2529,6 +2556,15 @@ top: -13px; } + .img_class_logo_mini { + display: block; + width: 112px; + height: 112px; + border-radius: 10px !important; + border: 1px solid black; + float: left; + } + } // end media @@ -2623,8 +2659,14 @@ .MuiMenu-paper { max-width: 30% !important; + } + + .MuiPaper-root{ + border-radius: 10px !important; + background: #F8F9F9 !important; + } } diff --git a/src/styles/components/_toggleswitch.scss b/src/styles/components/_toggleswitch.scss index 8c852a1..6bb45d4 100644 --- a/src/styles/components/_toggleswitch.scss +++ b/src/styles/components/_toggleswitch.scss @@ -1,6 +1,7 @@ .toggleswitch { .container { text-align: center; + padding-right: 5px !important; } .toggle-switch { position: relative;