From 0008cc73be2c48258caf43a69d18fd0cc6ca90a9 Mon Sep 17 00:00:00 2001 From: cherif Date: Wed, 31 Jan 2024 16:01:57 +0100 Subject: [PATCH] 31/01/2024 - 16h --- src/components/DisplayPartnerSession.js | 401 ++++++++++++------ .../DisplayPartnerTrainingsPagination.js | 38 +- src/components/Module_Editique.js | 91 +++- src/components/TestUrl_new.js | 2 +- .../components/_displaypartnersession.scss | 13 +- 5 files changed, 386 insertions(+), 159 deletions(-) diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 72606e0..a2ab7bb 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -143,6 +143,19 @@ const DisplayPartnerSession = (props) => { ); } + + + function Display_Colunm_text({ value }) { + + return ( +
+ {value}  + +
+ ); + } + + const [datagrid_columns_size_model1, setdatagrid_columns_size_model1] = useState(200); const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(100); @@ -155,18 +168,22 @@ const DisplayPartnerSession = (props) => { { field: 'statut', headerName: 'Statut', hide: true, width: datagrid_columns_size_model2, - valueFormatter: (params) => { - if (String(params.value) === "0") - return "Inactif"; - else if (String(params.value) === "1") - return "Actif"; - else - return "?"; + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.distantiel) === "1" && "Actif"}  + {String(cellValues.row.distantiel) !== "1" && "Inactif"}  + +
+ + ); }, + }, { - field: 'etape', headerName: 'Etape', hide: false, width: datagrid_columns_size_model2, + field: 'etape', headerName: 'Etape', hide: false, width: datagrid_columns_size_model2, renderCell: (params) => , }, { field: 'class_external_code', headerName: 'Code Formation', align: "center", hideable: true, flex: 1, hide: true, minWidth: 150, renderCell: (params) => , }, @@ -174,28 +191,37 @@ const DisplayPartnerSession = (props) => { { field: 'date_fin', headerName: 'Fin', hideable: false, width: datagrid_columns_size_model2, }, { field: 'distantiel', headerName: 'Distantiel', hideable: false, width: datagrid_columns_size_model2, - valueFormatter: (params) => { - if (String(params.value) === "0") - return "Non"; - else if (String(params.value) === "1") - return "Oui"; - else - return "?"; + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.distantiel) === "1" && "Oui"}  + {String(cellValues.row.distantiel) !== "1" && "Non"}  + +
+ + ); }, + }, { field: 'presentiel', headerName: 'Presentiel', width: datagrid_columns_size_model2, - valueFormatter: (params) => { - if (String(params.value) === "0") - return "Non"; - else if (String(params.value) === "1") - return "Oui"; - else - return "?"; + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.presentiel) === "1" && "Oui"}  + {String(cellValues.row.presentiel) !== "1" && "Non"}  + +
+ + ); }, + + }, { field: 'formateur', headerName: 'Formateur', minWidth: datagrid_columns_size_model1, hide: true, hideable: true, renderCell: (params) => , }, - { field: 'nb_participant', headerName: 'Nb Parti.', minWidth: datagrid_columns_size_model2, align: "center", hide: true, }, + { field: 'nb_participant', headerName: 'Nb Parti.', minWidth: datagrid_columns_size_model2, align: "center", hide: true, renderCell: (params) => , }, { field: 'taux_remplissage', headerName: 'Remplissage', align: "center", flex: 1, minWidth: 100, maxWidth: 150, flex: 1, align: "left", @@ -218,12 +244,12 @@ const DisplayPartnerSession = (props) => { }, { field: 'nb_inscrit', headerName: 'Inscrits', minWidth: 20, align: "center", hide: true, hideable: true, }, { field: 'nb_preinscrit', headerName: 'Preinscrits', minWidth: 20, align: "center", hide: true, hideable: true, }, - { field: 'prix_session', headerName: 'Prix', minWidth: 20, align: "center", }, + { field: 'prix_session', headerName: 'Prix', minWidth: 20, align: "center", renderCell: (params) => , }, { field: 'title', headerName: 'Formation', minWidth: 250, flex: 1, align: "center", hide: true, hideable: true, renderCell: (params) => , }, - { field: 'domaine', headerName: 'Domaine', minWidth: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, }, - { field: 'published', headerName: 'publié', minWidth: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, }, + { field: 'domaine', headerName: 'Domaine', minWidth: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, renderCell: (params) => , }, + { field: 'published', headerName: 'publié', minWidth: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, renderCell: (params) => , }, - { field: 'duration', headerName: 'Durée', minWidth: datagrid_columns_size_model2, align: "center", hide: true, hideable: true, }, + { field: 'duration', headerName: 'Durée', minWidth: datagrid_columns_size_model2, align: "center", hide: true, hideable: true, renderCell: (params) => , }, { field: "Detail", headerName: 'Voir détail', renderCell: (cellValues) => { @@ -724,6 +750,22 @@ const DisplayPartnerSession = (props) => { { field: 'nom', headerName: 'nom', width: 150, hide: false, editable: true }, { field: 'prenom', headerName: 'prenom', width: 150, hide: false, editable: false }, + { field: 'statut', headerName: 'Statut', width: 150, hide: false, editable: false , + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.statut) === "0" && "Init"}  + {String(cellValues.row.statut) === "1" && "Envoyé"}  + {String(cellValues.row.statut) === "2" && "Validé"}  + +
+ + ); + }, + }, + { field: 'date_envoi', headerName: 'Envoyé le', width: 150, hide: false, editable: false }, + { field: "valide", headerName: 'Valider', renderCell: (cellValues) => { @@ -1609,6 +1651,12 @@ const DisplayPartnerSession = (props) => { document.getElementById("historique").style.fontWeight = "normal"; } + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } + } async function submenu_detail_session() { @@ -1654,6 +1702,12 @@ const DisplayPartnerSession = (props) => { document.getElementById("historique").style.color = "black"; document.getElementById("historique").style.fontWeight = "normal"; } + + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } } async function submenu_sequence_session() { @@ -1701,6 +1755,12 @@ const DisplayPartnerSession = (props) => { document.getElementById("historique").style.fontWeight = "normal"; } + + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } } @@ -1811,9 +1871,11 @@ const DisplayPartnerSession = (props) => { document.getElementById("preinscrit").style.fontWeight = "normal"; } - - - + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } } @@ -1824,7 +1886,7 @@ const DisplayPartnerSession = (props) => { document.getElementById("editique").style.backgroundColor = "#104277"; document.getElementById("editique").style.color = "white"; document.getElementById("editique").style.fontWeight = "bold"; - console.log(" editique"); + } if (document.getElementById("inscrit")) { @@ -1836,16 +1898,19 @@ const DisplayPartnerSession = (props) => { if (document.getElementById("detail_session")) { document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; document.getElementById("detail_session").style.color = "black"; + document.getElementById("detail_session").style.fontWeight = "normal"; } if (document.getElementById("preinscrit")) { document.getElementById("preinscrit").style.backgroundColor = "#d8edfc"; document.getElementById("preinscrit").style.color = "black"; + document.getElementById("preinscrit").style.fontWeight = "normal"; } if (document.getElementById("sequence_session")) { document.getElementById("sequence_session").style.backgroundColor = "#d8edfc"; document.getElementById("sequence_session").style.color = "black"; + document.getElementById("sequence_session").style.fontWeight = "normal"; } if (document.getElementById("historique")) { @@ -1854,6 +1919,11 @@ const DisplayPartnerSession = (props) => { document.getElementById("historique").style.fontWeight = "normal"; } + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } } @@ -2592,16 +2662,16 @@ const DisplayPartnerSession = (props) => { const New_civilite = [ { "id": "Mme", "label": "Mme", "value": "Mme" }, { "id": "M", "label": "M", "value": "M" }, - { "id": "Neutre", "label": "Neutre", "value": "Neutre" }, + { "id": "Neutre", "label": "Neutre", "value": "Neutre" }, ] - - const New_type_apprenant = [ + + const New_type_apprenant = [ { "id": "0", "label": "Autre", "value": "0" }, { "id": "1", "label": "Salariés", "value": "1" }, - { "id": "2", "label": "Apprentis", "value": "2" }, - { "id": "3", "label": "Particuliers", "value": "3" }, - { "id": "4", "label": "Rech. Emploi", "value": "4" }, - + { "id": "2", "label": "Apprentis", "value": "2" }, + { "id": "3", "label": "Particuliers", "value": "3" }, + { "id": "4", "label": "Rech. Emploi", "value": "4" }, + ] const [myinscript_status, setmyinscript_status] = useState(""); @@ -7743,6 +7813,7 @@ const DisplayPartnerSession = (props) => { } else { //console.log("erreur rrrr:" + data['status']) setGetListePreinscrit_emarg_api("false"); + alert(data['message']); } @@ -7750,11 +7821,16 @@ const DisplayPartnerSession = (props) => { setLoading(false); console.error('Error:', error); setGetListePreinscrit_emarg_api("false"); + alert(" Impossible de récupérer les données d'émargement") }); } + const New_Option_Emargement_Masse = [ + { "id": "demande emargement", "label": "Envoyer demande émargement", "value": "demande emargement" }, + ] + const [actionmass_emarg_val, setactionmass_emarg_val] = useState(); const actionmass_emarg = (event) => { const value = event.target.value; @@ -7791,12 +7867,13 @@ const DisplayPartnerSession = (props) => { if (String(actionmass_emarg_val) === "demande emargement") { ActionMassListEmargement(); } - await sleep(50) + await sleep(20) } setSelectionModel_emarg([]); setactionmass_emarg_val(); GetListeEmargement(selected_session_id, selected_internal_url); + alert(" La demande d'émargement a été envoyée" ); } @@ -7807,7 +7884,7 @@ const DisplayPartnerSession = (props) => { clean_old_messages(); if (selectionModel_emarg.length <= 0) { - alert(" Selectionnez un enregistrement pour envoyer la demande d'emargement"); + alert(" Sélectionnez un enregistrement pour envoyer la demande d'émargement"); return; } @@ -7836,13 +7913,15 @@ const DisplayPartnerSession = (props) => { setActionMassListEmargement_api("true"); setActionMassListEmargement_result(res.data.message); + } else if (String(res.data.status) === String("Err_Connexion")) { - alert('Erreur: ' + res.data.message); + alert(res.data.message); history.push("/Connexion"); } else { setActionMassListEmargement_api("false"); setActionMassListEmargement_message(res.data.message); + alert(res.data.message); } @@ -8893,7 +8972,7 @@ const DisplayPartnerSession = (props) => { }} - renderInput={(params) => + renderInput={(params) => } /> {/* { } }} - renderInput={(params) => + renderInput={(params) => } /> @@ -8989,7 +9068,7 @@ const DisplayPartnerSession = (props) => { } }} - renderInput={(params) => + renderInput={(params) => } /> {/* {
Civilité
- {
Type apprenant
- { } }} - + renderInput={(params) => } /> @@ -12727,21 +12806,21 @@ const DisplayPartnerSession = (props) => {
Ajout d'un nouveau participant
Civilité
- { - if (value && value.value) { - setp_one_civilite_part(value.value); + options={New_civilite} + onChange={(event, value) => { + if (value && value.value) { + setp_one_civilite_part(value.value); + } + }} + renderInput={(params) => } - }} - renderInput={(params) => - } - /> + /> {/* {
Civilité
- {
Statut Inscription
- { onChange={(event, value) => { if (value && value.value) { setmyinscript_status(value.value); - + } }} renderInput={(params) => } /> - {/* {
Type apprenant
- { onChange={(event, value) => { if (value && value._id) { setp_one_detail_type_apprenant(value._id); - + } }} - + renderInput={(params) => } /> - + {/* { {String(submenu) === String("emargement") &&
- - -
+ + Initialiser la liste + } + modal + nested + position="center center" + + > + + {close => ( +
+ +
MySy Information
+
+ {' '} + + + Confirmez la (ré)initialisation de la liste d'émargement.
+ /!\ Si un tableau d'émargement existe pour cette session, il sera supprimé et récréé +
+ + +
+
+
+ + +
+
+ +
+
+
+ )} +
+ + + +
+ { @@ -14410,7 +14541,8 @@ const DisplayPartnerSession = (props) => { sequence_end: JSON.parse(item).sequence_end, is_present: JSON.parse(item).is_present, - + statut: JSON.parse(item).statut, + date_envoi: JSON.parse(item).date_envoi, } ))} @@ -14426,71 +14558,100 @@ const DisplayPartnerSession = (props) => { /> - {selectionModel_emarg && selectionModel_emarg.length >= 1 && -
- -   -   + */}   - {actionmass_emarg_val && - - Traiter + {actionmass_emarg_val && + + Traiter - } - modal - nested - position="center center" - > + } + modal + nested + position="center center" + > - {close => ( -
- -
MySy Information
-
- {' '} - - Confirmer l'action {actionmass_emarg_val} en masse. -
-
-
- + {close => ( +
+ +
MySy Information
+
+ {' '} + Confirmer l'action {actionmass_emarg_val} en masse.
-
- + }}> Valider + +
+
+ +
-
- )} - - } -
+ )} + + } +
-
- } +
+ } -
+
+
{/*
*/} diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index 173e6e9..bdaeee0 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -376,25 +376,25 @@ const DistplayPartnerTraningsPage = (props) => { { 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,editable: false, }, - { field: 'duration_in_hour', headerName: 'duration_in_hour', hide: true, Width: 0,editable: false, }, + { field: 'duration_unit', headerName: 'duration_unit', hide: true, Width: 0, editable: false, }, + { field: 'duration_in_hour', headerName: 'duration_in_hour', hide: true, Width: 0, editable: false, }, { field: 'currency', headerName: 'currency', hide: true, Width: 0, editable: false, }, { field: 'zone_diffusion', headerName: 'zone_diffusion', hide: true, maxWidth: 1, editable: false, }, - { field: 'internal_url', headerName: 'internal_url', hide: true, editable: false, }, + { field: 'internal_url', headerName: 'internal_url', hide: true, editable: false, }, { field: 'external_code', headerName: 'Code Formation', hideable: false, minWidth: 150, flex: 1, maxWidth: 250, editable: false, renderCell: (params) => , }, - { field: 'title', headerName: 'Titre', hideable: false, minWidth: 300, flex: 1, editable: false, renderCell: (params) => , }, + { field: 'title', headerName: 'Titre', hideable: false, minWidth: 300, flex: 1, editable: false, renderCell: (params) => , }, { field: 'domain', headerName: 'Domaine', minWidth: 50, flex: 1, maxWidth: 150, hideable: true, editable: false, }, - { field: 'metier', headerName: 'Métier', minWidth: 50, flex: 1, maxWidth: 150, hideable: true, hide: true, editable: false, }, - { field: 'nb_session_formation', headerName: 'Nb Session', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false , editable: false, align: "center",}, - { field: 'url', headerName: 'lien', minWidth: 20, hideable: true, hide: true, editable: false, }, + { field: 'metier', headerName: 'Métier', minWidth: 50, flex: 1, maxWidth: 150, hideable: true, hide: true, editable: false, }, + { field: 'nb_session_formation', headerName: 'Nb Session', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center", }, + { field: 'url', headerName: 'lien', minWidth: 20, hideable: true, hide: true, editable: false, }, { field: 'description', headerName: 'Description', hide: true, resizable: true, minWidth: 250, maxWidth: 300, flex: 1, renderCell: (params) => , }, - { field: 'price', headerName: 'Prix', minWidth: 50, flex: 1, maxWidth: 100, align: "center", resizable: true, hide: ismobilephone_columns_hide, editable: false, }, + { field: 'price', headerName: 'Prix', minWidth: 50, flex: 1, maxWidth: 100, align: "center", resizable: true, hide: ismobilephone_columns_hide, editable: false, }, { - field: 'published', headerName: 'Publié', minWidth: 50, flex: 1, maxWidth: 100, align: "center", resizable: true, editable: false, - valueFormatter: (params) => { + field: 'published', headerName: 'Publié', minWidth: 50, flex: 1, maxWidth: 100, align: "center", resizable: true, editable: false, + valueFormatter: (params) => { if (String(params.value) === "0") return "Non"; else if (String(params.value) === "1") @@ -404,7 +404,7 @@ const DistplayPartnerTraningsPage = (props) => { }, }, { - field: "management", headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, + field: "management", headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, renderCell: (cellValues) => { return ( @@ -1266,7 +1266,7 @@ const DistplayPartnerTraningsPage = (props) => { }, "& .MuiDataGrid-cellContent": { minHeight: 50, - + } }; @@ -1953,7 +1953,7 @@ const DistplayPartnerTraningsPage = (props) => { components={{ Toolbar: GridToolbar, }} - + getCellClassName={(params) => { if (params.field === 'published' && String(params.value) === "1") { return 'cell--published'; @@ -1983,7 +1983,7 @@ const DistplayPartnerTraningsPage = (props) => { getEstimatedRowHeight={() => 200} getRowHeight={() => "auto"} sx={datagridSx} - + /> @@ -1993,8 +1993,10 @@ const DistplayPartnerTraningsPage = (props) => {
{selectionModel && selectionModel.length >= 1 &&
-   +  
+ { else { setactionmass_ftion_val(); } - } - }} - - renderInput={(params) => + hiddenLabel="true" + renderInput={(params) => } /> diff --git a/src/components/Module_Editique.js b/src/components/Module_Editique.js index d8297ab..ef2022c 100644 --- a/src/components/Module_Editique.js +++ b/src/components/Module_Editique.js @@ -49,6 +49,7 @@ import allLocales from '@fullcalendar/core/locales-all' import { RepeatOnRounded } from "@mui/icons-material"; import { alignPropType } from "react-bootstrap/esm/types"; + import ToggleSwitch from "./ToggleSwitch"; import ToggleSwitch_v2_mysy from "./ToggleSwitch_v2_mysy"; import Autocomplete from '@mui/material/Autocomplete'; @@ -275,7 +276,7 @@ const Module_Editique = (props) => { var nom_fichier_cmd = "Convention.zip"; - if( String(selected_convention_id).trim() === ""){ + if (String(selected_convention_id).trim() === "") { alert(" Vous devez choisir un modèle de document "); return; } @@ -320,7 +321,7 @@ const Module_Editique = (props) => { var nom_fichier_cmd = "Convocation.zip"; - if( String(selected_convention_id).trim() === ""){ + if (String(selected_convention_id).trim() === "") { alert(" Vous devez choisir un modèle de document "); return; } @@ -334,8 +335,8 @@ const Module_Editique = (props) => { } - console.log(" ### url = ", url); - + console.log(" ### url = ", url); + //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id); setLoading(true); axios.get(url, { responseType: 'blob', },) @@ -847,7 +848,7 @@ const Module_Editique = (props) => { var myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convocation_From_Session_By_Email/"; if (String(selected_convention_id) === "default_mail") { // Il s'agit d'envoyer les convention par defaut de type mail - myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Default_Convocation_From_Session_By_Email/"; + myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Default_Convocation_From_Session_By_Email/"; } //console.log(" ### myurl = ", myurl); @@ -919,6 +920,11 @@ const Module_Editique = (props) => { }; + const New_Option_Type_Document = [ + { "id": "email", "label": "Email", "value": "email" }, + { "id": "pdf", "label": "PDF", "value": "pdf" }, + ] + return (
@@ -1070,7 +1076,28 @@ const Module_Editique = (props) => {
Type Document
- { + if (value && value.value) { + setselected_convention_type(value.value); + Get_List_Stagiaire_Convocations(action_server_ref_interne_doc, action_server_nom_doc, + String(value.value), Dialog_1_message); + + } + }} + renderInput={(params) => + } + /> + + {/* { Email   PDF   - + */}
@@ -1168,8 +1195,6 @@ const Module_Editique = (props) => { value="pdf" fullWidth - - /> @@ -1377,7 +1402,26 @@ const Module_Editique = (props) => {
Type Document
- { + if (value && value.value) { + setselected_convention_type(value.value); + + Get_List_Stagiaire_Conventions(action_server_ref_interne_doc, action_server_nom_doc, + String(value.value), Dialog_1_message); + } + }} + renderInput={(params) => + } + /> + + {/* { Email   PDF   - + */}
@@ -1468,6 +1512,8 @@ const Module_Editique = (props) => {
} {String(selected_convention_type) === "pdf" &&
Type Document
+ + { value="pdf" fullWidth - - /> - -
} @@ -1749,7 +1791,7 @@ const Module_Editique = (props) => { minHeight: 270, flexGrow: 1, boxShadow: 1, borderRadius: 2, - bgcolor: "yellowgreen" + bgcolor: "#DAF7A6", }}> @@ -1773,12 +1815,25 @@ const Module_Editique = (props) => { {JSON.parse(document).list_document_history_event && JSON.parse(document).list_document_history_event.map((history_doc) => ( + ))} + {/*!JSON.parse(document).list_document_history_event || (JSON.parse(document).list_document_history_event).length <= 0 && */} diff --git a/src/components/TestUrl_new.js b/src/components/TestUrl_new.js index b826c5b..3a772e5 100644 --- a/src/components/TestUrl_new.js +++ b/src/components/TestUrl_new.js @@ -607,7 +607,7 @@ const TestUrl_New = (props) => {

Module Ediditique

- +