30/08/23 - 14h
parent
f7678b3477
commit
7515b837a6
|
@ -198,6 +198,67 @@ const DisplayPartnerSession = (props) => {
|
|||
{ field: 'title', headerName: 'Formation', width: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, },
|
||||
{ field: 'domaine', headerName: 'Domaine', width: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, },
|
||||
{ field: 'duration', headerName: 'Durée', width: datagrid_columns_size_model2, align: "center", },
|
||||
{
|
||||
field: "delete", headerName: 'Supprimer',
|
||||
renderCell: (cellValues) => {
|
||||
return (
|
||||
|
||||
<Popup
|
||||
trigger={<Button
|
||||
|
||||
onClick={(event) => {
|
||||
//handleClick_delete_Session_Formation(event, cellValues);
|
||||
}}
|
||||
>
|
||||
<CiTrash />
|
||||
|
||||
</Button>}
|
||||
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, la session de formation sera <i><font color="red"> définitivement supprimée</font></i>. <br />
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
handleClick_delete_Session_Formation(event, cellValues);
|
||||
//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>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
]
|
||||
|
||||
|
@ -1560,6 +1621,62 @@ const DisplayPartnerSession = (props) => {
|
|||
}
|
||||
|
||||
|
||||
function handleClick_delete_Session_Formation(event, cellValues) {
|
||||
// Recuperation du motif du refus :
|
||||
|
||||
var session_id = cellValues.row._id;
|
||||
Delete_Session_Formation(session_id);
|
||||
}
|
||||
|
||||
const [Delete_Session_Formation_api, setDelete_Session_Formation_api] = useState();
|
||||
const [Delete_Session_Formation_message, setDelete_Session_Formation_message] = useState();
|
||||
const [Delete_Session_Formation_result, setDelete_Session_Formation_result] = useState();
|
||||
function Delete_Session_Formation(local_session_id) {
|
||||
|
||||
setSendInscriptionCancell_api();
|
||||
var form = new FormData();
|
||||
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
form.append("session_id", local_session_id);
|
||||
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_SessionFormation/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
//console.log(" In Delete_Session_Formation res.data.status = " + res.data.status);
|
||||
//console.log(" In Delete_Session_Formation res.data.message r_class = " + res.data.message);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
setDelete_Session_Formation_api("true");
|
||||
setDelete_Session_Formation_result(res.data.message);
|
||||
setSelectionModel([]);
|
||||
setaddOneParticipant();
|
||||
setdisplay_detail_insc();
|
||||
setselected_code_session();
|
||||
setsubmenu();
|
||||
Getall_TrainingSession();
|
||||
|
||||
alert(" La session a été correctement supprimée.")
|
||||
}
|
||||
else {
|
||||
setDelete_Session_Formation_api("false");
|
||||
setDelete_Session_Formation_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
|
||||
console.warn('Delete_Session_Formation : Not good man :( mysearchtext = ' + error);
|
||||
setDelete_Session_Formation_api("false");
|
||||
alert(" Impossible de supprimer la session");
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const [retval_ch, setretval_ch] = useState();
|
||||
|
||||
|
@ -2177,7 +2294,6 @@ const DisplayPartnerSession = (props) => {
|
|||
form.append("token", stored_cookie);
|
||||
form.append("session_id", GetCurrentSession_id);
|
||||
form.append("class_internal_url", selected_internal_url);
|
||||
form.append("formation_session_id", new_code_session);
|
||||
form.append("date_debut", format(SessionstartDate, 'dd/MM/yyyy kk:mm:ss'));
|
||||
form.append("date_fin", format(SessionendDate, 'dd/MM/yyyy kk:mm:ss'));
|
||||
form.append("prix_session", prix_session);
|
||||
|
@ -2188,7 +2304,12 @@ const DisplayPartnerSession = (props) => {
|
|||
form.append("adresse", adress);
|
||||
form.append("code_postal", codepostal);
|
||||
form.append("ville", ville);
|
||||
form.append("pays", p_pays);
|
||||
if (p_pays)
|
||||
form.append("pays", p_pays);
|
||||
|
||||
else
|
||||
form.append("pays", "");
|
||||
|
||||
form.append("code_session", code_session);
|
||||
form.append("formateur", formateur);
|
||||
form.append("lms_class_code", lms_class_code);
|
||||
|
@ -2211,6 +2332,10 @@ const DisplayPartnerSession = (props) => {
|
|||
|
||||
|
||||
|
||||
//console.log(" ### CreateSessionFormation form = ", form);
|
||||
|
||||
//return;
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation/";
|
||||
|
||||
|
||||
|
@ -5731,7 +5856,7 @@ const DisplayPartnerSession = (props) => {
|
|||
className="disabled_style enable_style"
|
||||
>
|
||||
{status_inscription.map((option) => (
|
||||
<MenuItem key={option.value} value={option.value} style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
|
||||
<MenuItem key={option.value} value={option.value} style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
|
||||
{option.label} <br />
|
||||
</MenuItem>
|
||||
))}
|
||||
|
@ -6004,7 +6129,7 @@ const DisplayPartnerSession = (props) => {
|
|||
className="disabled_style enable_style"
|
||||
>
|
||||
{status_inscription.map((option) => (
|
||||
<MenuItem key={option.value} value={option.value} style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
|
||||
<MenuItem key={option.value} value={option.value} style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
|
||||
{option.label} <br />
|
||||
</MenuItem>
|
||||
))}
|
||||
|
@ -6141,7 +6266,7 @@ const DisplayPartnerSession = (props) => {
|
|||
className="disabled_style enable_style"
|
||||
>
|
||||
{status_inscription.map((option) => (
|
||||
<MenuItem key={option.value} value={option.value} style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
|
||||
<MenuItem key={option.value} value={option.value} style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%", "fontSize": "12px" }}>
|
||||
{option.label} <br />
|
||||
</MenuItem>
|
||||
))}
|
||||
|
|
|
@ -165,7 +165,7 @@ const DistplayPartnerTraningsPage = (props) => {
|
|||
})
|
||||
.then((data) => data.json())
|
||||
.then((data) => {
|
||||
console.log('Success:', data['message'], "data['status'] = ", data['status']);
|
||||
//console.log('Success:', data['message'], "data['status'] = ", data['status']);
|
||||
setTableData(data['message']);
|
||||
setRows(data['message']);
|
||||
if (String(data['status']) === String("false")) {
|
||||
|
|
|
@ -1434,7 +1434,7 @@ function GestionAdministrative(props) {
|
|||
const [p_one_detail_client_rattachement_nom, setp_one_detail_client_rattachement_nom] = useState();
|
||||
const [p_one_detail_client_rattachement_id, setp_one_detail_client_rattachement_id] = useState();
|
||||
|
||||
const [selected_session_id, setselected_session_id] = useState("");
|
||||
|
||||
const [selected_code_session, setselected_code_session] = useState("");
|
||||
const [mysession, setmysession] = useState("");
|
||||
const [allmysession_info, setallmysession_info] = useState("");
|
||||
|
@ -1774,8 +1774,8 @@ function GestionAdministrative(props) {
|
|||
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("session_id", selected_session_id);
|
||||
form.append("class_internal_url", internal_url);
|
||||
form.append("code_session", mysession);
|
||||
form.append("date_debut", format(SessionstartDate, 'dd/MM/yyyy kk:mm:ss'));
|
||||
form.append("date_fin", format(SessionendDate, 'dd/MM/yyyy kk:mm:ss'));
|
||||
form.append("prix_session", prix_session);
|
||||
|
@ -1792,7 +1792,10 @@ function GestionAdministrative(props) {
|
|||
form.append("session_status", sessionStatus);
|
||||
form.append("date_debut_inscription", format(SessionstartDateInscription, 'dd/MM/yyyy kk:mm:ss'));
|
||||
form.append("date_fin_inscription", format(SessionendDateInscription, 'dd/MM/yyyy kk:mm:ss'));
|
||||
form.append("attestation_certif", selectedCertif);
|
||||
if (selectedCertif)
|
||||
form.append("attestation_certif", selectedCertif);
|
||||
else
|
||||
form.append("attestation_certif", "");
|
||||
|
||||
var contenu_ftion = "";
|
||||
if (editorRef_contenu_ftion.current) {
|
||||
|
@ -1810,6 +1813,9 @@ function GestionAdministrative(props) {
|
|||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation/";
|
||||
|
||||
|
||||
console.log(" ### CreateSessionFormation form = ", form);
|
||||
|
||||
//return;
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
//console.log(" In CreateSessionFormation res.data.status = " + res.data.status);
|
||||
|
@ -1821,6 +1827,7 @@ function GestionAdministrative(props) {
|
|||
setsessionChanged(false);
|
||||
desableSessionFields();
|
||||
GetCurrentClass_trainingsession();
|
||||
alert(" La mise à jour a été correctement faite");
|
||||
|
||||
} else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + res.data.message);
|
||||
|
@ -2037,6 +2044,8 @@ function GestionAdministrative(props) {
|
|||
|
||||
|
||||
|
||||
const [selected_session_id, setselected_session_id] = useState();
|
||||
|
||||
const [GetCurrentSession_api, setGetCurrentSession_api] = useState();
|
||||
const [GetCurrentSession_message, setGetCurrentSession_message] = useState();
|
||||
const [GetCurrentSession_result, setGetCurrentSession_result] = useState();
|
||||
|
@ -2063,6 +2072,11 @@ function GestionAdministrative(props) {
|
|||
setGetCurrentSession_result(res.data.message);
|
||||
var mylocaltraining = JSON.parse(res.data.message);
|
||||
|
||||
if (mylocaltraining._id) {
|
||||
setselected_session_id(mylocaltraining._id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (mylocaltraining.date_debut) {
|
||||
var date_du = new Date(moment(mylocaltraining.date_debut, "DD/MM/YYYY HH:mm:ss"));
|
||||
|
@ -2082,6 +2096,7 @@ function GestionAdministrative(props) {
|
|||
|
||||
|
||||
|
||||
|
||||
if (mylocaltraining.date_fin_inscription) {
|
||||
var date_fin_inscript = new Date(moment(mylocaltraining.date_fin_inscription, "DD/MM/YYYY HH:mm:ss"));
|
||||
setSessionendDateInscription(date_fin_inscript);
|
||||
|
@ -2156,6 +2171,8 @@ function GestionAdministrative(props) {
|
|||
else if (String(mylocaltraining.session_status) === "false")
|
||||
setsessionStatus(false);
|
||||
|
||||
} else {
|
||||
alert(" Aucune information recuperée");
|
||||
}
|
||||
|
||||
} else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
|
@ -2172,6 +2189,7 @@ function GestionAdministrative(props) {
|
|||
}).catch((error) => {
|
||||
console.warn('Not good man :( GetCurrentSession = ', error);
|
||||
setGetCurrentSession_api("false");
|
||||
alert(" Impossible de recuperer les données de la session")
|
||||
|
||||
})
|
||||
}
|
||||
|
@ -4242,6 +4260,51 @@ function GestionAdministrative(props) {
|
|||
|
||||
|
||||
|
||||
const [Delete_Session_Formation_api, setDelete_Session_Formation_api] = useState();
|
||||
const [Delete_Session_Formation_message, setDelete_Session_Formation_message] = useState();
|
||||
const [Delete_Session_Formation_result, setDelete_Session_Formation_result] = useState();
|
||||
function Delete_Session_Formation() {
|
||||
|
||||
setSendInscriptionCancell_api();
|
||||
var form = new FormData();
|
||||
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
form.append("session_id", selected_session_id);
|
||||
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_SessionFormation/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
//console.log(" In Delete_Session_Formation res.data.status = " + res.data.status);
|
||||
//console.log(" In Delete_Session_Formation res.data.message r_class = " + res.data.message);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
setDelete_Session_Formation_api("true");
|
||||
setDelete_Session_Formation_result(res.data.message);
|
||||
alert(" La session a été correctement supprimée.")
|
||||
|
||||
window.location.reload();
|
||||
return;
|
||||
}
|
||||
else {
|
||||
setDelete_Session_Formation_api("false");
|
||||
setDelete_Session_Formation_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
|
||||
console.warn('Delete_Session_Formation : Not good man :( mysearchtext = ' + error);
|
||||
setDelete_Session_Formation_api("false");
|
||||
alert(" Impossible de supprimer la session");
|
||||
})
|
||||
}
|
||||
|
||||
const [isimgclassSelected, setisimgclassSelected] = useState(false);
|
||||
const [isimgclassSelected_recid, setisimgclassSelected_recid] = useState("");
|
||||
const [isimgclassSelectedfile, setisimgclassSelectedfile] = useState(false);
|
||||
|
@ -4427,7 +4490,7 @@ function GestionAdministrative(props) {
|
|||
history.push("/Connexion");
|
||||
} else {
|
||||
setrecord_Stagiaire_Image_api("false");
|
||||
alert(" Erreur : "+ result['message']);
|
||||
alert(" Erreur : " + result['message']);
|
||||
}
|
||||
|
||||
})
|
||||
|
@ -4811,7 +4874,7 @@ function GestionAdministrative(props) {
|
|||
/>
|
||||
</div>
|
||||
|
||||
<div className="session_caract">Session à la demande* <i>(0 = Non, 1 = Oui) </i><br />
|
||||
<div className="session_caract">Session à la demande* <i>(0 = Non, 1 = Oui) </i><br />
|
||||
<TextField
|
||||
name="one_session_ondemande"
|
||||
id="one_session_ondemande"
|
||||
|
@ -5593,6 +5656,61 @@ function GestionAdministrative(props) {
|
|||
|
||||
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
||||
|
||||
{!sessionChanged && mysession && fields1desabled &&
|
||||
<Popup
|
||||
trigger={<Button variant="contained" className="bton_supprimer" onClick={Delete_Session_Formation}>Supprimer
|
||||
</Button>
|
||||
}
|
||||
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, la session de formation sera <i><font color="red"> définitivement supprimée</font></i>. <br />
|
||||
|
||||
<div className="gest_actions">
|
||||
|
||||
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
Delete_Session_Formation();
|
||||
close();
|
||||
}}> Valider
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup"
|
||||
onClick={() => {
|
||||
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>)}
|
||||
</Popup>
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
{sessionChanged && mysession &&
|
||||
<Button variant="contained" className="bton_envoyer" onClick={CreateSessionFormation}>Enregistrer les modifications
|
||||
</Button>}
|
||||
|
@ -6838,7 +6956,7 @@ function GestionAdministrative(props) {
|
|||
|
||||
{String(participant_data_changed) === "1" && String(participant_data_edit_mode) === "1" && <div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
||||
|
||||
<Button variant="contained" className="bton_envoyer" onClick={Update_One_StagiaireData}>Enregistrer les modifications aa
|
||||
<Button variant="contained" className="bton_envoyer" onClick={Update_One_StagiaireData}>Enregistrer les modifications
|
||||
</Button>
|
||||
|
||||
</div>}
|
||||
|
|
|
@ -0,0 +1,978 @@
|
|||
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 CheckOut from "./CheckOut";
|
||||
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
|
||||
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
|
||||
import { Editor } from '@tinymce/tinymce-react';
|
||||
import parse from 'html-react-parser';
|
||||
import { FcViewDetails, FcDisapprove } from "react-icons/fc";
|
||||
import 'react-tooltip/dist/react-tooltip.css'
|
||||
import { Tooltip } from 'react-tooltip'
|
||||
import add_plus from "../mysy_img/plus.png";
|
||||
import excel_icone from "../mysy_img/excel_icone.png";
|
||||
import participants from "../mysy_img/participants.png";
|
||||
import fileDownload from 'js-file-download'
|
||||
import Popup from 'reactjs-popup';
|
||||
import 'reactjs-popup/dist/index.css';
|
||||
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
|
||||
import DatePicker from "react-datepicker";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
import { format } from 'date-fns'
|
||||
import moment from "moment";
|
||||
import InputAdornment from '@mui/material/InputAdornment';
|
||||
import { AiFillCloseCircle } from "react-icons/ai";
|
||||
import Box from '@mui/material/Box';
|
||||
import { Typography, LinearProgress } from '@mui/material';
|
||||
import styled from 'styled-components';
|
||||
import { CiTrash } from "react-icons/ci";
|
||||
import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
|
||||
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';
|
||||
import { TransitionProps } from '@mui/material/transitions';
|
||||
|
||||
const Materiels = (props) => {
|
||||
const history = useHistory();
|
||||
const [submenu, setsubmenu] = useState("");
|
||||
const [rowss, setRows] = useState([]);
|
||||
const [selectionModel, setSelectionModel] = React.useState([]);
|
||||
|
||||
const [rows_affectations, setrows_affectations] = useState([]);
|
||||
const [selectionModel_affectations, setSelectionModel_affectations] = React.useState([]);
|
||||
|
||||
|
||||
const [p_filtre1, setp_filtre1] = useState();
|
||||
const [p_filtre1_value, setp_filtre1_value] = useState();
|
||||
|
||||
const [p_filtre2, setp_filtre2] = useState();
|
||||
const [p_filtre2_value, setp_filtre2_value] = useState();
|
||||
|
||||
const [p_filtre3, setp_filtre3] = useState();
|
||||
const [p_filtre3_value, setp_filtre3_value] = useState();
|
||||
|
||||
const [p_filtre4, setp_filtre4] = useState();
|
||||
const [p_filtre4_value, setp_filtre4_value] = useState();
|
||||
|
||||
const columns = [
|
||||
{ field: '_id', headerName: '_id', hide: true },
|
||||
{ field: 'id', headerName: 'id', hide: true },
|
||||
{ field: 'ref_interne', headerName: 'Ref. Interne', width: 150, hideable: false, },
|
||||
{ field: 'nom', headerName: 'Nom', width: 150, hide: false, editable: true },
|
||||
{ field: 'famille', headerName: 'Famille', width: 150, hide: false, editable: true },
|
||||
{ field: 'marque', headerName: 'Marque', width: 150, hide: false, editable: true },
|
||||
{ field: 'type', headerName: 'Type', width: 150, hide: false, editable: true },
|
||||
{ field: 'fournisseur', headerName: 'Fournisseur', width: 150, hide: false, editable: true },
|
||||
{
|
||||
field: "delete", headerName: 'Supprimer',
|
||||
renderCell: (cellValues) => {
|
||||
return (
|
||||
|
||||
<Popup
|
||||
trigger={<Button
|
||||
|
||||
onClick={(event) => {
|
||||
// handleClick_delete(event, cellValues);
|
||||
}}
|
||||
>
|
||||
<CiTrash />
|
||||
|
||||
</Button>}
|
||||
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, l'employé sera <i><font color="red"> définitivement supprimé</font></i>. <br />
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
//handleClick_delete(event, cellValues);
|
||||
//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>
|
||||
|
||||
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
]
|
||||
|
||||
|
||||
|
||||
const myRef_head = useRef(null);
|
||||
|
||||
const [Dialog_1_message, setDialog_1_message] = React.useState(false);
|
||||
const [Dialog_1_open, setDialog_1_open] = React.useState(false);
|
||||
function Dialog_1_handle_change_participant_session(message) {
|
||||
setDialog_1_message(message);
|
||||
setDialog_1_open(true);
|
||||
}
|
||||
|
||||
const Dialog_1_handleClose = () => {
|
||||
//alert(" Utiliser le bouton 'fermer' ");
|
||||
//setOpen(false);
|
||||
};
|
||||
|
||||
const Dialog_1_handleClose_buton = () => {
|
||||
setDialog_1_open(false);
|
||||
};
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
Getall_Training_Materiel_No_Filter();
|
||||
}, [])
|
||||
|
||||
const myRef = useRef(null)
|
||||
|
||||
const [session_file_name, setsession_file_name] = useState();
|
||||
const [display_affectation, setdisplay_affectation] = useState();
|
||||
|
||||
const [Add_new_affectation, setAdd_new_affectation] = useState();
|
||||
const [display_detail_materiel, setdisplay_detail_materiel] = React.useState();
|
||||
|
||||
const hiddenFileInput_session = React.useRef(null);
|
||||
const [Employee_data_changed, setEmployee_data_changed] = useState();
|
||||
|
||||
const [add_One_Materiel, setadd_One_Materiel] = useState();
|
||||
|
||||
function submenu_add_one_materiel() {
|
||||
setdisplay_detail_materiel();
|
||||
setadd_One_Materiel("1");
|
||||
setsubmenu("detail_materiel");
|
||||
|
||||
}
|
||||
|
||||
function Annule_add_one_materiel() {
|
||||
setdisplay_detail_materiel();
|
||||
setadd_One_Materiel();
|
||||
setsubmenu("");
|
||||
setSelectionModel([]);
|
||||
}
|
||||
|
||||
function clean_affectation_fields(){
|
||||
|
||||
}
|
||||
|
||||
function clean_nouvelle_affectation_fields() {
|
||||
}
|
||||
|
||||
|
||||
const [Getall_Training_Materiel_api, setGetall_Training_Materiel_api] = useState();
|
||||
const [Getall_Training_Materiel_message, setGetall_Training_Materiel_message] = useState();
|
||||
const [Getall_Training_Materiel_result, setGetall_Training_Materiel_result] = useState();
|
||||
function Getall_Training_Materiel(event) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
|
||||
// Recuperation des parametres
|
||||
var filtre1 = p_filtre1;
|
||||
var filtre2 = p_filtre2;
|
||||
var filtre3 = p_filtre3;
|
||||
var filtre4 = p_filtre4;
|
||||
|
||||
var filtre1_value = "";
|
||||
var filtre2_value = "";
|
||||
var filtre3_value = "";
|
||||
var filtre4_value = "";
|
||||
// Recuperation des valeurs de filtres
|
||||
|
||||
if (p_filtre1_value) {
|
||||
filtre1_value = p_filtre1_value;
|
||||
form.append(filtre1, filtre1_value);
|
||||
}
|
||||
|
||||
if (p_filtre2_value) {
|
||||
filtre2_value = p_filtre2_value;
|
||||
form.append(filtre2, filtre2_value);
|
||||
}
|
||||
|
||||
if (p_filtre3_value) {
|
||||
filtre3_value = p_filtre3_value;
|
||||
form.append(filtre3, p_filtre3_value);
|
||||
}
|
||||
|
||||
if (p_filtre4_value) {
|
||||
filtre4_value = p_filtre4_value;
|
||||
form.append(filtre4, p_filtre4_value);
|
||||
}
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Ressource_Humaine_with_filter/";
|
||||
|
||||
|
||||
setdisplay_affectation("");
|
||||
setAdd_new_affectation("");
|
||||
clean_affectation_fields();
|
||||
clean_nouvelle_affectation_fields();
|
||||
setSelectionModel_affectations([]);
|
||||
setSelectionModel([]);
|
||||
setsubmenu("");
|
||||
setSelectionModel([]);
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Getall_Training_Materiel res.data.status = " + res.data.status);
|
||||
//console.log(" In Getall_Training_Materiel res.data.message r_class = " + res.data.message);
|
||||
setGetall_Training_Materiel_api("true");
|
||||
setGetall_Training_Materiel_result(res.data.message);
|
||||
setRows(res.data.message);
|
||||
}
|
||||
else {
|
||||
setGetall_Training_Materiel_api("false");
|
||||
setGetall_Training_Materiel_message(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( Getall_Training_Materiel = ', error);
|
||||
setGetall_Training_Materiel_api("false");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const [liste_sessions_file_change_api, setliste_sessions_file_change_api] = useState();
|
||||
const [liste_sessions_file_change_result, setliste_sessions_file_change_result] = useState();
|
||||
const [liste_sessions_file_change_message, setliste_sessions_file_change_message] = useState();
|
||||
const liste_sessions_file_change = event => {
|
||||
|
||||
|
||||
const fileUploaded = event.target.files[0];
|
||||
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);
|
||||
if (file_size > 1000000) {
|
||||
alert("Le fichier ne doit pas depasser un 1 Méga octets");
|
||||
return;
|
||||
}
|
||||
|
||||
setsession_file_name(event.target.files[0].name);
|
||||
|
||||
const formData = new FormData();
|
||||
formData.append('File', fileUploaded);
|
||||
//formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
||||
formData.append("token", stored_cookie);
|
||||
//console.log("token = " + stored_cookie);
|
||||
|
||||
fetch(
|
||||
process.env.REACT_APP_API_URL + "myclass/api/Add_Ressource_Humaine_mass/",
|
||||
{
|
||||
method: 'POST',
|
||||
body: formData,
|
||||
}
|
||||
)
|
||||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
|
||||
//console.log(" ## result['status'] = ", result['status'])
|
||||
if (String(result['status']) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + result['message']);
|
||||
history.push("/Connexion");
|
||||
}
|
||||
|
||||
else if (String(result['status']) === String("true")) {
|
||||
//console.log('Success:', result['message']);
|
||||
setliste_sessions_file_change_result(result['message']);
|
||||
setliste_sessions_file_change_api("true");
|
||||
|
||||
Getall_Training_Materiel();
|
||||
alert(" Le materiel ont été correctement importé");
|
||||
|
||||
}
|
||||
|
||||
else {
|
||||
setliste_sessions_file_change_message(result['message']);
|
||||
setliste_sessions_file_change_api("false");
|
||||
alert('Erreur: ' + result['message']);
|
||||
|
||||
}
|
||||
|
||||
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('Error:', error);
|
||||
setliste_sessions_file_change_api("false");
|
||||
alert(" Impossible d'importer le materiel ");
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function submenu_import_materiel() {
|
||||
setsession_file_name();
|
||||
setliste_sessions_file_change_api();
|
||||
hiddenFileInput_session.current.click();
|
||||
}
|
||||
|
||||
|
||||
|
||||
const [Getall_Training_Materiel_No_Filter_api, setGetall_Training_Materiel_No_Filter_api] = useState();
|
||||
const [Getall_Training_Materiel_No_Filter_message, setGetall_Training_Materiel_No_Filter_message] = useState();
|
||||
const [Getall_Training_Materiel_No_Filter_result, setGetall_Training_Materiel_No_Filter_result] = useState();
|
||||
function Getall_Training_Materiel_No_Filter(event) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Ressource_Materielle_no_filter/";
|
||||
|
||||
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
console.log(" In Getall_Training_Materiel_No_Filter res.data.status = " + res.data.status);
|
||||
console.log(" In Getall_Training_Materiel_No_Filter res.data.message r_class = " + res.data.message);
|
||||
setGetall_Training_Materiel_No_Filter_api("true");
|
||||
setGetall_Training_Materiel_No_Filter_result(res.data.message);
|
||||
setRows(res.data.message);
|
||||
}
|
||||
else {
|
||||
setGetall_Training_Materiel_No_Filter_api("false");
|
||||
setGetall_Training_Materiel_No_Filter_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( Getall_Training_Materiel_No_Filter = ', error);
|
||||
setGetall_Training_Materiel_No_Filter_api("false");
|
||||
alert(" Impossible de recuperer la liste du materiel");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
const sleep = (milliseconds) => {
|
||||
return new Promise(resolve => setTimeout(resolve, milliseconds))
|
||||
}
|
||||
|
||||
async function submenu_detail_materiel() {
|
||||
setsubmenu("detail_employe");
|
||||
|
||||
await sleep(5);
|
||||
/*if (!edit_session_form) {
|
||||
desableSessionFields();
|
||||
}*/
|
||||
|
||||
if (document.getElementById("detail_materiel")) {
|
||||
document.getElementById("detail_materiel").style.backgroundColor = "#104277";
|
||||
document.getElementById("detail_materiel").style.color = "white";
|
||||
}
|
||||
|
||||
|
||||
if (document.getElementById("affectation")) {
|
||||
document.getElementById("affectation").style.backgroundColor = "#d8edfc";
|
||||
document.getElementById("affectation").style.color = "black";
|
||||
}
|
||||
|
||||
//console.log(" ### employee_data_edit_mode = ", employee_data_edit_mode);
|
||||
/*if (String(materiel_data_edit_mode) !== "1")
|
||||
disable_Employee_DetailFields();*/
|
||||
|
||||
}
|
||||
|
||||
|
||||
async function submenu_affectation() {
|
||||
setsubmenu("affectation");
|
||||
|
||||
await sleep(5);
|
||||
/*if (!edit_session_form) {
|
||||
desableSessionFields();
|
||||
}*/
|
||||
|
||||
if (document.getElementById("affectation")) {
|
||||
document.getElementById("affectation").style.backgroundColor = "#104277";
|
||||
document.getElementById("affectation").style.color = "white";
|
||||
}
|
||||
|
||||
if (document.getElementById("detail_materiel")) {
|
||||
document.getElementById("detail_materiel").style.backgroundColor = "#d8edfc";
|
||||
document.getElementById("detail_materiel").style.color = "black";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="materiels">
|
||||
<Dialog
|
||||
open={Dialog_1_open}
|
||||
onClose={Dialog_1_handleClose}
|
||||
|
||||
>
|
||||
|
||||
<DialogTitle>MySy Information</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText>
|
||||
{Dialog_1_message}
|
||||
</DialogContentText>
|
||||
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<Button onClick={Dialog_1_handleClose_buton}>OK</Button>
|
||||
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
<h3> Votre matériel </h3>
|
||||
<div className="div_row">
|
||||
<div className="titre1"> Utilisez les filtres !</div>
|
||||
<div className="div_row" style={{ "marginBottom": "5px" }}>
|
||||
<div className="div_row_gauche texte_area_filter" >
|
||||
<TextField
|
||||
name="filtre1"
|
||||
label="Choisir un champ"
|
||||
select
|
||||
sx={{ m: 1, width: '100%' }}
|
||||
value={p_filtre1}
|
||||
onChange={(e) => {
|
||||
setp_filtre1(e.target.value);
|
||||
|
||||
}}
|
||||
>
|
||||
<MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email </MenuItem>
|
||||
<MenuItem value="nom" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Nom </MenuItem>
|
||||
<MenuItem value="formation" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Lié a la Formation (code externe) </MenuItem>
|
||||
<MenuItem value="session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Lié a la Session (code session) </MenuItem>
|
||||
|
||||
|
||||
</TextField>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div className="div_row_droite texte_area_filter_value" >
|
||||
{p_filtre1 &&
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="filtre1_value"
|
||||
id="filtre1_value"
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_filtre1_value}
|
||||
onChange={(e) => { setp_filtre1_value(e.target.value); }}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<AiFillCloseCircle
|
||||
style={{ 'cursor': "pointer", "color": "orangered" }}
|
||||
onClick={(e) => {
|
||||
setp_filtre1_value("");
|
||||
}} />
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
/>
|
||||
|
||||
}
|
||||
</div>
|
||||
{p_filtre1 && <div className='filter_bton_add'>
|
||||
<Tooltip id="my-tooltip01" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip01" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
|
||||
<MdAddCircleOutline onClick={(e) => {
|
||||
setp_filtre2("1");
|
||||
setp_filtre2_value("");
|
||||
}} />
|
||||
</a>
|
||||
</div>}
|
||||
{p_filtre1 && <div className='filter_bton_add'>
|
||||
<Tooltip id="my-tooltip02" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip02" data-tooltip-content="Supprimer cette ligne de filtre">
|
||||
<MdRemoveCircleOutline onClick={(e) => {
|
||||
setp_filtre1();
|
||||
setp_filtre1_value();
|
||||
}}
|
||||
/>
|
||||
</a>
|
||||
</div>}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
{p_filtre2 &&
|
||||
<div className="div_row" style={{ "marginBottom": "5px" }}>
|
||||
<div className="div_row_gauche texte_area_filter">
|
||||
<TextField
|
||||
name="filtre2"
|
||||
label="Choisir un champ"
|
||||
select
|
||||
sx={{ m: 1, width: '100%' }}
|
||||
|
||||
value={p_filtre2}
|
||||
onChange={(e) => {
|
||||
setp_filtre2(e.target.value);
|
||||
|
||||
}}
|
||||
>
|
||||
<MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email </MenuItem>
|
||||
<MenuItem value="nom" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Nom </MenuItem>
|
||||
<MenuItem value="formation" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Lié a la Formation (code externe) </MenuItem>
|
||||
<MenuItem value="session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Lié a la Session (code session) </MenuItem>
|
||||
|
||||
|
||||
</TextField>
|
||||
</div>
|
||||
<div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
|
||||
{String(p_filtre2).length > 2 &&
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="filtre2_value"
|
||||
id="filtre2_value"
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_filtre2_value}
|
||||
onChange={(e) => setp_filtre2_value(e.target.value)}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<AiFillCloseCircle
|
||||
style={{ 'cursor': "pointer", "color": "orangered" }}
|
||||
onClick={(e) => {
|
||||
setp_filtre2_value("");
|
||||
}} />
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
/>}
|
||||
</div>
|
||||
|
||||
{String(p_filtre2).length > 2 && <div className='filter_bton_add' >
|
||||
<Tooltip id="my-tooltip03" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip03" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
|
||||
<MdAddCircleOutline
|
||||
onClick={(e) => {
|
||||
setp_filtre3("1");
|
||||
setp_filtre3_value("");
|
||||
}}
|
||||
/>
|
||||
</a>
|
||||
</div>}
|
||||
|
||||
{String(p_filtre2).length > 2 && <div className='filter_bton_add'>
|
||||
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
|
||||
<MdRemoveCircleOutline
|
||||
onClick={(e) => {
|
||||
setp_filtre2();
|
||||
setp_filtre2_value();
|
||||
}}
|
||||
/>
|
||||
</a>
|
||||
</div>}
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
{p_filtre3 &&
|
||||
<div className="div_row" style={{ "marginBottom": "5px" }}>
|
||||
<div className="div_row_gauche texte_area_filter">
|
||||
<TextField
|
||||
name="filtre3"
|
||||
label="Choisir un champ"
|
||||
select
|
||||
sx={{ m: 1, width: '100%' }}
|
||||
|
||||
value={p_filtre3}
|
||||
onChange={(e) => {
|
||||
setp_filtre3(e.target.value)
|
||||
}}
|
||||
>
|
||||
<MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email </MenuItem>
|
||||
<MenuItem value="nom" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Nom </MenuItem>
|
||||
<MenuItem value="formation" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Lié a la Formation (code externe) </MenuItem>
|
||||
<MenuItem value="session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Lié a la Session (code session) </MenuItem>
|
||||
|
||||
|
||||
</TextField>
|
||||
</div>
|
||||
<div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
|
||||
{String(p_filtre3).length > 2 &&
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="filtre3_value"
|
||||
id="filtre3_value"
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_filtre3_value}
|
||||
onChange={(e) => setp_filtre3_value(e.target.value)}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<AiFillCloseCircle
|
||||
style={{ 'cursor': "pointer", "color": "orangered" }}
|
||||
onClick={(e) => {
|
||||
setp_filtre3_value("");
|
||||
}} />
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
/>}
|
||||
</div>
|
||||
|
||||
{String(p_filtre2).length > 2 && <div className='filter_bton_add' >
|
||||
<Tooltip id="my-tooltip03" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip03" data-tooltip-content="Ajouter une nouvelle ligne de filtre">
|
||||
<MdAddCircleOutline
|
||||
onClick={(e) => {
|
||||
setp_filtre4("1");
|
||||
setp_filtre4_value("");
|
||||
}}
|
||||
/>
|
||||
</a>
|
||||
</div>}
|
||||
|
||||
{String(p_filtre3).length > 2 && <div className='filter_bton_add'>
|
||||
<Tooltip id="my-tooltip05" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip05" data-tooltip-content="Supprimer cette ligne de filtre">
|
||||
<MdRemoveCircleOutline onClick={(e) => {
|
||||
setp_filtre3();
|
||||
setp_filtre3_value();
|
||||
}} />
|
||||
</a>
|
||||
</div>}
|
||||
</div>
|
||||
}
|
||||
|
||||
{/*
|
||||
{p_filtre4 &&
|
||||
<div className="div_row" style={{ "marginBottom": "5px" }}>
|
||||
<div className="div_row_gauche texte_area_filter">
|
||||
<TextField
|
||||
name="filtre4"
|
||||
label="Choisir un champ"
|
||||
select
|
||||
sx={{ m: 1, width: '100%' }}
|
||||
|
||||
value={p_filtre4}
|
||||
onChange={(e) => {
|
||||
setp_filtre4(e.target.value)
|
||||
}}
|
||||
>
|
||||
<MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email </MenuItem>
|
||||
<MenuItem value="nom" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Nom </MenuItem>
|
||||
<MenuItem value="code_session" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Code Session </MenuItem>
|
||||
<MenuItem value="class_title" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Titre Formation </MenuItem>
|
||||
|
||||
|
||||
</TextField>
|
||||
</div>
|
||||
<div className="div_row_droite texte_area_filter_value" style={{ "marginTop": "0.5rem" }}>
|
||||
{String(p_filtre4).length > 2 &&
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="filtre4_value"
|
||||
id="filtre4_value"
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_filtre4_value}
|
||||
onChange={(e) => setp_filtre2_value(e.target.value)}
|
||||
InputProps={{
|
||||
endAdornment: (
|
||||
<InputAdornment position="end">
|
||||
<AiFillCloseCircle
|
||||
style={{ 'cursor': "pointer", "color": "orangered" }}
|
||||
onClick={(e) => {
|
||||
setp_filtre4_value("");
|
||||
}} />
|
||||
</InputAdornment>
|
||||
),
|
||||
}}
|
||||
|
||||
/>}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{String(p_filtre2).length > 2 && <div className='filter_bton_add'>
|
||||
<Tooltip id="my-tooltip04" style={{ "fontSize": "12px" }} />
|
||||
<a data-tooltip-id="my-tooltip04" data-tooltip-content="Supprimer cette ligne de filtre">
|
||||
<MdRemoveCircleOutline
|
||||
onClick={(e) => {
|
||||
setp_filtre4();
|
||||
setp_filtre4_value();
|
||||
}}
|
||||
/>
|
||||
</a>
|
||||
</div>}
|
||||
|
||||
</div>
|
||||
}
|
||||
*/}
|
||||
<div className="div_row" ref={myRef_head} style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
|
||||
|
||||
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
||||
<Button variant="contained" className="bton_enreg" onClick={"Getall_Training_Employee"}>Rechercher
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
|
||||
<Button variant="contained" className="bton_annule" onClick={"clean_all_filters"}>Annuler
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<div className="div_row">
|
||||
<div className="session_data">
|
||||
<div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '1px' }}>
|
||||
|
||||
<Box
|
||||
sx={{
|
||||
height: 500,
|
||||
width: '100%',
|
||||
paddingRight: '1px',
|
||||
|
||||
// Gestion des cellule a distance ou presentiel
|
||||
'& .cell--distantiel': {
|
||||
backgroundColor: '#AFE1AF',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
'& .cell--presentiel': {
|
||||
backgroundColor: '#AFE1AF',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
|
||||
// gestion couleur des lignes avec le statut d'inscription
|
||||
'& .line--statut--annule': {
|
||||
backgroundColor: '#D8D8D8',
|
||||
color: 'white',
|
||||
},
|
||||
|
||||
'& .line--statut--inscrit': {
|
||||
backgroundColor: '#CEF6D8',
|
||||
color: 'black',
|
||||
},
|
||||
'& .line--statut--preinscrit': {
|
||||
backgroundColor: '#F7F2E0',
|
||||
color: 'black',
|
||||
},
|
||||
|
||||
/*"& .MuiDataGrid-virtualScrollerRenderZone": {
|
||||
"& .MuiDataGrid-row": {
|
||||
"&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
|
||||
}
|
||||
},*/
|
||||
"& .MuiDataGrid-columnHeaders": {
|
||||
backgroundColor: "#c8cfd5",
|
||||
color: "black",
|
||||
fontSize: 14
|
||||
},
|
||||
|
||||
}}
|
||||
>
|
||||
<DataGrid
|
||||
checkboxSelection
|
||||
/*onSelectionModelChange={(newSelectionModel) => {
|
||||
setSelectionModel(newSelectionModel);
|
||||
if (newSelectionModel.length === 1)
|
||||
handleClick_edit_employee_From_Line(newSelectionModel);
|
||||
if (newSelectionModel.length !== 1) {
|
||||
setsubmenu();
|
||||
setdisplay_detail_employe();
|
||||
setadd_One_Employee();
|
||||
}
|
||||
}}*/
|
||||
selectionModel={selectionModel}
|
||||
|
||||
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
|
||||
rows={rowss.map((item, index) => (
|
||||
{
|
||||
id: index,
|
||||
_id: JSON.parse(item)._id,
|
||||
email: JSON.parse(item).email,
|
||||
nom: JSON.parse(item).nom,
|
||||
ref_interne: JSON.parse(item).ref_interne,
|
||||
famille: JSON.parse(item).famille,
|
||||
marque: JSON.parse(item).marque,
|
||||
type: JSON.parse(item).type,
|
||||
fournisseur: JSON.parse(item).fournisseur,
|
||||
|
||||
}
|
||||
))}
|
||||
|
||||
columns={columns}
|
||||
pageSize={10}
|
||||
className="datagridclass"
|
||||
|
||||
rowsPerPageOptions={[10]}
|
||||
//disableSelectionOnClick
|
||||
components={{
|
||||
Toolbar: GridToolbar,
|
||||
}}
|
||||
//sx={datagridSx}
|
||||
getCellClassName={(params) => {
|
||||
//field === 'distantiel'
|
||||
if (params.field === 'distantiel' && String(params.value) === "1") {
|
||||
return 'cell--distantiel';
|
||||
}
|
||||
if (params.field === "presentiel" && String(params.value) == "1") {
|
||||
return 'cell--presentiel';
|
||||
}
|
||||
|
||||
|
||||
//field === "statut"
|
||||
if (params.field === "status" && String(params.value) == "0") {
|
||||
return 'cell--statut--preinscrit';
|
||||
}
|
||||
|
||||
if (params.field === "status" && String(params.value) == "1") {
|
||||
return 'cell--statut--inscrit';
|
||||
}
|
||||
|
||||
if (params.field === "status" && String(params.value) == "-1") {
|
||||
return 'cell--statut--annule';
|
||||
}
|
||||
|
||||
}}
|
||||
getRowClassName={(params) => {
|
||||
|
||||
if (String(params.row.status) === "-1") {
|
||||
return 'line--statut--annule';
|
||||
}
|
||||
if (String(params.row.status) === "0") {
|
||||
return 'line--statut--preinscrit';
|
||||
}
|
||||
if (String(params.row.status) === "1") {
|
||||
return 'line--statut--inscrit';
|
||||
}
|
||||
}}
|
||||
|
||||
|
||||
/>
|
||||
</Box>
|
||||
<br />
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
|
||||
<div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
|
||||
|
||||
<Button variant="outlined" onClick={submenu_import_materiel} className="detail_class_submenu bton_import_excel"
|
||||
id='menu_import_participant' name='menu_import_participant'>Importer du materiel Excel
|
||||
<img src={excel_icone} alt="ajout csv" className="icon_excel" />
|
||||
</Button>
|
||||
|
||||
|
||||
<Button variant="outlined" onClick={submenu_add_one_materiel}
|
||||
className="detail_class_submenu bton_add_session"
|
||||
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Materiel
|
||||
<img src={add_plus} alt="ajout session" className="icon_plus" />
|
||||
</Button>
|
||||
|
||||
<br />
|
||||
{session_file_name && <nav><i>{session_file_name}</i></nav>}
|
||||
{String(liste_sessions_file_change_api) === String("true") && <nav className="okUpdateData"> Le materiel ont été correctement importé</nav>}
|
||||
{String(liste_sessions_file_change_api) === String("false") && <nav className="koUpdateData"> {liste_sessions_file_change_message} </nav>}
|
||||
|
||||
<input type="file"
|
||||
accept=".csv"
|
||||
ref={hiddenFileInput_session}
|
||||
style={{ display: 'none' }}
|
||||
name="liste_sessions_file"
|
||||
onChange={liste_sessions_file_change}
|
||||
/>
|
||||
|
||||
<a href='/sample/template_import_employes.csv' download>Télécharger un fichier modèle</a>
|
||||
</div>
|
||||
</div>
|
||||
<div className="div_row"> </div>
|
||||
<div className="div_row">
|
||||
<Button variant="outlined" ref={myRef} onClick={submenu_detail_materiel} className="detail_materiel" id='detail_materiel' name='detail_employe'>Détail Materiel</Button>
|
||||
<Button variant="outlined" onClick={submenu_affectation} className="detail_class_submenu" id='affectation' name='affectation'>Affectation </Button>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div >
|
||||
);
|
||||
}
|
||||
|
||||
export default Materiels;
|
|
@ -41,9 +41,12 @@ import {
|
|||
FcFlowChart, FcReading
|
||||
} from "react-icons/fc";
|
||||
|
||||
import { BsTools } from "react-icons/bs";
|
||||
|
||||
import DisplayPartnerSession from "./DisplayPartnerSession";
|
||||
import DisplayPartnerStagiaires from "./DisplayPartnerStagiaires";
|
||||
import Employes from "./Employes";
|
||||
import Materiels from "./Materiels";
|
||||
|
||||
//import { FcHome} from "react-icons/fc";
|
||||
|
||||
|
@ -240,7 +243,7 @@ const Partner = (props) => {
|
|||
|
||||
var list_menu = ['creation', 'infopartner', 'statistique', 'abonnement', 'affichage', 'ordervalide',
|
||||
'mes_sessions', 'setuplms', 'facture', 'pricing', 'mes_clients', 'mes_devis', 'mes_cmd',
|
||||
'mes_stagiaires', 'mes_employes']
|
||||
'mes_stagiaires', 'mes_employes', 'mon_materiel']
|
||||
|
||||
|
||||
if (action && list_menu.includes(action)) {
|
||||
|
@ -361,7 +364,12 @@ const Partner = (props) => {
|
|||
history.push("/Partner/mes_employes");
|
||||
}
|
||||
|
||||
|
||||
function DisplayeMaterielList(event) {
|
||||
setmenu("mon_materiel");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/mon_materiel");
|
||||
}
|
||||
|
||||
|
||||
function DiplaytrainingList(event) {
|
||||
|
@ -737,6 +745,10 @@ const Partner = (props) => {
|
|||
{String(menu) === "mes_employes" && <div className="sousmenu_selected" onClick={DisplayeEmployeList} ><GiTeacher className="icone_menu" /> MES EMPLOYES</div>}
|
||||
<hr className="my_hr" />
|
||||
|
||||
{String(menu) !== "mon_materiel" && <div className="sousmenu" onClick={DisplayeMaterielList} > <BsTools className="icone_menu" /> MON MATERIEL </div>}
|
||||
{String(menu) === "mon_materiel" && <div className="sousmenu_selected" onClick={DisplayeMaterielList} ><BsTools className="icone_menu" /> MON MATERIEL </div>}
|
||||
<hr className="my_hr" />
|
||||
|
||||
|
||||
{String(menu) !== "abonnement" && <div className="sousmenu" onClick={Abonnement_func} > <FcKey className="icone_menu" /> ABONNEMENT </div>}
|
||||
{String(menu) === "abonnement" && <div className="sousmenu_selected" onClick={Abonnement_func} > <FcKey className="icone_menu" /> ABONNEMENT </div>}
|
||||
|
@ -968,14 +980,12 @@ const Partner = (props) => {
|
|||
|
||||
{String(menu) === "statistique" &&
|
||||
<div className="div_droite">
|
||||
|
||||
<PartenairStat />
|
||||
</div>
|
||||
}
|
||||
|
||||
{String(menu) === "setuplms" &&
|
||||
<div className="div_droite">
|
||||
|
||||
<HebergementLms />
|
||||
</div>
|
||||
}
|
||||
|
@ -983,17 +993,20 @@ const Partner = (props) => {
|
|||
|
||||
{String(menu) === "mes_sessions" &&
|
||||
<div className="div_droite">
|
||||
|
||||
<DisplayPartnerSession />
|
||||
|
||||
</div>
|
||||
}
|
||||
|
||||
{String(menu) === "mes_employes" &&
|
||||
<div className="div_droite">
|
||||
|
||||
<Employes />
|
||||
</div>
|
||||
}
|
||||
|
||||
|
||||
{String(menu) === "mon_materiel" &&
|
||||
<div className="div_droite">
|
||||
<Materiels />
|
||||
</div>
|
||||
}
|
||||
|
||||
|
|
|
@ -257,6 +257,15 @@
|
|||
color: #104277 !important;
|
||||
}
|
||||
|
||||
.bton_supprimer {
|
||||
border-radius: 5px;
|
||||
font-size: small;
|
||||
padding: 0.3rem;
|
||||
width: 100%;
|
||||
background-color: white;
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
.css-1x5jdmq {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
@ -311,6 +320,7 @@
|
|||
margin-top: 1rem;
|
||||
|
||||
}
|
||||
|
||||
.div_row_gauche_image {
|
||||
float: left;
|
||||
//border:0px solid black;
|
||||
|
@ -614,6 +624,15 @@
|
|||
color: #104277 !important;
|
||||
}
|
||||
|
||||
.bton_supprimer {
|
||||
border-radius: 5px;
|
||||
font-size: small;
|
||||
padding: 0.3rem;
|
||||
width: 80%;
|
||||
background-color: white;
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
.css-1x5jdmq {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
@ -966,6 +985,17 @@
|
|||
color: #104277 !important;
|
||||
}
|
||||
|
||||
|
||||
.bton_supprimer {
|
||||
border-radius: 5px;
|
||||
font-size: small;
|
||||
padding: 0.3rem;
|
||||
width: 60%;
|
||||
background-color: white;
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
|
||||
.css-1x5jdmq {
|
||||
padding: 6px !important;
|
||||
}
|
||||
|
@ -1392,12 +1422,20 @@
|
|||
color: #104277 !important;
|
||||
}
|
||||
|
||||
.bton_supprimer {
|
||||
border-radius: 5px;
|
||||
font-size: small;
|
||||
padding: 0.3rem;
|
||||
width: 60%;
|
||||
background-color: white;
|
||||
color: red !important;
|
||||
}
|
||||
|
||||
|
||||
.enable_style {
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
|
||||
// end media
|
||||
|
||||
.css-1t8l2tu-MuiInputBase-input-MuiOutlinedInput-input:invalid {
|
||||
padding-top: 5px !important;
|
||||
|
@ -1455,6 +1493,16 @@
|
|||
}
|
||||
}
|
||||
|
||||
// end media
|
||||
|
||||
.css-igs3ac{
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.css-1v4ccyo {
|
||||
height: 3.5rem !important;
|
||||
}
|
||||
|
||||
option {
|
||||
font-weight: normal;
|
||||
display: block;
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -74,4 +74,5 @@
|
|||
@import "./components/displaypartnerstagiaire";
|
||||
@import "./components/global_mysy_css";
|
||||
@import "./components/employes";
|
||||
@import "./components/materiels";
|
||||
|
||||
|
|
Loading…
Reference in New Issue