- Pièces jointes
+ Pièces jointes
@@ -7636,39 +7889,8 @@ const DisplayPartnerSession = (props) => {
- {String(participant_data_changed) === "1" && String(participant_data_edit_mode) === "1" &&
- /!\ Pensez à enregistrer les modifications
-
-
-
- {String(participant_data_edit_mode) !== "1" &&
diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js
index 3875724..8ee3b0f 100644
--- a/src/components/DisplayPartnerStagiaires.js
+++ b/src/components/DisplayPartnerStagiaires.js
@@ -244,7 +244,7 @@ const DisplayPartnerStagiaires = (props) => {
}
- {cellValues.row.status && String(cellValues.row.status) === "-1" &&
+ {/*cellValues.row.status && String(cellValues.row.status) === "-1" &&
{
)}
- }
-
- {cellValues.row.status && String(cellValues.row.status) === "2" &&
-
- Finaliser Préins.
-
- }
- modal
- nested
- position="center center"
- >
- {close => (
-
-
-
MySy Information
-
- {' '}
-
- En confirmant cette opération, vous allez finaliser la préinscription du stagiaire.
-
-
-
-
-
-
-
-
-
-
-
-
- )}
-
- }
@@ -463,7 +414,7 @@ const DisplayPartnerStagiaires = (props) => {
var email = cellValues.row.email;
var inscription_id = cellValues.row._id;
-
+
Refuse_Inscritpion_with_Motif(email, inscription_id, motif_refus);
}
@@ -474,7 +425,7 @@ const DisplayPartnerStagiaires = (props) => {
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);
@@ -495,7 +446,7 @@ const DisplayPartnerStagiaires = (props) => {
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);
@@ -521,7 +472,7 @@ const DisplayPartnerStagiaires = (props) => {
-
+
function handleClick_accept(event, cellValues) {
var email = cellValues.row.email;
@@ -535,7 +486,7 @@ const DisplayPartnerStagiaires = (props) => {
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);
@@ -554,7 +505,7 @@ const DisplayPartnerStagiaires = (props) => {
setAccept_Inscritpion_result(res.data.message);
Getall_TrainingParticipant();
alert(res.data.message);
-
+
} else if (String(res.data.status) === String("Err_Connexion")) {
setLoading(false);
@@ -611,11 +562,11 @@ const DisplayPartnerStagiaires = (props) => {
var myurl = process.env.REACT_APP_API_URL + "myclass/api/DeleteAttendeeInscription/";
-
+ setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In DeleteStagiaireData res.data.status = " + res.data.status);
//console.log(" In DeleteStagiaireData res.data.message r_class = " + res.data.message);
-
+ setLoading(false);
if (String(res.data.status) === String("true")) {
setDeleteStagiaireData_api("true");
setDeleteStagiaireData_result(res.data.message);
@@ -632,7 +583,7 @@ const DisplayPartnerStagiaires = (props) => {
}
}).catch((error) => {
-
+ setLoading(false);
console.warn('DeleteStagiaireData : Not good man :( mysearchtext = ' + error);
setDeleteStagiaireData_api("false");
alert(" Impossible de supprimer le stagaire");
@@ -714,9 +665,10 @@ const DisplayPartnerStagiaires = (props) => {
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Statgaire_List_Partner_with_filter/";
-
+ setLoading(true);
axios.post(myurl, form).then(res => {
+ setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_TrainingParticipant res.data.status = " + res.data.status);
//console.log(" In Getall_TrainingParticipant res.data.message r_class = " + res.data.message);
@@ -731,6 +683,7 @@ const DisplayPartnerStagiaires = (props) => {
}
}).catch((error) => {
+ setLoading(false);
console.warn('Not good man :( Getall_TrainingParticipant = ', error);
setGetall_TrainingParticipant_api("false");
alert(" Impossible de recuperer la liste des stagiaires")
@@ -751,9 +704,9 @@ const DisplayPartnerStagiaires = (props) => {
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Statgaire_List_Partner_with_filter/";
-
+ setLoading(true);
axios.post(myurl, form).then(res => {
-
+ setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_TrainingParticipant res.data.status = " + res.data.status);
//console.log(" In Getall_TrainingParticipant res.data.message r_class = " + res.data.message);
@@ -767,6 +720,7 @@ const DisplayPartnerStagiaires = (props) => {
}
}).catch((error) => {
+ setLoading(false);
console.warn('Not good man :( Getall_TrainingParticipant = ', error);
setGetall_TrainingParticipant_api("false");
//setmyApimyApiMessage("")
@@ -780,6 +734,7 @@ const DisplayPartnerStagiaires = (props) => {
function handleClick_edit_session_From_Line(selected_row_id) {
+
var line = JSON.parse(rowss[selected_row_id]);
@@ -1153,6 +1108,7 @@ const DisplayPartnerStagiaires = (props) => {
formData.append("email", local_mail);
formData.append("class_internal_url", selected_internal_url);
//console.log("token = " + stored_cookie);
+ setLoading(true);
fetch(
process.env.REACT_APP_API_URL + "myclass/api/LMS_Credential_Sending_mail/",
@@ -1163,6 +1119,7 @@ const DisplayPartnerStagiaires = (props) => {
)
.then((response) => response.json())
.then((result) => {
+ setLoading(false);
if (String(result['status']) === String("true")) {
//console.log('Success:', result['message']);
setResend_LMS_Credentials_result(result['message']);
@@ -1180,6 +1137,7 @@ const DisplayPartnerStagiaires = (props) => {
})
.catch((error) => {
+ setLoading(false);
console.error('Error:', error);
setResend_LMS_Credentials_api("false");
});
@@ -1379,7 +1337,7 @@ const DisplayPartnerStagiaires = (props) => {
function AnnuleAttendeeDetailFields() {
- GetAttendee_Data(selected_participant_email, selected_code_session, selected_internal_url);
+ GetAttendee_Data(selected_participant_email, selected_session_id, selected_internal_url);
disableAttendeeDetailFields();
setparticipant_data_changed();
setparticipant_data_edit_mode();
@@ -1953,7 +1911,10 @@ const DisplayPartnerStagiaires = (props) => {
setdatagrid_columns_size_model2(10);
}
-
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
}, [])
@@ -2054,6 +2015,7 @@ const DisplayPartnerStagiaires = (props) => {
setparticipant_data_changed();
setparticipant_data_edit_mode();
clean_old_messages();
+ clearDetailAttendeFields();
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
@@ -2063,8 +2025,9 @@ const DisplayPartnerStagiaires = (props) => {
form.append("internal_url", internal_url);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAttendeeDetail_perSession/";
-
+ setLoading(true);
axios.post(myurl, form).then(res => {
+ setLoading(false);
if (String(res.data.status) === "true") {
//console.log(" In GetAttendee res.data.status = " + res.data.status);
@@ -2075,7 +2038,6 @@ const DisplayPartnerStagiaires = (props) => {
if (res.data.message) {
var mylocalattendee = JSON.parse(res.data.message);
-
if (mylocalattendee.inscription_validation_date) {
var date_du = new Date(moment(mylocalattendee.inscription_validation_date, "DD/MM/YYYY HH:mm:ss"));
setdetailuser_date_inscription(date_du);
@@ -2228,6 +2190,7 @@ const DisplayPartnerStagiaires = (props) => {
}
} else if (String(res.data.status) === String("Err_Connexion")) {
+
alert('Erreur: ' + res.data.message);
history.push("/Connexion");
}
@@ -2239,6 +2202,7 @@ const DisplayPartnerStagiaires = (props) => {
}
}).catch((error) => {
+ setLoading(false);
console.warn('Not good man :( GetAttendee = ', error);
setGetAttendee_api("false");
alert(" Impossible de recuperer les données du participant");
@@ -2421,12 +2385,12 @@ const DisplayPartnerStagiaires = (props) => {
//console.log(" #### form = ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/AddStagiairetoClass/";
-
+ setLoading(true);
axios.post(myurl, form).then(res => {
//console.log(" In One_Create_Participant res.data.status = " + res.data.status);
//console.log(" In One_Create_Participant res.data.message r_class = " + res.data.message);
-
+ setLoading(false);
if (String(res.data.status) === String("true")) {
setOne_Create_Participant_api("true");
setOne_Create_Participant_result(res.data.message);
@@ -2457,6 +2421,7 @@ const DisplayPartnerStagiaires = (props) => {
}).catch((error) => {
+ setLoading(false);
console.warn('One_Create_Participant : Not good man :( = ' + error);
setOne_Create_Participant_api("false");
alert(" Impossible d'ajouter le participant")
@@ -2517,11 +2482,12 @@ const DisplayPartnerStagiaires = (props) => {
//console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/UpdateStagiairetoClass/";
-
+ setLoading(true);
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);
+ //console.log(" In UpdateStagiaireData res.data.status = " + res.data.status);
+ //console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message);
+ setLoading(false);
if (String(res.data.status) === String("true")) {
setUpdateStagiaireData_api("true");
setUpdateStagiaireData_result(res.data.message);
@@ -2552,7 +2518,7 @@ const DisplayPartnerStagiaires = (props) => {
}
}).catch((error) => {
-
+ setLoading(false);
console.warn('UpdateStagiaireData : Not good man :( mysearchtext = ' + error);
setUpdateStagiaireData_api("false");
alert(" Impossible de mettre à jour le participant");
@@ -2635,9 +2601,9 @@ const DisplayPartnerStagiaires = (props) => {
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_partner_class/";
-
+ setLoading(true);
axios.post(myurl, form).then(res => {
-
+ setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In GetCurrentPartnerClass res.data.status = " + res.data.status);
//console.log(" In GetCurrentPartnerClass res.data.message r_class = " + res.data.message);
@@ -2655,6 +2621,7 @@ const DisplayPartnerStagiaires = (props) => {
}
}).catch((error) => {
+ setLoading(false);
console.warn('Not good man :( mysearchtext = ', error);
setGetCurrentPartnerClass_api("false");
//setmyApimyApiMessage("")
@@ -2820,10 +2787,11 @@ const DisplayPartnerStagiaires = (props) => {
form.append("session_id", local_session_id);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetSessionFormation/";
-
+ setLoading(true);
axios.post(myurl, form).then(res => {
if (String(res.data.status) === "true") {
+ setLoading(false);
//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);
@@ -2991,17 +2959,20 @@ const DisplayPartnerStagiaires = (props) => {
}
} else if (String(res.data.status) === String("Err_Connexion")) {
+ setLoading(false);
alert('Erreur: ' + res.data.message);
history.push("/Connexion");
}
else {
+ setLoading(false);
setGetCurrentSession_api("false");
setGetCurrentSession_message(res.data.message);
alert("Erreur : " + res.data.message);
}
}).catch((error) => {
+ setLoading(false);
console.warn('Not good man :( GetCurrentSession = ', error);
setGetCurrentSession_api("false");
@@ -3135,12 +3106,14 @@ const DisplayPartnerStagiaires = (props) => {
var url = process.env.REACT_APP_API_URL + "myclass/api/Get_Stored_Downloaded_File/" + token + "/" + file_name;
-
+ setLoading(true);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
+ setLoading(false);
fileDownload(res.data, nom_fiche_detaillee);
setDownload_one_attached_document_api("true");
}).catch((error) => {
+ setLoading(false);
console.error('Error:', error);
setDownload_one_attached_document_api("false");
@@ -3304,7 +3277,7 @@ const DisplayPartnerStagiaires = (props) => {
//formData.append("class_internal_url", internal_url);
//console.log("token = " + stored_cookie);
-
+ setLoading(true);
fetch(
process.env.REACT_APP_API_URL + "myclass/api/Store_User_Downloaded_File/",
{
@@ -3315,6 +3288,7 @@ const DisplayPartnerStagiaires = (props) => {
.then((response) => response.json())
.then((result) => {
+ setLoading(false);
//console.log(" ## result['status'] = ", result['status'])
if (String(result['status']) === String("true")) {
//console.log('Success:', result['message']);
@@ -3335,6 +3309,7 @@ const DisplayPartnerStagiaires = (props) => {
})
.catch((error) => {
+ setLoading(false);
console.error(' Record_All_PJ Error:', error);
setRecord_All_PJ_api("false");
});
@@ -3365,7 +3340,7 @@ const DisplayPartnerStagiaires = (props) => {
var url = process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/";
-
+ setLoading(true);
fetch(
process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/",
{
@@ -3375,7 +3350,7 @@ const DisplayPartnerStagiaires = (props) => {
)
.then((response) => response.json())
.then((result) => {
-
+ setLoading(false);
//console.log(" ## result['status'] = ", result['status'])
if (String(result['status']) === String("true")) {
//console.log('Success:', result['message']);
@@ -3392,6 +3367,7 @@ const DisplayPartnerStagiaires = (props) => {
})
.catch((error) => {
+ setLoading(false);
console.error(' Record_All_PJ Error:', error);
setDelete_one_attached_document_api("false");
alert(" Impossible de supprimer le document")
@@ -3419,7 +3395,7 @@ const DisplayPartnerStagiaires = (props) => {
//formData.append("class_internal_url", internal_url);
//console.log("token = " + stored_cookie);
-
+ setLoading(true);
fetch(
process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files/",
@@ -3430,6 +3406,7 @@ const DisplayPartnerStagiaires = (props) => {
)
.then((response) => response.json())
.then((result) => {
+ setLoading(false);
//console.log(" ## result['status'] = ", result['status'])
if (String(result['status']) === String("true")) {
@@ -3445,6 +3422,7 @@ const DisplayPartnerStagiaires = (props) => {
})
.catch((error) => {
+ setLoading(false);
console.error(' Get_List_Of_All_PJ Error:', error);
setGet_List_Of_All_PJ_api("false");
});
@@ -3465,6 +3443,110 @@ const DisplayPartnerStagiaires = (props) => {
// -- end gestion pièces jointes
+ // Action en mass
+
+ const [actionmass_ftion_val, setactionmass_ftion_val] = useState();
+ const actionmass_ftion = (event) => {
+ const value = event.target.value;
+
+
+ if (String(value) === "supprimer" || String(value) === "depublier" || String(value) === "desactiver") {
+ setactionmass_ftion_val(value);
+ }
+ else {
+ setactionmass_ftion_val();
+ }
+ }
+
+ async function actionmass_ftion_Traitemet() {
+
+
+ var liste_session = GetSelectedRowsSession();
+
+ //console.log(" liste_formation = ", liste_formation);
+ //console.log(" actionmass_ftion_val = ", actionmass_ftion_val);
+
+ if (String(actionmass_ftion_val) === String("supprimer")) {
+ console.log(" ### liste session : ", liste_session)
+ Delete_LIST_Stagiaires(liste_session);
+
+ }
+
+ else if (String(actionmass_ftion_val) === String("publier")) {
+
+ }
+
+ else if (String(actionmass_ftion_val) === String("desactiver")) {
+
+ }
+
+ }
+
+ const [selectedtraining, setselectedtraining] = useState([])
+ function GetSelectedRowsSession() {
+ ///alert(" les lignes slected sont : " + selectionModel + " nb item = " + selectionModel.length);
+ //const selectedRowsData = selectionModel.map((id) => rowss.find((row) => row.id === id));
+ //console.log(rowss[0]);
+ var tab_tmp = []
+ for (var i = 0; i < selectionModel.length; i++) {
+ var myid = parseInt(String(selectionModel[i]));
+ var line = JSON.parse(rowss[myid]);
+ tab_tmp.push(line._id);
+ //console.log(rowss[myid]['external_code']);
+ }
+ setselectedtraining(tab_tmp);
+ return tab_tmp;
+
+ }
+
+ const [Delete_LIST_Stagiaires_api, setDelete_LIST_Stagiaires_api] = useState();
+ const [Delete_LIST_Stagiaires_message, setDelete_LIST_Stagiaires_message] = useState();
+ const [Delete_LIST_Stagiaires_result, setDelete_LIST_Stagiaires_result] = useState();
+ function Delete_LIST_Stagiaires(local_liste_class) {
+
+
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+
+ // console.log(" #### local_liste_class = ", local_liste_class)
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("list_inscription_id", local_liste_class);
+
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_List_AttendeeInscription/";
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Delete_LIST_Stagiaires res.data.status = " + res.data.status);
+ //console.log(" In Delete_LIST_Stagiaires res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ setDelete_LIST_Stagiaires_api("true");
+ setDelete_LIST_Stagiaires_result(res.data.message);
+ setSelectionModel([]);
+ Getall_TrainingParticipant();
+ alert(res.data.message);
+ }
+ else {
+ setDelete_LIST_Stagiaires_api("false");
+ setDelete_LIST_Stagiaires_message(res.data.message);
+ alert(res.data.message);
+
+ }
+
+ }).catch((error) => {
+
+ console.warn('Delete_LIST_Stagiaires : Not good man :( mysearchtext = ' + error);
+ setDelete_LIST_Stagiaires_api("false");
+ alert(" Impossible de supprimer la liste des stagiaires");
+ })
+ }
+
+ // -- end action en mass
+
+
return (
{isLoading &&
@@ -3965,6 +4047,83 @@ const DisplayPartnerStagiaires = (props) => {
+
+
+ {selectionModel && selectionModel.length > 1 &&
+
+
+
+
+
+
+
+ {actionmass_ftion_val &&
+ }
+
+
}
+
+
+
@@ -4820,6 +4979,37 @@ const DisplayPartnerStagiaires = (props) => {
/>