diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js
index 9f07e82..3897c18 100644
--- a/src/components/DisplayPartnerStagiaires.js
+++ b/src/components/DisplayPartnerStagiaires.js
@@ -2810,7 +2810,7 @@ const DisplayPartnerStagiaires = (props) => {
setdisplay_detail_ue();
setdisplay_detail_stages("");
setdisplay_stage("")
- setdisplay_detail_historique();
+ setdisplay_detail_historique("");
desableSessionFields();
submenu_color_management("sessions");
}
@@ -3251,7 +3251,7 @@ const DisplayPartnerStagiaires = (props) => {
}
function submenu_color_management(current_menu) {
- const list_sous_menu = ['detail_inscrit', 'ue', 'notes', 'stages', 'historique', 'piece_jointe']
+ const list_sous_menu = ['detail_inscrit', 'ue', 'notes', 'stages', 'historique', 'piece_jointe', 'absence']
for (let i = 0; i < list_sous_menu.length; i++) {
@@ -3966,7 +3966,7 @@ const DisplayPartnerStagiaires = (props) => {
if (String(res.data.status) === String("true")) {
//console.log(" In Get_Inscrit_Notes_Of_Evaluations res.data.status = " + res.data.status);
- console.log(" In Get_Inscrit_Notes_Of_Evaluations res.data.message r_class = " + res.data.message);
+ // console.log(" In Get_Inscrit_Notes_Of_Evaluations res.data.message r_class = " + res.data.message);
setGet_Inscrit_Notes_Of_Evaluations_api("true");
setGet_Inscrit_Notes_Of_Evaluations_result(res.data.message);
}
@@ -13841,8 +13841,8 @@ const DisplayPartnerStagiaires = (props) => {
- {/*
- */}
+ {/* */}
+
{selected_class_is_ftion_initiale == "1" && String(addOneParticipant) !== "1" && }
@@ -13850,6 +13850,7 @@ const DisplayPartnerStagiaires = (props) => {
{String(addOneParticipant) !== "1" && }
+
{selected_class_is_ftion_initiale == "1" && String(addOneParticipant) !== "1" && }
@@ -17864,7 +17865,7 @@ const DisplayPartnerStagiaires = (props) => {
- {/*}
+ {/*}
@@ -17881,7 +17882,7 @@ const DisplayPartnerStagiaires = (props) => {
width: '100%',
paddingRight: '1px',
-
+
"& .MuiDataGrid-columnHeaders": {
backgroundColor: "#dfe8f2",
color: "#0a2a4d",
@@ -17981,9 +17982,9 @@ const DisplayPartnerStagiaires = (props) => {
}}
getRowClassName={(params) => {
-
- if (parseInt(String(params.row.id)) % 2 === 0) {
+
+ if (parseInt(String(params.row.id)) % 2 === 0) {
return 'line--statut--pair';
}
else if (parseInt(String(params.row.id)) % 2 !== 0) {
@@ -18019,7 +18020,7 @@ const DisplayPartnerStagiaires = (props) => {
height: 500,
width: '100%',
paddingRight: '1px',
-
+
"& .MuiDataGrid-columnHeaders": {
backgroundColor: "#dfe8f2",
color: "#0a2a4d",
@@ -18160,6 +18161,19 @@ const DisplayPartnerStagiaires = (props) => {
+ {String(submenu) === "absence" && String(addOneParticipant) !== "1" && selected_id &&
+
+
}
+
+
diff --git a/src/components/Module_Absence.js b/src/components/Module_Absence.js
index 4f22d99..439ba12 100644
--- a/src/components/Module_Absence.js
+++ b/src/components/Module_Absence.js
@@ -86,6 +86,8 @@ const Module_Absence = (props) => {
const classes = useStyles();
const attendee_email = props.attendee_email;
+ const caller_session_id = props.session_id;
+
const [selected_employee_id, setselected_employee_id] = useState(props.conntected_employee_id);
const [selected_attendee_email, setselected_attendee_email] = useState(props.attendee_email);
@@ -257,8 +259,14 @@ const Module_Absence = (props) => {
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
- form.append("related_collection", props.related_collection);
- form.append("related_collection_email", attendee_email);
+
+ if (props.origin === "apprenant") {
+ form.append("related_collection", props.related_collection);
+ form.append("related_collection_email", attendee_email);
+ }
+ else if (props.origin === "inscription") {
+ form.append("inscription_id", props.inscription_id);
+ }
@@ -268,7 +276,7 @@ const Module_Absence = (props) => {
axios.post(myurl, form).then(res => {
//console.log(" In Get_Connected_User_List_Agenda_Events res.data.status = " + res.data.status);
- console.log(" In Get_Connected_User_List_Agenda_Events res.data.message r_class = " + res.data.message);
+ // console.log(" In Get_Connected_User_List_Agenda_Events res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
@@ -885,7 +893,7 @@ const Module_Absence = (props) => {
//Getall_Training_Employee_No_Filter();
//Getall_Training_Materiel_No_Filter();
- }, [attendee_email])
+ }, [caller_session_id])
const [local_heure_non_justifie, setlocal_heure_non_justifie] = useState();
@@ -901,10 +909,14 @@ const Module_Absence = (props) => {
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
- form.append("related_collection", props.related_collection);
- form.append("related_collection_email", attendee_email);
-
+ if (props.origin === "apprenant") {
+ form.append("related_collection", props.related_collection);
+ form.append("related_collection_email", attendee_email);
+ }
+ else if (props.origin === "inscription") {
+ form.append("inscription_id", props.inscription_id);
+ }
var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_Agenda_Event_List_Stagiaire_Total_Nb_Heure/";
@@ -947,7 +959,7 @@ const Module_Absence = (props) => {
const [p_detail_event_id, setp_detail_event_id] = useState();
const [p_detail_title, setp_detail_title] = useState();
- const [p_detail_session_id, setp_detail_session_id] = useState("");
+ const [p_detail_session_id, setp_detail_session_id] = useState(props.session_id);
const [p_detail_start, setp_detail_start] = useState();
const [p_detail_end, setp_detail_end] = useState();
@@ -1003,6 +1015,7 @@ const Module_Absence = (props) => {
form.append("_id", p_detail_event_id);
form.append("inscription_id", props.inscription_id);
form.append("apprenant_id", props.apprenant_id);
+ form.append("inscription_id", props.inscription_id);
form.append("related_collection", props.related_collection);
form.append("event_title", new_title);
@@ -1031,7 +1044,11 @@ const Module_Absence = (props) => {
setUpdate_One_Agenda_Event_api("true");
setUpdate_One_Agenda_Event_result(res.data.message);
- Get_List_Agenda_Events_For_Given_User(selected_attendee_email);
+
+ Get_Connected_User_List_Agenda_Events();
+ Get_ENT_Apprenant_Total_Heure();
+
+
setp_detail_event_id();
setp_detail_title("");
@@ -1071,6 +1088,140 @@ const Module_Absence = (props) => {
}
+ const [Create_Agenda_Absence_Event_api, setCreate_Agenda_Absence_Event_api] = useState();
+ const [Create_Agenda_Absence_Event_message, setCreate_Agenda_Absence_Event_message] = useState();
+ const [Create_Agenda_Absence_Event_result, setCreate_Agenda_Absence_Event_result] = useState();
+ const Create_Agenda_Absence_Event = event => {
+
+
+ var local_related_collection = p_filtre1;
+
+ if (String(props.session_id).length < 2) {
+ // alert(" Vous devez un stagiaire");
+ setdisplay_alert_mysy("1");
+ setalert_message(" La promotion est invalide ");
+ setalert_type("error");
+ return;
+ }
+
+ if (String(props.inscription_id).length < 2) {
+ // alert(" Vous devez un stagiaire");
+ setdisplay_alert_mysy("1");
+ setalert_message(" L'inscription est invalide ");
+ setalert_type("error");
+ return;
+ }
+
+
+ if (String(selected_attendee_email).length < 2) {
+ // alert(" Vous devez un stagiaire");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez choisir un stagiaire");
+ setalert_type("error");
+ return;
+ }
+
+ if (moment(endDate) <= moment(startDate)) {
+ //alert(" Les dates de début et de fin sont incohérentes");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Les dates de début et de fin sont incohérentes");
+ setalert_type("error");
+ return;
+ }
+ var new_title = p_detail_title;
+ var new_start_date = moment(startDate).format("DD/MM/YYYY HH:mm");
+ var new_end_date = moment(endDate).format("DD/MM/YYYY HH:mm");
+ var event_id = p_detail_event_id
+
+ // console.log(" ### new event = ", new_title, " -- ", new_start_date, " --- ", new_end_date, " : setp_detail_event_id = ", p_detail_event_id);
+
+ // console.log(" ### new event = ", new_title, " -- ", startDate, " --- ", endDate, " : setp_detail_event_id = ", p_detail_event_id);
+
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ form.append("tab_inscrit_ids", props.inscription_id);
+
+ form.append("start_date", new_start_date);
+ form.append("end_date", new_end_date);
+ form.append("sequence_id", "");
+ form.append("comment", p_detail_comment);
+
+ // form.append("event_type", p_detail_event_type);
+ form.append("justified", p_detail_justified);
+ form.append("session_id", props.session_id);
+
+ var myurl = "";
+
+ if (p_detail_event_id && p_detail_event_id.length > 5) {
+ form.append("_id", p_detail_event_id);
+ } else {
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/Create_Inscrit_Absence_By_Plage_Of_Date_OR_Sequence_Id/";
+ }
+
+ //console.log(" form == ", form);
+
+
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Create_Agenda_Absence_Event res.data.status = " + res.data.status);
+ //console.log(" In Create_Agenda_Absence_Event res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ setCreate_Agenda_Absence_Event_api("true");
+ setCreate_Agenda_Absence_Event_result(res.data.message);
+
+ Get_Connected_User_List_Agenda_Events();
+
+ Get_ENT_Apprenant_Total_Heure();
+
+ setp_detail_event_id();
+ setp_detail_title("");
+ setp_detail_start("");
+ setp_detail_session_id("")
+ setp_detail_end();
+ setp_detail_comment();
+ setp_detail_justified(false);
+ setp_detail_event_type();
+
+
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+ Close_Dialog_Detail_Event_open();
+
+ }
+ else {
+ setCreate_Agenda_Absence_Event_api("false");
+ setCreate_Agenda_Absence_Event_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+
+
+ setLoading(false);
+ console.warn('UpdateStagiaireData : Not good man :( Create_Agenda_Absence_Event = ' + error);
+ setCreate_Agenda_Absence_Event_api("false");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Impossible d'ajouter ou mettre à jour l'événement ");
+ setalert_type("error");
+
+ })
+ }
+
+
const [Delete_One_Agenda_Event_api, setDelete_One_Agenda_Event_api] = useState();
const [Delete_One_Agenda_Event_message, setDelete_One_Agenda_Event_message] = useState();
const [Delete_One_Agenda_Event_result, setDelete_One_Agenda_Event_result] = useState();
@@ -1102,7 +1253,10 @@ const Module_Absence = (props) => {
setDelete_One_Agenda_Event_api("true");
setDelete_One_Agenda_Event_result(res.data.message);
- Get_List_Agenda_Events();
+ Get_Connected_User_List_Agenda_Events();
+
+ Getall_Partner_Session_Reduice_Fields();
+ Get_ENT_Apprenant_Total_Heure();
setp_detail_event_id();
setp_detail_title();
@@ -1226,7 +1380,7 @@ const Module_Absence = (props) => {
>
-
MySy Information
+
Absence
{Dialog_1_message}
@@ -1243,8 +1397,9 @@ const Module_Absence = (props) => {
name="event_dialog_type"
id="event_dialog_type"
+ disabled={true}
+ value="Absence"
- select
fullWidth
value={p_detail_event_type}
@@ -1258,9 +1413,6 @@ const Module_Absence = (props) => {
}
>
-
-
-
@@ -1292,7 +1444,7 @@ const Module_Absence = (props) => {
- Titre
+ {/*
Titre
{
/>
-
-
*/}
+ {/*
+ */}
-
-
-
@@ -1509,15 +1610,32 @@ const Module_Absence = (props) => {
}
{String(props.write_access) === "1" &&
- {p_detail_event_id && String(p_detail_event_id) !== "" && }
- {(!p_detail_event_id || String(p_detail_event_id) === "") && }
+ {p_detail_event_id && String(p_detail_event_id) !== "" && }
+ {(!p_detail_event_id || String(p_detail_event_id) === "") && }
}
-