07/10/2024 - 20h30

recette2
cherif 2024-10-07 20:17:16 +02:00
parent 8a4ec815b8
commit 77368feb32
4 changed files with 425 additions and 30 deletions

View File

@ -48,6 +48,13 @@ const Fotter_Catalog_Pub = (props) => {
downloadLink.click();
}
function Display_Mention_Legale_File() {
const downloadLink = document.createElement("a");
const fileName = "file.pdf";
downloadLink.href = props.partner_data.catalog_pub_mention_legale_pdf;
downloadLink.download = fileName;
downloadLink.click();
}
return (
@ -61,6 +68,8 @@ const Fotter_Catalog_Pub = (props) => {
<hr />
<i className='copyright'>
Copyright © 2024 {props.partner_data.nom} . Tous droits réservés. &nbsp;
<a> <nav onClick={Display_Mention_Legale_File} >| Mentions légales </nav> </a>
<a> <nav onClick={Display_CGU_File} >| Conditions générales dutilisation </nav> </a>
<a><nav onClick={Display_CGV_File} > | Conditions générales de vente </nav> </a>
</i>

View File

@ -2649,7 +2649,11 @@ const Mon_Catalogue_Public = (props) => {
if (JSON.parse(x).catalog_pub_cgu_pdf)
catalog_pub_cgu_pdf = JSON.parse(x).catalog_pub_cgu_pdf;
var catalog_pub_mention_legale_pdf = ""
if (JSON.parse(x).catalog_pub_mention_legale_pdf)
catalog_pub_mention_legale_pdf = JSON.parse(x).catalog_pub_mention_legale_pdf;
var catalog_pub_message_1_taille = "12"
if (JSON.parse(x).catalog_pub_message_1_taille)
@ -2783,6 +2787,7 @@ const Mon_Catalogue_Public = (props) => {
"catalog_pub_cgv_pdf": catalog_pub_cgv_pdf,
"catalog_pub_cgu_pdf": catalog_pub_cgu_pdf,
"catalog_pub_mention_legale_pdf": catalog_pub_mention_legale_pdf,
"catalog_pub_logo": catalog_pub_logo,
"catalog_pub_banniere_img": catalog_pub_banniere_img,

View File

@ -1948,6 +1948,11 @@ function UpdateParnterInfo(props) {
local_cgv = JSON.parse(res.data.message).cgv_pdf;
setp_detail_cgv_file_pdf(local_cgv);
var local_mentions_legales = "";
if (JSON.parse(res.data.message).mention_legale_pdf)
local_mentions_legales = JSON.parse(res.data.message).mention_legale_pdf;
setp_detail_mention_legale_file_pdf(local_mentions_legales);
var theme_id_preview = "data:image/png;base64," + JSON.parse(res.data.message).theme_preview;
setselected_catalog_pub_theme_preview(theme_id_preview);
@ -2694,6 +2699,9 @@ function UpdateParnterInfo(props) {
const [p_detail_cgv_file_pdf, setp_detail_cgv_file_pdf] = React.useState("");
const [p_detail_cgu_file_pdf, setp_detail_cgu_file_pdf] = React.useState("");
const [p_detail_mention_legale_file_pdf, setp_detail_mention_legale_file_pdf] = React.useState("");
const [p_text2_taille, setp_text2_taille] = React.useState("12");
const [p_text2_gras, setp_text2_gras] = React.useState(false);
@ -2835,6 +2843,10 @@ function UpdateParnterInfo(props) {
})
}
function Cancel_Add_Update_Catalog_Pub_CGV() {
setpdf_cgv_file_pdf("");
}
const [Supprimer_Catalog_Pub_CGV_api, setSupprimer_Catalog_Pub_CGV_api] = useState();
const [Supprimer_Catalog_Pub_CGV_message, setSupprimer_Catalog_Pub_CGV_message] = useState();
const [Supprimer_Catalog_Pub_CGV_result, setSupprimer_Catalog_Pub_CGV_result] = useState();
@ -2980,6 +2992,11 @@ function UpdateParnterInfo(props) {
})
}
function Cancel_Add_Update_Catalog_Pub_CGU() {
setpdf_cgu_file_pdf("");
}
const [Supprimer_Catalog_Pub_CGU_api, setSupprimer_Catalog_Pub_CGU_api] = useState();
const [Supprimer_Catalog_Pub_CGU_message, setSupprimer_Catalog_Pub_CGU_message] = useState();
const [Supprimer_Catalog_Pub_CGU_result, setSupprimer_Catalog_Pub_CGU_result] = useState();
@ -3037,6 +3054,154 @@ function UpdateParnterInfo(props) {
downloadLink.click();
}
// ==> Mentions Legales
const changeHandler2_mention_legale = (event) => {
hiddenFileInput_mention_legale.current.click();
};
const [mention_legale_file_name, setmention_legale_file_name] = useState();
const hiddenFileInput_mention_legale = React.useRef(null);
const [handleSubmission_mention_legale_api, sethandleSubmission_mention_legale_api] = useState();
const [handleSubmission_mention_legale_result, sethandleSubmission_mention_legale_result] = useState();
const [handleSubmission_mention_legale_message, sethandleSubmission_mention_legale_message] = useState();
function Cancel_Add_Update_Catalog_Pub_Mention_Legale() {
setpdf_mention_legale_file_pdf("");
}
const handleSubmission_mention_legale = event => {
const fileUploaded = event.target.files[0];
let file_size = event.target.files[0].size;
let file_type = event.target.files[0].type;
sethandleSubmission_mention_legale_message("");
sethandleSubmission_mention_legale_api("");
// console.log("file_size = ", file_size, " file_type = ", file_type, " naturalWidth = ", fileUploaded.naturalWidth);
if (file_size > 1000000) {
alert("Le fichier ne doit pas dépasser un 1 Méga octets");
return;
}
setmention_legale_file_name(event.target.files[0].name);
reader(event.target.files[0], (err, res) => {
// console.log("#### res === ", res); // Base64 `data:image/...` String result.
setpdf_mention_legale_file_pdf(res);
});
};
const [pdf_mention_legale_file_pdf, setpdf_mention_legale_file_pdf] = useState();
const [Add_Update_Catalog_Pub_Mention_Legale_api, setAdd_Update_Catalog_Pub_Mention_Legale_api] = useState();
const [Add_Update_Catalog_Pub_Mention_Legale_message, setAdd_Update_Catalog_Pub_Mention_Legale_message] = useState();
const [Add_Update_Catalog_Pub_Mention_Legale_result, setAdd_Update_Catalog_Pub_Mention_Legale_result] = useState();
function Add_Update_Catalog_Pub_Mention_Legale() {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("_id", selected_catalog_pub_config_id);
form.append("mention_legale_pdf", pdf_mention_legale_file_pdf);
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Catalog_Pub_Config/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
//console.log(" In Add_Update_Catalog_Pub_CGU res.data.status = " + res.data.status);
//console.log(" In Add_Update_Catalog_Pub_CGU res.data.message r_class = " + res.data.message);
if (String(res.data.status) === String("true")) {
setAdd_Update_Catalog_Pub_Mention_Legale_api("true");
setAdd_Update_Catalog_Pub_Mention_Legale_result(res.data.message);
setcgv_file_name("");
setpdf_mention_legale_file_pdf("");
Get_Partner_Catalog_Pub_Config();
alert(res.data.message);
}
else {
setAdd_Update_Catalog_Pub_Mention_Legale_api("false");
setAdd_Update_Catalog_Pub_Mention_Legale_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('UpdateStagiaireData : Not good man :( Add_Update_Catalog_Pub_CGU = ' + error);
setAdd_Update_Catalog_Pub_Mention_Legale_api("false");
alert(" Impossible de supprimer le fichier CGV ");
})
}
const [Supprimer_Catalog_Pub_Mention_Legale_api, setSupprimer_Catalog_Pub_Mention_Legale_api] = useState();
const [Supprimer_Catalog_Pub_Mention_Legale_message, setSupprimer_Catalog_Pub_Mention_Legale_message] = useState();
const [Supprimer_Catalog_Pub_Mention_Legale_result, setSupprimer_Catalog_Pub_Mention_Legale_result] = useState();
function Supprimer_Catalog_Pub_Mention_Legale() {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("_id", selected_catalog_pub_config_id);
form.append("mention_legale_pdf", "");
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_Catalog_Pub_Config/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
//console.log(" In Supprimer_Catalog_Pub_CGU res.data.status = " + res.data.status);
//console.log(" In Supprimer_Catalog_Pub_CGU res.data.message r_class = " + res.data.message);
if (String(res.data.status) === String("true")) {
setSupprimer_Catalog_Pub_Mention_Legale_api("true");
setSupprimer_Catalog_Pub_Mention_Legale_result(res.data.message);
setcgv_file_name("");
setpdf_mention_legale_file_pdf("");
Get_Partner_Catalog_Pub_Config();
alert(res.data.message);
}
else {
setSupprimer_Catalog_Pub_Mention_Legale_api("false");
setSupprimer_Catalog_Pub_Mention_Legale_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('UpdateStagiaireData : Not good man :( Supprimer_Catalog_Pub_CGU = ' + error);
setSupprimer_Catalog_Pub_Mention_Legale_api("false");
alert(" Impossible de supprimer le fichier CGU ");
})
}
function Display_Mention_Legale_File() {
const downloadLink = document.createElement("a");
const fileName = "file.pdf";
downloadLink.href = p_detail_mention_legale_file_pdf;
downloadLink.download = fileName;
downloadLink.click();
}
return (
<div className='updateparnterinfo'>
@ -4726,16 +4891,16 @@ function UpdateParnterInfo(props) {
<div className="detail_class_submenu_data" style={{ "border": "None", "width": "100%", "float": "left" }}>
<div className="div_row" style={{ "width": "48%", "float": "left" }}>
<div className="div_row block_cgv_pj">
{p_detail_cgv_file_pdf && <div style={{ "marginBottom": "0.5rem" }}>
<nav style={{ "width": "100%" }}> CGV actuelle(pdf) <AttachFileIcon /> </nav>
<div style={{ "width": "100%" }}>
<nav style={{ "width": "40%", "float": "left", "textAlign": "left", cursor: "pointer", "color": "green", fontSize: "12px" }} onClick={Display_CGV_File} >Télécharger <DownloadingIcon /> </nav> &nbsp;
<nav className="block_cgv_pj_telecharger" onClick={Display_CGV_File} >Télécharger <DownloadingIcon /> </nav> &nbsp;
<Popup
trigger={
<nav style={{ "width": "40%", "float": "left", "textAlign": "left", cursor: "pointer", color: "orangered", fontSize: "12px" }} > Supprimer <CiTrash /> </nav>
<nav className="block_cgv_pj_supprimer" > Supprimer <CiTrash /> </nav>
}
modal
@ -4818,12 +4983,12 @@ function UpdateParnterInfo(props) {
</div>
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="btn_modif" onClick={"Annule_logo_img"}>Annuler
<div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px', maxWidth: '40%' }}>
<Button variant="contained" className="btn_modif" onClick={Cancel_Add_Update_Catalog_Pub_CGV}>Annuler
</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px', maxWidth: '40%' }}>
<Button variant="contained" className="btn_enreg" onClick={Add_Update_Catalog_Pub_CGV}>Enregistrer
</Button>
@ -4837,16 +5002,16 @@ function UpdateParnterInfo(props) {
</div>}
</div>
<div className="div_row" style={{ "width": "48%", "float": "left" }}>
<div className="div_row block_cgv_pj" >
{p_detail_cgu_file_pdf && <div style={{ "marginBottom": "0.5rem" }}>
<nav style={{ "width": "100%" }}> CGU actuelle(pdf) <AttachFileIcon /> </nav>
<div style={{ "width": "100%" }}>
<nav style={{ "width": "40%", "float": "left", "textAlign": "left", cursor: "pointer", "color": "green", fontSize: "12px" }} onClick={Display_CGU_File} >Télécharger <DownloadingIcon /> </nav> &nbsp;
<nav className="block_cgv_pj_telecharger" onClick={Display_CGU_File} >Télécharger <DownloadingIcon /> </nav> &nbsp;
<Popup
trigger={
<nav style={{ "width": "40%", "float": "left", "textAlign": "left", cursor: "pointer", color: "orangered", fontSize: "12px" }} > Supprimer <CiTrash /> </nav>
<nav className="block_cgv_pj_supprimer" > Supprimer <CiTrash /> </nav>
}
modal
@ -4923,19 +5088,130 @@ function UpdateParnterInfo(props) {
<br />
{pdf_cgu_file_pdf && <div className="div_row">
{pdf_cgu_file_pdf && <div className="div_row ">
<div className="div_row" style={{ "border": "None" }}>
&nbsp;
</div>
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="btn_modif" onClick={"Annule_logo_img"}>Annuler
<div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px', maxWidth: '40%' }}>
<Button variant="contained" className="btn_modif" style={{ maxWidth: '80%' }} onClick={Cancel_Add_Update_Catalog_Pub_CGU}>Annuler
</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<Button variant="contained" className="btn_enreg" onClick={Add_Update_Catalog_Pub_CGU}>Enregistrer
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px', maxWidth: '40%' }}>
<Button variant="contained" className="btn_enreg" style={{ maxWidth: '80%' }} onClick={Add_Update_Catalog_Pub_CGU}>Enregistrer
</Button>
</div>
</div>}
<div className="div_row" style={{ "border": "None" }}>
&nbsp;
</div>
</div>}
</div>
<div className="div_row block_cgv_pj" >
{p_detail_mention_legale_file_pdf && <div style={{ "marginBottom": "0.5rem" }}>
<nav style={{ "width": "100%" }}> Mentions légales actuelle(pdf) <AttachFileIcon /> </nav>
<div style={{ "width": "100%" }}>
<nav className="block_cgv_pj_telecharger" onClick={Display_Mention_Legale_File} >Télécharger <DownloadingIcon /> </nav> &nbsp;
<Popup
trigger={
<nav className="block_cgv_pj_supprimer" > Supprimer <CiTrash /> </nav>
}
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">
{' '}
En confirmant cette opération, le fichier sera <i><font color="red"> définitivement supprimé</font></i>. <br />
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
Supprimer_Catalog_Pub_Mention_Legale();
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>
)}
</Popup>
</div>
</div>}
<Button variant="outlined" onClick={changeHandler2_mention_legale} className="detail_class_submenu" style={{
"background": "#c8cfd5",
"minWidth": "15rem", "color": "black", "width": "auto"
}}
id='menu_import_formation' name='menu_import_formation'>Imp. Ment. Légales(pdf) <br />
</Button><br />
<nav className="koUpdateData" style={{ "color": "orange" }}>
<Tooltip className="tooltip_css" id="tooltip_2" />
</nav>
{cgu_file_name && <nav className="okUpdateData"><i><AttachFileIcon /> {mention_legale_file_name}</i></nav>}
<input type="file"
accept=".pdf"
ref={hiddenFileInput_mention_legale}
style={{ display: 'none' }}
name="liste_formation_file"
onChange={handleSubmission_mention_legale}
/>
{String(Add_Update_Catalog_Pub_Mention_Legale_api) === "true" && <div className="okUpdateData"> La mise à jour a été correctement faite</div>}
{String(Add_Update_Catalog_Pub_Mention_Legale_api) === "false" && <div className="koUpdateData"> {Add_Update_Catalog_Pub_Mention_Legale_message}</div>}
<br />
{pdf_mention_legale_file_pdf && <div className="div_row">
<div className="div_row" style={{ "border": "None" }}>
&nbsp;
</div>
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
<div className="div_row_gauche " style={{ "textAlign": 'left', 'marginLeft': '15px', maxWidth: '40%' }}>
<Button variant="contained" className="btn_modif" style={{ maxWidth: '80%' }} onClick={Cancel_Add_Update_Catalog_Pub_Mention_Legale}>Annuler
</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px', maxWidth: '40%' }}>
<Button variant="contained" className="btn_enreg" style={{ maxWidth: '80%' }} onClick={Add_Update_Catalog_Pub_Mention_Legale}>Enregistrer
</Button>
</div>

View File

@ -6,30 +6,30 @@
font-size: small !important;
}
.css-1q6at85-MuiInputBase-root-MuiOutlinedInput-root{
.css-1q6at85-MuiInputBase-root-MuiOutlinedInput-root {
padding-right: 0.2rem !important;
height: 3rem !important;
margin-bottom: 1rem;
}
.css-1o9s3wi-MuiInputBase-input-MuiOutlinedInput-input{
.css-1o9s3wi-MuiInputBase-input-MuiOutlinedInput-input {
height: 2.5rem !important;
font-size: small;
}
.css-1ixds2g{
.css-1ixds2g {
height: 2.5rem !important;
font-size: small !important;
}
.css-1v4ccyo{
.css-1v4ccyo {
font-size: small !important;
}
.text_pwd_crit{
.text_pwd_crit {
font-size: small;
}
.texte_area {
float: left;
width: 100% !important;
@ -68,7 +68,7 @@
text-align: center;
margin-bottom: 0.8rem;
color: white;
cursor:unset;
cursor: unset;
font-style: italic;
background-color: gray;
font-weight: normal;
@ -264,12 +264,39 @@
overflow-y: scroll;
padding-right: 1rem !important;
}
.block_cgv_pj {
width: 100%;
float: left;
text-align: center;
}
.block_cgv_pj_telecharger {
width: 50%;
float: left;
text-align: center;
cursor: pointer;
color: green;
font-size: 12px;
}
.block_cgv_pj_supprimer {
width: 50%;
float: left;
text-align: center;
cursor: pointer;
color: orangered;
font-size: 12px;
}
}
@media only screen and (min-width: 601px) and (max-width: 991px) {
text-align: left;
.text_pwd_crit{
.text_pwd_crit {
font-size: small;
}
@ -308,7 +335,7 @@
text-align: center;
margin-bottom: 0.8rem;
color: white;
cursor:unset;
cursor: unset;
font-style: italic;
background-color: gray;
font-weight: normal;
@ -500,12 +527,38 @@
overflow-y: scroll;
padding-right: 1rem !important;
}
}
.block_cgv_pj {
width: 100%;
float: left;
text-align: center;
}
.block_cgv_pj_telecharger {
width: 45%;
float: left;
text-align: center;
cursor: pointer;
color: green;
font-size: 12px;
}
.block_cgv_pj_supprimer {
width: 45%;
float: left;
text-align: center;
cursor: pointer;
color: orangered;
font-size: 12px;
}
}
@media only screen and (min-width: 992px) and (max-width: 1199px) {
text-align: left;
.text_pwd_crit{
.text_pwd_crit {
font-size: small;
}
@ -543,7 +596,7 @@
text-align: center;
margin-bottom: 0.8rem;
color: white;
cursor:unset;
cursor: unset;
font-style: italic;
background-color: gray;
font-weight: normal;
@ -735,6 +788,31 @@
overflow-y: scroll;
padding-right: 1rem !important;
}
.block_cgv_pj {
width: 33%;
float: left;
}
.block_cgv_pj_telecharger {
width: 45%;
float: left;
text-align: center;
cursor: pointer;
color: green;
font-size: 12px;
}
.block_cgv_pj_supprimer {
width: 45%;
float: left;
text-align: center;
cursor: pointer;
color: orangered;
font-size: 12px;
}
}
@media only screen and (min-width: 1200px) {
@ -778,7 +856,7 @@
font-size: medium;
text-align: center;
color: white;
cursor:unset;
cursor: unset;
font-style: italic;
background-color: gray;
font-weight: normal;
@ -988,8 +1066,35 @@
padding-right: 1rem !important;
}
.block_cgv_pj {
width: 33%;
float: left;
}
.block_cgv_pj_telecharger {
width: 45%;
float: left;
text-align: center;
cursor: pointer;
color: green;
font-size: 12px;
}
.block_cgv_pj_supprimer {
width: 45%;
float: left;
text-align: center;
cursor: pointer;
color: orangered;
font-size: 12px;
}
}
// end media
.css-mnn31 {
font-size: small !important;
}
@ -998,12 +1103,12 @@
padding-left: 5px !important;
}
.css-1ixds2g{
.css-1ixds2g {
font-size: small !important;
height: 2rem !important;
}
.css-1v4ccyo{
.css-1v4ccyo {
font-size: small !important;
}