recette2
cherif 2025-01-11 20:47:27 +01:00
parent 5ad8f123ea
commit 91bcf694c3
8 changed files with 673 additions and 177 deletions

View File

@ -150,6 +150,9 @@ const AddArticleAvis = () => {
function clear_alert_type() {
setalert_type("");
}
function clear_display_alert_mysy() {
setdisplay_alert_mysy("");
}
return (
@ -160,6 +163,7 @@ const AddArticleAvis = () => {
alert_type={alert_type}
clear_alert_message={clear_alert_message}
clear_alert_type={clear_alert_type}
clear_display_alert_mysy = {clear_display_alert_mysy}
/>
}

View File

@ -431,8 +431,11 @@ const AddClassManual = (props) => {
setDelete_Given_Evaluation_UE_Class_api("false");
setDelete_Given_Evaluation_UE_Class_message(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
alert(res.data.message);
// alert(res.data.message);
}
@ -480,13 +483,20 @@ const AddClassManual = (props) => {
setDelete_Given_UE_From_Class_api("true");
setDelete_Given_UE_From_Class_result(res.data.message);
Getall_Class_List_UE();
alert(res.data.message)
// alert(res.data.message)
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else {
setDelete_Given_UE_From_Class_api("false");
setDelete_Given_UE_From_Class_message(res.data.message);
alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
// alert(res.data.message);
}
@ -528,11 +538,10 @@ const AddClassManual = (props) => {
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Class_List_UE res.data.status = " + res.data.status);
console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message);
// console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message);
setGetall_Class_List_UE_api("true");
setGetall_Class_List_UE_result(res.data.message);
@ -587,7 +596,10 @@ const AddClassManual = (props) => {
else {
setGetall_Class_List_UE_api("false");
setGetall_Class_List_UE_message(res.data.message);
alert(res.data.message);
//alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -1049,6 +1061,7 @@ const AddClassManual = (props) => {
//document.getElementsByName("programme")[0].value = "";
//document.getElementsByName("prerequis")[0].value = "";
alert(" La formation a été correctement supprimée.");
history.push({
pathname: "/Partner/",
state: {
@ -1058,7 +1071,11 @@ const AddClassManual = (props) => {
});
window.location.reload();
} else if (String(result['status']) === "false") {
alert(result['message']);
// alert(result['message']);
setdisplay_alert_mysy("1");
setalert_message(result['message']);
setalert_type("error");
} else if (String(result['status']) === String("Err_Connexion")) {
alert('Erreur: ' + result['message']);
history.push("/Connexion");
@ -2006,7 +2023,7 @@ const AddClassManual = (props) => {
window.location.reload();*/
}
else{
else {
setdisplay_alert_mysy("1");
setalert_message(result['message']);
setalert_type("error");
@ -3856,18 +3873,24 @@ const AddClassManual = (props) => {
setalert_type("");
}
function clear_display_alert_mysy() {
setdisplay_alert_mysy("");
}
return (
<div className="addclassmanual">
{isLoading && <div className="loader-container">
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
</div>}
{/*** Affichage des messages d'alerte*/}
{/*** Affichage des messages d'alerte*/}
{display_alert_mysy && String(display_alert_mysy) === "1" &&
<Module_Alert_Confirmation alert_message={alert_message}
alert_type={alert_type}
clear_alert_message={clear_alert_message}
clear_alert_type={clear_alert_type}
clear_display_alert_mysy = {clear_display_alert_mysy}
/>
}
{/*** FIN Affichage des messages d'alerte*/}

View File

@ -34,7 +34,7 @@ import Radio from '@mui/material/Radio';
import { FcOpenedFolder } from "react-icons/fc";
import { MdManageAccounts } from "react-icons/md";
import { FcInfo } from "react-icons/fc";
import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
import Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
@ -54,6 +54,7 @@ import WarningAmberIcon from '@mui/icons-material/WarningAmber';
import BlockIcon from '@mui/icons-material/Block';
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
function PaperComponent(props) {
return (
@ -66,7 +67,6 @@ function PaperComponent(props) {
);
}
const useStyles = makeStyles((theme) => ({
dialog: {
@ -1640,11 +1640,15 @@ const AddParnerClient = (props) => {
setformedit_mode("0");
setdatamodification("0");
Disable_fields();
alert(res.data.message);
props.Get_List_Partner_Clients();
props.father_scroll_to_top();
props.close_detail_client();
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else if (String(res.data.status) === String("Err_Connexion")) {
@ -1656,7 +1660,10 @@ const AddParnerClient = (props) => {
setAdd_New_PartnerClient_api("false");
setAdd_New_PartnerClient_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
@ -1814,7 +1821,11 @@ const AddParnerClient = (props) => {
setdatamodification("0");
fillfield();
Disable_fields();
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
@ -1827,7 +1838,10 @@ const AddParnerClient = (props) => {
setrecordPartnerClient_api("false");
setrecordPartnerClient_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
@ -1931,10 +1945,15 @@ const AddParnerClient = (props) => {
setrecordPartnerClient_Invoice_Data_result(res.data.message);
setformedit_mode_invoice("0");
setdatamodification_invoice("0");
alert(" Les données de facturation ont été mises à jour.")
// alert(" Les données de facturation ont été mises à jour.")
Disable_invoice_fields();
sethas_client_invoice_email("");
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
@ -1947,7 +1966,10 @@ const AddParnerClient = (props) => {
setrecordPartnerClient_Invoice_Data_api("false");
setrecordPartnerClient_Invoice_Data_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
@ -2336,7 +2358,10 @@ const AddParnerClient = (props) => {
setaddcontact("0");
setdatamodification_contact("");
setis_contact_include_com(false)
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
@ -2349,7 +2374,10 @@ const AddParnerClient = (props) => {
setrecordPartnerClient_Contact_Data_api("false");
setrecordPartnerClient_Contact_Data_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
@ -2507,7 +2535,10 @@ const AddParnerClient = (props) => {
setDisplay_Part_Client_Contact_api("false");
setDisplay_Part_Client_Contact_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
@ -2556,7 +2587,6 @@ const AddParnerClient = (props) => {
Get_List_Contact_Of_client_Part();
}
else if (String(res.data.status) === String("Err_Connexion")) {
alert('Erreur: ' + res.data.message);
@ -2567,7 +2597,10 @@ const AddParnerClient = (props) => {
setDelete_Part_Client_Contact_api("false");
setDelete_Part_Client_Contact_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
@ -2788,7 +2821,11 @@ const AddParnerClient = (props) => {
setfile_1_name();
setp_detail_one_file_to_download_type_name();
//GetCurrentClass_trainingsession();
alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée")
// alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée")
var txt = "La pièce jointe " + file_1_name.name + " a été bien enregistrée";
setdisplay_alert_mysy("1");
setalert_message(txt);
setalert_type("success");
}
else {
@ -2844,7 +2881,11 @@ const AddParnerClient = (props) => {
setDelete_one_attached_document_result(result['message']);
setDelete_one_attached_document_api("true");
Get_List_Of_All_PJ(props.client_id);
alert(result['message'])
// alert(result['message'])
setdisplay_alert_mysy("1");
setalert_message(result['message']);
setalert_type("success");
}
else {
@ -2983,7 +3024,10 @@ const AddParnerClient = (props) => {
else {
setGet_List_Type_Financeur_api("false");
setGet_List_Type_Financeur_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -3052,7 +3096,10 @@ const AddParnerClient = (props) => {
else {
setGet_List_Type_Pouvoir_Public_api("false");
setGet_List_Type_Pouvoir_Public_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -3141,7 +3188,7 @@ const AddParnerClient = (props) => {
if (p_client_intranet_account_id && String(p_client_intranet_account_id).length > 3) {
// Il s'agit d'une mise à jour de mot de passe
myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Pwd_Partner_Client_Intranet_Account/";
console.log(" ### mise à jour INTRANET ");
// console.log(" ### mise à jour INTRANET ");
} else {
console.log(" ### creation INTRANET ");
@ -3160,7 +3207,11 @@ const AddParnerClient = (props) => {
//setp_detail_user_login(p_new_login);
Dialog_mysy_intranet_account_handleClose();
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
setp_new_login('');
setp_new_pwd('');
setp_conf_new_login('');
@ -3169,7 +3220,10 @@ const AddParnerClient = (props) => {
else {
setAdd_Update_Client_Intranet_Login_Pass_Data_api("false");
setAdd_Update_Client_Intranet_Login_Pass_Data_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -3181,10 +3235,38 @@ const AddParnerClient = (props) => {
})
}
const [display_alert_mysy, setdisplay_alert_mysy] = useState("");
const [alert_message, setalert_message] = useState("");
const [alert_type, setalert_type] = useState("");
function clear_alert_message() {
setalert_message("");
}
function clear_alert_type() {
setalert_type("");
}
function clear_display_alert_mysy() {
setdisplay_alert_mysy("");
}
return (
<div className="add_partner_client">
{/*** Affichage des messages d'alerte*/}
display_alert_mysy = {display_alert_mysy} <br />
{display_alert_mysy && String(display_alert_mysy) === "1" &&
<Module_Alert_Confirmation alert_message={alert_message}
alert_type={alert_type}
clear_alert_message={clear_alert_message}
clear_alert_type={clear_alert_type}
clear_display_alert_mysy={clear_display_alert_mysy}
/>
}
{/*** FIN Affichage des messages d'alerte*/}
{/*** GESTION Compte Intranet */}
<Dialog
open={Dialog_mysy_intranet_account_open}
@ -3290,6 +3372,7 @@ const AddParnerClient = (props) => {
>
<CancelPresentationIcon />
</IconButton>
<div className="div_row">
<div className="div_row_gauche">
&nbsp;

View File

@ -62,11 +62,50 @@ import {
GridPreferencePanelsValue,
} from '@mui/x-data-grid';
import * as XLSX from 'xlsx';
import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
import * as XLSX from 'xlsx';
import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
import CancelPresentationIcon from '@mui/icons-material/CancelPresentation';
import { makeStyles } from "@material-ui/core/styles";
import Paper from '@material-ui/core/Paper';
import Draggable from 'react-draggable';
import { IconButton } from '@material-ui/core';
function PaperComponent(props) {
return (
<Draggable
handle="#draggable-dialog-title"
cancel={'[class*="MuiDialogContent-root"]'}
>
<Paper {...props} />
</Draggable>
);
}
const useStyles = makeStyles((theme) => ({
dialog: {
position: 'absolute',
// left: 10,
top: 400
},
paper: {
overflowY: 'unset',
},
customizedButton: {
position: 'absolute',
left: '98%',
top: '-3%',
backgroundColor: 'lightgray',
color: 'gray',
},
}));
const Apprenant = (props) => {
const classes = useStyles();
const history = useHistory();
const [submenu, setsubmenu] = useState("");
@ -127,8 +166,8 @@ const Apprenant = (props) => {
const columns = [
{ field: 'id', headerName: 'id', hide: true , disableExport: true,},
{ field: '_id', headerName: '_id', hide: true , disableExport: true,},
{ field: 'id', headerName: 'id', hide: true, disableExport: true, },
{ field: '_id', headerName: '_id', hide: true, disableExport: true, },
{
field: 'civilite', headerName: 'Civ.', minWidth: 100, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false,
@ -540,12 +579,18 @@ const Apprenant = (props) => {
Get_Appenant_List_Suivi_Pedagogique(selected_apprenant_id);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else {
setDelete_Suivi_Pedago_Data_api("false");
setDelete_Suivi_Pedago_Data_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
@ -934,7 +979,11 @@ const Apprenant = (props) => {
setLoading(false);
setGet_Current_Apprenant_Data_api("false");
setGet_Current_Apprenant_Data_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -959,7 +1008,7 @@ const Apprenant = (props) => {
}
if (file_1_name && file_1_name.name) {
// console.log(" ### Traitement de : ", file_1_name.name);
// console.log(" ### Traitement de : ", file_1_name.name);
const formData = new FormData();
formData.append('File', file_1_name);
@ -1800,8 +1849,10 @@ const Apprenant = (props) => {
Disable_Detail_Apprenant_Fields();
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
@ -1816,7 +1867,10 @@ const Apprenant = (props) => {
setUpdate_Apprenant_Data_api("false");
setUpdate_Apprenant_Data_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -2108,7 +2162,10 @@ const Apprenant = (props) => {
else {
setGet_Partner_Object_Specific_Fields_apprenant_api("false");
setGet_Partner_Object_Specific_Fields_apprenant_message(res.data.message);
alert(res.data.message)
// alert(res.data.message)
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -2187,7 +2244,10 @@ const Apprenant = (props) => {
else {
setGetall_Training_Employee_No_Filter_api("false");
setGetall_Training_Employee_No_Filter_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -2228,7 +2288,10 @@ const Apprenant = (props) => {
else {
setGetall_Training_Materiel_No_Filter_api("false");
setGetall_Training_Materiel_No_Filter_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -2591,9 +2654,6 @@ const Apprenant = (props) => {
setAdd_Update_Suiv_Pedagogique_result(res.data.message);
Dialog_Suivi_Pedago_handleClose_buton();
setgiven_suivi_ped_changed("");
setgiven_suivi_ped_data_edit_mode("");
setadd_one_suivi_ped("");
@ -2611,7 +2671,10 @@ const Apprenant = (props) => {
Get_Appenant_List_Suivi_Pedagogique(selected_apprenant_id);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
if (document.getElementById('myRef')) {
// myRef.current.scrollIntoView({ behavior: "smooth" });
@ -2626,7 +2689,10 @@ const Apprenant = (props) => {
else {
setAdd_Update_Suiv_Pedagogique_api("false");
setAdd_Update_Suiv_Pedagogique_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -2783,7 +2849,10 @@ const Apprenant = (props) => {
else {
setGetall_Partner_Class_Reduice_Fields_api("false");
setGetall_Partner_Class_Reduice_Fields_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -3764,7 +3833,11 @@ const Apprenant = (props) => {
setapprenant_data_edit_mode("");
setadd_One_Apprenant("0");
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
window.scrollTo({
@ -3834,7 +3907,10 @@ const Apprenant = (props) => {
setp_dialog_type_apprenant('');
setp_dialog_financement('');
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
window.scrollTo({
@ -3895,7 +3971,10 @@ const Apprenant = (props) => {
top: 0,
behavior: "smooth",
});
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else {
setDelete_Apprenant_Data_api("false");
@ -3955,7 +4034,10 @@ const Apprenant = (props) => {
Get_All_Apprenant();
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else {
setDelete_LIST_Apprenant_api("false");
@ -4014,7 +4096,10 @@ const Apprenant = (props) => {
setp_dialog_financement('');
setSelectionModel([]);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
window.scrollTo({
@ -4376,7 +4461,10 @@ const Apprenant = (props) => {
setAdd_Update_Apprenant_Tuteur_result(res.data.message);
Dialog_tuteur_1_handleClose_buton();
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else {
@ -4835,115 +4923,129 @@ const Apprenant = (props) => {
}
// DEBUT EXPORT EXCEL DATAGRID
// DEBUT EXPORT EXCEL DATAGRID
function CustomToolbar(props) {
function CustomToolbar(props) {
return (
<GridToolbarContainer {...props}>
return (
<GridToolbarContainer {...props}>
<GridToolbarColumnsButton />
<GridToolbarFilterButton />
<GridToolbarDensitySelector
slotProps={{ tooltip: { title: 'Change density' } }}
/>
<Box sx={{ flexGrow: 1 }} />
<ExportButton data_colums={props.data_colums} />
<GridToolbarColumnsButton />
<GridToolbarFilterButton />
<GridToolbarDensitySelector
slotProps={{ tooltip: { title: 'Change density' } }}
/>
<Box sx={{ flexGrow: 1 }} />
<ExportButton data_colums={props.data_colums} />
</GridToolbarContainer>
);
}
</GridToolbarContainer>
);
}
function getExcelData(apiRef) {
// Select rows and columns
const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
function getExcelData(apiRef) {
// Select rows and columns
const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
// Format the data. Here we only keep the value
const data = filteredSortedRowIds.map((id) => {
const row = {};
visibleColumnsField.forEach((field) => {
row[field] = apiRef.current.getCellParams(id, field).value;
// Format the data. Here we only keep the value
const data = filteredSortedRowIds.map((id) => {
const row = {};
visibleColumnsField.forEach((field) => {
row[field] = apiRef.current.getCellParams(id, field).value;
});
return row;
});
return row;
});
return data;
}
return data;
}
function ExportButton(props) {
return (
<GridToolbarExportContainer {...props}>
<ExportMenuItem data_colums={props.data_colums} />
</GridToolbarExportContainer>
);
}
function ExportButton(props) {
return (
<GridToolbarExportContainer {...props}>
<ExportMenuItem data_colums={props.data_colums} />
</GridToolbarExportContainer>
);
}
function handleExport(apiRef, data_colums) {
const data = getExcelData(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
function handleExport(apiRef, data_colums) {
const data = getExcelData(apiRef);
const visibleColumnsField = gridVisibleColumnFieldsSelector(apiRef);
const local_config = {
keys: visibleColumnsField,
const local_config = {
keys: visibleColumnsField,
columnNames: data_colums.filter((mydata) => (mydata).disableExport !== true).map(function (mydata) {
if (mydata.headerName && visibleColumnsField.includes(mydata.field)) {
if (mydata.headerName) {
return mydata.headerName;
columnNames: data_colums.filter((mydata) => (mydata).disableExport !== true).map(function (mydata) {
if (mydata.headerName && visibleColumnsField.includes(mydata.field)) {
if (mydata.headerName) {
return mydata.headerName;
}
}
}),
fileName: 'data_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_") + '.xlsx',
sheetName: 'Export_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_"),
};
local_config.columnNames = local_config.columnNames.filter(function (element) {
return element !== undefined;
});
const rows = data.map((row) => {
const mRow = {};
for (const key of local_config.keys) {
mRow[key] = row[key];
}
return mRow;
});
}),
const worksheet = XLSX.utils.json_to_sheet(rows);
XLSX.utils.sheet_add_aoa(worksheet, [[...local_config.columnNames]], {
origin: 'A1',
});
fileName: 'data_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_") + '.xlsx',
sheetName: 'Export_' + String(new Date().toJSON().slice(0, 10)).replaceAll("-", "_"),
};
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, local_config.sheetName);
XLSX.writeFile(workbook, local_config.fileName, { compression: true });
}
local_config.columnNames = local_config.columnNames.filter(function( element ) {
return element !== undefined;
});
function ExportMenuItem(props) {
const apiRef = useGridApiContext();
const { hideMenu } = props;
return (
<MenuItem
onClick={() => {
handleExport(apiRef, props.data_colums);
// Hide the export menu after the export
hideMenu?.();
}}
>
Export Excel
</MenuItem>
);
}
const rows = data.map((row) => {
const mRow = {};
for (const key of local_config.keys) {
mRow[key] = row[key];
}
return mRow;
});
// FIN EXPORT EXCEL DATAGRID
const worksheet = XLSX.utils.json_to_sheet(rows);
XLSX.utils.sheet_add_aoa(worksheet, [[...local_config.columnNames]], {
origin: 'A1',
});
const [display_alert_mysy, setdisplay_alert_mysy] = useState("");
const [alert_message, setalert_message] = useState("");
const [alert_type, setalert_type] = useState("");
const workbook = XLSX.utils.book_new();
XLSX.utils.book_append_sheet(workbook, worksheet, local_config.sheetName);
XLSX.writeFile(workbook, local_config.fileName, { compression: true });
}
function ExportMenuItem(props) {
const apiRef = useGridApiContext();
const { hideMenu } = props;
return (
<MenuItem
onClick={() => {
handleExport(apiRef, props.data_colums);
// Hide the export menu after the export
hideMenu?.();
}}
>
Export Excel
</MenuItem>
);
}
// FIN EXPORT EXCEL DATAGRID
function clear_alert_message() {
setalert_message("");
}
function clear_alert_type() {
setalert_type("");
}
function clear_display_alert_mysy() {
setdisplay_alert_mysy("");
}
return (
<div className="apprenant">
@ -4952,14 +5054,49 @@ function ExportMenuItem(props) {
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
</div>}
{/*** Affichage des messages d'alerte*/}
{display_alert_mysy && String(display_alert_mysy) === "1" &&
<Module_Alert_Confirmation alert_message={alert_message}
alert_type={alert_type}
clear_alert_message={clear_alert_message}
clear_alert_type={clear_alert_type}
clear_display_alert_mysy={clear_display_alert_mysy}
/>
}
{/*** FIN Affichage des messages d'alerte*/}
{/***** Dialog Suivi Pedagogique */}
<Dialog
open={Dialog_Suivi_Pedago_open}
onClose={Dialog_Suivi_Pedago_handleClose}
// onClose={Dialog_Suivi_Pedago_handleClose}
static
onClose={() => null}
PaperProps={{
className: classes.paper, // Apply the paper style
style: {
overflowY: 'unset',
position: 'absolute',
top: '7rem',
margin: "2px",
},
}}
hideBackdrop={true}
disableScrollLock
classes={{
paper: classes.dialog
}}
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
>
<DialogTitle>MySy Information</DialogTitle>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title" >MySy Information</DialogTitle>
<DialogContent>
<DialogContentText>
{Dialog_Suivi_Pedago_message}
@ -5011,6 +5148,15 @@ function ExportMenuItem(props) {
</DialogContent>
<DialogActions>
<IconButton
autoFocus
onClick={Dialog_Suivi_Pedago_handleClose_buton}
color="primary"
className={classes.customizedButton}
>
<CancelPresentationIcon />
</IconButton>
<Button onClick={Dialog_Suivi_Pedago_handleClose_buton}>OK</Button>
</DialogActions>
@ -5043,11 +5189,31 @@ function ExportMenuItem(props) {
{/****** Dialog synthèse apprenant */}
<Dialog
open={Dialog_apprenant_open}
onClose={Dialog_apprenant_handleClose}
// onClose={Dialog_apprenant_handleClose}
className="displaypartnersession"
static
onClose={() => null}
PaperProps={{
className: classes.paper, // Apply the paper style
style: {
overflowY: 'unset',
position: 'absolute',
top: '7rem',
margin: "2px",
},
}}
hideBackdrop={true}
disableScrollLock
classes={{
paper: classes.dialog
}}
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
>
<DialogTitle>Apprenant</DialogTitle>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title" >Apprenant</DialogTitle>
<DialogContent className="DialogContent_width">
<div>
@ -5153,6 +5319,16 @@ function ExportMenuItem(props) {
</DialogContent>
<DialogActions>
<IconButton
autoFocus
onClick={Dialog_apprenant_handleClose_buton}
color="primary"
className={classes.customizedButton}
>
<CancelPresentationIcon />
</IconButton>
<div className="div_row">
<div className="div_row_gauche">
<Button onClick={Show_Detailled_Apprenant_Data} className="bton_enreg_dialog">Voir détail</Button>
@ -5170,13 +5346,33 @@ function ExportMenuItem(props) {
<Dialog
open={Dialog_tuteur_1_open}
onClose={Dialog_tuteur_1_handleClose}
// onClose={Dialog_tuteur_1_handleClose}
className="displaypartnersession"
static
onClose={() => null}
PaperProps={{
className: classes.paper, // Apply the paper style
style: {
overflowY: 'unset',
position: 'absolute',
top: '7rem',
margin: "2px",
},
}}
hideBackdrop={true}
disableScrollLock
classes={{
paper: classes.dialog
}}
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
>
<DialogTitle>Tuteur {quel_tuteur}</DialogTitle>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">Tuteur {quel_tuteur}</DialogTitle>
{String(quel_tuteur) === "1" && <DialogContent className="DialogContent_width">
<DialogContentText>
{Dialog_tuteur_1_message}
@ -5555,8 +5751,17 @@ function ExportMenuItem(props) {
</DialogContent>}
<DialogActions>
<IconButton
autoFocus
onClick={Dialog_tuteur_1_handleClose_buton}
color="primary"
className={classes.customizedButton}
>
<CancelPresentationIcon />
</IconButton>
<div className="div_row">
<div className="div_row_gauche">
@ -5577,11 +5782,31 @@ function ExportMenuItem(props) {
{/*** Dialog pour reinscrire un apprenant à une session */}
<Dialog
open={Dialog_add_inscription_open}
onClose={Dialog_add_inscription_handleClose}
//onClose={Dialog_add_inscription_handleClose}
className="displaypartnersession"
static
onClose={() => null}
PaperProps={{
className: classes.paper, // Apply the paper style
style: {
overflowY: 'unset',
position: 'absolute',
top: '7rem',
margin: "2px",
},
}}
hideBackdrop={true}
disableScrollLock
classes={{
paper: classes.dialog
}}
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
>
<DialogTitle> Inscrire </DialogTitle>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title" > Inscrire </DialogTitle>
<DialogContent className="DialogContent_width">
{New_Getall_TrainingSession_result && <div className="session_caract_Dialog"> <b> Session</b>
@ -5689,6 +5914,16 @@ function ExportMenuItem(props) {
</DialogContent>
<DialogActions>
<IconButton
autoFocus
onClick={Dialog_add_inscription_handleClose_buton}
color="primary"
className={classes.customizedButton}
>
<CancelPresentationIcon />
</IconButton>
<div className="div_row">
<div className="div_row_gauche">
{selectionModel.length <= 1 && <Button onClick={Add_Inscription_Apprenant} className="bton_enreg_dialog"> Inscrire</Button>}
@ -5710,11 +5945,31 @@ function ExportMenuItem(props) {
<Dialog
open={Dialog_fiche_apprenant_open}
onClose={Dialog_fiche_apprenant_handleClose}
// onClose={Dialog_fiche_apprenant_handleClose}
className="displaypartnersession"
static
onClose={() => null}
PaperProps={{
className: classes.paper, // Apply the paper style
style: {
overflowY: 'unset',
position: 'absolute',
top: '7rem',
margin: "2px",
},
}}
hideBackdrop={true}
disableScrollLock
classes={{
paper: classes.dialog
}}
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
>
<DialogTitle>MySy Information</DialogTitle>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title" >MySy Information</DialogTitle>
<DialogContent className="DialogContent_width" style={{ "minHeight": "20rem" }}>
@ -5755,6 +6010,16 @@ function ExportMenuItem(props) {
<DialogActions>
<IconButton
autoFocus
onClick={Dialog_fiche_apprenant_handleClose_buton}
color="primary"
className={classes.customizedButton}
>
<CancelPresentationIcon />
</IconButton>
<div className="div_row">
<div className="div_row_gauche">
@ -5765,8 +6030,6 @@ function ExportMenuItem(props) {
>Télécharger </Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_fiche_apprenant_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
@ -6069,9 +6332,9 @@ function ExportMenuItem(props) {
rowsPerPageOptions={[10]}
disableSelectionOnClick
/* components={{
Toolbar: GridToolbar,
}}*/
/* components={{
Toolbar: GridToolbar,
}}*/
//sx={datagridSx}
getCellClassName={(params) => {
//field === 'distantiel'

View File

@ -12088,6 +12088,10 @@ const DisplayPartnerSession = (props) => {
function clear_alert_type() {
setalert_type("");
}
function clear_display_alert_mysy() {
setdisplay_alert_mysy("");
}
return (
<div className="displaypartnersession">
@ -12102,6 +12106,7 @@ const DisplayPartnerSession = (props) => {
alert_type={alert_type}
clear_alert_message={clear_alert_message}
clear_alert_type={clear_alert_type}
clear_display_alert_mysy = {clear_display_alert_mysy}
/>
}
{/*** FIN Affichage des messages d'alerte*/}

View File

@ -7,17 +7,19 @@ const Module_Alert_Confirmation = (props) => {
const [showElement, setShowElement] = React.useState(true);
useEffect(() => {
setTimeout(function () {
const timer = setTimeout(function () {
props.clear_display_alert_mysy();
setShowElement(false)
}, 4000);
},
[])
return (
<div className="module_alert_confirmation" >
{showElement && props.alert_message && String(props.alert_type) === "success" && <div style={{
width: "70%", margin: "auto",
position: "fixed", marginLeft: '10%', top: "10px", "border-left": "1rem solid green",
@ -28,9 +30,6 @@ const Module_Alert_Confirmation = (props) => {
</Stack>
</div>}
{showElement && props.alert_message && String(props.alert_type) === "error" && <div style={{
width: "70%", margin: "auto",
position: "fixed", marginLeft: '5%', top: "10px", "border-left": "1rem solid red",

View File

@ -2356,7 +2356,7 @@ const Partner = (props) => {
}
{String(menu) === "mes_employes" &&
<div className="div_droite">
<div className="div_droite">mes_clients
<Employes conntected_employee_id={conntected_employee_id} read_access={check_user_acces_right("employe", "read")} write_access={check_user_acces_right("employe", "write")}
check_user_acces_right={check_user_acces_right} />
</div>

View File

@ -42,9 +42,52 @@ import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
import { FcOrganization, FcBusinessman, FcDepartment } from "react-icons/fc";
import Autocomplete from '@mui/material/Autocomplete';
import CancelPresentationIcon from '@mui/icons-material/CancelPresentation';
import { makeStyles } from "@material-ui/core/styles";
import Paper from '@material-ui/core/Paper';
import Draggable from 'react-draggable';
import { IconButton } from '@material-ui/core';
import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
function PaperComponent(props) {
return (
<Draggable
handle="#draggable-dialog-title"
cancel={'[class*="MuiDialogContent-root"]'}
>
<Paper {...props} />
</Draggable>
);
}
const useStyles = makeStyles((theme) => ({
dialog: {
position: 'absolute',
// left: 10,
top: 400
},
paper: {
overflowY: 'unset',
},
customizedButton: {
position: 'absolute',
left: '98%',
top: '-3%',
backgroundColor: 'lightgray',
color: 'gray',
},
}));
const Partner_Client = (props) => {
const classes = useStyles();
const history = useHistory();
const [rows_list_clients, setrows_list_clients] = useState([]);
@ -270,16 +313,23 @@ const Partner_Client = (props) => {
Get_List_Partner_Clients();
setSelectionModel([]);
setEdite_Client();
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
}
else if (String(res.data.status) === String("Err_Connexion")) {
alert(res.data.message);
history.push("/Connexion");
}
else {
setDelete_Client_Data_api("false");
setDelete_Client_Data_message(res.data.message);
alert(res.data.message);
// alert(res.data.message);
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -377,7 +427,10 @@ const Partner_Client = (props) => {
else {
setGet_List_Partner_Clients_With_Filter_api("false");
setGet_List_Partner_Clients_With_Filter_message(res.data.message);
alert(res.data.message)
//alert(res.data.message)
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("error");
}
}).catch((error) => {
@ -470,7 +523,11 @@ const Partner_Client = (props) => {
setliste_part_client_file_change_result(result['message']);
setliste_part_client_file_change_api("true");
alert(result['message']);
// alert(result['message']);
setdisplay_alert_mysy("1");
setalert_message(result['message']);
setalert_type("success");
Get_List_Partner_Clients();
@ -482,7 +539,11 @@ const Partner_Client = (props) => {
else {
setliste_part_client_file_change_message(result['message']);
setliste_part_client_file_change_api("false");
alert(result['message']);
// alert(result['message']);
setdisplay_alert_mysy("1");
setalert_message(result['message']);
setalert_type("error");
}
})
@ -634,18 +695,66 @@ const Partner_Client = (props) => {
const [display_alert_mysy, setdisplay_alert_mysy] = useState("");
const [alert_message, setalert_message] = useState("");
const [alert_type, setalert_type] = useState("");
function clear_alert_message() {
setalert_message("");
}
function clear_alert_type() {
setalert_type("");
}
function clear_display_alert_mysy() {
setdisplay_alert_mysy("");
}
return (
<div className="partner_client">
{/*** Affichage des messages d'alerte*/}
{display_alert_mysy && String(display_alert_mysy) === "1" &&
<Module_Alert_Confirmation alert_message={alert_message}
alert_type={alert_type}
clear_alert_message={clear_alert_message}
clear_alert_type={clear_alert_type}
clear_display_alert_mysy={clear_display_alert_mysy}
/>
}
{/*** FIN Affichage des messages d'alerte*/}
{String(gridline_id) !== "" && <Dialog
open={Dialog_client_open}
onClose={Dialog_client_handleClose}
// onClose={Dialog_client_handleClose}
className="displaypartnersession"
static
onClose={() => null}
PaperProps={{
className: classes.paper, // Apply the paper style
style: {
overflowY: 'unset',
position: 'absolute',
top: '7rem',
margin: "2px",
},
}}
hideBackdrop={true}
disableScrollLock
classes={{
paper: classes.dialog
}}
PaperComponent={PaperComponent}
aria-labelledby="draggable-dialog-title"
>
<DialogTitle>client</DialogTitle>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">client</DialogTitle>
<DialogContent className="DialogContent_width">
<div className="div_row_dialog">
@ -734,6 +843,16 @@ const Partner_Client = (props) => {
</DialogContent>
<DialogActions>
<IconButton
autoFocus
onClick={Dialog_client_handleClose_buton}
color="primary"
className={classes.customizedButton}
>
<CancelPresentationIcon />
</IconButton>
<div className="div_row">
<div className="div_row_gauche">
<Button onClick={Show_Detailled_client_Data} className="bton_enreg_dialog">Voir détail</Button>