From fbb2896a065b6e9116258fdeda6be94ce0c9f8ac Mon Sep 17 00:00:00 2001 From: cherif Date: Tue, 9 Apr 2024 23:51:21 +0200 Subject: [PATCH] 09/04/2024 - 23h50 --- src/components/DisplayPartnerSession.js | 979 +++++++++++++----- .../Module_Evaluation_Positionnement.js | 1 + 2 files changed, 706 insertions(+), 274 deletions(-) diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index fd77c94..d8b0640 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -865,55 +865,44 @@ const DisplayPartnerSession = (props) => { const columns_list_evaluation = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, - { field: 'email', headerName: 'email', miniWidth: 300, flex: 1, hideable: true, resizable: true, renderCell: (params) => }, - { field: 'nom', headerName: 'nom', miniWidth: 200, hide: false, flex: 1, editable: true, renderCell: (params) => }, - { field: 'prenom', headerName: 'prenom', miniWidth: 200, hide: false, flex: 1, editable: false, renderCell: (params) => }, + { field: 'form_code', headerName: 'Form. Code', hide: true, minwidth: 200, flex: 1, hideable: true, resizable: true, renderCell: (params) => , }, + { field: 'email', headerName: 'email', minwidth: 300, flex: 1, hideable: true, resizable: true, renderCell: (params) => , }, + { field: 'nom', headerName: 'nom', minwidth: 300, flex: 1, hide: false, editable: true, renderCell: (params) => , }, + { field: 'prenom', headerName: 'prenom', minwidth: 300, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { - field: 'eval_status', headerName: 'Statut', width: 100, editable: false, flex: true, + field: 'status', headerName: 'Statut', width: 100, editable: false, flex: true, valueFormatter: (params) => { if (String(params.value) === "0") - return "Envoyé"; + return "Init."; else if (String(params.value) === "1") - return "Evalué"; + return "Env."; + else if (String(params.value) === "2") + return "Rép."; else - return "A envoyer"; + return " ?"; + }, + }, + + { + field: 'date_envoie', headerName: 'Date Envoi', width: 150, editable: false, + valueFormatter: (params) => { + if (params.value) + return String(params.value).substring(0, 16) + else + return "" + }, }, { - field: 'date_demande_eval', headerName: 'Date demande', width: 150, editable: false, + field: 'date_reponse', headerName: 'Date Réponse', width: 150, editable: false, valueFormatter: (params) => { - return String(params.value).substring(0, 16) + if (params.value) + return String(params.value).substring(0, 16) + else + return "" }, }, - { field: 'eval_eval', headerName: 'Evaluation', width: 100, editable: false, flex: true, renderCell: (params) => }, - { field: 'eval_note', headerName: 'Note', width: 100, editable: false, }, - { field: 'eval_pedagogie', headerName: 'Pédagogie', width: 100, editable: false, }, - { - field: 'eval_date', headerName: 'Date evalution', width: 100, editable: false, - valueFormatter: (params) => { - return String(params.value).substring(0, 16) - - }, - }, - {/* - field: "valide", headerName: 'Valider', - renderCell: (cellValues) => { - return ( - - - - ); - } - */}, ] @@ -2182,74 +2171,74 @@ const DisplayPartnerSession = (props) => { async function submenu_emargement() { setsubmenu("emargement"); submenu_color_management("emargement"); - - /* //await sleep(5); - if (!edit_session_form) { - desableSessionFields(); - } - if (document.getElementById("emargement")) { - document.getElementById("emargement").style.backgroundColor = "#104277"; - document.getElementById("emargement").style.color = "white"; - document.getElementById("emargement").style.fontWeight = "bold"; - } - - if (document.getElementById("editique")) { - document.getElementById("editique").style.backgroundColor = "#d8edfc"; - document.getElementById("editique").style.color = "black"; - document.getElementById("editique").style.fontWeight = "normal"; - } - - if (document.getElementById("evaluation")) { - document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; - document.getElementById("evaluation").style.color = "black"; - document.getElementById("evaluation").style.fontWeight = "normal"; - } - - if (document.getElementById("sequence_session")) { - document.getElementById("sequence_session").style.backgroundColor = "#d8edfc"; - document.getElementById("sequence_session").style.color = "black"; - document.getElementById("sequence_session").style.fontWeight = "normal"; - } - - - if (document.getElementById("detail_session")) { - document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; - document.getElementById("detail_session").style.color = "black"; - document.getElementById("detail_session").style.fontWeight = "normal"; - } - - if (document.getElementById("inscrit")) { - document.getElementById("inscrit").style.backgroundColor = "#d8edfc"; - document.getElementById("inscrit").style.color = "black"; - document.getElementById("inscrit").style.fontWeight = "normal"; - } - - if (document.getElementById("preinscrit")) { - document.getElementById("preinscrit").style.backgroundColor = "#d8edfc"; - document.getElementById("preinscrit").style.color = "black"; - document.getElementById("preinscrit").style.fontWeight = "normal"; - } - - - if (document.getElementById("historique")) { - document.getElementById("historique").style.backgroundColor = "#d8edfc"; - document.getElementById("historique").style.color = "black"; - document.getElementById("historique").style.fontWeight = "normal"; - } - - if (document.getElementById("attestation")) { - document.getElementById("attestation").style.backgroundColor = "#d8edfc"; - document.getElementById("attestation").style.color = "black"; - document.getElementById("attestation").style.fontWeight = "normal"; - } - - if (document.getElementById("piece_jointe")) { - document.getElementById("piece_jointe").style.backgroundColor = "#d8edfc"; - document.getElementById("piece_jointe").style.color = "black"; - document.getElementById("piece_jointe").style.fontWeight = "normal"; - } - */ + /* //await sleep(5); + if (!edit_session_form) { + desableSessionFields(); + } + + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#104277"; + document.getElementById("emargement").style.color = "white"; + document.getElementById("emargement").style.fontWeight = "bold"; + } + + if (document.getElementById("editique")) { + document.getElementById("editique").style.backgroundColor = "#d8edfc"; + document.getElementById("editique").style.color = "black"; + document.getElementById("editique").style.fontWeight = "normal"; + } + + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + document.getElementById("evaluation").style.fontWeight = "normal"; + } + + if (document.getElementById("sequence_session")) { + document.getElementById("sequence_session").style.backgroundColor = "#d8edfc"; + document.getElementById("sequence_session").style.color = "black"; + document.getElementById("sequence_session").style.fontWeight = "normal"; + } + + + if (document.getElementById("detail_session")) { + document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; + document.getElementById("detail_session").style.color = "black"; + document.getElementById("detail_session").style.fontWeight = "normal"; + } + + if (document.getElementById("inscrit")) { + document.getElementById("inscrit").style.backgroundColor = "#d8edfc"; + document.getElementById("inscrit").style.color = "black"; + document.getElementById("inscrit").style.fontWeight = "normal"; + } + + if (document.getElementById("preinscrit")) { + document.getElementById("preinscrit").style.backgroundColor = "#d8edfc"; + document.getElementById("preinscrit").style.color = "black"; + document.getElementById("preinscrit").style.fontWeight = "normal"; + } + + + if (document.getElementById("historique")) { + document.getElementById("historique").style.backgroundColor = "#d8edfc"; + document.getElementById("historique").style.color = "black"; + document.getElementById("historique").style.fontWeight = "normal"; + } + + if (document.getElementById("attestation")) { + document.getElementById("attestation").style.backgroundColor = "#d8edfc"; + document.getElementById("attestation").style.color = "black"; + document.getElementById("attestation").style.fontWeight = "normal"; + } + + if (document.getElementById("piece_jointe")) { + document.getElementById("piece_jointe").style.backgroundColor = "#d8edfc"; + document.getElementById("piece_jointe").style.color = "black"; + document.getElementById("piece_jointe").style.fontWeight = "normal"; + } + */ } @@ -2257,81 +2246,81 @@ const DisplayPartnerSession = (props) => { async function submenu_piece_jointe() { setsubmenu("piece_jointe"); submenu_color_management("piece_jointe"); - - /* // await sleep(5); - if (!edit_session_form) { - desableSessionFields(); - } - if (document.getElementById("piece_jointe")) { - document.getElementById("piece_jointe").style.backgroundColor = "#104277"; - document.getElementById("piece_jointe").style.color = "white"; - document.getElementById("piece_jointe").style.fontWeight = "bold"; - } - - - if (document.getElementById("historique")) { - document.getElementById("historique").style.backgroundColor = "#d8edfc"; - document.getElementById("historique").style.color = "black"; - document.getElementById("historique").style.fontWeight = "normal"; - } - - if (document.getElementById("attestation")) { - document.getElementById("attestation").style.backgroundColor = "#d8edfc"; - document.getElementById("attestation").style.color = "black"; - document.getElementById("attestation").style.fontWeight = "normal"; - } - - if (document.getElementById("evaluation")) { - document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; - document.getElementById("evaluation").style.color = "black"; - document.getElementById("evaluation").style.fontWeight = "normal"; - } - - if (document.getElementById("editique")) { - document.getElementById("editique").style.backgroundColor = "#d8edfc"; - document.getElementById("editique").style.color = "black"; - document.getElementById("editique").style.fontWeight = "normal"; - } - - if (document.getElementById("emargement")) { - document.getElementById("emargement").style.backgroundColor = "#d8edfc"; - document.getElementById("emargement").style.color = "black"; - document.getElementById("emargement").style.fontWeight = "normal"; - } - - - if (document.getElementById("sequence_session")) { - document.getElementById("sequence_session").style.backgroundColor = "#d8edfc"; - document.getElementById("sequence_session").style.color = "black"; - document.getElementById("sequence_session").style.fontWeight = "normal"; - } - - - if (document.getElementById("detail_session")) { - document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; - document.getElementById("detail_session").style.color = "black"; - document.getElementById("detail_session").style.fontWeight = "normal"; - } - - if (document.getElementById("inscrit")) { - document.getElementById("inscrit").style.backgroundColor = "#d8edfc"; - document.getElementById("inscrit").style.color = "black"; - document.getElementById("inscrit").style.fontWeight = "normal"; - } - - if (document.getElementById("preinscrit")) { - document.getElementById("preinscrit").style.backgroundColor = "#d8edfc"; - document.getElementById("preinscrit").style.color = "black"; - document.getElementById("preinscrit").style.fontWeight = "normal"; - } - - if (document.getElementById("emargement")) { - document.getElementById("emargement").style.backgroundColor = "#d8edfc"; - document.getElementById("emargement").style.color = "black"; - document.getElementById("emargement").style.fontWeight = "normal"; - } - */ + /* // await sleep(5); + if (!edit_session_form) { + desableSessionFields(); + } + + if (document.getElementById("piece_jointe")) { + document.getElementById("piece_jointe").style.backgroundColor = "#104277"; + document.getElementById("piece_jointe").style.color = "white"; + document.getElementById("piece_jointe").style.fontWeight = "bold"; + } + + + if (document.getElementById("historique")) { + document.getElementById("historique").style.backgroundColor = "#d8edfc"; + document.getElementById("historique").style.color = "black"; + document.getElementById("historique").style.fontWeight = "normal"; + } + + if (document.getElementById("attestation")) { + document.getElementById("attestation").style.backgroundColor = "#d8edfc"; + document.getElementById("attestation").style.color = "black"; + document.getElementById("attestation").style.fontWeight = "normal"; + } + + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + document.getElementById("evaluation").style.fontWeight = "normal"; + } + + if (document.getElementById("editique")) { + document.getElementById("editique").style.backgroundColor = "#d8edfc"; + document.getElementById("editique").style.color = "black"; + document.getElementById("editique").style.fontWeight = "normal"; + } + + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } + + + if (document.getElementById("sequence_session")) { + document.getElementById("sequence_session").style.backgroundColor = "#d8edfc"; + document.getElementById("sequence_session").style.color = "black"; + document.getElementById("sequence_session").style.fontWeight = "normal"; + } + + + if (document.getElementById("detail_session")) { + document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; + document.getElementById("detail_session").style.color = "black"; + document.getElementById("detail_session").style.fontWeight = "normal"; + } + + if (document.getElementById("inscrit")) { + document.getElementById("inscrit").style.backgroundColor = "#d8edfc"; + document.getElementById("inscrit").style.color = "black"; + document.getElementById("inscrit").style.fontWeight = "normal"; + } + + if (document.getElementById("preinscrit")) { + document.getElementById("preinscrit").style.backgroundColor = "#d8edfc"; + document.getElementById("preinscrit").style.color = "black"; + document.getElementById("preinscrit").style.fontWeight = "normal"; + } + + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } + */ } async function submenu_historique() { @@ -2341,76 +2330,76 @@ const DisplayPartnerSession = (props) => { if (!edit_session_form) { desableSessionFields(); } -/* - - if (document.getElementById("historique")) { - document.getElementById("historique").style.backgroundColor = "#104277"; - document.getElementById("historique").style.color = "white"; - document.getElementById("historique").style.fontWeight = "bold"; - } - - if (document.getElementById("attestation")) { - document.getElementById("attestation").style.backgroundColor = "#d8edfc"; - document.getElementById("attestation").style.color = "black"; - document.getElementById("attestation").style.fontWeight = "normal"; - } - - if (document.getElementById("evaluation")) { - document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; - document.getElementById("evaluation").style.color = "black"; - document.getElementById("evaluation").style.fontWeight = "normal"; - } - - if (document.getElementById("editique")) { - document.getElementById("editique").style.backgroundColor = "#d8edfc"; - document.getElementById("editique").style.color = "black"; - document.getElementById("editique").style.fontWeight = "normal"; - } - - if (document.getElementById("emargement")) { - document.getElementById("emargement").style.backgroundColor = "#d8edfc"; - document.getElementById("emargement").style.color = "black"; - document.getElementById("emargement").style.fontWeight = "normal"; - } - - - if (document.getElementById("sequence_session")) { - document.getElementById("sequence_session").style.backgroundColor = "#d8edfc"; - document.getElementById("sequence_session").style.color = "black"; - document.getElementById("sequence_session").style.fontWeight = "normal"; - } - - - if (document.getElementById("detail_session")) { - document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; - document.getElementById("detail_session").style.color = "black"; - document.getElementById("detail_session").style.fontWeight = "normal"; - } - - if (document.getElementById("inscrit")) { - document.getElementById("inscrit").style.backgroundColor = "#d8edfc"; - document.getElementById("inscrit").style.color = "black"; - document.getElementById("inscrit").style.fontWeight = "normal"; - } - - if (document.getElementById("preinscrit")) { - document.getElementById("preinscrit").style.backgroundColor = "#d8edfc"; - document.getElementById("preinscrit").style.color = "black"; - document.getElementById("preinscrit").style.fontWeight = "normal"; - } - - if (document.getElementById("emargement")) { - document.getElementById("emargement").style.backgroundColor = "#d8edfc"; - document.getElementById("emargement").style.color = "black"; - document.getElementById("emargement").style.fontWeight = "normal"; - } - - if (document.getElementById("piece_jointe")) { - document.getElementById("piece_jointe").style.backgroundColor = "#d8edfc"; - document.getElementById("piece_jointe").style.color = "black"; - document.getElementById("piece_jointe").style.fontWeight = "normal"; - } - */ + /* + + if (document.getElementById("historique")) { + document.getElementById("historique").style.backgroundColor = "#104277"; + document.getElementById("historique").style.color = "white"; + document.getElementById("historique").style.fontWeight = "bold"; + } + + if (document.getElementById("attestation")) { + document.getElementById("attestation").style.backgroundColor = "#d8edfc"; + document.getElementById("attestation").style.color = "black"; + document.getElementById("attestation").style.fontWeight = "normal"; + } + + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + document.getElementById("evaluation").style.fontWeight = "normal"; + } + + if (document.getElementById("editique")) { + document.getElementById("editique").style.backgroundColor = "#d8edfc"; + document.getElementById("editique").style.color = "black"; + document.getElementById("editique").style.fontWeight = "normal"; + } + + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } + + + if (document.getElementById("sequence_session")) { + document.getElementById("sequence_session").style.backgroundColor = "#d8edfc"; + document.getElementById("sequence_session").style.color = "black"; + document.getElementById("sequence_session").style.fontWeight = "normal"; + } + + + if (document.getElementById("detail_session")) { + document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; + document.getElementById("detail_session").style.color = "black"; + document.getElementById("detail_session").style.fontWeight = "normal"; + } + + if (document.getElementById("inscrit")) { + document.getElementById("inscrit").style.backgroundColor = "#d8edfc"; + document.getElementById("inscrit").style.color = "black"; + document.getElementById("inscrit").style.fontWeight = "normal"; + } + + if (document.getElementById("preinscrit")) { + document.getElementById("preinscrit").style.backgroundColor = "#d8edfc"; + document.getElementById("preinscrit").style.color = "black"; + document.getElementById("preinscrit").style.fontWeight = "normal"; + } + + if (document.getElementById("emargement")) { + document.getElementById("emargement").style.backgroundColor = "#d8edfc"; + document.getElementById("emargement").style.color = "black"; + document.getElementById("emargement").style.fontWeight = "normal"; + } + + if (document.getElementById("piece_jointe")) { + document.getElementById("piece_jointe").style.backgroundColor = "#d8edfc"; + document.getElementById("piece_jointe").style.color = "black"; + document.getElementById("piece_jointe").style.fontWeight = "normal"; + } + */ } @@ -2514,6 +2503,7 @@ const DisplayPartnerSession = (props) => { setsubmenu("evaluation"); submenu_color_management("evaluation"); + Getall_Survey_hot_evaluation_By_Session(); /* //await sleep(5); if (!edit_session_form) { @@ -10072,6 +10062,9 @@ const DisplayPartnerSession = (props) => { const [GetListePreinscrit_evaluation_meassage, setGetListePreinscrit_evaluation_meassage] = useState(); const [GetListePreinscrit_evaluation_result, setGetListePreinscrit_evaluation_result] = useState([]) function GetListeEvaluation(localsessionid) { + + return; + clean_old_messages(); var form = new FormData(); //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); @@ -10172,11 +10165,62 @@ const DisplayPartnerSession = (props) => { } - SendEvaluationEmail_Many_Ids(tab_ids_inscription); - + //SendEvaluationEmail_Many_Ids(tab_ids_inscription); + Send_Survey_By_Email_For_Ids(tab_ids_inscription); } + + const [Send_Survey_By_Email_For_Ids_api, setSend_Survey_By_Email_For_Ids_api] = useState(); + const [Send_Survey_By_Email_For_Ids_message, setSend_Survey_By_Email_For_Ids_message] = useState(); + const [Send_Survey_By_Email_For_Ids_result, setSend_Survey_By_Email_For_Ids_result] = useState(); + function Send_Survey_By_Email_For_Ids(tab_survey) { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("tab_ids", tab_survey); + + + //alert(" mysession = "+mysession); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Send_Survey_TabIds/"; + + + setLoading(true); + axios.post(myurl, form).then(res => { + + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In UpdateStagiaireData res.data.status = " + res.data.status); + //console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message); + setSend_Survey_By_Email_For_Ids_api("true"); + setSend_Survey_By_Email_For_Ids_result(res.data.message); + Getall_Survey_hot_evaluation_By_Session(); + + setSelectionModel_evaluation([]); + alert(res.data.message); + + } else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setSend_Survey_By_Email_For_Ids_api("false"); + setSend_Survey_By_Email_For_Ids_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Send_Survey_By_Email_For_Ids : Not good man :( mysearchtext = ' + error); + setSend_Survey_By_Email_For_Ids_api("false"); + alert(" Impossible d'envoyer les demandes"); + + }) + } + + function PrintEvaluationDetail() { var filedetail = "detail_evaluation.xlsx" @@ -10377,6 +10421,216 @@ const DisplayPartnerSession = (props) => { }; + const [Dialog_LIST_HOT_EVALUATION_QUESTION_open, setDialog_LIST_HOT_EVALUATION_QUESTION_open] = React.useState(false); + const Dialog_LIST_HOT_EVALUATION_QUESTION_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_LIST_HOT_EVALUATION_QUESTION_handleClose_buton = () => { + setDialog_LIST_HOT_EVALUATION_QUESTION_open(false); + }; + + const [selected_formulaire_id, setselected_formulaire_id] = useState(); + + const [New_Getall_Partner_Formulaires_hot_evaluation_with_Filter, setNew_Getall_Partner_Formulaires_hot_evaluation_with_Filter] = useState([]); + + const [Getall_Partner_Formulaires_hot_evaluation_with_Filter_api, setGetall_Partner_Formulaires_hot_evaluation_with_Filter_api] = useState(); + const [Getall_Partner_Formulaires_hot_evaluation_with_Filter_message, setGetall_Partner_Formulaires_hot_evaluation_with_Filter_message] = useState(); + const [Getall_Partner_Formulaires_hot_evaluation_with_Filter_result, setGetall_Partner_Formulaires_hot_evaluation_with_Filter_result] = useState([]); + function Getall_Partner_Formulaires_hot_evaluation_with_Filter(event) { + + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("type", "hot_eval"); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Formulaire_with_filter/"; + + + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Partner_Formulaires_hot_evaluation_with_Filter res.data.status = " + res.data.status); + //console.log(" In Getall_Partner_Formulaires_hot_evaluation_with_Filter res.data.message r_class = " + res.data.message); + setGetall_Partner_Formulaires_hot_evaluation_with_Filter_api("true"); + setGetall_Partner_Formulaires_hot_evaluation_with_Filter_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_code = JSON.parse(x).code; + var local_nom = JSON.parse(x).nom; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_code + " " + local_nom, + "nom": local_nom, + "code": local_code, + }; + new_data2.push(node); + }); + + var node = { + "_id": "", + "id": "", + "label": "", + "nom": "", + "code": "", + + }; + new_data2.push(node); + + if (new_data2.length > 0) + setNew_Getall_Partner_Formulaires_hot_evaluation_with_Filter(new_data2); + } + else { + setGetall_Partner_Formulaires_hot_evaluation_with_Filter_api("false"); + setGetall_Partner_Formulaires_hot_evaluation_with_Filter_message(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Partner_Formulaires_hot_evaluation_with_Filter = ', error); + setGetall_Partner_Formulaires_hot_evaluation_with_Filter_api("false"); + //setmyApimyApiMessage("") + }) + } + + const [Getall_Survey_hot_evaluation_By_Session_api, setGetall_Survey_hot_evaluation_By_Session_api] = useState(); + const [Getall_Survey_hot_evaluation_By_Session_message, setGetall_Survey_hot_evaluation_By_Session_message] = useState(); + const [Getall_Survey_hot_evaluation_By_Session_result, setGetall_Survey_hot_evaluation_By_Session_result] = useState([]); + function Getall_Survey_hot_evaluation_By_Session(event) { + + setSelectionModel_evaluation([]) + + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", selected_session_id); + form.append("formulaire_type", "hot_eval"); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Survey_with_filter/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + + setLoading(false); + + if (String(res.data.status) === String("true")) { + // console.log(" In Getall_Survey_hot_evaluation_By_Session res.data.status = " + res.data.status); + console.log(" In Getall_Survey_hot_evaluation_By_Session res.data.message r_class = " + res.data.message); + setGetall_Survey_hot_evaluation_By_Session_api("true"); + setGetall_Survey_hot_evaluation_By_Session_result(res.data.message); + setRows_evaluation(res.data.message); + + } + else { + setGetall_Survey_hot_evaluation_By_Session_api("false"); + setGetall_Survey_hot_evaluation_By_Session_message(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Survey_hot_evaluation_By_Session = ', error); + setGetall_Survey_hot_evaluation_By_Session_api("false"); + //setmyApimyApiMessage("") + }) + } + + + const [Create_List_Survey_hot_eval_For_Session_For_Inscrit_api, setCreate_List_Survey_hot_eval_For_Session_For_Inscrit_api] = useState(); + const [Create_List_Survey_hot_eval_For_Session_For_Inscrit_message, setCreate_List_Survey_hot_eval_For_Session_For_Inscrit_message] = useState(); + const [Create_List_Survey_hot_eval_For_Session_For_Inscrit_result, setCreate_List_Survey_hot_eval_For_Session_For_Inscrit_result] = useState(); + function Create_List_Survey_hot_eval_For_Session_For_Inscrit() { + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", selected_session_id); + form.append("formulaire_id", selected_formulaire_id); + form.append("survey_type", "hot_eval"); + + + //alert(" mysession = "+mysession); zzzz + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Init_Survey_Tab_For_All_Session_Inscrit/"; + + + setLoading(true); + axios.post(myurl, form).then(res => { + + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In UpdateStagiaireData res.data.status = " + res.data.status); + //console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message); + setCreate_List_Survey_hot_eval_For_Session_For_Inscrit_api("true"); + setCreate_List_Survey_hot_eval_For_Session_For_Inscrit_result(res.data.message); + Getall_Survey_hot_evaluation_By_Session(); + alert(res.data.message); + + } else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setCreate_List_Survey_hot_eval_For_Session_For_Inscrit_api("false"); + setCreate_List_Survey_hot_eval_For_Session_For_Inscrit_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Create_List_Survey_hot_eval_For_Session_For_Inscrit : Not good man :( mysearchtext = ' + error); + setCreate_List_Survey_hot_eval_For_Session_For_Inscrit_api("false"); + alert(" Impossible d'initialiser la liste des enquête de positionnement "); + + }) + } + + function Export_survey_hot_eval_datatab_class() { + const stored_cookie = getCookie('tokenmysypart'); + + var nom_fichier_cmd = "export_reponses.xlsx"; + + var url = process.env.REACT_APP_API_URL + "myclass/api/Export_To_Excel_Survey_with_filter/" + stored_cookie + "/" + selected_session_id+"/hot_eval/"; + + + setLoading(true); + axios.get(url, { responseType: 'blob', },) + .then((res) => { + setLoading(false); + //console.log(" In Export_Dashbord_to_CSV res.data = " + res.data); + if (String(res.data) === String("false")) { + alert("Impossible d'exporter les réponses (2) "); + } else { + fileDownload(res.data, nom_fichier_cmd) + + } + }).catch((error) => { + setLoading(false); + console.error('Error:', error); + alert(" Impossible d'exporter les réponses ") + + }); + + + setLoading(false); + } + + return (
@@ -10385,6 +10639,90 @@ const DisplayPartnerSession = (props) => {
} + + + {/* Dialog pour gerer les LIST_HOT_EVALUATION_QUESTION */} + + + MySy Information + + + {Dialog_1_message} + + + +
Choisir un questionnaire d'évaluation a chaud + { + if (value && value._id) { + + setselected_formulaire_id(value._id); + + } else { + setselected_formulaire_id(""); + } + }} + + renderInput={(params) => + } + /> + +
+
+ + +
+
+ + + + + +
+ + + +
+ +
+
+ +
+ +
+ {/* FIN Dialog pour gerer les LIST_HOT_EVALUATION_QUESTION */} + + {/* Dialog pour gerer les EMARGEMENT */} { {String(submenu) === String("evaluation") &&
- + + Initialiser la demande + } + modal + nested + position="center center" + + > + + {close => ( +
+ +
MySy Information
+
+ {' '} + + + Confirmez la (ré)initialisation de la demande.
+ /!\ Si une demande d'évaluation existe pour cette session, elle sera supprimée et récréée +
+ + +
+
+
+ + +
+
+ +
+
+
+ )} +
+ + +
+ Getall_Survey_hot_evaluation_By_Session(); + }}>Actualiser la liste + + + + +
@@ -17391,15 +17803,13 @@ const DisplayPartnerSession = (props) => { { id: index, _id: JSON.parse(item)._id, + email: JSON.parse(item).email, nom: JSON.parse(item).nom, prenom: JSON.parse(item).prenom, - email: JSON.parse(item).email, - eval_date: String(JSON.parse(item).eval_date).substring(0, 10), - eval_eval: parse(String(JSON.parse(item).eval_eval).replace(/(<([^>]+)>)/ig, '')), - eval_note: JSON.parse(item).eval_note, - eval_status: JSON.parse(item).eval_status, - eval_pedagogie: JSON.parse(item).eval_pedagogie, - date_demande_eval: JSON.parse(item).date_demande_eval, + status: JSON.parse(item).statut, + form_code: JSON.parse(item).formulaire.code, + date_envoie: JSON.parse(item).date_envoi, + date_reponse: JSON.parse(item).date_reponse, } ))} @@ -17416,16 +17826,37 @@ const DisplayPartnerSession = (props) => { getRowClassName={(params) => { - if (String(params.row.eval_status) === "0") { - - return 'line--eval_envoye'; + if (String(params.row.status) === "1") { + return 'line--positionnement_envoye'; } - if (String(params.row.eval_status) === "1") { - - return 'line--eval_fait'; + if (String(params.row.status) === "2") { + return 'line--positionnement_repondu'; } + // Pour la gestion de la couleur de zone double cliquée + if (String(params.row.id) === String(gridline_id)) { + + return 'line--statut--selected'; + } + else if (parseInt(String(params.row.id)) % 2 === 0) { + return 'line--statut--pair'; + } + else if (parseInt(String(params.row.id)) % 2 !== 0) { + return 'line--statut--impair'; + } + + }} + getEstimatedRowHeight={() => 200} + getRowHeight={() => "auto"} + sx={{ + "& .MuiDataGrid-cellContent": { + minHeight: 50, + + }, + [`& .${gridClasses.cell}`]: { + py: 1, + }, }} /> diff --git a/src/components/Module_Evaluation_Positionnement.js b/src/components/Module_Evaluation_Positionnement.js index e6fb4c9..481e250 100644 --- a/src/components/Module_Evaluation_Positionnement.js +++ b/src/components/Module_Evaluation_Positionnement.js @@ -30,6 +30,7 @@ import { gridClasses } from '@mui/x-data-grid'; import Link from '@mui/material/Link'; import { PiDotsThree } from "react-icons/pi"; + const Module_Evaluation_Positionnement = (props) => { const myconntected_employee_id = props.conntected_employee_id;