From ed7f18091efcd49d5efc7639c66b49008dea7f03 Mon Sep 17 00:00:00 2001 From: cherif Date: Fri, 17 Nov 2023 16:04:30 +0100 Subject: [PATCH] 17/11/2023 - 16h --- src/components/AddClassManual.js | 33 +++- src/components/DisplayPartnerSession.js | 143 +++++++++++++----- src/components/DisplayPartnerStagiaires.js | 84 +++++++--- src/components/Employes.js | 96 +++++++++--- src/components/GestionAdministrative.js | 79 ++++++++-- src/components/Inscription_Information.js | 62 +++++--- src/components/Module_Agenda.js | 15 +- .../Partner_Config_Session_Steps.js | 2 - .../components/_displaypartnersession.scss | 3 +- 9 files changed, 392 insertions(+), 125 deletions(-) diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index 75a206b..8b67b4f 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -254,7 +254,7 @@ const AddClassManual = (props) => { //document.getElementsByName("description2")[0].value = ""; - + document.getElementsByName("distentiel")[0].value = ""; document.getElementsByName("price")[0].value = ""; document.getElementsByName("domaine")[0].value = ""; @@ -1520,8 +1520,8 @@ const AddClassManual = (props) => { /> - -
+ +
{ rows_champs_specifics.map((champ_spec) => (
- { change_champs_spec_handle(e.target.value); //setEmployee_data_changed("1"); }} - /> + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && { + change_champs_spec_handle(e.target.value); + //setEmployee_data_changed("1"); + }} + />} +
))} diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index b69ca0a..37d26f6 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -20,7 +20,7 @@ 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 { FcCancel, FcApproval, FcAcceptDatabase, FcPrint, FcAlarmClock } from "react-icons/fc"; import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; import { format } from 'date-fns' @@ -43,6 +43,8 @@ import { Fab } from "@material-ui/core"; import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io"; import { AiTwotoneEdit, AiTwotoneSave } from "react-icons/ai"; +import ToggleSwitch from "./ToggleSwitch"; + const DisplayPartnerSession = (props) => { const history = useHistory(); const [submenu, setsubmenu] = useState(""); @@ -117,7 +119,7 @@ const DisplayPartnerSession = (props) => { { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, { field: 'class_internal_url', headerName: 'class_internal_url', hide: true }, - { field: 'code_session', headerName: 'Code session', hide: false, flex: 1 }, + { field: 'code_session', headerName: 'Code session', hide: false, flex: 1, minWidth: 150 }, { field: 'statut', headerName: 'Statut', hide: true, width: datagrid_columns_size_model2, valueFormatter: (params) => { @@ -134,7 +136,7 @@ const DisplayPartnerSession = (props) => { field: 'etape', headerName: 'Etape', hide: false, width: datagrid_columns_size_model2, }, - { field: 'class_external_code', headerName: 'Code Formation', align: "center", hideable: true, flex: 1, hide: false, }, + { field: 'class_external_code', headerName: 'Code Formation', align: "center", hideable: true, flex: 1, hide: false, minWidth: 150 }, { field: 'date_debut', headerName: 'Debut', hide: false, width: datagrid_columns_size_model2, }, { field: 'date_fin', headerName: 'Fin', hideable: false, width: datagrid_columns_size_model2, }, { @@ -186,6 +188,7 @@ const DisplayPartnerSession = (props) => { { field: 'prix_session', headerName: 'Prix', width: datagrid_columns_size_model2, align: "center", }, { field: 'title', headerName: 'Formation', width: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, }, { field: 'domaine', headerName: 'Domaine', width: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, }, + { field: 'published', headerName: 'publié', width: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, }, { field: 'duration', headerName: 'Durée', width: datagrid_columns_size_model2, align: "center", }, { @@ -1155,7 +1158,7 @@ const DisplayPartnerSession = (props) => { const [addOneSession, setaddOneSession] = useState(""); function submenu_add_one_session() { - + setaddOneSession("1"); setEdite_session("0"); @@ -5877,7 +5880,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair className="displaypartnersession" > - MySy Information + {Dialog_2_message} @@ -5889,7 +5892,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair Etape
{rowss && String(session_selected_row_id).length > 0 &&
- {JSON.parse(rowss[session_selected_row_id]).etape} + {JSON.parse(rowss[session_selected_row_id]).session_etape}
}
@@ -5975,6 +5978,24 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair } +
+
+ Publié +
+ {rowss && String(session_selected_row_id).length > 0 &&
+ +
} +
+ +
+
+ Exclu BPF +
+ {rowss && String(session_selected_row_id).length > 0 &&
+ +
} +
+ @@ -6290,6 +6311,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair duration: JSON.parse(item).duration_concat, class_external_code: JSON.parse(item).class_external_code, prix_session: JSON.parse(item).prix_session, + published: JSON.parse(item).class_published, } ))} @@ -6304,8 +6326,6 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair //handleClick_edit_session_From_Line(newSelectionModel.row.id); setsession_selected_row_id(newSelectionModel.row.id); - - setDialog_2_message(String(JSON.parse(rowss[newSelectionModel.row.id]).title)); setDialog_2_open(true); @@ -7268,33 +7288,57 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair

-
Vos champs spécifiques
+
Vos champs spécifiques
{rows_champs_specifics && rows_champs_specifics.map((champ_spec) => (
{JSON.parse(champ_spec).field_label}

- { - change_champs_spec_handle(e.target.value); - // setEmployee_data_changed("1"); - }} - //onChange={change_champs_spec_handle} + className="disabled_style" + onChange={(e) => { + change_champs_spec_handle(e.target.value); + // setEmployee_data_changed("1"); + }} + />} + + + + {String(JSON.parse(champ_spec).field_type) === "string" && + { + change_champs_spec_handle(e.target.value); + // setEmployee_data_changed("1"); + }} + + />} - />
))} @@ -7888,26 +7932,47 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
{JSON.parse(champ_spec).field_label}

- { + change_champs_spec_handle(e.target.value); + // setEmployee_data_changed("1"); + }} + + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && + { - change_champs_spec_handle(e.target.value); - // setEmployee_data_changed("1"); - }} - //onChange={change_champs_spec_handle} + className="disabled_style enable_style" + onChange={(e) => { + change_champs_spec_handle(e.target.value); + // setEmployee_data_changed("1"); + }} + />} - />
))} diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js index e836204..36a5b9f 100644 --- a/src/components/DisplayPartnerStagiaires.js +++ b/src/components/DisplayPartnerStagiaires.js @@ -77,12 +77,12 @@ const DisplayPartnerStagiaires = (props) => { 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, 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: 'class_internal_url', headerName: 'class_internal_url', hide: true, editable: false }, - { field: 'email', headerName: 'email', width: 150, hideable: false,editable: false }, + { field: 'email', headerName: 'email', width: 150, hideable: false, editable: false }, { field: 'nom', headerName: 'nom', width: 150, hide: false, editable: false, editable: false }, { field: 'prenom', headerName: 'prenom', width: 150, hide: false, editable: false }, { field: 'employeur', headerName: 'Employeur', width: 150, hide: true, editable: false }, @@ -101,8 +101,8 @@ const DisplayPartnerStagiaires = (props) => { return "???"; }, }, - { field: 'code_session', headerName: 'Code session', hideable: true, editable: false}, - { field: 'title', headerName: 'Formation', width: datagrid_columns_size_model1, align: "center", hideable: true, editable: false}, + { field: 'code_session', headerName: 'Code session', hideable: true, editable: false }, + { field: 'title', headerName: 'Formation', width: datagrid_columns_size_model1, align: "center", hideable: true, editable: false }, { field: 'distantiel', headerName: 'Distantiel', hideable: false, width: datagrid_columns_size_model2, valueFormatter: (params) => { @@ -126,10 +126,10 @@ const DisplayPartnerStagiaires = (props) => { }, }, - { field: 'domaine', headerName: 'Domaine', width: datagrid_columns_size_model2, align: "center", hide: true, hideable: true, editable: false}, - { field: 'date_debut', headerName: 'Du', width: datagrid_columns_size_model1, hideable: true, editable: false}, - { field: 'date_fin', headerName: 'Au', width: datagrid_columns_size_model1, hideable: true, editable: false}, - { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, editable: false}, + { field: 'domaine', headerName: 'Domaine', width: datagrid_columns_size_model2, align: "center", hide: true, hideable: true, editable: false }, + { field: 'date_debut', headerName: 'Du', width: datagrid_columns_size_model1, hideable: true, editable: false }, + { field: 'date_fin', headerName: 'Au', width: datagrid_columns_size_model1, hideable: true, editable: false }, + { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, editable: false }, { field: "Detail", headerName: 'Voir detail', renderCell: (cellValues) => { @@ -325,7 +325,7 @@ const DisplayPartnerStagiaires = (props) => { } }, - + { field: "Imprimer", headerName: 'Imprimer detail', renderCell: (cellValues) => { @@ -4271,8 +4271,8 @@ const DisplayPartnerStagiaires = (props) => { onRowDoubleClick={(newSelectionModel) => { handleClick_edit_session_From_Line(newSelectionModel.row.id); - - }} + + }} rowsPerPageOptions={[10]} disableSelectionOnClick @@ -4753,8 +4753,30 @@ const DisplayPartnerStagiaires = (props) => { rows_champs_specifics.map((champ_spec) => (
{JSON.parse(champ_spec).field_label}
-
- { + change_champs_spec_handle(e.target.value); + setparticipant_data_changed("1"); + }} + //onChange={change_champs_spec_handle} + + + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && { className="disabled_style" onChange={(e) => { change_champs_spec_handle(e.target.value); - //setEmployee_data_changed("1"); + setparticipant_data_changed("1"); }} //onChange={change_champs_spec_handle} - /> + />} +
))} @@ -5304,7 +5327,29 @@ const DisplayPartnerStagiaires = (props) => {
{JSON.parse(champ_spec).field_label}
- { + change_champs_spec_handle(e.target.value); + setparticipant_data_changed("1"); + }} + //onChange={change_champs_spec_handle} + + + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && { //onChange={change_champs_spec_handle} - /> + />} +
))} diff --git a/src/components/Employes.js b/src/components/Employes.js index 4fa78f6..6e59efa 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -115,25 +115,25 @@ const Employes = (props) => { { field: 'profil', headerName: 'profil', width: 150, hide: false, }, { field: 'fonction', headerName: 'Fonction', width: 150, hide: false, }, - { - field: "Detail", headerName: 'Voir detail', - renderCell: (cellValues) => { - return ( - - - - ); - } - }, + { + field: "Detail", headerName: 'Voir detail', + renderCell: (cellValues) => { + return ( + + + + ); + } + }, { field: "delete", headerName: 'Supprimer', renderCell: (cellValues) => { @@ -4216,8 +4216,8 @@ const Employes = (props) => { onRowDoubleClick={(newSelectionModel) => { handleClick_edit_employee_From_Line(newSelectionModel.row.id); - - }} + + }} rowsPerPageOptions={[10]} disableSelectionOnClick @@ -4830,7 +4830,29 @@ const Employes = (props) => {
{JSON.parse(champ_spec).field_label}

- { + change_champs_spec_handle(e.target.value); + setEmployee_data_changed("1"); + }} + //onChange={change_champs_spec_handle} + + + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && { //onChange={change_champs_spec_handle} - /> + />} +
))} @@ -5467,7 +5490,29 @@ const Employes = (props) => {
{JSON.parse(champ_spec).field_label}

- { + change_champs_spec_handle(e.target.value); + setEmployee_data_changed("1"); + }} + //onChange={change_champs_spec_handle} + + + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && { //onChange={change_champs_spec_handle} - /> + />} +
))} diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js index 9d63498..73dce32 100644 --- a/src/components/GestionAdministrative.js +++ b/src/components/GestionAdministrative.js @@ -6674,7 +6674,26 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
{JSON.parse(champ_spec).field_label}

- { + change_champs_spec_handle_session(e.target.value); + // setEmployee_data_changed("1"); + }} + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && } - - />
))} @@ -7440,7 +7457,26 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
{JSON.parse(champ_spec).field_label}

- { + change_champs_spec_handle_session(e.target.value); + // setEmployee_data_changed("1"); + }} + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && { change_champs_spec_handle_session(e.target.value); - IssessionChanged(); + // setEmployee_data_changed("1"); }} - //onChange={change_champs_spec_handle} + />} - - />
))} @@ -8747,7 +8781,29 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
{JSON.parse(champ_spec).field_label}
- { + change_champs_spec_handle_stagiaire(e.target.value); + setparticipant_data_changed("1"); + }} + //onChange={change_champs_spec_handle} + + + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && + />} +
))} diff --git a/src/components/Inscription_Information.js b/src/components/Inscription_Information.js index 9e03cdc..d96a501 100644 --- a/src/components/Inscription_Information.js +++ b/src/components/Inscription_Information.js @@ -759,16 +759,16 @@ function Inscription_Information(props) { 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_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; + 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 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; @@ -961,22 +961,46 @@ function Inscription_Information(props) { {rows_champs_specifics && rows_champs_specifics.filter((spec_field) => JSON.parse(spec_field).is_public === "1").map((champ_spec) => ( - + {String(JSON.parse(champ_spec).field_type) === "float" && - - - ), - }} - variant="standard" - /> + name={JSON.parse(champ_spec).field_name} + id={JSON.parse(champ_spec).field_name} + label={JSON.parse(champ_spec).field_label} + className="texte_area" + sx={{ m: 1, width: '48%' }} + type="number" + inputProps={{ min: "1", max: "999999", step: "1" }} + InputProps={{ + startAdornment: ( + + + + ), + }} + variant="standard" + />} + + {String(JSON.parse(champ_spec).field_type) === "string" && + + + ), + }} + variant="standard" + />} + + +
))} diff --git a/src/components/Module_Agenda.js b/src/components/Module_Agenda.js index a69e957..6074645 100644 --- a/src/components/Module_Agenda.js +++ b/src/components/Module_Agenda.js @@ -431,7 +431,7 @@ const Module_Agenda = (props) => { setagenda_owner_name(nom_prenom); if (String(p_filtre1) === "ressource_humaine") - setagenda_owner_type("Eployé"); + setagenda_owner_type("Employé"); else if (String(p_filtre1) === "ressource_materielle") setagenda_owner_type("Materiel"); @@ -459,7 +459,10 @@ const Module_Agenda = (props) => { const [events, setEvents] = useState([]); const handleSelect = (info) => { - + if( String(selected_employee_id).length < 2 ){ + alert(" Vous devez choisir un employé ou un materiel"); + return; + } if (String(props.write_access) !== "1") { // Pas d'acces en ecriture. return; @@ -506,6 +509,10 @@ const Module_Agenda = (props) => { const handleEventClick = (arg) => { + if( String(selected_employee_id).length < 2 ){ + alert(" Vous devez choisir un employé ou un materiel"); + return; + } setp_detail_title(arg.event.title) setp_detail_start(arg.event.start) @@ -599,6 +606,10 @@ const Module_Agenda = (props) => { var local_related_collection = p_filtre1; + if( String(selected_employee_id).length < 2 ){ + alert(" Vous devez choisir un employé ou un materiel"); + return; + } if (moment(endDate) <= moment(startDate)) { alert(" Les dates de début et de fin sont incohérentes"); diff --git a/src/components/Partner_Config_Session_Steps.js b/src/components/Partner_Config_Session_Steps.js index 952d946..0c960a3 100644 --- a/src/components/Partner_Config_Session_Steps.js +++ b/src/components/Partner_Config_Session_Steps.js @@ -277,8 +277,6 @@ const Partner_Configuration_Session_Steps = (props) => { if (document.getElementsByName("detail_config_point")[0]) { - console.log(" bbb"); - document.getElementsByName("detail_config_point")[0].disabled = true; document.getElementsByName("detail_config_point")[0].style.backgroundColor = "#ECEFF1"; } diff --git a/src/styles/components/_displaypartnersession.scss b/src/styles/components/_displaypartnersession.scss index 7bf5592..c1ed70a 100644 --- a/src/styles/components/_displaypartnersession.scss +++ b/src/styles/components/_displaypartnersession.scss @@ -1857,7 +1857,7 @@ border-width: 0.01rem; width: 100%; margin-bottom: 0.5rem; - border-radius: 1rem; + border-radius: 2rem; } .div_row_gauche { @@ -2456,6 +2456,7 @@ .div_row_gauche_dialog_session { width: 30%; float: left; + font-weight: 700; } .div_row_droite_dialog_session {