+
Programme (max 1000 caractères)
{
const history = useHistory();
@@ -155,7 +160,7 @@ const Module_Session_Planification = (props) => {
setselected_sequence_id(cellValues.row._id);
setdisplay_detail_sequence("1");
- Get_List_Of_All_PJ_For_Session(cellValues.row._id);
+
if (document.getElementById('myRef_seq_ressource')) {
var divh = document.getElementById('myRef_seq_ressource').offsetTop;
@@ -349,6 +354,1594 @@ const Module_Session_Planification = (props) => {
]
+ const myRef_seq_ressource = useRef(null)
+ const myRef_add_session = useRef(null)
+
+ const [update_sequence, setupdate_sequence] = useState();
+ function submenu_update_sequence() {
+ setupdate_sequence("1");
+
+ setDialog_seq_1_open(true);
+ }
+
+ const [sequence_gridline_id, setsequence_gridline_id] = useState("");
+ const [p_detail_sequence_title, setp_detail_sequence_title] = useState();
+ 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());
+
+
+ const [selected_detail_sequence_title, setselected_detail_sequence_title] = useState();
+ const [selected_detail_sequence_comment, setselected_detail_sequence_comment] = useState();
+ const [selected_sequence_startDate, setselected_sequence_startDate] = useState(new Date());
+ const [selected_sequence_endDate, setselected_sequence_endDate] = useState(new Date());
+
+
+ const [display_view, setdisplay_view] = useState("list");
+ function func_display_planning_view() {
+ setdisplay_view("planning");
+ }
+
+ function func_display_list_view() {
+ setdisplay_view("list");
+ }
+
+
+ const renderEventContent = (eventInfo) => {
+ //console.log(eventInfo);
+ return (
+ <>
+ {eventInfo.timeText}
+ {eventInfo.event.title}
+ >
+ )
+ };
+
+ const [actionmass_sequence_val, setactionmass_sequence_val] = useState();
+ const actionmass_sequence = (event) => {
+ const value = event.target.value;
+
+
+ if (String(value) === "ajout_ressource" || String(value) === "supprimer") {
+ setactionmass_sequence_val(value);
+ }
+ else {
+ setactionmass_sequence_val();
+ }
+ }
+
+
+ const [display_detail_sequence, setdisplay_detail_sequence] = useState();
+ const [selected_sequence_id, setselected_sequence_id] = useState();
+ const [tab_selected_sequence_id, settab_selected_sequence_id] = useState([]);
+
+
+
+ const [Getall_List_Sequence_Ressource_api, setGetall_List_Sequence_Ressource_api] = useState();
+ const [Getall_List_Sequence_Ressource_message, setGetall_List_Sequence_Ressource_message] = useState();
+ const [Getall_List_Sequence_Ressource_result, setGetall_List_Sequence_Ressource_result] = useState([]);
+ function Getall_List_Sequence_Ressource(local_sequence_id) {
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("sequence_session_id", local_sequence_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Sequence_Ressource_Affectation/";
+
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_List_Sequence_Ressource res.data.status = " + res.data.status);
+ //console.log(" In Getall_List_Sequence_Ressource res.data.message r_class = " + res.data.message);
+ setGetall_List_Sequence_Ressource_api("true");
+ setGetall_List_Sequence_Ressource_result(res.data.message);
+
+ }
+ else {
+ setGetall_List_Sequence_Ressource_api("false");
+ setGetall_List_Sequence_Ressource_message(res.data.message);
+ alert(res.data.message)
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_List_Sequence_Ressource = ', error);
+ setGetall_List_Sequence_Ressource_api("false");
+ alert("Impossible de récuperer la liste des ressources de la sequence")
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [Delete_Sequence_Session_Data_api, setDelete_Sequence_Session_Data_api] = useState();
+ const [Delete_Sequence_Session_Data_message, setDelete_Sequence_Session_Data_message] = useState();
+ const [Delete_Sequence_Session_Data_result, setDelete_Sequence_Session_Data_result] = useState();
+ function Delete_Sequence_Session_Data(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_Given_Session_Sequence/";
+ setLoading(true);
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Delete_Sequence_Session_Data res.data.status = " + res.data.status);
+ //console.log(" In Delete_Sequence_Session_Data res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+
+ if (String(res.data.status) === String("true")) {
+ setDelete_Sequence_Session_Data_api("true");
+ setDelete_Sequence_Session_Data_result(res.data.message);
+
+ Getall_Sequence_Of_Session(selected_session_id);
+
+ setDialog_seq_ressource_1_selected_type_ressource();
+ setDialog_seq_ressource_1_selected_ressource_id();
+ setDialog_seq_ressource_1_selected_ressource_poste();
+ setdisplay_detail_sequence();
+ setselected_sequence_id();
+ setupdate_sequence();
+ //setgridline_id('');
+ setsequence_gridline_id("");
+
+ Dialog_DIALOG_AGENDA_handleClose_buton();
+
+ alert(res.data.message)
+ }
+ else {
+ setDelete_Sequence_Session_Data_api("false");
+ setDelete_Sequence_Session_Data_message(res.data.message);
+ alert(res.data.message);
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Delete_Sequence_Session_Data : Not good man :( mysearchtext = ' + error);
+ setDelete_Sequence_Session_Data_api("false");
+ alert(" Impossible de supprimer la sequence");
+ })
+ }
+
+ const [selected_code_session, setselected_code_session] = useState();
+ const [selected_session_id, setselected_session_id] = useState(props.related_collection_recid);
+ const [selected_internal_url, setselected_internal_url] = useState();
+ const [selected_class_title, setselected_class_title] = useState();
+
+ const [one_selected_internal_url, setone_selected_internal_url] = useState();
+
+ const [Delete_Sequence_Session_Data_Mass_api, setDelete_Sequence_Session_Data_Mass_api] = useState();
+ const [Delete_Sequence_Session_Data_Mass_message, setDelete_Sequence_Session_Data_Mass_message] = useState();
+ const [Delete_Sequence_Session_Data_Mass_result, setDelete_Sequence_Session_Data_Mass_result] = useState();
+ function Delete_Sequence_Session_Data_Mass(local_tab_ids) {
+
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("tab_id", local_tab_ids);
+
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Given_Session_Sequence_Mass/";
+ setLoading(true);
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Delete_Sequence_Session_Data_Mass res.data.status = " + res.data.status);
+ //console.log(" In Delete_Sequence_Session_Data_Mass res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+
+ if (String(res.data.status) === String("true")) {
+ setDelete_Sequence_Session_Data_Mass_api("true");
+ setDelete_Sequence_Session_Data_Mass_result(res.data.message);
+
+ Getall_Sequence_Of_Session(selected_session_id);
+
+ setDialog_seq_ressource_1_selected_type_ressource();
+ setDialog_seq_ressource_1_selected_ressource_id();
+ setDialog_seq_ressource_1_selected_ressource_poste();
+ setdisplay_detail_sequence();
+ setselected_sequence_id();
+ setupdate_sequence();
+
+ setAdd_One_Sequence_Session_mass();
+ settab_selected_sequence_id([]);
+
+
+ alert(res.data.message)
+ }
+ else {
+ setDelete_Sequence_Session_Data_Mass_api("false");
+ setDelete_Sequence_Session_Data_Mass_message(res.data.message);
+ alert(res.data.message);
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Delete_Sequence_Session_Data_Mass : Not good man :( mysearchtext = ' + error);
+ setDelete_Sequence_Session_Data_Mass_api("false");
+ alert(" Impossible de supprimer les sequences en masse");
+ })
+ }
+
+
+ function GetSelectedRows_Sequence_Ids() {
+
+
+ var tab_tmp = []
+ for (var i = 0; i < selectionModel_sequence.length; i++) {
+ var myid = parseInt(String(selectionModel_sequence[i]));
+ //var line = JSON.parse(rowss[myid]);
+ tab_tmp.push(myid);
+ }
+ return tab_tmp;
+
+ }
+
+ async function actionmass_sequence_Traitement() {
+
+ setAdd_One_Sequence_Session_mass("1");
+ var liste_formation = GetSelectedRows_Sequence_Ids();
+
+ var tab_seq_mongo_ids = [];
+
+ for (var i = 0; i < selectionModel_sequence.length; i++) {
+
+ var line_id = selectionModel_sequence[i];
+ var mongo_id = JSON.parse(Getall_Sequence_Of_Session_result[line_id])._id;
+ tab_seq_mongo_ids.push(mongo_id);
+
+
+ }
+
+ settab_selected_sequence_id(tab_seq_mongo_ids);
+
+
+ if (String(actionmass_sequence_val) === "ajout_ressource") {
+ setDialog_seq_ressource_1_open(true);
+
+ }
+ else if (String(actionmass_sequence_val) === "supprimer") {
+
+ Delete_Sequence_Session_Data_Mass(tab_seq_mongo_ids);
+
+ }
+
+
+ }
+ const [Dialog_seq_choix_model_emargement_message, setDialog_seq_choix_model_emargement_message] = React.useState(false);
+ const [Dialog_seq_choix_model_emargement_open, setDialog_seq_choix_model_emargement_open] = React.useState(false);
+
+
+
+ function Dialog_1_handle_change_participant_session(message) {
+ setDialog_seq_choix_model_emargement_message(message);
+ setDialog_seq_planif_periode_type("");
+ setDialog_seq_choix_model_emargement_open(true);
+ }
+
+ const Dialog_seq_choix_model_emargement_handleClose = () => {
+ //alert(" Utiliser le bouton 'fermer' ");
+ //setOpen(false);
+ };
+
+ const Dialog_seq_choix_model_emargement_handleClose_buton = () => {
+ setDialog_seq_planif_periode_type("");
+ setDialog_seq_choix_model_emargement_open(false);
+ };
+
+
+
+ const [isLoading, setLoading] = useState();
+
+ const [p_detail_event_id, setp_detail_event_id] = useState();
+ const [p_detail_title, setp_detail_title] = useState();
+ const [p_detail_start, setp_detail_start] = useState();
+ const [p_detail_end, setp_detail_end] = useState();
+ const [p_detail_comment, setp_detail_comment] = useState();
+ const [p_detail_sequence_session_id, setp_detail_sequence_session_id] = useState("");
+
+ const [p_detail_justified, setp_detail_justified] = useState(false);
+ const [p_detail_event_type, setp_detail_event_type] = useState();
+
+
+ const [startDate, setStartDate] = useState(new Date());
+ const [endDate, setendDate] = useState(new Date());
+
+ const [mysy_events, setmysy_events] = useState();
+
+ const [Partner_Debut_Journee, setPartner_Debut_Journee] = useState("7:00");
+ const [Partner_Fin_Journee, setPartner_Fin_Journee] = useState("20:00");
+
+
+ const [Dialog_seq_ressource_1_selected_type_ressource, setDialog_seq_ressource_1_selected_type_ressource] = React.useState();
+ const [Dialog_seq_ressource_1_selected_ressource_id, setDialog_seq_ressource_1_selected_ressource_id] = React.useState();
+ const [Dialog_seq_ressource_1_selected_ressource_poste, setDialog_seq_ressource_1_selected_ressource_poste] = React.useState();
+
+
+
+ const [Add_One_Sequence_Session_mass, setAdd_One_Sequence_Session_mass] = useState();
+
+ const [Add_One_Sequence_Session_Ressource_api, setAdd_One_Sequence_Session_Ressource_api] = useState();
+ const [Add_One_Sequence_Session_Ressource_message, setAdd_One_Sequence_Session_Ressource_message] = useState();
+ const [Add_One_Sequence_Session_Ressource_result, setAdd_One_Sequence_Session_Ressource_result] = useState();
+ const Add_One_Sequence_Session_Ressource = event => {
+
+ var new_ressource_type = Dialog_seq_ressource_1_selected_type_ressource;
+ var new_ressource_id = Dialog_seq_ressource_1_selected_ressource_id;
+ var new_ressource_poste = Dialog_seq_ressource_1_selected_ressource_poste;
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("sequence_session_id", selected_sequence_id);
+ form.append("poste", new_ressource_poste);
+ form.append("related_target_collection", new_ressource_type);
+ form.append("related_target_collection_id", new_ressource_id);
+
+ if (String("new_ressource_type") === "ressource_humaine" && String(new_ressource_poste).trim() === "") {
+ alert(" Vous devez préciser le poste occupé pour cette ressrouce");
+ return;
+ }
+
+ //console.log(" form == ", form);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Sequence_Affectation_Ressource_Poste/";
+
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Add_One_Sequence_Session_Ressource res.data.status = " + res.data.status);
+ //console.log(" In Add_One_Sequence_Session_Ressource res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ setAdd_One_Sequence_Session_Ressource_api("true");
+ setAdd_One_Sequence_Session_Ressource_result(res.data.message);
+
+ Getall_List_Sequence_Ressource(selected_sequence_id);
+
+ setDialog_seq_ressource_1_selected_type_ressource();
+ setDialog_seq_ressource_1_selected_ressource_id();
+ setDialog_seq_ressource_1_selected_ressource_poste();
+
+ alert(res.data.message);
+ Dialog_seq_ressource_1_handleClose_buton();
+ }
+ else {
+ setAdd_One_Sequence_Session_Ressource_api("false");
+ setAdd_One_Sequence_Session_Ressource_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+
+
+ setLoading(false);
+ console.warn('UpdateStagiaireData : Not good man :( Add_One_Sequence_Session_Ressource = ' + error);
+ setAdd_One_Sequence_Session_Ressource_api("false");
+ alert(" Impossible d'ajouter la ressource à la séquence");
+ })
+ }
+
+ const [Delete_Sequence_Session_Ressource_Data_api, setDelete_Sequence_Session_Ressource_Data_api] = useState();
+ const [Delete_Sequence_Session_Ressource_Data_message, setDelete_Sequence_Session_Ressource_Data_message] = useState();
+ const [Delete_Sequence_Session_Ressource_Data_result, setDelete_Sequence_Session_Ressource_Data_result] = useState();
+ function Delete_Sequence_Session_Ressource_Data(local_seq_ressource_id) {
+
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("_id", local_seq_ressource_id);
+
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Sequence_Affectation_Ressource_Poste/";
+ setLoading(true);
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Delete_Sequence_Session_Ressource_Data res.data.status = " + res.data.status);
+ //console.log(" In Delete_Sequence_Session_Ressource_Data res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+
+ if (String(res.data.status) === String("true")) {
+ setDelete_Sequence_Session_Ressource_Data_api("true");
+ setDelete_Sequence_Session_Ressource_Data_result(res.data.message);
+
+ Getall_List_Sequence_Ressource(selected_sequence_id);
+
+ alert(res.data.message)
+ }
+ else {
+ setDelete_Sequence_Session_Ressource_Data_api("false");
+ setDelete_Sequence_Session_Ressource_Data_message(res.data.message);
+
+ alert(res.data.message);
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Delete_Sequence_Session_Ressource_Data : Not good man :( mysearchtext = ' + error);
+ setDelete_Sequence_Session_Ressource_Data_api("false");
+ alert(" Impossible de supprimer la sequence");
+ })
+ }
+
+ const [Add_One_Sequence_Session_api, setAdd_One_Sequence_Session_api] = useState();
+ const [Add_One_Sequence_Session_message, setAdd_One_Sequence_Session_message] = useState();
+ const [Add_One_Sequence_Session_result, setAdd_One_Sequence_Session_result] = useState();
+ const Add_One_Sequence_Session = event => {
+
+ var new_title = p_detail_sequence_title;
+ var new_start_date = moment(sequence_startDate).format("DD/MM/YYYY HH:mm");
+ var new_end_date = moment(sequence_endDate).format("DD/MM/YYYY HH:mm");
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("session_id", selected_session_id);
+ form.append("sequence_title", new_title);
+ form.append("sequence_start", new_start_date);
+ form.append("sequence_end", new_end_date);
+
+ form.append("agenda", p_detail_sequence_agenda);
+ form.append("objectif", p_detail_sequence_objectif);
+ form.append("commentaire", p_detail_sequence_comment);
+
+
+ //console.log(" form == ", form);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Session_Sequence/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Add_One_Sequence_Session res.data.status = " + res.data.status);
+ //console.log(" In Add_One_Sequence_Session res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ setAdd_One_Sequence_Session_api("true");
+ setAdd_One_Sequence_Session_result(res.data.message);
+
+ Getall_Sequence_Of_Session(selected_session_id);
+
+ setp_detail_sequence_title("");
+ setp_detail_sequence_comment("");
+
+ setp_detail_sequence_agenda("");
+ setp_detail_sequence_objectif("");
+
+ setsequence_startDate();
+ setsequence_endDate();
+
+
+
+ alert(res.data.message);
+ Close_Dialog_Detail_seq_open();
+ Dialog_DIALOG_AGENDA_handleClose_buton();
+ }
+ else {
+ setAdd_One_Sequence_Session_api("false");
+ setAdd_One_Sequence_Session_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+
+
+ setLoading(false);
+ console.warn('UpdateStagiaireData : Not good man :( Add_One_Sequence_Session = ' + error);
+ setAdd_One_Sequence_Session_api("false");
+ alert(" Impossible d'ajouter la séquence");
+ })
+ }
+
+ const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]);
+
+ const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState();
+ const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState();
+ const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState();
+ function Getall_Training_Employee_No_Filter(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_List_Ressource_Humaine_no_filter/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Training_Employee_No_Filter res.data.status = " + res.data.status);
+ //console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message);
+ setGetall_Training_Employee_No_Filter_api("true");
+ setGetall_Training_Employee_No_Filter_result(res.data.message);
+
+ var new_data2 = [];
+ const new_data = res.data.message.map((x) => {
+
+ //---
+ var localid = JSON.parse(x).id;
+ var local_id = JSON.parse(x)._id;
+ var local_nom = JSON.parse(x).nom;
+ var local_prenom = JSON.parse(x).prenom;
+ var local_ismanager = JSON.parse(x).ismanager;
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom + " " + local_prenom,
+ "nom": local_nom,
+ "prenom": local_prenom,
+ "ismanager": local_ismanager
+ };
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0)
+ setNew_Getall_Training_Employee_No_Filter_result(new_data2);
+
+ }
+ else {
+ setGetall_Training_Employee_No_Filter_api("false");
+ setGetall_Training_Employee_No_Filter_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Training_Employee_No_Filter = ', error);
+ setGetall_Training_Employee_No_Filter_api("false");
+ alert(" Impossible de recuperer la liste des employés");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [New_Getall_Training_Materiel_No_Filter_result, setNew_Getall_Training_Materiel_No_Filter_result] = useState([]);
+
+
+ const [Getall_Training_Materiel_No_Filter_api, setGetall_Training_Materiel_No_Filter_api] = useState();
+ const [Getall_Training_Materiel_No_Filter_message, setGetall_Training_Materiel_No_Filter_message] = useState();
+ const [Getall_Training_Materiel_No_Filter_result, setGetall_Training_Materiel_No_Filter_result] = useState();
+ function Getall_Training_Materiel_No_Filter(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_List_Ressource_Materielle_no_filter/";
+
+ setLoading(true);
+
+ axios.post(myurl, form).then(res => {
+
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Training_Materiel_No_Filter res.data.status = " + res.data.status);
+ //console.log(" In Getall_Training_Materiel_No_Filter res.data.message r_class = " + res.data.message);
+ setGetall_Training_Materiel_No_Filter_api("true");
+ setGetall_Training_Materiel_No_Filter_result(res.data.message);
+
+ var new_data2 = [];
+ const new_data = res.data.message.map((x) => {
+
+ //---
+ var localid = JSON.parse(x).id;
+ var local_id = JSON.parse(x)._id;
+ var local_nom = JSON.parse(x).nom;
+ var local_ref_interne = JSON.parse(x).ref_interne;
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "nom": local_nom,
+ "ref_interne": local_ref_interne,
+
+ };
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0)
+ setNew_Getall_Training_Materiel_No_Filter_result(new_data2);
+ }
+ else {
+ setGetall_Training_Materiel_No_Filter_api("false");
+ setGetall_Training_Materiel_No_Filter_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+
+ setLoading(false);
+ console.warn('Not good man :( Getall_Training_Materiel_No_Filter = ', error);
+ setGetall_Training_Materiel_No_Filter_api("false");
+ alert(" Impossible de recuperer la liste du materiel");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+ const [Add_One_Sequence_Session_Ressource_Mass_api, setAdd_One_Sequence_Session_Ressource_Mass_api] = useState();
+ const [Add_One_Sequence_Session_Ressource_Mass_message, setAdd_One_Sequence_Session_Ressource_Mass_message] = useState();
+ const [Add_One_Sequence_Session_Ressource_Mass_result, setAdd_One_Sequence_Session_Ressource_Mass_result] = useState();
+ const Add_One_Sequence_Session_Ressource_Mass = tab_ids => {
+
+ var new_ressource_type = Dialog_seq_ressource_1_selected_type_ressource;
+ var new_ressource_id = Dialog_seq_ressource_1_selected_ressource_id;
+ var new_ressource_poste = Dialog_seq_ressource_1_selected_ressource_poste;
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("tab_sequence_session_id", tab_selected_sequence_id);
+ form.append("poste", new_ressource_poste);
+ form.append("related_target_collection", new_ressource_type);
+ form.append("related_target_collection_id", new_ressource_id);
+
+ //console.log(" form == ", form);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Sequence_Affectation_Ressource_Poste_Mass/";
+
+
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Add_One_Sequence_Session_Ressource_Mass res.data.status = " + res.data.status);
+ //console.log(" In Add_One_Sequence_Session_Ressource_Mass res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ setAdd_One_Sequence_Session_Ressource_Mass_api("true");
+ setAdd_One_Sequence_Session_Ressource_Mass_result(res.data.message);
+
+ Getall_List_Sequence_Ressource(selected_sequence_id);
+
+ setDialog_seq_ressource_1_selected_type_ressource();
+ setDialog_seq_ressource_1_selected_ressource_id();
+ setDialog_seq_ressource_1_selected_ressource_poste();
+
+ setAdd_One_Sequence_Session_mass();
+ settab_selected_sequence_id([]);
+
+ alert(res.data.message);
+ Dialog_seq_ressource_1_handleClose_buton();
+ }
+ else {
+ setAdd_One_Sequence_Session_Ressource_Mass_api("false");
+ setAdd_One_Sequence_Session_Ressource_Mass_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+
+
+ setLoading(false);
+ console.warn('UpdateStagiaireData : Not good man :( Add_One_Sequence_Session_Ressource_Mass = ' + error);
+ setAdd_One_Sequence_Session_Ressource_Mass_api("false");
+ alert(" Impossible d'ajouter la ressource à la séquence");
+ })
+ }
+
+
+ const [Getall_Sequence_Of_Session_result_planning_view, setGetall_Sequence_Of_Session_result_planning_view] = useState([]);
+
+ const [Getall_Sequence_Of_Session_api, setGetall_Sequence_Of_Session_api] = useState();
+ const [Getall_Sequence_Of_Session_message, setGetall_Sequence_Of_Session_message] = useState();
+ const [Getall_Sequence_Of_Session_result, setGetall_Sequence_Of_Session_result] = useState([]);
+ function Getall_Sequence_Of_Session(local_session_id) {
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("session_id", local_session_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Session_Sequence_List/";
+
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Sequence_Of_Session res.data.status = " + res.data.status);
+ //console.log(" In Getall_Sequence_Of_Session res.data.message r_class = " + res.data.message);
+ setGetall_Sequence_Of_Session_api("true");
+ setGetall_Sequence_Of_Session_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) => {
+
+ //---
+ 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_title = JSON.parse(x).sequence_title;
+ var local_start = new Date(moment(JSON.parse(x).sequence_start, "DD/MM/YYYY hh:mm"))
+ var local_end = new Date(moment(JSON.parse(x).sequence_end, "DD/MM/YYYY hh:mm"))
+
+ 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;
+
+
+ //---
+ var node = {
+ "_id": localid,
+ "id": localid,
+ "title": local_title,
+ "start": local_start,
+ "end": local_end,
+ "local_agenda": local_agenda,
+ "local_objectif": local_objectif,
+ "local_comment": local_session_comment,
+ };
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0) {
+ setGetall_Sequence_Of_Session_result_planning_view(new_data2);
+
+ // console.log(" ### new_data2 = ", new_data2);
+
+ }
+
+
+ }
+ else {
+ setGetall_Sequence_Of_Session_api("false");
+ setGetall_Sequence_Of_Session_message(res.data.message);
+ alert(res.data.message)
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Sequence_Of_Session = ', error);
+ setGetall_Sequence_Of_Session_api("false");
+ alert("Impossible de récuperer la liste des séquences")
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+
+ const [selectionModel_sequence, setselectionModel_sequence] = React.useState([]);
+ const [Dialog_seq_1_message, setDialog_seq_1_message] = React.useState(false);
+ const [Dialog_seq_1_open, setDialog_seq_1_open] = React.useState(false);
+
+ function Close_Dialog_Detail_seq_open() {
+ clearSequence_Data();
+ setDialog_seq_1_open(false);
+ }
+
+ function Dialog_1_handle_change_participant_session(message) {
+ setDialog_seq_1_message(message);
+ setDialog_seq_1_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_handleClose_buton = () => {
+ setDialog_DIALOG_AGENDA_open(false);
+ };
+
+ 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_planif_periode_type, setDialog_seq_planif_periode_type] = React.useState("");
+
+
+ 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([]);
+
+
+ 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 = () => {
+ setp_detail_sequence_event_type_semaine_id("");
+ setp_detail_sequence_event_type_semaine_title("");
+ setp_detail_sequence_event_type_semaine_comment("");
+ setp_detail_sequence_event_type_semaine_agenda("");
+ setp_detail_sequence_event_type_semaine_objectif("");
+
+ setsequence_event_type_semaine_startDate(new Date());
+ setsequence_event_type_semaine_endDate(new Date());
+
+ setDialog_EVENT_SEMAINE_TYPE_open(false);
+ setDialog_seq_CREATION_SEMAINE_TYPE_open(true);
+ };
+
+
+
+ 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_seq_CREATION_SEMAINE_TYPE_open(false)
+ setDialog_EVENT_SEMAINE_TYPE_open(true);
+
+ }
+
+
+ const Add_event_type_semaine = event => {
+
+ setDialog_seq_CREATION_SEMAINE_TYPE_open(false);
+
+ 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;
+
+ moment.locale('fr');
+ var local_getDay = moment(sequence_event_type_semaine_startDate).format('dddd')
+
+
+
+ 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,
+ "day_week": local_getDay,
+ };
+ 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_id("");
+ 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());
+
+
+ setDialog_EVENT_SEMAINE_TYPE_open(true);
+
+ }
+
+
+
+ const Update_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 = p_detail_sequence_event_type_semaine_id
+
+ var local_tab = semaine_type_event;
+
+ moment.locale('fr');
+ var local_getDay = moment(sequence_event_type_semaine_startDate).format('dddd')
+
+
+
+ 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,
+ "day_week": local_getDay,
+ };
+
+
+ for (let i = 0; i < local_tab.length; i++) {
+ var local_node = local_tab[i]
+
+
+ if (String(local_node['id']) === String(p_detail_sequence_event_type_semaine_id)) {
+ local_node['title'] = new_title;
+ local_node['start'] = new_start_date;
+ local_node['end'] = new_end_date;
+ local_node['agenda'] = new_agenda;
+ local_node['objectif'] = new_objectif;
+ local_node['comment'] = new_comment;
+ local_node['day_week'] = local_getDay;
+ }
+ }
+
+
+ setsemaine_type_event(local_tab);
+
+ Dialog_EVENT_SEMAINE_TYPE_handleClose_buton();
+ //console.log(" semaine_type_event = ", semaine_type_event);
+
+
+ setp_detail_sequence_event_type_semaine_id("");
+ 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());
+
+ setDialog_seq_CREATION_SEMAINE_TYPE_open(true);
+ }
+
+
+ const Remove_event_type_semaine = event => {
+
+ var local_id = p_detail_sequence_event_type_semaine_id
+
+ var local_tab = semaine_type_event;
+
+
+
+ const result = local_tab.filter(element => element.id !== local_id);
+
+ setsemaine_type_event(result);
+
+ Dialog_EVENT_SEMAINE_TYPE_handleClose_buton();
+ //console.log(" semaine_type_event = ", semaine_type_event);
+
+
+ setp_detail_sequence_event_type_semaine_id("");
+ 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());
+
+ setDialog_seq_CREATION_SEMAINE_TYPE_open(true);
+ }
+
+ const [planification_model_date_from, setplanification_model_date_from] = useState();
+ const [planification_model_date_to, setplanification_model_date_to] = useState();
+
+
+ const [planification_ecrase_existing_seq, setplanification_ecrase_existing_seq] = useState("1");
+
+
+ function submenu_add_one_Ressource() {
+ setDialog_seq_ressource_1_open(true);
+ }
+
+
+ function clearSequence_Data() {
+ setupdate_sequence();
+ setp_detail_sequence_title("");
+
+ setp_detail_sequence_comment("");
+ setp_detail_sequence_agenda("");
+ setp_detail_sequence_objectif("");
+
+ setsequence_startDate(new Date());
+ setsequence_endDate(new Date());
+
+ }
+
+ function submenu_add_one_sequence() {
+ setupdate_sequence();
+ setp_detail_sequence_title("");
+
+ setp_detail_sequence_comment("");
+ setp_detail_sequence_agenda("");
+ setp_detail_sequence_objectif("");
+
+ setsequence_startDate(new Date());
+ setsequence_endDate(new Date());
+
+ setDialog_seq_1_open(true);
+ }
+
+
+ function submenu_update_sequence() {
+ setupdate_sequence("1");
+
+ setDialog_seq_1_open(true);
+ }
+
+
+ const [nb_sequence, setnb_sequence] = useState("0");
+
+ const [Dialog_seq_ressource_1_message, setDialog_seq_ressource_1_message] = React.useState(false);
+ const [Dialog_seq_ressource_1_open, setDialog_seq_ressource_1_open] = React.useState(false);
+
+
+ function Dialog_1_handle_change_participant_session(message) {
+ setDialog_seq_ressource_1_message(message);
+ setDialog_seq_ressource_1_open(true);
+ }
+
+ const Dialog_seq_ressource_1_handleClose = () => {
+ //alert(" Utiliser le bouton 'fermer' ");
+ //setOpen(false);
+ };
+
+ const Dialog_seq_ressource_1_handleClose_buton = () => {
+ setDialog_seq_ressource_1_open(false);
+ };
+
+ const handleEventClick = (arg) => {
+
+
+ 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.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_seq_choix_model_emargement, setDialog_seq_choix_model_emargement] = React.useState("0");
+
+
+ const New_Option_Type_Ressource = [
+ { "id": "0", "label": "Employe", "value": "ressource_humaine" },
+ { "id": "1", "label": "Materiel", "value": "ressource_materielle" },
+ ]
+
+ const New_Option_Model_Sequence = [
+ { "id": "0", "label": "Calendrier de travail", "value": "0" },
+ { "id": "1", "label": "La 1/2 journée", "value": "1" },
+ { "id": "2", "label": "La journée", "value": "2" },
+ { "id": "3", "label": "Un modèle à ma semaine", "value": "3" },
+ { "id": "4", "label": "Un modèle à au mois", "value": "4" },
+ ]
+
+ const datagridSx = {
+ borderRadius: 2,
+ marginRight: 1,
+ marginLeft: 1,
+ border: 0,
+ "& .MuiDataGrid-main": { borderRadius: 0 },
+
+ "& .MuiDataGrid-virtualScrollerRenderZone": {
+ "& .MuiDataGrid-row": {
+ "&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
+ }
+ },
+ "& .MuiDataGrid-columnHeaders": {
+ backgroundColor: "#c8cfd5",
+ color: "black",
+ fontSize: 16
+ }
+ };
+
+
+ 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();
+ const Add_Automatic_Sequence_Session = event => {
+
+ var new_title = p_detail_sequence_title;
+ var new_start_date = moment(sequence_startDate).format("DD/MM/YYYY HH:mm");
+ var new_end_date = moment(sequence_endDate).format("DD/MM/YYYY HH:mm");
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("session_id", selected_session_id);
+ form.append("jounree_modele_id", "");
+ form.append("option", Dialog_seq_choix_model_emargement);
+ form.append("ecrase_existing", planification_ecrase_existing_seq);
+
+
+ //console.log(" form == ", form);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Create_Automatic_Sequence/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Add_Automatic_Sequence_Session res.data.status = " + res.data.status);
+ //console.log(" In Add_Automatic_Sequence_Session res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ setAdd_Automatic_Sequence_Session_api("true");
+ setAdd_Automatic_Sequence_Session_result(res.data.message);
+
+ Getall_Sequence_Of_Session(selected_session_id);
+
+ setp_detail_sequence_title("");
+ setp_detail_sequence_comment("");
+
+ setp_detail_sequence_agenda("");
+ setp_detail_sequence_objectif("");
+
+ setsequence_startDate();
+ setsequence_endDate();
+
+ setDialog_seq_choix_model_emargement_open(false);
+ setDialog_seq_planif_periode_type("");
+ setplanification_ecrase_existing_seq("");
+
+ alert(res.data.message);
+ Close_Dialog_Detail_seq_open();
+
+ }
+ else {
+ setAdd_Automatic_Sequence_Session_api("false");
+ setAdd_Automatic_Sequence_Session_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+
+
+ setLoading(false);
+ console.warn('UpdateStagiaireData : Not good man :( Add_Automatic_Sequence_Session = ' + error);
+ setAdd_Automatic_Sequence_Session_api("false");
+ alert(" Impossible de créer automatiquement les séquences");
+ })
+ }
+
+ const [Update_One_Sequence_Session_api, setUpdate_One_Sequence_Session_api] = useState();
+ const [Update_One_Sequence_Session_message, setUpdate_One_Sequence_Session_message] = useState();
+ const [Update_One_Sequence_Session_result, setUpdate_One_Sequence_Session_result] = useState();
+ const Update_One_Sequence_Session = event => {
+
+ var new_title = p_detail_sequence_title;
+ var new_start_date = moment(sequence_startDate).format("DD/MM/YYYY HH:mm");
+ var new_end_date = moment(sequence_endDate).format("DD/MM/YYYY HH:mm");
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("session_id", selected_session_id);
+ form.append("sequence_title", new_title);
+ form.append("sequence_start", new_start_date);
+ form.append("sequence_end", new_end_date);
+
+ form.append("agenda", p_detail_sequence_agenda);
+ form.append("objectif", p_detail_sequence_objectif);
+ form.append("commentaire", p_detail_sequence_comment);
+
+ form.append("_id", selected_sequence_id);
+
+ //console.log(" form == ", form);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Session_Sequence/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Update_One_Sequence_Session res.data.status = " + res.data.status);
+ //console.log(" In Update_One_Sequence_Session res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ setUpdate_One_Sequence_Session_api("true");
+ setUpdate_One_Sequence_Session_result(res.data.message);
+
+ Getall_Sequence_Of_Session(selected_session_id);
+
+ setp_detail_sequence_title("");
+ setp_detail_sequence_comment("");
+
+ setp_detail_sequence_agenda("");
+ setp_detail_sequence_objectif("");
+
+ setsequence_startDate();
+ setsequence_endDate();
+
+ setupdate_sequence();
+
+ alert(res.data.message);
+ Close_Dialog_Detail_seq_open();
+ }
+ else {
+ setUpdate_One_Sequence_Session_api("false");
+ setUpdate_One_Sequence_Session_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+
+
+ setLoading(false);
+ console.warn('UpdateStagiaireData : Not good man :( Update_One_Sequence_Session = ' + error);
+ setUpdate_One_Sequence_Session_api("false");
+ alert(" Impossible de mettre à jour la séquence");
+ })
+ }
+
+
+
+ const [Add_Automatic_Sequence_Session_From_Week_Model_api, setAdd_Automatic_Sequence_Session_From_Week_Model_api] = useState();
+ const [Add_Automatic_Sequence_Session_From_Week_Model_message, setAdd_Automatic_Sequence_Session_From_Week_Model_message] = useState();
+ const [Add_Automatic_Sequence_Session_From_Week_Model_result, setAdd_Automatic_Sequence_Session_From_Week_Model_result] = useState([]);
+ const Add_Automatic_Sequence_Session_From_Week_Model = event => {
+
+ var new_title = p_detail_sequence_title;
+ var new_start_date = moment(planification_model_date_from).format("DD/MM/YYYY HH:mm");
+ var new_end_date = moment(planification_model_date_to).format("DD/MM/YYYY HH:mm");
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("session_id", selected_session_id);
+ form.append("planif_date_debut", new_start_date);
+ form.append("planif_date_fin", new_end_date);
+ form.append("ecrase_existing", planification_ecrase_existing_seq);
+
+ var json_str = JSON.stringify(semaine_type_event)
+ form.append("semaine_tab_event", json_str);
+
+ //console.log(" form == ", form);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Create_Automatic_Sequence_From_Week_Model/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Add_Automatic_Sequence_Session_From_Week_Model res.data.status = " + res.data.status);
+ //console.log(" In Add_Automatic_Sequence_Session_From_Week_Model res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ setAdd_Automatic_Sequence_Session_From_Week_Model_api("true");
+ setAdd_Automatic_Sequence_Session_From_Week_Model_result(res.data.message);
+
+ Getall_Sequence_Of_Session(selected_session_id);
+
+ setp_detail_sequence_title("");
+ setp_detail_sequence_comment("");
+
+ setp_detail_sequence_agenda("");
+ setp_detail_sequence_objectif("");
+
+ setsequence_startDate();
+ setsequence_endDate();
+
+ setDialog_seq_choix_model_emargement_open(false);
+ setDialog_seq_planif_periode_type("");
+
+ alert(res.data.message);
+ Close_Dialog_Detail_seq_open();
+ Dialog_seq_CREATION_SEMAINE_TYPE_handleClose_buton();
+
+ }
+ else {
+ setAdd_Automatic_Sequence_Session_From_Week_Model_api("false");
+ setAdd_Automatic_Sequence_Session_From_Week_Model_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+
+
+ setLoading(false);
+ console.warn('UpdateStagiaireData : Not good man :( Add_Automatic_Sequence_Session_From_Week_Model = ' + error);
+ setAdd_Automatic_Sequence_Session_From_Week_Model_api("false");
+ alert(" Impossible de créer automatiquement les séquences");
+ })
+ }
+
+
+ const [Add_Automatic_Sequence_Session_From_Month_Model_api, setAdd_Automatic_Sequence_Session_From_Month_Model_api] = useState();
+ const [Add_Automatic_Sequence_Session_From_Month_Model_message, setAdd_Automatic_Sequence_Session_From_Month_Model_message] = useState();
+ const [Add_Automatic_Sequence_Session_From_Month_Model_result, setAdd_Automatic_Sequence_Session_From_Month_Model_result] = useState([]);
+ const Add_Automatic_Sequence_Session_From_Month_Model = event => {
+
+ var new_title = p_detail_sequence_title;
+ var new_start_date = moment(planification_model_date_from).format("DD/MM/YYYY HH:mm");
+ var new_end_date = moment(planification_model_date_to).format("DD/MM/YYYY HH:mm");
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("session_id", selected_session_id);
+ form.append("planif_date_debut", new_start_date);
+ form.append("planif_date_fin", new_end_date);
+ form.append("ecrase_existing", planification_ecrase_existing_seq);
+
+ var json_str = JSON.stringify(semaine_type_event)
+ form.append("semaine_tab_event", json_str);
+
+ //console.log(" form == ", form);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Create_Automatic_Sequence_From_Month_Model/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Add_Automatic_Sequence_Session_From_Month_Model res.data.status = " + res.data.status);
+ //console.log(" In Add_Automatic_Sequence_Session_From_Month_Model res.data.message r_class = " + res.data.message);
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ setAdd_Automatic_Sequence_Session_From_Month_Model_api("true");
+ setAdd_Automatic_Sequence_Session_From_Month_Model_result(res.data.message);
+
+ Getall_Sequence_Of_Session(selected_session_id);
+
+ setp_detail_sequence_title("");
+ setp_detail_sequence_comment("");
+
+ setp_detail_sequence_agenda("");
+ setp_detail_sequence_objectif("");
+
+ setsequence_startDate();
+ setsequence_endDate();
+
+ setDialog_seq_choix_model_emargement_open(false);
+ setDialog_seq_planif_periode_type("");
+
+ alert(res.data.message);
+ Close_Dialog_Detail_seq_open();
+ Dialog_seq_CREATION_SEMAINE_TYPE_handleClose_buton();
+
+ }
+ else {
+ setAdd_Automatic_Sequence_Session_From_Month_Model_api("false");
+ setAdd_Automatic_Sequence_Session_From_Month_Model_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+
+
+ setLoading(false);
+ console.warn('UpdateStagiaireData : Not good man :( Add_Automatic_Sequence_Session_From_Month_Model = ' + error);
+ setAdd_Automatic_Sequence_Session_From_Month_Model_api("false");
+ alert(" Impossible de créer automatiquement les séquences");
+ })
+ }
+
+
+
+ const handleSelect = (info) => {
+ setp_detail_sequence_title("Nouvelle")
+ setsequence_startDate(info.start)
+ setsequence_endDate(info.end)
+ setp_detail_sequence_agenda("");
+ setp_detail_event_id("");
+ setp_detail_sequence_objectif("");
+ setp_detail_sequence_comment("");
+ setDialog_DIALOG_AGENDA_open(true);
+ };
+
+ useEffect(() => {
+
+ Getall_Training_Employee_No_Filter();
+ Getall_Training_Materiel_No_Filter();
+
+ Getall_Sequence_Of_Session(props.related_collection_recid);
+
+ }, [])
+
+ const [SessionendDate, setSessionendDate] = useState();
+
+ const filterPassedTime_end = (time) => {
+ const currentDate = new Date();
+ const selectedDate = new Date(time);
+
+ return currentDate.getTime() < selectedDate.getTime();
+ };
+
+ const [SessionstartDate, setSessionstartDate] = useState();
+
+ const filterPassedTime_start = (time) => {
+ const currentDate = new Date();
+ const selectedDate = new Date(time);
+
+ return currentDate.getTime() < selectedDate.getTime();
+ };
+
+ const Dialog_seq_1_handleClose = () => {
+ //alert(" Utiliser le bouton 'fermer' ");
+ //setOpen(false);
+ };
+
+
return (
@@ -358,6 +1951,1739 @@ const Module_Session_Planification = (props) => {
}
+ {/*** Dialog ajout sequence */}
+
+
+
+
+
+ {String(update_sequence) !== "1" && "Ajouter une séquence"}
+ {String(update_sequence) === "1" && "Mettre à jour une séquence"}
+
+
+
+
+
+ {Dialog_seq_1_message}
+
+
+ Titre
+ {
+ setp_detail_sequence_title(e.target.value);
+ }
+ }
+
+ />
+
+
+
+ Debut
+ {
+
+ return setsequence_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_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_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
+
+
+
+
+
+
+
+
+
+
+
+ {String(update_sequence) !== "1" && Ajouter }
+ {String(update_sequence) === "1" && Mettre à jour }
+
+
+
+
+
+
+ Fermer
+
+
+
+
+
+
+
+ {/*** Fin ajout sequence */}
+
+
+ {/*** Dialog Ajout Ressources */}
+
+
+
+ Ajout ressource
+
+
+ {Dialog_seq_ressource_1_message}
+
+
+
+ Type de ressource
+
{
+ if (value && value.value) {
+
+ setDialog_seq_ressource_1_selected_type_ressource(value.value);
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
+ {String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_humaine" && Ressource Humaine
+
+
{
+ if (value && value._id) {
+ setDialog_seq_ressource_1_selected_ressource_id(value._id);
+
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+ }
+
+
+ {String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_materielle" && Ressource Materiel
+
+
{
+ if (value && value._id) {
+ setDialog_seq_ressource_1_selected_ressource_id(value._id);
+
+
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+ }
+
+
+ Poste
+ {
+
+ setDialog_seq_ressource_1_selected_ressource_poste(e.target.value);
+ }
+ }
+
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+ {String(Add_One_Sequence_Session_mass) !== "1" && Ajouter }
+
+ {String(Add_One_Sequence_Session_mass) === "1" && Ajouter en masse }
+
+
+
+ Fermer
+
+
+
+
+
+
+
+
+ {/*** Fin ajout ressource */}
+
+ {/**** Dialogue pour EVENT SEMAINE TYPE */}
+
+
+
+ MySy Information
+
+
+ {Dialog_EVENT_SEMAINE_TYPE_message}
+
+
+
+
+
+
Type
+
+
+
+ {
+ if (String(props.write_access) === "1") {
+
+ if (value && value.value) {
+ setp_detail_event_type(value.value);
+
+ }
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
+
+ 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
+
+
+
+
+
+
+
+
+
+ {String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "" &&
+ {p_detail_sequence_event_type_semaine_id && String(p_detail_sequence_event_type_semaine_id) !== "" && Mettre à jour }
+
+ {(!p_detail_sequence_event_type_semaine_id || String(p_detail_sequence_event_type_semaine_id) === "") && Ajouter }
+
+
+
+
}
+
+ Fermer
+
+
+
+
+
+
+
+
+ {p_detail_sequence_event_type_semaine_id && String(p_detail_sequence_event_type_semaine_id) !== "" &&
+
+
+
+
{
+
+ }}
+ >
+ Supprimer
+
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+ ×
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, la séquence sera définitivement supprimée .
+
+
+
+
+ {
+ Remove_event_type_semaine();
+ //console.log('modal closed ');
+ close();
+ }}> Valider
+
+
+
+ {
+ //console.log('modal closed ');
+ close();
+ }}
+ >
+ Annuler
+
+
+
+
+ )}
+
+
+
+
+ }
+
+
+
+ {/**** fin pour Dialogue pour EVENT SEMAINE TYPE */}
+
+ {/* Dialogue CREATION SEMAINE TYPE */}
+
+
+
+ {Dialog_seq_CREATION_SEMAINE_TYPE_message}
+
+
+ {Dialog_seq_CREATION_SEMAINE_TYPE_message}
+
+
+
+ {SessionstartDate && SessionendDate &&
+
+ Debut Formation = {new Date(moment(SessionstartDate, "DD/MM/YYYY")).toISOString().split('T')[0]}
+
+
+
+
+ Fin Formation = {new Date(moment(SessionendDate, "DD/MM/YYYY")).toISOString().split('T')[0]}
+
+
+
+
}
+
+
+
+
+
+ {Dialog_seq_planif_periode_type && String(Dialog_seq_planif_periode_type) === "mois" && }
+ //plugins={[timeGridPlugin]}
+
+
+
+
+ plugins={[daygridPlugin, timeGridPlugin, 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}
+ />}
+
+
+ {Dialog_seq_planif_periode_type && String(Dialog_seq_planif_periode_type) === "semaine" && }
+ //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 :
+ {
+
+ let local_date = new Date(date).getTime();
+ let date_end_session = new Date(SessionendDate).getTime();
+ let date_start_session = new Date(SessionstartDate).getTime();
+
+ /* console.log(" local_date = ", local_date);
+ console.log(" date_end_session = ", date_end_session);
+ console.log(" date_start_session = ", date_start_session);*/
+
+ if (local_date > date_end_session) {
+ alert(" La date est après la fin de la session");
+ return;
+ }
+
+ if (local_date < date_start_session) {
+ alert(" La date est avant le début de la session");
+ return;
+ }
+
+ setplanification_model_date_from(date);
+ }
+ }
+ showTimeSelect={false}
+ filterTime={filterPassedTime_start}
+ dateFormat="dd/MM/yyyy"
+ className="disabled_style "
+ locale='fr-FR'
+
+ />
+
+
+
+ Dupliquer Au :
+ {
+
+ let local_date = new Date(date).getTime();
+ let date_end_session = new Date(SessionendDate).getTime();
+ let date_start_session = new Date(SessionstartDate).getTime();
+
+ /* console.log(" local_date = ", local_date);
+ console.log(" date_end_session = ", date_end_session);
+ console.log(" date_start_session = ", date_start_session);*/
+
+
+ if (local_date > date_end_session) {
+ alert(" La date est après la fin de la session");
+ return;
+ }
+
+ if (local_date < date_start_session) {
+ alert(" La date est avant le début de la session");
+ return;
+ }
+
+ setplanification_model_date_to(date);
+
+ }
+ }
+ showTimeSelect={false}
+ filterTime={filterPassedTime_start}
+ dateFormat="dd/MM/yyyy"
+ className="disabled_style "
+ locale='fr-FR'
+
+ />
+
+
+
}
+
+
+
+
+
+
+
+
+
+ Ecraser la planification existant
+
+ {
+ setplanification_ecrase_existing_seq(e.target.value);
+
+
+ if (String(e.target.value) === "1") {
+ alert(" Vous allez definitivement supprimer toutes planifications associées à cette session de formation ")
+ }
+ }}
+ >
+ } label="Oui" />
+ } label="Non" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+
+ let date_end_planif = new Date(planification_model_date_to).getTime();
+ let date_start_planif = new Date(planification_model_date_from).getTime();
+
+ if (date_end_planif < date_start_planif) {
+ alert(" La date de début est postérieure à la date de fin ");
+ return;
+ }
+
+
+ if (String(Dialog_seq_planif_periode_type) === "semaine")
+ Add_Automatic_Sequence_Session_From_Week_Model();
+
+ else if (String(Dialog_seq_planif_periode_type) === "mois")
+ Add_Automatic_Sequence_Session_From_Month_Model();
+ }}
+ className="bton_enreg_dialog">Crée en masse
+
+
+
+ Fermer
+
+
+
+
+
+
+
+
+ {/*** fin CREATION SEMAINE TYPE */}
+
+
+ {/* Dialgue pour le choix du modele de sequene (la journée, 1/2 journée, etc*/}
+
+
+
+ Choisir un modèle de planification
+
+
+ {Dialog_seq_choix_model_emargement_message}
+
+
+
+
+
{
+ if (value && value.value) {
+ setDialog_seq_choix_model_emargement(value.value);
+
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+ Ecraser la planification existant
+
+ {
+ setplanification_ecrase_existing_seq(e.target.value);
+
+
+ if (String(e.target.value) === "1") {
+ alert(" Vous allez definitivement supprimer toutes planifications associées à cette session de formation ")
+ }
+ }}
+ >
+ } label="Oui" />
+ } label="Non" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) !== "3" &&
+ String(Dialog_seq_choix_model_emargement) !== "4" && Crée en masse }
+
+
+ {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) === "3" &&
+ {
+ setDialog_seq_planif_periode_type("semaine");
+ setp_detail_sequence_event_type_semaine_id("");
+ setDialog_seq_choix_model_emargement_open(false);
+ setDialog_seq_CREATION_SEMAINE_TYPE_open(true);
+ setDialog_seq_CREATION_SEMAINE_TYPE_message(" Planification à la SEMAINE ")
+ setplanification_model_date_from(SessionstartDate);
+
+ setplanification_model_date_to(SessionendDate);
+
+
+ }} className="bton_enreg_dialog">Configurer la semaine }
+
+
+ {Dialog_seq_choix_model_emargement && String(Dialog_seq_choix_model_emargement) === "4" &&
+ {
+ setDialog_seq_planif_periode_type("mois");
+ setp_detail_sequence_event_type_semaine_id("");
+ setDialog_seq_choix_model_emargement_open(false);
+ setDialog_seq_CREATION_SEMAINE_TYPE_open(true);
+ setDialog_seq_CREATION_SEMAINE_TYPE_message(" Planification au MOIS ")
+ setplanification_model_date_from(SessionstartDate);
+
+ setplanification_model_date_to(SessionendDate);
+
+ }} className="bton_enreg_dialog">Configurer le mois }
+
+
+
+
+ Fermer
+
+
+
+
+
+
+
+
+ {/*** fin dialog choix modele sequence */}
+
+ {/**** Dialogue pour AGENDA */}
+
+
+
+ MySy Information
+
+
+ {Dialog_DIALOG_AGENDA_message}
+
+
+
+
+
Type
+
+
+
+ {
+ if (String(props.write_access) === "1") {
+
+ if (value && value.value) {
+ setp_detail_event_type(value.value);
+
+ }
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
+
+ Titre
+ {
+ if (String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "")
+ setp_detail_sequence_title(e.target.value);
+ }
+ }
+
+ />
+
+
+
+ Debut
+ {
+
+ return setsequence_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_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_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
+
+
+
+
+
+
+
+
+
+ {String(props.write_access) === "1" && String(p_detail_sequence_session_id) === "" &&
+ {p_detail_event_id && String(p_detail_event_id) !== "" && Mettre à jour }
+ {(!p_detail_event_id || String(p_detail_event_id) === "") && Ajouter }
+
+
+
+
}
+
+ Fermer
+
+
+
+
+
+
+
+
+ {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 .
+
+
+
+
+ {
+ Delete_Sequence_Session_Data(p_detail_event_id);
+ //console.log('modal closed ');
+ close();
+ }}> Valider
+
+
+
+ {
+ //console.log('modal closed ');
+ close();
+ }}
+ >
+ Annuler
+
+
+
+
+ )}
+
+
+
+
+ }
+
+
+
+
+ {/*** fin dialogue pr agenda */}
+
+
+
+ Planninfication session de formation
+
+
+
+
+
+
+
+
+
+
+ Affichage : planning
+ Liste
+
+
+
+ {display_view && String(display_view) === "list" &&
+
+
+
+
+ {
+ setselectionModel_sequence(newSelectionModel);
+
+ }}
+ selectionModel={selectionModel_sequence}
+
+ localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
+ rows={Getall_Sequence_Of_Session_result.map((item, index) => (
+ {
+ id: index,
+ _id: JSON.parse(item)._id,
+ sequence_start: JSON.parse(item).sequence_start,
+ sequence_end: JSON.parse(item).sequence_end,
+ session_id: JSON.parse(item).session_id,
+ sequence_title: JSON.parse(item).sequence_title,
+ agenda: JSON.parse(item).agenda,
+ objectif: JSON.parse(item).objectif,
+ commentaire: JSON.parse(item).commentaire,
+ }
+ ))}
+
+ columns={columns_sequence}
+ 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';
+ }
+
+
+
+ }}
+
+ />
+
+
+
+ {selectionModel_sequence && selectionModel_sequence.length > 1 &&
+
+
Traitement en masse / Séquence
+
+ Choisir une action
+ Ajouter Ressource
+ Supprimer
+
+
+
+
+ {actionmass_sequence_val && String(actionmass_sequence_val).length > 1 &&
+
+ Traiter
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+
+ {close => (
+
+
+ ×
+
+
MySy Information
+ {String(actionmass_sequence_val) === "ajout_ressource" &&
+ {' '}
+
+ Confirmer l'action d'ajout de ressource en masse.
+
}
+
+ {String(actionmass_sequence_val) === "supprimer" &&
+ {' '}
+
+ Confirmer l'action de suppression en masse.
+
}
+
+
+
+
+ {
+ actionmass_sequence_Traitement();
+ close();
+ }}> Valider
+
+
+
+ {
+ //console.log('modal closed ');
+ close();
+ }}
+ >
+ Annuler
+
+
+
+
+ )}
+
+ }
+
+
+
+
+
+ }
+
+
+
+
+
}
+
+ {display_view && String(display_view) === "planning" && Getall_Sequence_Of_Session_result_planning_view &&
+
+
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}
+
+
+ />
+
+
+
+
+
+
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {String(display_detail_sequence) === "1" &&
+
+
Titre
+
+
+
+
début
+
+
+
+
Fin
+
+
+
+
+
+
+
+
+
+
+ {
+ setselectionModel_sequence(newSelectionModel);
+
+ }}
+ //selectionModel={selectionModel_sequence}
+
+ localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
+ rows={Getall_List_Sequence_Ressource_result.map((item, index) => (
+ {
+ id: index,
+ _id: JSON.parse(item)._id,
+ related_target_collection_id: JSON.parse(item).related_target_collection_id,
+ related_target_collection: JSON.parse(item).related_target_collection,
+ type_ressource: JSON.parse(item).related_target_collection_object,
+ related_target_collection_object: JSON.parse(item).related_target_collection_object,
+ related_target_collection_id_nom: JSON.parse(item).related_target_collection_id_nom,
+ poste: JSON.parse(item).poste,
+ }
+ ))}
+
+ columns={columns_sequence_ressources_affectation}
+ pageSize={10}
+ className="datagridclass"
+
+ onRowDoubleClick={(newSelectionModel) => {
+
+
+ }}
+
+
+
+ rowsPerPageOptions={[10]}
+ disableSelectionOnClick
+ components={{
+ Toolbar: GridToolbar,
+ }}
+ sx={datagridSx}
+
+
+
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
}
+
+
+
);
}
diff --git a/src/components/Partner_Client.js b/src/components/Partner_Client.js
index 4270aad..0403f99 100644
--- a/src/components/Partner_Client.js
+++ b/src/components/Partner_Client.js
@@ -513,7 +513,7 @@ const Partner_Client = (props) => {
if (rows_list_clients[selected_row_id]) {
- console.log(" OKKKKK ");
+ //console.log(" OKKKKK ");
var line = JSON.parse(rows_list_clients[selected_row_id]);
var clientmail = String(line.email);
@@ -759,22 +759,6 @@ const Partner_Client = (props) => {
}
/>}
- {/*}
{
- setp_filtre1(e.target.value)
- }}
- >
-
- Nom
- Email
-
-
- */}
@@ -1024,12 +1008,12 @@ const Partner_Client = (props) => {
selectionModel={selectionModel}
onRowDoubleClick={(newSelectionModel) => {
- console.log(" 01 GRRRR newSelectionModel.row._id = ", newSelectionModel.row._id);
+ //console.log(" 01 GRRRR newSelectionModel.row._id = ", newSelectionModel.row._id);
setgridline_id(newSelectionModel.row.id);
setselected_id(newSelectionModel.row._id);
//handleClick_edit_session_From_Line(newSelectionModel.row.id);
- console.log(" GRRRR newSelectionModel.row._id = ", newSelectionModel.row._id);
+ //console.log(" GRRRR newSelectionModel.row._id = ", newSelectionModel.row._id);
setDialog_client_open(true);
}}
diff --git a/src/styles/components/_addclassmanual.scss b/src/styles/components/_addclassmanual.scss
index 6db812b..dd671d9 100644
--- a/src/styles/components/_addclassmanual.scss
+++ b/src/styles/components/_addclassmanual.scss
@@ -377,6 +377,7 @@
width: 100%;
border-left: 3mm ridge rgba(211, 220, 50, .6);
float: left;
+ font-size: medium;
}
.detail_class_submenu {
@@ -395,13 +396,21 @@
font-weight: normal;
width: 100%;
height: 2rem !important;
- }
+ }
- .detail_class_submenu:hover:active,
- .detail_class_submenu:hover {
+ .detail_class_submenu:hover:active,
+ .detail_class_submenu:hover {
background-color: #104277;
color: white;
- }
+ }
+
+ .session_caract {
+ width: 100%;
+ padding: 5px;
+ float: left;
+ text-align: left;
+ font-size: small;
+ }
}
@@ -826,6 +835,7 @@
width: 50%;
border-left: 3mm ridge rgba(211, 220, 50, .6);
float: left;
+ font-size: medium;
}
.detail_class_submenu {
@@ -845,13 +855,21 @@
height: 2rem !important;
font-size: 11px;
min-width: 12rem;
- }
+ }
- .detail_class_submenu:hover:active,
- .detail_class_submenu:hover {
+ .detail_class_submenu:hover:active,
+ .detail_class_submenu:hover {
background-color: #104277;
color: white;
- }
+ }
+
+ .session_caract {
+ width: 50%;
+ padding: 5px;
+ float: left;
+ text-align: left;
+ font-size: small;
+ }
}
@@ -1275,6 +1293,7 @@
width: 30%;
border-left: 3mm ridge rgba(211, 220, 50, .6);
float: left;
+ font-size: medium;
}
.detail_class_submenu {
@@ -1302,6 +1321,14 @@
color: white;
}
+ .session_caract {
+ width: 33%;
+ padding: 5px;
+ float: left;
+ text-align: left;
+ font-size: small;
+ }
+
}
@media only screen and (min-width: 1200px) {
@@ -1740,6 +1767,7 @@
width: 30%;
border-left: 3mm ridge rgba(211, 220, 50, .6);
float: left;
+ font-size: medium;
}
.detail_class_submenu {
@@ -1767,6 +1795,14 @@
color: white;
}
+ .session_caract {
+ width: 33%;
+ padding: 5px;
+ float: left;
+ text-align: left;
+ font-size: small;
+ }
+
// - end media
}
diff --git a/src/styles/components/_displayPartnerunite_enseignement.scss b/src/styles/components/_displayPartnerunite_enseignement.scss
index 8007d69..195f6a3 100644
--- a/src/styles/components/_displayPartnerunite_enseignement.scss
+++ b/src/styles/components/_displayPartnerunite_enseignement.scss
@@ -589,10 +589,11 @@
width: 100%;
padding: 5px;
float: left;
- height: 320px !important;
+ height: 350px !important;
min-height: 320px !important;
- max-height: 320px !important;
+ max-height: 350px !important;
margin-bottom: 10px;
+ border: "1px solide";
}
.titre_training_text {
@@ -1238,10 +1239,11 @@
width: 50%;
padding: 5px;
float: left;
- height: 320px !important;
+ height: 350px !important;
min-height: 320px !important;
- max-height: 320px !important;
+ max-height: 350px !important;
margin-bottom: 10px;
+ border: "1px solide";
}
.titre_training_text {
@@ -1531,10 +1533,11 @@
width: 50%;
padding: 5px;
float: left;
- height: 320px !important;
+ height: 350px !important;
min-height: 320px !important;
- max-height: 320px !important;
+ max-height: 350px !important;
margin-bottom: 10px;
+ border: "1px solide";
}
.titre_training_text {
@@ -2120,10 +2123,11 @@
width: 50%;
padding: 5px;
float: left;
- height: 320px !important;
+ height: 350px !important;
min-height: 320px !important;
- max-height: 320px !important;
+ max-height: 350px !important;
margin-bottom: 10px;
+ border: "1px solide";
}
.titre_training_text {