From e0e80bd13fff46eff96cb7b2d614c41cc4e830fa Mon Sep 17 00:00:00 2001 From: cherif Date: Sun, 8 Sep 2024 21:25:04 +0200 Subject: [PATCH] 08/09/2024 - 21h --- src/components/AddClassManual.js | 4 +- src/components/DisplayPartnerSession.js | 2 +- src/components/Employes.js | 325 +++++------ src/components/Module_Session_Evaluation.js | 2 +- src/components/Notes_Evaluation.js | 520 +++++++++++++++++- src/components/Partner.js | 2 +- src/components/PartnerClient_Activite.js | 1 - src/components/Partner_Commande.js | 152 ++++- .../Partner_Config_Session_Steps.js | 155 +++--- src/components/Partner_Config_Technique.js | 41 +- src/components/UpdatePartnerInfo.js | 44 +- 11 files changed, 935 insertions(+), 313 deletions(-) diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index d0be39a..f1af479 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -252,6 +252,8 @@ const AddClassManual = (props) => {
{New_Getall_Class_List_UE_result && New_Getall_Class_List_UE_result.length > 0 && } @@ -487,7 +489,7 @@ const AddClassManual = (props) => { setLoading(false); if (String(res.data.status) === String("true")) { //console.log(" In Getall_Class_List_UE res.data.status = " + res.data.status); - //console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message); + console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message); setGetall_Class_List_UE_api("true"); setGetall_Class_List_UE_result(res.data.message); diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 31f42bf..46c3c09 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -12217,7 +12217,7 @@ const DisplayPartnerSession = (props) => { -
Choisir un questionnaire d'évaluation a chaud +
Choisir un questionnaire d'évaluation à chaud { { field: 'fonction', headerName: 'Fonction', width: 150, hide: false, }, { - field: "Detail", headerName: 'Voir detail', + field: "Detail", headerName: 'Voir détail', renderCell: (cellValues) => { return ( @@ -559,7 +559,7 @@ const Employes = (props) => { var url = process.env.REACT_APP_API_URL + "myclass/api/Print_Employee_Given_Contrat/" + stored_cookie + "/" + selected_id + "/" + local_contract_id + "/"; Dialog_print_contrat_handleClose_buton(); - + setLoading(true); axios.get(url, { responseType: 'blob', },) .then((res) => { @@ -1142,6 +1142,9 @@ const Employes = (props) => { const [p_detail_linkedIn, setp_detail_linkedIn] = useState(""); const [p_detail_facebook, setp_detail_facebook] = useState(""); const [p_detail_twitter, setp_detail_twitter] = useState(""); + const [p_detail_list_diffusion_mail, setp_detail_list_diffusion_mail] = useState(""); + + const [p_detail_competence, setp_detail_competence] = useState(""); @@ -1188,6 +1191,8 @@ const Employes = (props) => { const [p_one_detail_facebook, setp_one_detail_facebook] = useState(); const [p_one_detail_twitter, setp_one_detail_twitter] = useState(); + const [p_one_detail_list_diffusion_mail, setp_one_detail_list_diffusion_mail] = useState(); + const [p_one_detail_competence, setp_one_detail_competence] = useState(); @@ -1318,6 +1323,12 @@ const Employes = (props) => { setp_detail_facebook(""); } + if (mylocal_employe.diffusion_mail) { + setp_detail_list_diffusion_mail(mylocal_employe.diffusion_mail); + } else { + setp_detail_list_diffusion_mail(""); + } + if (mylocal_employe.twitter) { setp_detail_twitter(mylocal_employe.twitter); @@ -1347,6 +1358,7 @@ const Employes = (props) => { } + if (mylocal_employe.user_login) { setp_detail_user_login(mylocal_employe.user_login); setp_new_login(mylocal_employe.user_login) @@ -1384,8 +1396,6 @@ const Employes = (props) => { } - - setp_detail_ismanager("0"); if (mylocal_employe.ismanager) { setp_detail_ismanager(mylocal_employe.ismanager); @@ -1960,6 +1970,12 @@ const Employes = (props) => { document.getElementsByName("detail_fonction")[0].style.backgroundColor = "#ECEFF1"; } + + if (document.getElementsByName("list_diffusion_mail")[0]) { + document.getElementsByName("list_diffusion_mail")[0].disabled = true; + document.getElementsByName("list_diffusion_mail")[0].style.backgroundColor = "#ECEFF1"; + } + if (document.getElementsByName("detail_ismanager")[0]) { document.getElementsByName("detail_ismanager")[0].disabled = true; document.getElementsByName("detail_ismanager")[0].style.backgroundColor = "#ECEFF1"; @@ -2099,6 +2115,10 @@ const Employes = (props) => { document.getElementsByName("detail_ismanager")[0].style.backgroundColor = "#FFFFFF"; } + if (document.getElementsByName("list_diffusion_mail") && document.getElementsByName("list_diffusion_mail")[0]) { + document.getElementsByName("list_diffusion_mail")[0].disabled = false; + document.getElementsByName("list_diffusion_mail")[0].style.backgroundColor = "#FFFFFF"; + } if (document.getElementsByName("detail_resp_hierarchie_id") && document.getElementsByName("detadetail_resp_hierarchie_idil_civilite")[0]) { @@ -2239,6 +2259,12 @@ const Employes = (props) => { else form.append("ismanager", "0"); + + if (p_detail_ismanager) + form.append("diffusion_mail", p_detail_list_diffusion_mail); + else + form.append("diffusion_mail", ""); + form.append("_id", selected_id); @@ -3027,6 +3053,12 @@ const Employes = (props) => { form.append("twitter", ""); + if (p_one_detail_list_diffusion_mail) + form.append("diffusion_mail", p_one_detail_twitter); + else + form.append("diffusion_mail", ""); + + if (p_one_detail_ismanager) form.append("ismanager", p_one_detail_ismanager); else @@ -6761,7 +6793,7 @@ const Employes = (props) => { MySy Information - + Impression contrat employé @@ -7040,7 +7072,7 @@ const Employes = (props) => {
- +
@@ -8601,32 +8633,34 @@ const Employes = (props) => { />
} - {String(employee_data_edit_mode) === "1" &&
Profil
+ {String(employee_data_edit_mode) === "1" && New_Get_List_RH_Profils_result && New_Get_List_RH_Profils_result.length > 0 && +
Profil
- (data).nom === String(p_detail_profil))[0].label} - onChange={(event, value) => { - if (value && value.nom) { - setp_detail_profil(value.nom); - setEmployee_data_changed("1"); + + (data).nom === String(p_detail_profil))[0].label} + onChange={(event, value) => { + if (value && value.nom) { + setp_detail_profil(value.nom); + setEmployee_data_changed("1"); + } + }} + + renderInput={(params) => } - }} - - renderInput={(params) => - } - /> -
} +
}
Fonction
{

+
+ + + Email Liste de Diffusion +
+ + { + setp_detail_list_diffusion_mail(e.target.value); + setEmployee_data_changed("1"); + } + } + /> + +
+
+ +
+
+ CRM +
+
+
+
+
+
+ +
+ + +
Compte utilisateur @@ -9140,181 +9216,8 @@ const Employes = (props) => {  
- {/* -
-
-
-
-
- Pièces jointes -
-
-
-
- -
- -
- {file_1_name && file_1_name.name && - } - - {Record_All_PJ_api && String(Record_All_PJ_api) === "true" &&
Pièce jointe enregistrée
} - - {Record_All_PJ_api && String(Record_All_PJ_api) === "false" &&
{Record_All_PJ_message}
} -
- - - - {file_1_name && file_1_name.name &&
- -
- -
- - -
} - - {Get_List_Of_All_PJ_result &&
-
- Liste des pièces jointes
-
- {Get_List_Of_All_PJ_result && Get_List_Of_All_PJ_result.map((val) => ( -
-
- Supprimer - - - } - modal - nested - position="center center" - > - {close => ( -
- -
MySy Information
-
- {' '} - - En confirmant cette opération, la pièce jointe sera définitivement supprimée.
- - -
-
-
- - -
-
- -
-
-
- )} -
- -
- ))} -
-
-
} -
-
-   -
- */} - {/* {String(Employee_data_changed) === "1" && String(employee_data_edit_mode) === "1" &&
- /!\ Pensez à enregistrer les modifications -
} - - -
- - {String(Employee_data_changed) === "1" && String(employee_data_edit_mode) === "1" &&
- - - -
} - - {String(employee_data_edit_mode) === "1" &&
- -
} -
- - - {String(employee_data_edit_mode) !== "1" &&
- - - -
} - */}
 
@@ -9753,6 +9656,26 @@ const Employes = (props) => {
+
CRM Email Diffusion
+ { + setp_one_detail_list_diffusion_mail(e.target.value); + setEmployee_data_changed("1"); + }} + /> +
+ {/* -- début champs specifiques **/} diff --git a/src/components/Module_Session_Evaluation.js b/src/components/Module_Session_Evaluation.js index 62ef6c7..a74e111 100644 --- a/src/components/Module_Session_Evaluation.js +++ b/src/components/Module_Session_Evaluation.js @@ -1395,7 +1395,7 @@ const Module_Session_Evaluation = (props) => {
-
Choisir un questionnaire d'évaluation a chaud +
Choisir un questionnaire d'évaluation à chaud { { field: 'groupe', headerName: 'groupe', flex: 1, hide: false, minWidth: 180, renderCell: (params) => , }, { field: 'note', headerName: 'Note', width: 200, editable: true, renderCell: (params) => , align: "center", }, + { field: 'convocation_send_date', headerName: 'Conv. Envoyé', width: 200, editable: true, renderCell: (params) => , align: "center", }, + { field: 'convocation_send_type', headerName: 'Conv. Par', width: 200, editable: true, renderCell: (params) => , align: "center", }, { @@ -541,6 +543,7 @@ const Notes_Evaluation = (props) => { setnoted_changed(""); setselectionModel_evalutions_participant([]); + settab_convention_pieces_jointes_result([]); Getall_Evaluation_Participant_List(selected_id); alert(res.data.message) @@ -965,6 +968,9 @@ const Notes_Evaluation = (props) => { var local_inscription_id = JSON.parse(x).inscription_id; var local_group_inscription_id = JSON.parse(x).group_inscription_id; + var local_convocation_send_date = JSON.parse(x).convocation_send_date; + var local_convocation_send_type = JSON.parse(x).convocation_send_type; + //--- var node = { @@ -978,6 +984,8 @@ const Notes_Evaluation = (props) => { "note_changed": "0", "inscription_id": local_inscription_id, "group_inscription_id": local_group_inscription_id, + "convocation_send_date": String(local_convocation_send_date).substring(0, 10), + "convocation_send_type": String(local_convocation_send_type).substring(0, 10), }; new_data2.push(node); @@ -995,6 +1003,8 @@ const Notes_Evaluation = (props) => { "note_changed": "0", "inscription_id": "", "group_inscription_id": "", + "convocation_send_date": "", + "convocation_send_type": "", }; new_data2.push(node); @@ -1547,6 +1557,8 @@ const Notes_Evaluation = (props) => { behavior: "smooth", }); + Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc("EVALUATION_CONVOCATION"); + }, []) const myRef_head = useRef(null); @@ -1706,8 +1718,27 @@ const Notes_Evaluation = (props) => { form.append("class_eu_id", p_detail_class_eu_id); form.append("type_eval_id", p_detail_type_eval_id); - form.append("eval_date_heure_debut", p_detail_eval_date_heure_debut); - form.append("eval_date_heure_fin", p_detail_eval_date_heure_fin); + + var new_p_detail_eval_date_heure_debut = ""; + if (typeof p_detail_eval_date_heure_debut == "object") { + var act_deadline = format(p_detail_eval_date_heure_debut, 'dd/MM/yyyy HH:mm'); + new_p_detail_eval_date_heure_debut = act_deadline; + } else { + new_p_detail_eval_date_heure_debut = p_detail_eval_date_heure_debut; + } + form.append("eval_date_heure_debut", new_p_detail_eval_date_heure_debut); + + + + var new_p_detail_eval_date_heure_fin = ""; + if (typeof p_detail_eval_date_heure_fin == "object") { + var act_deadline = format(p_detail_eval_date_heure_fin, 'dd/MM/yyyy HH:mm'); + new_p_detail_eval_date_heure_fin = act_deadline; + } else { + new_p_detail_eval_date_heure_fin = p_detail_eval_date_heure_fin; + } + form.append("eval_date_heure_fin", new_p_detail_eval_date_heure_fin); + form.append("statut", p_detail_statut); form.append("adress", p_detail_adress); form.append("cp", p_detail_cp); @@ -2009,9 +2040,6 @@ const Notes_Evaluation = (props) => { var liste_apprenant_id = GetSelectedRows_Apprenant_Evaluation_Ids(); - //console.log(" liste_preinscr_id = ", liste_preinscr_id); - - var tab_mongo_preins_ids = []; @@ -2019,7 +2047,6 @@ const Notes_Evaluation = (props) => { var line = Getall_Evaluation_Participant_List_result[liste_apprenant_id[i]] - var line_json = JSON.parse(line) //console.log(" line_json['prenom'] = ", line_json['prenom']); //console.log(" line_json['_id'] = ", line_json['_id']); @@ -2029,7 +2056,12 @@ const Notes_Evaluation = (props) => { if (String(actionmass_eval_inscr_val) === String("delete_inscr")) { Delete_List_Participant_From_Evaluation(tab_mongo_preins_ids); + setactionmass_eval_inscr_val(""); + } + if (String(actionmass_eval_inscr_val) === String("send_convocation")) { + setDialog_CONVOCATION_EVAL_open(true); //zzzz + setactionmass_eval_inscr_val(""); } } @@ -2037,6 +2069,7 @@ const Notes_Evaluation = (props) => { const New_Option_PreInscription = [ + { "id": "send_convocation", "label": "Envoyer Convocation", "value": "send_convocation" }, { "id": "delete_inscr", "label": "Supprimer", "value": "delete_inscr" }, { "id": "", "label": "", "value": "" }, ] @@ -2071,7 +2104,8 @@ const Notes_Evaluation = (props) => { setnoted_changed(""); Getall_Evaluation_Participant_List(selected_id); - setselectionModel_evalutions_participant([]) + setselectionModel_evalutions_participant([]); + settab_convention_pieces_jointes_result([]); alert(res.data.message); } @@ -2746,7 +2780,7 @@ const Notes_Evaluation = (props) => { //console.log(" In Delete_Sequence_Session_Ressource_Data res.data.status = " + res.data.status); //console.log(" In Delete_Sequence_Session_Ressource_Data res.data.message r_class = " + res.data.message); - + setLoading(false); if (String(res.data.status) === String("true")) { @@ -2888,12 +2922,464 @@ const Notes_Evaluation = (props) => { // -- end gestion des ressources + const [New_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result, setNew_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result] = useState([]); + + const [Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api, setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api] = useState(); + const [Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_message, setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_message] = useState(); + const [Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result, setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result] = useState([]); + function Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc(ref_interne_document) { + + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("ref_interne", ref_interne_document); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Document_with_filter/"; + setLoading(true); + + + axios.post(myurl, form).then(res => { + //console.log(" In Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc res.data.status = " + res.data.status); + //console.log(" In Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc res.data.message r_class = " + res.data.message); + setLoading(false); + if (String(res.data.status) === String("true")) { + + + setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api("true"); + setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result(res.data.message); + + var new_data2 = []; + + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_ref_interne = JSON.parse(x).ref_interne; + var local_nom = JSON.parse(x).nom; + var local_sujet = JSON.parse(x).sujet; + 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; + + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_nom + " - " + local_type_doc, + "ref_interne": local_ref_interne, + "nom": local_nom, + "sujet": local_sujet, + "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) + }); + + if (new_data2.length > 0) + setNew_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result(new_data2); + + } + else { + setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api("false"); + setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc = ', error); + setGet_Partner_List_EVALUATION_CONVOCATION_Model_Doc_api("false"); + alert("Impossible de récupérer les modèles de convocations"); + //setmyApimyApiMessage("") + }) + } + + const New_Option_Type_Document = [ + { "id": "email", "label": "Email", "value": "email" }, + { "id": "pdf", "label": "PDF", "value": "pdf" }, + + ] + + const [Convocation_Eval_Type_doc, setConvocation_Eval_Type_doc] = React.useState("pdf"); + const [Convocation_Eval_model_doc_id, setConvocation_Eval_model_doc_id] = React.useState("pdf"); + + + const [Dialog_CONVOCATION_EVAL_open, setDialog_CONVOCATION_EVAL_open] = React.useState(false); + + + const Dialog_CONVOCATION_EVAL_handleClose_buton = () => { + setDialog_CONVOCATION_EVAL_open(false); + settab_convention_pieces_jointes_result([]); + }; + + + function Download_Evaluation_Convocation_PDF() { + + const stored_cookie = getCookie('tokenmysypart'); + var nom_fichier = "Convocation_Evaluation.zip"; + + var liste_apprenant_id = GetSelectedRows_Apprenant_Evaluation_Ids(); + var tab_mongo_preins_ids = []; + + for (var i = 0; i < liste_apprenant_id.length; i++) { + var line = Getall_Evaluation_Participant_List_result[liste_apprenant_id[i]] + var line_json = JSON.parse(line); + tab_mongo_preins_ids.push(line_json['_id']) + } + + var list_ids = tab_mongo_preins_ids.toString() + + + var url = process.env.REACT_APP_API_URL + "myclass/api/Send_Evaluation_Convocation_Participant_By_PDF/" + stored_cookie + "/" + selected_id + "/" + list_ids + "/" + Convocation_Eval_model_doc_id; + + + //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id); + setLoading(true); + axios.get(url, { responseType: 'blob', },) + .then((res) => { + setLoading(false); + //console.log(" In Download_Stagiaire_Conventions_PDF res.data = " + res.data); + if (String(res.data) === String("false")) { + alert("Impossible de télécharger le fichier (2) "); + } else { + fileDownload(res.data, nom_fichier); + setselectionModel_evalutions_participant([]); + settab_convention_pieces_jointes_result([]); + + } + }).catch((error) => { + setLoading(false); + console.error('Error:', error); + alert(" Impossible de télécharger la convention ") + + }); + + } + + const [Send_Eval_Convocation_By_Email_api, setSend_Eval_Convocation_By_Email_api] = useState(); + const [Send_Eval_Convocation_By_Email_message, setSend_Eval_Convocation_By_Email_message] = useState(); + const [Send_Eval_Convocation_By_Email_result, setSend_Eval_Convocation_By_Email_result] = useState(); + function Send_Eval_Convocation_By_Email(event) { + + var liste_apprenant_id = GetSelectedRows_Apprenant_Evaluation_Ids(); + var tab_mongo_preins_ids = []; + + for (var i = 0; i < liste_apprenant_id.length; i++) { + var line = Getall_Evaluation_Participant_List_result[liste_apprenant_id[i]] + var line_json = JSON.parse(line); + tab_mongo_preins_ids.push(line_json['_id']) + } + + var list_ids = tab_mongo_preins_ids.toString() + + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("evaluation_id", selected_id); + form.append("tab_eval_inscription_id", list_ids); + form.append("courrier_template_id", Convocation_Eval_model_doc_id); + + + 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/Send_Evaluation_Convocation_Participant_By_Email/"; + + + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Send_Eval_Convocation_By_Email res.data.status = " + res.data.status); + //console.log(" In Send_Eval_Convocation_By_Email res.data.message r_class = " + res.data.message); + setSend_Eval_Convocation_By_Email_api("true"); + setSend_Eval_Convocation_By_Email_result(res.data.message); + setselectionModel_evalutions_participant([]); + settab_convention_pieces_jointes_result([]); + + Dialog_CONVOCATION_EVAL_handleClose_buton(); + alert(res.data.message); + + } + else { + setSend_Eval_Convocation_By_Email_api("false"); + setSend_Eval_Convocation_By_Email_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Send_Eval_Convocation_By_Email = ', error); + setSend_Eval_Convocation_By_Email_api("false"); + alert("Impossible d'envoyer la convocation par email"); + //setmyApimyApiMessage("") + }) + } + + function Delete_Convention_Attached_Doc(event) { + + var doc_to_del_name = event.target.id; + const myArray = tab_convention_pieces_jointes_result; + + + + let new_myArray = myArray.filter(file => file.name !== String(doc_to_del_name)); + + var new_tab = [] + for (let i = 0; i < new_myArray.length; i++) { + new_tab.push(new_myArray[i]); + } + + settab_convention_pieces_jointes_result(new_tab); + + + } + + const [sessions_file_change_1_convention_api, setsessions_file_change_1_convention_api] = useState(); + const [sessions_file_change_1_convention_result, setsessions_file_change_1_convention_result] = useState(); + const [sessions_file_change_1_convention_message, setsessions_file_change_1_convention_message] = useState(); + const sessions_file_change_1_convention = event => { + + const fileUploaded = event.target.files[0]; + let file_size = event.target.files[0].size; + let file_type = event.target.files[0].type; + + + if (file_type !== "application/pdf") { + alert("Le fichier n'est pas de type PDF"); + return; + } + + + + if (file_size > 10000000) { + alert("Le fichier ne doit pas depasser un 1 Méga octets"); + console.log("Le fichier ne doit pas depasser un 1 Méga octets"); + return; + } + + //var new_node = {'name':event.target.files[0].name, 'type':event.target.files[0].type} + + + var new_tmp = []; + + if (tab_convention_pieces_jointes_result && tab_convention_pieces_jointes_result.length > 0) { + + tab_convention_pieces_jointes_result.map((x) => { + new_tmp.push(x); + + }); + + } + + new_tmp.push(event.target.files[0]) + + settab_convention_pieces_jointes_result(new_tmp); + + //console.log(" tab_convention_pieces_jointes_result = ", tab_convention_pieces_jointes_result) + + + return; + + + }; + + const [tab_convention_pieces_jointes_result, settab_convention_pieces_jointes_result] = useState([]); + + + + return (
{isLoading &&
} + + + {/* Dialog pour gerer les CONVOCATION_EVAL */} + + + MySy Information + + + {setConvocation_Eval_Type_doc && setConvocation_Eval_Type_doc.length > 0 && +
Type Document
+ (data).id === String(Convocation_Eval_Type_doc))[0].label} + + onChange={(event, value) => { + if (value && value.id) { + setConvocation_Eval_Type_doc(value.id); + } else { + setConvocation_Eval_Type_doc("pdf"); + + } + }} + + renderInput={(params) => + } + /> + +
} + + {New_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result && New_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result.length > 0 && +
Choisir un modèle d'émargement + (data).type_doc === String(Convocation_Eval_Type_doc))} + + onChange={(event, value) => { + if (value && value._id) { + setConvocation_Eval_model_doc_id(value._id); + //var result2 = New_Get_Partner_List_EVALUATION_CONVOCATION_Model_Doc_result.filter((local_mymanager) => JSON.parse(local_mymanager)._id === String(value._id)) + + } else { + setConvocation_Eval_model_doc_id(""); + + } + }} + + renderInput={(params) => + } + /> + +
} + + + + {String(Convocation_Eval_Type_doc) === "email" &&
+ +
+
+
+
+ +
+ Pièces jointes Convention + +
+ +
+ +
+ +
+ + +
+ + + {tab_convention_pieces_jointes_result &&
+ +
+ Liste des pièces jointes
+ {
+ {tab_convention_pieces_jointes_result && tab_convention_pieces_jointes_result.map((val) => ( +
+
+ + +
+ ))} +
} +
+
} + + + +
+
} + +
+ + +
+
+ + + + {Convocation_Eval_Type_doc && String(Convocation_Eval_Type_doc) === "pdf" && } + + {Convocation_Eval_Type_doc && String(Convocation_Eval_Type_doc) === "email" && } + +
+ + + +
+ +
+
+ +
+ +
+ {/* FIN Dialog pour gerer les CONVOCATION_EVAL */} + + + {/*** Dialog Ajout Ressources */} { setgridline_id(newSelectionModel.row.id); handleClick_edit_evaluation_From_Line(newSelectionModel.row.id); + setselectionModel_evalutions_participant([]); + settab_convention_pieces_jointes_result([]); }} @@ -4251,7 +4739,7 @@ const Notes_Evaluation = (props) => { - +
}
  @@ -4800,6 +5288,10 @@ const Notes_Evaluation = (props) => { note: (item).note, note_changed: (item).note_changed, + convocation_send_date: (item).convocation_send_date, + convocation_send_type: (item).convocation_send_type, + + } ))} @@ -4879,7 +5371,7 @@ const Notes_Evaluation = (props) => { options={New_Option_PreInscription} onChange={(event, value) => { if (value && value.value) { - if (String(value.value) === "delete_inscr") { + if (String(value.value) === "delete_inscr" || String(value.value) === "send_convocation") { setactionmass_eval_inscr_val(value.value); } else { @@ -4900,6 +5392,7 @@ const Notes_Evaluation = (props) => { />   + {actionmass_eval_inscr_val && String(actionmass_eval_inscr_val).length > 1 &&
@@ -5120,7 +5618,7 @@ const Notes_Evaluation = (props) => { + evaluation_selected_id={selected_id} />
} diff --git a/src/components/Partner.js b/src/components/Partner.js index 762aa3e..80a3047 100644 --- a/src/components/Partner.js +++ b/src/components/Partner.js @@ -1233,7 +1233,7 @@ const Partner = (props) => { axios.post(myurl, form).then(res => { if (String(res.data.status) === String("true")) { //console.log(" In GetPartnerNameFromToken res.data.status = " + res.data.status); - console.log(" In GetPartnerNameFromToken res.data.message = " + res.data.message); + // console.log(" In GetPartnerNameFromToken res.data.message = " + res.data.message); setparntername(JSON.parse(res.data.message).nom); setconntected_employee_email(JSON.parse(res.data.message).email); diff --git a/src/components/PartnerClient_Activite.js b/src/components/PartnerClient_Activite.js index a2488ce..d8f2b44 100644 --- a/src/components/PartnerClient_Activite.js +++ b/src/components/PartnerClient_Activite.js @@ -705,7 +705,6 @@ const PartnerClientActivite = (props) => { var new_dead_line_format = ""; - if (typeof p_activite_deadline == "object") { var act_deadline = format(p_activite_deadline, 'dd/MM/yyyy'); new_dead_line_format = act_deadline; diff --git a/src/components/Partner_Commande.js b/src/components/Partner_Commande.js index e4fd540..7da10b4 100644 --- a/src/components/Partner_Commande.js +++ b/src/components/Partner_Commande.js @@ -10,6 +10,9 @@ import { useHistory } from "react-router-dom"; import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; +import { Fab } from "@material-ui/core"; +import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io"; + import { FcViewDetails, FcDisapprove } from "react-icons/fc"; import 'react-tooltip/dist/react-tooltip.css'; import { Tooltip } from 'react-tooltip'; @@ -3597,6 +3600,10 @@ const Partner_Commande = (props) => { form.append("request_digital_signature", "0"); } + for (let i = 0; i < tab_convention_pieces_jointes_result.length; i++) { + form.append('File', tab_convention_pieces_jointes_result[i]); + } + //console.log("### form = ", form); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Send_Partner_Order_By_Email/"; @@ -4169,10 +4176,8 @@ const Partner_Commande = (props) => { }; const Dialog_signature_digitale_handleClose_buton = () => { - setDialog_signature_digitale_open(false); - - + settab_convention_pieces_jointes_result([]); }; @@ -4446,6 +4451,78 @@ const Partner_Commande = (props) => { }; + function Delete_Convention_Attached_Doc(event) { + + var doc_to_del_name = event.target.id; + const myArray = tab_convention_pieces_jointes_result; + + + + let new_myArray = myArray.filter(file => file.name !== String(doc_to_del_name)); + + var new_tab = [] + for (let i = 0; i < new_myArray.length; i++) { + new_tab.push(new_myArray[i]); + } + + settab_convention_pieces_jointes_result(new_tab); + + + } + + const [sessions_file_change_1_convention_api, setsessions_file_change_1_convention_api] = useState(); + const [sessions_file_change_1_convention_result, setsessions_file_change_1_convention_result] = useState(); + const [sessions_file_change_1_convention_message, setsessions_file_change_1_convention_message] = useState(); + const sessions_file_change_1_convention = event => { + + const fileUploaded = event.target.files[0]; + let file_size = event.target.files[0].size; + let file_type = event.target.files[0].type; + + + if (file_type !== "application/pdf") { + alert("Le fichier n'est pas de type PDF"); + return; + } + + + + if (file_size > 10000000) { + alert("Le fichier ne doit pas depasser un 1 Méga octets"); + console.log("Le fichier ne doit pas depasser un 1 Méga octets"); + return; + } + + //var new_node = {'name':event.target.files[0].name, 'type':event.target.files[0].type} + + + var new_tmp = []; + + if (tab_convention_pieces_jointes_result && tab_convention_pieces_jointes_result.length > 0) { + + tab_convention_pieces_jointes_result.map((x) => { + new_tmp.push(x); + + }); + + } + + new_tmp.push(event.target.files[0]) + + settab_convention_pieces_jointes_result(new_tmp); + + //console.log(" tab_convention_pieces_jointes_result = ", tab_convention_pieces_jointes_result) + + + return; + + + }; + + const [tab_convention_pieces_jointes_result, settab_convention_pieces_jointes_result] = useState([]); + + + return ( @@ -4804,6 +4881,73 @@ const Partner_Commande = (props) => {
} +
+ +
+
+
+
+ +
+ Pièces jointes Convention + +
+ +
+ +
+ +
+ + +
+ + + {tab_convention_pieces_jointes_result &&
+ +
+ Liste des pièces jointes
+ {
+ {tab_convention_pieces_jointes_result && tab_convention_pieces_jointes_result.map((val) => ( +
+
+ + +
+ ))} +
} +
+
} + + + +
+
+ + @@ -4815,8 +4959,6 @@ const Partner_Commande = (props) => {
} - modal - nested - position="center center" - > - {close => ( -
- -
MySy Information
-
- {' '} - - En confirmant cette opération, le document sera définitivement supprimé.
- -
-
-
- - -
-
- -
-
-
- )} - - - - ); - } - } + + { + field: "delete", headerName: 'Supprimer', + renderCell: (cellValues) => { + return ( + + { + // handleClick_delete(event, cellValues); + }} + > + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, le document sera définitivement supprimé.
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+ + + ); + } + } ] @@ -222,7 +224,7 @@ const Partner_Configuration_Session_Steps = (props) => { var line = JSON.parse(rowss[selected_row_id]); setdisplay_detail_config("1"); - + var invoice_id = line._id; setselected_id(invoice_id); @@ -236,6 +238,7 @@ const Partner_Configuration_Session_Steps = (props) => { var local_config_comment = line.session_step_comment; setp_detail_config_comment(local_config_comment); + Disable_Config_DetailFields(); @@ -307,6 +310,7 @@ const Partner_Configuration_Session_Steps = (props) => { form.append("session_step_sequence", p_detail_config_valeur); form.append("session_step_comment", p_detail_config_comment); + //console.log(" form == ", form); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Partner_session_step/"; @@ -325,7 +329,8 @@ const Partner_Configuration_Session_Steps = (props) => { setp_detail_config_valeur(); setp_detail_config_point(); setp_detail_config_comment(); - + + setConfig_data_changed(); setconfig_data_edit_mode(); setdisplay_detail_config(); @@ -365,8 +370,8 @@ const Partner_Configuration_Session_Steps = (props) => { Delete_Personalise_Field_Data(local_id, local_session_step_name); } - - const [Delete_Personalise_Field_Data_api, setDelete_Personalise_Field_Data_api] = useState(); + + const [Delete_Personalise_Field_Data_api, setDelete_Personalise_Field_Data_api] = useState(); const [Delete_Personalise_Field_Data_message, setDelete_Personalise_Field_Data_message] = useState(); const [Delete_Personalise_Field_Data_result, setDelete_Personalise_Field_Data_result] = useState(); function Delete_Personalise_Field_Data(local_id, local_session_step_name) { @@ -398,8 +403,8 @@ const Partner_Configuration_Session_Steps = (props) => { setConfig_data_changed(); setconfig_data_edit_mode(); setdisplay_detail_config(); - - + + alert(" Le document a été correctement supprimé."); //myRef_head.current.scrollIntoView({ behavior: "smooth" }); @@ -437,7 +442,7 @@ const Partner_Configuration_Session_Steps = (props) => { setconfig_data_edit_mode("1"); setadd_new_step('1'); Enable_Config_DetailFields(); - + } function Annule_Order_DetailFields() { @@ -445,14 +450,14 @@ const Partner_Configuration_Session_Steps = (props) => { var line = JSON.parse(rowss[selected_row_id_val]); setdisplay_detail_config("1"); - + var invoice_id = line._id; setselected_id(invoice_id); var local_config_name = line.session_step_name; setp_detail_config_point(local_config_name); - + var local_config_value = line.session_step_sequence; setp_detail_config_valeur(local_config_value); @@ -663,6 +668,7 @@ const Partner_Configuration_Session_Steps = (props) => { config_name: JSON.parse(item).session_step_name, config_value: JSON.parse(item).session_step_sequence, config_comment: JSON.parse(item).session_step_comment, + config_gagne: JSON.parse(item).session_step_gagne, } ))} @@ -917,10 +923,8 @@ const Partner_Configuration_Session_Steps = (props) => { setConfig_data_changed("1"); } } - /> -
} @@ -966,8 +970,7 @@ const Partner_Configuration_Session_Steps = (props) => { />
- - +
  @@ -991,7 +994,7 @@ const Partner_Configuration_Session_Steps = (props) => {
- +
 
diff --git a/src/components/Partner_Config_Technique.js b/src/components/Partner_Config_Technique.js index e137923..01c5fe0 100644 --- a/src/components/Partner_Config_Technique.js +++ b/src/components/Partner_Config_Technique.js @@ -14,7 +14,7 @@ import parse from 'html-react-parser'; import { FcViewDetails, FcDisapprove } from "react-icons/fc"; import 'react-tooltip/dist/react-tooltip.css' import { Tooltip } from 'react-tooltip' - +import Checkbox from '@mui/material/Checkbox'; import Autocomplete from '@mui/material/Autocomplete'; import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; @@ -358,6 +358,7 @@ const Partner_Configuration_Technique = (props) => { { field: 'code', headerName: 'Code', flex: 1, hide: false, editable: false }, { field: 'description', headerName: 'description', flex: 1, hide: false, editable: false }, { field: 'rang', headerName: 'Rang', flex: 1, hide: false, editable: false }, + { field: 'gagne', headerName: 'Gagne', flex: 1, hide: false, editable: false }, { @@ -847,8 +848,7 @@ const Partner_Configuration_Technique = (props) => { var local_code = JSON.parse(x).code; var local_description = JSON.parse(x).description; var local_rang = JSON.parse(x).rang; - - + var local_gagne = JSON.parse(x).gagne; //--- var node = { @@ -858,6 +858,7 @@ const Partner_Configuration_Technique = (props) => { "code": local_code, "description": local_description, "rang": local_rang, + "gagne": local_gagne, }; @@ -872,6 +873,7 @@ const Partner_Configuration_Technique = (props) => { "code": "", "description": "", "rang": "", + "gagne": "", }; new_data2.push(node); @@ -1433,6 +1435,8 @@ const Partner_Configuration_Technique = (props) => { const [p_detail_crm_opport_description, setp_detail_crm_opport_description] = useState(""); const [p_detail_crm_opport_rang, setp_detail_crm_opport_rang] = useState(""); + const [p_detail_crm_opport_gagne, setp_detail_crm_opport_gagne] = useState(false); + const [selected_competence_id, setselected_competence_id] = useState(""); const [p_detail_competence_description, setp_detail_competence_description] = useState(""); @@ -1996,6 +2000,7 @@ const Partner_Configuration_Technique = (props) => { setp_detail_crm_opport_code(""); setp_detail_crm_opport_description(""); setp_detail_crm_opport_rang(""); + setp_detail_crm_opport_gagne(false); setDialog_crm_opport_1_open(false); }; @@ -2022,6 +2027,12 @@ const Partner_Configuration_Technique = (props) => { form.append("description", p_detail_crm_opport_description); form.append("rang", p_detail_crm_opport_rang); + if (p_detail_crm_opport_gagne) + form.append("gagne", "1"); + else + form.append("gagne", "0"); + + } else { // Il s'agit d'une creation myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_CRM_Opportunite_Etape/"; @@ -2029,6 +2040,11 @@ const Partner_Configuration_Technique = (props) => { form.append("description", p_detail_crm_opport_description); form.append("rang", p_detail_crm_opport_rang); + if (p_detail_crm_opport_gagne) + form.append("gagne", "1"); + else + form.append("gagne", "0"); + } setLoading(true); @@ -2650,7 +2666,7 @@ const Partner_Configuration_Technique = (props) => {
Site de rattachement - + {p_detail_code_site && New_Getall_Partner_Site_Formation_result && New_Getall_Partner_Site_Formation_result.length > 0 && { if (value && value._id) { setp_detail_site_rattachement_id(value._id); - }else{ + } else { setp_detail_site_rattachement_id(""); } }} @@ -2906,6 +2922,19 @@ const Partner_Configuration_Technique = (props) => {
+
Gagné
+ { + setp_detail_crm_opport_gagne(e.target.checked); + + }} + + /> +
@@ -3899,6 +3928,7 @@ const Partner_Configuration_Technique = (props) => { code: JSON.parse(item).code, description: JSON.parse(item).description, rang: JSON.parse(item).rang, + gagne: JSON.parse(item).gagne, } ))} @@ -3993,6 +4023,7 @@ const Partner_Configuration_Technique = (props) => { setp_detail_crm_opport_code(""); setp_detail_crm_opport_description(""); setp_detail_crm_opport_rang(""); + setp_detail_crm_opport_gagne(false); setDialog_crm_opport_1_open(true); diff --git a/src/components/UpdatePartnerInfo.js b/src/components/UpdatePartnerInfo.js index 703a7ce..967fc37 100644 --- a/src/components/UpdatePartnerInfo.js +++ b/src/components/UpdatePartnerInfo.js @@ -419,58 +419,81 @@ function UpdateParnterInfo(props) { if (mylocaltraining.link_linkedin) { setp_link_linkedin(mylocaltraining.link_linkedin); - + }else{ + setp_link_linkedin(''); } if (mylocaltraining.link_twitter) { setp_link_twitter(mylocaltraining.link_twitter); + }else{ + setp_link_twitter(''); } if (mylocaltraining.adr_street) { setp_adr_street(mylocaltraining.adr_street); + }else{ + setp_adr_street(''); } if (mylocaltraining.nom) { setp_nom(mylocaltraining.nom); + }else{ + setp_nom(''); } if (mylocaltraining.contact_tel) { setp_contact_tel(mylocaltraining.contact_tel); + }else{ + setp_contact_tel(''); } if (mylocaltraining.contact_nom) { setp_contact_nom(mylocaltraining.contact_nom); + }else{ + setp_contact_nom(''); } if (mylocaltraining.contact_prenom) { setp_contact_prenom(mylocaltraining.contact_prenom); + }else{ + setp_contact_prenom(''); } if (mylocaltraining.contact_mail) { setp_contact_mail(mylocaltraining.contact_mail); + }else{ + setp_contact_mail(''); } + + if (mylocaltraining.lms_virtualhost_url) { setp_lms_virtualhost_url(mylocaltraining.lms_virtualhost_url); + }else{ + setp_lms_virtualhost_url(''); } if (mylocaltraining.lms_username) { setp_lms_username(mylocaltraining.lms_username); + }else{ + setp_lms_username(''); } if (mylocaltraining.mysy_lms_user_id) { setp_mysy_lms_user_id(mylocaltraining.mysy_lms_user_id); + }else{ + setp_mysy_lms_user_id(''); } @@ -538,7 +561,7 @@ function UpdateParnterInfo(props) { 'adr_street', 'nom', 'contact_tel', 'contact_nom', 'contact_prenom', 'contact_mail', 'email', 'website', 'website', - 'isqualiopi', 'iscertifvoltaire',] + 'isqualiopi', 'iscertifvoltaire', ] for (let i = 0; i < list_fields.length; i++) { if (document.getElementsByName(String(list_fields[i])) && document.getElementsByName(String(list_fields[i]))[0]) { @@ -680,6 +703,7 @@ function UpdateParnterInfo(props) { var contact_tel = document.getElementsByName("contact_tel")[0].value; var contact_mail = document.getElementsByName("contact_mail")[0].value; + //var mycertitrace = document.getElementsByName("iscertitrace")[0].value; //var mybureaucertitrace = document.getElementsByName("isbureaucertitrace")[0].value; @@ -729,7 +753,6 @@ function UpdateParnterInfo(props) { formData.append('contact_tel', contact_tel); formData.append('contact_mail', contact_mail); - // Recuperation de l'image logo & de l'image du cachet if (String(userimgclassprofilchanged) === "1") { formData.append('file_logo', isimgclassSelected); @@ -1608,6 +1631,8 @@ function UpdateParnterInfo(props) { const [p_contact_tel, setp_contact_tel] = useState(""); const [p_contact_mail, setp_contact_mail] = useState(""); + + const [p_lms_virtualhost_url, setp_lms_virtualhost_url] = useState(""); const [p_lms_username, setp_lms_username] = useState(""); const [p_mysy_lms_user_id, setp_mysy_lms_user_id] = useState(""); @@ -2419,10 +2444,10 @@ function UpdateParnterInfo(props) { {String(submenu).trim() === "submenu_donnee_catalog_pub" &&

Configuration du Catalog public

- +
-
Lien web (url)
+
Lien web (url)
@@ -2465,7 +2490,7 @@ function UpdateParnterInfo(props) {
-
Thème
+
Thème
{String(catalog_pub_config_edit) === "1" &&
Choisir un exemple de thème :
@@ -2572,9 +2597,9 @@ function UpdateParnterInfo(props) { {String(catalog_pub_config_edit) !== "1" &&
-
+
+ - {selected_catalog_pub_theme_preview &&
} @@ -3601,7 +3626,6 @@ function UpdateParnterInfo(props) { /> - {fields1desabled == false && String(datamodification) === String("1") &&
/!\ Pensez à enregistrer les modifications
}