12/10/2023 - 22h40
parent
476f21046a
commit
cf02e6782c
|
@ -1193,7 +1193,7 @@ const DisplayPartnerSession = (props) => {
|
|||
|
||||
formData.append("token", stored_cookie);
|
||||
//console.log("token = " + stored_cookie);
|
||||
|
||||
setLoading(true);
|
||||
fetch(
|
||||
process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation_mass_for_many_class/",
|
||||
{
|
||||
|
@ -1204,8 +1204,8 @@ const DisplayPartnerSession = (props) => {
|
|||
.then((response) => response.json())
|
||||
.then((result) => {
|
||||
|
||||
console.log(" ## result['status'] = ", result['status'])
|
||||
|
||||
//console.log(" ## result['status'] = ", result['status'])
|
||||
setLoading(false);
|
||||
if (String(result['status']) === String("Err_Connexion")) {
|
||||
alert('Erreur: ' + result['message']);
|
||||
history.push("/Connexion");
|
||||
|
@ -1232,6 +1232,7 @@ const DisplayPartnerSession = (props) => {
|
|||
|
||||
})
|
||||
.catch((error) => {
|
||||
setLoading(false);
|
||||
console.error('Error:', error);
|
||||
setliste_sessions_file_change_api("false");
|
||||
alert(" Impossible d'importer les sessions");
|
||||
|
@ -2210,8 +2211,6 @@ const DisplayPartnerSession = (props) => {
|
|||
setp_session_ondemande_label();
|
||||
setp_session_ondemande();
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -2256,6 +2255,29 @@ const DisplayPartnerSession = (props) => {
|
|||
setone_SessionstartDate();
|
||||
setone_urlpreview_certif();
|
||||
setone_field_contenu_ftion();
|
||||
setp_one_myclass_title();
|
||||
setp_one_code_session();
|
||||
setp_one_code_session_id();
|
||||
setp_one_adresse();
|
||||
setp_one_code_postal();
|
||||
setp_one_ville();
|
||||
setp_one_pays();
|
||||
setp_one_formateur();
|
||||
setp_one_lms_class_code();
|
||||
setp_one_nb_participant();
|
||||
setp_one_prix_session();
|
||||
setp_one_session_ondemande("0");
|
||||
setp_one_session_ondemande_label();
|
||||
setp_one_session_distance("0");
|
||||
setp_one_session_distance_label();
|
||||
setp_one_session_presentiel("0");
|
||||
setp_one_session_presentiel_label();
|
||||
setp_one_session_status();
|
||||
setp_one_session_status_label();
|
||||
setp_one_session_etape();
|
||||
setp_one_session_etape_label();
|
||||
|
||||
|
||||
}
|
||||
|
||||
const [is_lms_class_code, setis_lms_class_code] = useState();
|
||||
|
@ -2416,19 +2438,18 @@ const DisplayPartnerSession = (props) => {
|
|||
form.append("contenu_ftion", contenu_ftion);
|
||||
|
||||
|
||||
|
||||
//console.log(" ### CreateSessionFormation form = ", form);
|
||||
|
||||
//return;
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation/";
|
||||
|
||||
|
||||
setLoading(true);
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
//console.log(" In CreateSessionFormation res.data.status = " + res.data.status);
|
||||
//console.log(" In CreateSessionFormation res.data.message r_class = " + res.data.message);
|
||||
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
setCreateSessionFormation_api("true");
|
||||
setCreateSessionFormation_result(res.data.message);
|
||||
|
@ -2449,7 +2470,7 @@ const DisplayPartnerSession = (props) => {
|
|||
}
|
||||
|
||||
}).catch((error) => {
|
||||
|
||||
setLoading(false);
|
||||
console.warn('CreateSessionFormation : Not good man :( mysearchtext = ' + error);
|
||||
setCreateSessionFormation_api("false");
|
||||
alert(" Impossible de mettre à jour la session");
|
||||
|
@ -2608,19 +2629,26 @@ const DisplayPartnerSession = (props) => {
|
|||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_SessionFormation/";
|
||||
|
||||
|
||||
|
||||
setLoading(true);
|
||||
axios.post(myurl, form).then(res => {
|
||||
//console.log(" In One_CreateSessionFormation res.data.status = " + res.data.status);
|
||||
//console.log(" In One_CreateSessionFormation res.data.message r_class = " + res.data.message);
|
||||
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
setone_CreateSessionFormation_api("true");
|
||||
setone_CreateSessionFormation_result(res.data.message);
|
||||
setsessionChanged(false);
|
||||
Getall_TrainingSession();
|
||||
alert(res.data.message);
|
||||
|
||||
One_clearSessionFields();
|
||||
setaddOneSession();
|
||||
|
||||
setaddOneParticipant();
|
||||
setdisplay_detail_insc();
|
||||
setselected_code_session();
|
||||
setsubmenu();
|
||||
|
||||
alert(res.data.message);
|
||||
//GetCurrentSession(p_one_code_session, one_selected_internal_url);
|
||||
|
||||
} else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
|
@ -2634,7 +2662,7 @@ const DisplayPartnerSession = (props) => {
|
|||
}
|
||||
|
||||
}).catch((error) => {
|
||||
|
||||
setLoading(false);
|
||||
console.warn('One_CreateSessionFormation : Not good man :( = ' + error);
|
||||
setone_CreateSessionFormation_api("false");
|
||||
alert("Erreur : Impossible d'ajouter la session");
|
||||
|
|
|
@ -20,7 +20,10 @@ import participants from "../mysy_img/participants.png";
|
|||
import fileDownload from 'js-file-download'
|
||||
import Popup from 'reactjs-popup';
|
||||
import 'reactjs-popup/dist/index.css';
|
||||
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
|
||||
import {
|
||||
FcCancel, FcApproval, FcAcceptDatabase,
|
||||
FcPrint, FcDataConfiguration, FcDownload
|
||||
} from "react-icons/fc";
|
||||
import DatePicker from "react-datepicker";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
import { format } from 'date-fns'
|
||||
|
@ -127,6 +130,232 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
{ field: 'date_debut', headerName: 'Du', width: datagrid_columns_size_model1, hideable: true, },
|
||||
{ field: 'date_fin', headerName: 'Au', width: datagrid_columns_size_model1, hideable: true, },
|
||||
{ field: 'class_internal_url', headerName: 'class_internal_url', hide: true, },
|
||||
{
|
||||
field: 'Action', headerName: 'Action', hide: false, width: 200,
|
||||
renderCell: (cellValues) => {
|
||||
|
||||
return (
|
||||
<nav>
|
||||
{cellValues.row.status && String(cellValues.row.status) === "1" &&
|
||||
|
||||
<Popup
|
||||
trigger={<Button
|
||||
|
||||
>
|
||||
<FcCancel /> Annuler
|
||||
|
||||
</Button>}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, l'inscription du stagiaire sera <i><font color="red"> définitivement annulée</font></i>. <br />
|
||||
Il (le stagiaire) sera automatiquement <i><font color="red"> notifié par email de l'annulation de son inscription. </font></i> <br />
|
||||
<br /> Motif du annulation : <br />
|
||||
<textarea name='motif_refus' id="motif_refus" style={{ "width": "80%" }}
|
||||
rows="3" maxlength="180" />
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
handleClick_refuse(event, cellValues);
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup"
|
||||
onClick={() => {
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>
|
||||
|
||||
}
|
||||
|
||||
{cellValues.row.status && String(cellValues.row.status) === "0" &&
|
||||
<Popup
|
||||
trigger={<Button
|
||||
|
||||
|
||||
>
|
||||
<FcApproval /> Valider inscr.
|
||||
|
||||
</Button>}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, l'inscription du stagiaire sera définitivement validée. <br />
|
||||
Il (le stagiaire) sera automatiquement notifié par email de la validation de son inscription. <br />
|
||||
Le stagiaire passera de l'onglet "préinscrit" vers l'onglet "inscription".<br />
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
handleClick_accept(event, cellValues);
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup"
|
||||
onClick={() => {
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>
|
||||
}
|
||||
|
||||
{cellValues.row.status && String(cellValues.row.status) === "-1" &&
|
||||
|
||||
|
||||
<Popup
|
||||
trigger={<Button
|
||||
|
||||
>
|
||||
<FcDownload />
|
||||
Réinscrire
|
||||
|
||||
|
||||
</Button>}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, le stagaire sera réinscrit à la meme session <br />
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
//handleClick_accept(event, cellValues);
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup"
|
||||
onClick={() => {
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>
|
||||
|
||||
}
|
||||
|
||||
{cellValues.row.status && String(cellValues.row.status) === "2" &&
|
||||
<Popup
|
||||
trigger={<Button
|
||||
|
||||
|
||||
>
|
||||
<FcDataConfiguration /> Finaliser Préins.
|
||||
|
||||
</Button>}
|
||||
modal
|
||||
nested
|
||||
position="center center"
|
||||
>
|
||||
{close => (
|
||||
<div>
|
||||
<button className="gest_close" onClick={close}>
|
||||
×
|
||||
</button>
|
||||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
En confirmant cette opération, vous allez finaliser la préinscription du stagiaire. <br />
|
||||
<br />
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
<button className="gest_bton_popup" onClick={(event) => {
|
||||
//handleClick_accept(event, cellValues);
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}> Valider </button>
|
||||
|
||||
</div>
|
||||
<div style={{ "width": "45%", "float": "right" }}>
|
||||
<button
|
||||
className="gest_bton_popup"
|
||||
onClick={() => {
|
||||
//console.log('modal closed ');
|
||||
close();
|
||||
}}
|
||||
>
|
||||
Annuler
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</Popup>
|
||||
}
|
||||
|
||||
|
||||
|
||||
</nav>
|
||||
)
|
||||
|
||||
}
|
||||
},
|
||||
/* {
|
||||
field: "Detail", headerName: 'Voir detail',
|
||||
renderCell: (cellValues) => {
|
||||
|
@ -227,6 +456,128 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
]
|
||||
|
||||
function handleClick_refuse(event, cellValues) {
|
||||
// Recuperation du motif du refus :
|
||||
var motif_refus = document.getElementById("motif_refus").value;
|
||||
|
||||
|
||||
var email = cellValues.row.email;
|
||||
var inscription_id = cellValues.row._id;
|
||||
|
||||
|
||||
Refuse_Inscritpion_with_Motif(email, inscription_id, motif_refus);
|
||||
}
|
||||
|
||||
const [Refuse_Inscritpion_with_Motif_api, setRefuse_Inscritpion_with_Motif_api] = useState();
|
||||
const [Refuse_Inscritpion_with_Motif_message, setRefuse_Inscritpion_with_Motif_message] = useState();
|
||||
const [Refuse_Inscritpion_with_Motif_result, setRefuse_Inscritpion_with_Motif_result] = useState();
|
||||
function Refuse_Inscritpion_with_Motif(local_email, local_inscription_id, motif) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
|
||||
form.append("inscription_id", local_inscription_id);
|
||||
form.append("motif", motif);
|
||||
form.append("email", local_email);
|
||||
|
||||
setLoading(true);
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/RefuseAttendeeInscription_with_motif/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
setLoading(false);
|
||||
//console.log(" In UpdateStagiaireData res.data.status = " + res.data.status);
|
||||
//console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message);
|
||||
setRefuse_Inscritpion_with_Motif_api("true");
|
||||
setRefuse_Inscritpion_with_Motif_result(res.data.message);
|
||||
Getall_TrainingParticipant();
|
||||
alert(res.data.message);
|
||||
|
||||
|
||||
} else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
setLoading(false);
|
||||
alert('Erreur: ' + res.data.message);
|
||||
history.push("/Connexion");
|
||||
}
|
||||
else {
|
||||
setLoading(false);
|
||||
setRefuse_Inscritpion_with_Motif_api("false");
|
||||
setRefuse_Inscritpion_with_Motif_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Refuse_Inscritpion_with_Motif : Not good man :( mysearchtext = ' + error);
|
||||
setRefuse_Inscritpion_with_Motif_api("false");
|
||||
alert(" Impossible d'annuler l'inscription");
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function handleClick_accept(event, cellValues) {
|
||||
|
||||
var email = cellValues.row.email;
|
||||
var inscription_id = cellValues.row._id;
|
||||
|
||||
Accept_Inscritpion(email, inscription_id);
|
||||
}
|
||||
const [Accept_Inscritpion_api, setAccept_Inscritpion_api] = useState();
|
||||
const [Accept_Inscritpion_message, setAccept_Inscritpion_message] = useState();
|
||||
const [Accept_Inscritpion_result, setAccept_Inscritpion_result] = useState();
|
||||
function Accept_Inscritpion(local_email, local_inscription_id) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("inscription_id", local_inscription_id);
|
||||
form.append("email", local_email);
|
||||
|
||||
setLoading(true);
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/AcceptAttendeeInscription/";
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
setLoading(false);
|
||||
//console.log(" In UpdateStagiaireData res.data.status = " + res.data.status);
|
||||
//console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message);
|
||||
setAccept_Inscritpion_api("true");
|
||||
setAccept_Inscritpion_result(res.data.message);
|
||||
Getall_TrainingParticipant();
|
||||
alert(res.data.message);
|
||||
|
||||
|
||||
} else if (String(res.data.status) === String("Err_Connexion")) {
|
||||
setLoading(false);
|
||||
alert('Erreur: ' + res.data.message);
|
||||
history.push("/Connexion");
|
||||
}
|
||||
else {
|
||||
setLoading(false);
|
||||
setAccept_Inscritpion_api("false");
|
||||
setAccept_Inscritpion_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Accept_Inscritpion : Not good man :( mysearchtext = ' + error);
|
||||
setAccept_Inscritpion_api("false");
|
||||
alert(" Impossible de valider l'inscription");
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function handleClick_delete(event, cellValues) {
|
||||
// Recuperation du motif du refus :
|
||||
|
@ -240,6 +591,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
}
|
||||
|
||||
|
||||
|
||||
const [DeleteStagiaireData_api, setDeleteStagiaireData_api] = useState();
|
||||
const [DeleteStagiaireData_message, setDeleteStagiaireData_message] = useState();
|
||||
const [DeleteStagiaireData_result, setDeleteStagiaireData_result] = useState();
|
||||
|
@ -445,6 +797,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
var participant_email = line.email;
|
||||
setselected_participant_email(line.email);
|
||||
setselectedattendeeemail(line.email);
|
||||
|
||||
setselected_class_title(line.title);
|
||||
setselected_id(line._id);
|
||||
|
@ -904,7 +1257,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
var form = new FormData();
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("session_id", selected_code_session);
|
||||
form.append("session_id", selected_session_id);
|
||||
form.append("attendee_email", selectedattendeeemail);
|
||||
form.append("class_internal_url", selected_internal_url);
|
||||
|
||||
|
@ -1262,7 +1615,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("session_id", selected_session_id);
|
||||
form.append("attendee_email", selectedattendeeemail);
|
||||
form.append("attendee_email", selected_participant_email);
|
||||
form.append("class_internal_url", selected_internal_url);
|
||||
|
||||
|
||||
|
|
|
@ -313,11 +313,9 @@ const DistplayPartnerTraningsPage = (props) => {
|
|||
renderCell: (cellValues) => {
|
||||
return (
|
||||
<nav>
|
||||
|
||||
|
||||
|
||||
<Popup
|
||||
trigger={<Button style={{ "marginLeft": "auto", "marginRight": "auto", "cursor": "pointer" }}
|
||||
trigger={
|
||||
<Button style={{ "marginLeft": "auto", "marginRight": "auto", "cursor": "pointer" }}
|
||||
|
||||
onClick={(event) => {
|
||||
handlepush_to_lms(event, cellValues);
|
||||
|
|
Loading…
Reference in New Issue