diff --git a/src/components/Dashbord_Ressources_Humaines.js b/src/components/Dashbord_Ressources_Humaines.js new file mode 100644 index 0000000..0261c6c --- /dev/null +++ b/src/components/Dashbord_Ressources_Humaines.js @@ -0,0 +1,572 @@ +import React, { useRef, useState, useEffect } from "react"; +import TextField from '@mui/material/TextField'; +import MenuItem from '@mui/material/MenuItem'; +import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css +import Button from '@mui/material/Button'; +import axios from "axios"; +import { getCookie, setCookie } from 'react-use-cookie'; +import { useHistory } from "react-router-dom"; +import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; +import 'react-tooltip/dist/react-tooltip.css' +import { Tooltip } from 'react-tooltip' +import 'reactjs-popup/dist/index.css'; +import DatePicker from "react-datepicker"; +import "react-datepicker/dist/react-datepicker.css"; +import { format } from 'date-fns' +import moment from "moment"; +import Box from '@mui/material/Box'; +import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; +import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; +import { tokens } from "./../theme"; +import { MdOutlineAddchart, } from "react-icons/md"; +import { + useTheme, +} from "@mui/material"; + +import { ResponsivePie } from '@nivo/pie' +import { ResponsiveBar } from "@nivo/bar"; + +import { TbColumns2, TbColumns1 } from "react-icons/tb"; + +const Dashbord_Ressources_Humaines = (props) => { + + const history = useHistory(); + const [isLoading, setLoading] = useState(); + + const theme = useTheme(); + const colors = tokens(theme.palette.mode); + + const [isMySyDashboard, setisMySyDashboard] = useState(false); + + var date_today_90j = new Date(); + date_today_90j.setDate(date_today_90j.getDate() - 90); + const [selectionModel, setSelectionModel] = React.useState([]); + + + const columns = [ + { field: 'id', headerName: 'id', hide: true }, + { field: '_id', headerName: '_id', hide: true }, + + { field: 'civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, maxWidth: 60 }, + { field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 20 }, + { field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 }, + { field: 'email', headerName: 'Email', hide: false, flex: 1, minWidth: 200 }, + { field: 'ismanager', headerName: 'Manager', hide: false, minWidth: 50, flex: 1, maxWidth: 100 }, + { field: 'fonction', headerName: 'Fonction', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, + + { field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 200, flex: 1, }, + { field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, + { field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 100, flex: 1, maxWidth: 100 }, + { field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 50, flex: 1, maxWidth: 100 }, + { field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, + { field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 }, + { field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 }, + { field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1 }, + + + ] + + + const [p_filter_date_from, setp_filter_date_from] = useState(date_today_90j.toLocaleDateString('fr-FR')); + const [p_filter_date_to, setp_filter_date_to] = useState(new Date().toLocaleDateString('fr-FR')); + + + const [filter_value, setfilter_value] = useState("d"); + + const [filter_type_tache, setfilter_type_tache] = useState(""); + + const [tdb_title, settdb_title] = useState(); + + const [display_nb_column, setdisplay_nb_column] = useState("1"); + const [display_column_size, setdisplay_column_size] = useState("50%"); + + + + const [Getall_Qry_RH_Data_result_JSON, setGetall_Qry_RH_Data_result_JSON] = useState([]); + const [Getall_Qry_RH_Data_api, setGetall_Qry_RH_Data_api] = useState(); + const [Getall_Qry_RH_Data_message, setGetall_Qry_RH_Data_message] = useState(); + const [Getall_Qry_RH_Data_result, setGetall_Qry_RH_Data_result] = useState([]); + function Getall_Qry_RH_Data(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + var date_from = ""; + if (p_filter_date_from) { + date_from = p_filter_date_from; + + } + + var date_to = ""; + if (p_filter_date_to) { + date_to = p_filter_date_to; + + } + + + form.append("token", stored_cookie); + form.append("session_start_date", date_from); + form.append("session_end_date", date_to); + form.append("filter_value", filter_value); + form.append("tab_rh_id", "all"); + + form.append("event_type", filter_type_tache); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Humain_Ressource_With_Planning/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Qry_RH_Data res.data.status = " + res.data.status); + //console.log(" In Getall_Qry_RH_Data res.data.message r_class = " + res.data.message); + + setGetall_Qry_RH_Data_result_JSON(JSON.parse('[' + res.data.message + ']')); + + var jsonObj = JSON.parse('[' + res.data.message + ']'); + + setGetall_Qry_RH_Data_api("true"); + setGetall_Qry_RH_Data_result(res.data.message); + + + } + else { + setGetall_Qry_RH_Data_api("false"); + setGetall_Qry_RH_Data_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Qry_RH_Data = ', error); + setGetall_Qry_RH_Data_api("false"); + alert("Impossible de récuperer les données demandées") + //setmyApimyApiMessage("") + }) + } + + const [dashbord_internal_code, setdashbord_internal_code] = useState(""); + const [gridline_id, setgridline_id] = useState(""); + + const [Add_To_User_TBD_api, setAdd_To_User_TBD_api] = useState(); + const [Add_To_User_TBD_message, setAdd_To_User_TBD_message] = useState(); + const [Add_To_User_TBD_result, setAdd_To_User_TBD_result] = useState(); + function Add_To_User_TBD(local_dashbord_internal_code) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + //console.log(" ### dashbord_internal_code = ", local_dashbord_internal_code); + + var tdb_title = "default"; + var filter_val = ""; + var filter_type_event = ""; + + + if (document.getElementsByName("tdb_title")[0]) { + tdb_title = document.getElementsByName("tdb_title")[0].value; + } + + if (document.getElementsByName("filtre11")[0]) { + filter_val = document.getElementsByName("filtre11")[0].value; + } + + if (document.getElementsByName("filtre12")[0]) { + filter_type_event = document.getElementsByName("filtre12")[0].value; + } + + // Si filter_val = "d", alors on va recuperer l'interval de date + if (String(filter_val) === "d") { + var date_from = p_filter_date_from; + var date_to = p_filter_date_to; + + + filter_val = "{'session_start_date':'" + String(date_from) + "' , 'session_end_date':'" + String(date_to) + "'}"; + } else { + filter_val = "{'periode':'" + String(filter_val) + "'}" + } + + form.append("token", stored_cookie); + form.append("dashbord_internal_code", local_dashbord_internal_code); + form.append("default_filter", filter_val); + form.append("title", tdb_title); + form.append("type_event", filter_type_event); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_To_User_Dashbord/"; + + //console.log(" ## myurl = ", myurl); + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Add_To_User_TBD res.data.status = " + res.data.status); + //console.log(" In Add_To_User_TBD res.data.message r_class = " + res.data.message); + + setAdd_To_User_TBD_api("true"); + setAdd_To_User_TBD_result(res.data.message); + settdb_title(); + alert(res.data.message) + + + } + else { + setAdd_To_User_TBD_api("false"); + setAdd_To_User_TBD_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Add_To_User_TBD = ', error); + setAdd_To_User_TBD_api("false"); + alert("Impossible d'ajouter le tableau de bord"); + //setmyApimyApiMessage("") + }) + } + + + + useEffect(() => { + Getall_Qry_RH_Data(); + + window.scrollTo({ + top: 0, + behavior: "smooth", + }); + + }, []) + + + return ( +
+ {isLoading &&
+
+
} + +

Tableaux de bord des ressources humaines (Employés)

+
 
+
Affichage   + + + { + setdisplay_nb_column("1"); + setdisplay_column_size("100%"); + + }} /> +     + + + { + setdisplay_nb_column("2"); + setdisplay_column_size("50%"); + + }} /> +
+ +
+
+ Filtre
+ { + setfilter_value(e.target.value); + } + } + + > + Mois en cours    + Mois précédant   + Choisir des dates   + +
+ + {filter_value && String(filter_value) === "d" &&
+
+ Date Debut + { + setp_filter_date_from(format(date, 'dd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style session_caract_Dialog_DatePicker" + locale='fr-FR' + + /> + +
+ +
+ Date Fin + { + setp_filter_date_to(format(date, 'dd/MM/yyyy')); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style enable_style" + /> + +
+ +
} +
+
+ Type Tache
+ { + setfilter_type_tache(e.target.value); + } + } + + > + Absence    + Planning   + Autre   +   + +
+ +
+ + +
+ + +
+ + +
+
+ + + + + +
+ + {tdb_title && String(tdb_title) === "3" && } + + +   + +
+
+ +
+   + + { + setSelectionModel(newSelectionModel); + /*if (newSelectionModel.length === 1) + handleClick_edit_session_From_Line(newSelectionModel);*/ + if (newSelectionModel.length !== 1) { + /* setaddOneParticipant(); + setdisplay_detail_insc(); + setselected_code_session(); + setsubmenu();*/ + } + }} + selectionModel={selectionModel} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={Getall_Qry_RH_Data_result.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + civilite: JSON.parse(item).civilite, + nom: JSON.parse(item).nom, + prenom: JSON.parse(item).prenom, + email: JSON.parse(item).email, + ismanager: JSON.parse(item).ismanager, + fonction: JSON.parse(item).fonction, + agenda_event_title: JSON.parse(item).agenda_event_title, + agenda_event_code_session: JSON.parse(item).agenda_event_code_session, + agenda_event_type: JSON.parse(item).agenda_event_type, + agenda_date_jour: JSON.parse(item).agenda_date_jour, + agenda_event_start: JSON.parse(item).agenda_event_start, + agenda_event_end: JSON.parse(item).agenda_event_end, + event_duration_hour: JSON.parse(item).event_duration_hour, + agenda_event_sequence_session_id: JSON.parse(item).agenda_event_sequence_session_id, + + } + ))} + + columns={columns} + pageSize={10} + className="datagridclass" + + onRowDoubleClick={(newSelectionModel) => { + /*setgridline_id(newSelectionModel.row.id); + setaddOneSession("0"); + setEdite_session("0"); + //handleClick_edit_session_From_Line(newSelectionModel.row.id); + + setselected_session_id(newSelectionModel.row._id); + + setsession_selected_row_id(newSelectionModel.row.id); + + setDialog_2_message(String(JSON.parse(rowss[newSelectionModel.row.id]).title)); + setDialog_2_open(true);*/ + + }} + + + + rowsPerPageOptions={[10]} + disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + //sx={datagridSx} + getCellClassName={(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'; + } + + }} + + 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'; + } + + }} + + + /> + +
+ +
+ +
+ +
+ + + +
+ +
+ +
+ + +
) +} + + +export default Dashbord_Ressources_Humaines; + diff --git a/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js b/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js new file mode 100644 index 0000000..045875a --- /dev/null +++ b/src/components/Dashbord_Ressources_Humaines_Tache_by_rhid.js @@ -0,0 +1,460 @@ +import React, { useRef, useState, useEffect } from "react"; +import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css +import axios from "axios"; +import { getCookie, setCookie } from 'react-use-cookie'; +import { useHistory } from "react-router-dom"; +import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; +import 'react-tooltip/dist/react-tooltip.css' +import { Tooltip } from 'react-tooltip' +import fileDownload from 'js-file-download' +import Popup from 'reactjs-popup'; +import 'reactjs-popup/dist/index.css'; +import "react-datepicker/dist/react-datepicker.css"; +import Box from '@mui/material/Box'; +import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; +import { tokens } from "../theme"; +import { MdDeleteForever } from "react-icons/md"; +import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; +import { + useTheme, +} from "@mui/material"; + +import { ResponsiveBar } from "@nivo/bar"; + +import { RiFileExcel2Line } from "react-icons/ri"; + +const Dashbord_Ressources_Humaines_Tache_by_rhid = (props) => { + const [gridline_id, setgridline_id] = useState(""); + const [isLoading, setLoading] = useState(); + const [selectionModel, setSelectionModel] = React.useState([]); + const [user_dashbord_id, setuser_dashbord_id] = useState(props.user_dashbord_id); + + var date_today_90j = new Date(); + date_today_90j.setDate(date_today_90j.getDate() - 90); + + const columns = [ + { field: 'id', headerName: 'id', hide: true }, + { field: '_id', headerName: '_id', hide: true }, + + { field: 'civilite', headerName: 'Civ.', hide: false, minWidth: 50, flex: 1, maxWidth: 60 }, + { field: 'nom', headerName: 'Nom', hide: false, flex: 1, minWidth: 20 }, + { field: 'prenom', headerName: 'Prénom', hide: false, flex: 1, minWidth: 200 }, + { field: 'email', headerName: 'Email', hide: false, flex: 1, minWidth: 200 }, + { field: 'ismanager', headerName: 'Manager', hide: false, minWidth: 50, flex: 1, maxWidth: 100 }, + { field: 'fonction', headerName: 'Fonction', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, + + { field: 'agenda_event_title', headerName: 'Titre Event', hide: false, minWidth: 200, flex: 1, }, + { field: 'agenda_event_code_session', headerName: 'Code session', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, + { field: 'agenda_event_type', headerName: 'Type Event', hide: false, minWidth: 100, flex: 1, maxWidth: 100 }, + { field: 'event_duration_hour', headerName: 'Durée (h)', hide: false, minWidth: 50, flex: 1, maxWidth: 100 }, + { field: 'agenda_date_jour', headerName: 'Date', hide: false, minWidth: 100, flex: 1, maxWidth: 150 }, + { field: 'agenda_event_start', headerName: 'Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 }, + { field: 'agenda_event_end', headerName: 'Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 }, + { field: 'agenda_event_sequence_session_id', headerName: 'agenda_id', hide: true, maxWidth: 1 }, + + + ] + + const [p_filter_date_from, setp_filter_date_from] = useState(date_today_90j.toLocaleDateString('fr-FR')); + const [p_filter_date_to, setp_filter_date_to] = useState(new Date().toLocaleDateString('fr-FR')); + + const [event_type_filter, setevent_type_filter] = useState(props.user_dashbord_filter_type_envent); + + + const [filter_value, setfilter_value] = useState(""); + + const [Getall_Qry_RH_Data_result_JSON, setGetall_Qry_RH_Data_result_JSON] = useState([]); + const [Getall_Qry_RH_Data_api, setGetall_Qry_RH_Data_api] = useState(); + const [Getall_Qry_RH_Data_message, setGetall_Qry_RH_Data_message] = useState(); + const [Getall_Qry_RH_Data_result, setGetall_Qry_RH_Data_result] = useState([]); + function Getall_Qry_RH_Data(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + var date_from = ""; + if (p_filter_date_from) { + date_from = p_filter_date_from; + + } + + var date_to = ""; + if (p_filter_date_to) { + date_to = p_filter_date_to; + + } + + var event_type = ""; + if (event_type_filter) { + event_type = event_type_filter; + + } + + + form.append("token", stored_cookie); + form.append("session_start_date", date_from); + form.append("session_end_date", date_to); + form.append("filter_value", filter_value); + form.append("tab_rh_id", "all"); + + form.append("event_type", event_type); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Humain_Ressource_With_Planning/"; + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Qry_RH_Data res.data.status = " + res.data.status); + //console.log(" In Getall_Qry_RH_Data res.data.message r_class = " + res.data.message); + + setGetall_Qry_RH_Data_result_JSON(JSON.parse('[' + res.data.message + ']')); + + var jsonObj = JSON.parse('[' + res.data.message + ']'); + + setGetall_Qry_RH_Data_api("true"); + setGetall_Qry_RH_Data_result(res.data.message); + + + } + else { + setGetall_Qry_RH_Data_api("false"); + setGetall_Qry_RH_Data_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Qry_RH_Data = ', error); + setGetall_Qry_RH_Data_api("false"); + alert("Impossible de récuperer les données demandées") + //setmyApimyApiMessage("") + }) + } + + + + const [Remove_From_User_TBD_api, setRemove_From_User_TBD_api] = useState(); + const [Remove_From_User_TBD_message, setRemove_From_User_TBD_message] = useState(); + const [Remove_From_User_TBD_result, setRemove_From_User_TBD_result] = useState(); + function Remove_From_User_TBD() { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + + + form.append("token", stored_cookie); + form.append("user_dashbord_id", user_dashbord_id); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_To_User_Dashbord/"; + + //console.log(" ## myurl = ", myurl); + + setLoading(true); + axios.post(myurl, form).then(res => { + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Remove_From_User_TBD res.data.status = " + res.data.status); + //console.log(" In Remove_From_User_TBD res.data.message r_class = " + res.data.message); + + setRemove_From_User_TBD_api("true"); + setRemove_From_User_TBD_result(res.data.message); + Getall_Qry_RH_Data(); + alert(res.data.message); + window.location.reload(); + + + } + else { + setRemove_From_User_TBD_api("false"); + setRemove_From_User_TBD_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Remove_From_User_TBD = ', error); + setRemove_From_User_TBD_api("false"); + alert("Impossible de supprimer le tableau de bord de votre liste"); + //setmyApimyApiMessage("") + }) + } + + useEffect(() => { + + setp_filter_date_from(props.user_dashbord_filter_start); + setp_filter_date_to(props.user_dashbord_filter_end); + setevent_type_filter(props.user_dashbord_filter_type_envent); + + + Getall_Qry_RH_Data(); + + + window.scrollTo({ + top: 0, + behavior: "smooth", + }); + + }, []) + + + function Export_Dashbord_to_CSV(local_dashbord_internal_id) { + + const stored_cookie = getCookie('tokenmysypart'); + + var nom_fichier_cmd = "export_csv.csv"; + //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- local_dashbord_internal_id = ", local_dashbord_internal_id); + + var url = process.env.REACT_APP_API_URL + "myclass/api/TBD_RH_01_Export_Dashbord_To_Csv/" + stored_cookie + "/" + local_dashbord_internal_id; + + //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url); + 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 données (2) "); + } else { + fileDownload(res.data, nom_fichier_cmd) + + } + }).catch((error) => { + setLoading(false); + console.error('Error:', error); + alert(" Impossible d'exporter les données ") + + }); + + } + + return ( +
+ {isLoading &&
+
+
} + +
+ +
+ + + + + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, le tableau sera supprimé de votre tableau de bord global.
+ Vous pourrez le rajouter à nouveau si besoin.
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+
+ + + + + + +
+ + +   + +
+
+ +
+   + + { + setSelectionModel(newSelectionModel); + /*if (newSelectionModel.length === 1) + handleClick_edit_session_From_Line(newSelectionModel);*/ + if (newSelectionModel.length !== 1) { + /* setaddOneParticipant(); + setdisplay_detail_insc(); + setselected_code_session(); + setsubmenu();*/ + } + }} + selectionModel={selectionModel} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={Getall_Qry_RH_Data_result.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + civilite: JSON.parse(item).civilite, + nom: JSON.parse(item).nom, + prenom: JSON.parse(item).prenom, + email: JSON.parse(item).email, + ismanager: JSON.parse(item).ismanager, + fonction: JSON.parse(item).fonction, + agenda_event_title: JSON.parse(item).agenda_event_title, + agenda_event_code_session: JSON.parse(item).agenda_event_code_session, + agenda_event_type: JSON.parse(item).agenda_event_type, + agenda_date_jour: JSON.parse(item).agenda_date_jour, + agenda_event_start: JSON.parse(item).agenda_event_start, + agenda_event_end: JSON.parse(item).agenda_event_end, + event_duration_hour: JSON.parse(item).event_duration_hour, + agenda_event_sequence_session_id: JSON.parse(item).agenda_event_sequence_session_id, + + } + ))} + + columns={columns} + pageSize={10} + className="datagridclass" + + onRowDoubleClick={(newSelectionModel) => { + /*setgridline_id(newSelectionModel.row.id); + setaddOneSession("0"); + setEdite_session("0"); + //handleClick_edit_session_From_Line(newSelectionModel.row.id); + + setselected_session_id(newSelectionModel.row._id); + + setsession_selected_row_id(newSelectionModel.row.id); + + setDialog_2_message(String(JSON.parse(rowss[newSelectionModel.row.id]).title)); + setDialog_2_open(true);*/ + + }} + + + + rowsPerPageOptions={[10]} + disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + //sx={datagridSx} + getCellClassName={(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'; + } + + }} + + 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'; + } + + }} + + + /> + +
+ +
+ +
+ +
+ + +
+ +
+ +
+ ) +} + + +export default Dashbord_Ressources_Humaines_Tache_by_rhid; \ No newline at end of file diff --git a/src/components/Dashbord_Session.js b/src/components/Dashbord_Session.js index 7bcd061..868d225 100644 --- a/src/components/Dashbord_Session.js +++ b/src/components/Dashbord_Session.js @@ -307,8 +307,6 @@ const Dashbord_Session = (props) => { const [dashbord_internal_code, setdashbord_internal_code] = useState(""); useEffect(() => { - - Getall_Qry_Session_Data(); Getall_Qry_Session_Data_By_Trainer(); Getall_Qry_Session_Data_Pourcent_Trainer(); diff --git a/src/components/Dashbord_Session_Par_Fteur.js b/src/components/Dashbord_Session_Par_Fteur.js index ec673ee..024bb79 100644 --- a/src/components/Dashbord_Session_Par_Fteur.js +++ b/src/components/Dashbord_Session_Par_Fteur.js @@ -403,82 +403,6 @@ const Dashbord_Session_Par_Fteur = (props) => {
} - {/*
-
- Filtre
- { - setfilter_value(e.target.value); - } - } - - > - Mois en cours    - Trimestre en cours   - Choisir des dates   - -
- - {filter_value && String(filter_value) === "d" &&
-
- Date Debut - { - setp_filter_date_from(format(date, 'dd/MM/yyyy')); - - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style session_caract_Dialog_DatePicker" - locale='fr-FR' - - /> - -
- -
- Date Fin - { - setp_filter_date_to(format(date, 'dd/MM/yyyy')); - - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style enable_style" - /> - -
- -
} -
- - -
*/}
diff --git a/src/components/Dashbord_Session_Taux_Remplissage.js b/src/components/Dashbord_Session_Taux_Remplissage.js index 4e2582b..ff6c3b9 100644 --- a/src/components/Dashbord_Session_Taux_Remplissage.js +++ b/src/components/Dashbord_Session_Taux_Remplissage.js @@ -192,7 +192,7 @@ const Dashbord_Session_Taux_Remplissage = (props) => { var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Session_Data/"; - console.log(" ### form = ", form); + //console.log(" ### form = ", form); setLoading(true); axios.post(myurl, form).then(res => { diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index d862664..ef985ab 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -582,7 +582,7 @@ const DisplayPartnerSession = (props) => { onClick={(event) => { if (cellValues.row._id && String(cellValues.row._id).length > 2) { var tmp = selected_code_session + "&" + selected_session_id + "&" + selected_internal_url + "&" + cellValues.row.email; - + window.open( process.env.REACT_APP_FRONT_URL + "Partner/mes_stagiaires/" + String(cellValues.row._id) + "/" + String(tmp), '_blank' @@ -1111,6 +1111,7 @@ const DisplayPartnerSession = (props) => { const [selected_class_external_code, setselected_class_external_code] = useState(""); function handleClick_edit_session_From_Line(selected_row_id) { + setgridline_id(selected_row_id); setLoading(true); setaddOneSession("0"); @@ -3705,7 +3706,7 @@ const DisplayPartnerSession = (props) => { clean_old_messages(); var form = new FormData(); - + setLoading(true); var one_myclass_title = "" @@ -3880,7 +3881,7 @@ const DisplayPartnerSession = (props) => { var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation/"; - setLoading(true); + axios.post(myurl, form).then(res => { //console.log(" In One_CreateSessionFormation res.data.status = " + res.data.status); //console.log(" In One_CreateSessionFormation res.data.message r_class = " + res.data.message); @@ -7978,7 +7979,7 @@ const DisplayPartnerSession = (props) => { } - console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id); + //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_session_id = ", selected_session_id, " --- selected_convention_id =", selected_convention_id); setLoading(true); axios.get(url, { responseType: 'blob', },) .then((res) => { @@ -9324,6 +9325,22 @@ const DisplayPartnerSession = (props) => { }} + 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'; + } + + }} + /> diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js index 55cffbc..de3c5e3 100644 --- a/src/components/DisplayPartnerStagiaires.js +++ b/src/components/DisplayPartnerStagiaires.js @@ -2369,6 +2369,8 @@ const DisplayPartnerStagiaires = (props) => { if (mylocalattendee.status) { setp_detail_status_inscrit(mylocalattendee.status); + setselected_id_status(mylocalattendee.status); + if (String(mylocalattendee.status) === "1") setp_detail_status_inscrit_label("Inscrit"); else if (String(mylocalattendee.status) === "0") @@ -4742,7 +4744,7 @@ const DisplayPartnerStagiaires = (props) => { } //form.append("File", list_files); - var myurl = process.env.REACT_APP_API_URL + "myclass/api/Sent_Convention_Stagiaire_By_Email/"; + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Sent_Convention_Individuelle_Stagiaire_By_Email/"; axios.post(myurl, form).then(res => { @@ -4775,7 +4777,8 @@ const DisplayPartnerStagiaires = (props) => { var nom_fichier_cmd = "Convention.pdf"; - var url = process.env.REACT_APP_API_URL + "myclass/api/Download_Convention_Stagiaire_PDF/" + stored_cookie + "/" + selected_id + "/" + selected_convention_id; + var url = process.env.REACT_APP_API_URL + "myclass/api/Download_Convention_Individuelle_Stagiaire_PDF/" + stored_cookie + "/" + selected_id + "/" + selected_convention_id; + //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url); setLoading(true); @@ -4858,11 +4861,10 @@ const DisplayPartnerStagiaires = (props) => { } //form.append("File", list_files); - var myurl = process.env.REACT_APP_API_URL + "myclass/api/Sent_Convention_Stagiaire_By_Email/"; setLoading(true); fetch( - process.env.REACT_APP_API_URL + "myclass/api/Sent_Convention_Stagiaire_By_Email/", + process.env.REACT_APP_API_URL + "myclass/api/Sent_Convention_Individuelle_Stagiaire_By_Email/", { method: 'POST', body: form, @@ -5415,7 +5417,7 @@ const DisplayPartnerStagiaires = (props) => { > MySy Information - + {/*
Choisir une convention Individuelle { setselected_convention_type("pdf"); } else { //var result2 = New_Get_List_Stagiaire_Conventions_Individuel_result.filter((local_mymanager) => local_mymanager._id === String(value._id)) - + //console.log("### value.type_doc = ", value.type_doc); setselected_convention_type(value.type_doc); } @@ -6132,10 +6134,7 @@ const DisplayPartnerStagiaires = (props) => { fontSize: 14 }, - '& .line--statut--selected': { - backgroundColor: '#FBF2EF', - color: 'black', - }, + '& .line--statut--pair': { backgroundColor: 'rgba(235, 235, 235, .7)', color: 'black', @@ -6144,6 +6143,10 @@ const DisplayPartnerStagiaires = (props) => { backgroundColor: '#FFFFFF', color: 'black', }, + '& .line--statut--selected': { + backgroundColor: '#FBF2EF', + color: 'black', + }, }} > @@ -6231,7 +6234,11 @@ const DisplayPartnerStagiaires = (props) => { }} 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'; + } if (String(params.row.status) === "-1") { return 'line--statut--annule'; } @@ -6241,17 +6248,13 @@ const DisplayPartnerStagiaires = (props) => { if (String(params.row.status) === "1") { return 'line--statut--inscrit'; } - - // 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'; } + }} @@ -6280,7 +6283,7 @@ const DisplayPartnerStagiaires = (props) => { onChange={actionmass_ftion} > Action    - Envoyer Convention   + {/*Envoyer Convention  */} Supprimer   @@ -7599,7 +7602,9 @@ const DisplayPartnerStagiaires = (props) => { {String(participant_data_edit_mode) !== "1" &&
- {String(selected_id_status) !== "1" && } {selected_id_status && String(selected_id_status) === "1" && p_detail_apprenant_id && diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index a85308d..c7e17c4 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -27,7 +27,11 @@ import { Tooltip } from 'react-tooltip' import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc"; import { CiTrash } from "react-icons/ci"; import add_plus from "../mysy_img/plus.png"; - +import Dialog from '@mui/material/Dialog'; +import DialogActions from '@mui/material/DialogActions'; +import DialogContent from '@mui/material/DialogContent'; +import DialogContentText from '@mui/material/DialogContentText'; +import DialogTitle from '@mui/material/DialogTitle'; const DistplayPartnerTraningsPage = (props) => { @@ -1204,6 +1208,29 @@ const DistplayPartnerTraningsPage = (props) => { } + const [Dialog_formation_message, setDialog_formation_message] = React.useState(false); + const [Dialog_formation_open, setDialog_formation_open] = React.useState(false); + function Dialog_formation_handle_change_participant_session(message) { + setDialog_formation_message(message); + setDialog_formation_open(true); + } + + const Dialog_formation_handleClose = () => { + + }; + + const Dialog_formation_handleClose_buton = () => { + setDialog_formation_open(false); + }; + + + const [gridline_id, setgridline_id] = useState(""); + + function Show_Detailled_formation_Data() { + setupdatetraining(true); + Dialog_formation_handleClose_buton(); + } + return (
@@ -1211,6 +1238,47 @@ const DistplayPartnerTraningsPage = (props) => {
} + + + + Info Formation + + +
+
+ Civilité +
+
+ ----- +
+
+ + + +
  + +
+
+ + +
+
+ +
+
+ +
+
+ +
+ + +
+ {updatetraining &&
@@ -1226,7 +1294,7 @@ const DistplayPartnerTraningsPage = (props) => {
- } + } {createtraining &&
@@ -1520,6 +1588,12 @@ const DistplayPartnerTraningsPage = (props) => { color: 'black', }, + + '& .line--statut--selected': { + backgroundColor: '#FBF2EF', + color: 'black', + }, + }} > { className="datagridclass" onRowDoubleClick={(newSelectionModel) => { + setgridline_id(newSelectionModel.row.id); Closecreatetraining(); closeTrainingForm(); setreftrainingtoupdate(newSelectionModel.row.internal_url); setexternalcodetraining_toupdate(newSelectionModel.row.external_code); - setupdatetraining(true); + + + + setDialog_formation_open(true); } } @@ -1582,6 +1660,12 @@ const DistplayPartnerTraningsPage = (props) => { }} 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'; + } + if (String(params.row.published) === "1") { return 'line--published'; } @@ -1589,6 +1673,7 @@ const DistplayPartnerTraningsPage = (props) => { if (String(params.row.published) !== "1") { return 'line--unpublished'; } + }} /> diff --git a/src/components/Employes.js b/src/components/Employes.js index 5294454..995a5f5 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -84,17 +84,8 @@ const Employes = (props) => { { field: '_id', headerName: '_id', hide: true }, { field: 'id', headerName: 'id', hide: true }, { - field: 'civilite', headerName: 'Civilité', width: 90, hide: false, - valueFormatter: (params) => { - if (String(params.value) === "0") - return "Mme"; - else if (String(params.value) === "1") - return "M"; - else if (String(params.value) === "-1") - return " "; - else - return String(params.value); - }, + field: 'civilite', headerName: 'Civilité', minWidth: 50, flex: 1, maxWidth: 100, hide: false, + }, { field: 'nom', headerName: 'Nom', flex: 1, hide: false, minWidth: 150 }, @@ -940,17 +931,6 @@ const Employes = (props) => { if (mylocal_employe.civilite) { setp_detail_civilite(mylocal_employe.civilite); - - if (String(mylocal_employe.civilite) === "1") - setp_detail_civilite_label("M."); - else if (String(mylocal_employe.civilite) === "0") - setp_detail_civilite_label("Mme."); - else if (String(mylocal_employe.civilite) === "-1") - setp_detail_civilite_label("Neutre"); - else - setp_detail_civilite_label("?"); - - } @@ -3425,7 +3405,7 @@ const Employes = (props) => { let file_size = event.target.files[0].size; let file_type = event.target.files[0].type; - + console.log("file_size = ", file_size, " file_type = ", file_type); @@ -3461,7 +3441,7 @@ const Employes = (props) => { let file_size = event.target.files[0].size; let file_type = event.target.files[0].type; - + console.log("file_size = ", file_size, " file_type = ", file_type); @@ -5173,7 +5153,7 @@ const Employes = (props) => {
- {String(employee_data_edit_mode) !== "1" &&
Civilité
+ {String(employee_data_edit_mode) !== "1" &&
Civilité
{ }} disabled={false} className="disabled_style" - value={p_detail_civilite_label} + value={p_detail_civilite} />
} @@ -5207,9 +5187,9 @@ const Employes = (props) => { setEmployee_data_changed("1"); }} > - M.    - Mme.   - Neutre   + M.    + Mme.   + Neutre  
} @@ -5256,7 +5236,7 @@ const Employes = (props) => { />
- +
Email
{ setEmployee_data_changed("1"); }} > - M.    - Mme.   - Neutre   + M.    + Mme.   + Neutre  
diff --git a/src/components/Module_Agenda.js b/src/components/Module_Agenda.js index 7ee707c..06568c5 100644 --- a/src/components/Module_Agenda.js +++ b/src/components/Module_Agenda.js @@ -48,6 +48,7 @@ import allLocales from '@fullcalendar/core/locales-all' import { RepeatOnRounded } from "@mui/icons-material"; import { alignPropType } from "react-bootstrap/esm/types"; +import ToggleSwitch from "./ToggleSwitch"; import FullCalendar, { formatDate } from "@fullcalendar/react"; import dayGridPlugin from "@fullcalendar/daygrid"; @@ -576,6 +577,25 @@ const Module_Agenda = (props) => { setp_detail_sequence_session_id(""); + if (arg.event.extendedProps.justified) { + if (String(arg.event.extendedProps.justified) === "true") + setp_detail_justified(true); + + else + setp_detail_justified(false); + + + } + else + setp_detail_justified(false); + + + + if (arg.event.extendedProps.type) { + setp_detail_event_type(arg.event.extendedProps.type); + } + else + setp_detail_event_type(""); setStartDate(arg.event.start); setendDate(arg.event.end); @@ -712,6 +732,10 @@ const Module_Agenda = (props) => { const [p_detail_comment, setp_detail_comment] = useState(); const [p_detail_sequence_session_id, setp_detail_sequence_session_id] = useState(""); + const [p_detail_justified, setp_detail_justified] = useState(false); + const [p_detail_event_type, setp_detail_event_type] = useState(); + + const [startDate, setStartDate] = useState(new Date()); const [endDate, setendDate] = useState(new Date()); @@ -758,7 +782,8 @@ const Module_Agenda = (props) => { form.append("related_collection_recid", selected_employee_id); form.append("comment", p_detail_comment); - + form.append("event_type", p_detail_event_type); + form.append("justified", p_detail_justified); //console.log(" form == ", form); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Agenda_Event/"; @@ -781,7 +806,8 @@ const Module_Agenda = (props) => { setp_detail_end(); setp_detail_comment(); setp_detail_sequence_session_id(""); - + setp_detail_justified(false); + setp_detail_event_type(); alert(res.data.message); Close_Dialog_Detail_Event_open(); @@ -845,6 +871,8 @@ const Module_Agenda = (props) => { setp_detail_comment(); setp_detail_sequence_session_id(""); + setp_detail_justified(false); + setp_detail_event_type(); alert(res.data.message); Close_Dialog_Detail_Event_open(); @@ -947,6 +975,59 @@ const Module_Agenda = (props) => { {Dialog_1_message} +
+ + + + +
+ + +
+ + + +
+
Titre { const [Get_Connected_User_Dashbord_api, setGet_Connected_User_Dashbord_api] = useState(); const [Get_Connected_User_Dashbord_message, setGet_Connected_User_Dashbord_message] = useState(); - const [Get_Connected_User_Dashbord_result, setGet_Connected_User_Dashbord_result] = useState(); + const [Get_Connected_User_Dashbord_result, setGet_Connected_User_Dashbord_result] = useState([]); function Get_Connected_User_Dashbord() { @@ -156,6 +157,18 @@ const Mon_Tableau_De_Bord = (props) => { user_dashbord_filter_end={String(JSON.parse(step).end_date)} /> } + {String(JSON.parse(step).dashbord_internal_code) === "tbd_rh_01" && + + + + } +
@@ -163,11 +176,11 @@ const Mon_Tableau_De_Bord = (props) => {
} {!Get_Connected_User_Dashbord_result || Get_Connected_User_Dashbord_result.length <= 0 &&
- +

Pour utiliser votre tableau de bord, Merci de le configurer à partir du menu : "Configuration" == > "Tableau de bord"

- +
} diff --git a/src/components/Partner.js b/src/components/Partner.js index 7f06a1f..f31339d 100644 --- a/src/components/Partner.js +++ b/src/components/Partner.js @@ -55,6 +55,7 @@ import Module_Agenda from "./Module_Agenda"; import Partner_Configuration_Session_Steps from "./Partner_Config_Session_Steps"; import Partner_Configuration_Jours_Travail from "./Partner_Config_Jours_Travail"; import Dashbord_Session from "./Dashbord_Session"; +import Dashbord_Ressources_Humaines from "./Dashbord_Ressources_Humaines"; import Mon_Tableau_De_Bord from "./Mon_Tableau_De_Bord"; import Dashbord_Formation from "./Dashbord_Formation"; import Partner_Prix_Achat from "./Partner_Prix_Achat"; @@ -319,7 +320,7 @@ const Partner = (props) => { 'mes_sessions', 'setuplms', 'facture', 'pricing', 'mes_clients', 'mes_devis', 'mes_cmd', 'mes_stagiaires', 'mes_employes', 'mon_materiel', 'config_document', 'factures_client', "config_technique", "config_champ_specific", "module_agenda", "config_session_steps", "config_jours_heures", "dashbord_formation", - "dashbord_session", "mon_tableau_de_bord", "prix_achat", "mes_apprenants"] + "dashbord_session", "mon_tableau_de_bord", "prix_achat", "mes_apprenants", "dashbord_ressources_humaines"] if (action && list_menu.includes(action)) { @@ -695,6 +696,21 @@ const Partner = (props) => { } + function config_dashbord_ressources_humaines_func(event) { + var security_retval = check_user_acces_right("dashbord", "read"); + + if (security_retval === 1) { + setmenu("dashbord_ressources_humaines"); + setapiexcelimportmessage(); + setformation_file_name(); + document.body.style.backgroundColor = "#ffffff"; + history.push("/Partner/dashbord_ressources_humaines"); + } else { + Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion du matériel pédagogique"); + } + } + + function DiplaytrainingList(event) { setmenu("affichage"); @@ -1063,6 +1079,7 @@ const Partner = (props) => { }; const [left_menu, setleft_menu] = React.useState(true); + const open_close_left_menu = () => { if (left_menu === true) setleft_menu(false); @@ -1334,6 +1351,11 @@ const Partner = (props) => { {String(menu) === "dashbord_session" &&
    SESSION
} + + {String(menu) !== "dashbord_ressources_humaines" &&
   RES. HUMAINES
} + {String(menu) === "dashbord_ressources_humaines" &&
    ES. HUMAINES
} +
+ @@ -1668,7 +1690,11 @@ const Partner = (props) => {
} - + {String(menu) === "dashbord_ressources_humaines" &&
+ + +
+ } {String(menu) === "mon_tableau_de_bord" &&
@@ -1748,7 +1774,7 @@ const Partner = (props) => {
- + {String(menu) !== "affichage" &&
 
} {String(menu) === "affichage" &&
 
}
@@ -2208,6 +2234,12 @@ const Partner = (props) => {
} + {String(menu) === "dashbord_ressources_humaines" &&
+ + +
+ } + {String(menu) === "mon_tableau_de_bord" &&