18/01/2025 - 17h
parent
5de283e4e9
commit
c0fce1d5ed
|
@ -1,17 +0,0 @@
|
||||||
{
|
|
||||||
// Use IntelliSense to learn about possible attributes.
|
|
||||||
// Hover to view descriptions of existing attributes.
|
|
||||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
||||||
"version": "0.2.0",
|
|
||||||
"configurations": [
|
|
||||||
{
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"name": "Launch Program",
|
|
||||||
"skipFiles": [
|
|
||||||
"<node_internals>/**"
|
|
||||||
],
|
|
||||||
"program": "${file}"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
40
src/App.js
40
src/App.js
|
@ -11,6 +11,7 @@ import Recherche_new_v3 from "./pages/recherche_new_v3";
|
||||||
import Recherche_new_v4 from "./pages/recherche_new_v4";
|
import Recherche_new_v4 from "./pages/recherche_new_v4";
|
||||||
|
|
||||||
import Mon_Catalogue_Public from "./pages/mon_catalogue_public";
|
import Mon_Catalogue_Public from "./pages/mon_catalogue_public";
|
||||||
|
import Mon_Intranet_Public from "./pages/mon_intranet_public";
|
||||||
|
|
||||||
import TestUrl from "./pages/testurl";
|
import TestUrl from "./pages/testurl";
|
||||||
import Account from "./pages/account";
|
import Account from "./pages/account";
|
||||||
|
@ -38,7 +39,7 @@ import ContactezNous from "./pages/contactez_nous";
|
||||||
import CoupDeCoeur from "./pages/coupdecoeur";
|
import CoupDeCoeur from "./pages/coupdecoeur";
|
||||||
import AccountUserActivated from "./pages/accountuseractivated";
|
import AccountUserActivated from "./pages/accountuseractivated";
|
||||||
import ProduitsService from "./pages/produitservice";
|
import ProduitsService from "./pages/produitservice";
|
||||||
|
|
||||||
import Recherche_new from "./pages/recherche_new";
|
import Recherche_new from "./pages/recherche_new";
|
||||||
import Recherche_old from "./pages/recherche";
|
import Recherche_old from "./pages/recherche";
|
||||||
import UserSignFirst from "./pages/usersigninfirst";
|
import UserSignFirst from "./pages/usersigninfirst";
|
||||||
|
@ -52,7 +53,8 @@ import TestUrl_New from "./pages/testurl_new";
|
||||||
import QuiSommesNous_v3 from "./pages/quisommesnous_v3";
|
import QuiSommesNous_v3 from "./pages/quisommesnous_v3";
|
||||||
import Fonctionnalites from "./pages/fonctionnalite";
|
import Fonctionnalites from "./pages/fonctionnalite";
|
||||||
import Test_Drag_Drop from "./pages/test_drag_drop";
|
import Test_Drag_Drop from "./pages/test_drag_drop";
|
||||||
|
|
||||||
|
|
||||||
import Test_Drag_Drop2 from "./pages/test_dnd";
|
import Test_Drag_Drop2 from "./pages/test_dnd";
|
||||||
|
|
||||||
import ESign from "./pages/eSigne";
|
import ESign from "./pages/eSigne";
|
||||||
|
@ -90,9 +92,7 @@ function App() {
|
||||||
let myurl = window.location.host;
|
let myurl = window.location.host;
|
||||||
let myurl_pathname = window.location.pathname;
|
let myurl_pathname = window.location.pathname;
|
||||||
|
|
||||||
//console.log(" url 12 = ", myurl);
|
|
||||||
|
|
||||||
//console.log(" action 12 = ", window.location.pathname);
|
|
||||||
|
|
||||||
var domain = myurl;
|
var domain = myurl;
|
||||||
if (domain.includes('://')) {
|
if (domain.includes('://')) {
|
||||||
|
@ -114,21 +114,12 @@ function App() {
|
||||||
|
|
||||||
|
|
||||||
if (tab_myurl_pathname.length > 0 && !tab_action.includes(tab_myurl_pathname[1]) && !tab_reserved_subdomain.includes(subdomain)) {
|
if (tab_myurl_pathname.length > 0 && !tab_action.includes(tab_myurl_pathname[1]) && !tab_reserved_subdomain.includes(subdomain)) {
|
||||||
|
|
||||||
var new_url = window.location.protocol + "//" + domain.split('.')[0] + "." + domain.split('.')[1] + "/moncatalog";
|
var new_url = window.location.protocol + "//" + domain.split('.')[0] + "." + domain.split('.')[1] + "/moncatalog";
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
window.open(
|
|
||||||
new_url,
|
|
||||||
'_self'
|
|
||||||
);
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}, []);
|
}, []);
|
||||||
|
@ -157,6 +148,7 @@ function App() {
|
||||||
<Route path="/subdomain" exact component={Subdomain_Recherche_new_v2} />
|
<Route path="/subdomain" exact component={Subdomain_Recherche_new_v2} />
|
||||||
|
|
||||||
<Route path="/moncatalog" exact component={Mon_Catalogue_Public} />
|
<Route path="/moncatalog" exact component={Mon_Catalogue_Public} />
|
||||||
|
<Route path="/intranet" exact component={Mon_Intranet_Public} />
|
||||||
|
|
||||||
|
|
||||||
<Route path="/acceuil" exact component={Acceuil} />
|
<Route path="/acceuil" exact component={Acceuil} />
|
||||||
|
@ -177,29 +169,29 @@ function App() {
|
||||||
<Route path="/recherche-formation/ref/:NewSearchText" exact component={Recherche_new_v2} />
|
<Route path="/recherche-formation/ref/:NewSearchText" exact component={Recherche_new_v2} />
|
||||||
<Route path="/testurl/:course/:tab" exact component={TestUrl} />
|
<Route path="/testurl/:course/:tab" exact component={TestUrl} />
|
||||||
<Route path="/testurl_new/:courseid/:tabid" exact component={TestUrl_New} />
|
<Route path="/testurl_new/:courseid/:tabid" exact component={TestUrl_New} />
|
||||||
|
|
||||||
<Route path="/ajout-article" exact component={AddArticleAvis} />
|
<Route path="/ajout-article" exact component={AddArticleAvis} />
|
||||||
|
|
||||||
<Route path="/Display-Detail-formation_v3/:classId" exact component={DisplayDetailClass_new_v3} />
|
<Route path="/Display-Detail-formation_v3/:classId" exact component={DisplayDetailClass_new_v3} />
|
||||||
<Route path="/Display-Detail-formation/:classId" exact component={DisplayDetailClass_new_v3} />
|
<Route path="/Display-Detail-formation/:classId" exact component={DisplayDetailClass_new_v3} />
|
||||||
|
|
||||||
<Route path="/Display-Detail-formation/:classId/:action" exact component={DisplayDetailClass_new_v3} />
|
<Route path="/Display-Detail-formation/:classId/:action" exact component={DisplayDetailClass_new_v3} />
|
||||||
<Route path="/Display-Detail-formation_old/:classId/:action" exact component={DisplayDetailClass_new_v3} />
|
<Route path="/Display-Detail-formation_old/:classId/:action" exact component={DisplayDetailClass_new_v3} />
|
||||||
<Route path="/Display-Detail-Article/:articleId" exact component={DisplayDetailArticle} />
|
<Route path="/Display-Detail-Article/:articleId" exact component={DisplayDetailArticle} />
|
||||||
<Route path="/Display-Detail-formation-Coeur/:classId" exact component={CoupDeCoeur} />
|
<Route path="/Display-Detail-formation-Coeur/:classId" exact component={CoupDeCoeur} />
|
||||||
|
|
||||||
<Route path="/Display-Partner-Catalog-Detail-formation/:classId" exact component={Display_Partner_Catalog_DetailClass_new_v2} />
|
<Route path="/Display-Partner-Catalog-Detail-formation/:classId" exact component={Display_Partner_Catalog_DetailClass_new_v2} />
|
||||||
<Route path="/Display-Partner-Catalog-Detail-formation/:classId/:action" exact component={Display_Partner_Catalog_DetailClass_new_v2} />
|
<Route path="/Display-Partner-Catalog-Detail-formation/:classId/:action" exact component={Display_Partner_Catalog_DetailClass_new_v2} />
|
||||||
|
|
||||||
<Route path="/Partner/:action/:orderid/:packs" exact component={Partner} />
|
<Route path="/Partner/:action/:orderid/:packs" exact component={Partner} />
|
||||||
<Route path="/Partner/:action/:orderid" exact component={Partner} />
|
<Route path="/Partner/:action/:orderid" exact component={Partner} />
|
||||||
<Route path="/Partner/:action" exact component={Partner} />
|
<Route path="/Partner/:action" exact component={Partner} />
|
||||||
<Route path="/Partner" exact component={Partner} />
|
<Route path="/Partner" exact component={Partner} />
|
||||||
<Route path="/PartnerLogin" exact component={PartnerLogin} />
|
<Route path="/PartnerLogin" exact component={PartnerLogin} />
|
||||||
<Route path="/PartnerLogin0" exact component={PartnerLogin0} />
|
<Route path="/PartnerLogin0" exact component={PartnerLogin0} />
|
||||||
<Route path="/PartnerLogin1" exact component={PartnerLogin1} />
|
<Route path="/PartnerLogin1" exact component={PartnerLogin1} />
|
||||||
|
|
||||||
|
|
||||||
<Route path="/Recherche-Article-formation" exact component={RechecheArticles} />
|
<Route path="/Recherche-Article-formation" exact component={RechecheArticles} />
|
||||||
<Route path="/Ajout-Article-formation" exact component={AddArticle} />
|
<Route path="/Ajout-Article-formation" exact component={AddArticle} />
|
||||||
<Route path="/ResetUserPwd/:token/:accounttype" exact component={ResetUserPwd} />
|
<Route path="/ResetUserPwd/:token/:accounttype" exact component={ResetUserPwd} />
|
||||||
|
@ -212,7 +204,7 @@ function App() {
|
||||||
<Route path="/ContactezNous" exact component={ContactezNous} />
|
<Route path="/ContactezNous" exact component={ContactezNous} />
|
||||||
<Route path="/mysy-training-login/:obj/:objid" exact component={Login} />
|
<Route path="/mysy-training-login/:obj/:objid" exact component={Login} />
|
||||||
<Route path="/mysy-account-activated/" exact component={AccountUserActivated} />
|
<Route path="/mysy-account-activated/" exact component={AccountUserActivated} />
|
||||||
{/* <Route path="/Produits-Services/" exact component={ProduitsService} />*/}
|
{/* <Route path="/Produits-Services/" exact component={ProduitsService} />*/}
|
||||||
<Route path="/tarifs_produits_services/" exact component={ProduitsService} />
|
<Route path="/tarifs_produits_services/" exact component={ProduitsService} />
|
||||||
<Route path="/Recherche_new/" exact component={Recherche_new} />
|
<Route path="/Recherche_new/" exact component={Recherche_new} />
|
||||||
<Route path="/GestionAdministrative/:internal_url" exact component={GestionAdministrative} />
|
<Route path="/GestionAdministrative/:internal_url" exact component={GestionAdministrative} />
|
||||||
|
@ -242,7 +234,7 @@ function App() {
|
||||||
|
|
||||||
<Route path="/intelligence-artificielle-mysy-training/" exact component={MySyIA} />
|
<Route path="/intelligence-artificielle-mysy-training/" exact component={MySyIA} />
|
||||||
|
|
||||||
*/
|
*/
|
||||||
<Route component={NotFound} />
|
<Route component={NotFound} />
|
||||||
</Switch>
|
</Switch>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
|
|
|
@ -6256,6 +6256,7 @@ const DisplayPartnerSession = (props) => {
|
||||||
const [SessionendDateInscription, setSessionendDateInscription] = useState();
|
const [SessionendDateInscription, setSessionendDateInscription] = useState();
|
||||||
|
|
||||||
const [New_GetCurrentPartnerClass_result, setNew_GetCurrentPartnerClass_result] = useState([]);
|
const [New_GetCurrentPartnerClass_result, setNew_GetCurrentPartnerClass_result] = useState([]);
|
||||||
|
|
||||||
|
|
||||||
const [GetCurrentPartnerClass_api, setGetCurrentPartnerClass_api] = useState();
|
const [GetCurrentPartnerClass_api, setGetCurrentPartnerClass_api] = useState();
|
||||||
const [GetCurrentPartnerClass_message, setGetCurrentPartnerClass_message] = useState();
|
const [GetCurrentPartnerClass_message, setGetCurrentPartnerClass_message] = useState();
|
||||||
|
|
|
@ -0,0 +1,80 @@
|
||||||
|
import React, { useRef, useState, useEffect } from "react";
|
||||||
|
import { styled } from '@mui/material/styles';
|
||||||
|
import Paper from '@mui/material/Paper';
|
||||||
|
import Grid from '@mui/material/Grid';
|
||||||
|
import { FacebookShareButton, LinkedinShareButton, TwitterShareButton } from "react-share";
|
||||||
|
import { SocialIcon } from 'react-social-icons';
|
||||||
|
import {
|
||||||
|
Box,
|
||||||
|
Container,
|
||||||
|
Row,
|
||||||
|
Column,
|
||||||
|
FooterLink,
|
||||||
|
Heading,
|
||||||
|
} from "./FooterStyles";
|
||||||
|
|
||||||
|
const Fotter_Intranet_Client_Pub = (props) => {
|
||||||
|
|
||||||
|
const [partner_id, setpartner_id] = useState(props.partner_data);
|
||||||
|
// Integration du gestionnaire de cookie : axeptio
|
||||||
|
|
||||||
|
window.axeptioSettings = {
|
||||||
|
clientId: "6273ecd99c50de9cfb190555",
|
||||||
|
cookiesVersion: "mysy training technology-fr",
|
||||||
|
};
|
||||||
|
|
||||||
|
(function (d, s) {
|
||||||
|
var t = d.getElementsByTagName(s)[0], e = d.createElement(s);
|
||||||
|
|
||||||
|
e.async = true; e.src = "//static.axept.io/sdk-slim.js";
|
||||||
|
t.parentNode.insertBefore(e, t);
|
||||||
|
})(document, "script");
|
||||||
|
|
||||||
|
function Display_CGV_File() {
|
||||||
|
|
||||||
|
const downloadLink = document.createElement("a");
|
||||||
|
const fileName = "file.pdf";
|
||||||
|
downloadLink.href = props.partner_data.catalog_pub_cgv_pdf;
|
||||||
|
|
||||||
|
downloadLink.download = fileName;
|
||||||
|
downloadLink.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
function Display_CGU_File() {
|
||||||
|
const downloadLink = document.createElement("a");
|
||||||
|
const fileName = "file.pdf";
|
||||||
|
downloadLink.href = props.partner_data.catalog_pub_cgu_pdf;
|
||||||
|
downloadLink.download = fileName;
|
||||||
|
downloadLink.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
function Display_Mention_Legale_File() {
|
||||||
|
const downloadLink = document.createElement("a");
|
||||||
|
const fileName = "file.pdf";
|
||||||
|
downloadLink.href = props.partner_data.catalog_pub_mention_legale_pdf;
|
||||||
|
downloadLink.download = fileName;
|
||||||
|
downloadLink.click();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className='footer_catalog_pub'>
|
||||||
|
<div style={{ "minHeight": "5rem", "width":"100%" }}>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className='Box_div'>
|
||||||
|
<i className='copyright'>
|
||||||
|
Copyright © 2024 {props.partner_data.nom} . Tous droits réservés.
|
||||||
|
|
||||||
|
<a> <nav onClick={Display_Mention_Legale_File} >| Mentions légales </nav> </a>
|
||||||
|
<a> <nav onClick={Display_CGU_File} >| Conditions générales d’utilisation </nav> </a>
|
||||||
|
<a><nav onClick={Display_CGV_File} > | Conditions générales de vente </nav> </a>
|
||||||
|
</i>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
);
|
||||||
|
};
|
||||||
|
export default Fotter_Intranet_Client_Pub;
|
|
@ -129,7 +129,7 @@ const Header = () => {
|
||||||
const handleAvis = () => {
|
const handleAvis = () => {
|
||||||
setavisMenu(null);
|
setavisMenu(null);
|
||||||
history.push("/Recherche-Article-formation")
|
history.push("/Recherche-Article-formation")
|
||||||
};
|
};
|
||||||
|
|
||||||
function user_logout_confirmation() {
|
function user_logout_confirmation() {
|
||||||
/* si c'est une connexion partner qui est active */
|
/* si c'est une connexion partner qui est active */
|
||||||
|
@ -141,9 +141,11 @@ const Header = () => {
|
||||||
setpartCookie(acces_right_token_name, "", { path: '/' });
|
setpartCookie(acces_right_token_name, "", { path: '/' });
|
||||||
removeCookie(acces_right_token_name, { path: '/' });
|
removeCookie(acces_right_token_name, { path: '/' });
|
||||||
|
|
||||||
|
removeCookie("tokenmysych", { path: '/' });
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
history.push("/");
|
history.push("/intranet");
|
||||||
}
|
}
|
||||||
|
|
||||||
function user_logout() {
|
function user_logout() {
|
||||||
|
@ -176,6 +178,16 @@ const Header = () => {
|
||||||
removeCookie(acces_right_token_name, { path: '/' });
|
removeCookie(acces_right_token_name, { path: '/' });
|
||||||
|
|
||||||
|
|
||||||
|
setpartCookie("mysy_session_display_view", "", { path: '/' });
|
||||||
|
setpartCookie("mysy_menu_gauche_reduit", "", { path: '/' });
|
||||||
|
setpartCookie("mysy_catalog_data_row_grouped_by", "", { path: '/' });
|
||||||
|
|
||||||
|
removeCookie("tokenmysypart", { path: '/' });
|
||||||
|
removeCookie("mysy_session_display_view", { path: '/' });
|
||||||
|
removeCookie("mysy_menu_gauche_reduit", { path: '/' });
|
||||||
|
removeCookie("mysy_catalog_data_row_grouped_by", { path: '/' });
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
setsomeoneconnected("0");
|
setsomeoneconnected("0");
|
||||||
setDialog_1_open(false);
|
setDialog_1_open(false);
|
||||||
|
@ -549,7 +561,7 @@ const Header = () => {
|
||||||
<DialogTitle>MySy Information</DialogTitle>
|
<DialogTitle>MySy Information</DialogTitle>
|
||||||
<DialogContent className="DialogContent_width">
|
<DialogContent className="DialogContent_width">
|
||||||
<DialogContentText>
|
<DialogContentText>
|
||||||
Confirmez la deconnexion
|
Confirmez la deconnexion
|
||||||
</DialogContentText>
|
</DialogContentText>
|
||||||
|
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
|
|
|
@ -0,0 +1,570 @@
|
||||||
|
import React, { useState, useEffect } from "react";
|
||||||
|
import { useForm } from "react-hook-form";
|
||||||
|
import { useHistory } from "react-router-dom";
|
||||||
|
import { Button, FormGroup, Label, Input } from "reactstrap";
|
||||||
|
import { FacebookLoginButton, GoogleLoginButton } from "react-social-login-buttons";
|
||||||
|
//import { getCookie, setCookie, removeCookie } from 'react-use-cookie';
|
||||||
|
import { Helmet } from "react-helmet";
|
||||||
|
import { useCookies } from "react-cookie";
|
||||||
|
import { confirmAlert } from 'react-confirm-alert'; // Import
|
||||||
|
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
|
||||||
|
import Popup from 'reactjs-popup';
|
||||||
|
import 'reactjs-popup/dist/index.css';
|
||||||
|
import axios from "axios";
|
||||||
|
import { useParams } from 'react-router-dom'
|
||||||
|
|
||||||
|
import Header from "./Header";
|
||||||
|
import { useLocation } from "react-router-dom";
|
||||||
|
import Visibility from '@mui/icons-material/Visibility';
|
||||||
|
import VisibilityOff from '@mui/icons-material/VisibilityOff';
|
||||||
|
import 'react-tooltip/dist/react-tooltip.css'
|
||||||
|
import { Tooltip } from 'react-tooltip'
|
||||||
|
import Fotter_v3 from "./Fotter_v3";
|
||||||
|
|
||||||
|
function Module_Connexion_Intranet_Client() {
|
||||||
|
const [isconnected, setisconnected] = useState("");
|
||||||
|
const [cookie_acces_right, setCookie_acces_right, removeCookie_acces_right] = useCookies(['mysy_user_access_right']);
|
||||||
|
const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych'], { path: '/' });
|
||||||
|
const [cookie_part, setCookie_part, removeCookie_part] = useCookies(['tokenmysypart'], { path: '/' });
|
||||||
|
const [retval, setretval] = useState("0");
|
||||||
|
const [myApimyApiMessage, setmyApimyApiMessage] = useState("");
|
||||||
|
const [initpasswd, setinitpasswd] = useState();
|
||||||
|
const [result, setResult] = useState("");
|
||||||
|
const [myApiResponse, setmyApiResponse] = useState("false");
|
||||||
|
const url_login = process.env.REACT_APP_API_URL + "myclass/api/login/";
|
||||||
|
|
||||||
|
const random1 = Math.floor(Math.random() * 10);
|
||||||
|
const random2 = Math.floor(Math.random() * 10);
|
||||||
|
|
||||||
|
const [closepopup, setclosepopup] = useState(0);
|
||||||
|
const { obj, objid } = useParams();
|
||||||
|
const [menucompte, setmenucompte] = useState("user");
|
||||||
|
const [currentpawdvisible, setcurrentpawdvisible] = useState(false);
|
||||||
|
const [typecompte, settypecompte] = useState("");
|
||||||
|
|
||||||
|
const {
|
||||||
|
register,
|
||||||
|
formState: { errors },
|
||||||
|
handleSubmit,
|
||||||
|
} = useForm();
|
||||||
|
|
||||||
|
|
||||||
|
const history = useHistory();
|
||||||
|
|
||||||
|
function logout_partner_confirmation() {
|
||||||
|
removeCookie_part('tokenmysypart', { path: '/' });
|
||||||
|
}
|
||||||
|
|
||||||
|
function retnull() {
|
||||||
|
setretval("-1");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function logout_user_confirmation() {
|
||||||
|
removeCookie_part('tokenmysych', { path: '/' });
|
||||||
|
}
|
||||||
|
|
||||||
|
function Logout_User() {
|
||||||
|
confirmAlert({
|
||||||
|
title: 'Deconnexion utilisateur ?',
|
||||||
|
message: 'Confirmez la deconnexion utilisateur',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
label: 'Oui',
|
||||||
|
onClick: () => logout_user_confirmation()
|
||||||
|
},
|
||||||
|
/* {
|
||||||
|
label: 'Non',
|
||||||
|
onClick: () => retnull()
|
||||||
|
|
||||||
|
}*/
|
||||||
|
]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const onSubmit = async (data) => {
|
||||||
|
|
||||||
|
//console.log(" CONNEXION DE = ",menucompte);
|
||||||
|
var partner_connexion = "";
|
||||||
|
var url_login = "";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
url_login = process.env.REACT_APP_API_URL + "myclass/api/login/";
|
||||||
|
setmenucompte("user");
|
||||||
|
partner_connexion = "user";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const stored_user = cookie.tokenmysych;
|
||||||
|
|
||||||
|
const formData = new FormData();
|
||||||
|
var mymail = document.getElementsByName("email")[0].value;
|
||||||
|
var mypwd = document.getElementsByName("pwd")[0].value;
|
||||||
|
|
||||||
|
formData.append("email", mymail);
|
||||||
|
formData.append("pwd", mypwd);
|
||||||
|
|
||||||
|
var re = /\S+@\S+\.\S+/;
|
||||||
|
if (re.test(mymail) === false) {
|
||||||
|
alert("l'adresse email est incorrecte");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mypwd.length <= 0) {
|
||||||
|
alert("Vous n'avez pas saisi de mot de passe");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// si c'est une connexion user qui est active
|
||||||
|
if (typeof (stored_user) != "undefined" && String(stored_user) !== String('')) {
|
||||||
|
//alert(" c'est une connexion USERR qui est active");
|
||||||
|
Logout_User();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
fetch(
|
||||||
|
url_login,
|
||||||
|
{
|
||||||
|
method: 'POST',
|
||||||
|
body: formData,
|
||||||
|
}
|
||||||
|
).then((response) => response.json())
|
||||||
|
.then((result) => {
|
||||||
|
//console.log('Success:', result['message'], "result['status'] = ", result['status']);
|
||||||
|
|
||||||
|
var val = result['status'];
|
||||||
|
|
||||||
|
if (String(val) === String("true")) {
|
||||||
|
|
||||||
|
if (String(partner_connexion) === String("partner")) {
|
||||||
|
|
||||||
|
// recuperation et stockage des cookies sur les droit d'acces
|
||||||
|
setCookie("tokenmysypart", JSON.parse(result['message']).token, { path: '/' });
|
||||||
|
|
||||||
|
var acces_right_token_name = String(JSON.parse(result['message']).token) + "_uar";
|
||||||
|
var acces_right_token_val = JSON.parse(result['message']).user_access_right;
|
||||||
|
|
||||||
|
//acces_right_token_val = [{'key1':'val1'}, {'key2':'val2'}];
|
||||||
|
|
||||||
|
///console.log(" acces_right_token_val = ", acces_right_token_val);
|
||||||
|
|
||||||
|
setCookie_acces_right(acces_right_token_name, acces_right_token_val, { path: '/' });
|
||||||
|
|
||||||
|
// recuperation et stockage des cookie sur les paramettres de connexion
|
||||||
|
var returned_connexion_data = JSON.parse(result['message'])
|
||||||
|
if (returned_connexion_data.list_connexion_context) {
|
||||||
|
|
||||||
|
const new_data = returned_connexion_data.list_connexion_context.map((x) => {
|
||||||
|
// recuperation et stockage des cookies sur les droit d'acces
|
||||||
|
if (x['code'] && x['code_value']) {
|
||||||
|
setCookie(String(x['code']), String(x['code_value']), { path: '/' });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//setCookie("tokenmysypart", result['message']);
|
||||||
|
history.push("/Partner");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else if (String(partner_connexion) === String("user")) {
|
||||||
|
setCookie("tokenmysych", result['message']);
|
||||||
|
|
||||||
|
// Verification vers quelle page les renvoyer
|
||||||
|
if (obj === "training" && String(objid).length > 0) {
|
||||||
|
// redirection vers l'affichage d'une formation
|
||||||
|
history.push("/Display-Detail-formation/" + objid);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// Redirection par defaut vers la compte utilisateur
|
||||||
|
history.push("/mysy-user-account");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setisconnected("false");
|
||||||
|
setmyApimyApiMessage(result['message']);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
console.error('Error:', error);
|
||||||
|
setisconnected("false");
|
||||||
|
setmyApimyApiMessage("Le service est momentanément indisponible, merci de ressayer plus tard. ");
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const location = useLocation();
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setmenucompte("partner");
|
||||||
|
|
||||||
|
const listener = event => {
|
||||||
|
if (event.code === "Enter" || event.code === "NumpadEnter") {
|
||||||
|
|
||||||
|
event.preventDefault();
|
||||||
|
|
||||||
|
onSubmit();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
document.addEventListener("keydown", listener);
|
||||||
|
|
||||||
|
if (String(menucompte) === String("user")) {
|
||||||
|
menu_user_account();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
menu_parter_account();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (location && location.state && location.state.mysy_arg && String(location.state.mysy_arg) === "partner") {
|
||||||
|
menu_parter_account();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function menu_parter_account() {
|
||||||
|
//alert(" menu_parter_account = "+String(menucompte));
|
||||||
|
setmenucompte("partner");
|
||||||
|
|
||||||
|
if (document.getElementsByName("partner_account") && document.getElementsByName("partner_account")[0])
|
||||||
|
document.getElementsByName("partner_account")[0].style.backgroundColor = "#81BC3A";
|
||||||
|
|
||||||
|
if (document.getElementsByName("user_account") && document.getElementsByName("user_account")[0])
|
||||||
|
document.getElementsByName("user_account")[0].style.backgroundColor = "#ffffff";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function menu_user_account() {
|
||||||
|
|
||||||
|
setmenucompte("user");
|
||||||
|
|
||||||
|
if (document.getElementsByName("user_account") && document.getElementsByName("user_account")[0])
|
||||||
|
document.getElementsByName("user_account")[0].style.backgroundColor = "#81BC3A";
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function resetpasswd_ok(e) {
|
||||||
|
|
||||||
|
var total = " ?? ";
|
||||||
|
if (document.getElementsByName("sommerandom")[0].value) {
|
||||||
|
total = document.getElementsByName("sommerandom")[0].value;
|
||||||
|
}
|
||||||
|
var calcaul_total = parseInt(random1) + parseInt(random2);
|
||||||
|
if (parseInt(total) != parseInt(calcaul_total)) {
|
||||||
|
document.getElementsByName("pasrobot")[0].style.backgroundColor = "red";
|
||||||
|
|
||||||
|
alert(" Le total dans la zone 'je ne suis pas un robot' est incohérent. Recommencez svp :) !!!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Controle du mail
|
||||||
|
var mymail = document.getElementsByName("resetemailvalue")[0].value;
|
||||||
|
//alert(" le mail de reset = "+mymail);
|
||||||
|
var re = /\S+@\S+\.\S+/;
|
||||||
|
if (re.test(mymail) === false) {
|
||||||
|
alert("l'adresse email est incorrecte");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
form.append("email", mymail);
|
||||||
|
|
||||||
|
|
||||||
|
// Controle du type de compte
|
||||||
|
if (String(typecompte) !== "partner" && String(typecompte) !== "user") {
|
||||||
|
alert("Le type de compte est inconnu");
|
||||||
|
document.getElementsByName("is_user_or_pro")[0].style.backgroundColor = "orangered";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
form.append("account_type", typecompte);
|
||||||
|
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/InitUserPasswd/";
|
||||||
|
|
||||||
|
//alert("myurl = "+myurl);
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
setclosepopup(1);
|
||||||
|
setinitpasswd("true");
|
||||||
|
if (String(res.data.status) != String("false")) {
|
||||||
|
//console.log(" In test res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In test res.data.message = " + res.data.message);
|
||||||
|
setmyApiResponse("true");
|
||||||
|
|
||||||
|
setResult(res.data.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//console.log(" In test res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In test res.data.message = " + res.data.message);
|
||||||
|
setmyApiResponse("false");
|
||||||
|
setResult(res.data.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.warn('Not good man :( mysearchtext = ');
|
||||||
|
setmyApiResponse("false");
|
||||||
|
setinitpasswd("false");
|
||||||
|
//setmyApimyApiMessage("")
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function resetpasswd(e) {
|
||||||
|
confirmAlert({
|
||||||
|
title: 'Reinitialisation Mot de Passe?',
|
||||||
|
message: 'Confirmez la reinitialisation',
|
||||||
|
buttons: [
|
||||||
|
{
|
||||||
|
label: 'Oui',
|
||||||
|
onClick: () => resetpasswd_ok()
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: 'Non',
|
||||||
|
onClick: () => { return }
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
],
|
||||||
|
closeOnEscape: false,
|
||||||
|
closeOnClickOutside: false,
|
||||||
|
keyCodeForClose: [8, 32],
|
||||||
|
willUnmount: () => { },
|
||||||
|
afterClose: () => { },
|
||||||
|
onClickOutside: () => { },
|
||||||
|
onKeypress: () => { },
|
||||||
|
onKeypressEscape: () => { },
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function closepopupinitpwd() {
|
||||||
|
setclosepopup("1");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Cette fonction permet de cacher le mot de passer et eviter les
|
||||||
|
// autocompletion
|
||||||
|
const [realpwdvalue, setrealpwdvalue] = useState("");
|
||||||
|
const [realpwdhidenvalue, setrealpwdhidenvalue] = useState("");
|
||||||
|
function realpwd(e) {
|
||||||
|
const val = e.target.value;
|
||||||
|
const last = val.charAt(val.length - 1);
|
||||||
|
var new_val = realpwdvalue;
|
||||||
|
var new_val_hiden = realpwdhidenvalue;
|
||||||
|
|
||||||
|
//alert(" new_val avant saisie= "+new_val);
|
||||||
|
new_val = new_val + last;
|
||||||
|
new_val_hiden = new_val_hiden + "*";
|
||||||
|
|
||||||
|
//alert(" - new_val apres sisie = "+new_val+" new_val_hiden = "+new_val_hiden);
|
||||||
|
setrealpwdhidenvalue(new_val_hiden);
|
||||||
|
setrealpwdvalue(new_val);
|
||||||
|
|
||||||
|
//setrealpwdvalue(val);
|
||||||
|
//document.getElementById("cle_secrete").value = new_val_hiden;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/* function displayvlaue(){
|
||||||
|
alert(" la valeur secrete = "+realpwdvalue);
|
||||||
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
const handleClickShowPassword = () => {
|
||||||
|
if (currentpawdvisible == false) {
|
||||||
|
document.getElementsByName("pwd")[0].type = "text";
|
||||||
|
setcurrentpawdvisible(true);
|
||||||
|
}
|
||||||
|
else if (currentpawdvisible == true) {
|
||||||
|
document.getElementsByName("pwd")[0].type = "password";
|
||||||
|
setcurrentpawdvisible(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div style={{ width: "100%", float: "left" }}>
|
||||||
|
|
||||||
|
<div className="module_connexion_intranet_client">
|
||||||
|
|
||||||
|
|
||||||
|
<div className="div_mobile">
|
||||||
|
<div className="block_centrer">
|
||||||
|
|
||||||
|
<div className="display_screen_600_901">
|
||||||
|
<div className="div_centre_master">
|
||||||
|
<div className="div_centre_002">
|
||||||
|
<Button variant="outlined" onClick={menu_user_account} className="signin_menu"
|
||||||
|
id="user_account" name="user_account"
|
||||||
|
style={{ "float": "left", "textAlign": "center", "height": "3rem" }}>Intranet Utilisateur</Button>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="div_centre">
|
||||||
|
|
||||||
|
<div className="div_row_bis" >
|
||||||
|
|
||||||
|
<FormGroup>
|
||||||
|
<Label style={{fontSize:"14px"}}>Votre adresse email</Label>
|
||||||
|
<Input type="email" placeholder="Email" name="email" />
|
||||||
|
</FormGroup>
|
||||||
|
|
||||||
|
<div style={{ height: '10px' }}> </div>
|
||||||
|
|
||||||
|
|
||||||
|
<FormGroup>
|
||||||
|
<div className="label_pwd_div">
|
||||||
|
<div className="label_div" >
|
||||||
|
<Label style={{fontSize:"14px"}}>Votre mot de passe </Label>
|
||||||
|
</div>
|
||||||
|
<div className="show_pwd_div" onClick={handleClickShowPassword}>
|
||||||
|
{currentpawdvisible ? <Visibility style={{ fontSize: '15px' }} /> : <VisibilityOff style={{ fontSize: '15px' }} />}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<Input type="password" placeholder="Password" name="pwd" />
|
||||||
|
</FormGroup>
|
||||||
|
|
||||||
|
|
||||||
|
{String(initpasswd) === String("true") && closepopup === 1 && <div className="okUpdateData">
|
||||||
|
La demande reinitialisation a bien ete prise en compte.
|
||||||
|
Verifiez votre boite email.
|
||||||
|
</div>}
|
||||||
|
<div className="forgot_pass" >
|
||||||
|
{String(initpasswd) !== String("true") && String(closepopup) !== String("1")
|
||||||
|
&& <Popup trigger={<button className="avisformation"> Mot de passe oublié</button>}
|
||||||
|
position="center" className="signin popup-reset-pwd">
|
||||||
|
<div className="signin-content popup-reset-pwd-content">
|
||||||
|
<div className="div_row" style={{
|
||||||
|
"textAlign": "center", "background": "orangered",
|
||||||
|
"height": "2rem", "paddingTop": "5px", "fontSize": "14px", "fontWeight": "bold"
|
||||||
|
}}
|
||||||
|
> Modifier le mot de passe</div>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<label for="exampleFormControlTextarea1">Saisir votre email</label>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<input type="text" id="resetemailvalue" name="resetemailvalue" rows="1" cols="20"
|
||||||
|
className="zone_mail" />
|
||||||
|
<br />
|
||||||
|
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<br />
|
||||||
|
<Tooltip className="tooltip_css" id="is_user_or_pro-tooltip" />
|
||||||
|
<a data-tooltip-id="is_user_or_pro-tooltip" data-tooltip-html="Compte partenaire : création et gestion de formation <br/>
|
||||||
|
compte utilisateur : non autorisé à la création et gestion de formation">
|
||||||
|
<label for="is_user_or_pro">Compte partenaire ou utilisateur * ?</label>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
|
||||||
|
<select id="is_user_or_pro" name="is_user_or_pro" style={{
|
||||||
|
"width": '100%', "height": "2.5rem",
|
||||||
|
'marginTop': '5px'
|
||||||
|
}}
|
||||||
|
onChange={(event) => settypecompte(event.target.value)}>
|
||||||
|
<option selected value="">Choisir </option>
|
||||||
|
|
||||||
|
<option value="partner">Partenaire </option>
|
||||||
|
<option value="user">Utilisateur </option>
|
||||||
|
</select>
|
||||||
|
</a>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div className="text_pwd_crit" style={{ "textAlign": "center" }}>
|
||||||
|
Je ne suis pas un robot <br />
|
||||||
|
<div >
|
||||||
|
|
||||||
|
|
||||||
|
<div name="pasrobot" > {random1} + {random2} = <input
|
||||||
|
type='text'
|
||||||
|
name='sommerandom'
|
||||||
|
id='sommerandom'
|
||||||
|
|
||||||
|
{...register('sommerandom', {
|
||||||
|
required: { value: true, message: 'sommes de valeurs' },
|
||||||
|
maxLength: {
|
||||||
|
value: 30,
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
|
||||||
|
className="pasrobot_css"
|
||||||
|
placeholder='Le total est ?'
|
||||||
|
/>
|
||||||
|
|
||||||
|
{errors.sommerandom && (
|
||||||
|
<span className='koUpdateData'>la sommes est incorrect</span>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button type="submit" class="btn btn-secondary btn-sm" onClick={resetpasswd_ok}>Envoyer</button>
|
||||||
|
<button type="submit" class="btn btn-secondary btn-sm" onClick={closepopupinitpwd}> Annuler</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</Popup>
|
||||||
|
}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<FormGroup>
|
||||||
|
|
||||||
|
</FormGroup>
|
||||||
|
|
||||||
|
<div className="div_row22">
|
||||||
|
<Button variant="contained" color="success" className="div_row22 btn_login button" onClick={onSubmit}>Connectez-Vous</Button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{isconnected === "false" && <div className="erreurconnexion">
|
||||||
|
<br />
|
||||||
|
{myApimyApiMessage}</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* <div style={{ height: "5rem", width: "100%" }}>
|
||||||
|
<Fotter_v3 />
|
||||||
|
</div>*/}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Module_Connexion_Intranet_Client;
|
|
@ -951,8 +951,6 @@ const Mon_Catalogue_Public = (props) => {
|
||||||
|
|
||||||
Get_Subdomain_Partner_Data(window.location.host)
|
Get_Subdomain_Partner_Data(window.location.host)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
// const result = await axios('https://geolocation-db.com/json/',);
|
// const result = await axios('https://geolocation-db.com/json/',);
|
||||||
|
|
||||||
|
@ -2604,11 +2602,11 @@ const Mon_Catalogue_Public = (props) => {
|
||||||
domain = url.split('://')[1];
|
domain = url.split('://')[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(" ### local_url_subdomain = ", local_url_subdomain);
|
// console.log(" ### local_url_subdomain = ", local_url_subdomain);
|
||||||
|
|
||||||
const subdomain = domain.split('.')[0];
|
const subdomain = domain.split('.')[0];
|
||||||
|
|
||||||
console.log(" ### subdomain = ", subdomain);
|
// console.log(" ### subdomain = ", subdomain);
|
||||||
|
|
||||||
var form = new FormData();
|
var form = new FormData();
|
||||||
|
|
||||||
|
@ -2620,7 +2618,7 @@ const Mon_Catalogue_Public = (props) => {
|
||||||
|
|
||||||
if (String(res.data.status) === "true") {
|
if (String(res.data.status) === "true") {
|
||||||
//console.log(" In Get_Subdomain_Partner_Data res.data.status = " + res.data.status);
|
//console.log(" In Get_Subdomain_Partner_Data res.data.status = " + res.data.status);
|
||||||
console.log(" In Get_Subdomain_Partner_Data res.data.message r_class = " + res.data.message);
|
// console.log(" In Get_Subdomain_Partner_Data res.data.message r_class = " + res.data.message);
|
||||||
setGet_Subdomain_Partner_Data_api("true");
|
setGet_Subdomain_Partner_Data_api("true");
|
||||||
setGet_Subdomain_Partner_Data_result(res.data.message);
|
setGet_Subdomain_Partner_Data_result(res.data.message);
|
||||||
|
|
||||||
|
@ -2834,7 +2832,7 @@ const Mon_Catalogue_Public = (props) => {
|
||||||
"theme_code": theme_code,
|
"theme_code": theme_code,
|
||||||
|
|
||||||
};
|
};
|
||||||
console.log(" --- node = ", node);
|
// console.log(" --- node = ", node);
|
||||||
new_data2.push(node);
|
new_data2.push(node);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -2845,7 +2843,6 @@ const Mon_Catalogue_Public = (props) => {
|
||||||
if (res.data.message.length > 0) {
|
if (res.data.message.length > 0) {
|
||||||
var mylocal_materiel = JSON.parse(res.data.message);
|
var mylocal_materiel = JSON.parse(res.data.message);
|
||||||
|
|
||||||
|
|
||||||
if (mylocal_materiel.recid)
|
if (mylocal_materiel.recid)
|
||||||
setsubdomain_recid(mylocal_materiel.recid);
|
setsubdomain_recid(mylocal_materiel.recid);
|
||||||
else
|
else
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -50,7 +50,7 @@ import { BsTools } from "react-icons/bs";
|
||||||
|
|
||||||
import DisplayPartnerSession from "./DisplayPartnerSession";
|
import DisplayPartnerSession from "./DisplayPartnerSession";
|
||||||
import DisplayPartnerStagiaires from "./DisplayPartnerStagiaires";
|
import DisplayPartnerStagiaires from "./DisplayPartnerStagiaires";
|
||||||
|
import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
|
||||||
import Employes from "./Employes";
|
import Employes from "./Employes";
|
||||||
import Materiels from "./Materiels";
|
import Materiels from "./Materiels";
|
||||||
import Partner_Commande from "./Partner_Commande";
|
import Partner_Commande from "./Partner_Commande";
|
||||||
|
@ -135,6 +135,9 @@ import Modules_Mes_Documents from "./Modules_Mes_Documents";
|
||||||
import FolderZipIcon from '@mui/icons-material/FolderZip';
|
import FolderZipIcon from '@mui/icons-material/FolderZip';
|
||||||
|
|
||||||
const Partner = (props) => {
|
const Partner = (props) => {
|
||||||
|
|
||||||
|
const stored_cookie_menu_gauche_reduit = getCookie('mysy_menu_gauche_reduit');
|
||||||
|
|
||||||
const { commingmenu, commingpack } = useParams();
|
const { commingmenu, commingpack } = useParams();
|
||||||
const [myApiResponse, setmyApiResponse] = useState("");
|
const [myApiResponse, setmyApiResponse] = useState("");
|
||||||
const [result, setResult] = useState("");
|
const [result, setResult] = useState("");
|
||||||
|
@ -455,9 +458,8 @@ const Partner = (props) => {
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|
||||||
const stored_cookie_menu_gauche = getCookie('mysy_menu_gauche_reduit');
|
|
||||||
|
|
||||||
if (String(stored_cookie_menu_gauche) === "1")
|
if (String(stored_cookie_menu_gauche_reduit) === "1")
|
||||||
setleft_menu(false);
|
setleft_menu(false);
|
||||||
else
|
else
|
||||||
setleft_menu(true);
|
setleft_menu(true);
|
||||||
|
@ -1565,16 +1567,81 @@ const Partner = (props) => {
|
||||||
setDialog_1_open(false);
|
setDialog_1_open(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const [left_menu, setleft_menu] = React.useState(true);
|
const [Update_Connexion_Context_api, setUpdate_Connexion_Context_api] = useState();
|
||||||
|
const [Update_Connexion_Context_message, setUpdate_Connexion_Context_message] = useState();
|
||||||
|
const [Update_Connexion_Context_result, setUpdate_Connexion_Context_result] = useState([]);
|
||||||
|
function Update_Connexion_Context(local_key, local_value) {
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
form.append("partner_id", conntected_account_id);
|
||||||
|
|
||||||
|
var my_key = local_key;
|
||||||
|
|
||||||
|
var local_node = {};
|
||||||
|
|
||||||
|
local_node[String(my_key)] = local_value;
|
||||||
|
|
||||||
|
var tab_node = [];
|
||||||
|
tab_node.push(local_node)
|
||||||
|
|
||||||
|
var tab_context_json_str = JSON.stringify(tab_node);
|
||||||
|
form.append("tab_context_json", tab_context_json_str);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Context_Partner_Account/";
|
||||||
|
setLoading(true);
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
//console.log(" In Update_Connexion_Context res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In Update_Connexion_Context res.data.message r_class = " + res.data.message);
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
setUpdate_Connexion_Context_api("true");
|
||||||
|
setUpdate_Connexion_Context_result(res.data.message);
|
||||||
|
|
||||||
|
|
||||||
|
/* alert(res.data.message);
|
||||||
|
setdisplay_alert_mysy("1");
|
||||||
|
setalert_message(res.data.message);
|
||||||
|
setalert_type("success");*/
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setUpdate_Connexion_Context_api("false");
|
||||||
|
setUpdate_Connexion_Context_message(res.data.message);
|
||||||
|
// alert(res.data.message);
|
||||||
|
setdisplay_alert_mysy("1");
|
||||||
|
setalert_message(res.data.message);
|
||||||
|
setalert_type("error");
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
setLoading(false);
|
||||||
|
console.warn('Update_Connexion_Context : Not good man :( mysearchtext = ' + error);
|
||||||
|
setUpdate_Connexion_Context_api("false");
|
||||||
|
alert(" Impossible de mettre à jour le contexte de connexion");
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const [left_menu, setleft_menu] = React.useState();
|
||||||
|
|
||||||
const open_close_left_menu = () => {
|
const open_close_left_menu = () => {
|
||||||
if (left_menu === true) {
|
if (left_menu === true) {
|
||||||
setleft_menu(false);
|
setleft_menu(false);
|
||||||
setcookie_menu_gauche_reduit("mysy_menu_gauche_reduit", "1", { path: '/' });
|
setcookie_menu_gauche_reduit("mysy_menu_gauche_reduit", "1", { path: '/' });
|
||||||
|
// Mettre à jour le context de connexion, coté backoffice
|
||||||
|
Update_Connexion_Context("mysy_menu_gauche_reduit", "1");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setleft_menu(true);
|
setleft_menu(true);
|
||||||
setcookie_menu_gauche_reduit("mysy_menu_gauche_reduit", "0", { path: '/' });
|
setcookie_menu_gauche_reduit("mysy_menu_gauche_reduit", "0", { path: '/' });
|
||||||
|
// Mettre à jour le context de connexion, coté backoffice
|
||||||
|
Update_Connexion_Context("mysy_menu_gauche_reduit", "0");
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -1601,7 +1668,21 @@ const Partner = (props) => {
|
||||||
setconntected_employee_activite_new(String(new_val));
|
setconntected_employee_activite_new(String(new_val));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [display_alert_mysy, setdisplay_alert_mysy] = useState("");
|
||||||
|
const [alert_message, setalert_message] = useState("");
|
||||||
|
const [alert_type, setalert_type] = useState("");
|
||||||
|
|
||||||
|
function clear_alert_message() {
|
||||||
|
setalert_message("");
|
||||||
|
}
|
||||||
|
function clear_alert_type() {
|
||||||
|
setalert_type("");
|
||||||
|
}
|
||||||
|
function clear_display_alert_mysy() {
|
||||||
|
setdisplay_alert_mysy("");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
||||||
<div className="partner">
|
<div className="partner">
|
||||||
|
@ -1620,6 +1701,19 @@ const Partner = (props) => {
|
||||||
{isLoading && <div className="loader-container">
|
{isLoading && <div className="loader-container">
|
||||||
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
||||||
</div>}
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
{/*** Affichage des messages d'alerte*/}
|
||||||
|
{display_alert_mysy && String(display_alert_mysy) === "1" &&
|
||||||
|
<Module_Alert_Confirmation alert_message={alert_message}
|
||||||
|
alert_type={alert_type}
|
||||||
|
clear_alert_message={clear_alert_message}
|
||||||
|
clear_alert_type={clear_alert_type}
|
||||||
|
clear_display_alert_mysy={clear_display_alert_mysy}
|
||||||
|
/>
|
||||||
|
}
|
||||||
|
{/*** FIN Affichage des messages d'alerte*/}
|
||||||
|
|
||||||
<Dialog
|
<Dialog
|
||||||
open={Dialog_1_open}
|
open={Dialog_1_open}
|
||||||
onClose={Dialog_1_handleClose}
|
onClose={Dialog_1_handleClose}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import { confirmAlert } from 'react-confirm-alert'; // Import
|
||||||
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
|
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
|
||||||
import Popup from 'reactjs-popup';
|
import Popup from 'reactjs-popup';
|
||||||
import 'reactjs-popup/dist/index.css';
|
import 'reactjs-popup/dist/index.css';
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { useParams } from 'react-router-dom'
|
import { useParams } from 'react-router-dom'
|
||||||
|
|
||||||
import Header from "./Header";
|
import Header from "./Header";
|
||||||
|
@ -115,7 +115,7 @@ function SignIn() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log( " ### full url_login = ", url_login)
|
// console.log( " ### full url_login = ", url_login)
|
||||||
|
|
||||||
// Gestion des Cookies
|
// Gestion des Cookies
|
||||||
const stored_partner = cookie_part.tokenmysypart;
|
const stored_partner = cookie_part.tokenmysypart;
|
||||||
|
@ -170,6 +170,7 @@ function SignIn() {
|
||||||
|
|
||||||
if (String(partner_connexion) === String("partner")) {
|
if (String(partner_connexion) === String("partner")) {
|
||||||
|
|
||||||
|
// recuperation et stockage des cookies sur les droit d'acces
|
||||||
setCookie("tokenmysypart", JSON.parse(result['message']).token, { path: '/' });
|
setCookie("tokenmysypart", JSON.parse(result['message']).token, { path: '/' });
|
||||||
|
|
||||||
var acces_right_token_name = String(JSON.parse(result['message']).token) + "_uar";
|
var acces_right_token_name = String(JSON.parse(result['message']).token) + "_uar";
|
||||||
|
@ -181,12 +182,28 @@ function SignIn() {
|
||||||
|
|
||||||
setCookie_acces_right(acces_right_token_name, acces_right_token_val, { path: '/' });
|
setCookie_acces_right(acces_right_token_name, acces_right_token_val, { path: '/' });
|
||||||
|
|
||||||
|
// recuperation et stockage des cookie sur les paramettres de connexion
|
||||||
|
var returned_connexion_data = JSON.parse(result['message'])
|
||||||
|
if (returned_connexion_data.list_connexion_context) {
|
||||||
|
|
||||||
|
const new_data = returned_connexion_data.list_connexion_context.map((x) => {
|
||||||
|
// recuperation et stockage des cookies sur les droit d'acces
|
||||||
|
if (x['code'] && x['code_value']) {
|
||||||
|
setCookie(String(x['code']), String(x['code_value']), { path: '/' });
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//setCookie("tokenmysypart", result['message']);
|
//setCookie("tokenmysypart", result['message']);
|
||||||
history.push("/Partner");
|
history.push("/Partner");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (String(partner_connexion) === String("user")) {
|
else if (String(partner_connexion) === String("user")) {
|
||||||
setCookie("tokenmysych", result['message']);
|
setCookie("tokenmysych", result['message']);
|
||||||
|
|
||||||
// Verification vers quelle page les renvoyer
|
// Verification vers quelle page les renvoyer
|
||||||
|
@ -498,7 +515,7 @@ function SignIn() {
|
||||||
<Input type="email" placeholder="Email" name="email" />
|
<Input type="email" placeholder="Email" name="email" />
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
|
|
||||||
<div style={{height:'10px'}}> </div>
|
<div style={{ height: '10px' }}> </div>
|
||||||
|
|
||||||
|
|
||||||
<FormGroup>
|
<FormGroup>
|
||||||
|
@ -507,7 +524,7 @@ function SignIn() {
|
||||||
<Label>Votre mot de passe </Label>
|
<Label>Votre mot de passe </Label>
|
||||||
</div>
|
</div>
|
||||||
<div className="show_pwd_div" onClick={handleClickShowPassword}>
|
<div className="show_pwd_div" onClick={handleClickShowPassword}>
|
||||||
{currentpawdvisible ? <Visibility style={{fontSize:'15px'}}/> : <VisibilityOff style={{fontSize:'15px'}}/>}
|
{currentpawdvisible ? <Visibility style={{ fontSize: '15px' }} /> : <VisibilityOff style={{ fontSize: '15px' }} />}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -2,7 +2,7 @@ import Link from "next/link";
|
||||||
import SignIn from "../components/SignIn";
|
import SignIn from "../components/SignIn";
|
||||||
import Navigation from "../components/Navigation";
|
import Navigation from "../components/Navigation";
|
||||||
|
|
||||||
|
|
||||||
export default function Login() {
|
export default function Login() {
|
||||||
return (
|
return (
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
import Mon_Intranet_Public from "../components/Mon_Intranet_Public"
|
||||||
|
import Navigation from "../components/Navigation";
|
||||||
|
import Footer from "./footer";
|
||||||
|
|
||||||
|
const mon_intranet_public = () => {
|
||||||
|
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<Mon_Intranet_Public />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default mon_intranet_public;
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -205,7 +205,7 @@
|
||||||
height: 2.5rem !important;
|
height: 2.5rem !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.signin {
|
.signin {
|
||||||
|
|
||||||
|
|
|
@ -138,4 +138,5 @@
|
||||||
@import "./components/intranet_tous_documents";
|
@import "./components/intranet_tous_documents";
|
||||||
@import "./components/modules_mes_documents";
|
@import "./components/modules_mes_documents";
|
||||||
@import "./components/intranet_mes_stagiaires";
|
@import "./components/intranet_mes_stagiaires";
|
||||||
@import "./components/module_alert_confirmation";
|
@import "./components/mon_intranet_public";
|
||||||
|
@import "./components/module_connexion_intranet_client";
|
Loading…
Reference in New Issue