diff --git a/src/components/Config_Document.js b/src/components/Config_Document.js index 4045641..4fbd6e3 100644 --- a/src/components/Config_Document.js +++ b/src/components/Config_Document.js @@ -2691,7 +2691,7 @@ const Config_Documents = (props) => { } diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index d4e0fac..ee1590f 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -10,11 +10,11 @@ import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; import { Editor } from '@tinymce/tinymce-react'; import parse from 'html-react-parser'; -import { FcViewDetails, FcDisapprove, FcInfo, FcExpired } from "react-icons/fc"; +import { FcViewDetails, FcDisapprove, FcInfo, FcExpired } from "react-icons/fc"; import 'react-tooltip/dist/react-tooltip.css' import { Tooltip } from 'react-tooltip' import add_plus from "../mysy_img/plus.png"; -import excel_icone from "../mysy_img/excel_icone.png"; +import excel_icone from "../mysy_img/excel_icone.png"; import participants from "../mysy_img/participants.png"; import fileDownload from 'js-file-download' import Popup from 'reactjs-popup'; @@ -1060,10 +1060,10 @@ const DisplayPartnerSession = (props) => { onClick={(event) => { // handleClick_valide_emargement(event, cellValues); zzz - setp_detail_emargement_comment(cellValues.row.comment) ; + setp_detail_emargement_comment(cellValues.row.comment); - setselected_emargement_user(cellValues.row.prenom+ " "+cellValues.row.nom) ; - setselected_emargement_date("Du "+cellValues.row.sequence_start+" au "+cellValues.row.sequence_end); + setselected_emargement_user(cellValues.row.prenom + " " + cellValues.row.nom); + setselected_emargement_date("Du " + cellValues.row.sequence_start + " au " + cellValues.row.sequence_end); setselected_emargement_id(cellValues.row._id); setDialog_COMMENT_EMARGEMENTE_open(true); }} @@ -2970,6 +2970,10 @@ const DisplayPartnerSession = (props) => { return; } + // Gestion du statut d'inscription + if( String(myinscript_status) === ""){ + alert(" Vous devez choisir un statut d'inscription "); + } //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); const stored_cookie = getCookie('tokenmysypart'); @@ -3123,7 +3127,7 @@ const DisplayPartnerSession = (props) => { const New_status_inscription_add = [ { "id": "0", "label": "PréInscription", "value": "0" }, - { "id": "1", "label": "Inscription", "value": "1" }, + // { "id": "1", "label": "Inscription", "value": "1" }, { "id": "2", "label": "En Cours", "value": "2" }, ] @@ -3149,7 +3153,7 @@ const DisplayPartnerSession = (props) => { { "id": "4", "label": "Rech. Emploi", "value": "4" }, ] - const [myinscript_status, setmyinscript_status] = useState(""); + const [myinscript_status, setmyinscript_status] = useState("0"); @@ -9418,7 +9422,7 @@ const DisplayPartnerSession = (props) => { const [Update_Comment_Given_Emargement_result, setUpdate_Comment_Given_Emargement_result] = useState(); function Update_Comment_Given_Emargement(emargement_id) { - + /*console.log(" ### date , email, matin,matin_val, apresmidi, apresmidi_val = ", date, email, matin, matin_val, apresmidi, apresmidi_val);*/ @@ -9428,8 +9432,8 @@ const DisplayPartnerSession = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); form.append("tab_ids", emargement_id); - form.append("comment", p_detail_emargement_comment); - + form.append("comment", p_detail_emargement_comment); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Given_Emargement_Data/"; @@ -9438,6 +9442,8 @@ const DisplayPartnerSession = (props) => { setLoading(false); if (String(res.data.status) === String("true")) { + Dialog_COMMENT_EMARGEMENTE_handleClose_buton(); + //console.log(" In UpdateStagiaireData res.data.status = " + res.data.status); //console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message); setUpdate_Comment_Given_Emargement_api("true"); @@ -11216,10 +11222,10 @@ const DisplayPartnerSession = (props) => { MySy Information - {selected_emargement_date}
{selected_emargement_user} + {selected_emargement_date}
{selected_emargement_user}
- + {
@@ -11314,10 +11320,10 @@ const DisplayPartnerSession = (props) => {
- +
} - + { /******** End de comment emargement */} @@ -12744,8 +12750,8 @@ const DisplayPartnerSession = (props) => { {Dialog_2_message} - - + +

@@ -17095,7 +17101,7 @@ const DisplayPartnerSession = (props) => { /> -
Statut Inscription
+
Statut Inscription
{ onChange={(event, value) => { if (value && value.value) { setmyinscript_status(value.value); + } else { + setmyinscript_status(""); + alert(" Vous devez choisir un statut d'inscription") } }} renderInput={(params) => { {String(addOneParticipant) !== "1" && selected_code_session && selected_internal_url &&
- -
-
Statut Inscription
+
Statut Inscription
{ />
-
Statut Inscription
+
Statut Inscription
{ } else { setmyinscript_status(""); + + alert(" Vous devez choisir un statut d'inscription") + } }} renderInput={(params) => { {String(addOneParticipant) !== "1" && selected_code_session && selected_internal_url &&
- - - } - modal - nested - position="center center" + {String(selected_session_invoiced_statut) !== "1" && String(selected_session_invoiced_statut) !== "2" && + Initialiser la liste + } + modal + nested + position="center center" - > + > - {close => ( -
- -
MySy Information
-
- {' '} + {close => ( +
+ +
MySy Information
+
+ {' '} - Confirmez la (ré)initialisation de la liste d'émargement.
- /!\ Si un tableau d'émargement existe pour cette session, il sera supprimé et récréé -
+ Confirmez la (ré)initialisation de la liste d'émargement.
+ /!\ Si un tableau d'émargement existe pour cette session, il sera supprimé et récréé +
-
-
-
- -
-
- + }}> Valider + +
+
+ +
-
- )} - + )} + } + } modal nested @@ -20268,7 +20336,7 @@ const DisplayPartnerSession = (props) => { + SessionendDate={new Date(moment(SessionendDate, "DD/MM/YYYY"))} selected_session_invoiced_statut={selected_session_invoiced_statut} />
} @@ -20279,7 +20347,9 @@ const DisplayPartnerSession = (props) => { + SessionendDate={new Date(moment(SessionendDate, "DD/MM/YYYY"))} session_formateur_id={p_formateur_id} + session_class_id={p_detail_session_class_id} + selected_session_invoiced_statut={selected_session_invoiced_statut} />
} diff --git a/src/components/Employes.js b/src/components/Employes.js index 26d938b..e5803b9 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -432,6 +432,50 @@ const Employes = (props) => { ] + const columns_list_evaluation_enseignant = [ + { field: 'id', headerName: 'id', hide: true }, + { field: '_id', headerName: '_id', hide: true }, + { 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: 'status', headerName: 'Statut', width: 100, editable: false, flex: true, + valueFormatter: (params) => { + if (String(params.value) === "0") + return "Init."; + else if (String(params.value) === "1") + return "Env."; + else if (String(params.value) === "2") + return "Rép."; + else + 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_reponse', headerName: 'Date Réponse', width: 150, editable: false, + valueFormatter: (params) => { + if (params.value) + return String(params.value).substring(0, 16) + else + return "" + + }, + }, + + ] + const [tabledata, settabledata] = useState([]); const [rows_acces_right_v2, setrows_acces_right_v2] = useState([]); @@ -793,7 +837,52 @@ const Employes = (props) => { } + const [selectionModel_evaluation_formateur, setselectionModel_evaluation_formateur] = React.useState([]); + const [rowss_evaluation_formateur, setRows_evaluation_formateur] = useState([]); + const [Getall_Survey_formateur_evaluation_By_Session_api, setGetall_Survey_formateur_evaluation_By_Session_api] = useState(); + const [Getall_Survey_formateur_evaluation_By_Session_message, setGetall_Survey_formateur_evaluation_By_Session_message] = useState(); + const [Getall_Survey_formateur_evaluation_By_Session_result, setGetall_Survey_formateur_evaluation_By_Session_result] = useState([]); + function Getall_Survey_formateur_evaluation_By_Session(event) { + + setselectionModel_evaluation_formateur([]) + + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("related_collection", "ressource_humaine"); + form.append("related_collection_id", selected_id); + form.append("formulaire_type", "human_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_formateur_evaluation_By_Session res.data.status = " + res.data.status); + //console.log(" In Getall_Survey_formateur_evaluation_By_Session res.data.message r_class = " + res.data.message); + setGetall_Survey_formateur_evaluation_By_Session_api("true"); + setGetall_Survey_formateur_evaluation_By_Session_result(res.data.message); + setRows_evaluation_formateur(res.data.message); + + } + else { + setGetall_Survey_formateur_evaluation_By_Session_api("false"); + setGetall_Survey_formateur_evaluation_By_Session_message(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Survey_formateur_evaluation_By_Session = ', error); + setGetall_Survey_formateur_evaluation_By_Session_api("false"); + //setmyApimyApiMessage("") + }) + } useEffect(() => { Getall_Training_Employee_No_Filter(); @@ -804,6 +893,8 @@ const Employes = (props) => { Get_Partner_Object_Specific_Fields("ressource_humaine"); + Getall_Survey_formateur_evaluation_By_Session(); + window.scrollTo({ top: 0, behavior: "smooth", @@ -1256,7 +1347,7 @@ const Employes = (props) => { * Update 22/10/2023 : Gestion des champs spécifiques. ils commencent tous par 'my_' */ - + for (let i = 0; i < rows_champs_specifics.length; i++) { @@ -1943,7 +2034,7 @@ const Employes = (props) => { } - + // Pour les champs spécifiques @@ -3003,6 +3094,11 @@ const Employes = (props) => { document.getElementById("piece_jointe").style.color = "black"; } + + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + } //console.log(" ### employee_data_edit_mode = ", employee_data_edit_mode); if (String(employee_data_edit_mode) !== "1") disable_Employee_DetailFields(); @@ -3055,6 +3151,11 @@ const Employes = (props) => { document.getElementById("piece_jointe").style.backgroundColor = "#d8edfc"; document.getElementById("piece_jointe").style.color = "black"; } + + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + } } async function submenu_contrat() { @@ -3088,6 +3189,55 @@ const Employes = (props) => { } + if (document.getElementById("piece_jointe")) { + document.getElementById("piece_jointe").style.backgroundColor = "#d8edfc"; + document.getElementById("piece_jointe").style.color = "black"; + } + + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + } + + } + + + async function submenu_evaluation() { + setsubmenu("evaluation"); + + await sleep(5); + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#104277"; + document.getElementById("evaluation").style.color = "white"; + } + + if (document.getElementById("contrat")) { + document.getElementById("contrat").style.backgroundColor = "#d8edfc"; + document.getElementById("contrat").style.color = "black"; + } + + if (document.getElementById("affectation")) { + document.getElementById("affectation").style.backgroundColor = "#d8edfc"; + document.getElementById("affectation").style.color = "black"; + } + + if (document.getElementById("detail_employe")) { + document.getElementById("detail_employe").style.backgroundColor = "#d8edfc"; + document.getElementById("detail_employe").style.color = "black"; + } + + if (document.getElementById("droit_acces")) { + document.getElementById("droit_acces").style.backgroundColor = "#d8edfc"; + document.getElementById("droit_acces").style.color = "black"; + } + + + if (document.getElementById("competence")) { + document.getElementById("competence").style.backgroundColor = "#d8edfc"; + document.getElementById("competence").style.color = "black"; + } + + if (document.getElementById("piece_jointe")) { document.getElementById("piece_jointe").style.backgroundColor = "#d8edfc"; document.getElementById("piece_jointe").style.color = "black"; @@ -3134,6 +3284,11 @@ const Employes = (props) => { document.getElementById("piece_jointe").style.color = "black"; } + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + } + setSelectionModel_affectations([]); setdisplay_affectation("0"); setAdd_new_affectation(""); @@ -3216,6 +3371,11 @@ const Employes = (props) => { document.getElementById("droit_acces").style.color = "black"; } + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + } + } @@ -3256,6 +3416,12 @@ const Employes = (props) => { document.getElementById("affectation").style.backgroundColor = "#d8edfc"; document.getElementById("affectation").style.color = "black"; } + + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#d8edfc"; + document.getElementById("evaluation").style.color = "black"; + } + setSelectionModel_affectations([]); setdisplay_affectation("0"); setAdd_new_affectation(""); @@ -6016,7 +6182,7 @@ const Employes = (props) => { } />} - +
@@ -6629,6 +6795,7 @@ const Employes = (props) => { +
@@ -7782,7 +7949,7 @@ const Employes = (props) => { - +
@@ -8300,6 +8467,7 @@ const Employes = (props) => { +
@@ -8864,6 +9032,7 @@ const Employes = (props) => { +
@@ -9111,6 +9280,7 @@ const Employes = (props) => { +
 
@@ -9220,6 +9390,7 @@ const Employes = (props) => { +
@@ -9374,6 +9545,7 @@ const Employes = (props) => { +
@@ -9443,6 +9615,152 @@ const Employes = (props) => {
} + {String(submenu) === "evaluation" &&
+
+ + + + + + + +
+ + +
+
Evaluation par les apprenants
+ Evaluation
+
+ + + { + setselectionModel_evaluation_formateur(newSelectionModel_evaluation); + //console.log("ch selected--" + newSelectionModel_evaluation); + + }} + + selectionModel={selectionModel_evaluation_formateur} + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={rowss_evaluation_formateur.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + email: JSON.parse(item).email, + nom: JSON.parse(item).nom, + prenom: JSON.parse(item).prenom, + 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, + + } + ))} + + columns={columns_list_evaluation_enseignant} + pageSize={10} + className="datagridclass" + + rowsPerPageOptions={[10]} + disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + + getRowClassName={(params) => { + + if (String(params.row.status) === "1") { + return 'line--positionnement_envoye'; + } + + if (String(params.row.status) === "2") { + return 'line--positionnement_repondu'; + } + + // Pour la gestion de la couleur de zone double cliquée + + 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, + }, + }} + + /> + + + + +
+ + + + +
+ + +
+ +
+
+
Autres évaluations
+
+ +
+ +
} + diff --git a/src/components/Module_Session_Evaluation.js b/src/components/Module_Session_Evaluation.js index 8ba8463..df753d9 100644 --- a/src/components/Module_Session_Evaluation.js +++ b/src/components/Module_Session_Evaluation.js @@ -315,12 +315,12 @@ const Module_Session_Evaluation = (props) => { }; new_data2.push(node); }); - - //--- - var node = { + + //--- + var node = { "_id": "", "id": "", - "label":"", + "label": "", "nom": "", "prenom": "", "ismanager": "" @@ -514,7 +514,7 @@ const Module_Session_Evaluation = (props) => { 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); + //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); @@ -592,7 +592,7 @@ const Module_Session_Evaluation = (props) => { const [selectionModel_evaluation_cold, setSelectionModel_evaluation_cold] = React.useState([]); const [rowss_evaluation_cold, setRows_evaluation_cold] = useState([]); - const [selectionModel_evaluation_formateur, setSelectionModel_evaluation_formateur] = React.useState([]); + const [selectionModel_evaluation_formateur, setselectionModel_evaluation_formateur] = React.useState([]); const [rowss_evaluation_formateur, setRows_evaluation_formateur] = useState([]); /**** Les évaluations a froid */ @@ -770,7 +770,7 @@ const Module_Session_Evaluation = (props) => { if (String(res.data.status) === String("true")) { // console.log(" In Getall_Survey_cold_evaluation_By_Session res.data.status = " + res.data.status); - console.log(" In Getall_Survey_cold_evaluation_By_Session res.data.message r_class = " + res.data.message); + //console.log(" In Getall_Survey_cold_evaluation_By_Session res.data.message r_class = " + res.data.message); setGetall_Survey_cold_evaluation_By_Session_api("true"); setGetall_Survey_cold_evaluation_By_Session_result(res.data.message); setRows_evaluation_cold(res.data.message); @@ -794,7 +794,7 @@ const Module_Session_Evaluation = (props) => { const [Getall_Survey_formateur_evaluation_By_Session_result, setGetall_Survey_formateur_evaluation_By_Session_result] = useState([]); function Getall_Survey_formateur_evaluation_By_Session(event) { - setSelectionModel_evaluation_formateur([]) + setselectionModel_evaluation_formateur([]) var form = new FormData(); @@ -813,7 +813,7 @@ const Module_Session_Evaluation = (props) => { if (String(res.data.status) === String("true")) { // console.log(" In Getall_Survey_formateur_evaluation_By_Session res.data.status = " + res.data.status); - console.log(" In Getall_Survey_formateur_evaluation_By_Session res.data.message r_class = " + res.data.message); + //console.log(" In Getall_Survey_formateur_evaluation_By_Session res.data.message r_class = " + res.data.message); setGetall_Survey_formateur_evaluation_By_Session_api("true"); setGetall_Survey_formateur_evaluation_By_Session_result(res.data.message); setRows_evaluation_formateur(res.data.message); @@ -887,7 +887,7 @@ const Module_Session_Evaluation = (props) => { const [Create_List_Survey_eval_formateur_For_Session_For_Inscrit_result, setCreate_List_Survey_eval_formateur_For_Session_For_Inscrit_result] = useState(); function Create_List_Survey_eval_formateur_For_Session_For_Inscrit() { - if( String(selected_formateur_id) === "" || String(selected_formateur_id).length < 5 ){ + if (String(selected_formateur_id) === "" || String(selected_formateur_id).length < 5) { alert(" Vous devez choisir un formateur "); return; } @@ -917,6 +917,7 @@ const Module_Session_Evaluation = (props) => { setCreate_List_Survey_eval_formateur_For_Session_For_Inscrit_api("true"); setCreate_List_Survey_eval_formateur_For_Session_For_Inscrit_result(res.data.message); Getall_Survey_formateur_evaluation_By_Session(); + setselected_formateur_id(""); alert(res.data.message); } else if (String(res.data.status) === String("Err_Connexion")) { @@ -938,6 +939,9 @@ const Module_Session_Evaluation = (props) => { }) } + + const [actionmass_eval_formateur, setactionmass_eval_formateur] = useState(); + const [actionmass_eval_froid, setactionmass_eval_froid] = useState(); const [actionmass_eval_val, setactionmass_eval_val] = useState(); @@ -969,6 +973,34 @@ const Module_Session_Evaluation = (props) => { } + function GetSelectedRows_Evaluation_formateur_Ids() { + + var tab_tmp = [] + for (var i = 0; i < selectionModel_evaluation_formateur.length; i++) { + var myid = parseInt(String(selectionModel_evaluation_formateur[i])); + //var line = JSON.parse(rowss[myid]); + tab_tmp.push(myid); + } + return tab_tmp; + + } + async function actionmass_Formation_Traitemet() { + var liste_formation = GetSelectedRows_Evaluation_formateur_Ids(); + + var tab_ids_survey = [] + for (var i = 0; i < selectionModel_evaluation_formateur.length; i++) { + var myid = parseInt(String(selectionModel_evaluation_formateur[i])); + var line = JSON.parse(rowss_evaluation_formateur[myid]); + var line_id = JSON.parse(rowss_evaluation_formateur[myid])._id; + tab_ids_survey.push(line_id); + } + + //SendEvaluationEmail_Many_Ids(tab_ids_inscription); + Send_Survey_By_Email_For_Ids(tab_ids_survey); + + } + + async function actionmass_Evaluation_Traitemet() { var liste_formation = GetSelectedRows_Evaluation_Ids(); @@ -1048,13 +1080,17 @@ const Module_Session_Evaluation = (props) => { Getall_Survey_hot_evaluation_By_Session(); Getall_Survey_cold_evaluation_By_Session(); + Getall_Survey_formateur_evaluation_By_Session(); setSelectionModel_evaluation([]); setSelectionModel_evaluation_cold([]); + setselectionModel_evaluation_formateur([]); setactionmass_eval_val(""); setactionmass_eval_froid(""); + setactionmass_eval_formateur(""); + alert(res.data.message); @@ -1103,9 +1139,9 @@ const Module_Session_Evaluation = (props) => { useEffect(() => { - if( props.session_formateur_id){ + if (props.session_formateur_id) { setselected_formateur_id(props.session_formateur_id); - }else{ + } else { setselected_formateur_id(""); } Getall_Training_Employee_No_Filter(); @@ -1113,6 +1149,7 @@ const Module_Session_Evaluation = (props) => { Getall_Survey_hot_evaluation_By_Session(); Getall_Survey_cold_evaluation_By_Session(); + Getall_Survey_formateur_evaluation_By_Session(); setSessionendDate(props.SessionendDate); setSessionstartDate(props.SessionstartDate); @@ -1171,6 +1208,37 @@ const Module_Session_Evaluation = (props) => { } + function Export_survey_formateur_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 + "/human_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); + } + + function Export_survey_cold_eval_datatab_class() { const stored_cookie = getCookie('tokenmysypart'); @@ -1261,7 +1329,7 @@ const Module_Session_Evaluation = (props) => { > MySy Information - + {Dialog_1_message} @@ -1341,7 +1409,7 @@ const Module_Session_Evaluation = (props) => { > MySy Information - + {Dialog_1_message} @@ -1442,7 +1510,7 @@ const Module_Session_Evaluation = (props) => { > MySy Information - + {Dialog_1_message} @@ -1476,7 +1544,7 @@ const Module_Session_Evaluation = (props) => { - + {New_Getall_Training_Employee_No_Filter_result && New_Getall_Training_Employee_No_Filter_result.length > 0 &&
Choisir un formateur à évaluer @@ -1487,14 +1555,15 @@ const Module_Session_Evaluation = (props) => { fullWidth //className="disabled_style enable_style" options={New_Getall_Training_Employee_No_Filter_result} - value={New_Getall_Training_Employee_No_Filter_result.filter((data) => (data)._id === String(selected_formateur_id))[0].label} + value={New_Getall_Training_Employee_No_Filter_result.filter((data) => (data)._id === String(selected_formateur_id))[0].label} onChange={(event, value) => { if (value && value._id) { setselected_formateur_id(value._id); } else { - setselected_formateur_id(""); + + alert(" Vous devez choisir un formateur ") } }} @@ -1733,14 +1802,7 @@ const Module_Session_Evaluation = (props) => {   - {/*    */} + { /> - {actionmass_eval_val && String(actionmass_eval_val).length > 1 && + {actionmass_eval_val && String(actionmass_eval_val).length > 1 && String(actionmass_eval_val) !== "" && + selectionModel_evaluation.length > 0 && + Traiter @@ -2054,9 +2118,9 @@ const Module_Session_Evaluation = (props) => { renderInput={(params) => } /> - - - {actionmass_Evaluation_Traitemet_cold && String(actionmass_Evaluation_Traitemet_cold) !== "" && String(actionmass_eval_froid).length > 1 && + + {actionmass_eval_froid && String(actionmass_eval_froid) !== "" && String(actionmass_eval_froid).length > 1 && + selectionModel_evaluation_cold.length > 0 && Traiter @@ -2160,6 +2224,7 @@ const Module_Session_Evaluation = (props) => {
@@ -2189,7 +2254,7 @@ const Module_Session_Evaluation = (props) => {
@@ -2238,12 +2303,12 @@ const Module_Session_Evaluation = (props) => { { - setSelectionModel_evaluation_formateur(newSelectionModel_evaluation); + setselectionModel_evaluation_formateur(newSelectionModel_evaluation); //console.log("ch selected--" + newSelectionModel_evaluation); }} - selectionModel={setSelectionModel_evaluation_formateur} + selectionModel={selectionModel_evaluation_formateur} localeText={frFR.components.MuiDataGrid.defaultProps.localeText} rows={rowss_evaluation_formateur.map((item, index) => ( { @@ -2305,9 +2370,9 @@ const Module_Session_Evaluation = (props) => { /> - {selectionModel_evaluation_cold && selectionModel_evaluation_cold.length >= 0 && + {selectionModel_evaluation_formateur && selectionModel_evaluation_formateur.length >= 0 &&
- +   @@ -2321,16 +2386,16 @@ const Module_Session_Evaluation = (props) => { if (value && value.value) { if (String(value.value) === "demande evaluation") { - setactionmass_eval_froid(value.value); + setactionmass_eval_formateur(value.value); } else { - setactionmass_eval_froid(""); + setactionmass_eval_formateur(""); } } else { - setactionmass_eval_froid(""); + setactionmass_eval_formateur(""); } }} @@ -2340,7 +2405,8 @@ const Module_Session_Evaluation = (props) => { /> - {actionmass_Evaluation_Traitemet_cold && String(actionmass_Evaluation_Traitemet_cold) !== "" && String(actionmass_eval_froid).length > 1 && + {actionmass_eval_formateur && String(actionmass_eval_formateur) !== "" && String(actionmass_eval_formateur).length > 1 && + selectionModel_evaluation_formateur.length > 0 && Traiter @@ -2360,12 +2426,12 @@ const Module_Session_Evaluation = (props) => {
{' '} - Confirmer l'action {actionmass_eval_froid} en masse. + Confirmer l'action {actionmass_eval_formateur} en masse.
diff --git a/src/components/Module_Session_Planification.js b/src/components/Module_Session_Planification.js index 44573d0..005e7bb 100644 --- a/src/components/Module_Session_Planification.js +++ b/src/components/Module_Session_Planification.js @@ -2287,9 +2287,9 @@ const Module_Session_Planification = (props) => { onChange={(event, value) => { if (value && value._id) { setDialog_seq_ressource_1_selected_ressource_id(value._id); - + console.log(" ### check_ressource_avabilities = ", check_ressource_avabilities) - if (check_ressource_avabilities === "1" ) { + if (check_ressource_avabilities === "1") { // On ne fait le controle de disponibilité que si on une sequence precise. pas quand c'est en masse. Get_Ressource_Avabilities(value._id); } @@ -3667,17 +3667,35 @@ const Module_Session_Planification = (props) => {   -
-
- {String(add_new_form) !== "1" && String(display_form) === "1" && String(form_edit_mode) !== "1" &&
+ { + String(add_new_form) !== "1" && String(display_form) === "1" && String(form_edit_mode) !== "1" &&
-
-
+
+
+ +
Code
+ +
+ + + {New_Option_type_Formulaire.length > 0 &&
Type
+ (data).value === String(p_detail_from_type))[0].label} + /> +
} + + + + +
Nom
+ +
+ +
Description
+ +
+ +
Message d'introduction
+ +
+ + +
Commentaire
+ +
+ + +
+ + +
+ +
+ + {p_detail_from_list_question && p_detail_from_list_question.length > 0 &&
+   + + { + setSelectionModel_question(newSelectionModel); + + }} + selectionModel={selectionModel} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={p_detail_from_list_question.map((item, index) => ( + { + id: index, + _id: (item)._id, + question: (item).question, + type: (item).type, + max_note: (item).max_note, + list_choix: (item).list_choix, + list_case_cocher: (item).list_case_cocher, + is_statistic: (item).is_statistic, + + + + } + ))} + + columns={columns_question} + pageSize={10} + className="datagridclass" + disableSelectionOnClick + onRowDoubleClick={(newSelectionModel) => { + + setselected_question_id(newSelectionModel.row._id); + setquestion_question(newSelectionModel.row.question); + setquestion_type(newSelectionModel.row.type); + setquestion_max_note(newSelectionModel.row.max_note); + + if (newSelectionModel.row.list_choix) { + var tmp_tab = [] + for (let i = 0; i < newSelectionModel.row.list_choix.length; i++) { + tmp_tab.push(newSelectionModel.row.list_choix[i]['reponse_qcm']); + } + settab_qcm_choix(tmp_tab); + } + + console.log(" ") + if (newSelectionModel.row.list_case_cocher) { + var tmp_tab_checkbox = [] + for (let i = 0; i < newSelectionModel.row.list_case_cocher.length; i++) { + tmp_tab_checkbox.push(newSelectionModel.row.list_case_cocher[i]['reponse_checkbox']); + + } + + settab_checkbox_choix(tmp_tab_checkbox); + } + + setDialog_Question_open(true); + + }} + + rowsPerPageOptions={[10]} + //disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + //sx={datagridSx} + + getRowClassName={(params) => { + // 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, + + } + }} + + /> + +
+ +
} +
+
+
+   +
+ +
+ + + +
+
+   +
+
-
Code
-
+
+ } - {New_Option_type_Formulaire.length > 0 &&
Type
- - InputLabelProps={{ - shrink: true, - }} - disabled={false} - className="disabled_style" - value={New_Option_type_Formulaire.filter((data) => (data).value === String(p_detail_from_type))[0].label} - /> -
} +
+
+ +
Code
+ { + setp_detail_from_code(e.target.value); + setconfig_data_changed("1"); + }} + /> +
+ + + {String(form_edit_mode) === "1" && New_Option_type_Formulaire.length > 0 &&
Type
+ (data).value === String(p_detail_from_type))[0].label} + + onChange={(event, value) => { + setconfig_data_changed("1"); + if (value && value.value) { + setp_detail_from_type(value.value); + } else { + setp_detail_from_type(""); + } + }} + + renderInput={(params) => + } + /> +
} + +
Nom
+ { + setp_detail_from_nom(e.target.value); + setconfig_data_changed("1"); + }} + /> +
+ +
Description
+ { + setp_detail_from_description(e.target.value); + setconfig_data_changed("1"); + }} + /> +
+ +
Message d'introduction
+ { + setp_detail_from_message_intro(e.target.value); + setconfig_data_changed("1"); + }} + multiline={true} + rows={2} + /> +
+ +
Commentaire
+ { + setp_detail_from_commentaire(e.target.value); + setconfig_data_changed("1"); + }} + /> +
-
Nom
-
-
Description
- -
- -
Message d'introduction
- -
- - -
Commentaire
- -
- -
@@ -2051,9 +2403,6 @@ const Partner_Config_Formulaires = (props) => { question: (item).question, type: (item).type, max_note: (item).max_note, - list_choix: (item).list_choix, - list_case_cocher: (item).list_case_cocher, - } ))} @@ -2064,31 +2413,8 @@ const Partner_Config_Formulaires = (props) => { disableSelectionOnClick onRowDoubleClick={(newSelectionModel) => { - setselected_question_id(newSelectionModel.row._id); - setquestion_question(newSelectionModel.row.question); - setquestion_type(newSelectionModel.row.type); - setquestion_max_note(newSelectionModel.row.max_note); - - if (newSelectionModel.row.list_choix) { - var tmp_tab = [] - for (let i = 0; i < newSelectionModel.row.list_choix.length; i++) { - tmp_tab.push(newSelectionModel.row.list_choix[i]['reponse_qcm']); - } - settab_qcm_choix(tmp_tab); - } - - console.log(" ") - if (newSelectionModel.row.list_case_cocher) { - var tmp_tab_checkbox = [] - for (let i = 0; i < newSelectionModel.row.list_case_cocher.length; i++) { - tmp_tab_checkbox.push(newSelectionModel.row.list_case_cocher[i]['reponse_checkbox']); - - } - - settab_checkbox_choix(tmp_tab_checkbox); - } - - setDialog_Question_open(true); + /* setgridline_id(newSelectionModel.row.id); + handleClick_edit_config_From_Line(newSelectionModel.row.id);*/ }} @@ -2131,446 +2457,20 @@ const Partner_Config_Formulaires = (props) => {
 
- -
- - - -
-
-   -
-
- - -
- -
} - - {String(add_new_form) !== "1" && String(display_form) === "1" && String(form_edit_mode) === "1" &&
- -
-
- -
Code
- { - setp_detail_from_code(e.target.value); - setconfig_data_changed("1"); - }} - /> -
- - - {String(form_edit_mode) === "1" && New_Option_type_Formulaire.length > 0 &&
Type
- (data).value === String(p_detail_from_type))[0].label} - - onChange={(event, value) => { - setconfig_data_changed("1"); - if (value && value.value) { - setp_detail_from_type(value.value); - } else { - setp_detail_from_type(""); - } - }} - - renderInput={(params) => - } - /> -
} - -
Nom
- { - setp_detail_from_nom(e.target.value); - setconfig_data_changed("1"); - }} - /> -
- -
Description
- { - setp_detail_from_description(e.target.value); - setconfig_data_changed("1"); - }} - /> -
- -
Message d'introduction
- { - setp_detail_from_message_intro(e.target.value); - setconfig_data_changed("1"); - }} - multiline={true} - rows={2} - /> -
- -
Commentaire
- { - setp_detail_from_commentaire(e.target.value); - setconfig_data_changed("1"); - }} - /> -
- - - - -
- -
- - -
- -
- - {p_detail_from_list_question && p_detail_from_list_question.length > 0 &&
-   - - { - setSelectionModel_question(newSelectionModel); - - }} - selectionModel={selectionModel} - - localeText={frFR.components.MuiDataGrid.defaultProps.localeText} - rows={p_detail_from_list_question.map((item, index) => ( - { - id: index, - _id: (item)._id, - question: (item).question, - type: (item).type, - max_note: (item).max_note, - - } - ))} - - columns={columns_question} - pageSize={10} - className="datagridclass" - disableSelectionOnClick - onRowDoubleClick={(newSelectionModel) => { - - /* setgridline_id(newSelectionModel.row.id); - handleClick_edit_config_From_Line(newSelectionModel.row.id);*/ - - }} - - rowsPerPageOptions={[10]} - //disableSelectionOnClick - components={{ - Toolbar: GridToolbar, - }} - //sx={datagridSx} - - getRowClassName={(params) => { - // 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, - - } - }} - - /> - -
- -
} -
-
-
-   -
- {String(config_data_changed) === "1" &&
- /!\ Pensez à enregistrer les modifications -
} -
- -
- - - -
- -
- -
-
- - - -
-   -
-
- -
} - - {String(add_new_form) === "1" &&
- -
- Ajouter un nouveau formulaire -
- -
Code
- { - setp_detail_one_from_code(e.target.value); - - }} - /> -
- - {New_Option_type_Formulaire &&
Type
- (data).value === String(p_detail_one_from_type))[0].label} - - onChange={(event, value) => { - if (value && value.value) { - setp_detail_one_from_type(value.value); - } else { - setp_detail_one_from_type(""); - } - }} - - renderInput={(params) => - } - /> -
} - - -
Nom
- { - setp_detail_one_from_nom(e.target.value); - - }} - /> -
- -
Description
- { - setp_detail_one_from_description(e.target.value); - - }} - /> -
- -
Message d'introduction
- { - setp_detail_one_from_message_intro(e.target.value); - - }} - /> -
- - -
Commentaire
- { - setp_detail_one_from_commentaire(e.target.value); - - }} - /> -
- - -
-
-   -
- + {String(config_data_changed) === "1" &&
+ /!\ Pensez à enregistrer les modifications +
}
-
-
@@ -2582,13 +2482,180 @@ const Partner_Config_Formulaires = (props) => {
+
+ } + + { + String(add_new_form) === "1" &&
+ +
+ Ajouter un nouveau formulaire +
+ +
Code
+ { + setp_detail_one_from_code(e.target.value); + + }} + /> +
+ + {New_Option_type_Formulaire &&
Type
+ (data).value === String(p_detail_one_from_type))[0].label} + + onChange={(event, value) => { + if (value && value.value) { + setp_detail_one_from_type(value.value); + } else { + setp_detail_one_from_type(""); + } + }} + + renderInput={(params) => + } + /> +
} + + +
Nom
+ { + setp_detail_one_from_nom(e.target.value); + + }} + /> +
+ +
Description
+ { + setp_detail_one_from_description(e.target.value); + + }} + /> +
+ +
Message d'introduction
+ { + setp_detail_one_from_message_intro(e.target.value); + + }} + /> +
+ + +
Commentaire
+ { + setp_detail_one_from_commentaire(e.target.value); + + }} + /> +
+ + +
+
+   +
+ +
+ +
+ + + +
+ +
+ +
+
+ + + +
+   +
+
+ + +
+
+ } - -
} - -
+
) }