From 8a2091d1abbb15f4427097e0d289e34309c9a740 Mon Sep 17 00:00:00 2001 From: cherif Date: Fri, 2 Feb 2024 17:07:03 +0100 Subject: [PATCH] 02/02/2024 - 17h --- src/components/Config_Document.js | 26 +- src/components/DisplayPartnerSession.js | 64 +- src/components/DisplayPartnerStagiaires.js | 705 +++++++-------------- src/components/Module_Editique.js | 14 +- 4 files changed, 315 insertions(+), 494 deletions(-) diff --git a/src/components/Config_Document.js b/src/components/Config_Document.js index c23b72f..03d2a74 100644 --- a/src/components/Config_Document.js +++ b/src/components/Config_Document.js @@ -383,6 +383,8 @@ const Config_Documents = (props) => { const [p_one_detail_type_doc, setp_one_detail_type_doc] = useState(""); const [p_one_detail_duplicate, setp_one_detail_duplicate] = useState(""); + const [p_one_detail_courrier_template_type_document_ref_interne, setp_one_detail_courrier_template_type_document_ref_interne] = useState(""); + function clear_detail_fields() { setp_detail_cible(""); @@ -401,6 +403,9 @@ const Config_Documents = (props) => { setp_one_detail_nom(""); setp_one_detail_ref_interne(""); setp_one_detail_sujet(""); + + setp_one_detail_courrier_template_type_document_ref_interne(""); + setp_one_detail_duplicate(""); setp_one_detail_type_doc(""); setone_field_programme(); @@ -703,6 +708,12 @@ const Config_Documents = (props) => { setp_one_detail_ref_interne(mylocal_document.ref_interne); } + if (mylocal_document.courrier_template_type_document_ref_interne) { + setp_one_detail_courrier_template_type_document_ref_interne(mylocal_document.courrier_template_type_document_ref_interne); + } else { + setp_one_detail_courrier_template_type_document_ref_interne(""); + } + if (mylocal_document.sujet) { setp_one_detail_sujet(mylocal_document.sujet); @@ -1025,6 +1036,13 @@ const Config_Documents = (props) => { } + if (p_one_detail_courrier_template_type_document_ref_interne) + form.append("courrier_template_type_document_ref_interne", p_one_detail_courrier_template_type_document_ref_interne); + else { + form.append("courrier_template_type_document_ref_interne", ""); + + } + if (p_one_detail_duplicate) form.append("duplicate", p_one_detail_duplicate); @@ -1592,7 +1610,7 @@ const Config_Documents = (props) => { var node = { "_id": local_id, "id": localid, - "label": local_nom+" - "+local_type_doc+"", + "label": local_nom + " - " + local_type_doc + "", "nom": local_nom, "type_doc": local_type_doc, @@ -3066,7 +3084,7 @@ const Config_Documents = (props) => {
Choisir le document à ajouter
- {/* { disablePortal name="champ_table" id="champ_table" - + options={New_Get_List_Personnalisable_Default_Document_result} onChange={(event, value) => { if (value && value._id) { setselecte_defaul_doc_to_add(value._id); - + } }} diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index d38376c..624f99f 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -346,10 +346,11 @@ const DisplayPartnerSession = (props) => { { field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => , }, { field: 'email', headerName: 'email', minWidth: 150, flex: 1, hideable: false, flex: 1, renderCell: (params) => , }, { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, maxWidth: 200, hide: false, editable: true, renderCell: (params) => , }, + { field: 'client_rattachement_id', headerName: 'Client_id', Width: 0, hide: true, editable: true, }, { field: 'employeur', headerName: 'Employeur', minWidth: 150, flex: 1, maxWidth: 200, hide: false, editable: true, renderCell: (params) => , }, { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: true }, { field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: true }, - { field: 'amount', headerName: 'Montant Formation', minWidth: 100, flex: 1, maxWidth: 150, type: 'number', hideable: false, flex: 1, editable: true }, + { field: 'amount', headerName: 'Montant Formation', minWidth: 100, flex: 1, maxWidth: 150, type: 'number', hideable: false, flex: 1, editable: true, renderCell: (params) => , }, { field: "update", headerName: 'Mise à jour', renderCell: (cellValues) => { @@ -605,6 +606,7 @@ const DisplayPartnerSession = (props) => { { field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => , }, { field: 'email', headerName: 'email', minWidth: 150, flex: 1, hideable: false, flex: 1, renderCell: (params) => , }, { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, maxWidth: 200, hide: false, editable: true, renderCell: (params) => , }, + { field: 'client_rattachement_id', headerName: 'Client_id', Width: 0, hide: true, editable: true, }, { field: 'employeur', headerName: 'Employeur', minWidth: 150, flex: 1, maxWidth: 200, hide: false, editable: true }, { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: true }, { field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: true }, @@ -897,6 +899,8 @@ const DisplayPartnerSession = (props) => { onClick={(event) => { + setsequence_gridline_id(cellValues.row.id); + setdisplay_detail_sequence(""); setp_detail_sequence_title(cellValues.row.sequence_title); setselected_sequence_id(cellValues.row._id); var date_du = new Date(moment(cellValues.row.sequence_start, "DD/MM/YYYY HH:mm")); @@ -2680,6 +2684,13 @@ const DisplayPartnerSession = (props) => { { "id": "2", "label": "En Cours", "value": "2" }, ] + const New_status_inscription_add_with_annule = [ + { "id": "0", "label": "PréInscription", "value": "0" }, + { "id": "1", "label": "Inscription", "value": "1" }, + { "id": "2", "label": "En Cours", "value": "2" }, + { "id": "-1", "label": "Annule", "value": "-1" }, + ] + const New_civilite = [ { "id": "Mme", "label": "Mme", "value": "Mme" }, { "id": "M", "label": "M", "value": "M" }, @@ -4977,6 +4988,12 @@ const DisplayPartnerSession = (props) => { var email = cellValues.row.email; var prenom = cellValues.row.prenom; var opco = cellValues.row.opco; + + var local_client_rattachement_id = cellValues.row.client_rattachement_id; + if (String(local_client_rattachement_id) === "undefined") { + local_client_rattachement_id = "" + } + if (String(opco) === "undefined") { opco = "" } @@ -4993,11 +5010,11 @@ const DisplayPartnerSession = (props) => { } - UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, "", _id); + UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, "", _id, local_client_rattachement_id); } - function UpdateStagiaireData(nom, prenom, email, status, price, opco, modefinancement, employeur, comment, object_id) { + function UpdateStagiaireData(nom, prenom, email, status, price, opco, modefinancement, employeur, comment, object_id, local_client_rattachement_id) { setSendInscriptionCancell_api(); var form = new FormData(); @@ -5019,7 +5036,7 @@ const DisplayPartnerSession = (props) => { form.append("comment", comment); form.append("_id", object_id); - form.append("client_rattachement_id", p_detail_client_rattachement_id); + form.append("client_rattachement_id", local_client_rattachement_id); var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/"; setLoading(true); @@ -5080,6 +5097,11 @@ const DisplayPartnerSession = (props) => { modefinancement = "" } + var local_client_rattachement_id = cellValues.row.client_rattachement_id; + if (String(local_client_rattachement_id) === "undefined") { + local_client_rattachement_id = "" + } + var status = "0"; var employeur = cellValues.row.employeur; @@ -5090,7 +5112,7 @@ const DisplayPartnerSession = (props) => { var comment = ""; - UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, comment, _id); + UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, comment, _id, local_client_rattachement_id); } function handleClick_refuse(event, cellValues) { @@ -5123,7 +5145,13 @@ const DisplayPartnerSession = (props) => { employeur = "" } - UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, motif_refus, _id); + + var local_client_rattachement_id = cellValues.row.client_rattachement_id; + if (String(local_client_rattachement_id) === "undefined") { + local_client_rattachement_id = "" + } + + UpdateStagiaireData(nom, prenom, email, status, montant, opco, modefinancement, employeur, motif_refus, _id, local_client_rattachement_id); } @@ -12809,6 +12837,7 @@ const DisplayPartnerSession = (props) => { modefinancement: JSON.parse(item).modefinancement, civilite: JSON.parse(item).civilite, client_rattachement_nom: JSON.parse(item).client_rattachement_nom, + client_rattachement_id: JSON.parse(item).client_rattachement_id, } @@ -13511,6 +13540,7 @@ const DisplayPartnerSession = (props) => { modefinancement: JSON.parse(item).modefinancement, civilite: JSON.parse(item).civilite, client_rattachement_nom: JSON.parse(item).client_rattachement_nom, + client_rattachement_id: JSON.parse(item).client_rattachement_id, } ))} @@ -13826,7 +13856,25 @@ const DisplayPartnerSession = (props) => {
} {String(participant_data_edit_mode) === "1" &&
Statut
- { + if (value && value.value) { + setp_detail_status_inscrit(value.value); + setparticipant_data_changed("1"); + } + }} + renderInput={(params) => + } + /> + + {/* { Preinscrit   Annule   Encours   - + */}
} diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js index a2a6689..3f32b18 100644 --- a/src/components/DisplayPartnerStagiaires.js +++ b/src/components/DisplayPartnerStagiaires.js @@ -52,6 +52,8 @@ import ToggleSwitch from "./ToggleSwitch"; import Autocomplete from '@mui/material/Autocomplete'; import { FcDownRight, FcRight, FcSearch, FcViewDetails, FcOpenedFolder } from "react-icons/fc"; import { MdOutlineVisibility } from "react-icons/md"; +import Link from '@mui/material/Link'; +import { PiDotsThree } from "react-icons/pi"; const DisplayPartnerStagiaires = (props) => { const history = useHistory(); @@ -99,11 +101,11 @@ const DisplayPartnerStagiaires = (props) => { { field: 'civilite', headerName: 'Civ.', minWidth: 70, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false }, - { field: 'nom', headerName: 'Nom', minWidth: 150, flex: 1, hide: false, editable: false, editable: false }, - { field: 'prenom', headerName: 'Prénom', minWidth: 150, flex: 1, hide: false, editable: false }, - { field: 'email', headerName: 'Email', minWidth: 200, flex: 1, hideable: false, editable: false }, - { field: 'employeur', headerName: 'Employeur', minWidth: 150, hide: true, editable: false }, - { field: 'client_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: false }, + { field: 'nom', headerName: 'Nom', minWidth: 200, flex: 1, hide: false, editable: false, editable: false, renderCell: (params) => , }, + { field: 'prenom', headerName: 'Prénom', minWidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'email', headerName: 'Email', minWidth: 250, flex: 1, hideable: false, editable: false, renderCell: (params) => , }, + { field: 'employeur', headerName: 'Employeur', minWidth: 200, hide: true, editable: false }, + { field: 'client_nom', headerName: 'Client', minWidth: 200, flex: 1, hide: false, editable: false , renderCell: (params) => ,}, { field: 'status', headerName: 'Statut', hide: false, width: datagrid_columns_size_model2, valueFormatter: (params) => { @@ -429,6 +431,41 @@ const DisplayPartnerStagiaires = (props) => { ] + + function ExpandableCell_50({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( +
+ {expanded ? value : value.slice(0, 50)}  + {value.length > 50 && ( + // eslint-disable-next-line jsx-a11y/anchor-is-valid + setExpanded(!expanded)} + > + {expanded ? : } + + )} +
+ ); + } + + + + function Display_Colunm_text({ value }) { + + return ( +
+ {value}  + +
+ ); + } + + function handleClick_refuse(event, cellValues) { // Recuperation du motif du refus : var motif_refus = document.getElementById("motif_refus").value; @@ -3023,6 +3060,8 @@ const DisplayPartnerStagiaires = (props) => { var form = new FormData(); //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + if (p_detail_session_class.length <= 0) { alert(" Vous devez choisir une session"); return; @@ -3049,7 +3088,7 @@ const DisplayPartnerStagiaires = (props) => { return; } - if (!p_detail_civilite || String(p_detail_civilite).trim().length < 2) { + if (!p_detail_civilite || String(p_detail_civilite).trim() === "") { alert("La civilité est invalide."); return; } @@ -4210,7 +4249,7 @@ const DisplayPartnerStagiaires = (props) => { if (String(value) === "supprimer" || String(value) === "convention" || String(value) === "desactiver" - || String(value) === "exporter") { + || String(value) === "exporter") { setactionmass_ftion_val(value); } else { @@ -5142,6 +5181,33 @@ const DisplayPartnerStagiaires = (props) => { { "id": "1", "label": "Supprimer", "value": "supprimer" }, ] + const New_civilite = [ + { "id": "Mme", "label": "Mme", "value": "Mme" }, + { "id": "M", "label": "M", "value": "M" }, + { "id": "Neutre", "label": "Neutre", "value": "Neutre" }, + ] + + + + + const New_status_inscription_add_with_annule = [ + { "id": "0", "label": "PréInscription", "value": "0" }, + { "id": "1", "label": "Inscription", "value": "1" }, + { "id": "2", "label": "En Cours", "value": "2" }, + { "id": "-1", "label": "Annule", "value": "-1" }, + ] + + + 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" }, + + ] + + return (
{isLoading &&
@@ -5158,7 +5224,7 @@ const DisplayPartnerStagiaires = (props) => {
- +
Civilite
@@ -6479,7 +6545,7 @@ const DisplayPartnerStagiaires = (props) => { onRowDoubleClick={(newSelectionModel) => { ///setuserimgclassprofil(""); - + setselected_row_data_json_age(''); setgridline_id(newSelectionModel.row.id); setselected_id_status(newSelectionModel.row.status); @@ -6555,7 +6621,8 @@ const DisplayPartnerStagiaires = (props) => { } }} - + getEstimatedRowHeight={() => 200} + getRowHeight={() => "auto"} /> @@ -6569,28 +6636,28 @@ const DisplayPartnerStagiaires = (props) => {   { - if (value && value.value) { - if( String(value.value) === "supprimer" - || String(value.value) === "convention" || String(value.value) === "exporter") { - setactionmass_ftion_val(value.value); - } - else { - setactionmass_ftion_val(); + disablePortal + id="combo-box-demo" + className="block_en_mass_select" + fullWidth + options={New_Option} + onChange={(event, value) => { + if (value && value.value) { + if (String(value.value) === "supprimer" + || String(value.value) === "convention" || String(value.value) === "exporter") { + setactionmass_ftion_val(value.value); + } + else { + setactionmass_ftion_val(); + } + } + }} + + renderInput={(params) => } - - }} - - renderInput={(params) => - } - /> + /> {/* {
{' '} {String(actionmass_ftion_val) === "supprimer" && - Confirmer la suppression en masse pour {selectionModel.length} lignes. - } + Confirmer la suppression en masse pour {selectionModel.length} lignes. + } {String(actionmass_ftion_val) === "exporter" && - Confirmer l' export en masse pour {selectionModel.length} lignes. - } + Confirmer l' export en masse pour {selectionModel.length} lignes. + } {String(actionmass_ftion_val) === "convention" && - Confirmer l' édition des conventions en masse pour {selectionModel.length} lignes. - } + Confirmer l' édition des conventions en masse pour {selectionModel.length} lignes. + } + -
@@ -6717,7 +6784,7 @@ const DisplayPartnerStagiaires = (props) => { {/* */} - + {String(addOneParticipant) !== "1" && }
} @@ -6858,7 +6925,25 @@ const DisplayPartnerStagiaires = (props) => {
*/}
Civilité
- { + if (value && value.value) { + + setp_one_civilite_part(value.value); + } + }} + renderInput={(params) => + } + /> + {/* { Mme.   M.   Neutre   - + */}
@@ -7069,8 +7154,25 @@ const DisplayPartnerStagiaires = (props) => { />
-
Statut Inscription *
- Statut Inscription
+ + { + if (value && value.value) { + setp_one_status_part(value.value); + } + }} + renderInput={(params) => + } + /> + + {/* { {option.label}  
))} -
+
*/}
-
Client a
+
Client
{
Type apprenant
- { + if (value && value._id) { + + setp_one_detail_type_apprenant(value._id); + + } + }} + + renderInput={(params) => + } + /> + + + {/* { Particuliers   Rech. Emploi   - + */}
{/* -- début champs specifiques **/} @@ -7463,35 +7585,28 @@ const DisplayPartnerStagiaires = (props) => {
} - {String(participant_data_edit_mode) === "1" &&
Type apprenant
- Type apprenant
+ + { - //setp_detail_client_rattachement_id(e.target.value); - setp_detail_type_apprenant(e.target.value); - setparticipant_data_changed("1"); + options={New_type_apprenant} + value={New_type_apprenant.filter((val) => val.value === String(p_detail_type_apprenant))[0].label} + onChange={(event, value) => { + if (value && value.id) { + setp_detail_type_apprenant(value.id); + setparticipant_data_changed("1"); + } + }} + + renderInput={(params) => } - } + /> - > - Autre   - Salariés   - Apprentis   - Particuliers   - Rech. Emploi   -
} {String(participant_data_edit_mode) !== "1" &&
Type apprenant
@@ -7528,58 +7643,55 @@ const DisplayPartnerStagiaires = (props) => {
} - {String(participant_data_edit_mode) === "1" &&
Statut
- Statut
+ + { - setp_detail_status_inscrit(e.target.value); - setparticipant_data_changed("1"); - } - } - > - Inscrit    - Preinscrit   - Annule   - Encours   -
+ options={New_status_inscription_add_with_annule} + value={New_status_inscription_add_with_annule.filter((val) => val.value === String(p_detail_status_inscrit))[0].label} + onChange={(event, value) => { + if (value && value.value) { + + setp_detail_status_inscrit(value.value); + setparticipant_data_changed("1"); + } + }} + renderInput={(params) => + } + /> + +
} {String(participant_data_edit_mode) === "1" &&
Civilité
- { - setp_detail_civilite(e.target.value); - setparticipant_data_changed("1"); - } - } + value={New_civilite.filter((val) => val.value === String(p_detail_civilite))[0].label} + options={New_civilite} + onChange={(event, value) => { + if (value && value.value) { + + setp_detail_civilite(value.value); + setparticipant_data_changed("1"); + console.log(" change civilite value.value = ", value.value) + + + } + }} + renderInput={(params) => + } + /> + + - > - Mme.   - M.   - Neutre   -
} {String(participant_data_edit_mode) !== "1" &&
Civilité
@@ -8092,13 +8204,13 @@ const DisplayPartnerStagiaires = (props) => {
{String(p_detail_apprenant_id).trim().length <= 0 &&
{ - setquel_tuteur("1"); - setDialog_tuteur_1_open(true); - }}> Voir plus + setquel_tuteur("1"); + setDialog_tuteur_1_open(true); + }}> Voir plus + +
} -
} - @@ -8196,11 +8308,11 @@ const DisplayPartnerStagiaires = (props) => {
{String(p_detail_apprenant_id).trim().length <= 0 &&
{ - setquel_tuteur("2"); - setDialog_tuteur_1_open(true); - }}> Voir plus + setquel_tuteur("2"); + setDialog_tuteur_1_open(true); + }}> Voir plus -
} + } @@ -8605,366 +8717,9 @@ const DisplayPartnerStagiaires = (props) => { } - {/*String(submenu) === "sessions" && selected_code_session &&
- -
-
Formation
- - - -
-
Code Session
- -
- - -
Session à la demande*
- - -
- -
Statut *
- -
- -
Etape *
- - - -
- -
- Date Debut - - - -
- -
Date Fin - - - -
- -
Date début des inscriptions * - - - -
- - -
Date Fin des inscriptions * - - - -
- -
Présentiel *
- - -
- -
A distance*
- - -
- -
Adresse
- -
-
Code postal
- -
-
Ville
- -
- -
Pays
- -
- -
Formateur
- -
- -
Code Formation LMS - (le code créé dans le LMS) - -
- - -
Nombre participants *
- -
- -
Prix session
- -
- - -
- -
*/} - - {/*String(submenu) === "absence" && String(display_detail_absence) === "1" &&
- - -
*/} - - {String(submenu) === "historique" && String(display_detail_historique) === "1" &&
+ {String(submenu) === "historique" && String(display_detail_historique) === "1" && String(addOneParticipant) !== "1" &&
{ var nom_fichier_cmd = "Convention.zip"; - if (String(selected_convention_id).trim() === "") { + if (!selected_convention_id || String(selected_convention_id).trim() === "") { alert(" Vous devez choisir un modèle de document "); return; } @@ -995,7 +995,7 @@ const Module_Editique = (props) => { > MySy Information - + @@ -1079,7 +1079,7 @@ const Module_Editique = (props) => { MySy Information - {Dialog_1_message} - {action_server_type_doc} + {Dialog_1_message} @@ -1406,7 +1406,7 @@ const Module_Editique = (props) => { MySy Information - {Dialog_1_message} - {action_server_type_doc} + {Dialog_1_message}
Type Document
@@ -1722,7 +1722,7 @@ const Module_Editique = (props) => {
-
+
Action Editique
{Getall_Editable_Document_By_Partner_By_Collection_result && @@ -1761,7 +1761,7 @@ const Module_Editique = (props) => { } }}> - {(JSON.parse(document).courrier_template_ref_interne)} + {(JSON.parse(document).courrier_template_nom)}
{String(JSON.parse(document).has_history_event) === "1" && @@ -1791,7 +1791,7 @@ const Module_Editique = (props) => {
-
+
Détail