diff --git a/src/components/Formation - Copie.js b/src/components/Formation - Copie.js
index 2dce705..6e937ce 100644
--- a/src/components/Formation - Copie.js
+++ b/src/components/Formation - Copie.js
@@ -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 => {
diff --git a/src/components/Formation.js b/src/components/Formation.js
index c6c7845..637945e 100644
--- a/src/components/Formation.js
+++ b/src/components/Formation.js
@@ -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 => {
diff --git a/src/components/Formation_Cartouche_Com.js b/src/components/Formation_Cartouche_Com.js
index 8913d96..a76cc23 100644
--- a/src/components/Formation_Cartouche_Com.js
+++ b/src/components/Formation_Cartouche_Com.js
@@ -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 => {
diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js
index 02bd1cc..00f0b76 100644
--- a/src/components/GestionAdministrative.js
+++ b/src/components/GestionAdministrative.js
@@ -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 (
+
Partenaires editeurs formations
@@ -4578,9 +4818,46 @@ function GestionAdministrative(props) {
{String(addOneSession) !== "1" &&
+ {/*---
+ Choisir une session v 2
+
+ {GetCurrentClass_trainingsession_result &&
+ GetCurrentClass_trainingsession_result.map((session) => (
+
+ ))}
+
+ ---*/}
Choisir une session
-
-
Client
+ {String(participant_data_edit_mode) !== "1" &&
Client
-
+
}
-
Statut
+ {String(participant_data_edit_mode) === "1" &&
Client
+ {
+ 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) => (
+
+ ))}
+
+
}
+
+ {String(participant_data_edit_mode) !== "1" &&
Statut
-
+
}
+
+ {String(participant_data_edit_mode) === "1" &&
Statut
+ {
+ setp_detail_status_inscrit(e.target.value);
+ setparticipant_data_changed("1");
+ }
+ }
+
+ >
+
+
+
+
+
}
Téléphone
{
+ setp_detail_tel(e.target.value);
+ setparticipant_data_changed("1");
+ }}
/>
@@ -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");
+ }}
/>
Code postal
@@ -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");
+ }}
/>
Ville
@@ -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");
+ }}
/>
@@ -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");
+ }}
/>
+
Opco
+ {
+ setp_detail_opco(e.target.value);
+ setparticipant_data_changed("1");
+ }}
+ />
+
Mode Financement
{
+ setp_detail_mode_fin(e.target.value);
+ setparticipant_data_changed("1");
+ }}
/>
@@ -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");
+ }}
/>
@@ -6066,6 +6514,43 @@ function GestionAdministrative(props) {