30/09/2023 - 14h
parent
a1c1046dbf
commit
9c9677b5d2
|
@ -587,6 +587,8 @@ const Employes = (props) => {
|
|||
|
||||
Getall_Employee_Affectation(employe_id);
|
||||
Getall_Employee_Acces_Right(employe_id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -669,6 +671,9 @@ const Employes = (props) => {
|
|||
const [p_detail_resp_hierarchie_nom, setp_detail_resp_hierarchie_nom] = useState("");
|
||||
const [p_detail_resp_hierarchie_prenom, setp_detail_resp_hierarchie_prenom] = useState("");
|
||||
|
||||
const [p_detail_user_login, setp_detail_user_login] = useState();
|
||||
const [p_detail_user_pass, setp_detail_user_pass] = useState();
|
||||
|
||||
|
||||
const [p_one_detail_nom, setp_one_detail_nom] = useState();
|
||||
const [p_one_detail_prenom, setp_one_detail_prenom] = useState();
|
||||
|
@ -805,6 +810,13 @@ const Employes = (props) => {
|
|||
setp_detail_fonction(mylocal_employe.fonction);
|
||||
}
|
||||
|
||||
if (mylocal_employe.user_login) {
|
||||
setp_detail_user_login(mylocal_employe.user_login);
|
||||
setp_new_login(mylocal_employe.user_login)
|
||||
}else{
|
||||
setp_new_login(mylocal_employe.email)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (mylocal_employe.ismanager) {
|
||||
|
@ -1290,6 +1302,12 @@ const Employes = (props) => {
|
|||
document.getElementsByName("detail_ismanager")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
if (document.getElementsByName("detail_user_login")[0]) {
|
||||
document.getElementsByName("detail_user_login")[0].disabled = true;
|
||||
document.getElementsByName("detail_user_login")[0].style.backgroundColor = "#ECEFF1";
|
||||
}
|
||||
|
||||
|
||||
if (document.getElementsByName("detail_resp_hierarchie_id")[0]) {
|
||||
document.getElementsByName("detail_resp_hierarchie_id")[0].disabled = true;
|
||||
document.getElementsByName("detail_resp_hierarchie_id")[0].style.backgroundColor = "#ECEFF1";
|
||||
|
@ -1353,6 +1371,9 @@ const Employes = (props) => {
|
|||
document.getElementsByName("detail_ismanager")[0].disabled = false;
|
||||
document.getElementsByName("detail_ismanager")[0].style.backgroundColor = "#FFFFFF";
|
||||
|
||||
document.getElementsByName("detail_user_login")[0].disabled = false;
|
||||
document.getElementsByName("detail_user_login")[0].style.backgroundColor = "#FFFFFF";
|
||||
|
||||
document.getElementsByName("detail_resp_hierarchie_id")[0].disabled = false;
|
||||
document.getElementsByName("detail_resp_hierarchie_id")[0].style.backgroundColor = "#FFFFFF";
|
||||
|
||||
|
@ -1467,6 +1488,8 @@ const Employes = (props) => {
|
|||
else
|
||||
form.append("twitter", "");
|
||||
|
||||
|
||||
|
||||
if (p_detail_ismanager)
|
||||
form.append("ismanager", p_detail_ismanager);
|
||||
else
|
||||
|
@ -2134,26 +2157,6 @@ const Employes = (props) => {
|
|||
|
||||
async function submenu_droit_acces() {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("module_name", 'employe');
|
||||
form.append("action", 'read');
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Is_User_Has_Right_To_Action/";
|
||||
|
||||
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Check_User_Access_Right res.data.status = " + res.data.status);
|
||||
//console.log(" In Check_User_Access_Right res.data.message r_class = " + res.data.message);
|
||||
setCheck_User_Access_Right_api("true");
|
||||
setCheck_User_Access_Right_result(res.data.message);
|
||||
|
||||
setsubmenu("droit_acces");
|
||||
|
||||
sleep(5);
|
||||
|
@ -2177,28 +2180,6 @@ const Employes = (props) => {
|
|||
setAdd_new_affectation("");
|
||||
clean_affectation_fields();
|
||||
clean_nouvelle_affectation_fields();
|
||||
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setCheck_User_Access_Right_api("false");
|
||||
setCheck_User_Access_Right_message(res.data.message);
|
||||
alert(res.data.message)
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
console.warn('Not good man :( Check_User_Access_Right = ', error);
|
||||
setCheck_User_Access_Right_api("false");
|
||||
alert(" Impossible de recuperer la matrice des droits d'acces de l'employé");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2771,6 +2752,63 @@ const Employes = (props) => {
|
|||
};
|
||||
|
||||
|
||||
|
||||
const [Dialog_1_message_create_update_login_pwd, setDialog_1_message_create_update_login_pwd] = React.useState(false);
|
||||
const [Dialog_1_open_create_update_login_pwd, setDialog_1_open_create_update_login_pwd] = React.useState(false);
|
||||
|
||||
function Dialog_1_handle_change_login_pwd() {
|
||||
setDialog_1_message_create_update_login_pwd("Souhaitez-vous modifier les accès (login & pwd) de l'utilisateur ?");
|
||||
setDialog_1_open_create_update_login_pwd(true);
|
||||
}
|
||||
|
||||
const Dialog_1_handleClose_buton_create_update_login_pwd = () => {
|
||||
//alert(" Utiliser le bouton 'fermer' ");
|
||||
//setOpen(false);
|
||||
};
|
||||
|
||||
const Dialog_1_handle_OK_buton_create_update_login_pwd = () => {
|
||||
|
||||
setDialog_1_open_create_update_login_pwd(false);
|
||||
setDialog_1_open_create_update_login_pwd_update(true);
|
||||
};
|
||||
|
||||
|
||||
const Dialog_1_handleCancel_buton_create_update_login_pwd = () => {
|
||||
setDialog_1_open_create_update_login_pwd(false);
|
||||
};
|
||||
|
||||
const [Dialog_1_message_create_update_login_pwd_update, setDialog_1_message_create_update_login_pwd_update] = React.useState(false);
|
||||
const [Dialog_1_open_create_update_login_pwd_update, setDialog_1_open_create_update_login_pwd_update] = React.useState(false);
|
||||
|
||||
function Dialog_1_handle_change_login_pwd_update() {
|
||||
setDialog_1_message_create_update_login_pwd_update("Souhaitez-vous modifier les accès (login & pwd) de l'utilisateur ?");
|
||||
setDialog_1_open_create_update_login_pwd_update(true);
|
||||
}
|
||||
|
||||
const Dialog_1_handleClose_buton_create_update_login_pwd_update = () => {
|
||||
//alert(" Utiliser le bouton 'fermer' ");
|
||||
//setOpen(false);
|
||||
};
|
||||
|
||||
const Dialog_1_handle_OK_buton_create_update_login_pwd_update = () => {
|
||||
|
||||
setDialog_1_open_create_update_login_pwd_update(false);
|
||||
};
|
||||
|
||||
|
||||
const Dialog_1_handleCancel_buton_create_update_login_pwd_update = () => {
|
||||
setDialog_1_open_create_update_login_pwd_update(false);
|
||||
//setp_new_login('');
|
||||
setp_new_pwd('');
|
||||
setp_conf_new_login('');
|
||||
|
||||
};
|
||||
|
||||
|
||||
const [p_new_login, setp_new_login] = React.useState("");
|
||||
const [p_new_pwd, setp_new_pwd] = React.useState("");
|
||||
const [p_conf_new_login, setp_conf_new_login] = React.useState("");
|
||||
|
||||
function OnchangeCellDataGrid(params) {
|
||||
|
||||
|
||||
|
@ -2826,6 +2864,92 @@ const Employes = (props) => {
|
|||
|
||||
}
|
||||
|
||||
|
||||
const [Add_Update_Employee_Login_Pass_Data_api, setAdd_Update_Employee_Login_Pass_Data_api] = useState();
|
||||
const [Add_Update_Employee_Login_Pass_Data_message, setAdd_Update_Employee_Login_Pass_Data_message] = useState();
|
||||
const [Add_Update_Employee_Login_Pass_Data_result, setAdd_Update_Employee_Login_Pass_Data_result] = useState();
|
||||
function Add_Update_Employee_Login_Pass_Data() {
|
||||
var form = new FormData();
|
||||
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
|
||||
|
||||
// Controle sur les champs
|
||||
|
||||
if (p_new_login.trim() == "") {
|
||||
alert(" Vous devez saisir le mail de login");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (p_new_pwd.trim() == "") {
|
||||
alert(" Vous devez saisir un mot de passe");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (p_conf_new_login.trim() == "") {
|
||||
alert(" Vous devez confirmer le mot de passe");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
|
||||
if (!p_new_login.match(validRegex)) {
|
||||
alert("L'adresse email est invalide.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("email", p_new_login);
|
||||
form.append("pwd", p_new_pwd);
|
||||
form.append("ressource_humaine_id", selected_id);
|
||||
|
||||
|
||||
|
||||
console.log(" form == ", form);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_Employee_Login_Pass/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
//console.log(" In Add_Update_Employee_Login_Pass_Data res.data.status = " + res.data.status);
|
||||
//console.log(" In Add_Update_Employee_Login_Pass_Data res.data.message r_class = " + res.data.message);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
setAdd_Update_Employee_Login_Pass_Data_api("true");
|
||||
setAdd_Update_Employee_Login_Pass_Data_result(res.data.message);
|
||||
|
||||
setp_detail_user_login(p_new_login);
|
||||
|
||||
setDialog_1_open_create_update_login_pwd_update(false);
|
||||
alert(res.data.message);
|
||||
setp_new_login('');
|
||||
setp_new_pwd('');
|
||||
setp_conf_new_login('');
|
||||
|
||||
}
|
||||
else {
|
||||
setAdd_Update_Employee_Login_Pass_Data_api("false");
|
||||
setAdd_Update_Employee_Login_Pass_Data_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
|
||||
console.warn('UpdateStagiaireData : Not good man :( Add_Update_Employee_Login_Pass_Data = ' + error);
|
||||
setAdd_Update_Employee_Login_Pass_Data_api("false");
|
||||
alert(" Impossible de créer ou mettre à jour le compte l'employé");
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
function Generate_Pwd(){
|
||||
var randomstring = Math.random().toString(36).slice(-8);
|
||||
setp_new_pwd(randomstring);
|
||||
setp_conf_new_login(randomstring);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="employes">
|
||||
<Dialog
|
||||
|
@ -2870,6 +2994,127 @@ const Employes = (props) => {
|
|||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
<Dialog
|
||||
open={Dialog_1_open_create_update_login_pwd}
|
||||
onClose={Dialog_1_handleClose_buton_create_update_login_pwd}
|
||||
|
||||
>
|
||||
|
||||
<DialogTitle>MySy Information</DialogTitle>
|
||||
<DialogContent>
|
||||
<DialogContentText>
|
||||
{Dialog_1_message_create_update_login_pwd}
|
||||
</DialogContentText>
|
||||
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<Button onClick={Dialog_1_handle_OK_buton_create_update_login_pwd}>OK</Button>
|
||||
<Button onClick={Dialog_1_handleCancel_buton_create_update_login_pwd}>Annuler</Button>
|
||||
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
<Dialog
|
||||
open={Dialog_1_open_create_update_login_pwd_update}
|
||||
onClose={Dialog_1_handleClose_buton_create_update_login_pwd_update}
|
||||
className="employes"
|
||||
|
||||
|
||||
>
|
||||
|
||||
<DialogTitle>MySy Information</DialogTitle>
|
||||
<DialogContent style={{"background": "#fffff0"}}>
|
||||
|
||||
<DialogContentText>
|
||||
Mise à jour Login & Mot de passe
|
||||
</DialogContentText>
|
||||
|
||||
|
||||
|
||||
<div className="session_caract_Dialog" > Login
|
||||
<TextField
|
||||
autoFocus
|
||||
margin="dense"
|
||||
id="new_login"
|
||||
//label="Prix Unitaire"
|
||||
|
||||
fullWidth
|
||||
//variant="standard"
|
||||
value={p_new_login}
|
||||
onChange={(e) => {
|
||||
setp_new_login(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="session_caract_Dialog" > Mot de passe
|
||||
<TextField
|
||||
autoFocus
|
||||
margin="dense"
|
||||
id="new_pwd"
|
||||
//label="Prix Unitaire"
|
||||
|
||||
fullWidth
|
||||
//variant="standard"
|
||||
value={p_new_pwd}
|
||||
onChange={(e) => {
|
||||
setp_new_pwd(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<div className="session_caract_Dialog" > Confirmer Mot de passe
|
||||
<TextField
|
||||
autoFocus
|
||||
margin="dense"
|
||||
id="conf_new_login"
|
||||
//label="Prix Unitaire"
|
||||
|
||||
fullWidth
|
||||
//variant="standard"
|
||||
value={p_conf_new_login}
|
||||
onChange={(e) => {
|
||||
setp_conf_new_login(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div className="div_row">
|
||||
<div className="div_row_droite">
|
||||
<Button onClick={Generate_Pwd} className="bton_enreg_dialog">Generer un mot de passe</Button>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
|
||||
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
<Button onClick={Add_Update_Employee_Login_Pass_Data} className="bton_enreg_dialog">Mettre à jour</Button>
|
||||
</div>
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Dialog_1_handleCancel_buton_create_update_login_pwd_update} className="bton_annule_dialog" >Annuler</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
|
||||
|
||||
<h3> Vos employés </h3>
|
||||
<div className="div_row">
|
||||
<div className="titre1"> Utilisez les filtres !</div>
|
||||
|
@ -3883,6 +4128,42 @@ const Employes = (props) => {
|
|||
</TextField>
|
||||
</div>}
|
||||
|
||||
<div className="div_row">
|
||||
<hr />
|
||||
</div>
|
||||
{String(employee_data_edit_mode) !== "1" && <div className="session_caract"> Login<br />
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="detail_user_login"
|
||||
id="detail_user_login"
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_detail_user_login}
|
||||
/>
|
||||
</div>}
|
||||
|
||||
{String(employee_data_edit_mode) === "1" && <div className="session_caract"> Login<br />
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="detail_user_login"
|
||||
id="detail_user_login"
|
||||
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={p_detail_user_login}
|
||||
/> <Button variant="contained" className="bton_enreg" onClick={Dialog_1_handle_change_login_pwd}> Créer / Mettre à jour login & pwd
|
||||
</Button>
|
||||
</div>}
|
||||
|
||||
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
|
||||
|
|
|
@ -49,6 +49,12 @@ import Employes from "./Employes";
|
|||
import Materiels from "./Materiels";
|
||||
import Partner_Commande from "./Partner_Commande";
|
||||
import Config_Documents from "./Config_Document";
|
||||
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 { FcHome} from "react-icons/fc";
|
||||
|
||||
const Partner = (props) => {
|
||||
|
@ -252,9 +258,11 @@ const Partner = (props) => {
|
|||
// check du droit d'acces de l'utilisateur
|
||||
function check_user_acces_right(local_module, local_action) {
|
||||
|
||||
//console.log(" #### check_user_acces_right = ", local_module, " --- local_action = ", local_action);
|
||||
console.log(" ### connected_user_access_right = ", connected_user_access_right);
|
||||
console.log(" #### check_user_acces_right = ", local_module, " --- local_action = ", local_action);
|
||||
for (let i = 0; i < connected_user_access_right.length; i++) {
|
||||
if (String(connected_user_access_right[i].module) === String(local_module)) {
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
@ -303,67 +311,103 @@ const Partner = (props) => {
|
|||
|
||||
|
||||
function CreateTraining(event) {
|
||||
var security_retval = check_user_acces_right("formation", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("creation");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/creation");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
function PersonnalData(event) {
|
||||
var security_retval = check_user_acces_right("compte_partner", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("infopartner");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/infopartner");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function config_document_func(event) {
|
||||
var security_retval = check_user_acces_right("config_document", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("config_document");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/config_document");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DisplayStat(event) {
|
||||
var security_retval = check_user_acces_right("formation", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("statistique");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/statistique");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
function DisplaySetUpLMS(event) {
|
||||
var security_retval = check_user_acces_right("lms", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("setuplms");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/setuplms");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function DisplayFacure(event) {
|
||||
|
||||
var security_retval = check_user_acces_right("commande", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("facture");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/facture");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function Abonnement_func(event) {
|
||||
var security_retval = check_user_acces_right("abonnement", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("abonnement");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/abonnement");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function pricing_func(event) {
|
||||
var security_retval = check_user_acces_right("prix", "read");
|
||||
|
||||
if (security_retval === 1) {
|
||||
setmenu("pricing");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/pricing");
|
||||
} else {
|
||||
alert("Vous droits ne sont pas suffisants");
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -377,51 +421,85 @@ const Partner = (props) => {
|
|||
setformation_file_name();
|
||||
history.push("/Partner/mes_clients");
|
||||
} else {
|
||||
alert("Vous droits ne sont pas suffisants");
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
function mes_devis_func(event) {
|
||||
var security_retval = check_user_acces_right("commande", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("mes_devis");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/mes_devis");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function mes_cmd_func(event) {
|
||||
var security_retval = check_user_acces_right("commande", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("mes_cmd");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/mes_cmd");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function DiplaySessionList(event) {
|
||||
var security_retval = check_user_acces_right("session", "read");
|
||||
|
||||
|
||||
if (security_retval === 1) {
|
||||
setmenu("mes_sessions");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/mes_sessions");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
function DiplayStagiaireList(event) {
|
||||
var security_retval = check_user_acces_right("stagiaire", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("mes_stagiaires");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/mes_stagiaires");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
function DisplayeEmployeList(event) {
|
||||
var security_retval = check_user_acces_right("employe", "read");
|
||||
if (security_retval === 1) {
|
||||
setmenu("mes_employes");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/mes_employes");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
function DisplayeMaterielList(event) {
|
||||
var security_retval = check_user_acces_right("materiel", "read");
|
||||
|
||||
if (security_retval === 1) {
|
||||
setmenu("mon_materiel");
|
||||
setapiexcelimportmessage();
|
||||
setformation_file_name();
|
||||
history.push("/Partner/mon_materiel");
|
||||
} else {
|
||||
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -743,6 +821,22 @@ const Partner = (props) => {
|
|||
|
||||
}
|
||||
|
||||
const [Dialog_1_message, setDialog_1_message] = React.useState(false);
|
||||
const [Dialog_1_open, setDialog_1_open] = React.useState(false);
|
||||
function Dialog_1_handle_acces_insuffisant(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);
|
||||
};
|
||||
|
||||
|
||||
return (
|
||||
|
||||
|
@ -762,6 +856,26 @@ const Partner = (props) => {
|
|||
{isLoading && <div className="loader-container">
|
||||
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
||||
</div>}
|
||||
<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>
|
||||
|
||||
<div className="sub_dib_mobile">
|
||||
<div className="div_gauche">
|
||||
<img class="img-responsive img_user" src={userimgprofil} />
|
||||
|
|
|
@ -1555,7 +1555,7 @@ function UpdateParnterInfo(props) {
|
|||
if (security_retval === 1)
|
||||
setsubmenu("submenu_donnee_securite");
|
||||
else
|
||||
alert("Vous droits ne sont pas suffisants");
|
||||
alert("Vos droits ne sont pas suffisants");
|
||||
}
|
||||
|
||||
async function submenu_contact() {
|
||||
|
|
|
@ -2170,6 +2170,41 @@
|
|||
|
||||
// end media
|
||||
|
||||
|
||||
.session_caract_Dialog {
|
||||
width: 100%;
|
||||
padding: 5px;
|
||||
float: left;
|
||||
text-align: left;
|
||||
font-size: small;
|
||||
margin-bottom: 1rem !important;
|
||||
}
|
||||
|
||||
.bton_enreg_dialog {
|
||||
border-radius: 5rem;
|
||||
font-size: small;
|
||||
background: #81BC3A !important;
|
||||
text-align: center;
|
||||
height: 2.5rem;
|
||||
width: 80%;
|
||||
color: white;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
|
||||
.bton_annule_dialog {
|
||||
border-radius: 5rem;
|
||||
font-size: small;
|
||||
background: lightgray !important;
|
||||
text-align: right;
|
||||
height: 2.5rem;
|
||||
width: 80%;
|
||||
color: black;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.css-1v4ccyo {
|
||||
height: 3.5rem !important;
|
||||
font-size: small;
|
||||
|
|
Loading…
Reference in New Issue