30/09/2023 - 18h

recette2
cherif 2023-09-30 18:27:31 +02:00
parent 9c9677b5d2
commit 263cb03e6d
2 changed files with 74 additions and 38 deletions

View File

@ -154,7 +154,7 @@ const Header = () => {
function part_logout() {
confirmAlert({
title: '',
message: 'Confirmez la deconnexion (pro aa )',
message: 'Confirmez la deconnexion (pro)',
buttons: [
{
label: 'Oui',

View File

@ -38,7 +38,7 @@ import {
FcList, FcGraduationCap, FcMultipleDevices, FcCurrencyExchange,
FcMoneyTransfer, FcFeedback, FcKey, FcVideoCall, FcSettings,
FcBusinesswoman, FcServices, FcCollect, FcCandleSticks, FcKindle,
FcFlowChart, FcReading, FcFinePrint
FcFlowChart, FcReading, FcFinePrint, FcCancel,
} from "react-icons/fc";
import { BsTools } from "react-icons/bs";
@ -54,7 +54,7 @@ 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 { ImWarning } from "react-icons/im";
//import { FcHome} from "react-icons/fc";
const Partner = (props) => {
@ -87,6 +87,8 @@ const Partner = (props) => {
const [refesh, setrefesh] = useState("init");
const [firstConnexion, setfirstConnexion] = useState("");
const [part_is_partner_admin_account, setpart_is_partner_admin_account] = useState("");
const { action, orderid, packs } = useParams()
@ -260,13 +262,28 @@ const Partner = (props) => {
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;
if (String(local_action) === "read") {
for (let i = 0; i < connected_user_access_right.length; i++) {
if (String(connected_user_access_right[i].module) === String(local_module)
&& String(connected_user_access_right[i].read) === "true") {
return 1;
}
}
return 0;
} else if (String(local_action) === "write") {
for (let i = 0; i < connected_user_access_right.length; i++) {
if (String(connected_user_access_right[i].module) === String(local_module)
&& String(connected_user_access_right[i].write) === "true") {
return 1;
}
}
return 0;
}else{
return 0;
}
return 0;
}
@ -318,7 +335,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/creation");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des formations");
}
}
@ -330,7 +347,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/infopartner");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion du compte");
}
}
@ -343,7 +360,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/config_document");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des documents");
}
}
@ -356,7 +373,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/statistique");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des formations");
}
}
@ -368,7 +385,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/setuplms");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion du E-Learning");
}
}
@ -381,7 +398,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/facture");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des commandes");
}
}
@ -394,7 +411,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/abonnement");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des abonnements");
}
}
@ -407,7 +424,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/pricing");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des prix");
}
}
@ -421,7 +438,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/mes_clients");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des clients");
}
}
@ -433,7 +450,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/mes_devis");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des commandes");
}
}
@ -446,7 +463,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/mes_cmd");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des commandes");
}
}
@ -461,7 +478,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/mes_sessions");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des sessions");
}
}
@ -473,7 +490,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/mes_stagiaires");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des stagiaires");
}
}
@ -485,7 +502,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/mes_employes");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion des employés");
}
}
@ -498,7 +515,7 @@ const Partner = (props) => {
setformation_file_name();
history.push("/Partner/mon_materiel");
} else {
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants");
Dialog_1_handle_acces_insuffisant("Vos droits ne sont pas suffisants pour acceder à la gestion du matériel pédagogique");
}
}
@ -657,6 +674,14 @@ const Partner = (props) => {
} else {
setfirstConnexion("1");
}
if (JSON.parse(res.data.message).is_partner_admin_account &&
String(JSON.parse(res.data.message).is_partner_admin_account) === "1") {
setpart_is_partner_admin_account("1");
} else {
setpart_is_partner_admin_account("0");
}
}
else {
//console.log(" In GetPartnerNameFromToken res.data.status = " + res.data.status);
@ -857,24 +882,24 @@ const Partner = (props) => {
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
</div>}
<Dialog
open={Dialog_1_open}
onClose={Dialog_1_handleClose}
open={Dialog_1_open}
onClose={Dialog_1_handleClose}
>
>
<DialogTitle>MySy Information</DialogTitle>
<DialogContent>
<DialogContentText>
{Dialog_1_message}
</DialogContentText>
<DialogTitle>MySy Warning</DialogTitle>
<DialogContent>
<DialogContentText>
<ImWarning style={{"color":"red", "fontSize":"40px"}} /> {Dialog_1_message}
</DialogContentText>
</DialogContent>
</DialogContent>
<DialogActions>
<Button onClick={Dialog_1_handleClose_buton}>OK</Button>
<DialogActions>
<Button onClick={Dialog_1_handleClose_buton}>OK</Button>
</DialogActions>
</Dialog>
</DialogActions>
</Dialog>
<div className="sub_dib_mobile">
<div className="div_gauche">
@ -1001,7 +1026,7 @@ const Partner = (props) => {
<hr className="my_hr" />
</div>
{String(firstConnexion) === "1" &&
{String(firstConnexion) === "1" && String(part_is_partner_admin_account) === "1" &&
<div className="div_droite firstConnexion">
<div className="firstConnexion_text">
<b>Cher partenaire, c'est votre première connexion, </b> <br /> &nbsp;<br />
@ -1012,6 +1037,17 @@ const Partner = (props) => {
</div>}
{String(firstConnexion) === "1" && String(part_is_partner_admin_account) !== "1" &&
<div className="div_droite firstConnexion">
<div className="firstConnexion_text">
<b>Cher Utilisateur, c'est votre première connexion, </b> <br /> &nbsp;<br />
Nous sommes ravis de vous accueillir dans notre aventure MySy. <br/><br />
<Button onClick={(e) => setfirstConnexion()} className="firstConnexion_bton"> &nbsp; &nbsp;<FaHandPointRight /> &nbsp; Fermer</Button><br />
&nbsp; <br /> Merci.
</div>
</div>}
{String(myApiResponse) === String("false") && <div className="div_droite">
<div className="koUpdateData"> Impossible de contacter l'hote distant. Merci de contacter votre administrateur </div>