20/08/23 - 23h30

recette2
cherif 2023-08-20 23:56:43 +02:00
parent 70227e493c
commit e36d5dd997
11 changed files with 590 additions and 58 deletions

View File

@ -469,6 +469,8 @@ const DisplayDetailClass = (props) => {
form.append("class_internal_url", classId);
form.append("token", stored_partner);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
axios.post(myurl, form).then(res => {

View File

@ -494,6 +494,8 @@ const DisplayDetailClassAction = (props) => {
form.append("class_internal_url", classId);
form.append("token", stored_partner);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
axios.post(myurl, form).then(res => {

View File

@ -894,6 +894,8 @@ const DisplayDetailClass_new_v2 = (props) => {
form.append("class_internal_url", classId);
form.append("token", stored_partner);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
axios.post(myurl, form).then(res => {

View File

@ -987,7 +987,8 @@ const DisplayPartnerSession = (props) => {
.then((response) => response.json())
.then((result) => {
//console.log(" ## result['status'] = ", result['status'])
console.log(" ## result['status'] = ", result['status'])
if (String(result['status']) === String("Err_Connexion")) {
alert('Erreur: ' + result['message']);
history.push("/Connexion");
@ -1029,6 +1030,8 @@ const DisplayPartnerSession = (props) => {
var form = new FormData();
form.append("class_internal_url", selected_internal_url);
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionFormation_List/";
@ -2823,7 +2826,7 @@ const DisplayPartnerSession = (props) => {
return;
}
var _id = cellValues.row._id;
var nom = cellValues.row.nom;
@ -3623,8 +3626,8 @@ const DisplayPartnerSession = (props) => {
return (
<div className="displaypartnersession">
<h3> Vos sessions de formation </h3>
<h3> Vos sessions de formation </h3>
<div className="titre1"> Utilisez les filtres !</div>
<div className="div_row" style={{ "marginBottom": "5px" }}>
<div className="div_row_gauche texte_area_filter" >
@ -3791,8 +3794,8 @@ const DisplayPartnerSession = (props) => {
<div style={{ "border": "None" }}>
<div style={{ height: 500, width: '100%', paddingRight: '1px' }}>
&nbsp;
<Box
&nbsp;
<Box
sx={{
height: 500,
width: '100%',

View File

@ -411,6 +411,8 @@ const DisplayPartnerStagiaires = (props) => {
var form = new FormData();
form.append("class_internal_url", selected_internal_url);
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionFormation_List/";
@ -1235,7 +1237,7 @@ const DisplayPartnerStagiaires = (props) => {
//console.log('Success:', result['message']);
setliste_sessions_file_change_result(result['message']);
setliste_sessions_file_change_api("true");
Getall_TrainingParticipant();
alert(" Les stagiaires ont été correctement importés");
@ -1367,6 +1369,7 @@ const DisplayPartnerStagiaires = (props) => {
const [p_date_evaluation, setp_date_evaluation] = useState();
const [p_note_eval, setp_note_eval] = useState();
const [p_detail_session_class, setp_detail_session_class] = useState();
const [p_detail_session_class_id, setp_detail_session_class_id] = useState();
const [p_detail_status_inscrit, setp_detail_status_inscrit] = useState();
const [p_detail_status_inscrit_label, setp_detail_status_inscrit_label] = useState();
const [p_detail_opco, setp_detail_opco] = useState();
@ -1408,8 +1411,8 @@ const DisplayPartnerStagiaires = (props) => {
axios.post(myurl, form).then(res => {
if (String(res.data.status) === "true") {
//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.status = " + res.data.status);
console.log(" In GetAttendee res.data.message r_class = " + res.data.message);
setGetAttendee_api("true");
setGetAttendee_result(res.data.message);
var mylocalattendee = JSON.parse(res.data.message);
@ -1422,8 +1425,12 @@ const DisplayPartnerStagiaires = (props) => {
document.getElementsByName("detail_session")[0].value = "";
if (mylocalattendee.code_session)
setp_detail_session_class(mylocalattendee.code_session);
if (mylocalattendee.session_id)
setp_detail_session_class(mylocalattendee.session_id);
setp_detail_session_class_id(mylocalattendee.session_id);
document.getElementsByName("detail_status_inscript")[0].value = "";
if (mylocalattendee.status) {
@ -1768,14 +1775,37 @@ const DisplayPartnerStagiaires = (props) => {
form.append("nom", p_detail_nom);
form.append("prenom", p_detail_prenom);
form.append("email", p_detail_mail);
form.append("employeur", p_detail_employeur);
if (p_detail_employeur)
form.append("employeur", p_detail_employeur);
else
form.append("employeur", "");
form.append("status", p_detail_status_inscrit);
form.append("price", p_detail_cout);
form.append("modefinancement", p_detail_mode_fin);
if (p_detail_cout)
form.append("price", p_detail_cout);
else
form.append("price", "");
if (p_detail_mode_fin)
form.append("modefinancement", p_detail_mode_fin);
else
form.append("modefinancement", "");
if (p_detail_opco)
form.append("opco", p_detail_opco);
else
form.append("opco", "");
form.append("_id", selected_id);
form.append("client_rattachement_id", p_detail_client_rattachement_nom);
if (p_detail_client_rattachement_nom)
form.append("client_rattachement_id", p_detail_client_rattachement_nom);
else
form.append("client_rattachement_id", "");
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/";
@ -2467,7 +2497,7 @@ const DisplayPartnerStagiaires = (props) => {
>
{GetCurrentPartnerClass_result &&
GetCurrentPartnerClass_result.map((myclass) => (
<MenuItem key={JSON.parse(myclass).internal_url} value={JSON.parse(myclass).internal_url} style={{ "paddingLeft": "5px", "textAlign": "left", }}>
<MenuItem key={JSON.parse(myclass).title} value={JSON.parse(myclass).internal_url} style={{ "paddingLeft": "5px", "textAlign": "left", }}>
{JSON.parse(myclass).title}
</MenuItem>
@ -2497,7 +2527,7 @@ const DisplayPartnerStagiaires = (props) => {
>
{p_one_formation && Getall_TrainingSession_result &&
Getall_TrainingSession_result.filter((session_ch) => JSON.parse(session_ch).class_internal_url === p_one_formation).map((mysession) => (
<MenuItem key={JSON.parse(mysession).code_session} value={JSON.parse(mysession).code_session}
<MenuItem key={JSON.parse(mysession).code_session} value={JSON.parse(mysession)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", }}>
{JSON.parse(mysession).code_session}&nbsp;&nbsp;
@ -2505,7 +2535,7 @@ const DisplayPartnerStagiaires = (props) => {
))}
{!p_one_formation && Getall_TrainingSession_result &&
Getall_TrainingSession_result.map((mysession) => (
<MenuItem key={JSON.parse(mysession).code_session} value={JSON.parse(mysession).code_session}
<MenuItem key={JSON.parse(mysession).code_session} value={JSON.parse(mysession)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", }}>
{JSON.parse(mysession).code_session}&nbsp;&nbsp;
@ -2622,7 +2652,7 @@ const DisplayPartnerStagiaires = (props) => {
className="disabled_style enable_style"
>
{status_inscription.map((option) => (
<MenuItem key={option.value} value={option.value}>
<MenuItem key={option.label} value={option.value}>
{option.label} &nbsp; <br />
</MenuItem>
))}
@ -2652,7 +2682,7 @@ const DisplayPartnerStagiaires = (props) => {
>
{Get_List_Partner_Clients_result &&
Get_List_Partner_Clients_result.map((myclient) => (
<MenuItem key={JSON.parse(myclient)._id} value={JSON.parse(myclient)._id}
<MenuItem key={JSON.parse(myclient).nom} value={JSON.parse(myclient)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", }}>
{JSON.parse(myclient).nom}&nbsp;&nbsp;
@ -2777,7 +2807,7 @@ const DisplayPartnerStagiaires = (props) => {
{String(participant_data_edit_mode) === "1" && <div className="session_caract"> Session <br />
{String(participant_data_edit_mode) === "1" && <div className="session_caract"> Session aa<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
@ -2789,10 +2819,11 @@ const DisplayPartnerStagiaires = (props) => {
}}
disabled={false}
className="disabled_style"
value={p_detail_session_class}
value={p_detail_session_class_id}
onChange={(e) => {
setp_detail_session_class(e.target.value);
setparticipant_data_changed("1");
setp_detail_session_class_id(e.target.value);
Dialog_1_handle_change_participant_session(" Attention, vous allez modifier la session d'affectation du participant");
}
}
@ -2800,7 +2831,7 @@ const DisplayPartnerStagiaires = (props) => {
>
{Getall_TrainingSession_result &&
Getall_TrainingSession_result.map((mysession) => (
<MenuItem key={JSON.parse(mysession).code_session} value={JSON.parse(mysession).code_session}
<MenuItem key={JSON.parse(mysession)._id} value={JSON.parse(mysession)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", }}>
{JSON.parse(mysession).code_session}&nbsp;&nbsp;
@ -2834,7 +2865,7 @@ const DisplayPartnerStagiaires = (props) => {
>
{Get_List_Partner_Clients_result &&
Get_List_Partner_Clients_result.map((myclient) => (
<MenuItem key={JSON.parse(myclient)._id} value={JSON.parse(myclient)._id}
<MenuItem key={JSON.parse(myclient).nom} value={JSON.parse(myclient)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", }}>
{JSON.parse(myclient).nom}&nbsp;&nbsp;
@ -3222,8 +3253,6 @@ const DisplayPartnerStagiaires = (props) => {
</div>
{String(participant_data_edit_mode) !== "1" && <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>

View File

@ -166,7 +166,9 @@ const Formation_copie = (props) => {
var form = new FormData();
form.append("class_internal_url", props.formation.internal_url);
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
axios.post(myurl, form).then(res => {

View File

@ -186,6 +186,8 @@ const Formation = (props) => {
form.append("class_internal_url", props.formation.internal_url);
form.append("token", stored_partner);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
axios.post(myurl, form).then(res => {

View File

@ -169,6 +169,8 @@ const Formation_Cartouche_Com = (props) => {
form.append("class_internal_url", props.formation.internal_url);
form.append("token", stored_partner);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
axios.post(myurl, form).then(res => {

View File

@ -36,7 +36,11 @@ 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 { useHistory } from "react-router-dom";
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 { CiTrash } from "react-icons/ci";
@ -883,8 +887,7 @@ function GestionAdministrative(props) {
form.append("_id", object_id);
form.append("_id", selected_id);
form.append("client_rattachement_id", p_detail_client_rattachement_nom);
form.append("client_rattachement_id", p_detail_client_rattachement_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/";
@ -1047,7 +1050,9 @@ function GestionAdministrative(props) {
var form = new FormData();
form.append("class_internal_url", internal_url);
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionFormation_List/";
axios.post(myurl, form).then(res => {
@ -1453,6 +1458,7 @@ function GestionAdministrative(props) {
var tab_date = [];
setp_detail_session_class(event.target.value);
setmysession(event.target.value);
GetListePreinscrit(event.target.value);
GetListeInscrit(event.target.value);
@ -1940,8 +1946,8 @@ function GestionAdministrative(props) {
if (String(res.data.status) === "true") {
//console.log(" In GetCurrentSession res.data.status = " + res.data.status);
console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message);
console.log(" In GetCurrentSession res.data.message len = " + String(res.data.message).length);
//console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message);
//console.log(" In GetCurrentSession res.data.message len = " + String(res.data.message).length);
setGetCurrentSession_api("true");
if (String(res.data.message).length > 0) {
@ -3100,15 +3106,15 @@ function GestionAdministrative(props) {
document.getElementsByName("detail_nom")[0].value = "";
if (mylocalattendee.nom)
document.getElementsByName("detail_nom")[0].value = mylocalattendee.nom;
setp_detail_nom(mylocalattendee.nom);
document.getElementsByName("detail_prenom")[0].value = "";
if (mylocalattendee.prenom)
document.getElementsByName("detail_prenom")[0].value = mylocalattendee.prenom;
setp_detail_prenom(mylocalattendee.prenom);
document.getElementsByName("detail_mail")[0].value = "";
if (mylocalattendee.email) {
document.getElementsByName("detail_mail")[0].value = mylocalattendee.email;
setp_detail_mail(mylocalattendee.email);
setattendee_lms_login(mylocalattendee.email);
}
@ -3130,42 +3136,47 @@ function GestionAdministrative(props) {
setp_detail_status_inscrit_label("Annulé");
}
document.getElementsByName("detail_opco")[0].value = "";
if (mylocalattendee.opco)
setp_detail_opco(mylocalattendee.opco);
document.getElementsByName("detail_tel")[0].value = "";
if (mylocalattendee.telephone) {
document.getElementsByName("detail_tel")[0].value = mylocalattendee.telephone;
setp_detail_tel(mylocalattendee.telephone);
}
document.getElementsByName("detail_adresse")[0].value = "";
if (mylocalattendee.adresse) {
document.getElementsByName("detail_adresse")[0].value = mylocalattendee.adresse;
setp_detail_adresse(mylocalattendee.adresse);
}
document.getElementsByName("detail_code_postal")[0].value = "";
if (mylocalattendee.code_postal) {
document.getElementsByName("detail_code_postal")[0].value = mylocalattendee.code_postal;
setp_detail_code_postal(mylocalattendee.code_postal);
}
document.getElementsByName("detail_ville")[0].value = "";
if (mylocalattendee.ville) {
document.getElementsByName("detail_ville")[0].value = mylocalattendee.ville;
setp_detail_ville(mylocalattendee.ville);
}
document.getElementsByName("detail_cout")[0].value = "";
if (mylocalattendee.price) {
document.getElementsByName("detail_cout")[0].value = mylocalattendee.price;
setp_detail_cout(mylocalattendee.price);
}
document.getElementsByName("detail_mode_fin")[0].value = "";
if (mylocalattendee.modefinancement) {
document.getElementsByName("detail_mode_fin")[0].value = mylocalattendee.modefinancement;
setp_detail_mode_fin(mylocalattendee.modefinancement);
}
document.getElementsByName("detail_employeur")[0].value = "";
if (mylocalattendee.employeur) {
document.getElementsByName("detail_employeur")[0].value = mylocalattendee.employeur;
setp_detail_employeur(mylocalattendee.employeur);
}
document.getElementsByName("date_evaluation")[0].value = "";
@ -3200,7 +3211,7 @@ function GestionAdministrative(props) {
setattendee_lms_pwd("xxxxxx");
}
desableAttendeeDetailFields();
var myelement;
if (document.getElementById('ajout_participant')) {
@ -3211,6 +3222,7 @@ function GestionAdministrative(props) {
myelement.scrollIntoView({ behavior: 'smooth' });
}
disableAttendeeDetailFields();
} else if (String(res.data.status) === String("Err_Connexion")) {
alert('Erreur: ' + res.data.message);
@ -3220,12 +3232,13 @@ function GestionAdministrative(props) {
else {
setGetAttendee_api("false");
setGetAttendee_message(res.data.message);
alert('Erreur: ' + res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( GetAttendee = ', error);
setGetAttendee_api("false");
//setmyApimyApiMessage("")
alert(" Impossible de recuperer les données de l'apprenant");
})
}
@ -3891,12 +3904,14 @@ function GestionAdministrative(props) {
else {
setOne_Create_Participant_api("false");
setOne_Create_Participant_message(res.data.message);
alert('Erreur: ' + res.data.message);
}
}).catch((error) => {
console.warn('One_Create_Participant : Not good man :( = ' + error);
setOne_Create_Participant_api("false");
alert(" Imposible d'ajouter l'apprenant")
})
}
@ -4145,9 +4160,234 @@ function GestionAdministrative(props) {
const [p_detail_client_rattachement_nom, setp_detail_client_rattachement_nom] = useState();
const [p_detail_client_rattachement_id, setp_detail_client_rattachement_id] = useState();
let [participant_data_changed, setparticipant_data_changed] = useState();
let [participant_data_edit_mode, setparticipant_data_edit_mode] = useState();
function EnableAttendeeDetailFields() {
setparticipant_data_edit_mode("1");
document.getElementsByName("detail_session_class")[0].disabled = false;
document.getElementsByName("detail_session_class")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_client_rattachement")[0].disabled = false;
document.getElementsByName("detail_client_rattachement")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_nom")[0].disabled = false;
document.getElementsByName("detail_nom")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_status_inscript")[0].disabled = false;
document.getElementsByName("detail_status_inscript")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_opco")[0].disabled = false;
document.getElementsByName("detail_opco")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_prenom")[0].disabled = false;
document.getElementsByName("detail_prenom")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_mail")[0].disabled = false;
document.getElementsByName("detail_mail")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_tel")[0].disabled = false;
document.getElementsByName("detail_tel")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_adresse")[0].disabled = false;
document.getElementsByName("detail_adresse")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_code_postal")[0].disabled = false;
document.getElementsByName("detail_code_postal")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_ville")[0].disabled = false;
document.getElementsByName("detail_ville")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_cout")[0].disabled = false;
document.getElementsByName("detail_cout")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_mode_fin")[0].disabled = false;
document.getElementsByName("detail_mode_fin")[0].style.backgroundColor = "#FFFFFF";
document.getElementsByName("detail_employeur")[0].disabled = false;
document.getElementsByName("detail_employeur")[0].style.backgroundColor = "#FFFFFF";
}
function disableAttendeeDetailFields() {
setparticipant_data_edit_mode("0");
document.getElementsByName("detail_session_class")[0].disabled = true;
document.getElementsByName("detail_session_class")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_client_rattachement")[0].disabled = true;
document.getElementsByName("detail_client_rattachement")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_nom")[0].disabled = true;
document.getElementsByName("detail_nom")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_status_inscript")[0].disabled = true;
document.getElementsByName("detail_status_inscript")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_opco")[0].disabled = true;
document.getElementsByName("detail_opco")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_prenom")[0].disabled = true;
document.getElementsByName("detail_prenom")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_mail")[0].disabled = true;
document.getElementsByName("detail_mail")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_tel")[0].disabled = true;
document.getElementsByName("detail_tel")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_adresse")[0].disabled = true;
document.getElementsByName("detail_adresse")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_code_postal")[0].disabled = true;
document.getElementsByName("detail_code_postal")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_ville")[0].disabled = true;
document.getElementsByName("detail_ville")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_cout")[0].disabled = true;
document.getElementsByName("detail_cout")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_mode_fin")[0].disabled = true;
document.getElementsByName("detail_mode_fin")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_employeur")[0].disabled = true;
document.getElementsByName("detail_employeur")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("date_evaluation")[0].disabled = true;
document.getElementsByName("date_evaluation")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("detail_incr_date")[0].disabled = true;
document.getElementsByName("detail_incr_date")[0].style.backgroundColor = "#ECEFF1";
document.getElementsByName("certif_date")[0].disabled = true;
document.getElementsByName("certif_date")[0].style.backgroundColor = "#ECEFF1";
}
function AnnuleAttendeeDetailFields() {
GetAttendee_Data(selectedattendeeemail, mysession);
disableAttendeeDetailFields();
setparticipant_data_changed();
setparticipant_data_edit_mode();
}
const [Update_One_StagiaireData_api, setUpdate_One_StagiaireData_api] = useState();
const [Update_One_StagiaireData_message, setUpdate_One_StagiaireData_message] = useState();
const [Update_One_StagiaireData_result, setUpdate_One_StagiaireData_result] = useState();
function Update_One_StagiaireData() {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
if (p_detail_session_class.length <= 0) {
alert(" Vous devez choisir une session");
return;
}
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("class_internal_url", internal_url);
form.append("session_id", p_detail_session_class);
form.append("nom", p_detail_nom);
form.append("prenom", p_detail_prenom);
form.append("email", p_detail_mail);
form.append("employeur", p_detail_employeur);
form.append("status", p_detail_status_inscrit);
form.append("price", p_detail_cout);
form.append("modefinancement", p_detail_mode_fin);
form.append("opco", p_detail_opco);
form.append("_id", selected_id);
form.append("client_rattachement_id", p_detail_client_rattachement_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/";
axios.post(myurl, form).then(res => {
//console.log(" In UpdateStagiaireData res.data.status = " + res.data.status);
//console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message);
if (String(res.data.status) === String("true")) {
setUpdate_One_StagiaireData_api("true");
setUpdate_One_StagiaireData_result(res.data.message);
disableAttendeeDetailFields();
setparticipant_data_changed();
setparticipant_data_edit_mode();
GetAttendee_Data(p_detail_mail, p_detail_session_class);
GetCurrentClass_trainingsession();
GetAttestation_Certif();
Get_List_Partner_Clients();
alert(" La mise à jour été correctement faite.");
}
else {
setUpdate_One_StagiaireData_api("false");
setUpdate_One_StagiaireData_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
console.warn('UpdateStagiaireData : Not good man :( mysearchtext = ' + error);
setUpdate_One_StagiaireData_api("false");
alert(" Impossible de mettre à jour le participant");
})
}
const [Dialog_1_message, setDialog_1_message] = React.useState(false);
const [Dialog_1_open, setDialog_1_open] = React.useState(false);
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);
};
return (
<div className='gestionadministrative'>
<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>
<Helmet>
<title>Partenaires editeurs formations</title>
<meta name="description" content="backoffice partenaire editeurs formation" />
@ -4578,9 +4818,46 @@ function GestionAdministrative(props) {
{String(addOneSession) !== "1" && <div>
<div className="div_row_gauche" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
<br />
{/*---
Choisir une session v 2 <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="session_liste"
id="session_liste"
label="Choisir une session"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style selectsession"
//value={p_one_detail_client_rattachement_nom}
onChange={handleChangeSession}
>
{GetCurrentClass_trainingsession_result &&
GetCurrentClass_trainingsession_result.map((session) => (
<MenuItem key={(JSON.parse(session).code_session)} value={(JSON.parse(session).code_session)}
style={{ "paddingLeft": "5px", "textAlign": "left", }} className="selectsession">
{(JSON.parse(session).code_session) && (JSON.parse(session).code_session) + " - "}
{(JSON.parse(session).session_ondemande) === "1" && " A la Demande - "}
{(!JSON.parse(session).session_ondemande || JSON.parse(session).session_ondemande === "0") &&
(JSON.parse(session).date_debut).substring(0, 10) + " au " + (JSON.parse(session).date_fin).substring(0, 10)}
{/*(JSON.parse(session).date_debut).substring(0, 10)} au {(JSON.parse(session).date_fin).substring(0, 10) * /} -
{(JSON.parse(session).distantiel) === "1" && " A Distance - "}
{(JSON.parse(session).presentiel) === "1" && (JSON.parse(session).adresse) && " En Présentiel - " + (JSON.parse(session).adresse)}
{(JSON.parse(session).presentiel) === "1" && (!JSON.parse(session).adresse) && " En Présentiel - "}
{(JSON.parse(session).code_postal) && " " + (JSON.parse(session).code_postal)}
</MenuItem>
))}
</TextField>
---*/}
Choisir une session <br />
<select id="session_liste" value={mysession} onChange={handleChangeSession} className="selectsession">
<select id="session_liste2" value={mysession} onChange={handleChangeSession} className="selectsession">
<option value="" className="select_option_css">Choisir</option>
@ -5808,6 +6085,58 @@ function GestionAdministrative(props) {
<div className="session_data" >
{String(participant_data_edit_mode) !== "1" && <div className="session_caract"> Session<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_session_class"
id="detail_session_class"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_session_class}
/>
</div>}
{String(participant_data_edit_mode) === "1" && <div className="session_caract"> Session <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_session"
id="detail_session"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_session_class}
onChange={(e) => {
setp_detail_session_class(e.target.value);
setparticipant_data_changed("1");
Dialog_1_handle_change_participant_session(" Attention, vous allez modifier la session d'affectation du participant");
}
}
>
{GetCurrentClass_trainingsession_result &&
GetCurrentClass_trainingsession_result.map((mysession) => (
<MenuItem key={JSON.parse(mysession).code_session} value={JSON.parse(mysession).code_session}
style={{ "paddingLeft": "5px", "textAlign": "left", }}>
{JSON.parse(mysession).code_session}&nbsp;&nbsp;
</MenuItem>
))}
</TextField>
</div>}
<div className="session_caract"> Nom<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
@ -5820,6 +6149,11 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_nom}
onChange={(e) => {
setp_detail_nom(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
@ -5836,7 +6170,11 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_prenom}
onChange={(e) => {
setp_detail_prenom(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
@ -5852,11 +6190,15 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_mail}
onChange={(e) => {
setp_detail_mail(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
<div className="session_caract"> Client<br />
{String(participant_data_edit_mode) !== "1" && <div className="session_caract"> Client<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
@ -5871,9 +6213,41 @@ function GestionAdministrative(props) {
value={p_detail_client_rattachement_nom}
/>
</div>
</div>}
<div className="session_caract"> Statut<br />
{String(participant_data_edit_mode) === "1" && <div className="session_caract"> Client <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_client_rattachement"
id="detail_client_rattachement"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_client_rattachement_nom}
onChange={(e) => {
setp_detail_client_rattachement_id(e.target.value);
setp_detail_client_rattachement_nom(e.target.value);
setparticipant_data_changed("1");
Dialog_1_handle_change_participant_session(" Attention, vous allez modifier le client de rattachement du participant");
}
}
>
{Get_List_Partner_Clients_result &&
Get_List_Partner_Clients_result.map((myclient) => (
<MenuItem key={JSON.parse(myclient)._id} value={JSON.parse(myclient)._id}
style={{ "paddingLeft": "5px", "textAlign": "left", }}>
{JSON.parse(myclient).nom}&nbsp;&nbsp;
</MenuItem>
))}
</TextField>
</div>}
{String(participant_data_edit_mode) !== "1" && <div className="session_caract"> Statut<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
@ -5888,7 +6262,33 @@ function GestionAdministrative(props) {
value={p_detail_status_inscrit_label}
/>
</div>
</div>}
{String(participant_data_edit_mode) === "1" && <div className="session_caract"> Statut<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_status_inscript"
id="detail_status_inscript"
select
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_status_inscrit}
onChange={(e) => {
setp_detail_status_inscrit(e.target.value);
setparticipant_data_changed("1");
}
}
>
<MenuItem value="1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }}>Inscrit &nbsp;&nbsp;</MenuItem>
<MenuItem value="0" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Preinscrit &nbsp;</MenuItem>
<MenuItem value="-1" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Annule &nbsp;</MenuItem>
</TextField>
</div>}
<div className="session_caract"> Téléphone <br />
<TextField
@ -5902,7 +6302,11 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_tel}
onChange={(e) => {
setp_detail_tel(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
@ -5919,7 +6323,11 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_adresse}
onChange={(e) => {
setp_detail_adresse(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
<div className="session_caract"> Code postal<br />
@ -5934,7 +6342,11 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_code_postal}
onChange={(e) => {
setp_detail_code_postal(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
<div className="session_caract"> Ville<br />
@ -5949,7 +6361,11 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_ville}
onChange={(e) => {
setp_detail_ville(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
@ -5981,10 +6397,34 @@ function GestionAdministrative(props) {
inputProps={{ min: "1", max: "999999", step: "1" }}
disabled={false}
className="disabled_style"
value={p_detail_cout}
onChange={(e) => {
setp_detail_cout(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
<div className="session_caract"> Opco <br />
<TextField sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_opco"
id="detail_opco"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_opco}
onChange={(e) => {
setp_detail_opco(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
<div className="session_caract"> Mode Financement<br />
<TextField
@ -5998,7 +6438,11 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_mode_fin}
onChange={(e) => {
setp_detail_mode_fin(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
@ -6015,7 +6459,11 @@ function GestionAdministrative(props) {
}}
disabled={false}
className="disabled_style"
value={p_detail_employeur}
onChange={(e) => {
setp_detail_employeur(e.target.value);
setparticipant_data_changed("1");
}}
/>
</div>
{is_lms_class_code && <div>
@ -6066,6 +6514,43 @@ function GestionAdministrative(props) {
</div>
</div>
</div>}
{String(participant_data_changed) === "1" && String(participant_data_edit_mode) === "1" && <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
/!\ Pensez à enregistrer les modifications
</div>}
<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
{String(participant_data_changed) === "1" && String(participant_data_edit_mode) === "1" && <div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="bton_envoyer" onClick={Update_One_StagiaireData}>Enregistrer les modifications
</Button>
</div>}
{String(participant_data_edit_mode) === "1" && <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }} onClick={AnnuleAttendeeDetailFields}>
<Button variant="contained" className="bton_fermer" onClick={AnnuleAttendeeDetailFields}>Annuler
</Button>
</div>}
</div>
{String(participant_data_edit_mode) !== "1" && <div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
&nbsp;
</div>
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
<Button variant="contained" className="bton_fermer" onClick={EnableAttendeeDetailFields}>Editer
</Button>
</div>
</div>}
<div className="div_row" style={{ "border": "None" }}>
<hr className="hr_break" />
</div>

View File

@ -259,7 +259,7 @@ function Inscription_Information(props) {
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysych');
form.append("class_internal_url", props.internal_url);
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
axios.post(myurl, form).then(res => {

View File

@ -159,6 +159,7 @@ const Partner = (props) => {
setapiexcelimportmessage(result['status']);
if (String(result['status']) === String("true")) {
sethandleSubmission_api("true");
alert(result['message']);
} else if (String(result['status']) === String("Err_Connexion")) {
alert('Erreur: ' + result['message']);
history.push("/Connexion");
@ -167,6 +168,7 @@ const Partner = (props) => {
else {
sethandleSubmission_api("false");
sethandleSubmission_message(result['message']);
alert(result['message']);
}
//alert("result['status'] " + result['status']);
})
@ -175,6 +177,7 @@ const Partner = (props) => {
setmyApiResponse("false");
setapiexcelimportmessage("-1");
sethandleSubmission_api("false");
alert(" Impossible d'importer/mettre à jour les formations");
});
};