02/05/2024 - 22h
parent
ed985e0dcb
commit
7ee8f2e94d
|
@ -20,7 +20,7 @@ import fileDownload from 'js-file-download'
|
|||
import Popup from 'reactjs-popup';
|
||||
import 'reactjs-popup/dist/index.css';
|
||||
import { FcSearch } from "react-icons/fc";
|
||||
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint, FcAlarmClock, FcMultipleSmartphones, FcWorkflow } from "react-icons/fc";
|
||||
import { FcAlarmClock, FcMultipleSmartphones, FcWorkflow } from "react-icons/fc";
|
||||
import DatePicker from "react-datepicker";
|
||||
import "react-datepicker/dist/react-datepicker.css";
|
||||
import { format } from 'date-fns'
|
||||
|
@ -56,6 +56,14 @@ import Module_Editique from "./Module_Editique";
|
|||
import Module_Attestation_Formation from "./Module_Attestation_Formation";
|
||||
import Module_Evaluation_Positionnement from "./Module_Evaluation_Positionnement";
|
||||
import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
|
||||
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint, FcPlanner } from "react-icons/fc";
|
||||
import { CiBoxList } from "react-icons/ci";
|
||||
import FullCalendar from "@fullcalendar/react";
|
||||
import daygridPlugin from "@fullcalendar/daygrid";
|
||||
import interactionPlugin from "@fullcalendar/interaction";
|
||||
import timeGridPlugin from "@fullcalendar/timegrid";
|
||||
|
||||
import allLocales from '@fullcalendar/core/locales-all'
|
||||
|
||||
|
||||
const DisplayPartnerSession = (props) => {
|
||||
|
@ -2233,6 +2241,7 @@ const DisplayPartnerSession = (props) => {
|
|||
}
|
||||
|
||||
|
||||
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();
|
||||
|
@ -2263,6 +2272,42 @@ const DisplayPartnerSession = (props) => {
|
|||
//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 node = {
|
||||
"_id": localid,
|
||||
"id": localid,
|
||||
"title": local_title,
|
||||
"start": local_start,
|
||||
"end": local_end,
|
||||
"local_agenda": local_agenda,
|
||||
"local_objectif": local_objectif
|
||||
};
|
||||
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");
|
||||
|
@ -9392,6 +9437,7 @@ const DisplayPartnerSession = (props) => {
|
|||
{ "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" },
|
||||
]
|
||||
|
||||
/* Recuperation des evaluations */
|
||||
|
@ -9908,8 +9954,6 @@ const DisplayPartnerSession = (props) => {
|
|||
form.append("survey_type", "hot_eval");
|
||||
|
||||
|
||||
//alert(" mysession = "+mysession); zzzz
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Init_Survey_Tab_For_All_Session_Inscrit/";
|
||||
|
||||
|
||||
|
@ -9944,6 +9988,7 @@ const DisplayPartnerSession = (props) => {
|
|||
})
|
||||
}
|
||||
|
||||
|
||||
function Export_survey_hot_eval_datatab_class() {
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
||||
|
@ -9975,6 +10020,104 @@ const DisplayPartnerSession = (props) => {
|
|||
}
|
||||
|
||||
|
||||
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 (
|
||||
<>
|
||||
<b>{eventInfo.timeText}</b><br />
|
||||
<i>{eventInfo.event.title}</i>
|
||||
</>
|
||||
)
|
||||
};
|
||||
|
||||
|
||||
const handleSelect = (info) => {
|
||||
|
||||
/*if (String(selected_attendee_email).length < 2) {
|
||||
alert(" Vous devez choisir un stagiaire");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
setp_detail_title("Nouvelle")
|
||||
setp_detail_start(info.start)
|
||||
setp_detail_end(info.end)
|
||||
setp_detail_comment("");
|
||||
setp_detail_event_id("");
|
||||
setp_detail_justified(false);
|
||||
setp_detail_event_type("");
|
||||
|
||||
setStartDate(info.start);
|
||||
setendDate(info.end);
|
||||
setDialog_1_open(true);*/
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
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 handleEventClick = (arg) => {
|
||||
|
||||
/* if (String(selected_attendee_email).length < 2) {
|
||||
alert(" Vous devez choisir un stagiaire");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
setp_detail_title(arg.event.title)
|
||||
setp_detail_start(arg.event.start)
|
||||
setp_detail_end(arg.event.end)
|
||||
setp_detail_event_id(arg.event.id);
|
||||
|
||||
if (arg.event.extendedProps.comment) {
|
||||
setp_detail_comment(arg.event.extendedProps.comment);
|
||||
}
|
||||
else
|
||||
setp_detail_comment("");
|
||||
|
||||
|
||||
if (arg.event.extendedProps.justified) {
|
||||
if (String(arg.event.extendedProps.justified) === "true")
|
||||
setp_detail_justified(true);
|
||||
|
||||
else
|
||||
setp_detail_justified(false);
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
setp_detail_justified(false);
|
||||
|
||||
|
||||
|
||||
if (arg.event.extendedProps.type) {
|
||||
setp_detail_event_type(arg.event.extendedProps.type);
|
||||
}
|
||||
else
|
||||
setp_detail_event_type("");
|
||||
|
||||
|
||||
setStartDate(arg.event.start);
|
||||
setendDate(arg.event.end);
|
||||
setDialog_1_open(true);
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
return (
|
||||
<div className="displaypartnersession">
|
||||
|
||||
|
@ -13864,8 +14007,16 @@ const DisplayPartnerSession = (props) => {
|
|||
|
||||
<div className="div_row" style={{ "border": "None", paddingRight: '10px' }}>
|
||||
|
||||
|
||||
<div className="session_data">
|
||||
<div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ "textAlign": "right", "float": "right", "width": "100%", "marginRight":'20px' }}>
|
||||
Affichage : <nav className="mode_affichage" onClick={func_display_planning_view}> <FcPlanner /> planning </nav>
|
||||
<nav className="mode_affichage" onClick={func_display_list_view}> <CiBoxList /> Liste </nav>
|
||||
</div>
|
||||
|
||||
|
||||
{display_view && String(display_view) === "list" && <div style={{ "border": "None" }}>
|
||||
|
||||
<div style={{ height: 550, width: '100%', paddingRight: '1px' }}>
|
||||
|
||||
|
@ -13900,13 +14051,11 @@ const DisplayPartnerSession = (props) => {
|
|||
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,
|
||||
|
@ -14080,8 +14229,48 @@ const DisplayPartnerSession = (props) => {
|
|||
|
||||
</div>
|
||||
|
||||
</div>}
|
||||
|
||||
{display_view && String(display_view) === "planning" && Getall_Sequence_Of_Session_result_planning_view &&
|
||||
<div style={{ "border": "None" }}>
|
||||
<h3> Affichage planning</h3>
|
||||
|
||||
|
||||
<div style={{ "width": "98%", "marginLeft": "5px", }}>
|
||||
<FullCalendar
|
||||
height={550}
|
||||
locales={allLocales}
|
||||
locale={'fr'}
|
||||
editable
|
||||
selectable
|
||||
//events={events}
|
||||
events={Getall_Sequence_Of_Session_result_planning_view}
|
||||
|
||||
select={handleSelect}
|
||||
headerToolbar={{
|
||||
start: "today prev next",
|
||||
center: "title",
|
||||
end: "dayGridMonth,timeGridWeek,timeGridDay",
|
||||
}}
|
||||
//eventContent={(info) => <EventItem info={info} />}
|
||||
//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}
|
||||
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
</div>
|
||||
|
||||
<div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
|
||||
|
|
|
@ -569,22 +569,6 @@ const Module_Absence = (props) => {
|
|||
setDialog_1_open(true);
|
||||
|
||||
|
||||
|
||||
|
||||
/*const { start, end } = info;
|
||||
const eventNamePrompt = prompt("Enter, Nom evenment");
|
||||
if (eventNamePrompt) {
|
||||
|
||||
setEvents([
|
||||
...events,
|
||||
{
|
||||
start,
|
||||
end,
|
||||
title: eventNamePrompt,
|
||||
id: uuid(),
|
||||
},
|
||||
]);
|
||||
}*/
|
||||
};
|
||||
|
||||
|
||||
|
@ -1195,134 +1179,7 @@ const Module_Absence = (props) => {
|
|||
<nav className="mode_affichage" onClick={func_display_list_view}> <CiBoxList /> Liste </nav>
|
||||
</div>
|
||||
|
||||
{/*
|
||||
<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
|
||||
|
||||
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
|
||||
{(!display_other_agenda || String(display_other_agenda) !== "1") && <Button variant="contained" className="bton_enreg" onClick={show_other_agenda}>Voir autre planning
|
||||
</Button>}
|
||||
|
||||
{display_other_agenda && String(display_other_agenda) === "1" && <Button variant="contained" className="bton_enreg" onClick={show_my_agenda}>Voir mon planning
|
||||
</Button>}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{display_other_agenda && String(display_other_agenda) === "1" && <div className="div_row" style={{ "marginBottom": "5px" }}>
|
||||
<div className="div_row_gauche texte_area_filter" >
|
||||
<TextField
|
||||
name="filtre_related_collection"
|
||||
id="filtre_related_collection"
|
||||
label="Choisir un champ"
|
||||
select
|
||||
sx={{ m: 1, width: '100%' }}
|
||||
value={p_filtre1}
|
||||
onChange={(e) => {
|
||||
|
||||
setp_filtre1(e.target.value);
|
||||
setselected_employee_id("");
|
||||
setselected_related_collection(e.target.value);
|
||||
|
||||
}}
|
||||
>
|
||||
<MenuItem value="ressource_humaine" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Employé </MenuItem>
|
||||
<MenuItem value="ressource_materielle" style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} >Materiel </MenuItem>
|
||||
|
||||
|
||||
</TextField>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
{p_filtre1 && String(p_filtre1) === "ressource_humaine" && <div className="div_row_droite texte_area_filter_value" >
|
||||
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="filtre1_value"
|
||||
id="filtre1_value"
|
||||
select
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={selected_employee_id}
|
||||
onChange={(e) => {
|
||||
|
||||
Get_Ressource_Data(e.target.value)
|
||||
setselected_employee_id(e.target.value);
|
||||
Get_List_Agenda_Events_For_Given_User(e.target.value);
|
||||
|
||||
|
||||
}}
|
||||
>
|
||||
{Getall_Training_Employee_No_Filter_result &&
|
||||
Getall_Training_Employee_No_Filter_result.map((myclient) => (
|
||||
<MenuItem key={JSON.parse(myclient)._id} value={JSON.parse(myclient)._id} nom={JSON.parse(myclient).nom}
|
||||
style={{ "paddingLeft": "5px", "textAlign": "left", "width": "100%" }} id="filtre1_value_list">
|
||||
{JSON.parse(myclient).nom} {JSON.parse(myclient).prenom}
|
||||
|
||||
</MenuItem>
|
||||
))}
|
||||
|
||||
</TextField>
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
{p_filtre1 && String(p_filtre1) === "ressource_materielle" && <div className="div_row_droite texte_area_filter_value" >
|
||||
|
||||
<TextField
|
||||
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||
required
|
||||
name="filtre1_value"
|
||||
id="filtre1_value"
|
||||
select
|
||||
InputLabelProps={{
|
||||
shrink: true,
|
||||
}}
|
||||
disabled={false}
|
||||
className="disabled_style"
|
||||
value={selected_employee_id}
|
||||
onChange={(e) => {
|
||||
Get_Ressource_Data(e.target.value)
|
||||
setselected_employee_id(e.target.value);
|
||||
Get_List_Agenda_Events_For_Given_User(e.target.value);
|
||||
}}
|
||||
>
|
||||
{Getall_Training_Materiel_No_Filter_result &&
|
||||
Getall_Training_Materiel_No_Filter_result.map((myclient) => (
|
||||
<MenuItem key={JSON.parse(myclient)._id} value={JSON.parse(myclient)._id}
|
||||
style={{ "paddingLeft": "25px", "textAlign": "left", "width": "100%" }}>
|
||||
{JSON.parse(myclient).nom}
|
||||
|
||||
</MenuItem>
|
||||
))}
|
||||
|
||||
</TextField>
|
||||
|
||||
|
||||
</div>}
|
||||
|
||||
|
||||
|
||||
</div>}
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
|
||||
</div>
|
||||
|
||||
<div className="div_row" style={{ "border": "None" }}>
|
||||
{agenda_owner_name && String(agenda_owner_name) === "Mon Planning" && <h5> <i> {agenda_owner_name} </i> </h5>}
|
||||
{agenda_owner_name && String(agenda_owner_name) !== "Mon Planning" && <h5> Vous êtes sur le planning de <i> {agenda_owner_name} - ({agenda_owner_type}) </i> </h5>}
|
||||
</div>
|
||||
|
||||
*/}
|
||||
{String(display_view) === "planning" && <div style={{ "width": "98%", "marginLeft": "5px" }}>
|
||||
|
||||
|
||||
|
|
|
@ -707,6 +707,13 @@
|
|||
float: left;
|
||||
}
|
||||
|
||||
.mode_affichage {
|
||||
width: 25%;
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 601px) and (max-width: 991px) {
|
||||
|
@ -1345,6 +1352,13 @@
|
|||
float: left;
|
||||
}
|
||||
|
||||
.mode_affichage {
|
||||
width: 15%;
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 992px) and (max-width: 1199px) {
|
||||
|
@ -1907,6 +1921,13 @@
|
|||
float: left;
|
||||
}
|
||||
|
||||
.mode_affichage {
|
||||
width: 12%;
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@media only screen and (min-width: 1200px) {
|
||||
|
@ -2634,6 +2655,11 @@
|
|||
float: left;
|
||||
}
|
||||
|
||||
.mode_affichage {
|
||||
width: 8%;
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
// end media
|
||||
|
|
|
@ -2469,7 +2469,6 @@
|
|||
width: 8%;
|
||||
float: right;
|
||||
cursor: pointer;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue