From 88b405feda8a582fd552c4d6d649daa1e1975f7e Mon Sep 17 00:00:00 2001 From: cherif Date: Tue, 3 Sep 2024 20:53:23 +0200 Subject: [PATCH] sdssd --- package-lock.json | 24 + package.json | 1 + src/App.js | 4 +- .../DisplayPartnerUnite_Enseignement.js | 297 +++++++-- src/components/Employes.js | 3 - src/components/Mon_Tableau_De_Bord.js | 21 +- .../Partner_Domaine_Categorie_Metier.js | 621 ++++++++++++++++-- src/components/Partner_Facture.js | 57 +- src/components/Partner_Invoicing_Data.js | 2 + src/components/TestUrl_new.js | 64 +- 10 files changed, 923 insertions(+), 171 deletions(-) diff --git a/package-lock.json b/package-lock.json index ee4d3f2..67adb9c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -94,6 +94,7 @@ "react-canvas-js": "^1.0.1", "react-comments-section": "^2.0.10", "react-confirm-alert": "^2.8.0", + "react-contextmenu": "^2.14.0", "react-cookie": "^4.1.1", "react-csv": "^2.2.2", "react-custom-share": "^0.4.8", @@ -25294,6 +25295,20 @@ "react-dom": ">=16.0.0" } }, + "node_modules/react-contextmenu": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/react-contextmenu/-/react-contextmenu-2.14.0.tgz", + "integrity": "sha512-ktqMOuad6sCFNJs/ltEwppN8F0YeXmqoZfwycgtZR/MxOXMYx1xgYC44SzWH259HdGyshk1/7sXGuIRwj9hzbw==", + "dependencies": { + "classnames": "^2.2.5", + "object-assign": "^4.1.0" + }, + "peerDependencies": { + "prop-types": "^15.0.0", + "react": "^0.14.0 || ^15.0.0 || ^16.0.1", + "react-dom": "^0.14.0 || ^15.0.0 || ^16.0.1" + } + }, "node_modules/react-cookie": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz", @@ -52789,6 +52804,15 @@ "resolved": "https://registry.npmjs.org/react-confirm-alert/-/react-confirm-alert-2.8.0.tgz", "integrity": "sha512-qvNjJWuWUpTh+q4NecUjCMIWLNDl8IwW6JRIky5pzoiFBXsLWSA2Z1VsaDsQedwgyxEpKnMEJFETkDogBpv/kA==" }, + "react-contextmenu": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/react-contextmenu/-/react-contextmenu-2.14.0.tgz", + "integrity": "sha512-ktqMOuad6sCFNJs/ltEwppN8F0YeXmqoZfwycgtZR/MxOXMYx1xgYC44SzWH259HdGyshk1/7sXGuIRwj9hzbw==", + "requires": { + "classnames": "^2.2.5", + "object-assign": "^4.1.0" + } + }, "react-cookie": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/react-cookie/-/react-cookie-4.1.1.tgz", diff --git a/package.json b/package.json index a7b198a..2f6e8c1 100644 --- a/package.json +++ b/package.json @@ -89,6 +89,7 @@ "react-canvas-js": "^1.0.1", "react-comments-section": "^2.0.10", "react-confirm-alert": "^2.8.0", + "react-contextmenu": "^2.14.0", "react-cookie": "^4.1.1", "react-csv": "^2.2.2", "react-custom-share": "^0.4.8", diff --git a/src/App.js b/src/App.js index 7f24663..78e5f6a 100644 --- a/src/App.js +++ b/src/App.js @@ -124,9 +124,7 @@ function App() { } - } else { - console.log(" passs insite 12223 = "); - } + } }, []); diff --git a/src/components/DisplayPartnerUnite_Enseignement.js b/src/components/DisplayPartnerUnite_Enseignement.js index e26332f..f384d4a 100644 --- a/src/components/DisplayPartnerUnite_Enseignement.js +++ b/src/components/DisplayPartnerUnite_Enseignement.js @@ -140,7 +140,7 @@ const DisplayPartnerUnite_Enseignement = (props) => { function Display_Colunm_text({ value }) { return ( -
+
{value} 
@@ -653,6 +653,12 @@ const DisplayPartnerUnite_Enseignement = (props) => { setp_detail_titre(""); } + if (local_ue.detail_cours) { + setp_detail_detail_cours(local_ue.detail_cours); + } else { + setp_detail_detail_cours({}); + } + if (local_ue.support) { setp_detail_support(local_ue.support); } else { @@ -771,44 +777,16 @@ const DisplayPartnerUnite_Enseignement = (props) => { const [enable_editor, setenable_editor] = useState(0); function desable_detail_fields() { - setue_data_edit_mode("0"); - - if (document.getElementsByName("code_session") && document.getElementsByName("code_session")[0]) { - document.getElementsByName("code_session")[0].disabled = true; - document.getElementsByName("code_session")[0].style.backgroundColor = "#ECEFF1"; - } - - if (document.getElementsByName("titre") && document.getElementsByName("code_session")[0]) { - document.getElementsByName("titre")[0].disabled = true; - document.getElementsByName("titre")[0].style.backgroundColor = "#ECEFF1"; - } - - if (document.getElementsByName("description") && document.getElementsByName("code_session")[0]) { - document.getElementsByName("description")[0].disabled = true; - document.getElementsByName("description")[0].style.backgroundColor = "#ECEFF1"; - } + const list_menu_header_names = ['code_session', 'titre', 'description', 'duree_01', 'unit_duree', 'domaine', + 'bloc',] - if (document.getElementsByName("duree_01") && document.getElementsByName("duree_01")[0]) { - document.getElementsByName("duree_01")[0].disabled = true; - document.getElementsByName("duree_01")[0].style.backgroundColor = "#ECEFF1"; - } - - if (document.getElementsByName("unit_duree") && document.getElementsByName("unit_duree")[0]) { - document.getElementsByName("unit_duree")[0].disabled = true; - document.getElementsByName("unit_duree")[0].style.backgroundColor = "#ECEFF1"; - } - - - if (document.getElementsByName("domaine") && document.getElementsByName("domaine")[0]) { - document.getElementsByName("domaine")[0].disabled = true; - document.getElementsByName("domaine")[0].style.backgroundColor = "#ECEFF1"; - } - - if (document.getElementsByName("bloc") && document.getElementsByName("bloc")[0]) { - document.getElementsByName("bloc")[0].disabled = true; - document.getElementsByName("bloc")[0].style.backgroundColor = "#ECEFF1"; + for (let i = 0; i < list_menu_header_names.length; i++) { + if (document.getElementsByName(String(list_menu_header_names[i])) && document.getElementsByName(String(list_menu_header_names[i]))[0]) { + document.getElementsByName(String(list_menu_header_names[i]))[0].disabled = true; + document.getElementsByName(String(list_menu_header_names[i]))[0].style.backgroundColor = "#ECEFF1"; + } } } @@ -816,40 +794,25 @@ const DisplayPartnerUnite_Enseignement = (props) => { function enable_detail_fields() { setue_data_edit_mode("1"); + const list_menu_header_names = ['code_session', 'titre', 'description', 'duree_01', 'unit_duree', 'domaine', + 'bloc',] - if (document.getElementsByName("code_session") && document.getElementsByName("code_session")[0]) { - document.getElementsByName("code_session")[0].disabled = false; - document.getElementsByName("code_session")[0].style.backgroundColor = "#FFFFFF"; + for (let i = 0; i < list_menu_header_names.length; i++) { + if (document.getElementsByName(String(list_menu_header_names[i])) && document.getElementsByName(String(list_menu_header_names[i]))[0]) { + document.getElementsByName(String(list_menu_header_names[i]))[0].disabled = false; + document.getElementsByName(String(list_menu_header_names[i]))[0].style.backgroundColor = "#FFFFFF"; + } } - if (document.getElementsByName("titre") && document.getElementsByName("code_session")[0]) { - document.getElementsByName("titre")[0].disabled = false; - document.getElementsByName("titre")[0].style.backgroundColor = "#FFFFFF"; - } - - if (document.getElementsByName("description") && document.getElementsByName("code_session")[0]) { - document.getElementsByName("description")[0].disabled = false; - document.getElementsByName("description")[0].style.backgroundColor = "#FFFFFF"; - } - - if (document.getElementsByName("domaine") && document.getElementsByName("domaine")[0]) { - document.getElementsByName("domaine")[0].disabled = false; - document.getElementsByName("domaine")[0].style.backgroundColor = "#FFFFFF"; - } - - if (document.getElementsByName("bloc") && document.getElementsByName("bloc")[0]) { - document.getElementsByName("bloc")[0].disabled = false; - document.getElementsByName("bloc")[0].style.backgroundColor = "#FFFFFF"; - } - - } useEffect(() => { Get_List_Domaines(); + Get_List_Type_Cours(); + Getall_Parter_Unite_Enseignement(); if (document.getElementById('myRef_head')) { @@ -1049,6 +1012,9 @@ const DisplayPartnerUnite_Enseignement = (props) => { } const [p_detail_code, setp_detail_code] = useState(""); + const [p_detail_detail_cours, setp_detail_detail_cours] = useState(""); + + const [p_detail_titre, setp_detail_titre] = useState(""); const [p_detail_bloc, setp_detail_bloc] = useState(""); @@ -1059,6 +1025,9 @@ const DisplayPartnerUnite_Enseignement = (props) => { const [p_detail_duration, setp_detail_duration] = useState(""); const [p_detail_duration_unite, setp_detail_duration_unite] = useState(""); + const [p_detail_ects, setp_detail_ects] = useState(""); + const [p_detail_seuil_validation, setp_detail_seuil_validation] = useState(""); + const editorRef_description = useRef(null); const [editorRef_description_limite, seteditorRef_description_limite] = useState(5000); @@ -1235,6 +1204,90 @@ const DisplayPartnerUnite_Enseignement = (props) => { }); } + + const [New_Get_List_Type_Cours_result, setNew_Get_List_Type_Cours_result] = useState([]); + + const [Get_List_Type_Cours_api, setGet_List_Type_Cours_api] = useState(); + const [Get_List_Type_Cours_message, setGet_List_Type_Cours_message] = useState(); + const [Get_List_Type_Cours_result, setGet_List_Type_Cours_result] = useState(); + function Get_List_Type_Cours() { + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Type_Cours/"; + + fetch(myurl, + { + method: 'POST', + body: form, + }) + .then((data) => data.json()) + .then((data) => { + //console.log(' IN Get_List_Type_Cours Success:', data['message'], "data['status'] = ", data['status']); + + if (String(data['status']) === String("true")) { + setGet_List_Type_Cours_api("true"); + setGet_List_Type_Cours_result(data['message']); + + var new_data2 = []; + const new_data = data['message'].map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_code = JSON.parse(x).code; + var local_nom = JSON.parse(x).nom; + var local_description = JSON.parse(x).description; + + + //--- + var node = { + "id": localid, + "_id": local_id, + "nom": local_nom, + "code": local_code, + "label": local_nom, + "description": local_description, + + + }; + new_data2.push(node); + }); + + var node = { + "id": "", + "_id": "", + "nom": "", + "code": "", + "label": "", + "description": "", + + + }; + new_data2.push(node); + + if (new_data2.length > 0) { + setNew_Get_List_Type_Cours_result(new_data2); + + // console.log(" ## new_data2 = ", new_data2); + // console.log(" ## New_Get_List_Type_Cours_result = ", New_Get_List_Type_Cours_result); + } else { + setNew_Get_List_Type_Cours_result([]) + } + } + else { + setGet_List_Type_Cours_api("false"); + setGet_List_Type_Cours_message(data['message']); + } + + }).catch((error) => { + console.error('Error Get_List_Type_Cours :', error); + setGet_List_Type_Cours_api("false"); + }); + } + async function submenu_detail() { setsubmenu("detail_ue"); submenu_color_management("detail_ue"); @@ -2252,8 +2305,8 @@ const DisplayPartnerUnite_Enseignement = (props) => { {
} + {ue_data_edit_mode && String(ue_data_edit_mode) !== "1" &&
+
ECTS
+ +
+ +
} + + {ue_data_edit_mode && String(ue_data_edit_mode) !== "1" &&
+
Seuil Validation
+ +
+ +
} + + {ue_data_edit_mode && String(ue_data_edit_mode) !== "1" &&
Type de Cours :
+ + {ue_data_edit_mode && String(ue_data_edit_mode) !== "1" && + New_Get_List_Type_Cours_result && New_Get_List_Type_Cours_result.length > 0 && + New_Get_List_Type_Cours_result.map((type_cours) => ( + + ))} + +
} + {ue_data_edit_mode && String(ue_data_edit_mode) !== "1" &&
Durée
{ //disabled={true} className="disabled_style" value={p_detail_duration_unite} - - />
} + {ue_data_edit_mode && String(ue_data_edit_mode) === "1" &&
+
ECTS
+ { + setp_detail_ects(e.target.value); + } + } + + /> +
+ +
} + + {ue_data_edit_mode && String(ue_data_edit_mode) === "1" &&
+
Seuil Validation
+ { + setp_detail_seuil_validation(e.target.value); + } + } + + + /> +
+ +
} + + + {ue_data_edit_mode && String(ue_data_edit_mode) === "1" &&
Durée
@@ -2353,6 +2514,8 @@ const DisplayPartnerUnite_Enseignement = (props) => {
} + + {ue_data_edit_mode && String(ue_data_edit_mode) === "1" &&
@@ -2568,8 +2731,6 @@ const DisplayPartnerUnite_Enseignement = (props) => {
- - } diff --git a/src/components/Employes.js b/src/components/Employes.js index 7cc430d..0d15611 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -398,9 +398,6 @@ const Employes = (props) => { - - - ); } }, diff --git a/src/components/Mon_Tableau_De_Bord.js b/src/components/Mon_Tableau_De_Bord.js index 79ac4ec..ef923d5 100644 --- a/src/components/Mon_Tableau_De_Bord.js +++ b/src/components/Mon_Tableau_De_Bord.js @@ -53,6 +53,10 @@ import { import { tokens } from "../theme"; import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; + +import { FcPrint } from "react-icons/fc"; + + const Mon_Tableau_De_Bord = (props) => { const theme = useTheme(); @@ -2446,11 +2450,20 @@ const Mon_Tableau_De_Bord = (props) => {
-
{ - Export_BPF_PDF(); +
- }}> - + + + +
} diff --git a/src/components/Partner_Domaine_Categorie_Metier.js b/src/components/Partner_Domaine_Categorie_Metier.js index 6d2d13c..ccb7fe9 100644 --- a/src/components/Partner_Domaine_Categorie_Metier.js +++ b/src/components/Partner_Domaine_Categorie_Metier.js @@ -42,7 +42,7 @@ import ToggleSwitch from "./ToggleSwitch"; import Link from '@mui/material/Link'; import { PiDotsThree } from "react-icons/pi"; -const Partner_Domaine_Categorie_Metier = (props) => { +const Partner_domaine_Categorie_Metier = (props) => { const history = useHistory(); const [submenu, setsubmenu] = useState("technique"); @@ -99,7 +99,7 @@ const Partner_Domaine_Categorie_Metier = (props) => { { field: 'description', headerName: 'Description', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, - {/* + { field: "delete", headerName: 'Supprimer', renderCell: (cellValues) => { return ( @@ -129,7 +129,7 @@ const Partner_Domaine_Categorie_Metier = (props) => {
@@ -154,7 +154,7 @@ const Partner_Domaine_Categorie_Metier = (props) => { ); } - */} + } ] @@ -401,6 +401,57 @@ const Partner_Domaine_Categorie_Metier = (props) => { }) } + const [handleClick_delete_domaine_api, sethandleClick_delete_domaine_api] = useState(); + const [handleClick_delete_domaine_message, sethandleClick_delete_domaine_message] = useState(); + const [handleClick_delete_domaine_result, sethandleClick_delete_domaine_result] = useState(); + function handleClick_delete_domaine(event, cellValues) { + + var type_client_id = cellValues.row._id; + + var form = new FormData(); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("_id", type_client_id); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Class_domaine/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In handleClick_delete_domaine res.data.status = " + res.data.status); + //console.log(" In handleClick_delete_domaine res.data.message r_class = " + res.data.message); + sethandleClick_delete_domaine_api("true"); + sethandleClick_delete_domaine_result(res.data.message); + + setdomaine_data_edit_mode(""); + setdomaine_data_changed(""); + setdisplay_detail_domaine(""); + + + Getall_Partner_Class_Domaine(); + alert(res.data.message); + + } + else { + sethandleClick_delete_domaine_api("false"); + sethandleClick_delete_domaine_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( handleClick_delete_domaine = ', error); + sethandleClick_delete_domaine_api("false"); + alert(" Impossible de supprimer la catégorie"); + //setmyApimyApiMessage("") + }) + } + + const [gridline_domaine_id, setgridline_domaine_id] = useState(""); const [gridline_categorie_id, setgridline_categorie_id] = useState(""); @@ -504,11 +555,11 @@ const Partner_Domaine_Categorie_Metier = (props) => { const myRef = useRef(null) - const [New_Getall_Partner_Class_Domaine_result, setNew_Getall_Partner_Class_Domaine_result] = useState([]); + const [New_Getall_Partner_Class_domaine_result, setNew_Getall_Partner_Class_domaine_result] = useState([]); - const [Getall_Partner_Class_Domaine_api, setGetall_Partner_Class_Domaine_api] = useState(); - const [Getall_Partner_Class_Domaine_message, setGetall_Partner_Class_Domaine_message] = useState(); - const [Getall_Partner_Class_Domaine_result, setGetall_Partner_Class_Domaine_result] = useState([]); + const [Getall_Partner_Class_domaine_api, setGetall_Partner_Class_domaine_api] = useState(); + const [Getall_Partner_Class_domaine_message, setGetall_Partner_Class_domaine_message] = useState(); + const [Getall_Partner_Class_domaine_result, setGetall_Partner_Class_domaine_result] = useState([]); function Getall_Partner_Class_Domaine(event) { var form = new FormData(); @@ -525,8 +576,8 @@ const Partner_Domaine_Categorie_Metier = (props) => { if (String(res.data.status) === String("true")) { //console.log(" In Getall_Partner_Class_Domaine res.data.status = " + res.data.status); //console.log(" In Getall_Partner_Class_Domaine res.data.message r_class = " + res.data.message); - setGetall_Partner_Class_Domaine_api("true"); - setGetall_Partner_Class_Domaine_result(res.data.message); + setGetall_Partner_Class_domaine_api("true"); + setGetall_Partner_Class_domaine_result(res.data.message); var new_data2 = []; const new_data = res.data.message.map((x) => { @@ -568,20 +619,20 @@ const Partner_Domaine_Categorie_Metier = (props) => { if (new_data2.length > 0) - setNew_Getall_Partner_Class_Domaine_result(new_data2); + setNew_Getall_Partner_Class_domaine_result(new_data2); } else { - setGetall_Partner_Class_Domaine_api("false"); - setGetall_Partner_Class_Domaine_message(res.data.message); + setGetall_Partner_Class_domaine_api("false"); + setGetall_Partner_Class_domaine_message(res.data.message); alert(res.data.message); } }).catch((error) => { setLoading(false); console.warn('Not good man :( Getall_Partner_Class_Domaine = ', error); - setGetall_Partner_Class_Domaine_api("false"); + setGetall_Partner_Class_domaine_api("false"); alert(" Impossible de recuperer la liste des domaines de formation "); //setmyApimyApiMessage("") }) @@ -931,7 +982,7 @@ const Partner_Domaine_Categorie_Metier = (props) => { } - + async function Disable_Metier_DetailFields() { @@ -999,6 +1050,124 @@ const Partner_Domaine_Categorie_Metier = (props) => { } + async function Disable_domaine_DetailFields() { + await sleep(10); + setdomaine_data_edit_mode("0"); + + if (document.getElementsByName("detail_domaine_code") && document.getElementsByName("detail_domaine_code")[0]) { + document.getElementsByName("detail_domaine_code")[0].disabled = true; + document.getElementsByName("detail_domaine_code")[0].style.backgroundColor = "#ECEFF1"; + + } + + if (document.getElementsByName("detail_domaine_nom") && document.getElementsByName("detail_domaine_nom")[0]) { + document.getElementsByName("detail_domaine_nom")[0].disabled = true; + document.getElementsByName("detail_domaine_nom")[0].style.backgroundColor = "#ECEFF1"; + + } + + if (document.getElementsByName("detail_domaine_description") && document.getElementsByName("detail_domaine_description")[0]) { + document.getElementsByName("detail_domaine_description")[0].disabled = true; + document.getElementsByName("detail_domaine_description")[0].style.backgroundColor = "#ECEFF1"; + } + + + } + + function Enable_domaine_DetailFields() { + setdomaine_data_edit_mode("1") + + if (document.getElementsByName("detail_domaine_code")[0] && document.getElementsByName("detail_domaine_code")[0]) { + document.getElementsByName("detail_domaine_code")[0].disabled = false; + document.getElementsByName("detail_domaine_code")[0].style.backgroundColor = "#FFFFFF"; + } + + if (document.getElementsByName("detail_domaine_nom")[0] && document.getElementsByName("detail_domaine_nom")[0]) { + document.getElementsByName("detail_domaine_nom")[0].disabled = false; + document.getElementsByName("detail_domaine_nom")[0].style.backgroundColor = "#FFFFFF"; + } + + if (document.getElementsByName("detail_domaine_description")[0] && document.getElementsByName("detail_domaine_description")[0]) { + document.getElementsByName("detail_domaine_description")[0].disabled = false; + document.getElementsByName("detail_domaine_description")[0].style.backgroundColor = "#FFFFFF"; + } + + + } + + + function clear_domaine_DetailFields() { + setp_detail_domaine_id(""); + setp_detail_domaine_code(""); + setp_detail_domaine_nom(""); + setp_detail_domaine_description(""); + setp_detail_domaine_class_domaine_id(""); + + setselected_domaine_id(""); + setgridline_domaine_id(""); + + } + + function Annule_domaine_DetailFields() { + var line = JSON.parse(Getall_Partner_Class_domaine_result[gridline_domaine_id]); + + setselected_domaine_id(line._id); + + setp_detail_domaine_id(line._id); + setp_detail_domaine_code(line.code); + setp_detail_domaine_nom(line.nom); + setp_detail_domaine_description(line.description); + + + setdisplay_detail_domaine(""); + setdisplay_detail_metier(""); + setdisplay_detail_domaine("1"); + + + + if (document.getElementById('myRef')) { + var divh = document.getElementById('myRef').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + + Disable_domaine_DetailFields(); + } + + + + function handleClick_edit_domaine_From_Line(selected_row_id) { + + var line = JSON.parse(Getall_Partner_Class_domaine_result[selected_row_id]); + + setselected_domaine_id(line._id); + + setp_detail_domaine_id(line._id); + setp_detail_domaine_code(line.code); + setp_detail_domaine_nom(line.nom); + setp_detail_domaine_description(line.description); + setp_detail_domaine_class_domaine_id(line.class_domaine_id); + + setdisplay_detail_domaine(""); + setdisplay_detail_metier(""); + setdisplay_detail_domaine("1"); + + Disable_domaine_DetailFields(); + + if (document.getElementById('myRef')) { + var divh = document.getElementById('myRef').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + + } + + + useEffect(() => { Getall_Partner_Class_Domaine(); @@ -1279,6 +1448,136 @@ const Partner_Domaine_Categorie_Metier = (props) => { }) } + + const [Update_domaine_Data_api, setUpdate_domaine_Data_api] = useState(); + const [Update_domaine_Data_message, setUpdate_domaine_Data_message] = useState(); + const [Update_domaine_Data_result, setUpdate_domaine_Data_result] = useState(); + function Update_domaine_Data() { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("_id", p_detail_domaine_id); + form.append("code", p_detail_domaine_code); + form.append("nom", p_detail_domaine_nom); + form.append("description", p_detail_domaine_description); + + //console.log(" form ttt == ", form); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Class_domaine/"; + setLoading(true); + + axios.post(myurl, form).then(res => { + setLoading(false); + //console.log(" In Update_domaine_Data res.data.status = " + res.data.status); + //console.log(" In Update_domaine_Data res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + + setUpdate_domaine_Data_api("true"); + setUpdate_domaine_Data_result(res.data.message); + + Getall_Partner_Class_Domaine(); + clear_domaine_DetailFields(); + + setdisplay_detail_domaine(""); + setcategorie_data_edit_mode(""); + setcategorie_data_changed(""); + + alert(res.data.message); + if (document.getElementById('myRef_head')) { + var divh = document.getElementById('myRef_head').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + + } + else { + setUpdate_domaine_Data_api("false"); + setUpdate_domaine_Data_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('UpdateStagiaireData : Not good man :( Update_domaine_Data = ' + error); + setUpdate_domaine_Data_api("false"); + alert(" Impossible de mettre à jour le métier "); + + }) + } + + const [Add_domaine_Data_api, setAdd_domaine_Data_api] = useState(); + const [Add_domaine_Data_message, setAdd_domaine_Data_message] = useState(); + const [Add_domaine_Data_result, setAdd_domaine_Data_result] = useState(); + function Add_domaine_Data() { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("code", p_detail_domaine_code); + form.append("nom", p_detail_domaine_nom); + form.append("description", p_detail_domaine_description); + //form.append("class_domaine_id", p_detail_domaine_class_domaine_id); + + + //console.log(" form == ", form); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Class_Domaine/"; + setLoading(true); + + axios.post(myurl, form).then(res => { + setLoading(false); + //console.log(" In Add_domaine_Data res.data.status = " + res.data.status); + //console.log(" In Add_domaine_Data res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + + + + setAdd_domaine_Data_api("true"); + setAdd_domaine_Data_result(res.data.message); + + Getall_Partner_Class_Domaine(); + clear_domaine_DetailFields(); + + setdisplay_detail_domaine(""); + setcategorie_data_edit_mode(""); + setcategorie_data_changed(""); + + Dialog_domaine_1_handleClose_buton(); + + alert(res.data.message); + if (document.getElementById('myRef_head')) { + var divh = document.getElementById('myRef_head').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + + } + else { + setAdd_domaine_Data_api("false"); + setAdd_domaine_Data_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('UpdateStagiaireData : Not good man :( Add_domaine_Data = ' + error); + setAdd_domaine_Data_api("false"); + alert(" Impossible d'ajouter le métier "); + + }) + } + + const [Dialog_Categorie_1_message, setDialog_Categorie_1_message] = React.useState(false); const [Dialog_Categorie_1_open, setDialog_Categorie_1_open] = React.useState(false); @@ -1316,6 +1615,26 @@ const Partner_Domaine_Categorie_Metier = (props) => { }; + const [p_detail_domaine_class_domaine_id, setp_detail_domaine_class_domaine_id] = useState(""); + + const [Dialog_domaine_1_message, setDialog_domaine_1_message] = React.useState(false); + const [Dialog_domaine_1_open, setDialog_domaine_1_open] = React.useState(false); + + function Dialog_1_handle_change_Domaine(message) { + setDialog_domaine_1_message(message); + setDialog_domaine_1_open(true); + } + + const Dialog_domaine_1_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_domaine_1_handleClose_buton = () => { + clear_domaine_DetailFields(); + setDialog_domaine_1_open(false); + }; + return (
@@ -1324,6 +1643,101 @@ const Partner_Domaine_Categorie_Metier = (props) => {
} + {/***Domaine */} + + + Domaine de Formation + + + {Dialog_domaine_1_message} + + + +
Code + { + setp_detail_domaine_code(e.target.value); + } + } + /> + +
+ + +
Nom + { + setp_detail_domaine_nom(e.target.value); + } + } + /> + +
+ +
Description + { + setp_detail_domaine_description(e.target.value); + } + } + /> + +
+ + + +
+ + + +
+
+ + {String(selected_domaine_id).trim().length > 2 && } + {String(selected_domaine_id).trim() === "" && } +
+ +
+ +
+
+ +
+ +
+ + {/*** FinDomaine */} + {/***Categorie */} { {Dialog_Categorie_1_message} - {New_Getall_Partner_Class_Domaine_result && New_Getall_Partner_Class_Domaine_result.length > 0 &&
Domaine Formation + {New_Getall_Partner_Class_domaine_result && New_Getall_Partner_Class_domaine_result.length > 0 &&
Domaine Formation (data)._id === String(p_detail_categorie_class_domaine_id))[0].label} - options={New_Getall_Partner_Class_Domaine_result} + value={New_Getall_Partner_Class_domaine_result.filter((data) => (data)._id === String(p_detail_categorie_class_domaine_id))[0].label} + options={New_Getall_Partner_Class_domaine_result} onChange={(event, value) => { @@ -1466,15 +1880,15 @@ const Partner_Domaine_Categorie_Metier = (props) => { {Dialog_Metier_1_message} - {New_Getall_Partner_Class_Domaine_result && New_Getall_Partner_Class_Domaine_result.length > 0 &&
Domaine Formation + {New_Getall_Partner_Class_domaine_result && New_Getall_Partner_Class_domaine_result.length > 0 &&
Domaine Formation (data)._id === String(p_detail_metier_class_domaine_id))[0].label} - options={New_Getall_Partner_Class_Domaine_result} + value={New_Getall_Partner_Class_domaine_result.filter((data) => (data)._id === String(p_detail_metier_class_domaine_id))[0].label} + options={New_Getall_Partner_Class_domaine_result} onChange={(event, value) => { @@ -1581,7 +1995,6 @@ const Partner_Domaine_Categorie_Metier = (props) => { -
@@ -1643,7 +2056,7 @@ const Partner_Domaine_Categorie_Metier = (props) => { selectionModel={selectionModel_domaine} disableSelectionOnClick localeText={frFR.components.MuiDataGrid.defaultProps.localeText} - rows={Getall_Partner_Class_Domaine_result.map((item, index) => ( + rows={Getall_Partner_Class_domaine_result.map((item, index) => ( { id: index, _id: JSON.parse(item)._id, @@ -1661,8 +2074,8 @@ const Partner_Domaine_Categorie_Metier = (props) => { onRowDoubleClick={(newSelectionModel) => { setgridline_domaine_id(newSelectionModel.row.id); + handleClick_edit_domaine_From_Line(newSelectionModel.row.id); - // handleClick_edit_config_From_Line(newSelectionModel.row.id); }} @@ -1705,51 +2118,81 @@ const Partner_Domaine_Categorie_Metier = (props) => {
+
+
+ +
+ +
 
- {New_Getall_Partner_Class_Domaine_result && display_detail_domaine && String(display_detail_domaine) === "1" &&
+ {String(display_detail_domaine) === "1" &&
+ + {domaine_data_edit_mode && String(domaine_data_edit_mode) !== "1" && +
Code
+ + + +
} + + {domaine_data_edit_mode && String(domaine_data_edit_mode) === "1" &&
Code
- (data)._id === String(p_detail_domaine_id))[0].label} - options={New_Getall_Partner_Class_Domaine_result} - onChange={(event, value) => { - - if (value && value.value && value.value === "signature_digital") { - alert(" Vos droits d'accès ne vous permettent pas modifier la configuration : 'signature_digital'"); - return; - } - if (value && value._id) { - setp_detail_domaine_id(value._id); - setdomaine_data_changed("1"); - } else { - setp_detail_domaine_id(""); - setdomaine_data_changed("1"); - } + InputLabelProps={{ + shrink: true, }} + disabled={false} + className="disabled_style" + value={p_detail_domaine_code} - renderInput={(params) => + onChange={(e) => { + setp_detail_domaine_code(e.target.value); + setdomaine_data_changed("1"); } + } + /> - - -
} + + {String(domaine_data_edit_mode) !== "1" &&
Nom
{ disabled={false} className="disabled_style" value={p_detail_domaine_nom} - - />
} - {String(domaine_data_edit_mode) === "1" &&
Nom
+ {String(domaine_data_edit_mode) === "1" && +
Nom
+ { + setp_detail_domaine_nom(e.target.value); + setdomaine_data_changed("1"); + } + } + /> +
} + + {String(domaine_data_edit_mode) !== "1" && +
Description
+ +
} + + {String(domaine_data_edit_mode) === "1" &&
Description
{ - - setp_detail_domaine_nom(e.target.value); + setp_detail_domaine_description(e.target.value); setdomaine_data_changed("1"); - } } />
} -
  @@ -1807,13 +2286,13 @@ const Partner_Domaine_Categorie_Metier = (props) => { {String(domaine_data_edit_mode) === "1" && String(domaine_data_changed) === "1" &&
-
} {String(domaine_data_edit_mode) === "1" &&
-
}
@@ -1821,7 +2300,7 @@ const Partner_Domaine_Categorie_Metier = (props) => { {String(domaine_data_edit_mode) !== "1" &&
-
} @@ -1988,8 +2467,8 @@ const Partner_Domaine_Categorie_Metier = (props) => { name="detail_categorie_domaine" id="detail_categorie_domaine" className="disabled_style" - value={New_Getall_Partner_Class_Domaine_result.filter((data) => (data)._id === String(p_detail_categorie_class_domaine_id))[0].label} - options={New_Getall_Partner_Class_Domaine_result} + value={New_Getall_Partner_Class_domaine_result.filter((data) => (data)._id === String(p_detail_categorie_class_domaine_id))[0].label} + options={New_Getall_Partner_Class_domaine_result} onChange={(event, value) => { @@ -2027,7 +2506,7 @@ const Partner_Domaine_Categorie_Metier = (props) => { disabled={false} className="disabled_style" - value={New_Getall_Partner_Class_Domaine_result.filter((data) => (data)._id === String(p_detail_categorie_class_domaine_id))[0].label} + value={New_Getall_Partner_Class_domaine_result.filter((data) => (data)._id === String(p_detail_categorie_class_domaine_id))[0].label} />
} @@ -2342,7 +2821,7 @@ const Partner_Domaine_Categorie_Metier = (props) => {
 
- + {New_Getall_Partner_Class_Metier_result && display_detail_metier && String(display_detail_metier) === "1" &&
@@ -2354,8 +2833,8 @@ const Partner_Domaine_Categorie_Metier = (props) => { name="detail_metier_domaine" id="detail_metier_domaine" className="disabled_style" - value={New_Getall_Partner_Class_Domaine_result.filter((data) => (data)._id === String(p_detail_metier_class_domaine_id))[0].label} - options={New_Getall_Partner_Class_Domaine_result} + value={New_Getall_Partner_Class_domaine_result.filter((data) => (data)._id === String(p_detail_metier_class_domaine_id))[0].label} + options={New_Getall_Partner_Class_domaine_result} onChange={(event, value) => { @@ -2393,7 +2872,7 @@ const Partner_Domaine_Categorie_Metier = (props) => { disabled={false} className="disabled_style" - value={New_Getall_Partner_Class_Domaine_result.filter((data) => (data)._id === String(p_detail_metier_class_domaine_id))[0].label} + value={New_Getall_Partner_Class_domaine_result.filter((data) => (data)._id === String(p_detail_metier_class_domaine_id))[0].label} />
} @@ -2569,4 +3048,4 @@ const Partner_Domaine_Categorie_Metier = (props) => { } -export default Partner_Domaine_Categorie_Metier; \ No newline at end of file +export default Partner_domaine_Categorie_Metier; \ No newline at end of file diff --git a/src/components/Partner_Facture.js b/src/components/Partner_Facture.js index 7d30251..fbeed5d 100644 --- a/src/components/Partner_Facture.js +++ b/src/components/Partner_Facture.js @@ -55,6 +55,8 @@ import { } from '@mui/x-data-grid'; //import { utils, writeFileXLSX } from "xlsx"; +import { ContextMenu, ContextMenuTrigger } from "react-contextmenu"; +import zIndex from "@material-ui/core/styles/zIndex"; const Partner_Facture = (props) => { @@ -1021,7 +1023,7 @@ const Partner_Facture = (props) => { var line = JSON.parse(rowss[selected_row_id]); - console.log("### line = ", line); + //console.log("### line = ", line); var invoice_id = line._id; setselected_id(invoice_id); @@ -2395,6 +2397,10 @@ const Partner_Facture = (props) => { ] + function handleClick_menu_droite_facture(e) { + console.log(" III "); + } + return (
@@ -2809,6 +2815,22 @@ const Partner_Facture = (props) => { {/*** Fin annotation */} + {/******* Menu droire 'Client_Facturé' */} + + + ContextMenu Item 1 + + + ContextMenu Item 2 + + + + ContextMenu Item 3 + + + + {/******* Fin Menu droire 'Client_Facturé' */} +

Vos Factures

Utilisez les filtres !
@@ -3376,24 +3398,25 @@ const Partner_Facture = (props) => { -
Nom Client
- Nom Client aa
+ + + InputLabelProps={{ + shrink: true, + }} + disabled={false} + className="disabled_style" + value={p_detail_header_client_nom} + > +
+
Email Client
{ {String(header_submenu) !== "paiement" &&
- +
  ({ paper: { overflowY: 'unset', @@ -295,14 +298,14 @@ const TestUrl_New = (props) => { const [tab_label, settab_label] = useState([]); - function Get_Local_Label(){ + function Get_Local_Label() { var new_data2 = []; var node1 = { - "_id": "@text1", + "_id": "@text1", "label": "text1_label", }; - + var node2 = { "_id": "@text2", "label": "text2_label", @@ -676,6 +679,10 @@ const TestUrl_New = (props) => { setOpen1(false); }; + function handleClick(e) { + console.log(" CKILLLLL "); + } + return (
@@ -815,7 +822,54 @@ const TestUrl_New = (props) => {
- + + ZZZZ +
+ {/* NOTICE: id must be unique between EVERY and pair */} + {/* NOTICE: inside the pair, and must have the same id */} + + +
Click Droite Menu
+ TTTTTTTTTTTTTTTTtt + +
+ + + + ContextMenu Item 1 + + + ContextMenu Item 2 + + + + ContextMenu Item 3 + + + +
+ + + {/*
+ + + +
+ } + > +
+ Right click me to see the context menu +
+ +
*/} +

Module attestation

@@ -830,7 +884,7 @@ const TestUrl_New = (props) => {
- +
liste des events =