25/12/22 - 12h30
parent
9952a6b0c4
commit
48aff858b4
|
@ -1,4 +1,4 @@
|
||||||
import React, { useState, useEffect, useRef} from "react";
|
import React, { useState, useEffect, useRef } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { getCookie, setCookie } from 'react-use-cookie';
|
import { getCookie, setCookie } from 'react-use-cookie';
|
||||||
import Box from '@mui/material/Box';
|
import Box from '@mui/material/Box';
|
||||||
|
@ -1316,6 +1316,24 @@ function GestionAdministrative(props) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function DownloadAttendeeAttestation(event) {
|
||||||
|
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
|
||||||
|
var nom_fiche_detaillee = "Attestation.pdf";
|
||||||
|
|
||||||
|
var url = process.env.REACT_APP_API_URL + "myclass/api/PrintAttendeeCertification/" + stored_cookie + "/" + mysession + "/" + selectedattendeeemail;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
axios.get(url, { responseType: 'blob', },)
|
||||||
|
.then((res) => {
|
||||||
|
fileDownload(res.data, nom_fiche_detaillee)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
desableSessionFields();
|
desableSessionFields();
|
||||||
setCreateListEmargement_api();
|
setCreateListEmargement_api();
|
||||||
|
@ -1628,7 +1646,7 @@ function GestionAdministrative(props) {
|
||||||
|
|
||||||
if (res.data.status != "false") {
|
if (res.data.status != "false") {
|
||||||
//console.log(" In GetAttendee res.data.status = " + res.data.status);
|
//console.log(" In GetAttendee res.data.status = " + res.data.status);
|
||||||
//console.log(" In GetAttendee res.data.message r_class = " + res.data.message);
|
console.log(" In GetAttendee res.data.message r_class = " + res.data.message);
|
||||||
setGetAttendee_api("true");
|
setGetAttendee_api("true");
|
||||||
setGetAttendee_result(res.data.message);
|
setGetAttendee_result(res.data.message);
|
||||||
var mylocalattendee = JSON.parse(res.data.message);
|
var mylocalattendee = JSON.parse(res.data.message);
|
||||||
|
@ -1701,6 +1719,16 @@ function GestionAdministrative(props) {
|
||||||
setdetailuser_date_evaluation(date_eval);
|
setdetailuser_date_evaluation(date_eval);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
document.getElementsByName("date_evaluation")[0].value = "";
|
||||||
|
if (mylocalattendee.certification_send_date) {
|
||||||
|
alert(" certification_send_date = ", mylocalattendee.certification_send_date);
|
||||||
|
|
||||||
|
var date_eval = new Date(moment(mylocalattendee.certification_send_date, "DD/MM/YYYY"));
|
||||||
|
setdetailuser_date_certification(date_eval);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
document.getElementsByName("note_eval")[0].value = "";
|
document.getElementsByName("note_eval")[0].value = "";
|
||||||
if (mylocalattendee.eval_note) {
|
if (mylocalattendee.eval_note) {
|
||||||
document.getElementsByName("note_eval")[0].value = mylocalattendee.eval_note;
|
document.getElementsByName("note_eval")[0].value = mylocalattendee.eval_note;
|
||||||
|
@ -1819,7 +1847,78 @@ function GestionAdministrative(props) {
|
||||||
const [field_evaluation, setfield_evaluation] = useState("");
|
const [field_evaluation, setfield_evaluation] = useState("");
|
||||||
function editor_keyup() {
|
function editor_keyup() {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
const [SendEvaluationEmail_api, setSendEvaluationEmail_api] = useState();
|
||||||
|
const [SendEvaluationEmail_message, setSendEvaluationEmail_message] = useState();
|
||||||
|
const [SendEvaluationEmail_result, setSendEvaluationEmail_result] = useState();
|
||||||
|
function SendEvaluationEmail() {
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
form.append("session_id", mysession);
|
||||||
|
form.append("attendee_email", selectedattendeeemail);
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/SendTrainingEvaluationEmail/";
|
||||||
|
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
|
||||||
|
if (String(res.data.status) == "true") {
|
||||||
|
console.log(" In SendEvaluationEmail res.data.status = " + res.data.status);
|
||||||
|
console.log(" In SendEvaluationEmail res.data.message r_class = " + res.data.message);
|
||||||
|
setSendEvaluationEmail_api("true");
|
||||||
|
setSendEvaluationEmail_result(res.data.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setSendEvaluationEmail_api("false");
|
||||||
|
setSendEvaluationEmail_message(res.data.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.warn('Not good man :( SendEvaluationEmail = ', error);
|
||||||
|
setSendEvaluationEmail_api("false");
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const [SendAttendeeAttestation_api, setSendAttendeeAttestation_api] = useState();
|
||||||
|
const [SendAttendeeAttestation_message, setSendAttendeeAttestation_message] = useState();
|
||||||
|
const [SendAttendeeAttestation_result, setSendAttendeeAttestation_result] = useState();
|
||||||
|
function SendAttendeeAttestation() {
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
form.append("session_id", mysession);
|
||||||
|
form.append("attendee_email", selectedattendeeemail);
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/SendAttendeeCertification/";
|
||||||
|
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
|
||||||
|
if (String(res.data.status) == "true") {
|
||||||
|
console.log(" In SendAttendeeAttestation res.data.status = " + res.data.status);
|
||||||
|
console.log(" In SendAttendeeAttestation res.data.message r_class = " + res.data.message);
|
||||||
|
setSendAttendeeAttestation_api("true");
|
||||||
|
setSendAttendeeAttestation_result(res.data.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setSendAttendeeAttestation_api("false");
|
||||||
|
setSendAttendeeAttestation_message(res.data.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
console.warn('Not good man :( SendAttendeeAttestation = ', error);
|
||||||
|
setSendAttendeeAttestation_api("false");
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='gestionadministrative'>
|
<div className='gestionadministrative'>
|
||||||
|
@ -2619,7 +2718,7 @@ function GestionAdministrative(props) {
|
||||||
InputLabelProps={{
|
InputLabelProps={{
|
||||||
shrink: true,
|
shrink: true,
|
||||||
}}
|
}}
|
||||||
inputProps={{ min: "0", max: "5", step: "1", readOnly: true, }}
|
inputProps={{ min: "0", max: "5", step: "1", readOnly: true, }}
|
||||||
|
|
||||||
className="disabled_style"
|
className="disabled_style"
|
||||||
/>
|
/>
|
||||||
|
@ -2630,7 +2729,7 @@ function GestionAdministrative(props) {
|
||||||
onInit={(evt, editor) => editorRef_evaluation.current = editor}
|
onInit={(evt, editor) => editorRef_evaluation.current = editor}
|
||||||
initialValue={field_evaluation}
|
initialValue={field_evaluation}
|
||||||
onKeyUp={editor_keyup}
|
onKeyUp={editor_keyup}
|
||||||
disabled = {true}
|
disabled={true}
|
||||||
|
|
||||||
init={{
|
init={{
|
||||||
resize: false,
|
resize: false,
|
||||||
|
@ -2663,15 +2762,22 @@ function GestionAdministrative(props) {
|
||||||
|
|
||||||
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
||||||
|
|
||||||
|
{String(SendEvaluationEmail_api) === "false" && <div className="div_row koUpdateData" style={{ "textAlign": "center" }}>
|
||||||
|
{SendEvaluationEmail_message}</div>}
|
||||||
|
|
||||||
<Button variant="contained" className="bton_envoyer" onClick={"CreateSessionFormation"}>Envoi demande evaluation
|
|
||||||
|
{String(SendEvaluationEmail_api) === "true" && <div className="div_row okUpdateData" style={{ "textAlign": "center" }}>
|
||||||
|
La demande d'evaluation ete envoyée par emaiil </div>}
|
||||||
|
|
||||||
|
|
||||||
|
<Button variant="contained" className="bton_envoyer" onClick={SendEvaluationEmail}>Envoi demande evaluation
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
|
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
|
||||||
|
|
||||||
<Button variant="contained" className="bton_fermer" onClick={DownloadAttendeeDetail}>Imprimer fiche detaillee
|
<Button variant="contained" className="bton_fermer" onClick={DownloadAttendeeDetail}>Imprimer fiche detaillée
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
@ -2723,14 +2829,24 @@ function GestionAdministrative(props) {
|
||||||
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
||||||
|
|
||||||
|
|
||||||
|
{String(SendAttendeeAttestation_api) === "true" &&
|
||||||
|
<div className="div_row okUpdateData" style={{ "textAlign": "center" }}>
|
||||||
|
L'attestation a été bien envoyée par email
|
||||||
|
</div>}
|
||||||
|
|
||||||
<Button variant="contained" className="bton_envoyer" onClick={CreateSessionFormation}>Delivrer certificat
|
{String(SendAttendeeAttestation_api) === "false" &&
|
||||||
|
<div className="div_row koUpdateData" style={{ "textAlign": "center" }}>
|
||||||
|
{SendAttendeeAttestation_message}
|
||||||
|
</div>}
|
||||||
|
|
||||||
|
|
||||||
|
<Button variant="contained" className="bton_envoyer" onClick={SendAttendeeAttestation}>Delivrer certificat
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
|
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
|
||||||
|
|
||||||
<Button variant="contained" className="bton_fermer" onClick={enableSessionFields}>Imprimer certificat
|
<Button variant="contained" className="bton_fermer" onClick={DownloadAttendeeAttestation}>Imprimer certificat
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue