06/12/2023 - 21h
parent
596185e0af
commit
be9f5dc1d5
|
@ -301,7 +301,7 @@ const Config_Documents = (props) => {
|
|||
|
||||
|
||||
// Nettoyages des eventuelles pièces jointes
|
||||
setGet_List_Of_All_PJ_result([]);
|
||||
setGet_List_Of_All_PJ_result([]);
|
||||
|
||||
|
||||
var line = JSON.parse(rowss[selected_row_id]);
|
||||
|
@ -354,6 +354,7 @@ const Config_Documents = (props) => {
|
|||
const [p_one_detail_ref_interne, setp_one_detail_ref_interne] = useState("");
|
||||
const [p_one_detail_sujet, setp_one_detail_sujet] = useState("");
|
||||
const [p_one_detail_type_doc, setp_one_detail_type_doc] = useState("");
|
||||
const [p_one_detail_duplicate, setp_one_detail_duplicate] = useState("");
|
||||
|
||||
|
||||
function clear_detail_fields() {
|
||||
|
@ -373,6 +374,7 @@ const Config_Documents = (props) => {
|
|||
setp_one_detail_nom("");
|
||||
setp_one_detail_ref_interne("");
|
||||
setp_one_detail_sujet("");
|
||||
setp_one_detail_duplicate("");
|
||||
setp_one_detail_type_doc("");
|
||||
setone_field_programme();
|
||||
}
|
||||
|
@ -496,7 +498,7 @@ const Config_Documents = (props) => {
|
|||
if (String(res.data.status) === "true") {
|
||||
//console.log(" In Get_Default_Original_Partner_Document_Data res.data.status = " + res.data.status);
|
||||
//console.log(" In Get_Default_Original_Partner_Document_Data res.data.message r_class = " + res.data.message);
|
||||
|
||||
|
||||
setGet_Default_Original_Partner_Document_Data_api("true");
|
||||
setGet_Default_Original_Partner_Document_Data_result(res.data.message);
|
||||
|
||||
|
@ -595,7 +597,7 @@ const Config_Documents = (props) => {
|
|||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (String(res.data.status) === "true") {
|
||||
//console.log(" In Get_Default_Original_Partner_Document_Data_By_id res.data.status = " + res.data.status);
|
||||
//console.log(" In Get_Default_Original_Partner_Document_Data_By_id res.data.status = " + res.data.status);
|
||||
//console.log(" In Get_Default_Original_Partner_Document_Data_By_id res.data.message r_class = " + res.data.message);
|
||||
setLoading(false);
|
||||
setGet_Default_Original_Partner_Document_Data_By_id_api("true");
|
||||
|
@ -626,6 +628,13 @@ const Config_Documents = (props) => {
|
|||
setp_one_detail_sujet(mylocal_document.sujet);
|
||||
}
|
||||
|
||||
|
||||
if (mylocal_document.duplicate) {
|
||||
setp_one_detail_duplicate(mylocal_document.sujet);
|
||||
}
|
||||
else{
|
||||
setp_one_detail_duplicate("0");
|
||||
}
|
||||
setfield_programme("");
|
||||
if (mylocal_document.contenu_doc) {
|
||||
setp_one_detail_contenu_doc(String(mylocal_document.contenu_doc));
|
||||
|
@ -908,6 +917,14 @@ const Config_Documents = (props) => {
|
|||
}
|
||||
|
||||
|
||||
if (p_one_detail_duplicate)
|
||||
form.append("duplicate", p_one_detail_duplicate);
|
||||
else {
|
||||
form.append("duplicate", "0");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (p_one_detail_nom)
|
||||
form.append("nom", p_one_detail_nom);
|
||||
else {
|
||||
|
@ -1401,11 +1418,6 @@ const Config_Documents = (props) => {
|
|||
|
||||
function Record_All_PJ() {
|
||||
|
||||
if (!p_detail_one_file_to_download_type_name) {
|
||||
alert(" Vous devez donner un nom à la pièce jointe");
|
||||
return;
|
||||
}
|
||||
|
||||
if (file_1_name && file_1_name.name) {
|
||||
//console.log(" ### Traitement de : ", file_1_name.name);
|
||||
|
||||
|
@ -1415,7 +1427,7 @@ const Config_Documents = (props) => {
|
|||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
||||
formData.append("token", stored_cookie);
|
||||
formData.append("file_business_object", p_detail_one_file_to_download_type_name);
|
||||
formData.append("file_business_object", file_1_name.name);
|
||||
formData.append("file_name", file_1_name.name);
|
||||
formData.append("status", "0");
|
||||
formData.append("object_owner_collection", "courrier_template");
|
||||
|
@ -1465,7 +1477,7 @@ const Config_Documents = (props) => {
|
|||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -2262,155 +2274,6 @@ const Config_Documents = (props) => {
|
|||
/>
|
||||
|
||||
</div>
|
||||
{p_detail_type_doc && String(p_detail_type_doc).toLocaleLowerCase() === "email" && <div className="div_row_gauche texte_area_filter" >
|
||||
Pièces Jointe <br />
|
||||
<div>
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
<hr className="hr_break" />
|
||||
</div>
|
||||
|
||||
<div className="div_row" style={{ "border": "None", "fontSize": "22px", "fontWeight": "600", "padding": "5px" }}>
|
||||
Pièces jointes
|
||||
|
||||
</div>
|
||||
|
||||
<div className="div_row" style={{ "padding": "5px" }}>
|
||||
|
||||
<div style={{ "fontSize": "12px" }}>
|
||||
<label htmlFor="upload-photo">
|
||||
<input
|
||||
style={{ display: "none" }}
|
||||
id="upload-photo"
|
||||
name="upload-photo"
|
||||
type="file"
|
||||
onChange={sessions_file_change_1}
|
||||
/>
|
||||
|
||||
<Fab
|
||||
color="secondary"
|
||||
size="small"
|
||||
component="span"
|
||||
aria-label="add"
|
||||
variant="extended"
|
||||
>
|
||||
<IoMdAddCircle /> <nav style={{ "fontSize": "12px" }}> Ajouter un fichier </nav>
|
||||
</Fab>
|
||||
|
||||
</label>
|
||||
</div>
|
||||
{file_1_name && file_1_name.name &&
|
||||
<nav style={{ "fontSize": "12px" }}>
|
||||
<div className="session_caract">Nom du fichier <br />
|
||||
<TextField
|
||||
name="file_to_download_type_name"
|
||||
id="file_to_download_type_name"
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
|
||||
disabled={false}
|
||||
className="disabled_style enable_style"
|
||||
value={p_detail_one_file_to_download_type_name}
|
||||
onChange={(e) => {
|
||||
setp_detail_one_file_to_download_type_name(e.target.value);
|
||||
|
||||
}}
|
||||
/>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
Fichier : {file_1_name.name} <br /> <font style={{ "cursor": "pointer" }}
|
||||
onClick={Delete_file_1_name}> Supprimer <IoIosRemoveCircleOutline /> </font>
|
||||
</nav>}
|
||||
|
||||
{Record_All_PJ_api && String(Record_All_PJ_api) === "true" && <div className="okUpdateData"> Pièce jointe enregistrée </div>}
|
||||
|
||||
{Record_All_PJ_api && String(Record_All_PJ_api) === "false" && <div className="koUpdateData"> {Record_All_PJ_message} </div>}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{file_1_name && file_1_name.name && <div className="div_row">
|
||||
|
||||
<div className="div_row_gauche">
|
||||
<Button variant="contained" onClick={Record_All_PJ}
|
||||
startIcon={<AiTwotoneSave />} className="bton_enreg">ENREGISTRER LA PIECE</Button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
{Get_List_Of_All_PJ_result && <div className="div_row" style={{ "padding": "5px" }}>
|
||||
<div className="div_row">
|
||||
Liste des pièces jointes <br />
|
||||
<div className="div_row">
|
||||
{Get_List_Of_All_PJ_result && Get_List_Of_All_PJ_result.map((val) => (
|
||||
<div className="div_row_list_pj" >
|
||||
<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 <i> {(JSON.parse(val).file_business_object)}</i> </nav> <br />
|
||||
<Popup
|
||||
trigger={
|
||||
<nav style={{ "color": "red", "cursor": "pointer" }} > Supprimer</nav>
|
||||
|
||||
|
||||
}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, la pièce jointe sera <i><font color="red"> définitivement supprimée</font></i>. <br />
|
||||
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
|
||||
Delete_one_attached_document(event);
|
||||
close();
|
||||
}}
|
||||
name={(JSON.parse(val).file_name)} id={(JSON.parse(val).file_name)}
|
||||
> 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>
|
||||
</div>
|
||||
</div>}
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>}
|
||||
|
||||
</div>
|
||||
<div className="div_row_droite_1_tier" style={{ "textAlign": "left" }}>
|
||||
|
@ -2453,6 +2316,137 @@ const Config_Documents = (props) => {
|
|||
|
||||
</div>
|
||||
|
||||
{p_detail_type_doc && String(p_detail_type_doc).toLocaleLowerCase() === "email" && <div className="div_row" style={{ "marginRight": "15px" }} >
|
||||
|
||||
<div>
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
<hr className="hr_break" />
|
||||
</div>
|
||||
|
||||
<div className="div_row" style={{ "border": "None", "fontSize": "22px", "fontWeight": "600", "padding": "5px" }}>
|
||||
Pièces jointes
|
||||
|
||||
</div>
|
||||
|
||||
<div className="div_row" style={{ "padding": "5px" }}>
|
||||
|
||||
<div style={{ "fontSize": "12px" }}>
|
||||
<label htmlFor="upload-photo">
|
||||
<input
|
||||
style={{ display: "none" }}
|
||||
id="upload-photo"
|
||||
name="upload-photo"
|
||||
type="file"
|
||||
onChange={sessions_file_change_1}
|
||||
/>
|
||||
|
||||
<Fab
|
||||
color="secondary"
|
||||
size="small"
|
||||
component="span"
|
||||
aria-label="add"
|
||||
variant="extended"
|
||||
>
|
||||
<IoMdAddCircle /> <nav style={{ "fontSize": "12px" }}> Ajouter un fichier </nav>
|
||||
</Fab>
|
||||
|
||||
</label>
|
||||
</div>
|
||||
{file_1_name && file_1_name.name &&
|
||||
<nav style={{ "fontSize": "12px" }}>
|
||||
Fichier : {file_1_name.name} <font style={{ "cursor": "pointer" }}
|
||||
onClick={Delete_file_1_name}> Supprimer <IoIosRemoveCircleOutline /> </font>
|
||||
</nav>}
|
||||
|
||||
{Record_All_PJ_api && String(Record_All_PJ_api) === "true" && <div className="okUpdateData"> Pièce jointe enregistrée </div>}
|
||||
|
||||
{Record_All_PJ_api && String(Record_All_PJ_api) === "false" && <div className="koUpdateData"> {Record_All_PJ_message} </div>}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
{file_1_name && file_1_name.name && <div className="div_row">
|
||||
|
||||
<div className="div_row_gauche">
|
||||
<Button variant="contained" onClick={Record_All_PJ}
|
||||
startIcon={<AiTwotoneSave />} className="bton_enreg">ENREGISTRER LA PIECE</Button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
{Get_List_Of_All_PJ_result && <div className="div_row" style={{ "padding": "5px" }}>
|
||||
<div className="div_row">
|
||||
Liste des pièces jointes <br />
|
||||
<div className="div_row">
|
||||
{Get_List_Of_All_PJ_result && Get_List_Of_All_PJ_result.map((val) => (
|
||||
<div className="div_row_list_pj" >
|
||||
<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 <i> {(JSON.parse(val).file_business_object)}</i> </nav>
|
||||
<Popup
|
||||
trigger={
|
||||
<nav style={{ "color": "red", "cursor": "pointer", "marginBottom":"1rem" }} > Supprimer</nav>
|
||||
|
||||
}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, la pièce jointe sera <i><font color="red"> définitivement supprimée</font></i>. <br />
|
||||
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
|
||||
Delete_one_attached_document(event);
|
||||
close();
|
||||
}}
|
||||
name={(JSON.parse(val).file_name)} id={(JSON.parse(val).file_name)}
|
||||
> 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>
|
||||
</div>
|
||||
</div>}
|
||||
|
||||
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
<hr className="hr_break" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>}
|
||||
|
||||
</div>
|
||||
{String(partner_document_data_edit_mode) === "1" && <div className="div_row">
|
||||
<div style={{ "width": "98%", "marginLeft": "1%", "marginRight": "1%", "float": "left" }}>
|
||||
|
|
|
@ -3483,7 +3483,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
}
|
||||
|
||||
//var new_node = {'name':event.target.files[0].name, 'type':event.target.files[0].type}
|
||||
|
||||
|
||||
|
||||
var new_tmp = [];
|
||||
|
||||
|
@ -3500,7 +3500,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
settab_convention_pieces_jointes_result(new_tmp);
|
||||
|
||||
console.log( " tab_convention_pieces_jointes_result = ", tab_convention_pieces_jointes_result)
|
||||
console.log(" tab_convention_pieces_jointes_result = ", tab_convention_pieces_jointes_result)
|
||||
|
||||
|
||||
return;
|
||||
|
@ -4265,15 +4265,15 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
form.append("email_test", selected_convention_email_test);
|
||||
form.append("email_production", selected_convention_email_destinataire_prod);
|
||||
|
||||
// pièce jointe
|
||||
form.append("file_business_object", "");
|
||||
var list_files = new FormData();
|
||||
|
||||
for (let i=0; i< tab_convention_pieces_jointes_result.length; i++){
|
||||
form.append('File', tab_convention_pieces_jointes_result[i]);
|
||||
|
||||
}
|
||||
//form.append("File", list_files);
|
||||
// pièce jointe
|
||||
form.append("file_business_object", "");
|
||||
var list_files = new FormData();
|
||||
|
||||
for (let i = 0; i < tab_convention_pieces_jointes_result.length; i++) {
|
||||
form.append('File', tab_convention_pieces_jointes_result[i]);
|
||||
|
||||
}
|
||||
//form.append("File", list_files);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Sent_Convention_Stagiaire_By_Email/";
|
||||
|
||||
|
@ -4385,12 +4385,12 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
form.append("file_business_object", "");
|
||||
var list_files = new FormData();
|
||||
|
||||
for (let i=0; i< tab_convention_pieces_jointes_result.length; i++){
|
||||
for (let i = 0; i < tab_convention_pieces_jointes_result.length; i++) {
|
||||
form.append('File', tab_convention_pieces_jointes_result[i]);
|
||||
|
||||
|
||||
}
|
||||
//form.append("File", list_files);
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Sent_Convention_Stagiaire_By_Email/";
|
||||
|
||||
setLoading(true);
|
||||
|
@ -4494,11 +4494,23 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
form.append("tab_inscription_id", liste_selected_inscription_id);
|
||||
form.append("courrier_template_id", selected_convention_id);
|
||||
|
||||
// pièce jointe
|
||||
form.append("file_business_object", "");
|
||||
var list_files = new FormData();
|
||||
|
||||
for (let i = 0; i < tab_convention_pieces_jointes_result.length; i++) {
|
||||
form.append('File', tab_convention_pieces_jointes_result[i]);
|
||||
|
||||
}
|
||||
//form.append("File", list_files);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Sent_Convention_Stagiaire_By_Email_mass/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
setLoading(false);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Send_Stagiaire_Conventions_By_Email_Masse res.data.status = " + res.data.status);
|
||||
//console.log(" In Send_Stagiaire_Conventions_By_Email_Masse res.data.message r_class = " + res.data.message);
|
||||
|
@ -4515,6 +4527,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Send_Stagiaire_Conventions_By_Email_Masse = ', error);
|
||||
setSend_Stagiaire_Conventions_By_Email_Masse_api("false");
|
||||
alert("Impossible d'envoyer les conventions en masse par email");
|
||||
|
@ -4532,13 +4545,13 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
|
||||
|
||||
let new_myArray = myArray.filter(file => file.name !== String(doc_to_del_name) );
|
||||
let new_myArray = myArray.filter(file => file.name !== String(doc_to_del_name));
|
||||
|
||||
console.log( " new_myArray = ", new_myArray);
|
||||
console.log(" new_myArray = ", new_myArray);
|
||||
|
||||
|
||||
var new_tab = []
|
||||
for (let i = 0; i < new_myArray.length; i++){
|
||||
for (let i = 0; i < new_myArray.length; i++) {
|
||||
new_tab.push(new_myArray[i]);
|
||||
}
|
||||
|
||||
|
@ -5047,7 +5060,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
</div>
|
||||
|
||||
<div className="div_row" style={{ "border": "None", "fontSize": "22px", "fontWeight": "600", "padding": "5px" }}>
|
||||
Pièces jointes Convention a
|
||||
Pièces jointes Convention
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -1904,7 +1904,7 @@
|
|||
.bton_add_session {
|
||||
background: #c8cfd5;
|
||||
color: black;
|
||||
width: 30% !important;
|
||||
width: 40% !important;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue