31/01/2024 - 16h

recette2
cherif 2024-01-31 16:01:57 +01:00
parent 8024e787b6
commit 0008cc73be
5 changed files with 386 additions and 159 deletions

View File

@ -143,6 +143,19 @@ const DisplayPartnerSession = (props) => {
); );
} }
function Display_Colunm_text({ value }) {
return (
<div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
{value}&nbsp;
</div>
);
}
const [datagrid_columns_size_model1, setdatagrid_columns_size_model1] = useState(200); const [datagrid_columns_size_model1, setdatagrid_columns_size_model1] = useState(200);
const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(100); 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, field: 'statut', headerName: 'Statut', hide: true, width: datagrid_columns_size_model2,
valueFormatter: (params) => { renderCell: (cellValues) => {
if (String(params.value) === "0") return (
return "Inactif";
else if (String(params.value) === "1") <div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
return "Actif"; {String(cellValues.row.distantiel) === "1" && "Actif"}&nbsp;
else {String(cellValues.row.distantiel) !== "1" && "Inactif"}&nbsp;
return "?";
</div>
);
}, },
}, },
{ {
field: 'etape', headerName: 'Etape', hide: false, width: datagrid_columns_size_model2, field: 'etape', headerName: 'Etape', hide: false, width: datagrid_columns_size_model2, renderCell: (params) => <ExpandableCell_50 {...params} />,
}, },
{ field: 'class_external_code', headerName: 'Code Formation', align: "center", hideable: true, flex: 1, hide: true, minWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, }, { field: 'class_external_code', headerName: 'Code Formation', align: "center", hideable: true, flex: 1, hide: true, minWidth: 150, renderCell: (params) => <ExpandableCell_50 {...params} />, },
@ -174,28 +191,37 @@ const DisplayPartnerSession = (props) => {
{ field: 'date_fin', headerName: 'Fin', hideable: false, width: datagrid_columns_size_model2, }, { field: 'date_fin', headerName: 'Fin', hideable: false, width: datagrid_columns_size_model2, },
{ {
field: 'distantiel', headerName: 'Distantiel', hideable: false, width: datagrid_columns_size_model2, field: 'distantiel', headerName: 'Distantiel', hideable: false, width: datagrid_columns_size_model2,
valueFormatter: (params) => { renderCell: (cellValues) => {
if (String(params.value) === "0") return (
return "Non";
else if (String(params.value) === "1") <div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
return "Oui"; {String(cellValues.row.distantiel) === "1" && "Oui"}&nbsp;
else {String(cellValues.row.distantiel) !== "1" && "Non"}&nbsp;
return "?";
</div>
);
}, },
}, },
{ {
field: 'presentiel', headerName: 'Presentiel', width: datagrid_columns_size_model2, field: 'presentiel', headerName: 'Presentiel', width: datagrid_columns_size_model2,
valueFormatter: (params) => { renderCell: (cellValues) => {
if (String(params.value) === "0") return (
return "Non";
else if (String(params.value) === "1") <div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
return "Oui"; {String(cellValues.row.presentiel) === "1" && "Oui"}&nbsp;
else {String(cellValues.row.presentiel) !== "1" && "Non"}&nbsp;
return "?";
</div>
);
}, },
}, },
{ field: 'formateur', headerName: 'Formateur', minWidth: datagrid_columns_size_model1, hide: true, hideable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, }, { field: 'formateur', headerName: 'Formateur', minWidth: datagrid_columns_size_model1, hide: true, hideable: true, renderCell: (params) => <ExpandableCell_50 {...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) => <ExpandableCell_50 {...params} />, },
{ {
field: 'taux_remplissage', headerName: 'Remplissage', align: "center", flex: 1, minWidth: 100, maxWidth: 150, flex: 1, field: 'taux_remplissage', headerName: 'Remplissage', align: "center", flex: 1, minWidth: 100, maxWidth: 150, flex: 1,
align: "left", align: "left",
@ -218,12 +244,12 @@ const DisplayPartnerSession = (props) => {
}, },
{ field: 'nb_inscrit', headerName: 'Inscrits', minWidth: 20, align: "center", hide: true, hideable: true, }, { 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: '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) => <ExpandableCell_50 {...params} />, },
{ field: 'title', headerName: 'Formation', minWidth: 250, flex: 1, align: "center", hide: true, hideable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, }, { field: 'title', headerName: 'Formation', minWidth: 250, flex: 1, align: "center", hide: true, hideable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'domaine', headerName: 'Domaine', 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) => <ExpandableCell_50 {...params} />, },
{ field: 'published', headerName: 'publié', 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, renderCell: (params) => <ExpandableCell_50 {...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) => <ExpandableCell_50 {...params} />, },
{ {
field: "Detail", headerName: 'Voir détail', field: "Detail", headerName: 'Voir détail',
renderCell: (cellValues) => { renderCell: (cellValues) => {
@ -724,6 +750,22 @@ const DisplayPartnerSession = (props) => {
{ field: 'nom', headerName: 'nom', width: 150, hide: false, editable: true }, { field: 'nom', headerName: 'nom', width: 150, hide: false, editable: true },
{ field: 'prenom', headerName: 'prenom', width: 150, hide: false, editable: false }, { field: 'prenom', headerName: 'prenom', width: 150, hide: false, editable: false },
{ field: 'statut', headerName: 'Statut', width: 150, hide: false, editable: false ,
renderCell: (cellValues) => {
return (
<div style={{ paddingLeft: "5px", paddingRight: "10px", "display": "block", wordBreak: "break-all" }}>
{String(cellValues.row.statut) === "0" && "Init"}&nbsp;
{String(cellValues.row.statut) === "1" && "Envoyé"}&nbsp;
{String(cellValues.row.statut) === "2" && "Validé"}&nbsp;
</div>
);
},
},
{ field: 'date_envoi', headerName: 'Envoyé le', width: 150, hide: false, editable: false },
{ {
field: "valide", headerName: 'Valider', field: "valide", headerName: 'Valider',
renderCell: (cellValues) => { renderCell: (cellValues) => {
@ -1609,6 +1651,12 @@ const DisplayPartnerSession = (props) => {
document.getElementById("historique").style.fontWeight = "normal"; 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() { async function submenu_detail_session() {
@ -1654,6 +1702,12 @@ const DisplayPartnerSession = (props) => {
document.getElementById("historique").style.color = "black"; document.getElementById("historique").style.color = "black";
document.getElementById("historique").style.fontWeight = "normal"; 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() { async function submenu_sequence_session() {
@ -1701,6 +1755,12 @@ const DisplayPartnerSession = (props) => {
document.getElementById("historique").style.fontWeight = "normal"; 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"; 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.backgroundColor = "#104277";
document.getElementById("editique").style.color = "white"; document.getElementById("editique").style.color = "white";
document.getElementById("editique").style.fontWeight = "bold"; document.getElementById("editique").style.fontWeight = "bold";
console.log(" editique");
} }
if (document.getElementById("inscrit")) { if (document.getElementById("inscrit")) {
@ -1836,16 +1898,19 @@ const DisplayPartnerSession = (props) => {
if (document.getElementById("detail_session")) { if (document.getElementById("detail_session")) {
document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; document.getElementById("detail_session").style.backgroundColor = "#d8edfc";
document.getElementById("detail_session").style.color = "black"; document.getElementById("detail_session").style.color = "black";
document.getElementById("detail_session").style.fontWeight = "normal";
} }
if (document.getElementById("preinscrit")) { if (document.getElementById("preinscrit")) {
document.getElementById("preinscrit").style.backgroundColor = "#d8edfc"; document.getElementById("preinscrit").style.backgroundColor = "#d8edfc";
document.getElementById("preinscrit").style.color = "black"; document.getElementById("preinscrit").style.color = "black";
document.getElementById("preinscrit").style.fontWeight = "normal";
} }
if (document.getElementById("sequence_session")) { if (document.getElementById("sequence_session")) {
document.getElementById("sequence_session").style.backgroundColor = "#d8edfc"; document.getElementById("sequence_session").style.backgroundColor = "#d8edfc";
document.getElementById("sequence_session").style.color = "black"; document.getElementById("sequence_session").style.color = "black";
document.getElementById("sequence_session").style.fontWeight = "normal";
} }
if (document.getElementById("historique")) { if (document.getElementById("historique")) {
@ -1854,6 +1919,11 @@ const DisplayPartnerSession = (props) => {
document.getElementById("historique").style.fontWeight = "normal"; 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 = [ const New_civilite = [
{ "id": "Mme", "label": "Mme", "value": "Mme" }, { "id": "Mme", "label": "Mme", "value": "Mme" },
{ "id": "M", "label": "M", "value": "M" }, { "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": "0", "label": "Autre", "value": "0" },
{ "id": "1", "label": "Salariés", "value": "1" }, { "id": "1", "label": "Salariés", "value": "1" },
{ "id": "2", "label": "Apprentis", "value": "2" }, { "id": "2", "label": "Apprentis", "value": "2" },
{ "id": "3", "label": "Particuliers", "value": "3" }, { "id": "3", "label": "Particuliers", "value": "3" },
{ "id": "4", "label": "Rech. Emploi", "value": "4" }, { "id": "4", "label": "Rech. Emploi", "value": "4" },
] ]
const [myinscript_status, setmyinscript_status] = useState(""); const [myinscript_status, setmyinscript_status] = useState("");
@ -7743,6 +7813,7 @@ const DisplayPartnerSession = (props) => {
} else { } else {
//console.log("erreur rrrr:" + data['status']) //console.log("erreur rrrr:" + data['status'])
setGetListePreinscrit_emarg_api("false"); setGetListePreinscrit_emarg_api("false");
alert(data['message']);
} }
@ -7750,11 +7821,16 @@ const DisplayPartnerSession = (props) => {
setLoading(false); setLoading(false);
console.error('Error:', error); console.error('Error:', error);
setGetListePreinscrit_emarg_api("false"); 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_val, setactionmass_emarg_val] = useState();
const actionmass_emarg = (event) => { const actionmass_emarg = (event) => {
const value = event.target.value; const value = event.target.value;
@ -7791,12 +7867,13 @@ const DisplayPartnerSession = (props) => {
if (String(actionmass_emarg_val) === "demande emargement") { if (String(actionmass_emarg_val) === "demande emargement") {
ActionMassListEmargement(); ActionMassListEmargement();
} }
await sleep(50) await sleep(20)
} }
setSelectionModel_emarg([]); setSelectionModel_emarg([]);
setactionmass_emarg_val(); setactionmass_emarg_val();
GetListeEmargement(selected_session_id, selected_internal_url); 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(); clean_old_messages();
if (selectionModel_emarg.length <= 0) { 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; return;
} }
@ -7836,13 +7913,15 @@ const DisplayPartnerSession = (props) => {
setActionMassListEmargement_api("true"); setActionMassListEmargement_api("true");
setActionMassListEmargement_result(res.data.message); setActionMassListEmargement_result(res.data.message);
} else if (String(res.data.status) === String("Err_Connexion")) { } else if (String(res.data.status) === String("Err_Connexion")) {
alert('Erreur: ' + res.data.message); alert(res.data.message);
history.push("/Connexion"); history.push("/Connexion");
} }
else { else {
setActionMassListEmargement_api("false"); setActionMassListEmargement_api("false");
setActionMassListEmargement_message(res.data.message); setActionMassListEmargement_message(res.data.message);
alert(res.data.message);
} }
@ -8893,7 +8972,7 @@ const DisplayPartnerSession = (props) => {
}} }}
renderInput={(params) => <TextField {...params} label="" /> renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
} }
/> />
{/*<TextField {/*<TextField
@ -8937,7 +9016,7 @@ const DisplayPartnerSession = (props) => {
} }
}} }}
renderInput={(params) => <TextField {...params} label="" /> renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
} }
/> />
@ -8989,7 +9068,7 @@ const DisplayPartnerSession = (props) => {
} }
}} }}
renderInput={(params) => <TextField {...params} label="" /> renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
} }
/> />
{/*<TextField {/*<TextField
@ -12249,7 +12328,7 @@ const DisplayPartnerSession = (props) => {
<div className="session_caract"> <b> Civilité </b><br /> <div className="session_caract"> <b> Civilité </b><br />
<Autocomplete <Autocomplete
disablePortal disablePortal
name="one_civilite_part" name="one_civilite_part"
id="one_civilite_part" id="one_civilite_part"
@ -12453,7 +12532,7 @@ const DisplayPartnerSession = (props) => {
</div> </div>
<div className="session_caract"> Type apprenant <br /> <div className="session_caract"> Type apprenant <br />
<Autocomplete <Autocomplete
disablePortal disablePortal
name="one_detail_type_apprenant" name="one_detail_type_apprenant"
id="one_detail_type_apprenant" id="one_detail_type_apprenant"
@ -12465,7 +12544,7 @@ const DisplayPartnerSession = (props) => {
} }
}} }}
renderInput={(params) => <TextField {...params} label="" /> renderInput={(params) => <TextField {...params} label="" />
} }
/> />
@ -12727,21 +12806,21 @@ const DisplayPartnerSession = (props) => {
<h5> Ajout d'un nouveau participant</h5> <h5> Ajout d'un nouveau participant</h5>
<div className="session_caract"> <b> Civilité </b><br /> <div className="session_caract"> <b> Civilité </b><br />
<Autocomplete <Autocomplete
disablePortal disablePortal
name="one_civilite_part" name="one_civilite_part"
id="one_civilite_part" id="one_civilite_part"
className="disabled_style enable_style" className="disabled_style enable_style"
options={New_civilite} options={New_civilite}
onChange={(event, value) => { onChange={(event, value) => {
if (value && value.value) { if (value && value.value) {
setp_one_civilite_part(value.value); setp_one_civilite_part(value.value);
}
}}
renderInput={(params) => <TextField {...params} label="" />
} }
}} />
renderInput={(params) => <TextField {...params} label="" />
}
/>
{/*<TextField {/*<TextField
required required
@ -12950,7 +13029,7 @@ const DisplayPartnerSession = (props) => {
<div className="session_caract"> <b> Civilité </b><br /> <div className="session_caract"> <b> Civilité </b><br />
<Autocomplete <Autocomplete
disablePortal disablePortal
name="one_status_part" name="one_status_part"
id="one_civilite_part" id="one_civilite_part"
@ -13091,7 +13170,7 @@ const DisplayPartnerSession = (props) => {
</div> </div>
<div className="session_caract"> Statut Inscription <br /> <div className="session_caract"> Statut Inscription <br />
<Autocomplete <Autocomplete
disablePortal disablePortal
name="one_status_part" name="one_status_part"
id="one_status_part" id="one_status_part"
@ -13101,14 +13180,14 @@ const DisplayPartnerSession = (props) => {
onChange={(event, value) => { onChange={(event, value) => {
if (value && value.value) { if (value && value.value) {
setmyinscript_status(value.value); setmyinscript_status(value.value);
} }
}} }}
renderInput={(params) => <TextField {...params} label="" /> renderInput={(params) => <TextField {...params} label="" />
} }
/> />
{/*<TextField {/*<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required required
select select
@ -13153,7 +13232,7 @@ const DisplayPartnerSession = (props) => {
</div> </div>
<div className="session_caract"> Type apprenant <br /> <div className="session_caract"> Type apprenant <br />
<Autocomplete <Autocomplete
disablePortal disablePortal
name="one_detail_type_apprenant" name="one_detail_type_apprenant"
id="one_detail_type_apprenant" id="one_detail_type_apprenant"
@ -13162,16 +13241,16 @@ const DisplayPartnerSession = (props) => {
onChange={(event, value) => { onChange={(event, value) => {
if (value && value._id) { if (value && value._id) {
setp_one_detail_type_apprenant(value._id); setp_one_detail_type_apprenant(value._id);
} }
}} }}
renderInput={(params) => <TextField {...params} label="" /> renderInput={(params) => <TextField {...params} label="" />
} }
/> />
{/*<TextField {/*<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required required
@ -14379,12 +14458,64 @@ const DisplayPartnerSession = (props) => {
{String(submenu) === String("emargement") && <div style={{ "border": "None" }}> {String(submenu) === String("emargement") && <div style={{ "border": "None" }}>
<div className="div_row" style={{ "textAlign": "right", "marginTop": "0.5rem" }}> <div className="div_row" style={{ "textAlign": "right", "marginTop": "0.5rem" }}>
<Button className="bton_emarge" onClick={ConfirmInitListEmargement}>Initialiser la liste émargement</Button>
<Button className="bton_emarge" onClick={DownloadListEmargement}>Imprimer la liste émargement</Button> <Popup
<Button className="bton_emarge" onClick={ConfirmEnvoiListEmargement}>Envoyer les demandes d'émargement</Button><br /> trigger={
<Button className="bton_emarge">Initialiser la liste</Button>
}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
<font> Confirmez la ()initialisation de la liste d'émargement. <br />
<font color="red"> /!\ Si un tableau d'émargement existe pour cette session, il sera supprimé et récréé </font>
</font>
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
CreateListEmargement();
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
<Button className="bton_emarge" onClick={DownloadListEmargement}>Imprimer la liste</Button>
<Button className="bton_emarge" onClick={ConfirmEnvoiListEmargement}>Envoyer demandes émargement</Button><br />
</div> </div>
<div className="session_data" style={{ height: 500, width: '100%' }}> <div className="session_data" style={{ height: 500, width: '100%' }}>
<DataGrid <DataGrid
checkboxSelection checkboxSelection
onSelectionModelChange={(newSelectionModel_emarg) => { onSelectionModelChange={(newSelectionModel_emarg) => {
@ -14410,7 +14541,8 @@ const DisplayPartnerSession = (props) => {
sequence_end: JSON.parse(item).sequence_end, sequence_end: JSON.parse(item).sequence_end,
is_present: JSON.parse(item).is_present, 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 && <div className="div_row"> &nbsp; </div>
<div className="block_en_mass"> <div className="div_row">
<nav className='traitement_mass'>Traitement en masse / Emarge</nav> {selectionModel_emarg && selectionModel_emarg.length >= 1 &&
&nbsp;<select <div className="block_en_mass">
<nav >Traitement en masse </nav><br />
&nbsp;
<Autocomplete
disablePortal
id="combo-box-demo"
className="block_en_mass_select"
fullWidth
options={New_Option_Emargement_Masse}
onChange={(event, value) => {
if (value && value.value) {
if (String(value.value) === "demande emargement") {
setactionmass_emarg_val(value.value);
}
else {
setactionmass_emarg_val("");
}
}
}}
renderInput={(params) => <TextField {...params} placeholder="Choisir une option" />
}
/>
{/*<select
id={"actionmassemarg"} name={"actionmassemarg"} id={"actionmassemarg"} name={"actionmassemarg"}
onChange={actionmass_emarg} onChange={actionmass_emarg}
className="action_mass"> className="action_mass">
<option selected value="n/a">Choisir une action</option> <option selected value="n/a">Choisir une action</option>
<option value="demande emargement">Demande emargement</option> <option value="demande emargement">Demande emargement</option>
</select> &nbsp; </select>*/} &nbsp;
{actionmass_emarg_val && {actionmass_emarg_val &&
<Popup <Popup
trigger={<Button className="bton_traiter_en_mass" > trigger={<Button className="bton_enreg" >
<FcAcceptDatabase /> Traiter <FcAcceptDatabase /> Traiter
</Button>} </Button>}
modal modal
nested nested
position="center center" position="center center"
> >
{close => ( {close => (
<div> <div>
<button className="gest_close" onClick={close}> <button className="gest_close" onClick={close}>
&times; &times;
</button> </button>
<div className="gest_header"> MySy Information </div> <div className="gest_header"> MySy Information </div>
<div className="gest_content"> <div className="gest_content">
{' '} {' '}
Confirmer l'action <b> {actionmass_emarg_val} </b> en masse.
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
actionmass_emarge_Traitemet();
close();
}}> Valider </button>
Confirmer l'action <b> {actionmass_emarg_val} </b> en masse.
</div> </div>
<div style={{ "width": "45%", "float": "right" }}> <div className="gest_actions">
<button <div style={{ "width": "45%", "float": "left" }}>
className="gest_bton_popup" <button className="gest_bton_popup" onClick={(event) => {
onClick={() => { actionmass_emarge_Traitemet();
//console.log('modal closed ');
close(); close();
}} }}> Valider </button>
>
Annuler </div>
</button> <div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div> </div>
</div> </div>
</div> )}
)} </Popup>
</Popup> }
} <br />
<br />
</div> </div>
} }
<br /> <br />
</div>
{/*<Button className="bton_emarge" onClick={ActionMassListEmargement}>Envoyer les demandes d'emargement</Button><br /> {/*<Button className="bton_emarge" onClick={ActionMassListEmargement}>Envoyer les demandes d'emargement</Button><br />
*/} */}

View File

@ -376,25 +376,25 @@ const DistplayPartnerTraningsPage = (props) => {
{ field: 'presentiel', headerName: 'Présentiel', hide: true, Width: 0, }, { field: 'presentiel', headerName: 'Présentiel', hide: true, Width: 0, },
{ field: 'distanciel', headerName: 'Distanciel', hide: true, Width: 0, }, { field: 'distanciel', headerName: 'Distanciel', hide: true, Width: 0, },
{ field: 'cible', headerName: 'Cible', 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_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_in_hour', headerName: 'duration_in_hour', hide: true, Width: 0, editable: false, },
{ field: 'currency', headerName: 'currency', 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: '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) => <ExpandableCell_50 {...params} />, }, { field: 'external_code', headerName: 'Code Formation', hideable: false, minWidth: 150, flex: 1, maxWidth: 250, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'title', headerName: 'Titre', hideable: false, minWidth: 300, flex: 1, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, }, { field: 'title', headerName: 'Titre', hideable: false, minWidth: 300, flex: 1, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'domain', headerName: 'Domaine', minWidth: 50, flex: 1, maxWidth: 150, hideable: true, editable: false, }, { 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: '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: '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: '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) => <ExpandableCell_50 {...params} />, }, { field: 'description', headerName: 'Description', hide: true, resizable: true, minWidth: 250, maxWidth: 300, flex: 1, renderCell: (params) => <ExpandableCell_50 {...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, field: 'published', headerName: 'Publié', minWidth: 50, flex: 1, maxWidth: 100, align: "center", resizable: true, editable: false,
valueFormatter: (params) => { valueFormatter: (params) => {
if (String(params.value) === "0") if (String(params.value) === "0")
return "Non"; return "Non";
else if (String(params.value) === "1") 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) => { renderCell: (cellValues) => {
return ( return (
@ -1266,7 +1266,7 @@ const DistplayPartnerTraningsPage = (props) => {
}, },
"& .MuiDataGrid-cellContent": { "& .MuiDataGrid-cellContent": {
minHeight: 50, minHeight: 50,
} }
}; };
@ -1953,7 +1953,7 @@ const DistplayPartnerTraningsPage = (props) => {
components={{ components={{
Toolbar: GridToolbar, Toolbar: GridToolbar,
}} }}
getCellClassName={(params) => { getCellClassName={(params) => {
if (params.field === 'published' && String(params.value) === "1") { if (params.field === 'published' && String(params.value) === "1") {
return 'cell--published'; return 'cell--published';
@ -1983,7 +1983,7 @@ const DistplayPartnerTraningsPage = (props) => {
getEstimatedRowHeight={() => 200} getEstimatedRowHeight={() => 200}
getRowHeight={() => "auto"} getRowHeight={() => "auto"}
sx={datagridSx} sx={datagridSx}
/> />
</Box> </Box>
@ -1993,8 +1993,10 @@ const DistplayPartnerTraningsPage = (props) => {
<div className="div_row"> <div className="div_row">
{selectionModel && selectionModel.length >= 1 && <div className="block_en_mass"> {selectionModel && selectionModel.length >= 1 && <div className="block_en_mass">
<nav >Traitement en masse </nav> <nav >Traitement en masse </nav>
&nbsp; &nbsp;<br />
<Autocomplete <Autocomplete
//sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
disablePortal disablePortal
id="combo-box-demo" id="combo-box-demo"
className="block_en_mass_select" className="block_en_mass_select"
@ -2010,12 +2012,10 @@ const DistplayPartnerTraningsPage = (props) => {
else { else {
setactionmass_ftion_val(); setactionmass_ftion_val();
} }
} }
}} }}
hiddenLabel="true"
renderInput={(params) => <TextField {...params} label="" /> renderInput={(params) => <TextField {...params} placeholder="Choisir une option " variant="outlined" />
} }
/> />

View File

@ -49,6 +49,7 @@ import allLocales from '@fullcalendar/core/locales-all'
import { RepeatOnRounded } from "@mui/icons-material"; import { RepeatOnRounded } from "@mui/icons-material";
import { alignPropType } from "react-bootstrap/esm/types"; import { alignPropType } from "react-bootstrap/esm/types";
import ToggleSwitch from "./ToggleSwitch"; import ToggleSwitch from "./ToggleSwitch";
import ToggleSwitch_v2_mysy from "./ToggleSwitch_v2_mysy"; import ToggleSwitch_v2_mysy from "./ToggleSwitch_v2_mysy";
import Autocomplete from '@mui/material/Autocomplete'; import Autocomplete from '@mui/material/Autocomplete';
@ -275,7 +276,7 @@ const Module_Editique = (props) => {
var nom_fichier_cmd = "Convention.zip"; 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 "); alert(" Vous devez choisir un modèle de document ");
return; return;
} }
@ -320,7 +321,7 @@ const Module_Editique = (props) => {
var nom_fichier_cmd = "Convocation.zip"; 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 "); alert(" Vous devez choisir un modèle de document ");
return; 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); //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id);
setLoading(true); setLoading(true);
axios.get(url, { responseType: 'blob', },) 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/"; 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") { if (String(selected_convention_id) === "default_mail") {
// Il s'agit d'envoyer les convention par defaut de type 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); //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 ( return (
<div className="module_editique"> <div className="module_editique">
@ -1070,7 +1076,28 @@ const Module_Editique = (props) => {
<div className="session_caract_Dialog" > Type Document<br /> <div className="session_caract_Dialog" > Type Document<br />
<TextField
<Autocomplete
disablePortal
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
name="event_dialog_type_convention"
id="event_dialog_type_convention"
fullWidth
options={New_Option_Type_Document}
onChange={(event, value) => {
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) => <TextField {...params} label="" />
}
/>
{/*<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
name="event_dialog_type_convention" name="event_dialog_type_convention"
@ -1091,7 +1118,7 @@ const Module_Editique = (props) => {
<MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email &nbsp;</MenuItem> <MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email &nbsp;</MenuItem>
<MenuItem value="pdf" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >PDF &nbsp;</MenuItem> <MenuItem value="pdf" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >PDF &nbsp;</MenuItem>
</TextField> </TextField>*/}
</div> </div>
@ -1168,8 +1195,6 @@ const Module_Editique = (props) => {
value="pdf" value="pdf"
fullWidth fullWidth
/> />
@ -1377,7 +1402,26 @@ const Module_Editique = (props) => {
</DialogContentText> </DialogContentText>
<div className="session_caract_Dialog" > Type Document<br /> <div className="session_caract_Dialog" > Type Document<br />
<TextField <Autocomplete
disablePortal
name="event_dialog_type_convention"
id="event_dialog_type_convention"
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
fullWidth
options={New_Option_Type_Document}
onChange={(event, value) => {
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) => <TextField {...params} label="" />
}
/>
{/*<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
name="event_dialog_type_convention" name="event_dialog_type_convention"
@ -1398,7 +1442,7 @@ const Module_Editique = (props) => {
<MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email &nbsp;</MenuItem> <MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email &nbsp;</MenuItem>
<MenuItem value="pdf" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >PDF &nbsp;</MenuItem> <MenuItem value="pdf" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >PDF &nbsp;</MenuItem>
</TextField> </TextField>*/}
</div> </div>
@ -1468,6 +1512,8 @@ const Module_Editique = (props) => {
</div>} </div>}
{String(selected_convention_type) === "pdf" && <div className="session_caract_Dialog" > Type Document<br /> {String(selected_convention_type) === "pdf" && <div className="session_caract_Dialog" > Type Document<br />
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
@ -1476,12 +1522,8 @@ const Module_Editique = (props) => {
value="pdf" value="pdf"
fullWidth fullWidth
/> />
</div>} </div>}
@ -1749,7 +1791,7 @@ const Module_Editique = (props) => {
minHeight: 270, flexGrow: 1, minHeight: 270, flexGrow: 1,
boxShadow: 1, boxShadow: 1,
borderRadius: 2, 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 &&
JSON.parse(document).list_document_history_event.map((history_doc) => ( JSON.parse(document).list_document_history_event.map((history_doc) => (
<nav>
{String(history_doc.local_target_collection_name).trim() === "" &&
<TreeItem className="test02" nodeId={history_doc._id}
sx={{ color: 'darkslateblue', fontWeight: 'light', fontStyle: 'italic', mt: '10px' }}
label={(String(history_doc.date_update).substring(0, 16) + " Par " + String(history_doc.local_update_by_email))}
icon={<FcInfo />}
/>}
<TreeItem className="test02" nodeId={history_doc._id} {String(history_doc.local_target_collection_name).trim() !== "" &&
label={(String(history_doc.date_update).substring(0, 16) + " Par " + String(history_doc.local_update_by_email))} /> <TreeItem className="test02" nodeId={history_doc._id}
label={(String(history_doc.date_update).substring(0, 16) + " Par " + String(history_doc.local_update_by_email) + ". " + String(history_doc.local_target_collection) + " Pour " + String(history_doc.local_target_collection_name))}
sx={{ color: 'darkslateblue', fontWeight: 'light', fontStyle: 'italic', mt: '10px' }}
icon={<FcInfo />} />
}
</nav>
))} ))}
{/*!JSON.parse(document).list_document_history_event || (JSON.parse(document).list_document_history_event).length <= 0 && {/*!JSON.parse(document).list_document_history_event || (JSON.parse(document).list_document_history_event).length <= 0 &&
<TreeItem nodeId={"0"} label="Aucun" <TreeItem nodeId={"0"} label="Aucun"
className="test02" />*/} className="test02" />*/}

View File

@ -607,7 +607,7 @@ const TestUrl_New = (props) => {
<br /> <br />
<h2> Module Ediditique </h2> <h2> Module Ediditique </h2>
<Module_Editique conntected_employee_id={"1234"} related_collection={"session_formation"} related_collection_recid={"65224c1c7e5ee82f3a74afc6"}/> <Module_Editique conntected_employee_id={"1234"} related_collection={"session_formation"} related_collection_recid={"65b378562f89e592bf0e4b78"}/>
<Button variant="contained" className="bton_enreg" <Button variant="contained" className="bton_enreg"
onClick={afficher_champs_spec}> onClick={afficher_champs_spec}>

View File

@ -2251,11 +2251,22 @@
.bton_emarge { .bton_emarge {
border-radius: 5rem; border-radius: 5rem;
font-size: small; font-size: 11px;
padding: 0.5rem; padding: 0.5rem;
background: rgb(129, 188, 58); background: rgb(129, 188, 58);
margin-left: 5px; margin-left: 5px;
margin-right: 5px; margin-right: 5px;
color: white;
}
.bton_emarge:hover {
border-radius: 5rem;
font-size: 11px;
padding: 0.5rem;
background: rgb(129, 188, 58);
margin-left: 5px;
margin-right: 5px;
color: white;
} }
.css-1x5jdm { .css-1x5jdm {