From 0bc57e56853634153d6ee3fe4a2ad11d07aa6720 Mon Sep 17 00:00:00 2001 From: Cherif Date: Mon, 20 Oct 2025 13:35:40 +0200 Subject: [PATCH] 20/10/2025 - 14h --- src/components/DisplayPartnerPromotion.js | 259 +++++++++++++++++- src/components/DisplayPartnerSession.js | 4 - .../Module_Internal_Email_Management.js | 15 +- 3 files changed, 256 insertions(+), 22 deletions(-) diff --git a/src/components/DisplayPartnerPromotion.js b/src/components/DisplayPartnerPromotion.js index baf34c2..6065816 100644 --- a/src/components/DisplayPartnerPromotion.js +++ b/src/components/DisplayPartnerPromotion.js @@ -269,6 +269,7 @@ const DisplayPartnerPromotion = (props) => { const options_menu_vertical = [ 'Renvoyer Conf.', + 'Mémo & Comment.', 'Annuler Insc.', ]; @@ -688,6 +689,7 @@ const DisplayPartnerPromotion = (props) => { const options_menu_vertical_preinsc = [ '', 'Mise à jour', + 'Mémo & Comment.', 'Valider Insc.', 'Refuser Insc.', 'Supprimer', @@ -893,7 +895,7 @@ const DisplayPartnerPromotion = (props) => { onClick={(e) => { //handleClose_option_button_vertical(e, option); - setAnchorEl(null); + setAnchorEl_preinsc(null); if (option && String(option) === "Mise à jour") { setdialogOpen_update(true); @@ -910,6 +912,16 @@ const DisplayPartnerPromotion = (props) => { setdialogOpen_suppr_preinscription(true); } + else if (option && String(option) === "Mémo & Comment.") { + setp_detail_inscription_comment(working_cellValues_preisnc.row.comment); + setp_detail_inscription_memo(working_cellValues_preisnc.row.memo); + setselected_inscription_id(working_cellValues_preisnc.row._id); + setselected_inscription_email(working_cellValues_preisnc.row.email); + setselected_inscription_invoice_status("0"); + setselected_inscription_status("0"); + setDialog_Memo_Comment_open(true); + } + }} > {option} @@ -1206,6 +1218,8 @@ const DisplayPartnerPromotion = (props) => { ); }, }, + { field: 'memo', headerName: 'Mémo', maxWidth: 0, hide: true, editable: false }, + { field: 'comment', headerName: 'Commentaire', maxWidth: 0, hide: true, editable: false }, ] @@ -1417,6 +1431,15 @@ const DisplayPartnerPromotion = (props) => { handleClick_resend_conf_mail(e, working_cellValues); } + else if (option && String(option) === "Mémo & Comment.") { + setp_detail_inscription_comment(working_cellValues.row.comment); + setp_detail_inscription_memo(working_cellValues.row.memo); + setselected_inscription_id(working_cellValues.row._id); + setselected_inscription_email(working_cellValues.row.email); + setselected_inscription_invoice_status(working_cellValues.row.invoiced); + setselected_inscription_status("1"); + setDialog_Memo_Comment_open(true); + } else if (option && String(option) === "Annuler Insc.") { @@ -1456,6 +1479,16 @@ const DisplayPartnerPromotion = (props) => { handleClick_resend_conf_mail(e, working_cellValues); } + else if (option && String(option) === "Mémo & Comment.") { + setp_detail_inscription_comment(working_cellValues.row.comment); + setp_detail_inscription_memo(working_cellValues.row.memo); + setselected_inscription_id(working_cellValues.row._id); + setselected_inscription_email(working_cellValues.row.email); + setselected_inscription_invoice_status(working_cellValues.row.invoiced); + setselected_inscription_status("1"); + setDialog_Memo_Comment_open(true); + } + else if (option && String(option) === "Annuler Insc.") { setdialogOpen_supp_in_menu(true); } @@ -1620,6 +1653,8 @@ const DisplayPartnerPromotion = (props) => { }, }, + { field: 'memo', headerName: 'Mémo', maxWidth: 0, hide: true, editable: false }, + { field: 'comment', headerName: 'Commentaire', maxWidth: 0, hide: true, editable: false }, ] @@ -6025,7 +6060,7 @@ const DisplayPartnerPromotion = (props) => { document.getElementsByName("site_formation")[0].style.backgroundColor = "#ECEFF1"; } - if (document.getElementsByName("entree_scolaire")[0]) { + if (document.getElementsByName("entree_scolaire")[0]) { document.getElementsByName("entree_scolaire")[0].disabled = true; document.getElementsByName("entree_scolaire")[0].style.backgroundColor = "#ECEFF1"; } @@ -7114,7 +7149,7 @@ const DisplayPartnerPromotion = (props) => { if (String(res.data.status) === "true") { //console.log(" In GetCurrentSession res.data.status = " + res.data.status); - // console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message); + // console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message); //console.log(" In GetCurrentSession res.data.message len = " + String(res.data.message).length); setLoading(false); @@ -7130,8 +7165,8 @@ const DisplayPartnerPromotion = (props) => { if (mylocaltraining.session_status) { setp_session_status(mylocaltraining.session_status); var result2 = status_tab.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.session_status))) - - // console.log(" ### session_status = ", result2) + + // console.log(" ### session_status = ", result2) if (result2[0]) setp_session_status_label(result2[0].label); @@ -7920,6 +7955,70 @@ const DisplayPartnerPromotion = (props) => { }) } + function UpdateStagiaire_Memo_Comment(object_id, local_email, local_memo, local_comment) { + + setSendInscriptionCancell_api(); + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("class_internal_url", selected_internal_url); + form.append("session_id", selected_session_id); + form.append("memo", local_memo); + form.append("comment", local_comment); + form.append("_id", object_id); + form.append("email", local_email); + form.append("status", selected_inscription_status); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/"; + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + //console.log(" In UpdateStagiaireData res.data.status = " + res.data.status); + //console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + setUpdateStagiaireData_api("true"); + setUpdateStagiaireData_result(res.data.message); + GetListePreinscrit(selected_session_id, selected_internal_url); + GetListeInscrit(selected_session_id, selected_internal_url); + GetListeEmargement(selected_session_id, selected_internal_url); + + setretval_ch("1"); + // alert(" La mise à jour a été correctement faite."); + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message("La mise à jour a été correctement faite."); + setalert_type("success"); + Dialog_Memo_Comment_handleClose_buton(); + + } + else { + setUpdateStagiaireData_api("false"); + setUpdateStagiaireData_message(res.data.message); + setretval_ch("-1"); + // alert(res.data.message); + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + + } + + }).catch((error) => { + + console.warn('UpdateStagiaireData : Not good man :( mysearchtext = ' + error); + setUpdateStagiaireData_api("false"); + setretval_ch("-1"); + alert(" Impossible d'ajouter le participant") + + }) + } + + function handleClick_update_data(event, cellValues) { @@ -8033,6 +8132,11 @@ const DisplayPartnerPromotion = (props) => { } const [selected_inscription_id, setselected_inscription_id] = useState(""); + const [selected_inscription_email, setselected_inscription_email] = useState(""); + const [selected_inscription_status, setselected_inscription_status] = useState(""); + const [selected_inscription_invoice_status, setselected_inscription_invoice_status] = useState(""); + + function Display_Detail_Inscription(event, cellValues) { clearDetailAttendeFields(); setdisplay_detail_insc("1") @@ -9395,12 +9499,12 @@ const DisplayPartnerPromotion = (props) => { label: 'Inactif', }, - { + { value: '2', label: 'Clôturer', }, - { + { value: '-1', label: 'Annulé', }, @@ -15307,6 +15411,17 @@ const DisplayPartnerPromotion = (props) => { }; + const [Dialog_Memo_Comment_open, setDialog_Memo_Comment_open] = React.useState(false); + const Dialog_Memo_Comment_handleClose_buton = () => { + setDialog_Memo_Comment_open(false); + setp_detail_inscription_comment(""); + setp_detail_inscription_memo(""); + }; + + const [p_detail_inscription_comment, setp_detail_inscription_comment] = useState(""); + const [p_detail_inscription_memo, setp_detail_inscription_memo] = useState(""); + + return (
@@ -15326,6 +15441,130 @@ const DisplayPartnerPromotion = (props) => { {/*** FIN Affichage des messages d'alerte*/} + {/* Dialog pour gerer les Memo_Comment */} + null} + + PaperProps={{ + + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + position: 'absolute', + top: '7rem', + margin: "2px", + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + PaperComponent={PaperComponent} + aria-labelledby="draggable-dialog-title" + + > + + Mémo & Commentaire + + + {Dialog_1_message} + + +
Mémo
+ + { + setp_detail_inscription_memo(e.target.value); + + }} + + /> + +
+ +
Commentaire
+ + { + if (selected_inscription_invoice_status !== "1") { + setp_detail_inscription_comment(e.target.value); + } + + }} + /> + +
+ + +
+ + + + + + + +
+
+ {selected_inscription_invoice_status !== "1" && } + +
+ + +
+ +
+
+ +
+ +
+ {/* FIN Dialog pour gerer les Memo_Comment */} + {/* Dialog pour gerer les Décalage Session Date */} { email: JSON.parse(item).email, amount: JSON.parse(item).price, opco: JSON.parse(item).opco, + memo: JSON.parse(item).memo, + comment: JSON.parse(item).comment, modefinancement: JSON.parse(item).modefinancement, civilite: JSON.parse(item).civilite, client_rattachement_nom: JSON.parse(item).client_rattachement_nom, @@ -25413,6 +25654,10 @@ const DisplayPartnerPromotion = (props) => { client_rattachement_nom: JSON.parse(item).client_rattachement_nom, client_rattachement_id: JSON.parse(item).client_rattachement_id, + memo: JSON.parse(item).memo, + comment: JSON.parse(item).comment, + + invoiced: JSON.parse(item).invoiced, invoiced_ref: JSON.parse(item).invoiced_ref, invoiced_date: JSON.parse(item).invoiced_date, diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index cd602b5..b5d9709 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -537,7 +537,6 @@ const DisplayPartnerSession = (props) => { // position: 'absolute', top: '7rem', border: '1px solid #F1F1F1', - margin: "2px", boxShadow: "-3px 4px 0px -30px #000000", }, @@ -1295,7 +1294,6 @@ const DisplayPartnerSession = (props) => { { field: 'lms_user_id', headerName: 'lms_user_id', hide: true, }, { field: 'lms_account_expiration_date', headerName: 'lms_account_expiration_date', hide: true, }, { field: 'has_invoice_split', headerName: 'has_invoice_split', hide: true }, - { field: 'civilite', headerName: 'Civ.', minWidth: 90, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false, @@ -15573,7 +15571,6 @@ const DisplayPartnerSession = (props) => { } }} - />
@@ -26137,7 +26134,6 @@ const DisplayPartnerSession = (props) => { lms_user_id: JSON.parse(item).lms_user_id, lms_account_expiration_date: JSON.parse(item).lms_account_expiration_date, - } ))} diff --git a/src/components/Module_Internal_Email_Management.js b/src/components/Module_Internal_Email_Management.js index 1e1bab1..ec98d7f 100644 --- a/src/components/Module_Internal_Email_Management.js +++ b/src/components/Module_Internal_Email_Management.js @@ -1674,7 +1674,8 @@ const Module_Internal_Email_Management = (props) => { setp_one_internal_email_subject("Re: " + String(p_internal_email_subject)); setp_one_internal_email_to(p_internal_email_from); - var reply_message = "


" + String(p_internal_email_message); + var reply_message = "


De : " + `${p_internal_email_from}` + "
Enovyé le : " + `${String(p_internal_email_sent).substring(0, 16)}` + "
À : " + `${p_internal_email_from}` + "
Sujet : " + `${p_internal_email_subject}` + "

"; + reply_message = reply_message + String(p_internal_email_message); setp_one_internal_email_message(reply_message); settab_convention_pieces_jointes_result([]); @@ -2356,8 +2357,6 @@ const Module_Internal_Email_Management = (props) => { -


-
@@ -2540,17 +2539,11 @@ const Module_Internal_Email_Management = (props) => {
-


-
- -
- +
-
-
- +