recette2
cherif 2023-11-10 23:12:38 +01:00
parent acdbc08870
commit 48db31afe1
4 changed files with 225 additions and 53 deletions

View File

@ -203,6 +203,25 @@ const DisplayPartnerSession = (props) => {
{ field: 'domaine', headerName: 'Domaine', width: datagrid_columns_size_model1, align: "center", hide: true, hideable: true, },
{ field: 'duration', headerName: 'Durée', width: datagrid_columns_size_model2, align: "center", },
{
field: "Detail", headerName: 'Voir detail',
renderCell: (cellValues) => {
return (
<Button
onClick={(event) => {
handleClick_edit_session_From_Line(cellValues.row.id);
}}
>
<FcViewDetails />
</Button>
);
}
},
{
field: "delete", headerName: 'Supprimer',
renderCell: (cellValues) => {
@ -5798,8 +5817,8 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel(newSelectionModel);
if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
setaddOneParticipant();
setdisplay_detail_insc();
@ -5841,7 +5860,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
className="datagridclass"
rowsPerPageOptions={[10]}
//disableSelectionOnClick
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
@ -6032,7 +6051,7 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
</div>
</div>
<div className="div_row"> &nbsp; </div>
{selectionModel && selectionModel.length === 1 && <div className="div_row">
{selected_code_session && String(selected_code_session).length > 0 && <div className="div_row">
<Button variant="outlined" ref={myRef} onClick={submenu_detail_session} className="detail_class_submenu" id='detail_session' name='detail_session'>Détail Session</Button>
<Button variant="outlined" onClick={submenu_preinscrit} className="detail_class_submenu" id='preinscrit' name='preinscrit'>Preinscription ({String(nb_stagiaire_Preinscrit)}) </Button>
<Button variant="outlined" onClick={submenu_inscrit} className="detail_class_submenu" id='inscrit' name='inscrit'>Inscription ({String(nb_stagiaire_Inscrit)}) </Button>

View File

@ -77,15 +77,15 @@ const DisplayPartnerStagiaires = (props) => {
const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(80);
const columns = [
{ field: '_id', headerName: '_id', hide: true },
{ field: 'session_id', headerName: 'session_id', hide: true },
{ field: '_id', headerName: '_id', hide: true, editable: false},
{ field: 'session_id', headerName: 'session_id', hide: true, editable: false},
{ field: 'id', headerName: 'id', hide: true },
{ field: 'class_internal_url', headerName: 'class_internal_url', hide: true },
{ field: 'class_internal_url', headerName: 'class_internal_url', hide: true, editable: false},
{ field: 'email', headerName: 'email', width: 150, hideable: false, },
{ field: 'nom', headerName: 'nom', width: 150, hide: false, editable: true },
{ field: 'prenom', headerName: 'prenom', width: 150, hide: false, editable: true },
{ field: 'employeur', headerName: 'Employeur', width: 150, hide: false, editable: true },
{ field: 'email', headerName: 'email', width: 150, hideable: false,editable: false },
{ field: 'nom', headerName: 'nom', width: 150, hide: false, editable: false, editable: false },
{ field: 'prenom', headerName: 'prenom', width: 150, hide: false, editable: false },
{ field: 'employeur', headerName: 'Employeur', width: 150, hide: true, editable: false },
{
field: 'status', headerName: 'Statut', hide: false, width: datagrid_columns_size_model2,
valueFormatter: (params) => {
@ -101,8 +101,8 @@ const DisplayPartnerStagiaires = (props) => {
return "???";
},
},
{ field: 'code_session', headerName: 'Code session', hideable: true, },
{ field: 'title', headerName: 'Formation', width: datagrid_columns_size_model1, align: "center", hideable: true, },
{ field: 'code_session', headerName: 'Code session', hideable: true, editable: false},
{ field: 'title', headerName: 'Formation', width: datagrid_columns_size_model1, align: "center", hideable: true, editable: false},
{
field: 'distantiel', headerName: 'Distantiel', hideable: false, width: datagrid_columns_size_model2,
valueFormatter: (params) => {
@ -126,10 +126,28 @@ const DisplayPartnerStagiaires = (props) => {
},
},
{ field: 'domaine', headerName: 'Domaine', width: datagrid_columns_size_model2, align: "center", hide: true, hideable: true, },
{ field: 'date_debut', headerName: 'Du', width: datagrid_columns_size_model1, hideable: true, },
{ field: 'date_fin', headerName: 'Au', width: datagrid_columns_size_model1, hideable: true, },
{ field: 'class_internal_url', headerName: 'class_internal_url', hide: true, },
{ field: 'domaine', headerName: 'Domaine', width: datagrid_columns_size_model2, align: "center", hide: true, hideable: true, editable: false},
{ field: 'date_debut', headerName: 'Du', width: datagrid_columns_size_model1, hideable: true, editable: false},
{ field: 'date_fin', headerName: 'Au', width: datagrid_columns_size_model1, hideable: true, editable: false},
{ field: 'class_internal_url', headerName: 'class_internal_url', hide: true, editable: false},
{
field: "Detail", headerName: 'Voir detail',
renderCell: (cellValues) => {
return (
<Button
onClick={(event) => {
handleClick_edit_session_From_Line(cellValues.row.id);
}}
>
<FcViewDetails />
</Button>
);
}
},
{
field: 'Action', headerName: 'Action', hide: false, width: 200,
renderCell: (cellValues) => {
@ -307,24 +325,7 @@ const DisplayPartnerStagiaires = (props) => {
}
},
/* {
field: "Detail", headerName: 'Voir detail',
renderCell: (cellValues) => {
return (
<Button
onClick={(event) => {
Display_Detail_Inscription(event, cellValues);
}}
>
<FcViewDetails />
</Button>
);
}
},*/
{
field: "Imprimer", headerName: 'Imprimer detail',
renderCell: (cellValues) => {
@ -4229,8 +4230,8 @@ const DisplayPartnerStagiaires = (props) => {
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel(newSelectionModel);
if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
setaddOneParticipant();
setdisplay_detail_stagiaire();
@ -4269,7 +4270,7 @@ const DisplayPartnerStagiaires = (props) => {
className="datagridclass"
rowsPerPageOptions={[10]}
//disableSelectionOnClick
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
@ -4872,7 +4873,7 @@ const DisplayPartnerStagiaires = (props) => {
<div className="session_data" >
<div>
{String(participant_data_edit_mode) !== "1" && <div className="session_caract"> Session aa<br />
{String(participant_data_edit_mode) !== "1" && <div className="session_caract"> Session <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required

View File

@ -115,7 +115,7 @@ const Employes = (props) => {
{ field: 'profil', headerName: 'profil', width: 150, hide: false, },
{ field: 'fonction', headerName: 'Fonction', width: 150, hide: false, },
/* {
{
field: "Detail", headerName: 'Voir detail',
renderCell: (cellValues) => {
return (
@ -123,7 +123,8 @@ const Employes = (props) => {
<Button
onClick={(event) => {
Display_Detail_Employe(event, cellValues);
handleClick_edit_employee_From_Line(cellValues.row.id);
}}
>
<FcViewDetails />
@ -132,7 +133,7 @@ const Employes = (props) => {
);
}
},*/
},
{
field: "delete", headerName: 'Supprimer',
renderCell: (cellValues) => {
@ -4182,8 +4183,8 @@ const Employes = (props) => {
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
setSelectionModel(newSelectionModel);
if (newSelectionModel.length === 1)
handleClick_edit_employee_From_Line(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_employee_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
setsubmenu();
setdisplay_detail_employe();
@ -4214,7 +4215,7 @@ const Employes = (props) => {
className="datagridclass"
rowsPerPageOptions={[10]}
//disableSelectionOnClick
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}

View File

@ -29,6 +29,13 @@ import { v4 as uuid } from "uuid";
import { isCompositeComponent } from "react-dom/test-utils";
import moment from "moment";
import allLocales from '@fullcalendar/core/locales-all'
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
const locales = {
'en-US': enUS,
@ -179,7 +186,69 @@ const TestUrl_New = (props) => {
})
}
const [mysy_events, setmysy_events] = useState();
const [Get_List_Agenda_Events_api, setGet_List_Agenda_Events_api] = useState();
const [Get_List_Agenda_Events_message, setGet_List_Agenda_Events_message] = useState();
const [Get_List_Agenda_Events_result, setGet_List_Agenda_Events_result] = useState();
function Get_List_Agenda_Events(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_Agenda_Event_List/";
axios.post(myurl, form).then(res => {
//console.log(" In Get_List_Agenda_Events res.data.status = " + res.data.status);
//console.log(" In Get_List_Agenda_Events res.data.message r_class = " + res.data.message);
if (String(res.data.status) === String("true")) {
setGet_List_Agenda_Events_api("true");
setGet_List_Agenda_Events_result(res.data.message);
var tab_event = []
var filtre2 = res.data.message.map(obj => {
var local_val = {
'title': String(JSON.parse(obj).event_title),
'start': String(JSON.parse(obj).event_start),
'end': String(JSON.parse(obj).event_end),
'id': String(JSON.parse(obj)._id),
}
tab_event.push(local_val);
});
console.log(" #### tab_event =", tab_event);
setmysy_events(tab_event);
}
else if (String(res.data.status) === String("Err_Connexion")) {
alert('Erreur: ' + res.data.message);
//history.push("/Connexion");
}
else {
setGet_List_Agenda_Events_api("false");
setGet_List_Agenda_Events_message(res.data.message);
}
}).catch((error) => {
console.warn('Not good man :( Get_List_Agenda_Events = ', error);
setGet_List_Agenda_Events_api("false");
//setmyApimyApiMessage("")
})
}
useEffect(() => {
Get_List_Agenda_Events();
Get_Personnalisable_Collections();
Get_Personnalisable_Collection_and_Fields();
Get_Partner_Object_Specific_Fields("ressource_humaine");
@ -271,10 +340,11 @@ const TestUrl_New = (props) => {
const myEventsList = []
const [events, setEvents] = useState([]);
const handleSelect = (info) => {
const { start, end } = info;
const eventNamePrompt = prompt("Enter, Nom evenment_ch");
const eventNamePrompt = prompt("Enter, Nom evenment");
if (eventNamePrompt) {
console.log("### eventNamePrompt = ", eventNamePrompt, " ### info = ", info);
setEvents([
...events,
{
@ -333,8 +403,8 @@ const TestUrl_New = (props) => {
axios.post(myurl, form).then(res => {
if (String(res.data.status) === String("true")) {
console.log(" In Get_Partner_Object_Specific_Fields res.data.status = " + res.data.status);
console.log(" In Get_Partner_Object_Specific_Fields res.data.message r_class = " + res.data.message);
//console.log(" In Get_Partner_Object_Specific_Fields res.data.status = " + res.data.status);
//console.log(" In Get_Partner_Object_Specific_Fields res.data.message r_class = " + res.data.message);
setGet_Partner_Object_Specific_Fields_api("true");
setGet_Partner_Object_Specific_Fields_result(res.data.message);
@ -360,9 +430,6 @@ const TestUrl_New = (props) => {
const [rows_champs_specifics, setrows_champs_specifics] = useState([]);
const [display_champs_specifics, setdisplay_champs_specifics] = useState("0");
@ -430,6 +497,41 @@ const TestUrl_New = (props) => {
}
// -- end champs specifiques
const renderEventContent = (eventInfo) => {
console.log(eventInfo);
return (
<>
<b>{eventInfo.timeText}</b><br />
<i>{eventInfo.event.title}</i>
</>
)
};
const handleEventClick = (arg) => {
alert(arg.event.title)
alert(arg.event.start)
setdialogMessage(" coucou cherif");
setOpen(true);
}
const [open, setOpen] = React.useState(false);
const [dialogMessage, setdialogMessage] = React.useState(false);
const handleClickOpen = () => {
setOpen(true);
};
const handleClose = () => {
alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const handleClose_buton = () => {
setOpen(false);
};
return (
<div className="testurl_new">
<Helmet>
@ -440,6 +542,32 @@ const TestUrl_New = (props) => {
<Header />
<Dialog
open={open}
onClose={handleClose}>
<DialogTitle>Subscribe</DialogTitle>
<DialogContent>
<DialogContentText>
{dialogMessage}
</DialogContentText>
<TextField
autoFocus
margin="dense"
id="name"
label="Email Address"
type="email"
fullWidth
variant="standard"
/>
</DialogContent>
<DialogActions>
<Button onClick={handleClose_buton}>Cancel</Button>
<Button onClick={handleClose_buton}>Subscribe</Button>
</DialogActions>
</Dialog>
<div className="div_mobile">
<h3> Page de test * testurl_new </h3>
parametres courseid = {courseid}, tabid = {tabid}
@ -490,6 +618,24 @@ const TestUrl_New = (props) => {
<br />
<div className="div_row">
liste des events =
{Get_List_Agenda_Events_result && <div> {Get_List_Agenda_Events_result} </div>}
</div>
<div className="div_row">
local events =
<button onClick={(e) => {
console.log("#### local events = ", events);
setdialogMessage(" coucou cherif");
setOpen(true);
}}>
display events
</button>
</div>
<div style={{ "width": "90%", "marginLeft": "1%" }}>
<FullCalendar
locales={allLocales}
@ -497,18 +643,23 @@ const TestUrl_New = (props) => {
editable
selectable
events={events}
//events={mysy_events}
select={handleSelect}
headerToolbar={{
start: "today prev next",
end: "dayGridMonth dayGridWeek dayGridDay",
}}
eventContent={(info) => <EventItem info={info} />}
//eventContent={(info) => <EventItem info={info} />}
//plugins={[timeGridPlugin]}
plugins={[timeGridPlugin, daygridPlugin, interactionPlugin]}
views={["dayGridMonth", "dayGridWeek", "dayGridDay"]}
slotMinTime="07:00"
slotMaxTime="20:00"
scrollTime='08:00'
displayEventEnd={true}
eventContent={renderEventContent}
eventClick={handleEventClick}
/>;