26/12/2023 - 22h

recette2
cherif 2023-12-26 21:44:55 +01:00
parent 68d444fdbd
commit 11a2150df8
4 changed files with 1019 additions and 278 deletions

View File

@ -180,10 +180,10 @@ const Apprenant = (props) => {
onClick={(event) => {
if (cellValues.row._id && String(cellValues.row._id).length > 2) {
var tmp = cellValues.row.session_code+"&"+cellValues.row.session_id+"&"+cellValues.row.class_internal_url+"&"+p_detail_email;
var tmp = cellValues.row.session_code + "&" + cellValues.row.session_id + "&" + cellValues.row.class_internal_url + "&" + p_detail_email;
window.open(
process.env.REACT_APP_FRONT_URL + "Partner/mes_stagiaires/" + String(cellValues.row._id)+"/"+String(tmp),
process.env.REACT_APP_FRONT_URL + "Partner/mes_stagiaires/" + String(cellValues.row._id) + "/" + String(tmp),
'_blank'
);
}
@ -2841,8 +2841,8 @@ const Apprenant = (props) => {
const [Add_Inscription_List_Apprenant_message, setAdd_Inscription_List_Apprenant_message] = useState();
const [Add_Inscription_List_Apprenant_result, setAdd_Inscription_List_Apprenant_result] = useState();
function Add_Inscription_List_Apprenant() {
var liste_apprenant = GetSelectedRowsSession();
var form = new FormData();
@ -2869,7 +2869,7 @@ const Apprenant = (props) => {
setAdd_Inscription_List_Apprenant_result(res.data.message);
Dialog_add_inscription_handleClose_buton();
Get_All_Apprenant();
setp_dialog_session_id('');
@ -3278,6 +3278,143 @@ const Apprenant = (props) => {
];
const [New_Get_List_Apprenant_Modele_Courrier_result, setNew_Get_List_Apprenant_Modele_Courrier_result] = useState([]);
const [Get_List_Apprenant_Modele_Courrier_api, setGet_List_Apprenant_Modele_Courrier_api] = useState();
const [Get_List_Apprenant_Modele_Courrier_message, setGet_List_Apprenant_Modele_Courrier_message] = useState();
const [Get_List_Apprenant_Modele_Courrier_result, setGet_List_Apprenant_Modele_Courrier_result] = useState();
function Get_List_Apprenant_Modele_Courrier(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
//form.append("inscription_id", selected_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Fiche_Apprenant/";
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
//console.log(" In Get_List_Apprenant_Modele_Courrier res.data.status = " + res.data.status);
//console.log(" In Get_List_Apprenant_Modele_Courrier res.data.message r_class = " + res.data.message);
setGet_List_Apprenant_Modele_Courrier_api("true");
setGet_List_Apprenant_Modele_Courrier_result(res.data.message);
var new_data2 = [];
var node = {
"_id": "default_pdf",
"id": "default_pdf",
"label": "PDF par default",
"ref_interne": "",
"nom": "",
"sujet": "",
"type_doc": "",
"cible": "",
"joint_pdf": "",
};
new_data2.push(node);
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_ref_interne = JSON.parse(x).ref_interne;
var local_nom = JSON.parse(x).nom;
var local_sujet = JSON.parse(x).sujet;
var local_type_doc = JSON.parse(x).type_doc;
var local_cible = JSON.parse(x).cible;
var local_joint_pdf = JSON.parse(x).joint_pdf;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_nom,
"ref_interne": local_ref_interne,
"nom": local_nom,
"sujet": local_sujet,
"type_doc": local_type_doc,
"cible": local_cible,
"joint_pdf": local_joint_pdf,
};
new_data2.push(node);
});
if (new_data2.length > 0)
setNew_Get_List_Apprenant_Modele_Courrier_result(new_data2);
}
else {
setGet_List_Apprenant_Modele_Courrier_api("false");
setGet_List_Apprenant_Modele_Courrier_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Get_List_Apprenant_Modele_Courrier = ', error);
setGet_List_Apprenant_Modele_Courrier_api("false");
alert("Impossible de récupérer les modèles de convention");
//setmyApimyApiMessage("")
})
}
const [Download_Apprenant_Fiche_PDF_api, setDownload_Apprenant_Fiche_PDF_api] = useState();
const [Download_Apprenant_Fiche_PDF_result, setDownload_Apprenant_Fiche_PDF_result] = useState();
const [Download_Apprenant_Fiche_PDF_message, setDownload_Apprenant_Fiche_PDF_message] = useState();
const Download_Apprenant_Fiche_PDF = (event) => {
const stored_cookie = getCookie('tokenmysypart');
var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
var token = stored_cookie;
var url = process.env.REACT_APP_API_URL + "myclass/api/Print_Apprenant_PDF/" + token + "/" + selected_apprenant_id+"/"+fiche_apprenant_id;
setLoading(true);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
setLoading(false);
fileDownload(res.data, nom_fiche_detaillee);
setDownload_Apprenant_Fiche_PDF_api("true");
}).catch((error) => {
setLoading(false);
console.error('Error:', error);
setDownload_Apprenant_Fiche_PDF_api("false");
});
}
const [fiche_apprenant_id, setfiche_apprenant_id] = React.useState("");
const [Dialog_fiche_apprenant_message, setDialog_fiche_apprenant_message] = React.useState(false);
const [Dialog_fiche_apprenant_open, setDialog_fiche_apprenant_open] = React.useState(false);
function Dialog_fiche_apprenant_handle_change(message) {
setDialog_fiche_apprenant_message(message);
setDialog_fiche_apprenant_open(true);
}
const Dialog_fiche_apprenant_handleClose_buton = () => {
setDialog_fiche_apprenant_open(false);
};
const Dialog_fiche_apprenant_handleClose = () => {
setDialog_fiche_apprenant_open(false);
};
return (
<div className="apprenant">
@ -3817,6 +3954,72 @@ const Apprenant = (props) => {
</Dialog>
<Dialog
open={Dialog_fiche_apprenant_open}
onClose={Dialog_fiche_apprenant_handleClose}
className="displaypartnersession"
>
<DialogTitle>MySy Information</DialogTitle>
<DialogContent className="DialogContent_width" style={{ "minHeight": "20rem" }}>
<div className="session_caract_Dialog" > Choisir un modèle de fiche
<Autocomplete
disablePortal
name="event_dialog_version_convention"
id="event_dialog_version_convention"
fullWidth
//className="disabled_style enable_style"
options={New_Get_List_Apprenant_Modele_Courrier_result}
onChange={(event, value) => {
if (value && value._id) {
if (String(value._id) === "default_pdf") {
setfiche_apprenant_id("default_pdf");
} else {
setfiche_apprenant_id(value._id);
}
}
}}
renderInput={(params) => <TextField {...params} label="" />
}
/>
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
<Button className="bton_enreg_dialog" onClick={(e) => {
Download_Apprenant_Fiche_PDF();
Dialog_fiche_apprenant_handleClose_buton();
}}
>Télécharger </Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_fiche_apprenant_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
<h3> Vos apprenants </h3>
<div>
<div className="titre1"> Utilisez les filtres !</div>
@ -4664,6 +4867,19 @@ const Apprenant = (props) => {
</div>
</div>
<div className="div_row_droite">
<div style={{ "marginLeft": "1rem" }}>
<label className="bton_image_class" onClick={(e) => {
Get_List_Apprenant_Modele_Courrier();
setDialog_fiche_apprenant_open(true);
}} >Imprimer une fiche</label><br />
</div>
</div>
</div>
@ -5591,7 +5807,6 @@ const Apprenant = (props) => {
</div>}
{String(display_detail_absence) === "1" && String(add_One_Apprenant) !== "1" && selected_apprenant_id && <div className="div_row" style={{ "border": "None", "background": '#F8F9F9', "padding": '5px' }}>
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Détail des absences </nav>
<Module_Absence attendee_email={selected_apprenant_email}
inscription_id={selected_apprenant_id}
related_collection={"apprenant"}

View File

@ -7947,7 +7947,7 @@ const DisplayPartnerSession = (props) => {
var url = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_PDF/" + stored_cookie + "/" + selected_session_id + "/" + selected_convention_id;
console.log(" #### selected_convention_id = ", selected_convention_id);
if (String(selected_convention_id) === "default_pdf") {
// Il s'agit d'envoyer les convention par defaut de type mail
@ -8637,58 +8637,7 @@ const DisplayPartnerSession = (props) => {
<DialogTitle>MySy Information</DialogTitle>
<DialogContent className="DialogContent_width" style={{ "minHeight": "30rem" }}>
{/*<div className="session_caract_Dialog" > Choisir une convention
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_version_convention"
id="event_dialog_version_convention"
select
fullWidth
value={selected_convention_id}
onChange={(e) => {
setselected_convention_id(e.target.value);
if (String(e.target.value) === "default_mail") {
setselected_convention_type("email");
}
else if (String(e.target.value) === "default_pdf") {
setselected_convention_type("pdf");
} else {
var result2 = Get_List_Stagiaire_Conventions_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(e.target.value))
setselected_convention_type(JSON.parse(result2).type_doc);
}
settab_convention_pieces_jointes_result([]);
}
}
>
{Get_List_Stagiaire_Conventions_result &&
Get_List_Stagiaire_Conventions_result.map((myclient) => (
<MenuItem key={JSON.parse(myclient)._id} value={JSON.parse(myclient)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>
{JSON.parse(myclient).nom}&nbsp; <b>{JSON.parse(myclient).type_doc} </b>
</MenuItem>
))}
<MenuItem key="default_mail" value="default_mail"
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>
Email par default &nbsp;<b>Email</b>
</MenuItem>
<MenuItem key="default_pdf" value="default_pdf"
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>
PDF par default &nbsp;<b>PDF</b>
</MenuItem>
</TextField>
</div>*/}
<div className="session_caract_Dialog" > Choisir une convention
@ -8704,9 +8653,7 @@ const DisplayPartnerSession = (props) => {
if (value && value._id) {
setselected_convention_id(value._id);
console.log(" €€ value = ", value);
console.log(" €€ value._id = ", value._id);
if (String(value._id) === "default_mail") {
setselected_convention_type("email");
}
@ -8716,7 +8663,7 @@ const DisplayPartnerSession = (props) => {
var result2 = Get_List_Stagiaire_Conventions_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(value._id))
setselected_convention_type(JSON.parse(result2).type_doc);
console.log(" ### JSON.parse(result2).type_doc = ", JSON.parse(result2).type_doc);
}
settab_convention_pieces_jointes_result([]);
}

File diff suppressed because it is too large Load Diff

View File

@ -523,6 +523,10 @@
width: 1rem;
height: 1rem;
}
.not_display_mobile{
display: none;
}
}
@media only screen and (min-width: 601px) and (max-width: 991px) {
@ -976,6 +980,14 @@
height: 1rem;
}
.div_gauche_reduit{
width: 5% !important;
}
.div_droite_ralonge{
width: 94% !important;
}
}
@media only screen and (min-width: 992px) and (max-width: 1199px) {
@ -1470,6 +1482,13 @@
width: 1rem;
height: 1rem;
}
.div_gauche_reduit{
width: 3% !important;
}
.div_droite_ralonge{
width: 96% !important;
}
}
@ -1489,6 +1508,12 @@
margin-right: 2px;
}
.div_droite_ralonge{
width: 96% !important;
}
.img_user {
margin-left: auto;
margin-right: auto;
@ -1532,6 +1557,10 @@
margin-left: 5px;
}
.div_gauche_reduit{
width: 3% !important;
}
.koUpdateData {
font-size: medium;
color: red;