From 0856f1ca15ff205cc937227c33685458e3c6af44 Mon Sep 17 00:00:00 2001 From: cherif Date: Thu, 15 Aug 2024 12:41:34 +0200 Subject: [PATCH] 15/08/2025 - 12h30 --- src/components/Materiels.js | 6 +- .../Module_Session_Planification.js | 1281 ++++++++++++++++- 2 files changed, 1273 insertions(+), 14 deletions(-) diff --git a/src/components/Materiels.js b/src/components/Materiels.js index 4337e17..87f6b2d 100644 --- a/src/components/Materiels.js +++ b/src/components/Materiels.js @@ -2466,7 +2466,8 @@ const Materiels = (props) => {
Utilisez les filtres !
- {New_Option_Filter && New_Option_Filter.length > 0 && 0 && + { /> } - />} + /> + } {/* { ); } + var date_today_90j = new Date(); + date_today_90j.setDate(date_today_90j.getDate() + 90); function Display_Colunm_text({ value }) { @@ -357,6 +359,213 @@ const Module_Session_Planification = (props) => { ] + const columns_sequence_new_planification = [ + { field: 'id', headerName: 'id', hide: true }, + { field: '_id', headerName: '_id', hide: true }, + { field: 'type', headerName: 'type', hide: true }, + { field: 'grp_apprenant_id', headerName: 'grp_apprenant_id', hide: true }, + { field: 'ue_id', headerName: 'ue_id', hide: true }, + { field: 'unite_enseignement_planif_id', headerName: 'unite_enseignement_planif_id', hide: true }, + + { field: 'session_id', headerName: 'session_id', width: 200, hide: true, flex: 1, minWidth: 150, maxWidth: 300 }, + { field: 'sequence_title', headerName: 'Titre', minWidth: 200, flex: 1, hide: false, editable: false, resizable: true }, + { field: 'grp_apprenant_code', headerName: 'Groupe', minWidth: 200, flex: 1, hide: false, editable: false, resizable: true }, + { field: 'sequence_start', headerName: 'Debut', minWidth: 200, flex: 1, hide: false, editable: false }, + { field: 'sequence_end', headerName: 'Fin', minWidth: 200, flex: 1, hide: false, editable: false }, + + { field: 'agenda', headerName: 'Agenda', minWidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'objectif', headerName: 'Objectif', width: 0, flex: 0, hide: true, editable: false, }, + { field: 'commentaire', headerName: 'Commentaire', width: 0, flex: 0, hide: true, editable: false, }, + + + { + field: "Detail", headerName: 'Voir detail', minWidth: 200, flex: 1, + renderCell: (cellValues) => { + return ( + + + + ); + } + }, + + { + field: "modifier", headerName: 'Modifier', minWidth: 200, flex: 1, + renderCell: (cellValues) => { + return ( + + + + ); + } + }, + + { + field: "delete", headerName: 'Supprimer', minWidth: 200, flex: 1, + renderCell: (cellValues) => { + return ( + + { + + }} + > + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, la séquence sera définitivement supprimée.
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+ + + ); + } + } + + + ] + + const [gridline_sequence_new_planificatio_id, setgridline_sequence_new_planificatio_id] = useState(""); + const columns_sequence_ressources_affectation = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true, minWidth: 200, }, @@ -403,7 +612,7 @@ const Module_Session_Planification = (props) => { @@ -432,6 +641,125 @@ const Module_Session_Planification = (props) => { ] + const columns_modele_planning = [ + { field: 'id', headerName: 'id', hide: true }, + { field: '_id', headerName: '_id', hide: true }, + { field: 'session_id', headerName: 'session_id', width: 200, hide: true, flex: 1, minWidth: 150, maxWidth: 300 }, + { field: 'code', headerName: 'code', minWidth: 200, flex: 1, hide: false, editable: false, resizable: true }, + { field: 'nom', headerName: 'nom', minWidth: 200, flex: 1, hide: false, editable: false, resizable: true }, + { field: 'is_public', headerName: 'is_public', minWidth: 200, flex: 1, hide: true, editable: false }, + { field: 'comment', headerName: 'comment', minWidth: 200, flex: 1, hide: true, editable: false }, + + { + field: "delete", headerName: 'Supprimer', + renderCell: (cellValues) => { + return ( + + { + + }} + > + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, le modème de planification sera définitivement supprimé.
+ +
+
+
+ + +
+
+ +
+
+
+ )} +
+ + ); + } + } + + + ] + + const [selectionModel_modele_planning, setselectionModel_modele_planning] = React.useState([]); + + + const [Delete_Saved_Model_Planning_api, setDelete_Saved_Model_Planning_api] = useState(); + const [Delete_Saved_Model_Planning_message, setDelete_Saved_Model_Planning_message] = useState(); + const [Delete_Saved_Model_Planning_result, setDelete_Saved_Model_Planning_result] = useState(); + function Delete_Saved_Model_Planning(local_seq_id) { + + + var form = new FormData(); + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("_id", local_seq_id); + + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Sequence_Planning_Model/"; + setLoading(true); + + axios.post(myurl, form).then(res => { + //console.log(" In Delete_Saved_Model_Planning res.data.status = " + res.data.status); + //console.log(" In Delete_Saved_Model_Planning res.data.message r_class = " + res.data.message); + + setLoading(false); + + if (String(res.data.status) === String("true")) { + setDelete_Saved_Model_Planning_api("true"); + setDelete_Saved_Model_Planning_result(res.data.message); + setgridline_sequence_new_planificatio_id(""); + alert(res.data.message); + Getall_Partner_Modele_Planning(); + } + else { + setDelete_Saved_Model_Planning_api("false"); + setDelete_Saved_Model_Planning_message(res.data.message); + alert(res.data.message); + + } + + }).catch((error) => { + setLoading(false); + console.warn('Delete_Saved_Model_Planning : Not good man :( mysearchtext = ' + error); + setDelete_Saved_Model_Planning_api("false"); + alert(" Impossible de supprimer le modèle de planification"); + }) + } const myRef_seq_ressource = useRef(null) const myRef_add_session = useRef(null) @@ -649,6 +977,7 @@ const Module_Session_Planification = (props) => { setAdd_One_Sequence_Session_mass(); settab_selected_sequence_id([]); + setselectionModel_sequence([]); alert(res.data.message) @@ -1354,7 +1683,199 @@ const Module_Session_Planification = (props) => { } + const [New_Getall_Partner_Modele_Planning_result_planning_view, setNew_Getall_Partner_Modele_Planning_result_planning_view] = useState([]); + const [Getall_Partner_Modele_Planning_api, setGetall_Partner_Modele_Planning_api] = useState(); + const [Getall_Partner_Modele_Planning_message, setGetall_Partner_Modele_Planning_message] = useState(); + const [Getall_Partner_Modele_Planning_result, setGetall_Partner_Modele_Planning_result] = useState([]); + function Getall_Partner_Modele_Planning() { + + 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_List_Sequence_Planning_Model_Header/"; + + setLoading(true); + + + axios.post(myurl, form).then(res => { + + setLoading(false); + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Partner_Modele_Planning res.data.status = " + res.data.status); + // console.log(" In Getall_Partner_Modele_Planning res.data.message r_class = " + res.data.message); + setGetall_Partner_Modele_Planning_api("true"); + setGetall_Partner_Modele_Planning_result(res.data.message); + + //console.log(" ##NB_Sequence = ", res.data.message.length); + setnb_sequence(res.data.message.length); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //console.log(" ### new_data XXX = ", x); + + //--- + var localid = JSON.parse(x)._id; // on donne volontairement a l'id la valeur de '_id' + var local_id = JSON.parse(x)._id; + var local_code = JSON.parse(x).code; + + var local_nom = JSON.parse(x).nom; + var local_code = JSON.parse(x).code; + var local_is_public = JSON.parse(x).is_public; + var local_comment = JSON.parse(x).comment; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "nom": local_nom, + "code": local_code, + "is_public": local_is_public, + "comment": local_comment, + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) { + setNew_Getall_Partner_Modele_Planning_result_planning_view(new_data2); + // console.log(" ### new_data2 = ", new_data2); + } + + + } + else { + setGetall_Partner_Modele_Planning_api("false"); + setGetall_Partner_Modele_Planning_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Getall_Partner_Modele_Planning = ', error); + setGetall_Partner_Modele_Planning_api("false"); + alert("Impossible de récuperer la liste des modèles de planning") + //setmyApimyApiMessage("") + }) + } + + + + const [planning_model_new_application_date, setplanning_model_new_application_date] = useState(); + const [new_planification_lines, setnew_planification_lines] = useState([]); + + const [New_Get_Given_Sequence_Planning_Model_With_Option_result_planning_view, setNew_Get_Given_Sequence_Planning_Model_With_Option_result_planning_view] = useState([]); + + const [Get_Given_Sequence_Planning_Model_With_Option_api, setGet_Given_Sequence_Planning_Model_With_Option_api] = useState(); + const [Get_Given_Sequence_Planning_Model_With_Option_message, setGet_Given_Sequence_Planning_Model_With_Option_message] = useState(); + const [Get_Given_Sequence_Planning_Model_With_Option_result, setGet_Given_Sequence_Planning_Model_With_Option_result] = useState([]); + function Get_Given_Sequence_Planning_Model_With_Option() { + + var form = new FormData(); + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("_id", selected_modele_planning_id); + form.append("date_debut", format(planning_model_new_application_date, 'dd/MM/yyyy')); + + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Sequence_Planning_Model_With_Option/"; + + setLoading(true); + + axios.post(myurl, form).then(res => { + + setLoading(false); + if (String(res.data.status) === String("true")) { + + Close_Dialog_RECORD_MODEL_PLANNING(); + Close_Dialog_MODEL_PLANNING(); + + //console.log(" In Get_Given_Sequence_Planning_Model_With_Option res.data.status = " + res.data.status); + //console.log(" In Get_Given_Sequence_Planning_Model_With_Option res.data.message r_class.lines_data = " + res.data.message.lines_data); + setGet_Given_Sequence_Planning_Model_With_Option_api("true"); + setGet_Given_Sequence_Planning_Model_With_Option_result(res.data.message); + + var mylocaldata = JSON.parse(res.data.message.lines_data); + + + //setnb_sequence(res.data.message.length); + + var new_data2 = []; + const new_data = mylocaldata.map((x) => { + + //--- + var localid = (x)._id; // on donne volontairement a l'id la valeur de '_id' + var local_id = (x)._id; + var local_title = (x).sequence_title; + var local_start = new Date(moment((x).new_sequence_start, "DD/MM/YYYY hh:mm")) + var local_end = new Date(moment((x).new_sequence_end, "DD/MM/YYYY hh:mm")) + + var local_agenda = (x).agenda; + var local_objectif = (x).objectif; + var local_session_id = (x).session_id; + var local_session_comment = (x).commentaire; + var local_session_type = (x).type; + + var local_session_ue_id = (x).ue_id; + var local_session_grp_apprenant_id = (x).grp_apprenant_id; + + var local_session_ue_planif_line_id = (x).unite_enseignement_planif_id; + var local_session_color = (x).grp_apprenant_color; + var local_session_grp_code = (x).grp_apprenant_code; + + + //--- + var node = { + "_id": local_id, + "id": localid, + "title": local_title, + "start": local_start, + "end": local_end, + "grp_code": local_session_grp_code, + "color": local_session_color, + "local_agenda": local_agenda, + "local_objectif": local_objectif, + "local_comment": local_session_comment, + "local_type": local_session_type, + "local_ue_id": local_session_ue_id, + "local_grp_apprenant_id": local_session_grp_apprenant_id, + "local_ue_planif_line_id": local_session_ue_planif_line_id, + + }; + new_data2.push(node); + }); + + if (new_data2.length > 0) { + setnew_planification_lines(new_data2); + // console.log(" ### new_data2 = ", new_data2); + } + + // console.log(" ### ENN new_data2 = ", new_data2); + } + else { + setGet_Given_Sequence_Planning_Model_With_Option_api("false"); + setGet_Given_Sequence_Planning_Model_With_Option_message(res.data.message); + alert(res.data.message) + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Get_Given_Sequence_Planning_Model_With_Option = ', error); + setGet_Given_Sequence_Planning_Model_With_Option_api("false"); + alert("Impossible de récuperer les données du modèle de planning") + //setmyApimyApiMessage("") + }) + } + + + + const [selectionModel_sequence_new_planification, setselectionModel_sequence_new_planification] = React.useState([]); const [selectionModel_sequence, setselectionModel_sequence] = React.useState([]); const [Dialog_seq_1_message, setDialog_seq_1_message] = React.useState(false); @@ -1923,6 +2444,13 @@ const Module_Session_Planification = (props) => { { "id": "4", "label": "Un modèle au mois", "value": "4" }, ] + const New_Option_Gestion_Model_Planning = [ + { "id": "record", "label": "Enreg. Modèle", "value": "record" }, + { "id": "gestion", "label": "Gestion modèles", "value": "gestion" }, + { "id": "", "label": "", "value": "" }, + ] + + const datagridSx = { borderRadius: 2, marginRight: 1, @@ -2672,6 +3200,162 @@ const Module_Session_Planification = (props) => { const [submenu_seq_dialog_ressource_type, setsubmenu_seq_dialog_ressource_type] = useState(""); const [submenu_seq_dialog_ressource_id, setsubmenu_seq_dialog_ressource_id] = useState(""); + + const [action_modele_planning, setaction_modele_planning] = useState(""); + + const [Dialog_MODEL_PLANNING_message, setDialog_MODEL_PLANNING_message] = React.useState(false); + const [Dialog_MODEL_PLANNING_open, setDialog_MODEL_PLANNING_open] = React.useState(false); + + function Close_Dialog_MODEL_PLANNING() { + setgridline_sequence_new_planificatio_id(""); + setDialog_MODEL_PLANNING_open(false); + setplanning_model_new_application_date(); + } + + + const [selected_modele_planning_id, setselected_modele_planning_id] = useState(""); + const handleRowClick = ( + params, // GridRowParams + event, // MuiEvent> + details, // GridCallbackDetails + ) => { + + setselected_modele_planning_id(params.row._id); + setgridline_sequence_new_planificatio_id(params.row.id); + }; + + const [Dialog_RECORD_MODEL_PLANNING_message, setDialog_RECORD_MODEL_PLANNING_message] = React.useState(false); + const [Dialog_RECORD_MODEL_PLANNING_open, setDialog_RECORD_MODEL_PLANNING_open] = React.useState(false); + + function Close_Dialog_RECORD_MODEL_PLANNING() { + setDialog_RECORD_MODEL_PLANNING_open(false); + } + + + const [p_model_planning_code, setp_model_planning_code] = useState(""); + const [p_model_planning_nom, setp_model_planning_nom] = useState(""); + + const [Record_New_Planning_Model_api, setRecord_New_Planning_Model_api] = useState(); + const [Record_New_Planning_Model_message, setRecord_New_Planning_Model_message] = useState(); + const [Record_New_Planning_Model_result, setRecord_New_Planning_Model_result] = useState(); + const Record_New_Planning_Model = event => { + var form = new FormData(); + + if (String(p_model_planning_code) === "") { + alert(" Vous devez définir un code"); + return; + } + + if (String(p_model_planning_nom) === "") { + alert(" Vous devez définir un nom"); + return; + } + + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", selected_session_id); + form.append("code", p_model_planning_code); + form.append("nom", p_model_planning_nom); + form.append("is_public", "1"); + form.append("comment", ""); + + //console.log(" form == ", form); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Sequence_Planning_Model/"; + + + setLoading(true); + axios.post(myurl, form).then(res => { + //console.log(" In Record_New_Planning_Model res.data.status = " + res.data.status); + //console.log(" In Record_New_Planning_Model res.data.message r_class = " + res.data.message); + + setLoading(false); + if (String(res.data.status) === String("true")) { + setRecord_New_Planning_Model_api("true"); + setRecord_New_Planning_Model_result(res.data.message); + + alert(res.data.message); + Close_Dialog_RECORD_MODEL_PLANNING(); + } + else { + setRecord_New_Planning_Model_api("false"); + setRecord_New_Planning_Model_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + + + setLoading(false); + console.warn('UpdateStagiaireData : Not good man :( Record_New_Planning_Model = ' + error); + setRecord_New_Planning_Model_api("false"); + alert(" Impossible de créer le nouveau modèle de plannig"); + }) + } + + + const [Apply_Planning_To_Session_api, setApply_Planning_To_Session_api] = useState(); + const [Apply_Planning_To_Session_message, setApply_Planning_To_Session_message] = useState(); + const [Apply_Planning_To_Session_result, setApply_Planning_To_Session_result] = useState(); + const Apply_Planning_To_Session = event => { + + var form = new FormData(); //zzzz + + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", selected_session_id); + + var json_str = JSON.stringify(new_planification_lines) + form.append("tab_sequence_modele", json_str); + + + + //console.log(" form == ", form); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Apply_Planning_Model_To_Session/"; + + + setLoading(true); + axios.post(myurl, form).then(res => { + //console.log(" In Apply_Planning_To_Session res.data.status = " + res.data.status); + //console.log(" In Apply_Planning_To_Session res.data.message r_class = " + res.data.message); + + setLoading(false); + if (String(res.data.status) === String("true")) { + setApply_Planning_To_Session_api("true"); + setApply_Planning_To_Session_result(res.data.message); + + Getall_Sequence_Of_Session(selected_session_id); + setnew_planification_lines([]); + alert(res.data.message); + + } + else { + setApply_Planning_To_Session_api("false"); + setApply_Planning_To_Session_message(res.data.message); + alert(res.data.message); + } + + }).catch((error) => { + + + setLoading(false); + console.warn('UpdateStagiaireData : Not good man :( Apply_Planning_To_Session = ' + error); + setApply_Planning_To_Session_api("false"); + alert(" Impossible d'appliquer le nouveau planning à la sessions"); + }) + } + + + function Cancel_Apply_Planning_To_Session() { + + setnew_planification_lines([]) + } + + + const [active_planif_modele, setactive_planif_modele] = useState(""); + return (
@@ -2680,8 +3364,290 @@ const Module_Session_Planification = (props) => {
} - {/*** Dialog ajout sequence */} + {/*** Dialog ajout RECORD MODEL PLANNING */} + + null} + + PaperProps={{ + + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + //position: 'absolute', + top: default_h + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + className="displaypartnersession mysy_MuiPaper-root" + > + + + Créer un nouveau modèle de planning + + + + {Dialog_RECORD_MODEL_PLANNING_message} + + + +
Code
+ { + setp_model_planning_code(e.target.value); + } + } + /> +
+ +
Nom
+ { + setp_model_planning_nom(e.target.value); + } + } + /> +
+ + + +
+ + +
+
+ + +
+ +
+ +
+ +
+ + + + + +
+ +
+ {/*** Fin ajout Dialog ajout RECORD MODEL PLANNING */} + + + {/*** Dialog ajout MODEL PLANNING */} + + null} + + PaperProps={{ + + + className: classes.paper, // Apply the paper style + style: { + overflowY: 'unset', + //position: 'absolute', + //top: default_h + }, + }} + hideBackdrop={true} + disableScrollLock + classes={{ + paper: classes.dialog + }} + + className="displaypartnersession mysy_MuiPaper-root" + > + + + Gestion Modèle de planning + + + + {Dialog_MODEL_PLANNING_message} + + + + {New_Getall_Partner_Modele_Planning_result_planning_view && New_Getall_Partner_Modele_Planning_result_planning_view.length > 0 &&
+ +
+   + + ( + { + id: index, + _id: (item)._id, + session_id: (item).session_id, + code: (item).code, + nom: (item).nom, + is_public: (item).is_public, + comment: (item).comment, + + } + ))} + + columns={columns_modele_planning} + pageSize={10} + className="datagridclass" + + + rowsPerPageOptions={[10]} + disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + sx={datagridSx} + getRowClassName={(params) => { + + // Pour la gestion de la couleur de zone double cliquée + if (String(params.row.id) === String(gridline_sequence_new_planificatio_id)) { + return 'line--statut--selected'; + } + + + + }} + + + /> + +
+ +
+ + +
} + + {New_Getall_Partner_Modele_Planning_result_planning_view && New_Getall_Partner_Modele_Planning_result_planning_view.length <= 0 &&
+ Aucun modèle de planning enregistré. +
} + + + +
+
+ + Appliquer à partir du : + { + + setplanning_model_new_application_date(date); + } + } + showTimeSelect={false} + filterTime={filterPassedTime_start} + dateFormat="dd/MM/yyyy" + className="disabled_style " + fullWidth + locale='fr-FR' + + /> +
+
+ +
+ + +
+
+ + +
+ +
+ +
+ +
+ + + + + +
+ +
+ {/*** Fin ajout Dialog ajout MODEL PLANNING */} + + + {/*** Dialog ajout sequence */} { grp_apprenant_code: JSON.parse(item).grp_apprenant_code, - } ))} @@ -5208,9 +6173,231 @@ const Module_Session_Planification = (props) => {
} + + +
-
+ {new_planification_lines && new_planification_lines.length > 0 &&
+ + ici afficher la planification nouvelle
+ {display_view && String(display_view) === "list" &&
+ +
+   + + { + setselectionModel_sequence_new_planification(newSelectionModel); + + }} + selectionModel={selectionModel_sequence_new_planification} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={new_planification_lines.map((item, index) => ( + { + id: index, + _id: (item)._id, + sequence_start: format((item).start, 'dd/MM/yyyy HH:mm'), + sequence_end: format((item).end, 'dd/MM/yyyy HH:mm'), + session_id: (item).id, + sequence_title: (item).title, + agenda: (item).local_agenda, + objectif: (item).local_objectif, + commentaire: (item).local_comment, + + grp_apprenant_id: (item).grp_apprenant_id, + ue_id: (item).local_ue_id, + unite_enseignement_planif_id: (item).local_ue_planif_line_id, + type: (item).local_type, + + grp_apprenant_code: (item).grp_apprenant_code, + + + + } + ))} + + columns={columns_sequence_new_planification} + pageSize={10} + className="datagridclass" + + onRowDoubleClick={(newSelectionModel) => { + /* + setsequence_gridline_id(newSelectionModel.row.id); + setselected_detail_sequence_title(newSelectionModel.row.sequence_title); + setselected_sequence_startDate(newSelectionModel.row.sequence_start); + setselected_sequence_endDate(newSelectionModel.row.sequence_end); + + setp_detail_sequence_agenda(newSelectionModel.row.agenda); + setp_detail_sequence_objectif(newSelectionModel.row.objectif); + setp_detail_sequence_comment(newSelectionModel.row.commentaire); + + + Getall_List_Sequence_Ressource(newSelectionModel.row._id); + + setselected_sequence_id(newSelectionModel.row._id); + setdisplay_detail_sequence("1"); + + if (document.getElementById('myRef_seq_ressource')) { + var divh = document.getElementById('myRef_seq_ressource').offsetTop; + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + } + + */ }} + + + + rowsPerPageOptions={[10]} + //disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + //sx={datagridSx} + getCellClassName={(params) => { + //field === 'distantiel' + if (params.field === 'distantiel' && String(params.value) === "1") { + return 'cell--distantiel'; + } + if (params.field === "presentiel" && String(params.value) == "1") { + return 'cell--presentiel'; + } + + + //field === "etape" + if (params.field === "etape" && String(params.value) == "0") { + return 'cell--etape--projet'; + } + + if (params.field === "etape" && String(params.value) == "1") { + return 'cell--etape--planification'; + } + + if (params.field === "etape" && String(params.value) == "2") { + return 'cell--etape--planifie'; + } + + if (params.field === "etape" && String(params.value) == "3") { + return 'cell--etape--termine'; + } + + if (params.field === "etape" && String(params.value) == "4") { + return 'cell--etape--facture'; + } + + if (params.field === "etape" && String(params.value) == "-1") { + return 'cell--etape--annule'; + } + + }} + getRowClassName={(params) => { + + // Pour la gestion de la couleur de zone double cliquée + if (String(params.row.id) === String(sequence_gridline_id)) { + return 'line--statut--selected'; + } + + + + }} + + /> + + +
+ +
+ + +
} + + + + {display_view && String(display_view) === "planning" && +
+

Affichage planning

+   + +
+ + } + //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} + eventClick={handleEventClick} + + + /> +
+ + + + +
} + +
+ + + + + +
+ +
} + + {!new_planification_lines || new_planification_lines.length <= 0 &&
+   + {String(active_planif_modele) !== "1" && } + + {String(active_planif_modele) === "1" && } +
-
+
} -
- Modèle : - - -
+ {String(active_planif_modele) === "1" &&
+ + + + +
}