29/07/2024 - 12h
parent
67f3cbb535
commit
06f99ca5e6
|
@ -97,6 +97,7 @@ const Module_Email_Management = (props) => {
|
|||
};
|
||||
|
||||
const Dialog_1_handleClose_buton = () => {
|
||||
setselected_courrier_template_id("");
|
||||
setDialog_1_open(false);
|
||||
};
|
||||
|
||||
|
@ -151,15 +152,20 @@ const Module_Email_Management = (props) => {
|
|||
const [one_field_corp_mail_initial_value, setone_field_corp_mail_initial_value] = useState("");
|
||||
|
||||
const one_editorRef_programme = useRef(null);
|
||||
|
||||
const [one_editorRef_programme_limite, setone_editorRef_programme_limite] = useState(1000);
|
||||
|
||||
|
||||
|
||||
const [field_programme, setfield_programme] = useState("");
|
||||
const [field_programme_initial_value, setfield_programme_initial_value] = useState("");
|
||||
|
||||
const [one_field_programme, setone_field_programme] = useState("");
|
||||
const [one_field_programme_initial_value, setone_field_programme_initial_value] = useState("");
|
||||
|
||||
const one_editorRef_corp_mail = useRef(null);
|
||||
const [one_editorRef_corp_mail_limite, setone_editorRef_corp_mail_limite] = useState(1000);
|
||||
const [partner_document_data_changed, setpartner_document_data_changed] = useState("");
|
||||
|
||||
const [New_Get_Partner_List_SendEmail_Document_result, setNew_Get_Partner_List_SendEmail_Document_result] = useState([]);
|
||||
|
||||
|
@ -201,6 +207,7 @@ const Module_Email_Management = (props) => {
|
|||
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 local_contenu_doc = JSON.parse(x).contenu_doc;
|
||||
|
||||
|
||||
|
||||
|
@ -215,11 +222,12 @@ const Module_Email_Management = (props) => {
|
|||
"type_doc": local_type_doc,
|
||||
"cible": local_cible,
|
||||
"joint_pdf": local_joint_pdf,
|
||||
"contenu_doc": local_contenu_doc,
|
||||
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
||||
console.log(" ## node = ", node)
|
||||
// console.log(" ## node = ", node)
|
||||
});
|
||||
|
||||
if (new_data2.length > 0)
|
||||
|
@ -260,7 +268,7 @@ const Module_Email_Management = (props) => {
|
|||
|
||||
if (String(res.data.status) === "true") {
|
||||
//console.log(" In Get_Given_Partner_Document_Data_By_id res.data.status = " + res.data.status);
|
||||
console.log(" In Get_Given_Partner_Document_Data_By_id res.data.message r_class = " + res.data.message);
|
||||
// console.log(" In Get_Given_Partner_Document_Data_By_id res.data.message r_class = " + res.data.message);
|
||||
setLoading(false);
|
||||
setGet_Given_Partner_Document_Data_By_id_api("true");
|
||||
setGet_Given_Partner_Document_Data_By_id_result(res.data.message);
|
||||
|
@ -324,16 +332,21 @@ const Module_Email_Management = (props) => {
|
|||
|
||||
|
||||
setfield_programme("");
|
||||
// set_field_corp_mail("");
|
||||
if (mylocal_document.contenu_doc) {
|
||||
setone_field_programme(String(mylocal_document.contenu_doc));
|
||||
setone_field_programme_initial_value(String(mylocal_document.contenu_doc));
|
||||
set_field_corp_mail(String(mylocal_document.contenu_doc));
|
||||
one_editorRef_programme.current.insertContent(String(mylocal_document.contenu_doc));
|
||||
|
||||
|
||||
}
|
||||
|
||||
set_field_corp_mail("");
|
||||
/* set_field_corp_mail("");
|
||||
if (mylocal_document.corps_mail) {
|
||||
setone_field_corp_mail(String(mylocal_document.corps_mail));
|
||||
setone_field_corp_mail_initial_value(String(mylocal_document.corps_mail));
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
if (document.getElementById('myRef')) {
|
||||
|
@ -375,10 +388,33 @@ const Module_Email_Management = (props) => {
|
|||
useEffect(() => {
|
||||
|
||||
Get_Partner_List_SendEmail_Document("SENDEMAIL_MODELE");
|
||||
if( props.email_destinataire){
|
||||
setemail_destinataire(props.email_destinataire)
|
||||
}
|
||||
|
||||
if( props.email_cc){
|
||||
setemail_cc(props.email_cc)
|
||||
}
|
||||
|
||||
if( props.email_bcc){
|
||||
setemail_bcc(props.email_bcc)
|
||||
}
|
||||
|
||||
}, [])
|
||||
|
||||
|
||||
const [selected_courrier_template_id, setselected_courrier_template_id] = useState("");
|
||||
|
||||
const editorRef_programme = useRef(null);
|
||||
const [editorRef_programme_limite, seteditorRef_programme] = useState(1000);
|
||||
|
||||
|
||||
const [email_destinataire, setemail_destinataire] = useState("");
|
||||
const [email_cc, setemail_cc] = useState("");
|
||||
const [email_bcc, setemail_bcc] = useState("");
|
||||
|
||||
const [email_sujet, setemail_sujet] = useState("");
|
||||
|
||||
|
||||
return (
|
||||
|
||||
|
@ -387,12 +423,57 @@ const Module_Email_Management = (props) => {
|
|||
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
||||
</div>}
|
||||
|
||||
<h3> Module gestion email </h3>
|
||||
|
||||
<form onSubmit={"sendEmail"}>
|
||||
<Dialog
|
||||
|
||||
onClose={Dialog_1_handleClose}
|
||||
className="module_email_management"
|
||||
PaperProps={{
|
||||
sx: {
|
||||
width: "400px",
|
||||
maxWidth: "400px!important",
|
||||
},
|
||||
}}
|
||||
open={Dialog_1_open}
|
||||
>
|
||||
|
||||
<DialogTitle></DialogTitle>
|
||||
<DialogContent style={{ "width": "400px" }}>
|
||||
<DialogContentText>
|
||||
{Dialog_1_message}
|
||||
</DialogContentText>
|
||||
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
<Button onClick={(e) => {
|
||||
|
||||
if (selected_courrier_template_id && String(selected_courrier_template_id) !== "") {
|
||||
setfield_programme("");
|
||||
Get_Given_Partner_Document_Data_By_id(selected_courrier_template_id);
|
||||
} else {
|
||||
setfield_programme("");
|
||||
set_field_corp_mail("");
|
||||
}
|
||||
Dialog_1_handleClose_buton();
|
||||
|
||||
}} className="bton_enreg_dialog">Confirmer</Button>
|
||||
</div>
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Dialog_1_handleClose_buton} className="bton_annule_dialog" >Annuler</Button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</DialogActions>
|
||||
|
||||
</Dialog>
|
||||
|
||||
|
||||
<div>
|
||||
|
||||
<div className="session_caract_Dialog" > Choisir un modèle de courrier
|
||||
<div className="titre1"> Gestion Email </div>
|
||||
<div className="session_caract_Dialog" style={{ "marginBottom": '0px' }} > Choisir un modèle de courrier
|
||||
{New_Get_Partner_List_SendEmail_Document_result && <Autocomplete
|
||||
disablePortal
|
||||
id="competence_nom"
|
||||
|
@ -405,12 +486,17 @@ const Module_Email_Management = (props) => {
|
|||
onChange={(event, value) => {
|
||||
|
||||
if (value && value._id) {
|
||||
|
||||
Get_Given_Partner_Document_Data_By_id(value._id);
|
||||
// setselected_statistic_question_id(value.question_id);
|
||||
setselected_courrier_template_id(value._id);
|
||||
var msg = "Vous allez modifier le coprs de l'email ! ";
|
||||
setDialog_1_message(msg);
|
||||
setDialog_1_open(true);
|
||||
} else {
|
||||
// setselected_statistic_question_id("");
|
||||
setselected_courrier_template_id("");
|
||||
var msg = "Vous allez modifier le coprs de l'email ! ";
|
||||
setDialog_1_message(msg);
|
||||
setDialog_1_open(true);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
|
||||
|
@ -421,62 +507,156 @@ const Module_Email_Management = (props) => {
|
|||
/>}
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog">
|
||||
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', height: '2.5rem', paddingTop: '10px' }}>
|
||||
<div className="session_caract_Dialog" style={{ "marginBottom": '1px' }}>
|
||||
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', height: '2.5rem', paddingTop: '20px' }}>
|
||||
Email
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
|
||||
<input type="email" name="user_email" style={{ "textAlign": 'left', width: "100%", height: '2.5rem' }} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog">
|
||||
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left' }}>
|
||||
Corps Email
|
||||
</div>
|
||||
</div>
|
||||
<TextField
|
||||
margin="dense"
|
||||
id="email_dest"
|
||||
|
||||
type="text"
|
||||
fullWidth
|
||||
value={email_destinataire}
|
||||
onChange={(e) => {
|
||||
setemail_destinataire(e.target.value);
|
||||
|
||||
<div className="session_caract_Dialog" style={{ "textAlign": 'left', "width": '100%', "border": "1px solid" }}>
|
||||
<div style={{ "textAlign": 'left', "width": '100%' }}>
|
||||
<Editor
|
||||
onInit={(evt, editor) => editorRef_suivi_eval.current = editor}
|
||||
initialValue={field_programme}
|
||||
onKeyUp={editor_keyup}
|
||||
onEditorChange={(newValue, editor) => {
|
||||
if (String(editor_tochange) === "1") {
|
||||
//alert(" change");
|
||||
DataUpdated();
|
||||
seteditor_tochange("");
|
||||
}
|
||||
}
|
||||
/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div className="session_caract_Dialog" style={{ "marginBottom": '0px' }}>
|
||||
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', height: '2.5rem', paddingTop: '20px' }}>
|
||||
CC
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
|
||||
<TextField
|
||||
margin="dense"
|
||||
id="email_dest"
|
||||
|
||||
type="text"
|
||||
fullWidth
|
||||
value={email_cc}
|
||||
onChange={(e) => {
|
||||
setemail_cc(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" style={{ "marginBottom": '1px' }}>
|
||||
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', height: '2.5rem', paddingTop: '20px' }}>
|
||||
BCC
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
|
||||
<TextField
|
||||
margin="dense"
|
||||
id="email_dest"
|
||||
|
||||
type="text"
|
||||
fullWidth
|
||||
value={email_bcc}
|
||||
onChange={(e) => {
|
||||
setemail_bcc(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="session_caract_Dialog" style={{ "marginBottom": '1px' }}>
|
||||
<div className="div_row_gauche_dialog_session" style={{ "textAlign": 'left', height: '2.5rem', paddingTop: '20px' }}>
|
||||
Sujet
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite_dialog_session" style={{ "textAlign": 'right' }}>
|
||||
<TextField
|
||||
margin="dense"
|
||||
id="email_dest"
|
||||
|
||||
type="text"
|
||||
fullWidth
|
||||
value={email_sujet}
|
||||
onChange={(e) => {
|
||||
setemail_sujet(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" style={{ "marginBottom": '0px' }}>
|
||||
<div style={{ "textAlign": 'left', "width": '100%' }}>
|
||||
|
||||
<Editor
|
||||
id="detail_document_principal"
|
||||
name="detail_document_principal"
|
||||
onInit={(evt, editor) => one_editorRef_programme.current = editor}
|
||||
//initialValue={field_programme_initial_value}
|
||||
|
||||
onKeyUp={editor_keyup}
|
||||
value={field_programme}
|
||||
onEditorChange={(newValue, editor) => {
|
||||
setfield_programme(one_editorRef_programme.current.getContent());
|
||||
setpartner_document_data_changed("1");
|
||||
|
||||
}}
|
||||
init={{
|
||||
resize: false,
|
||||
height: 300,
|
||||
|
||||
menubar: false,
|
||||
|
||||
height: 500,
|
||||
menubar: true,
|
||||
plugins: [
|
||||
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'preview',
|
||||
'anchor', 'searchreplace', 'visualblocks', 'code', 'fullscreen',
|
||||
'insertdatetime', 'media', 'table', 'code', 'help', 'wordcount'
|
||||
],
|
||||
toolbar: 'undo redo | blocks | ' +
|
||||
'bold italic forecolor | alignleft aligncenter ' +
|
||||
'alignright alignjustify | bullist numlist outdent indent | ' +
|
||||
'removeformat | help',
|
||||
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px }'
|
||||
}}
|
||||
'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
|
||||
'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
|
||||
'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
|
||||
|
||||
],
|
||||
toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
|
||||
'alignleft aligncenter alignright alignjustify | ' +
|
||||
'bullist numlist checklist outdent indent | removeformat | a11ycheck code table help',
|
||||
|
||||
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:14px; }'
|
||||
}}
|
||||
/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<input type="submit" value="Send" />
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
<Button onClick={(e) => {
|
||||
|
||||
|
||||
}} className="bton_enreg_dialog">Envoyer</Button>
|
||||
</div>
|
||||
</form>
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={(e) => {
|
||||
|
||||
|
||||
setselected_courrier_template_id("");
|
||||
setemail_destinataire("");
|
||||
setemail_cc("");
|
||||
setemail_bcc("");
|
||||
props.fathuer_close_function();
|
||||
|
||||
}} className="bton_annule_dialog" >Annuler</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5043,7 +5043,6 @@ const Partner_Commande = (props) => {
|
|||
|
||||
<div className="session_caract_Dialog" > Description <br />
|
||||
<TextField
|
||||
|
||||
margin="dense"
|
||||
id="order_description"
|
||||
|
||||
|
|
|
@ -655,27 +655,32 @@ const TestUrl_New = (props) => {
|
|||
|
||||
{ /********* Dialog email */}
|
||||
<Dialog
|
||||
open={Dialog_1_open}
|
||||
|
||||
onClose={Dialog_1_handleClose}
|
||||
|
||||
className="module_agenda"
|
||||
|
||||
className="module_email_management"
|
||||
PaperProps={{
|
||||
sx: {
|
||||
width: "100%",
|
||||
maxWidth: "920px!important",
|
||||
},
|
||||
}}
|
||||
open={Dialog_1_open}
|
||||
>
|
||||
|
||||
<DialogTitle>MySy Information</DialogTitle>
|
||||
<DialogContent className="DialogContent_width" style={{ "minHeight": "50rem", "width":'30rem ! important', "borderRadius":"10px"}}>
|
||||
|
||||
<DialogContent >
|
||||
<DialogContentText>
|
||||
{Dialog_1_message}
|
||||
</DialogContentText>
|
||||
|
||||
|
||||
<Module_Email_Management />
|
||||
<Module_Email_Management fathuer_close_function={Dialog_1_handleClose} email_destinataire={"cb@mysy.com"}/>
|
||||
|
||||
</DialogContent>
|
||||
|
||||
|
||||
|
||||
<DialogActions>
|
||||
{/* <DialogActions>
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
<Button onClick={"Update_One_Agenda_Event"} className="bton_enreg_dialog">Mettre à jour</Button>
|
||||
|
@ -686,7 +691,7 @@ const TestUrl_New = (props) => {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
</DialogActions>
|
||||
</DialogActions>*/}
|
||||
|
||||
</Dialog>
|
||||
{ /********* Dialog email */}
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
.module_email_management {
|
||||
|
||||
|
||||
.test01 {
|
||||
font-size: 3rem;
|
||||
// color: red;
|
||||
|
@ -2500,7 +2501,8 @@
|
|||
|
||||
|
||||
.DialogContent_width {
|
||||
width: 600px !important;
|
||||
width: 1500px !important;
|
||||
max-width: 1500px !important;
|
||||
}
|
||||
|
||||
.DialogContent_width_session {
|
||||
|
@ -2509,14 +2511,15 @@
|
|||
|
||||
|
||||
.div_row_gauche_dialog_session {
|
||||
width: 30%;
|
||||
width: 20%;
|
||||
float: left;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.div_row_droite_dialog_session {
|
||||
width: 69%;
|
||||
width: 79%;
|
||||
float: right;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
// end media
|
||||
|
@ -2532,11 +2535,11 @@
|
|||
|
||||
.session_caract_Dialog {
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
padding: 2px;
|
||||
float: left;
|
||||
text-align: left;
|
||||
font-size: small;
|
||||
margin-bottom: 1rem !important;
|
||||
margin-bottom: 0px !important;
|
||||
}
|
||||
|
||||
.session_caract_Dialog_comment_2_lines {
|
||||
|
@ -2656,3 +2659,7 @@
|
|||
padding-left: 5px !important;
|
||||
padding-right: 1rem !important;
|
||||
}
|
||||
|
||||
.tox-promotion {
|
||||
display: none !important;
|
||||
}
|
Loading…
Reference in New Issue