14/12/2023 - 21h

recette2
cherif 2023-12-14 20:59:06 +01:00
parent 59b5dba3ee
commit 4eb16af0ec
5 changed files with 143 additions and 55 deletions

View File

@ -1788,6 +1788,15 @@ const AddParnerClient = (props) => {
if (document.getElementsByName("contact_email")) {
contact_email = document.getElementsByName("contact_email")[0].value;
}
// Pour activier la fontion de "include com", le contact foit avoir une adresse email
var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
if (!contact_email.match(validRegex)) {
alert("L'adresse email est invalide. Pour créer un contact l'adresse email est obligatoire");
return;
}
form.append("email", contact_email);
var contact_nom = ""
@ -2136,7 +2145,7 @@ const AddParnerClient = (props) => {
return (
<div className="add_partner_client">
{String(props.new_customer) === "1" && <div className="div_row">
{String(props.new_customer) === "1" && <div className="div_row" style={{"paddingRight":"5px"}}>
<div className="div_row">
<Button variant="outlined" onClick={submenu_donnee_client} className="detail_submenu" id='submenu_donnee_client' name='submenu_donnee_client'>Données Client</Button>
</div>
@ -2789,7 +2798,7 @@ const AddParnerClient = (props) => {
<div >
{(JSON.parse(client).nom || JSON.parse(client).prenom) &&
<nav style={{ "width": "100%", "float": "left" }}>
<nav className="grid_title" style={{ "width": "75%", "float": "left" }} contactmail={String(JSON.parse(client).email)} contact_id={String(JSON.parse(client)._id)} onClick={Display_Part_Client_Contact}>
<nav className="grid_title" style={{ "width": "75%", "float": "left", "cursor":"pointer" }} contactmail={String(JSON.parse(client).email)} contact_id={String(JSON.parse(client)._id)} onClick={Display_Part_Client_Contact}>
{String(JSON.parse(client).prenom)} &nbsp; {String(JSON.parse(client).nom)}
</nav>
@ -2862,7 +2871,7 @@ const AddParnerClient = (props) => {
{JSON.parse(client).fonction && <nav> {String(JSON.parse(client).fonction)} </nav>}
{JSON.parse(client).email && <nav> {String(JSON.parse(client).email)} </nav>}
{JSON.parse(client).telephone && <nav> {String(JSON.parse(client).telephone)} </nav>}
{JSON.parse(client).telephone_mobile && <nav> {String(JSON.parse(client).telephone_mobile)} </nav>}
</nav>
</div>
@ -3126,8 +3135,17 @@ const AddParnerClient = (props) => {
//console.log("is_contact_include_com == ", is_contact_include_com);
if (is_contact_include_com === true)
setis_contact_include_com(false)
else
setis_contact_include_com(true)
else{
// Pour activier la fontion de "include com", le contact foit avoir une adresse email
var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
if (!p_contact_email.match(validRegex)) {
alert("L'adresse email est invalide. Pour activer cette fontion, vous devez saisir une adresse email valide");
return;
}
setis_contact_include_com(true);
}
}}
id="toggleSwitchNav" name="toggleSwitchNav">

View File

@ -31,6 +31,7 @@ import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io";
import { Fab } from "@material-ui/core";
import fileDownload from 'js-file-download'
import { AiTwotoneEdit, AiTwotoneSave } from "react-icons/ai";
import Checkbox from '@mui/material/Checkbox';
const Config_Documents = (props) => {
const history = useHistory();
@ -347,6 +348,9 @@ const Config_Documents = (props) => {
const [p_detail_type_doc, setp_detail_type_doc] = useState("");
const [p_detail_duplicate, setp_detail_duplicate] = useState("");
const [p_detail_joint_pdf, setp_detail_joint_pdf] = useState(false);
const [p_one_detail_cible, setp_one_detail_cible] = useState("");
const [p_one_detail_contenu_doc, setp_one_detail_contenu_doc] = useState("");
@ -632,7 +636,7 @@ const Config_Documents = (props) => {
if (mylocal_document.duplicate) {
setp_one_detail_duplicate(mylocal_document.duplicate);
}
else{
else {
setp_one_detail_duplicate("0");
}
setfield_programme("");
@ -1637,6 +1641,13 @@ const Config_Documents = (props) => {
};
const [document_principal_ou_corp_mail, setdocument_principal_ou_corp_mail] = useState();
/*
document_principal_ou_corp_mail = '1' pour le document principal
document_principal_ou_corp_mail = '2' pour le corps du mail qui comporte une pièce jointe
*/
const [Download_one_attached_document_api, setDownload_one_attached_document_api] = useState();
const [Download_one_attached_document_result, setDownload_one_attached_document_result] = useState();
const [Download_one_attached_document_message, setDownload_one_attached_document_message] = useState();
@ -2058,7 +2069,7 @@ const Config_Documents = (props) => {
</div>
<div className="div_row">
<div className="div_row" style={{ "paddingRight": "5px" }}>
<div className="session_data">
<div style={{ "border": "None" }}>
@ -2239,7 +2250,7 @@ const Config_Documents = (props) => {
<div className="div_row_gauche texte_area_filter" >
Type de document<br />
Type de document 2<br />
<TextField
name="document_type"
//label="Type de document"
@ -2280,6 +2291,18 @@ const Config_Documents = (props) => {
</div>
<div className="div_row_gauche texte_area_filter" >
Joindre en PDF aaaa <br />
<Checkbox
name="document_join_pdf"
className="disabled_style"
checked={p_detail_joint_pdf}
/>
</div>
</div>
<div className="div_row_droite_1_tier" style={{ "textAlign": "left" }}>
{String(partner_document_data_edit_mode) === "1" &&
@ -2390,7 +2413,7 @@ const Config_Documents = (props) => {
<nav style={{ "color": "green", "cursor": "pointer" }} onClick={Download_one_attached_document} name={(JSON.parse(val).file_name)} id={(JSON.parse(val).file_name)}> Télécharger &nbsp;<i> {(JSON.parse(val).file_business_object)}</i> </nav>
<Popup
trigger={
<nav style={{ "color": "red", "cursor": "pointer", "marginBottom":"1rem" }} > Supprimer</nav>
<nav style={{ "color": "red", "cursor": "pointer", "marginBottom": "1rem" }} > Supprimer</nav>
}
modal
@ -2455,6 +2478,7 @@ const Config_Documents = (props) => {
</div>
{String(partner_document_data_edit_mode) === "1" && <div className="div_row">
<div style={{ "width": "98%", "marginLeft": "1%", "marginRight": "1%", "float": "left" }}>
<div className="titre_training_text"> Modifier le contenu du document </div>
<Editor
id="document_contente"
@ -2551,50 +2575,50 @@ const Config_Documents = (props) => {
<Popup
trigger={
<Button variant="contained" className="bton_enreg" >Réinitialiser avec le modèle d'origine
</Button>
}
modal
nested
position="center center"
>
trigger={
<Button variant="contained" className="bton_enreg" >Réinitialiser avec le modèle d'origine
</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 color="red"> Toutes vos modifications seront perdues.
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
<font color="red"> Toutes vos modifications seront perdues.
<b> Confirmer la réinitialisation du document.</b> </font>
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
Get_Default_Original_Partner_Document_Data();
close();
}}> Valider </button>
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
Get_Default_Original_Partner_Document_Data();
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 style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
)}
</Popup>
</div>
)}
</Popup>
</div>}
@ -2657,7 +2681,7 @@ const Config_Documents = (props) => {
<div className="div_row_gauche">
<div className="div_row_gauche texte_area_filter" >
Type de document <br />
Type de document 1 <br />
<TextField
name="one_document_type"
//label="Type de document"
@ -2668,6 +2692,7 @@ const Config_Documents = (props) => {
/>
</div>
<div className="div_row_gauche texte_area_filter" >
Nom document <br />
<TextField
@ -2711,7 +2736,24 @@ const Config_Documents = (props) => {
</div>
<div className="div_row_gauche texte_area_filter" >
Joindre en PDF bbb <br />
<Checkbox
name="document_join_pdf"
// className="disabled_style"
checked={p_detail_joint_pdf}
onChange={(e) => {
setp_detail_joint_pdf(e.target.checked);
setpartner_document_data_changed("1");
}}
/>
</div>
</div>
<div className="div_row"> &nbsp; </div>
<div className="div_row_droite texte_area_filter" style={{ "textAlign": "left" }}>
<div className="div_row"> Choisir un champ <br />
<TextField
@ -2750,8 +2792,36 @@ const Config_Documents = (props) => {
</div>
</div>
<div className="div_row">
<div style={{ "width": "98%", "marginLeft": "1%", "marginRight": "1%", "float": "left" }}>
<div className="div_row" style={{ "border": "None", "width": "98%", "marginLeft": "1%", "marginRight": "1%", "float": "left" }}>
<hr className="hr_break" />
</div>
<div className="div_row" >
{p_detail_joint_pdf === true && <div className="div_row" style={{ "border": "None", "width": "98%", "marginLeft": "1%", "marginRight": "1%", "float": "left" }}>
<Button variant="outlined"
onClick={(event) => {
setdocument_principal_ou_corp_mail("1");
}}
className="detail_class_submenu" id='detail_employe' name='detail_employe'>Document principal</Button>
<Button variant="outlined"
onClick={(event) => {
setdocument_principal_ou_corp_mail("2");
}}
className="detail_class_submenu" id='droit_acces' name='droit_acces'>Corps du mail </Button>
</div>}
{p_detail_joint_pdf === true && String(document_principal_ou_corp_mail) === "2" &&
<div style={{ "width": "98%", "marginLeft": "1%", "marginRight": "1%", "float": "left" }}>
Coprs du mail
</div>
}
{String(document_principal_ou_corp_mail) !== "2" && <div style={{ "width": "98%", "marginLeft": "1%", "marginRight": "1%", "float": "left" }}>
<div className="titre_training_text"> Modifier le contenu du document </div>
<Editor
id="document_contente"
@ -2780,7 +2850,8 @@ const Config_Documents = (props) => {
}}
/>
</div>
</div>}
</div>

View File

@ -6355,7 +6355,7 @@ const Employes = (props) => {
<div className="session_data">
<div style={{ "border": "None" }}>
<div style={{ height: 350, width: '100%', paddingRight: '1px' }}>
<div style={{ height: 350, width: '100%', paddingRight: '5px' }}>
&nbsp;
<Box
sx={{

View File

@ -759,7 +759,7 @@ const Partner_Client = (props) => {
</div>
{String(Edite_Client) === "1" && <div className="div_row">
{String(Edite_Client) === "1" && <div className="div_row" style={{"paddingRight":"10px"}}>
<div className="titre1"> Detail client : {Client_email}</div>

View File

@ -736,7 +736,6 @@
border: 1px solid #CCC;
background: none;
box-shadow: 1px 1px 10px 1px rgb(0 0 0 / 15%);
cursor: pointer;
vertical-align: middle;
padding: 10px;
text-align: left;