06/01/24 - 20h30
parent
9807500adb
commit
957225269c
|
@ -0,0 +1,543 @@
|
|||
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_Inscriptions = (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: 'telephone', headerName: 'Téléphone', hide: false, minWidth: 50, flex: 1, maxWidth: 100 },
|
||||
{ field: 'session_class_title', headerName: 'Titre Ftion', hide: false, minWidth: 200, flex: 1, },
|
||||
{ field: 'session_code_session', headerName: 'Code session', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
|
||||
{ field: 'session_date_debut', headerName: 'Session Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
|
||||
{ field: 'session_date_fin', headerName: 'Session Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
|
||||
{ field: 'session_distantiel', headerName: 'Distantiel', hide: true, Width: 20 },
|
||||
{ field: 'session_presentiel', headerName: 'Présentiel', hide: true, Width: 20 },
|
||||
]
|
||||
|
||||
|
||||
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("100%");
|
||||
|
||||
const [dashbord_internal_code, setdashbord_internal_code] = useState("");
|
||||
const [gridline_id, setgridline_id] = useState("");
|
||||
|
||||
const [Getall_Qry_Inscription_Data_result_JSON, setGetall_Qry_Inscription_Data_result_JSON] = useState([]);
|
||||
const [Getall_Qry_Inscription_Data_api, setGetall_Qry_Inscription_Data_api] = useState();
|
||||
const [Getall_Qry_Inscription_Data_message, setGetall_Qry_Inscription_Data_message] = useState();
|
||||
const [Getall_Qry_Inscription_Data_result, setGetall_Qry_Inscription_Data_result] = useState([]);
|
||||
function Getall_Qry_Inscription_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);
|
||||
|
||||
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_By_Session_By_Periode/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Getall_Qry_Inscription_Data res.data.status = " + res.data.status);
|
||||
//console.log(" In Getall_Qry_Inscription_Data res.data.message r_class = " + res.data.message);
|
||||
|
||||
setGetall_Qry_Inscription_Data_result_JSON(JSON.parse('[' + res.data.message + ']'));
|
||||
|
||||
var jsonObj = JSON.parse('[' + res.data.message + ']');
|
||||
|
||||
setGetall_Qry_Inscription_Data_api("true");
|
||||
setGetall_Qry_Inscription_Data_result(res.data.message);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setGetall_Qry_Inscription_Data_api("false");
|
||||
setGetall_Qry_Inscription_Data_message(res.data.message);
|
||||
alert(res.data.message)
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Getall_Qry_Inscription_Data = ', error);
|
||||
setGetall_Qry_Inscription_Data_api("false");
|
||||
alert("Impossible de récuperer les données demandées")
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
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_Inscription_Data();
|
||||
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth",
|
||||
});
|
||||
|
||||
}, [])
|
||||
|
||||
|
||||
return (
|
||||
<div className="dashbord_session">
|
||||
{isLoading && <div className="loader-container">
|
||||
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
||||
</div>}
|
||||
|
||||
<h3> Tableaux de bord des Inscriptions </h3>
|
||||
<div className="div_row"> </div>
|
||||
|
||||
<div className="div_row" style={{ "textAlign": "right", "paddingRight": "20px" }}> Affichage
|
||||
<Tooltip className="tooltip_css" id="my_tooltip_1_col" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my_tooltip_1_col" data-tooltip-html="Affichage sur une colonne">
|
||||
<TbColumns1 style={{ "cursor": "pointer" }} onClick={(e) => {
|
||||
setdisplay_nb_column("1");
|
||||
setdisplay_column_size("100%");
|
||||
|
||||
}} />
|
||||
</a>
|
||||
<Tooltip className="tooltip_css" id="my_tooltip_2_col" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my_tooltip_2_col" data-tooltip-html="Affichage sur deux colonnes">
|
||||
<TbColumns2 style={{ "cursor": "pointer" }} onClick={(e) => {
|
||||
setdisplay_nb_column("2");
|
||||
setdisplay_column_size("50%");
|
||||
|
||||
}} />
|
||||
</a> </div>
|
||||
|
||||
<div className="div_row">
|
||||
<div className="" style={{ "width": "30%" }}>
|
||||
Filtre <br />
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="filtre11"
|
||||
id="filtre11"
|
||||
select
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={filter_value}
|
||||
onChange={(e) => {
|
||||
setfilter_value(e.target.value);
|
||||
}
|
||||
}
|
||||
|
||||
>
|
||||
<MenuItem value="m0" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Mois en cours </MenuItem>
|
||||
<MenuItem value="m1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Mois précédant </MenuItem>
|
||||
<MenuItem value="d" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Choisir des dates </MenuItem>
|
||||
</TextField>
|
||||
</div>
|
||||
|
||||
{filter_value && String(filter_value) === "d" && <div>
|
||||
<div className="session_caract">
|
||||
Date Debut
|
||||
<DatePicker
|
||||
name="one_sessiondatedebut"
|
||||
id="one_sessiondatedebut"
|
||||
|
||||
selected={new Date(moment(p_filter_date_from, "DD/MM/YYYY"))}
|
||||
onChange={(date) => {
|
||||
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'
|
||||
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="session_caract">
|
||||
Date Fin
|
||||
<DatePicker
|
||||
name="one_sessiondatefin"
|
||||
id="one_sessiondatefin"
|
||||
selected={new Date(moment(p_filter_date_to, "DD/MM/YYYY"))}
|
||||
onChange={(date) => {
|
||||
setp_filter_date_to(format(date, 'dd/MM/yyyy'));
|
||||
|
||||
}
|
||||
}
|
||||
showTimeSelect={false}
|
||||
dateFormat="dd/MM/yyyy"
|
||||
className="disabled_style enable_style"
|
||||
/>
|
||||
|
||||
</div>
|
||||
|
||||
</div>}
|
||||
<br />
|
||||
<div className="" style={{ "width": "30%" }}>
|
||||
Type Tache <br />
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="filtre12"
|
||||
id="filtre12"
|
||||
select
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={filter_type_tache}
|
||||
onChange={(e) => {
|
||||
setfilter_type_tache(e.target.value);
|
||||
}
|
||||
}
|
||||
|
||||
>
|
||||
<MenuItem value="absence" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Absence </MenuItem>
|
||||
<MenuItem value="planning" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Planning </MenuItem>
|
||||
<MenuItem value="autre" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Autre </MenuItem>
|
||||
<MenuItem value="" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} > </MenuItem>
|
||||
</TextField>
|
||||
</div>
|
||||
|
||||
<Button variant="contained" className="bton_enreg" onClick={(e) => {
|
||||
Getall_Qry_Inscription_Data();
|
||||
|
||||
}}> Afficher
|
||||
</Button><br />
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div style={{ "float": "left", "width": "100%", "paddingRight": "5px" }}>
|
||||
|
||||
|
||||
<div style={{ "float": "left", "width": String(display_column_size), "height": "42rem", "float": "left", "paddingRight": "5px" }} >
|
||||
<div className="titre1" style={{ "float": "left", "cursor": "none" }}>
|
||||
<nav style={{ "width": "90%", "float": "left", "textAlign": "center" }}> TBD Employés - Détail Tâche </nav>
|
||||
<Tooltip className="tooltip_css" id="my-tooltip01" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip01" data-tooltip-html="Ajouter à ma liste de TBD">
|
||||
<nav style={{ "width": "9%", "float": "right", "textAlign": "right", "cursor": "pointer" }}>
|
||||
<MdOutlineAddchart style={{ "cursor": "pointer", }} onClick={(e) => settdb_title("3")} />
|
||||
</nav>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{tdb_title && String(tdb_title) === "3" && <nav> Donnez un titre <TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="tdb_title"
|
||||
id="tdb_title"
|
||||
text
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
|
||||
|
||||
/>
|
||||
<nav style={{ "textAlign": "center" }}> <button onClick={(event) => {
|
||||
setdashbord_internal_code("RESSOURCES_HUMAINES_01")
|
||||
Add_To_User_TBD("tbd_inscription_01");
|
||||
|
||||
}}> Ajouter </button> <button onClick={(e) => settdb_title("0")}> Fermer </button>
|
||||
</nav>
|
||||
|
||||
</nav>}
|
||||
|
||||
<Box style={{ "color": "black", "height": "30rem" }}>
|
||||
|
||||
|
||||
<div className="session_data">
|
||||
<div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 500,
|
||||
width: '100%',
|
||||
paddingRight: '1px',
|
||||
|
||||
"& .MuiDataGrid-columnHeaders": {
|
||||
backgroundColor: "#c8cfd5",
|
||||
color: "black",
|
||||
fontSize: 14
|
||||
},
|
||||
|
||||
'& .line--statut--selected': {
|
||||
backgroundColor: '#FBF2EF',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--pair': {
|
||||
backgroundColor: 'rgba(235, 235, 235, .7)',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--impair': {
|
||||
backgroundColor: '#FFFFFF',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
checkboxSelection
|
||||
|
||||
onSelectionModelChange={(newSelectionModel) => {
|
||||
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_Inscription_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,
|
||||
telephone: JSON.parse(item).telephone,
|
||||
session_class_title: JSON.parse(item).session_class_title,
|
||||
session_code_session: JSON.parse(item).session_code_session,
|
||||
session_date_debut: JSON.parse(item).session_date_debut,
|
||||
session_date_fin: JSON.parse(item).session_date_fin,
|
||||
session_distantiel: JSON.parse(item).session_distantiel,
|
||||
session_presentiel: JSON.parse(item).session_presentiel,
|
||||
|
||||
}
|
||||
))}
|
||||
|
||||
columns={columns}
|
||||
pageSize={20}
|
||||
className="datagridclass"
|
||||
|
||||
onRowDoubleClick={(newSelectionModel) => {
|
||||
|
||||
}}
|
||||
|
||||
|
||||
|
||||
rowsPerPageOptions={[20]}
|
||||
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';
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
</Box>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</Box>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>)
|
||||
}
|
||||
|
||||
|
||||
export default Dashbord_Inscriptions;
|
|
@ -0,0 +1,525 @@
|
|||
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_Inscriptions_all_inscriptions = (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 [user_dashbord_id, setuser_dashbord_id] = useState(props.user_dashbord_id);
|
||||
|
||||
|
||||
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: 'telephone', headerName: 'Téléphone', hide: false, minWidth: 50, flex: 1, maxWidth: 100 },
|
||||
{ field: 'session_class_title', headerName: 'Titre Ftion', hide: false, minWidth: 200, flex: 1, },
|
||||
{ field: 'session_code_session', headerName: 'Code session', hide: false, minWidth: 100, flex: 1, maxWidth: 150 },
|
||||
{ field: 'session_date_debut', headerName: 'Session Début', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
|
||||
{ field: 'session_date_fin', headerName: 'Session Fin', hide: false, minWidth: 150, flex: 1, maxWidth: 200 },
|
||||
{ field: 'session_distantiel', headerName: 'Distantiel', hide: true, Width: 20 },
|
||||
{ field: 'session_presentiel', headerName: 'Présentiel', hide: true, Width: 20 },
|
||||
]
|
||||
|
||||
|
||||
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("100%");
|
||||
|
||||
const [dashbord_internal_code, setdashbord_internal_code] = useState("");
|
||||
const [gridline_id, setgridline_id] = useState("");
|
||||
|
||||
const [Getall_Qry_Inscription_Data_result_JSON, setGetall_Qry_Inscription_Data_result_JSON] = useState([]);
|
||||
const [Getall_Qry_Inscription_Data_api, setGetall_Qry_Inscription_Data_api] = useState();
|
||||
const [Getall_Qry_Inscription_Data_message, setGetall_Qry_Inscription_Data_message] = useState();
|
||||
const [Getall_Qry_Inscription_Data_result, setGetall_Qry_Inscription_Data_result] = useState([]);
|
||||
function Getall_Qry_Inscription_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);
|
||||
|
||||
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Inscription_By_Session_By_Periode/";
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Getall_Qry_Inscription_Data res.data.status = " + res.data.status);
|
||||
//console.log(" In Getall_Qry_Inscription_Data res.data.message r_class = " + res.data.message);
|
||||
|
||||
setGetall_Qry_Inscription_Data_result_JSON(JSON.parse('[' + res.data.message + ']'));
|
||||
|
||||
var jsonObj = JSON.parse('[' + res.data.message + ']');
|
||||
|
||||
setGetall_Qry_Inscription_Data_api("true");
|
||||
setGetall_Qry_Inscription_Data_result(res.data.message);
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setGetall_Qry_Inscription_Data_api("false");
|
||||
setGetall_Qry_Inscription_Data_message(res.data.message);
|
||||
alert(res.data.message)
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Getall_Qry_Inscription_Data = ', error);
|
||||
setGetall_Qry_Inscription_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_Inscription_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("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
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("")
|
||||
})
|
||||
}
|
||||
|
||||
const [event_type_filter, setevent_type_filter] = useState(props.user_dashbord_filter_type_envent);
|
||||
|
||||
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_Inscription_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_Inscription_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 (
|
||||
<div className="dashbord_session">
|
||||
{isLoading && <div className="loader-container">
|
||||
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
||||
</div>}
|
||||
<div>
|
||||
<div style={{ "height": "40rem" }}>
|
||||
<div className="titre1" style={{ "float": "left", "cursor": "none" }}>
|
||||
<nav style={{ "width": "80%", "float": "left", "textAlign": "center" }}> TBD : {props.user_dashbord_title} - Du : {props.user_dashbord_filter_start} au : {props.user_dashbord_filter_end}</nav>
|
||||
<Tooltip className="tooltip_css" id="my-tooltip02" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip02" data-tooltip-html="Supprimer de ma liste de TBD">
|
||||
<Popup
|
||||
trigger={
|
||||
<nav style={{ "width": "9%", "float": "right", "textAlign": "right", "cursor": "pointer" }}>
|
||||
<MdDeleteForever style={{ "cursor": "pointer", }} />
|
||||
</nav>
|
||||
}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, le tableau sera supprimé de votre tableau de bord global.<br />
|
||||
Vous pourrez le rajouter à nouveau si besoin. <br />
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
Remove_From_User_TBD();
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup"
|
||||
onClick={() => {
|
||||
console.log('modal closed ');
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>
|
||||
</a>
|
||||
|
||||
<Tooltip className="tooltip_css" id="my-tooltip03" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip03" data-tooltip-html="Export Csv/Excel">
|
||||
<nav style={{ "width": "9%", "float": "right", "textAlign": "right", "cursor": "pointer" }}>
|
||||
<RiFileExcel2Line style={{ "cursor": "pointer", }} onClick={(event) => {
|
||||
Export_Dashbord_to_CSV(props.user_dashbord_id);
|
||||
|
||||
}} />
|
||||
</nav>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
<Box style={{ "color": "black", "height": "30rem" }}>
|
||||
|
||||
|
||||
<div className="session_data">
|
||||
<div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 500,
|
||||
width: '100%',
|
||||
paddingRight: '1px',
|
||||
|
||||
"& .MuiDataGrid-columnHeaders": {
|
||||
backgroundColor: "#c8cfd5",
|
||||
color: "black",
|
||||
fontSize: 14
|
||||
},
|
||||
|
||||
'& .line--statut--selected': {
|
||||
backgroundColor: '#FBF2EF',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--pair': {
|
||||
backgroundColor: 'rgba(235, 235, 235, .7)',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--impair': {
|
||||
backgroundColor: '#FFFFFF',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
checkboxSelection
|
||||
|
||||
onSelectionModelChange={(newSelectionModel) => {
|
||||
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_Inscription_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,
|
||||
telephone: JSON.parse(item).telephone,
|
||||
session_class_title: JSON.parse(item).session_class_title,
|
||||
session_code_session: JSON.parse(item).session_code_session,
|
||||
session_date_debut: JSON.parse(item).session_date_debut,
|
||||
session_date_fin: JSON.parse(item).session_date_fin,
|
||||
session_distantiel: JSON.parse(item).session_distantiel,
|
||||
session_presentiel: JSON.parse(item).session_presentiel,
|
||||
|
||||
}
|
||||
))}
|
||||
|
||||
columns={columns}
|
||||
pageSize={20}
|
||||
className="datagridclass"
|
||||
|
||||
onRowDoubleClick={(newSelectionModel) => {
|
||||
|
||||
}}
|
||||
|
||||
|
||||
|
||||
rowsPerPageOptions={[20]}
|
||||
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';
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
</Box>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</Box>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>)
|
||||
}
|
||||
|
||||
|
||||
export default Dashbord_Inscriptions_all_inscriptions;
|
|
@ -91,10 +91,6 @@ const Dashbord_Ressources_Humaines = (props) => {
|
|||
{ field: 'rh_contrat_periodicite', headerName: 'Ctrat Périodicité', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
|
||||
{ field: 'rh_contrat_quantite', headerName: 'Ctrat Qte', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
{ field: 'rh_contrat_groupe_prix_achat_id', headerName: 'Grp Prix ID', hide: true, Width: 0, },
|
||||
{ field: 'rh_contrat_groupe_prix_achat_code', headerName: 'Grp Prix Code', hide: true, minWidth: 100, flex: 1, maxWidth: 150 },
|
||||
|
||||
|
|
|
@ -406,9 +406,6 @@ const Dashbord_Ressources_Humaines_Tache_Couts = (props) => {
|
|||
rh_event_planning_event_end: JSON.parse(item).rh_event_planning_event_end,
|
||||
rh_event_planning_event_cost: JSON.parse(item).rh_event_planning_event_cost,
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
))}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@ import Dashbord_Session_Repartition_Fteur from "./Dashbord_Session_Repartition_F
|
|||
import Dashbord_Formation_Evol_Session from "./Dashbord_Formation_Evol_Session";
|
||||
import Dashbord_Ressources_Humaines_Tache_by_rhid from "./Dashbord_Ressources_Humaines_Tache_by_rhid";
|
||||
import Dashbord_Ressources_Humaines_Tache_Couts from "./Dashbord_Ressources_Humaines_Tache_Couts";
|
||||
import Dashbord_Inscriptions_all_inscriptions from "./Dashbord_Inscription_All_Inscription";
|
||||
|
||||
import { TbColumns2, TbColumns1 } from "react-icons/tb";
|
||||
|
||||
|
@ -170,7 +171,7 @@ const Mon_Tableau_De_Bord = (props) => {
|
|||
|
||||
<div className="div_row" style={{ "width": "95%", "float": "left", "paddingRight": "2px" }}>
|
||||
|
||||
|
||||
|
||||
|
||||
{String(JSON.parse(step).dashbord_internal_code) === "tbd_rh_01" &&
|
||||
<Dashbord_Ressources_Humaines_Tache_by_rhid user_dashbord_id={String(JSON.parse(step)._id)}
|
||||
|
@ -192,6 +193,16 @@ const Mon_Tableau_De_Bord = (props) => {
|
|||
/>
|
||||
}
|
||||
|
||||
{String(JSON.parse(step).dashbord_internal_code) === "tbd_inscription_01" &&
|
||||
<Dashbord_Inscriptions_all_inscriptions user_dashbord_id={String(JSON.parse(step)._id)}
|
||||
user_dashbord_title={String(JSON.parse(step).title)}
|
||||
user_dashbord_filter_start={String(JSON.parse(step).start_date)}
|
||||
user_dashbord_filter_end={String(JSON.parse(step).end_date)}
|
||||
|
||||
|
||||
/>
|
||||
}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -56,6 +56,8 @@ 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 Dashbord_Inscriptions from "./Dashbord_Inscription";
|
||||
|
||||
import Mon_Tableau_De_Bord from "./Mon_Tableau_De_Bord";
|
||||
import Dashbord_Formation from "./Dashbord_Formation";
|
||||
import Partner_Prix_Achat from "./Partner_Prix_Achat";
|
||||
|
@ -323,7 +325,8 @@ 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_ressources_humaines"]
|
||||
"dashbord_session", "mon_tableau_de_bord", "prix_achat", "mes_apprenants", "dashbord_ressources_humaines",
|
||||
"dashbord_inscriptions"]
|
||||
|
||||
if (action && list_menu.includes(action)) {
|
||||
|
||||
|
@ -714,6 +717,21 @@ const Partner = (props) => {
|
|||
}
|
||||
|
||||
|
||||
|
||||
function config_dashbord_inscriptions_func(event) {
|
||||
var security_retval = check_user_acces_right("dashbord", "read");
|
||||
|
||||
if (security_retval === 1) {
|
||||
setmenu("dashbord_inscriptions");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
document.body.style.backgroundColor = "#ffffff";
|
||||
history.push("/Partner/dashbord_inscriptions");
|
||||
} 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");
|
||||
|
@ -1358,7 +1376,12 @@ const Partner = (props) => {
|
|||
|
||||
<Dropdown.Item>
|
||||
{String(menu) !== "dashbord_ressources_humaines" && <div className="sousmenu" onClick={config_dashbord_ressources_humaines_func}> <FcFinePrint className="icone_menu" /> RES. HUMAINES</div>}
|
||||
{String(menu) === "dashbord_ressources_humaines" && <div className="sousmenu_selected" onClick={config_dashbord_ressources_humaines_func}> <FcFinePrint className="icone_menu" /> ES. HUMAINES</div>}
|
||||
{String(menu) === "dashbord_ressources_humaines" && <div className="sousmenu_selected" onClick={config_dashbord_ressources_humaines_func}> <FcFinePrint className="icone_menu" /> RES. HUMAINES</div>}
|
||||
</Dropdown.Item>
|
||||
|
||||
<Dropdown.Item>
|
||||
{String(menu) !== "dashbord_inscriptions" && <div className="sousmenu" onClick={config_dashbord_inscriptions_func}> <FcFinePrint className="icone_menu" /> INSCRIPTIONS</div>}
|
||||
{String(menu) === "dashbord_inscriptions" && <div className="sousmenu_selected" onClick={config_dashbord_inscriptions_func}> <FcFinePrint className="icone_menu" /> INSCRIPTIONS</div>}
|
||||
</Dropdown.Item>
|
||||
|
||||
|
||||
|
@ -1701,6 +1724,12 @@ const Partner = (props) => {
|
|||
</div>
|
||||
}
|
||||
|
||||
{String(menu) === "dashbord_inscriptions" && <div className="div_droite">
|
||||
|
||||
<Dashbord_Inscriptions conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("dashbord", "read")} write_access={check_user_acces_right("dashbord", "write")} />
|
||||
</div>
|
||||
}
|
||||
|
||||
{String(menu) === "mon_tableau_de_bord" && <div className="div_droite">
|
||||
|
||||
<Mon_Tableau_De_Bord conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("dashbord", "read")} write_access={check_user_acces_right("dashbord", "write")} />
|
||||
|
|
Loading…
Reference in New Issue