diff --git a/src/components/AddPartnerClient.js b/src/components/AddPartnerClient.js index ca7fef6..d6c170e 100644 --- a/src/components/AddPartnerClient.js +++ b/src/components/AddPartnerClient.js @@ -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 (
- {String(props.new_customer) === "1" &&
+ {String(props.new_customer) === "1" &&
@@ -2789,7 +2798,7 @@ const AddParnerClient = (props) => {
{(JSON.parse(client).nom || JSON.parse(client).prenom) &&
@@ -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"> diff --git a/src/components/Config_Document.js b/src/components/Config_Document.js index 2941d2c..7f79986 100644 --- a/src/components/Config_Document.js +++ b/src/components/Config_Document.js @@ -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) => {
-
+
@@ -2239,7 +2250,7 @@ const Config_Documents = (props) => {
- Type de document
+ Type de document 2
{
+
+ Joindre en PDF aaaa
+ + + +
+ +
{String(partner_document_data_edit_mode) === "1" && @@ -2390,7 +2413,7 @@ const Config_Documents = (props) => { Supprimer + } modal @@ -2455,6 +2478,7 @@ const Config_Documents = (props) => {
{String(partner_document_data_edit_mode) === "1" &&
+
Modifier le contenu du document
{ Réinitialiser avec le modèle d'origine - - } - modal - nested - position="center center" - > + trigger={ + + } + modal + nested + position="center center" + > - {close => ( -
- -
MySy Information
-
- {' '} - Toutes vos modifications seront perdues. + {close => ( +
+ +
MySy Information
+
+ {' '} + Toutes vos modifications seront perdues. Confirmer la réinitialisation du document. -
-
-
- +
+
+
+ -
-
- -
+
+
+
- )} - - +
+ )} + +
} @@ -2657,7 +2681,7 @@ const Config_Documents = (props) => {
- Type de document
+ Type de document 1
{ />
+
Nom document
{
+
+ Joindre en PDF bbb
+ + { + setp_detail_joint_pdf(e.target.checked); + setpartner_document_data_changed("1"); + }} + + /> + +
+
+
 
Choisir un champ
{
-
-
+
+
+
+ +
+ + + {p_detail_joint_pdf === true &&
+ + +
} + + + {p_detail_joint_pdf === true && String(document_principal_ou_corp_mail) === "2" && +
+ Coprs du mail +
+ } + + + + {String(document_principal_ou_corp_mail) !== "2" &&
Modifier le contenu du document
{ }} /> -
+
} +
diff --git a/src/components/Employes.js b/src/components/Employes.js index 99b3c25..3286f48 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -6355,7 +6355,7 @@ const Employes = (props) => {
-
+
  {
- {String(Edite_Client) === "1" &&
+ {String(Edite_Client) === "1" &&
Detail client : {Client_email}
diff --git a/src/styles/components/_addpartnerclient.scss b/src/styles/components/_addpartnerclient.scss index aed6f1b..98731cc 100644 --- a/src/styles/components/_addpartnerclient.scss +++ b/src/styles/components/_addpartnerclient.scss @@ -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;