diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 624f99f..216207a 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -795,9 +795,10 @@ const DisplayPartnerSession = (props) => { const columns_list_evaluation = [ { field: 'id', headerName: 'id', hide: true }, - { field: 'email', headerName: 'email', width: 200, hideable: true, resizable: true }, - { field: 'nom', headerName: 'nom', width: 200, hide: false, editable: true }, - { field: 'prenom', headerName: 'prenom', width: 200, hide: false, editable: false }, + { field: '_id', headerName: '_id', hide: true }, + { field: 'email', headerName: 'email', width: 200, hideable: true, resizable: true, renderCell: (params) => }, + { field: 'nom', headerName: 'nom', width: 200, hide: false, editable: true, renderCell: (params) => }, + { field: 'prenom', headerName: 'prenom', width: 200, hide: false, editable: false, renderCell: (params) => }, { field: 'eval_status', headerName: 'Statut', width: 100, editable: false, flex: true, valueFormatter: (params) => { @@ -809,10 +810,23 @@ const DisplayPartnerSession = (props) => { return "A envoyer"; }, }, - { field: 'eval_eval', headerName: 'Evaluation', width: 100, editable: false, flex: true }, + { + field: 'date_demande_eval', headerName: 'Date demande', width: 150, editable: false, + valueFormatter: (params) => { + return String(params.value).substring(0, 16) + + }, + }, + { 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, }, + { + 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) => { @@ -1634,6 +1648,11 @@ const DisplayPartnerSession = (props) => { document.getElementById("sequence_session").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"; + } } function submenu_inscrit() { @@ -1681,6 +1700,12 @@ const DisplayPartnerSession = (props) => { document.getElementById("emargement").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"; + } + } async function submenu_detail_session() { @@ -1732,6 +1757,12 @@ const DisplayPartnerSession = (props) => { document.getElementById("emargement").style.color = "black"; document.getElementById("emargement").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"; + } } async function submenu_sequence_session() { @@ -1779,6 +1810,11 @@ const DisplayPartnerSession = (props) => { document.getElementById("historique").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("emargement")) { document.getElementById("emargement").style.backgroundColor = "#d8edfc"; @@ -1808,6 +1844,12 @@ const DisplayPartnerSession = (props) => { 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"; @@ -1857,6 +1899,12 @@ const DisplayPartnerSession = (props) => { document.getElementById("historique").style.fontWeight = "bold"; } + 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"; @@ -1919,6 +1967,12 @@ const DisplayPartnerSession = (props) => { document.getElementById("inscrit").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("detail_session")) { document.getElementById("detail_session").style.backgroundColor = "#d8edfc"; document.getElementById("detail_session").style.color = "black"; @@ -1950,6 +2004,68 @@ const DisplayPartnerSession = (props) => { } } + async function submenu_evaluation() { + setsubmenu("evaluation"); + + //await sleep(5); + if (!edit_session_form) { + desableSessionFields(); + } + + if (document.getElementById("evaluation")) { + document.getElementById("evaluation").style.backgroundColor = "#104277"; + document.getElementById("evaluation").style.color = "white"; + document.getElementById("evaluation").style.fontWeight = "bold"; + } + + + 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("editique")) { + document.getElementById("editique").style.backgroundColor = "#d8edfc"; + document.getElementById("editique").style.color = "black"; + document.getElementById("editique").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"; + } + + GetListeEvaluation(selected_session_id); + + } function handleClickSessionManagement(event, cellValues) { @@ -5914,6 +6030,54 @@ const DisplayPartnerSession = (props) => { }) } + + function SendEvaluationEmail_Many_Ids(local_tab_ids) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", selected_session_id); + form.append("tab_ids", local_tab_ids); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/SendTrainingEvaluationEmail_from_tab_ids/"; + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In SendEvaluationEmail res.data.status = " + res.data.status); + //console.log(" In SendEvaluationEmail res.data.message r_class = " + res.data.message); + setSendEvaluationEmail_api("true"); + setSendEvaluationEmail_result(res.data.message); + + setSelectionModel_evaluation([]); + setactionmass_eval_val(); + GetListePreinscrit(selected_session_id, selected_internal_url); + GetListeInscrit(selected_session_id, selected_internal_url); + GetListeEmargement(selected_session_id, selected_internal_url); + GetListeEvaluation(selected_session_id); + + alert(res.data.message); + + } else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setSendEvaluationEmail_api("false"); + setSendEvaluationEmail_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( SendEvaluationEmail = ', error); + setSendEvaluationEmail_api("false"); + alert(" Impossible d'envoyer les demande d'évaluation") + + }) + } + const [attendee_lms_pwd, setattendee_lms_pwd] = useState(); const [SendAttendeeAttestation_api, setSendAttendeeAttestation_api] = useState(); @@ -7931,6 +8095,11 @@ const DisplayPartnerSession = (props) => { { "id": "demande emargement", "label": "Envoyer demande émargement", "value": "demande emargement" }, ] + + const New_Option_Evaluation_Masse = [ + { "id": "demande evaluation", "label": "Envoyer demande Evaluation", "value": "demande evaluation" }, + ] + const [actionmass_emarg_val, setactionmass_emarg_val] = useState(); const actionmass_emarg = (event) => { const value = event.target.value; @@ -7956,6 +8125,9 @@ const DisplayPartnerSession = (props) => { } + + + async function actionmass_emarge_Traitemet() { var liste_formation = GetSelectedRows_Emarg_Ids(); @@ -8724,6 +8896,169 @@ const DisplayPartnerSession = (props) => { + /* Recuperation des evaluations */ + const [selectionModel_evaluation, setSelectionModel_evaluation] = React.useState([]); + const [rowss_evaluation, setRows_evaluation] = useState([]); + const [GetListePreinscrit_evaluation_api, setGetListePreinscrit_evaluation_api] = useState(); + const [GetListePreinscrit_evaluation_meassage, setGetListePreinscrit_evaluation_meassage] = useState(); + const [GetListePreinscrit_evaluation_result, setGetListePreinscrit_evaluation_result] = useState([]) + function GetListeEvaluation(localsessionid) { + clean_old_messages(); + var form = new FormData(); + //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", localsessionid); + + + /* + /!\ : Cette fonction a besoin d'un token actif + */ + + if (String(stored_cookie) === String("")) { + alert(" La session n'est plus valide "); + history.push("/Connexion"); + return; + } + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetListEvaluation_Session/"; + + setLoading(true); + fetch(myurl, + { + method: 'POST', + body: form, + }) + .then((data) => data.json()) + .then((data) => { + setLoading(false); + console.log('GetListeEvaluation -- Success:', data['message'], "data['status'] = ", data['status']); + setGetListePreinscrit_evaluation_result(data['message']); + setRows_evaluation(data['message']); + if (String(data['status']) === String("Err_Connexion")) { + alert('Erreur: ' + data['message']); + history.push("/Connexion"); + } + else if (String(data['status']) === String("true")) { + setGetListePreinscrit_evaluation_api("true"); + + } else { + //console.log("GetListeEvaluation rrrr:" + data['status']) + setGetListePreinscrit_evaluation_api("false"); + + } + + }).catch((error) => { + setLoading(false); + console.error('Error:', error); + setGetListePreinscrit_evaluation_api("false"); + alert(" Impossible de récuperer les données pour les avis ") + }); + + } + + + + const [actionmass_eval_val, setactionmass_eval_val] = useState(); + const actionmass_evaluation = (event) => { + const value = event.target.value; + + //console.log(" ### actionmass_evaluation = ", value); + + if (String(value) === "demande evaluation") { + setactionmass_eval_val(value); + //console.log(" ### LAAA = ", value); + } + + else { + setactionmass_eval_val(); + } + } + + function GetSelectedRows_Evaluation_Ids() { + + var tab_tmp = [] + for (var i = 0; i < selectionModel_evaluation.length; i++) { + var myid = parseInt(String(selectionModel_evaluation[i])); + //var line = JSON.parse(rowss[myid]); + tab_tmp.push(myid); + } + return tab_tmp; + + } + + + + async function actionmass_Evaluation_Traitemet() { + var liste_formation = GetSelectedRows_Evaluation_Ids(); + + + var tab_ids_inscription = [] + for (var i = 0; i < selectionModel_evaluation.length; i++) { + var myid = parseInt(String(selectionModel_evaluation[i])); + var line = JSON.parse(rowss_evaluation[myid]); + var line_id = JSON.parse(rowss_evaluation[myid])._id; + + tab_ids_inscription.push(line_id); + } + + + SendEvaluationEmail_Many_Ids(tab_ids_inscription); + + + } + + function PrintEvaluationDetail() { + + var filedetail = "detail_evaluation.xlsx" + + const stored_cookie = getCookie('tokenmysypart'); + + var url = process.env.REACT_APP_API_URL + "myclass/api/DownloadEvaluationList/" + stored_cookie + "/" + selected_session_id + "/" + selected_internal_url; + + setLoading(true); + axios.get(url, { responseType: 'blob', },) + .then((res) => { + setLoading(false); + fileDownload(res.data, filedetail) + }) + } + + const datagridSx_evaluation = { + borderRadius: 2, + marginRight: 1, + marginLeft: 1, + border: 0, + overflowX: 'scroll', + "& .MuiDataGrid-main": { borderRadius: 0 }, + /*'& div[data-rowIndex][role="row"]:nth-of-type(5n-4)': { + color: "blue", + fontSize: 18, + //risky + minHeight: "60px !important", + height: 60, + "& div": { + minHeight: "60px !important", + height: 60, + lineHeight: "59px !important" + } + },*/ + "& .MuiDataGrid-virtualScrollerRenderZone": { + "& .MuiDataGrid-row": { + "&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" } + } + }, + "& .MuiDataGrid-columnHeaders": { + backgroundColor: "#c8cfd5", + color: "black", + fontSize: 16 + }, + + [`& .${gridClasses.cell}`]: { + py: 1, + }, + + }; return (
@@ -10171,8 +10506,9 @@ const DisplayPartnerSession = (props) => { - + +
} @@ -14869,6 +15205,158 @@ const DisplayPartnerSession = (props) => { } + {String(submenu) === String("evaluation") &&
+ +
+ +
+
+
+ + { + setSelectionModel_evaluation(newSelectionModel_evaluation); + //console.log("ch selected--" + newSelectionModel_evaluation); + + }} + + selectionModel={selectionModel_evaluation} + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={rowss_evaluation.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + 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, + + } + ))} + + columns={columns_list_evaluation} + pageSize={10} + className="datagridclass" + + rowsPerPageOptions={[10]} + disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + + + /> + + {selectionModel_evaluation && selectionModel_evaluation.length >= 1 && +
+
+
+   + {/*    */} + + { + if (value && value.value) { + if (String(value.value) === "demande evaluation") { + + setactionmass_eval_val(value.value); + + } + else { + setactionmass_eval_val(""); + } + + } + + }} + + renderInput={(params) => + } + /> + + + {actionmass_eval_val && + + Traiter + + } + modal + nested + position="center center" + > + + {close => ( +
+ +
MySy Information
+
+ {' '} + + Confirmer l'action {actionmass_eval_val} en masse. +
+
+
+ + +
+
+ +
+
+
+ )} +
+ } +
+ + +
+ } + +
+ + + + +
+ + +
} + diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js index e78478b..3dea8cc 100644 --- a/src/components/GestionAdministrative.js +++ b/src/components/GestionAdministrative.js @@ -3494,12 +3494,8 @@ function GestionAdministrative(props) { const stored_cookie = getCookie('tokenmysypart'); - - var url = process.env.REACT_APP_API_URL + "myclass/api/DownloadEvaluationList/" + stored_cookie + "/" + mysession + "/" + internal_url; - - axios.get(url, { responseType: 'blob', },) .then((res) => { fileDownload(res.data, filedetail) @@ -6248,7 +6244,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair

Gestion Administrative de : {classtitle}

- isLoading = {isLoading}
+
diff --git a/src/components/Module_Editique.js b/src/components/Module_Editique.js index df3bf41..ab24131 100644 --- a/src/components/Module_Editique.js +++ b/src/components/Module_Editique.js @@ -925,6 +925,17 @@ const Module_Editique = (props) => { { "id": "pdf", "label": "PDF", "value": "pdf" }, ] + + const [Dialog_EVALUATION_FORMATION_open, setDialog_EVALUATION_FORMATION_open] = React.useState(false); + const Dialog_EVALUATION_FORMATION_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_EVALUATION_FORMATION_handleClose_buton = () => { + setDialog_EVALUATION_FORMATION_open(false); + }; + return (
@@ -1056,8 +1067,6 @@ const Module_Editique = (props) => {
- -
@@ -1069,6 +1078,47 @@ const Module_Editique = (props) => { {/* FIN Dialog pour gerer les EMARGEMENT_FORMATION */} + {/* Dialog pour gerer les EVALUATION_FORMATION */} + + + MySy Information + + +
+ Cliquez sur l'onglet 'LES AVIS' pour la gestion des évaluations :
+
    + +
  • Envoyer les demandes d'évaluation
  • +
  • Visualiser et exporter les évaluations
  • +
  • etc
  • +
+
+
+
+ + +
+
+   + +
+ +
+ +
+
+ +
+ +
+ + {/* FIN Dialog pour gerer les EVALUATION_FORMATION */} + + {/* Dialog pour gerer les CONVOCATION_STAGIAIRE */} { {/* FIN Dialog pour gerer les conventions */} -

Module Editique

+
@@ -1750,7 +1800,7 @@ const Module_Editique = (props) => { setDialog_EMARGEMENT_FORMATION_open(true); } else if (String(JSON.parse(document).courrier_template_ref_interne) === "CONVOCATION_STAGIAIRE") { - console.log(" ### Dialog_CONVOCATION_STAGIAIRE_open"); + Get_List_Stagiaire_Convocations(String(JSON.parse(document).courrier_template_ref_interne), String(JSON.parse(document).courrier_template_nom), String(JSON.parse(document).courrier_template_type_doc) ); setDialog_CONVOCATION_STAGIAIRE_open(true); @@ -1760,6 +1810,10 @@ const Module_Editique = (props) => { setDialog_CONF_INSCRIPTION_open(true); } + else if (String(JSON.parse(document).courrier_template_ref_interne) === "EVALUATIONS") { + setDialog_EVALUATION_FORMATION_open(true); + } + }}> {(JSON.parse(document).courrier_template_nom)}
diff --git a/src/styles/components/_displaypartnersession.scss b/src/styles/components/_displaypartnersession.scss index 59e588c..ad80d52 100644 --- a/src/styles/components/_displaypartnersession.scss +++ b/src/styles/components/_displaypartnersession.scss @@ -635,7 +635,8 @@ width: 100%; float: left; margin-bottom: 1rem; - margin-left: 15px; + margin-top: 15px; + margin-left: 0px; } .block_en_mass_select { @@ -1272,7 +1273,8 @@ width: 50%; float: left; margin-bottom: 1rem; - margin-left: 15px; + margin-top: 15px; + margin-left: 0px; } .block_en_mass_select { @@ -1833,7 +1835,8 @@ width: 50%; float: left; margin-bottom: 1rem; - margin-left: 15px; + margin-top: 15px; + margin-left: 0px; } .block_en_mass_select { @@ -2512,7 +2515,8 @@ width: 50%; float: left; margin-bottom: 1rem; - margin-left: 15px; + margin-top: 15px; + margin-left: 0px; } .block_en_mass_select { diff --git a/src/styles/components/_gestionadministrative.scss b/src/styles/components/_gestionadministrative.scss index 8710dc6..bf13176 100644 --- a/src/styles/components/_gestionadministrative.scss +++ b/src/styles/components/_gestionadministrative.scss @@ -386,12 +386,14 @@ background: #c8cfd5; color: black; width: 100%; + height: 2rem !important; } .bton_import_excel { background: #c8cfd5; color: black; width: 100% !important; + height: 2rem !important; } .div_row_gauche_etendu { @@ -813,12 +815,14 @@ background: #c8cfd5; color: black; width: 30%; + height: 2rem !important; } .bton_import_excel { background: #c8cfd5; color: black; width: 65% !important; + height: 2rem !important; } .div_row_gauche_etendu { @@ -1231,12 +1235,14 @@ background: #c8cfd5; color: black; width: 40%; + height: 2rem !important; } .bton_import_excel { background: #c8cfd5; color: black; width: 50% !important; + height: 2rem !important; } .div_row_gauche_etendu { @@ -1587,12 +1593,14 @@ background: #c8cfd5; color: black; width: 25% !important; + height: 2rem !important; } .bton_import_excel { background: #c8cfd5; color: black; width: 30% !important; + height: 2rem !important; } .div_row_gauche_etendu {