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 (