diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index e8b6fdf..ce360fb 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -7397,6 +7397,32 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair } + function submenu_add_one_tuteur() { + setDialog_tuteur_1_open(true); + } + + + + const [Dialog_tuteur_1_message, setDialog_tuteur_1_message] = React.useState(false); + const [Dialog_tuteur_1_open, setDialog_tuteur_1_open] = React.useState(false); + + + + function Dialog_1_handle_change_tuteur(message) { + setDialog_tuteur_1_message(message); + setDialog_tuteur_1_open(true); + } + + const Dialog_tuteur_1_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_tuteur_1_handleClose_buton = () => { + setDialog_tuteur_1_open(false); + }; + + return (
@@ -7857,6 +7883,49 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair + + + + + + Ajout ressource + + + {Dialog_tuteur_1_message} + + + + + + + + + + + + +
+
+ + {String(Add_One_Sequence_Session_mass) !== "1" && } + + {String(Add_One_Sequence_Session_mass) === "1" && } +
+ +
+ +
+
+ +
+ +

Vos sessions de formation

@@ -10040,7 +10109,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair Création automatique diff --git a/src/components/Module_Absence.js b/src/components/Module_Absence.js index fff6b52..eec7061 100644 --- a/src/components/Module_Absence.js +++ b/src/components/Module_Absence.js @@ -438,7 +438,6 @@ const Module_Absence = (props) => { - const [GetAttendee_api, setGetAttendee_api] = useState(); const [GetAttendee_message, setGetAttendee_message] = useState(); const [GetAttendee_result, setGetAttendee_result] = useState(); @@ -719,10 +718,67 @@ const Module_Absence = (props) => { } + +const [Partner_Debut_Journee, setPartner_Debut_Journee] = useState("7:00"); +const [Partner_Fin_Journee, setPartner_Fin_Journee] = useState("20:00"); + + +const [Get_Partner_Debut_Fin_Journee_api, setGet_Partner_Debut_Fin_Journee_api] = useState(); + const [Get_Partner_Debut_Fin_Journee_message, setGet_Partner_Debut_Fin_Journee_message] = useState(); + const [Get_Partner_Debut_Fin_Journee_result, setGet_Partner_Debut_Fin_Journee_result] = useState(); + function Get_Partner_Debut_Fin_Journee(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + form.append("token", stored_cookie); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Default_Debut_Fin_journee_Modele_Journee/"; + + setLoading(true); + + axios.post(myurl, form).then(res => { + //console.log(" In Get_Partner_Debut_Fin_Journee res.data.status = " + res.data.status); + //console.log(" In Get_Partner_Debut_Fin_Journee res.data.message r_class = " + res.data.message); + + setLoading(false); + if (String(res.data.status) === String("true")) { + setGet_Partner_Debut_Fin_Journee_api("true"); + setGet_Partner_Debut_Fin_Journee_result(res.data.message); + + + var val_json = JSON.parse(res.data.message); + + if (JSON.parse(res.data.message).planning_debut_journee) + setPartner_Debut_Journee(String(JSON.parse(res.data.message).planning_debut_journee)) + + if (JSON.parse(res.data.message).planning_fin_journee) + setPartner_Fin_Journee(String(JSON.parse(res.data.message).planning_fin_journee)) + + + } + else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setGet_Partner_Debut_Fin_Journee_api("false"); + setGet_Partner_Debut_Fin_Journee_message(res.data.message); + } + + }).catch((error) => { + + setLoading(false); + console.warn('Not good man :( Get_Partner_Debut_Fin_Journee = ', error); + setGet_Partner_Debut_Fin_Journee_api("false"); + //setmyApimyApiMessage("") + }) + } useEffect(() => { Get_Connected_User_List_Agenda_Events(); + Get_Partner_Debut_Fin_Journee(); //Getall_Training_Employee_No_Filter(); //Getall_Training_Materiel_No_Filter(); @@ -1284,8 +1340,8 @@ const Module_Absence = (props) => { //plugins={[timeGridPlugin]} plugins={[timeGridPlugin, daygridPlugin, interactionPlugin]} views={["dayGridMonth", "dayGridWeek", "dayGridDay"]} - slotMinTime="07:00" - slotMaxTime="20:00" + slotMinTime={Partner_Debut_Journee} + slotMaxTime={Partner_Fin_Journee} scrollTime='08:00' displayEventEnd={true} eventContent={renderEventContent} diff --git a/src/components/Module_Agenda.js b/src/components/Module_Agenda.js index aa120b9..edd916f 100644 --- a/src/components/Module_Agenda.js +++ b/src/components/Module_Agenda.js @@ -131,8 +131,8 @@ const Module_Agenda = (props) => { 'id': String(JSON.parse(obj)._id), 'comment': String(local_comment), 'sequence_session_id': String(local_sequence_session_id), - 'backgroundColor':bg_color, - + 'backgroundColor': bg_color, + } @@ -214,8 +214,8 @@ const Module_Agenda = (props) => { 'id': String(JSON.parse(obj)._id), 'comment': String(local_comment), 'sequence_session_id': String(local_sequence_session_id), - 'backgroundColor':bg_color, - + 'backgroundColor': bg_color, + } tab_event.push(local_val); @@ -261,7 +261,7 @@ const Module_Agenda = (props) => { form.append("related_collection_recid", local_selected_id); - + var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_Agenda_Event_List/"; @@ -300,8 +300,8 @@ const Module_Agenda = (props) => { 'id': String(JSON.parse(obj)._id), 'comment': String(local_comment), 'sequence_session_id': String(local_sequence_session_id), - 'backgroundColor':bg_color, - + 'backgroundColor': bg_color, + } tab_event.push(local_val); @@ -384,8 +384,8 @@ const Module_Agenda = (props) => { 'id': String(JSON.parse(obj)._id), 'comment': String(local_comment), 'sequence_session_id': String(local_sequence_session_id), - 'backgroundColor':bg_color, - + 'backgroundColor': bg_color, + } tab_event.push(local_val); @@ -495,7 +495,7 @@ const Module_Agenda = (props) => { return; } - + setp_detail_title("Nouvelle") @@ -509,7 +509,7 @@ const Module_Agenda = (props) => { setendDate(info.end); setDialog_1_open(true); - + /*const { start, end } = info; const eventNamePrompt = prompt("Enter, Nom evenment"); if (eventNamePrompt) { @@ -547,7 +547,7 @@ const Module_Agenda = (props) => { setp_detail_start(arg.event.start) setp_detail_end(arg.event.end) setp_detail_event_id(arg.event.id); - + if (arg.event.extendedProps.comment) { setp_detail_comment(arg.event.extendedProps.comment); @@ -615,11 +615,73 @@ const Module_Agenda = (props) => { }) } + + + const [Partner_Debut_Journee, setPartner_Debut_Journee] = useState("7:00"); + const [Partner_Fin_Journee, setPartner_Fin_Journee] = useState("20:00"); + + + const [Get_Partner_Debut_Fin_Journee_api, setGet_Partner_Debut_Fin_Journee_api] = useState(); + const [Get_Partner_Debut_Fin_Journee_message, setGet_Partner_Debut_Fin_Journee_message] = useState(); + const [Get_Partner_Debut_Fin_Journee_result, setGet_Partner_Debut_Fin_Journee_result] = useState(); + function Get_Partner_Debut_Fin_Journee(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + + form.append("token", stored_cookie); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Default_Debut_Fin_journee_Modele_Journee/"; + + setLoading(true); + + axios.post(myurl, form).then(res => { + //console.log(" In Get_Partner_Debut_Fin_Journee res.data.status = " + res.data.status); + //console.log(" In Get_Partner_Debut_Fin_Journee res.data.message r_class = " + res.data.message); + + setLoading(false); + if (String(res.data.status) === String("true")) { + setGet_Partner_Debut_Fin_Journee_api("true"); + setGet_Partner_Debut_Fin_Journee_result(res.data.message); + + + var val_json = JSON.parse(res.data.message); + + if (JSON.parse(res.data.message).planning_debut_journee) + setPartner_Debut_Journee(String(JSON.parse(res.data.message).planning_debut_journee)) + + if (JSON.parse(res.data.message).planning_fin_journee) + setPartner_Fin_Journee(String(JSON.parse(res.data.message).planning_fin_journee)) + + + + + } + else if (String(res.data.status) === String("Err_Connexion")) { + alert('Erreur: ' + res.data.message); + history.push("/Connexion"); + } + else { + setGet_Partner_Debut_Fin_Journee_api("false"); + setGet_Partner_Debut_Fin_Journee_message(res.data.message); + } + + }).catch((error) => { + + setLoading(false); + console.warn('Not good man :( Get_Partner_Debut_Fin_Journee = ', error); + setGet_Partner_Debut_Fin_Journee_api("false"); + //setmyApimyApiMessage("") + }) + } + + useEffect(() => { Get_Connected_User_List_Agenda_Events(); setselected_employee_id(myconntected_employee_id); Getall_Training_Employee_No_Filter(); Getall_Training_Materiel_No_Filter(); + Get_Partner_Debut_Fin_Journee(); }, [myconntected_employee_id]) @@ -756,7 +818,7 @@ const Module_Agenda = (props) => { setDelete_One_Agenda_Event_api("true"); setDelete_One_Agenda_Event_result(res.data.message); - Get_List_Agenda_Events_For_Given_User(selected_employee_id); + Get_List_Agenda_Events_For_Given_User(selected_employee_id); setp_detail_event_id(); setp_detail_title(); @@ -894,7 +956,7 @@ const Module_Agenda = (props) => { id="event_dialog_start" selected={startDate} onChange={(date) => { - if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "" ) + if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "") return setStartDate(date); } } @@ -950,7 +1012,7 @@ const Module_Agenda = (props) => { value={p_detail_comment} onChange={(e) => { - console.log( " dans comment p_detail_sequence_session_id = ", p_detail_sequence_session_id); + console.log(" dans comment p_detail_sequence_session_id = ", p_detail_sequence_session_id); if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "") setp_detail_comment(e.target.value); } @@ -1154,13 +1216,13 @@ const Module_Agenda = (props) => { //plugins={[timeGridPlugin]} plugins={[timeGridPlugin, daygridPlugin, interactionPlugin]} views={["dayGridMonth", "dayGridWeek", "dayGridDay"]} - slotMinTime="07:00" - slotMaxTime="20:00" + slotMinTime={Partner_Debut_Journee} + slotMaxTime={Partner_Fin_Journee} scrollTime='08:00' displayEventEnd={true} eventContent={renderEventContent} eventClick={handleEventClick} - eventColor= '#378006' + eventColor='#378006' /> diff --git a/src/components/Partner_Config_Jours_Travail.js b/src/components/Partner_Config_Jours_Travail.js index 6c6ab19..4c1dec6 100644 --- a/src/components/Partner_Config_Jours_Travail.js +++ b/src/components/Partner_Config_Jours_Travail.js @@ -1098,9 +1098,41 @@ const Partner_Configuration_Jours_Travail = (props) => { } + + if (document.getElementsByName("planning_debut_journee")[0] && document.getElementsByName("planning_fin_journee")[0]) { + var debut_journee_value = document.getElementsByName("planning_debut_journee")[0].value; + var fin_journee_value = document.getElementsByName("planning_fin_journee")[0].value; + + if (debut_journee_value === undefined || String(debut_journee_value) === "" + || fin_journee_value === undefined || String(fin_journee_value) === "") { + console.log(" Les heures de début et de fin de journée (planning) sont incorrectes"); + return; + } + + var work_debut_journee_value = parseInt(String(debut_journee_value).replaceAll(":", '')) + var work_fin_journee_value = parseInt(String(fin_journee_value).replaceAll(":", '')) + + + if (work_debut_journee_value >= work_fin_journee_value) { + console.log(" Les heures de début et de fin de journée (planning) sont incorrectes. L'heure de fin de journée doit être antérieure à l'heure de début de journée"); + return; + } + + var json_journee_travaille = { + 'planning_debut_journee': String(debut_journee_value), + 'planning_fin_journee': String(fin_journee_value), + } + + global_partner_working_hours['debut_fin_journee'] = json_journee_travaille + + } + + + + var json_str = JSON.stringify(global_partner_working_hours) - console.log(" json_str = ", json_str); + //console.log(" json_str = ", json_str); var form = new FormData(); @@ -1126,7 +1158,7 @@ const Partner_Configuration_Jours_Travail = (props) => { top: 0, behavior: "smooth", }); - + alert(res.data.message); } @@ -1458,6 +1490,14 @@ const Partner_Configuration_Jours_Travail = (props) => { Get_working_Setup_With_arg(line); + if (String(JSON.parse(res.data.message).debut_fin_journee.planning_debut_journee) ) { + document.getElementById("planning_debut_journee").value = String(JSON.parse(res.data.message).debut_fin_journee.planning_debut_journee); + } + + if (String(JSON.parse(res.data.message).debut_fin_journee.planning_fin_journee) ) { + document.getElementById("planning_fin_journee").value = String(JSON.parse(res.data.message).debut_fin_journee.planning_fin_journee); + } + } else { setGetall_Default_Model_Journee_api("false"); @@ -1475,9 +1515,6 @@ const Partner_Configuration_Jours_Travail = (props) => { async function Get_working_Setup_With_arg(json_test) { - - - /*** * Recuperation des nombres de sequence */ @@ -1943,6 +1980,74 @@ const Partner_Configuration_Jours_Travail = (props) => {
 
+
+ + + + + + + + + + + + + + + + + + + +
+ Plage horaire (planning) +
+ +
+ +
+ +
+ + + + + + + +
+
+ +
 
+
diff --git a/src/styles/components/_displaypartnersession.scss b/src/styles/components/_displaypartnersession.scss index 426f04d..55cb161 100644 --- a/src/styles/components/_displaypartnersession.scss +++ b/src/styles/components/_displaypartnersession.scss @@ -897,6 +897,8 @@ width: 50%; } + + .bton_import_excel { background: #c8cfd5; color: black; @@ -1545,6 +1547,11 @@ color: black; width: 40%; } + .bton_add_session_create_automatic { + background: #c8cfd5; + color: black; + width:60% !important; + } .bton_import_excel { background: #c8cfd5; @@ -2085,6 +2092,12 @@ width: 20% !important; } + .bton_add_session_create_automatic { + background: #c8cfd5; + color: black; + width: 40% !important; + } + .bton_import_excel { background: #c8cfd5; color: black; diff --git a/src/styles/components/_partner_configuration_jours_travail.scss b/src/styles/components/_partner_configuration_jours_travail.scss index 81f4300..bfed720 100644 --- a/src/styles/components/_partner_configuration_jours_travail.scss +++ b/src/styles/components/_partner_configuration_jours_travail.scss @@ -537,7 +537,7 @@ border-radius: 5px; background: white; border: solid gainsboro 1px; - padding-left: 5px !important; + padding-left: 0px !important; } @@ -701,7 +701,7 @@ border-radius: 5px; background: white; border: solid gainsboro 1px; - padding-left: 5px !important; + padding-left: 0px !important; } .training_caract { @@ -1296,7 +1296,7 @@ border-radius: 5px; background: white; border: solid gainsboro 1px; - padding-left: 5px !important; + padding-left: 0px !important; } .training_caract { @@ -1771,7 +1771,7 @@ border-radius: 5px; background: white; border: solid gainsboro 1px; - padding-left: 5px !important; + padding-left: 0px !important; } .disabled_style_date_off {