diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index a220060..004b392 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -2286,6 +2286,7 @@ const DisplayPartnerSession = (props) => { var local_agenda = JSON.parse(x).agenda; var local_objectif = JSON.parse(x).objectif; var local_session_id = JSON.parse(x).session_id; + var local_session_comment = JSON.parse(x).commentaire; //--- @@ -2296,7 +2297,8 @@ const DisplayPartnerSession = (props) => { "start": local_start, "end": local_end, "local_agenda": local_agenda, - "local_objectif": local_objectif + "local_objectif": local_objectif, + "local_comment": local_session_comment, }; new_data2.push(node); }); @@ -2304,7 +2306,7 @@ const DisplayPartnerSession = (props) => { if (new_data2.length > 0) { setGetall_Sequence_Of_Session_result_planning_view(new_data2); - console.log(" ### new_data2 = ", new_data2); + // console.log(" ### new_data2 = ", new_data2); } @@ -7800,7 +7802,6 @@ const DisplayPartnerSession = (props) => { const [p_detail_sequence_comment, setp_detail_sequence_comment] = useState(); const [p_detail_sequence_agenda, setp_detail_sequence_agenda] = useState(); const [p_detail_sequence_objectif, setp_detail_sequence_objectif] = useState(); - const [sequence_startDate, setsequence_startDate] = useState(new Date()); const [sequence_endDate, setsequence_endDate] = useState(new Date()); @@ -7920,6 +7921,7 @@ const DisplayPartnerSession = (props) => { alert(res.data.message); Close_Dialog_Detail_seq_open(); + Dialog_DIALOG_AGENDA_handleClose_buton(); } else { setAdd_One_Sequence_Session_api("false"); @@ -7938,7 +7940,6 @@ const DisplayPartnerSession = (props) => { } - const [Add_Automatic_Sequence_Session_api, setAdd_Automatic_Sequence_Session_api] = useState(); const [Add_Automatic_Sequence_Session_message, setAdd_Automatic_Sequence_Session_message] = useState(); const [Add_Automatic_Sequence_Session_result, setAdd_Automatic_Sequence_Session_result] = useState(); @@ -8115,6 +8116,7 @@ const DisplayPartnerSession = (props) => { setgridline_id(''); setsequence_gridline_id(""); + Dialog_DIALOG_AGENDA_handleClose_buton(); alert(res.data.message) } @@ -10044,24 +10046,14 @@ const DisplayPartnerSession = (props) => { const handleSelect = (info) => { - - - - - setp_detail_title("Nouvelle") - setp_detail_start(info.start) - setp_detail_end(info.end) - setp_detail_comment(""); + setp_detail_sequence_title("Nouvelle") + setsequence_startDate(info.start) + setsequence_endDate(info.end) + setp_detail_sequence_agenda(""); setp_detail_event_id(""); - setp_detail_justified(false); - setp_detail_event_type(""); - - setStartDate(info.start); - setendDate(info.end); + setp_detail_sequence_objectif(""); + setp_detail_sequence_comment(""); setDialog_DIALOG_AGENDA_open(true); - - - }; const [p_detail_event_id, setp_detail_event_id] = useState(); @@ -10086,69 +10078,249 @@ const DisplayPartnerSession = (props) => { const handleEventClick = (arg) => { - setp_detail_title(arg.event.title) - setp_detail_start(arg.event.start) - setp_detail_end(arg.event.end) + setp_detail_sequence_title(arg.event.title) + setsequence_startDate(arg.event.start) + setsequence_endDate(arg.event.end) setp_detail_event_id(arg.event.id); - /* - if (arg.event.extendedProps.comment) { - setp_detail_comment(arg.event.extendedProps.comment); - } - else - setp_detail_comment(""); - - - if (arg.event.extendedProps.justified) { - if (String(arg.event.extendedProps.justified) === "true") - setp_detail_justified(true); - - else - setp_detail_justified(false); - - - } - else - setp_detail_justified(false); - - - - if (arg.event.extendedProps.type) { - setp_detail_event_type(arg.event.extendedProps.type); - } - else - setp_detail_event_type(""); -*/ - setStartDate(arg.event.start); - setendDate(arg.event.end); + if (arg.event.extendedProps.local_comment) { + setp_detail_sequence_comment(arg.event.extendedProps.local_comment); + } + else + setp_detail_sequence_comment(""); + + + if (arg.event.extendedProps.local_objectif) { + setp_detail_sequence_objectif(arg.event.extendedProps.local_objectif); + } + else + setp_detail_sequence_objectif(""); + + if (arg.event.extendedProps._id) { + setp_detail_event_id(arg.event.extendedProps._id); + + } + else + setp_detail_event_id(""); + + + if (arg.event.extendedProps.local_agenda) { + setp_detail_sequence_agenda(arg.event.extendedProps.local_agenda); + + } + else + setp_detail_sequence_agenda(""); + setDialog_DIALOG_AGENDA_open(true); } - -const [Dialog_DIALOG_AGENDA_message, setDialog_DIALOG_AGENDA_message] = React.useState(false); -const [Dialog_DIALOG_AGENDA_open, setDialog_DIALOG_AGENDA_open] = React.useState(false); -function Dialog_DIALOG_AGENDA_handle_change_participant_session(message) { - setDialog_DIALOG_AGENDA_message(message); - setDialog_DIALOG_AGENDA_open(true); -} -const Dialog_DIALOG_AGENDA_handleClose = () => { - //alert(" Utiliser le bouton 'fermer' "); - //setOpen(false); -}; + const [Dialog_DIALOG_AGENDA_message, setDialog_DIALOG_AGENDA_message] = React.useState(false); + const [Dialog_DIALOG_AGENDA_open, setDialog_DIALOG_AGENDA_open] = React.useState(false); + function Dialog_DIALOG_AGENDA_handle_change_participant_session(message) { + setDialog_DIALOG_AGENDA_message(message); + setDialog_DIALOG_AGENDA_open(true); + } -const Dialog_DIALOG_AGENDA_handleClose_buton = () => { - setDialog_DIALOG_AGENDA_open(false); -}; + const Dialog_DIALOG_AGENDA_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; -const New_Option_Type_Event = [ + const Dialog_DIALOG_AGENDA_handleClose_buton = () => { + setDialog_DIALOG_AGENDA_open(false); + }; - { "id": "0", "label": "Absence", "value": "absence" }, - { "id": "1", "label": "Planning", "value": "planning" }, - { "id": "2", "label": "Autre", "value": "autre" }, -] + const New_Option_Type_Event = [ + + { "id": "0", "label": "Absence", "value": "absence" }, + { "id": "1", "label": "Planning", "value": "planning" }, + { "id": "2", "label": "Autre", "value": "autre" }, + ] + + const [Dialog_seq_CREATION_SEMAINE_TYPE_message, setDialog_seq_CREATION_SEMAINE_TYPE_message] = React.useState(false); + const [Dialog_seq_CREATION_SEMAINE_TYPE_open, setDialog_seq_CREATION_SEMAINE_TYPE_open] = React.useState(false); + + + + function Dialog_1_handle_change_participant_session(message) { + setDialog_seq_CREATION_SEMAINE_TYPE_message(message); + setDialog_seq_CREATION_SEMAINE_TYPE_open(true); + } + + const Dialog_seq_CREATION_SEMAINE_TYPE_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_seq_CREATION_SEMAINE_TYPE_handleClose_buton = () => { + setDialog_seq_CREATION_SEMAINE_TYPE_open(false); + }; + + + const [semaine_type_event, setsemaine_type_event] = React.useState([ + { + "id": "1714820379044", + "title": "Nouvelle", + "start": "2024-05-02 11:00:00", + "end": "2024-05-02 12:30:00", + "agenda": "ddd", + "objectif": "ff", + "comment": "sdfds" + }, + { + "id": "1714820397818", + "title": "Nouvelle", + "start": "2024-04-30 14:30:00", + "end": "2024-04-30 16:00:00", + "agenda": "ddfd", + "objectif": "fff", + "comment": "qqsdsq" + } + ]); + + + const [Dialog_EVENT_SEMAINE_TYPE_message, setDialog_EVENT_SEMAINE_TYPE_message] = React.useState(false); + const [Dialog_EVENT_SEMAINE_TYPE_open, setDialog_EVENT_SEMAINE_TYPE_open] = React.useState(false); + function Dialog_EVENT_SEMAINE_TYPE_handle_change_participant_session(message) { + setDialog_EVENT_SEMAINE_TYPE_message(message); + setDialog_EVENT_SEMAINE_TYPE_open(true); + } + + const Dialog_EVENT_SEMAINE_TYPE_handleClose = () => { + //alert(" Utiliser le bouton 'fermer' "); + //setOpen(false); + }; + + const Dialog_EVENT_SEMAINE_TYPE_handleClose_buton = () => { + setDialog_EVENT_SEMAINE_TYPE_open(false); + }; + + + const [p_detail_sequence_event_type_semaine_id, setp_detail_sequence_event_type_semaine_id] = useState(); + + const [p_detail_sequence_event_type_semaine_title, setp_detail_sequence_event_type_semaine_title] = useState(); + const [p_detail_sequence_event_type_semaine_comment, setp_detail_sequence_event_type_semaine_comment] = useState(); + const [p_detail_sequence_event_type_semaine_agenda, setp_detail_sequence_event_type_semaine_agenda] = useState(); + const [p_detail_sequence_event_type_semaine_objectif, setp_detail_sequence_event_type_semaine_objectif] = useState(); + + + const [sequence_event_type_semaine_startDate, setsequence_event_type_semaine_startDate] = useState(new Date()); + const [sequence_event_type_semaine_endDate, setsequence_event_type_semaine_endDate] = useState(new Date()); + + + const handleSelect_event_type_semaine = (info) => { + + setDialog_seq_CREATION_SEMAINE_TYPE_open(false); + + + setp_detail_sequence_event_type_semaine_title("Nouvelle") + setsequence_event_type_semaine_startDate(info.start) + setsequence_event_type_semaine_endDate(info.end) + setp_detail_sequence_event_type_semaine_agenda(""); + //setp_detail_event_id(""); + setp_detail_sequence_event_type_semaine_objectif(""); + setp_detail_sequence_event_type_semaine_comment(""); + setDialog_EVENT_SEMAINE_TYPE_open(true); + }; + + + const renderEventContent_event_type_semaine = (eventInfo) => { + //console.log(eventInfo); + return ( + <> + {eventInfo.timeText}
+ {eventInfo.event.title} + + ) + }; + + + const handleEventClick_event_type_semaine = (arg) => { + + + console.log(" arg = ", arg); + + setp_detail_sequence_event_type_semaine_title(arg.event.title) + setsequence_event_type_semaine_startDate(arg.event.start) + setsequence_event_type_semaine_endDate(arg.event.end) + + + setp_detail_sequence_event_type_semaine_id(arg.event.id); + + + if (arg.event.extendedProps.comment) { + setp_detail_sequence_event_type_semaine_comment(arg.event.extendedProps.comment); + } + else + setp_detail_sequence_event_type_semaine_comment(""); + + + if (arg.event.extendedProps.objectif) { + setp_detail_sequence_event_type_semaine_objectif(arg.event.extendedProps.objectif); + } + else + setp_detail_sequence_event_type_semaine_objectif(""); + + + + if (arg.event.extendedProps.agenda) { + setp_detail_sequence_event_type_semaine_agenda(arg.event.extendedProps.agenda); + + } + else + setp_detail_sequence_event_type_semaine_agenda(""); + + + + setDialog_EVENT_SEMAINE_TYPE_open(true); + + } + + + const Add_event_type_semaine = event => { + + var new_title = p_detail_sequence_event_type_semaine_title; + var new_agenda = p_detail_sequence_event_type_semaine_agenda; + var new_objectif = p_detail_sequence_event_type_semaine_objectif; + var new_comment = p_detail_sequence_event_type_semaine_comment; + var new_start_date = moment(sequence_event_type_semaine_startDate).format("YYYY-MM-DD HH:mm:ss"); + var new_end_date = moment(sequence_event_type_semaine_endDate).format("YYYY-MM-DD HH:mm:ss"); + + var local_id = String(Date.now()) + + var local_tab = semaine_type_event; + + console.log(" local_tab = ", local_tab); + + var node = { + "id": local_id, + "title": new_title, + "start": new_start_date, + "end": new_end_date, + "agenda": new_agenda, + "objectif": new_objectif, + "comment": new_comment, + }; + local_tab.push(node); + setsemaine_type_event(local_tab); + + Dialog_EVENT_SEMAINE_TYPE_handleClose_buton(); + console.log(" semaine_type_event = ", semaine_type_event); + + setDialog_seq_CREATION_SEMAINE_TYPE_open(true); + + setp_detail_sequence_event_type_semaine_title(""); + setp_detail_sequence_event_type_semaine_agenda(""); + setp_detail_sequence_event_type_semaine_objectif(""); + setp_detail_sequence_event_type_semaine_comment(""); + setsequence_event_type_semaine_endDate(new Date()); + setsequence_event_type_semaine_startDate(new Date()); + + + } @@ -10160,6 +10332,413 @@ const New_Option_Type_Event = [ } + {/**** Dialogue pour EVENT SEMAINE TYPE */} + + + + MySy Information + + + {Dialog_EVENT_SEMAINE_TYPE_message} + + +
+ + + + + +
+ + + +
Titre + { + + setp_detail_sequence_event_type_semaine_title(e.target.value); + } + } + + /> + +
+ +
Debut + { + + return setsequence_event_type_semaine_startDate(date); + } + } + + className="disabled_style session_caract_Dialog_DatePicker" + style={{ width: "99%" }} + locale='fr-FR' + showTimeSelect + timeFormat="HH:mm" + timeIntervals={15} + dateFormat="dd/MM/yyyy HH:mm" + is24Hour + + /> + +
+ +
Fin + { + + return setsequence_event_type_semaine_endDate(date); + } + } + + + className="disabled_style session_caract_Dialog_DatePicker" + style={{ width: "99%" }} + locale='fr-FR' + showTimeSelect + timeFormat="HH:mm" + timeIntervals={15} + dateFormat="dd/MM/yyyy HH:mm" + is24Hour + + /> + +
+ +
Agenda + { + + setp_detail_sequence_event_type_semaine_agenda(e.target.value); + } + } + multiline + minRows={2} + maxRows={2} + rows={2} + + /> + +
+ +
Objectif + { + + setp_detail_sequence_event_type_semaine_objectif(e.target.value); + } + } + multiline + minRows={2} + maxRows={2} + rows={2} + + /> + +
+ +
Commentaire + { + + setp_detail_sequence_event_type_semaine_comment(e.target.value); + } + } + multiline + minRows={2} + maxRows={2} + rows={2} + + /> + +
+ + +
+ + + + +
+ {String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "" &&
+ {p_detail_event_id && String(p_detail_event_id) !== "" && } + {(!p_detail_event_id || String(p_detail_event_id) === "") && } + + + +
} +
+ +
+
+ +
+ + + + + {String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "" && p_detail_event_id && String(p_detail_event_id) !== "" && + +
+ + { + + }} + > + Supprimer + + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, la séquence sera définitivement supprimée.
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+
+ + +
} + +
+ + + {/**** fin pour Dialogue pour EVENT SEMAINE TYPE */} + + {/* Dialogue CREATION SEMAINE TYPE */} + + + + Semaine Type à dupliquer + + + {Dialog_seq_CREATION_SEMAINE_TYPE_message} + + +
+ + +
+ } + //plugins={[timeGridPlugin]} + plugins={[timeGridPlugin, daygridPlugin, interactionPlugin]} + views={["dayGridMonth", "dayGridWeek", "dayGridDay"]} + slotMinTime={Partner_Debut_Journee} + slotMaxTime={Partner_Fin_Journee} + scrollTime='08:00' + displayEventEnd={true} + eventContent={renderEventContent_event_type_semaine} + eventClick={handleEventClick_event_type_semaine} + + /> +
+ +
+ + + {SessionstartDate && SessionendDate && + +
+ + Dupliquer Du (date du ): + { + if (edit_session_form) { + setSessionstartDate(date); + + } + } + } + showTimeSelect={false} + filterTime={filterPassedTime_start} + dateFormat="dd/MM/yyyy" + className="disabled_style session_caract_Dialog_DatePicker" + locale='fr-FR' + + /> + +
+ Dupliquer Au (date au ): + { + if (edit_session_form) { + SessionendDate(date); + + } + } + } + showTimeSelect={false} + filterTime={filterPassedTime_start} + dateFormat="dd/MM/yyyy" + className="disabled_style session_caract_Dialog_DatePicker" + locale='fr-FR' + + /> +
+ +
} + +
+ + + + +
+
+ +
+ +
+ +
+
+ +
+ + +
+ + {/*** fin CREATION SEMAINE TYPE */} {/* Dialog pour gerer les LIST_HOT_EVALUATION_QUESTION */} @@ -10355,8 +10934,8 @@ const New_Option_Type_Event = [ options={New_Option_Model_Sequence} onChange={(event, value) => { if (value && value.value) { - setDialog_seq_choix_model_emargement(value.value); + } }} @@ -10379,7 +10958,24 @@ const New_Option_Type_Event = [
- + + {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) !== "3" && + String(Dialog_seq_choix_model_emargement) !== "4" && } + + + {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) === "3" && + } + + + {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) === "4" && + }
@@ -10395,7 +10991,7 @@ const New_Option_Type_Event = [ {/*** fin dialog choix modele sequence */} - {/**** Dialogue pour agenda */} + {/**** Dialogue pour AGENDA */} } /> - +
- {String(p_detail_event_type) !== "planning" &&
- - - -
}
Titre { if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "") - setp_detail_title(e.target.value); + setp_detail_sequence_title(e.target.value); } } @@ -10491,15 +11069,15 @@ const New_Option_Type_Event = [ { - if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "") - return setStartDate(date); - } - } + return setsequence_startDate(date); + } + } className="disabled_style session_caract_Dialog_DatePicker" + style={{ width: "99%" }} locale='fr-FR' showTimeSelect timeFormat="HH:mm" @@ -10511,21 +11089,21 @@ const New_Option_Type_Event = [
-
Fin { - if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "") - return setendDate(date); + + return setsequence_endDate(date); } } className="disabled_style session_caract_Dialog_DatePicker" + style={{ width: "99%" }} locale='fr-FR' showTimeSelect timeFormat="HH:mm" @@ -10537,6 +11115,54 @@ const New_Option_Type_Event = [
+
Agenda + { + + setp_detail_sequence_agenda(e.target.value); + } + } + multiline + minRows={2} + maxRows={2} + rows={2} + + /> + +
+ +
Objectif + { + + setp_detail_sequence_objectif(e.target.value); + } + } + multiline + minRows={2} + maxRows={2} + rows={2} + + /> + +
+
Commentaire { - 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); + setp_detail_sequence_comment(e.target.value); } } multiline @@ -10571,8 +11195,8 @@ const New_Option_Type_Event = [
{String(props.write_access) === "1" && String(p_detail_sequence_session_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) !== "" && } + {(!p_detail_event_id || String(p_detail_event_id) === "") && } @@ -10590,14 +11214,61 @@ const New_Option_Type_Event = [ {String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "" && p_detail_event_id && String(p_detail_event_id) !== "" &&
- + } - "Delete_One_Agenda_Event"(); - } - } className="bton_supprime_dialog">Supprimer l'événement + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, la séquence sera définitivement supprimée.
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
@@ -10690,6 +11361,7 @@ const New_Option_Type_Event = [
Date début
+ {rowss && String(session_selected_row_id).length > 0 &&
{JSON.parse(rowss[session_selected_row_id]).date_debut}
} @@ -12624,7 +13296,7 @@ const New_Option_Type_Event = [
- Date début + Date début
- {/*
Formateur
- setp_formateur(e.target.value)} - /> -
*/} {!edit_session_form &&
Formateur
- Date début + Date début } //plugins={[timeGridPlugin]} - plugins={[timeGridPlugin, daygridPlugin, interactionPlugin, resourceTimeGridPlugin]} + plugins={[timeGridPlugin, daygridPlugin, interactionPlugin]} views={["dayGridMonth", "dayGridWeek", "dayGridDay"]} slotMinTime={Partner_Debut_Journee} slotMaxTime={Partner_Fin_Journee} diff --git a/src/components/Module_Agenda.js b/src/components/Module_Agenda.js index 4803850..baa22f7 100644 --- a/src/components/Module_Agenda.js +++ b/src/components/Module_Agenda.js @@ -728,9 +728,6 @@ const Module_Agenda = (props) => { 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); @@ -1155,8 +1152,7 @@ const Module_Agenda = (props) => { else setp_detail_justified(true); - } - } + } } id="toggleSwitchNav" name="toggleSwitchNav">