20/03/2024 - 22h30
parent
e6d2de7871
commit
2bb666e222
File diff suppressed because it is too large
Load Diff
|
@ -110,6 +110,7 @@
|
|||
"react-native-paper": "^4.9.2",
|
||||
"react-native-web": "^0.17.5",
|
||||
"react-paginate": "^8.1.1",
|
||||
"react-pdf": "^7.7.1",
|
||||
"react-player": "^2.10.0",
|
||||
"react-range": "^1.8.12",
|
||||
"react-rating-stars-component": "^2.2.0",
|
||||
|
|
|
@ -45,6 +45,9 @@ import Test_Drag_Drop from "./pages/test_drag_drop";
|
|||
|
||||
import Test_Drag_Drop2 from "./pages/test_dnd";
|
||||
|
||||
import ESign from "./pages/eSigne";
|
||||
|
||||
|
||||
function App() {
|
||||
|
||||
const [screenSizeh, getDimension] = useState({
|
||||
|
@ -116,6 +119,7 @@ function App() {
|
|||
<Route path="/OrderConfirmation_3DS/:orderid/:packs" exact component={OrderConfirmation_3DS} />
|
||||
<Route path="/page-inconnue/" exact component={NotFound} />
|
||||
<Route path="/formation-inconnue/" exact component={Training_Inactive_Or_Not_Found} />
|
||||
<Route path="/E_Signature/:document_id" exact component={ESign} />
|
||||
<Route component={NotFound} />
|
||||
</Switch>
|
||||
</BrowserRouter>
|
||||
|
|
|
@ -0,0 +1,395 @@
|
|||
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 Autocomplete from '@mui/material/Autocomplete';
|
||||
import Popup from 'reactjs-popup';
|
||||
import 'reactjs-popup/dist/index.css';
|
||||
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
|
||||
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';
|
||||
import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
|
||||
import { useParams } from 'react-router-dom'
|
||||
import Header from "./Header";
|
||||
import Footer from "./Fotter";
|
||||
import { FcInfo } from "react-icons/fc";
|
||||
import { Document, Page } from 'react-pdf'
|
||||
|
||||
function ESign() {
|
||||
|
||||
const history = useHistory();
|
||||
const { document_id } = useParams();
|
||||
const [isLoading, setLoading] = useState();
|
||||
|
||||
const [get_E_Document_PDF, setget_E_Document_PDF] = useState();
|
||||
const [selected_e_doc_id, setselected_e_doc_id] = useState();
|
||||
const [selected_e_doc_email, setselected_e_doc_email] = useState();
|
||||
const [selected_e_doc_secret, setselected_e_doc_secret] = useState();
|
||||
|
||||
const [is_valide_e_document, setis_valide_e_document] = useState(false);
|
||||
|
||||
const [get_E_Document_api, setget_E_Document_api] = useState();
|
||||
const [get_E_Document_message, setget_E_Document_message] = useState();
|
||||
const [get_E_Document_result, setget_E_Document_result] = useState();
|
||||
function get_E_Document() {
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_E_Document_Not_Signed_No_Token/";
|
||||
|
||||
var form = new FormData();
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("e_doc_id", document_id);
|
||||
form.append("secret_key", selected_e_doc_secret);
|
||||
form.append("user_email", user_email);
|
||||
|
||||
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
setLoading(false);
|
||||
//console.log(" get_E_Document : In test res.data.status = " + res.data.status);
|
||||
//console.log(" get_E_Document: res.data.message.img = " + res.data.message);
|
||||
|
||||
if (String(res.data.status) === "true") {
|
||||
setget_E_Document_api("true");
|
||||
|
||||
if (JSON.parse(res.data.message).document_data) {
|
||||
setis_valide_e_document(true);
|
||||
var document_data = "data:application/pdf;base64," + JSON.parse(res.data.message).document_data;
|
||||
setget_E_Document_PDF(document_data);
|
||||
setselected_e_doc_id(JSON.parse(res.data.message)._id);
|
||||
setselected_e_doc_email(JSON.parse(res.data.message).email_destinataire);
|
||||
setselected_e_doc_secret(JSON.parse(res.data.message).secret_key);
|
||||
setDialog_1_open(false);
|
||||
seterreur_recup_e_doc();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + res.data.message);
|
||||
history.push("/Connexion");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
setget_E_Document_api("false");
|
||||
seterreur_recup_e_doc(res.data.message);
|
||||
get_E_Document_message(res.data.message)
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('get_E_Document ee: Not good man :( = ', error);
|
||||
setget_E_Document_api("false");
|
||||
get_E_Document_message(" Impossible de recuperer le E-Document")
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
const [Signature_E_Document_api, setSignature_E_Document_api] = useState();
|
||||
const [Signature_E_Document_message, setSignature_E_Document_message] = useState();
|
||||
const [Signature_E_Document_result, setSignature_E_Document_result] = useState();
|
||||
function Signature_E_Document(material_id) {
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Create_E_Signature_For_E_Document/";
|
||||
|
||||
var form = new FormData();
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("e_doc_id", selected_e_doc_id);
|
||||
form.append("secret_key", selected_e_doc_secret);
|
||||
form.append("email_destinataire", selected_e_doc_email);
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
setLoading(false);
|
||||
//console.log(" Signature_E_Document : In test res.data.status = " + res.data.status);
|
||||
//console.log(" Signature_E_Document: res.data.message.img = " + res.data.message);
|
||||
|
||||
if (String(res.data.status) === "true") {
|
||||
setSignature_E_Document_api("true");
|
||||
|
||||
setDialog_Message_open(true);
|
||||
// alert(" Le document a été correctement signé");
|
||||
|
||||
}
|
||||
else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + res.data.message);
|
||||
history.push("/Connexion");
|
||||
return;
|
||||
}
|
||||
else {
|
||||
setSignature_E_Document_api("false");
|
||||
Signature_E_Document_message(res.data.message)
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Signature_E_Document ee: Not good man :( = ', error);
|
||||
setSignature_E_Document_api("false");
|
||||
Signature_E_Document_message(" Impossible de signer le E-Document")
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
setselected_e_doc_id(document_id);
|
||||
// get_E_Document();
|
||||
|
||||
window.scrollTo({
|
||||
top: 0,
|
||||
behavior: "smooth",
|
||||
});
|
||||
}, [])
|
||||
|
||||
|
||||
const [user_nom, setuser_nom] = React.useState("");
|
||||
const [user_prenom, setuser_prenom] = React.useState("");
|
||||
const [user_email, setuser_email] = React.useState("");
|
||||
|
||||
|
||||
const [erreur_recup_e_doc, seterreur_recup_e_doc] = React.useState();
|
||||
|
||||
|
||||
const [Dialog_1_message, setDialog_1_message] = React.useState(false);
|
||||
const [Dialog_1_open, setDialog_1_open] = React.useState(true);
|
||||
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);
|
||||
history.push("/");
|
||||
|
||||
};
|
||||
|
||||
const [Dialog_Message_message, setDialog_Message_message] = React.useState(false);
|
||||
const [Dialog_Message_open, setDialog_Message_open] = React.useState(false);
|
||||
function Dialog_Message_handle_change_participant_session(message) {
|
||||
setDialog_Message_message(message);
|
||||
setDialog_Message_open(true);
|
||||
}
|
||||
|
||||
const Dialog_Message_handleClose = () => {
|
||||
//alert(" Utiliser le bouton 'fermer' ");
|
||||
//setOpen(false);
|
||||
};
|
||||
|
||||
const Dialog_Message_handleClose_buton = () => {
|
||||
setDialog_Message_open(false);
|
||||
history.push("/");
|
||||
|
||||
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="esign">
|
||||
|
||||
|
||||
<Dialog
|
||||
open={Dialog_1_open}
|
||||
onClose={Dialog_1_handleClose}
|
||||
className="esign"
|
||||
|
||||
>
|
||||
|
||||
{!erreur_recup_e_doc && <DialogTitle>Authentification </DialogTitle>}
|
||||
{erreur_recup_e_doc && <DialogTitle>Authentification - <font color="red"> Identifiants invalides </font></DialogTitle>}
|
||||
<DialogContent className="DialogContent_width">
|
||||
|
||||
|
||||
<div className="div_row_dialog">
|
||||
<div className="session_caract_Dialog" > Email :
|
||||
<TextField
|
||||
autoFocus
|
||||
margin="dense"
|
||||
id="new_login"
|
||||
//label="Prix Unitaire"
|
||||
|
||||
fullWidth
|
||||
//variant="standard"
|
||||
value={user_email}
|
||||
onChange={(e) => {
|
||||
setuser_email(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="div_row_dialog">
|
||||
<div className="session_caract_Dialog" > Clé Secrete
|
||||
<TextField
|
||||
autoFocus
|
||||
margin="dense"
|
||||
id="secrete_key"
|
||||
//label="Prix Unitaire"
|
||||
|
||||
fullWidth
|
||||
//variant="standard"
|
||||
value={selected_e_doc_secret}
|
||||
onChange={(e) => {
|
||||
setselected_e_doc_secret(e.target.value);
|
||||
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
<Button onClick={get_E_Document} className="bton_enreg_dialog">Afficher Document </Button>
|
||||
</div>
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Dialog_1_handleClose_buton} className="bton_annule_dialog" >Annuler</Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
<Dialog
|
||||
open={Dialog_Message_open}
|
||||
onClose={Dialog_Message_handleClose}
|
||||
className="esign"
|
||||
|
||||
>
|
||||
|
||||
<DialogTitle>Information </DialogTitle>
|
||||
|
||||
<DialogContent className="DialogContent_width">
|
||||
|
||||
|
||||
<div className="div_row_dialog">
|
||||
|
||||
Le document a été signée. Vous allez recevoir le document par email
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<div className="div_row">
|
||||
<div className="div_row_gauche">
|
||||
|
||||
</div>
|
||||
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||
<Button onClick={Dialog_Message_handleClose_buton} className="bton_enreg_dialog"> Fermer </Button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</DialogActions>
|
||||
</Dialog>
|
||||
|
||||
{isLoading && <div className="loader-container">
|
||||
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
||||
</div>}
|
||||
|
||||
|
||||
<Header />
|
||||
|
||||
<h3> Signature Electronique </h3>
|
||||
|
||||
{is_valide_e_document && <div>
|
||||
<div style={{ width: "80%", "marginLeft": "auto", "marginRight": "auto" }}>
|
||||
<embed src={get_E_Document_PDF} width='100%' height='700px' type="application/pdf" />
|
||||
|
||||
|
||||
</div>
|
||||
<div className="div_row">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div style={{ width: "80%", "marginLeft": "auto", "marginRight": "auto" }}>
|
||||
<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
|
||||
|
||||
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
||||
|
||||
<Button variant="contained" className="bton_enreg" onClick={Signature_E_Document}>Signer
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }} >
|
||||
<Button variant="contained" className="bton_annule" onClick={"Annule_Add_One_New_Doc"}>Annuler
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>}
|
||||
|
||||
{!is_valide_e_document && <div style={{ height: "40vh" }}>
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
<div className="div_row">
|
||||
|
||||
</div>
|
||||
<div className="pieddepage">
|
||||
<Footer />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default ESign;
|
|
@ -4939,7 +4939,8 @@ const Employes = (props) => {
|
|||
|
||||
/>
|
||||
</div>}
|
||||
{String(p_detail_user_login).length < 2 && <div className="session_caract_Dialog" > Login
|
||||
{String(p_detail_user_login).length < 2 &&
|
||||
<div className="session_caract_Dialog" > Login
|
||||
<TextField
|
||||
autoFocus
|
||||
margin="dense"
|
||||
|
|
|
@ -1661,28 +1661,7 @@ const Module_Editique = (props) => {
|
|||
}
|
||||
/>
|
||||
|
||||
{/*<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
|
||||
|
||||
name="event_dialog_type_convention"
|
||||
id="event_dialog_type_convention"
|
||||
|
||||
select
|
||||
fullWidth
|
||||
|
||||
value={selected_convention_type}
|
||||
onChange={(e) => {
|
||||
setselected_convention_type(e.target.value);
|
||||
Get_List_Stagiaire_Conventions(action_server_ref_interne_doc, action_server_nom_doc,
|
||||
String(e.target.value), Dialog_1_message);
|
||||
|
||||
}
|
||||
}
|
||||
>
|
||||
|
||||
<MenuItem value="email" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Email </MenuItem>
|
||||
<MenuItem value="pdf" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >PDF </MenuItem>
|
||||
</TextField>*/}
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
import Link from "next/link";
|
||||
import Navigation from "../components/Navigation";
|
||||
import ESign from "../components/ESign";
|
||||
|
||||
|
||||
|
||||
export default function Login() {
|
||||
return (
|
||||
<div>
|
||||
<Navigation />
|
||||
<div>
|
||||
<ESign />
|
||||
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
.mysy_spinner {
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
//border: 1px solid black;
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
.mysy_spinner {
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
//border: 1px solid black;
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
.mysy_spinner {
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
//border: 1px solid black;
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
|
||||
.mysy_spinner {
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
//border: 1px solid black;
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
.mysy_spinner {
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
//border: 1px solid black;
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -31,7 +31,7 @@
|
|||
|
||||
.mysy_spinner {
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
//border: 1px solid black;
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
.mysy_spinner {
|
||||
border-radius: 5px;
|
||||
border: 1px solid black;
|
||||
//border: 1px solid black;
|
||||
opacity: 100%;
|
||||
}
|
||||
|
||||
|
|
|
@ -101,3 +101,4 @@
|
|||
@import "./components/test_drag_drop";
|
||||
@import "./components/materiel_salle";
|
||||
@import "./components/crm_opportunite";
|
||||
@import "./components/esign";
|
||||
|
|
Loading…
Reference in New Issue