diff --git a/src/components/Conseil_Classe.js b/src/components/Conseil_Classe.js
index 5a9bac1..3702e4a 100644
--- a/src/components/Conseil_Classe.js
+++ b/src/components/Conseil_Classe.js
@@ -6929,7 +6929,7 @@ const Conseil_Classe = (props) => {
/>
-
+
Choisir une convocation
@@ -2436,8 +2437,7 @@ const Module_Editique = (props) => {
onChange={(event, value) => {
if (value && value._id) {
-
- setselected_convention_id(value._id);
+ setselected_convocation_id(value._id);
if (String(value._id) === "default_mail") {
setselected_convention_type("email");
@@ -2449,11 +2449,11 @@ const Module_Editique = (props) => {
setselected_convention_type(JSON.parse(result2).type_doc);
}
settab_convention_pieces_jointes_result([]);
- setNew_Get_List_Stagiaire_Convocations_result([])
+ setNew_Get_List_Stagiaire_Convocations_result([]);
} else {
setselected_convocation_id("");
settab_convention_pieces_jointes_result([]);
- setNew_Get_List_Stagiaire_Convocations_result([])
+ setNew_Get_List_Stagiaire_Convocations_result([]);
}
}}
@@ -2662,7 +2662,7 @@ const Module_Editique = (props) => {
setalert_type("error");
return;
}
- if (!selected_convention_id || selected_convention_id === "") {
+ if (!selected_convocation_id || selected_convocation_id === "") {
setdisplay_alert_mysy("1");
setalert_message("Vous devez choisir un modèle de document");
setalert_type("error");
@@ -2692,7 +2692,7 @@ const Module_Editique = (props) => {
setalert_type("error");
return;
}
- if (!selected_convention_id || selected_convention_id === "") {
+ if (!selected_convocation_id || selected_convocation_id === "") {
setdisplay_alert_mysy("1");
setalert_message("Vous devez choisir un modèle de document");
setalert_type("error");
@@ -2768,6 +2768,11 @@ const Module_Editique = (props) => {
fullWidth
options={New_Option_Type_Document}
onChange={(event, value) => {
+
+ settab_convention_pieces_jointes_result([]);
+ setselected_convention_id("");
+ setNew_Get_List_Stagiaire_Conventions_result([]);
+
if (value && value.value) {
if (value.value === "email" && String(Dialog_1_message) === "CONVENTION_STAGIAIRE_INDIVIDUELLE")
@@ -2844,7 +2849,7 @@ const Module_Editique = (props) => {
{(String(selected_convention_type) === "email" || String(selected_convention_type) === "pdf") &&
Choisir une convention
-
0 && {
/>
}
- />
+ />}
}
diff --git a/src/components/Module_Ent_Internal_Email_Management.js b/src/components/Module_Ent_Internal_Email_Management.js
new file mode 100644
index 0000000..3aaeb77
--- /dev/null
+++ b/src/components/Module_Ent_Internal_Email_Management.js
@@ -0,0 +1,2730 @@
+
+import React, { useRef, useState, useEffect } from "react";
+import TextField from '@mui/material/TextField';
+import 'react-tooltip/dist/react-tooltip.css'
+import { Tooltip } from 'react-tooltip'
+import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
+import Button from '@mui/material/Button';
+import axios from "axios";
+import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io";
+import { AiTwotoneEdit, AiTwotoneSave } from "react-icons/ai";
+import fileDownload from 'js-file-download';
+import { IoAddCircleOutline } from "react-icons/io5";
+import InputAdornment from '@mui/material/InputAdornment';
+import { getCookie, setCookie } from 'react-use-cookie';
+import { useHistory } from "react-router-dom";
+import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
+import { Editor } from '@tinymce/tinymce-react';
+import 'react-tooltip/dist/react-tooltip.css'
+import Popup from 'reactjs-popup';
+import 'reactjs-popup/dist/index.css';
+import "react-datepicker/dist/react-datepicker.css";
+import { BsReplyAllFill } from "react-icons/bs";
+import { CiTrash, CiBoxList } from "react-icons/ci";
+import { TbMailDown } from "react-icons/tb";
+import { TbMailPlus } from "react-icons/tb";
+import { TbMailShare } from "react-icons/tb";
+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';
+import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
+import Checkbox from '@mui/material/Checkbox';
+import AttachFileIcon from '@mui/icons-material/AttachFile';
+import Autocomplete from '@mui/material/Autocomplete';
+import { Fab } from "@material-ui/core";
+
+import FormGroup from '@mui/material/FormGroup';
+import FormControlLabel from '@mui/material/FormControlLabel';
+import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
+import { AiFillCloseCircle, AiOutlineConsoleSql } from "react-icons/ai";
+import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
+import Badge from '@mui/material/Badge';
+import { styled } from '@mui/material/styles';
+import { createTheme, ThemeProvider } from '@mui/material/styles';
+import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
+import Box from '@mui/material/Box';
+import {
+ GridToolbarContainer, GridToolbarExport, GridToolbarColumnsButton,
+ GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExportContainer, useGridApiContext,
+ gridFilteredSortedRowIdsSelector,
+ gridVisibleColumnFieldsSelector,
+ GridValueGetterParams,
+ GridPreferencePanelsValue,
+
+} from '@mui/x-data-grid';
+import { RiReplyAllLine } from "react-icons/ri";
+import { FcAcceptDatabase, } from "react-icons/fc";
+
+const Module_Ent_Internal_Email_Management = (props) => {
+ const myconntected_employee_id = props.conntected_employee_id;
+
+ const [selected_employee_id, setselected_employee_id] = useState(props.conntected_employee_id);
+
+ const history = useHistory();
+ const [isLoading, setLoading] = useState();
+
+ const theme = createTheme({
+ palette: {
+ primary: {
+ light: '#F0E68C',
+ main: '#F0E68C',
+ dark: '#F0E68C',
+ contrastText: '#fff',
+ },
+ secondary: {
+ light: '#99ffcc',
+ main: '#99ffcc',
+ dark: '#ba000d',
+ contrastText: '#000',
+ },
+
+ tercier: {
+ light: '#dbff75',
+ main: '#dbff75',
+ dark: '#dbff75',
+ contrastText: '#000',
+ },
+
+ quatro: {
+ light: '#E08A8B',
+ main: '#E08A8B',
+ dark: '#E08A8B',
+ contrastText: '#000',
+ },
+
+ cinqo: {
+ light: '#D2691E',
+ main: '#D2691E',
+ dark: '#D2691E',
+ contrastText: '#000',
+ },
+ },
+ });
+
+ const StyledBadge = styled(Badge)(({ theme }) => ({
+ '& .MuiBadge-badge': {
+ right: 0,
+ top: 0,
+ border: `2px solid ${theme.palette.background.paper}`,
+ padding: '0 4px',
+ },
+ }));
+
+
+ const StyledBadge_mysy_color1 = styled(Badge)(({ }) => ({
+ '& .MuiBadge-badge': {
+ right: 0,
+ top: 0,
+ border: '2px solid #ffffff',
+ padding: '0 4px',
+ background: '#6a329f',
+ color: "#ffffff"
+ },
+ }));
+
+
+ const StyledBadge_mysy_red = styled(Badge)(({ }) => ({
+ '& .MuiBadge-badge': {
+ right: 0,
+ top: 0,
+ border: '2px solid ',
+ padding: '0 4px',
+ background: '#f44336',
+ color: "#ffffff",
+ },
+ }));
+
+ const columns = [
+ { field: '_id', headerName: '_id', hide: true },
+ { field: 'id', headerName: 'id', hide: true },
+ { field: 'from', headerName: 'De', flex: 1, hide: true, editable: false },
+ { field: 'to', headerName: 'A', flex: 1, hide: false, editable: false, minwidth: 350, },
+ {
+ field: 'read', headerName: 'Lu', width: 100, hide: true, editable: false,
+ renderCell: (cellValues) => {
+ return (
+
+ {cellValues.row.statut && String(cellValues.row.read) === "1" && "Oui"}
+ {cellValues.row.statut && String(cellValues.row.read) === "0" && "Non"}
+
+
+
+ );
+ }
+
+ },
+ { field: 'subject', headerName: 'Sujet', flex: 1, hide: false, editable: false },
+ { field: 'cc', headerName: 'cc', flex: 1, hide: true, editable: false },
+ { field: 'bcc', headerName: 'bcc', flex: 1, hide: true, editable: false },
+
+ /* {
+ field: 'statut', headerName: 'Statut', hide: false, editable: false, width: 150,
+ renderCell: (cellValues) => {
+ return (
+
+ {cellValues.row.statut && String(cellValues.row.statut) === "1" && "Env."}
+ {cellValues.row.statut && String(cellValues.row.statut) === "0" && "Init"}
+ {cellValues.row.statut && String(cellValues.row.statut) === "-1" && "Err"}
+
+
+
+ );
+ }
+ },*/
+ {
+ field: 'sent', headerName: 'Date', flex: 1, hide: false, editable: false,
+ renderCell: (cellValues) => {
+ return (
+
+ {cellValues.row.sent && <> {String(cellValues.row.sent).substring(0, 16)} >}
+
+
+ );
+ },
+ },
+
+ { field: 'message', headerName: 'MEssage', flex: 1, hide: true, editable: false },
+ /* { field: 'error_message', headerName: 'Erreur', flex: 1, hide: false, editable: false },*/
+
+ { field: 'smtp_account_From_User', headerName: 'smtp_account_From_User', flex: 1, hide: true, editable: false },
+ { field: 'smtp_account_user', headerName: 'smtp_account_user', flex: 1, hide: true, editable: false },
+ { field: 'smtp_account_port', headerName: 'smtp_account_port', flex: 1, hide: true, editable: false },
+
+
+ /*{
+ field: "resend", headerName: 'renvoyer',
+ renderCell: (cellValues) => {
+ return (
+
+
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+ ×
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, le message sera (r)envoyé
+
+
+
+
+ {
+ // handleClick_Renvoyer_Email_Qiueu(cellValues.row._id);
+ //console.log('modal closed ');
+ close();
+ }}> Valider
+
+
+
+ {
+ //console.log('modal closed ');
+ close();
+ }}
+ >
+ Annuler
+
+
+
+
+ )}
+
+
+
+ );
+ }
+ },*/
+
+ {
+ field: "delete", headerName: 'Supprimer',
+ renderCell: (cellValues) => {
+ return (
+
+
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+ ×
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, le message sera définitivement supprimé
+
+
+
+
+ {
+ handleClick_Delete_Internal_Mail(cellValues.row._id);
+ //console.log('modal closed ');
+ close();
+ }}> Valider
+
+
+
+ {
+ //console.log('modal closed ');
+ close();
+ }}
+ >
+ Annuler
+
+
+
+
+ )}
+
+
+
+ );
+ }
+ }
+
+
+ ]
+
+
+ const New_Option_Filter = [
+ { "id": "email", "label": "Email ", "value": "email" },
+ { "id": "nom", "label": "Nom ", "value": "nom" },
+ { "id": "prenom", "label": "Prénom ", "value": "prenom" },
+ { "id": "archive", "label": "Archive", "value": "archive" },
+ { "id": "", "label": "", "value": "" },
+ { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
+ ]
+
+ const [gridline_id, setgridline_id] = useState("");
+ const [selected_id, setselected_id] = useState("");
+
+ const [p_filtre1, setp_filtre1] = useState("");
+ const [p_filtre1_value, setp_filtre1_value] = useState("");
+
+ const [p_filtre2, setp_filtre2] = useState("");
+ const [p_filtre2_value, setp_filtre2_value] = useState("");
+
+ function clean_all_filters() {
+
+ setp_filtre1("");
+ setp_filtre1_value("");
+
+ setp_filtre2("");
+ setp_filtre2_value("");
+
+ setgridline_id('');
+ }
+
+ const [selectionModel, setSelectionModel] = React.useState([]);
+ const [actionmass_ftion_val, setactionmass_ftion_val] = useState();
+ async function actionmass_ftion_Traitemet() {
+
+ }
+
+
+ const [handleClick_Delete_Internal_Mail_api, sethandleClick_Delete_Internal_Mail_api] = useState();
+ const [handleClick_Delete_Internal_Mail_message, sethandleClick_Delete_Internal_Mail_message] = useState();
+ const [handleClick_Delete_Internal_Mail_result, sethandleClick_Delete_Internal_Mail_result] = useState();
+ function handleClick_Delete_Internal_Mail(tab_message_id) {
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("token", stored_cookie);
+ form.append("tab_message_id", tab_message_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Message_To_Internal_Mail/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In handleClick_Delete_Internal_Mail res.data.status = " + res.data.status);
+ //console.log(" In handleClick_Delete_Internal_Mail res.data.message r_class = " + res.data.message);
+
+ setreply_email("");
+ setadd_one_internal_email("");
+ Clear_Detail_internal_email_Fields();
+ Clear_One_Detail_internal_email_Fields();
+ setgridline_id("");
+ props.Get_Nb_Unread_Emails();
+
+
+ sethandleClick_Delete_Internal_Mail_api("true");
+ sethandleClick_Delete_Internal_Mail_result(res.data.message);
+
+ if (email_envoye_recu !== "1")
+ Get_All_Connected_User_Email();
+ else
+ Get_All_Connected_Sent_User_Email();
+
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+
+
+ }
+ else {
+ sethandleClick_Delete_Internal_Mail_api("false");
+ sethandleClick_Delete_Internal_Mail_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( handleClick_Delete_Internal_Mail = ', error);
+ sethandleClick_Delete_Internal_Mail_api("false");
+ alert(" Impossible de supprimer le message");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [Get_Nb_Unread_Emails_api, setGet_Nb_Unread_Emails_api] = useState();
+ const [Get_Nb_Unread_Emails_message, setGet_Nb_Unread_Emails_message] = useState();
+ const [Get_Nb_Unread_Emails_result, setGet_Nb_Unread_Emails_result] = useState([]);
+ function Get_Nb_Unread_Emails(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("token", stored_cookie);
+ form.append("related_collection_recid", props.conntected_account_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Nb_User_Internal_Mail_Not_Read/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_Nb_Unread_Emails res.data.status = " + res.data.status);
+ //console.log(" In Get_Nb_Unread_Emails res.data.message r_class = " + res.data.message);
+ setGet_Nb_Unread_Emails_api("true");
+ setGet_Nb_Unread_Emails_result(res.data.message);
+ }
+ else {
+ setGet_Nb_Unread_Emails_api("false");
+ setGet_Nb_Unread_Emails_message(res.data.message);
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_Nb_Unread_Emails = ', error);
+ setGet_Nb_Unread_Emails_api("false");
+ alert("Impossible de récuperer la liste des emails");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [Get_All_Connected_User_Email_api, setGet_All_Connected_User_Email_api] = useState();
+ const [Get_All_Connected_User_Email_message, setGet_All_Connected_User_Email_message] = useState();
+ const [Get_All_Connected_User_Email_result, setGet_All_Connected_User_Email_result] = useState([]);
+ function Get_All_Connected_User_Email(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("token", stored_cookie);
+ form.append("related_collection_recid", props.conntected_account_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_User_Internal_Mail/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_All_Connected_User_Email res.data.status = " + res.data.status);
+ // console.log(" In Get_All_Connected_User_Email res.data.message r_class = " + res.data.message);
+ setGet_All_Connected_User_Email_api("true");
+ setGet_All_Connected_User_Email_result(res.data.message);
+ }
+ else {
+ setGet_All_Connected_User_Email_api("false");
+ setGet_All_Connected_User_Email_message(res.data.message);
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_All_Connected_User_Email = ', error);
+ setGet_All_Connected_User_Email_api("false");
+ alert("Impossible de récuperer la liste des emails");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [NewGet_All_Internal_Destinataire_Emails_result, setNewGet_All_Internal_Destinataire_Emails_result] = useState([]);
+
+ const [Get_All_Internal_Destinataire_Emails_api, setGet_All_Internal_Destinataire_Emails_api] = useState();
+ const [Get_All_Internal_Destinataire_Emails_message, setGet_All_Internal_Destinataire_Emails_message] = useState();
+ const [Get_All_Internal_Destinataire_Emails_result, setGet_All_Internal_Destinataire_Emails_result] = useState([]);
+ function Get_All_Internal_Destinataire_Emails(event) {
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("token", stored_cookie);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Internal_Destinataire/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_All_Internal_Destinataire_Emails res.data.status = " + res.data.status);
+ // console.log(" In Get_All_Internal_Destinataire_Emails res.data.message r_class = " + res.data.message);
+ setGet_All_Internal_Destinataire_Emails_api("true");
+ setGet_All_Internal_Destinataire_Emails_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_email = JSON.parse(x).email;
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_prenom+" "+local_nom+" <"+local_email+">",
+ "nom": local_nom,
+ "prenom": local_prenom,
+ "email": local_email,
+
+ };
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0)
+ setNewGet_All_Internal_Destinataire_Emails_result(new_data2);
+ else
+ setNewGet_All_Internal_Destinataire_Emails_result([]);
+ }
+ else {
+ setGet_All_Internal_Destinataire_Emails_api("false");
+ setGet_All_Internal_Destinataire_Emails_message(res.data.message);
+ setNewGet_All_Internal_Destinataire_Emails_result([]);
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_All_Internal_Destinataire_Emails = ', error);
+ setGet_All_Internal_Destinataire_Emails_api("false");
+ alert("Impossible de récuperer la liste des emails destinataires");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [Get_All_Connected_Sent_User_Email_api, setGet_All_Connected_Sent_User_Email_api] = useState();
+ const [Get_All_Connected_Sent_User_Email_message, setGet_All_Connected_Sent_User_Email_message] = useState();
+ const [Get_All_Connected_Sent_User_Email_result, setGet_All_Connected_Sent_User_Email_result] = useState([]);
+ function Get_All_Connected_Sent_User_Email(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysych');
+ const stored_connected_user_id = getCookie('tokenmysychconnecteduserid');
+ form.append("token", stored_cookie);
+ form.append("creation_by", props.conntected_account_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Internal_Mail_Sent_By_User/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_All_Connected_Sent_User_Email res.data.status = " + res.data.status);
+ // console.log(" In Get_All_Connected_Sent_User_Email res.data.message r_class = " + res.data.message);
+ setGet_All_Connected_Sent_User_Email_api("true");
+ setGet_All_Connected_Sent_User_Email_result(res.data.message);
+
+ setGet_All_Connected_User_Email_result(res.data.message);
+
+ }
+ else {
+ setGet_All_Connected_Sent_User_Email_api("false");
+ setGet_All_Connected_Sent_User_Email_message(res.data.message);
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_All_Connected_Sent_User_Email = ', error);
+ setGet_All_Connected_Sent_User_Email_api("false");
+ alert("Impossible de récuperer la liste des apprenants");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const New_Option = [
+ { "id": "0", "label": "Dupliquer", "value": "dupliquer" },
+ { "id": "1", "label": "Exporter", "value": "exporter" },
+ { "id": "3", "label": "(R)Inscrire", "value": "inscrire" },
+ { "id": "4", "label": "ENT Créer accès", "value": "create_ent" },
+ { "id": "5", "label": "ENT Désactiver", "value": "disable_ent" },
+ { "id": "6", "label": "Archiver/Désarch.", "value": "archive_desarchive" },
+ { "id": "2", "label": "Supprimer", "value": "supprimer" },
+ ]
+
+
+ useEffect(() => {
+ Get_All_Connected_User_Email();
+ Get_All_Internal_Destinataire_Emails();
+
+ }, [])
+
+
+
+ const [p_one_internal_email_from, setp_one_internal_email_from] = useState("");
+ const [p_one_internal_email_cc, setp_one_internal_email_cc] = useState("");
+ const [p_one_internal_email_bcc, setp_one_internal_email_bcc] = useState("");
+ const [p_one_internal_email_subject, setp_one_internal_email_subject] = useState("");
+ const [p_one_internal_email_to, setp_one_internal_email_to] = useState("");
+
+ const [p_one_internal_email_message, setp_one_internal_email_message] = useState("");
+ const [p_one_internal_email_error_message, setp_one_internal_email_error_message] = useState("");
+ const [p_one_internal_email_sent, setp_one_internal_email_sent] = useState("");
+ const [p_one_internal_email_smtp_account_smtpsrv, setp_one_internal_email_smtp_account_smtpsrv] = useState("");
+ const [p_one_internal_email_smtp_account_user, setp_one_internal_email_smtp_account_user] = useState("");
+ const [p_one_internal_email_smtp_account_From_User, setp_one_internal_email_smtp_account_From_User] = useState("");
+ const [p_one_internal_email_smtp_account_port, setp_one_internal_email_smtp_account_port] = useState("");
+
+ const [p_internal_email_id, setp_internal_email_id] = useState("");
+ const [p_internal_email_from, setp_internal_email_from] = useState("");
+ const [p_internal_email_cc, setp_internal_email_cc] = useState("");
+ const [p_internal_email_bcc, setp_internal_email_bcc] = useState("");
+ const [p_internal_email_subject, setp_internal_email_subject] = useState("");
+ const [p_internal_email_to, setp_internal_email_to] = useState("");
+
+ const [p_internal_email_message, setp_internal_email_message] = useState("");
+ const [p_internal_email_error_message, setp_internal_email_error_message] = useState("");
+ const [p_internal_email_sent, setp_internal_email_sent] = useState("");
+ const [p_internal_email_smtp_account_smtpsrv, setp_internal_email_smtp_account_smtpsrv] = useState("");
+ const [p_internal_email_smtp_account_user, setp_internal_email_smtp_account_user] = useState("");
+ const [p_internal_email_smtp_account_From_User, setp_internal_email_smtp_account_From_User] = useState("");
+ const [p_internal_email_smtp_account_port, setp_internal_email_smtp_account_port] = useState("");
+
+
+ function Clear_Detail_internal_email_Fields() {
+ setp_internal_email_id("");
+ setp_internal_email_from("");
+ setp_internal_email_cc("");
+ setp_internal_email_bcc("");
+ setp_internal_email_subject("");
+ setp_internal_email_to("");
+ setp_internal_email_message("");
+
+ setp_internal_email_error_message("");
+ setp_internal_email_sent("");
+ setp_internal_email_smtp_account_smtpsrv("");
+ setp_internal_email_smtp_account_user("");
+ setp_internal_email_smtp_account_From_User("");
+ setp_internal_email_smtp_account_port("");
+
+ settab_convention_pieces_jointes_result([]);
+ }
+
+ function Clear_One_Detail_internal_email_Fields() {
+ setp_one_internal_email_from("");
+ setp_one_internal_email_cc("");
+ setp_one_internal_email_bcc("");
+ setp_one_internal_email_subject("");
+ setp_one_internal_email_to("");
+ setp_one_internal_email_message("");
+
+ setp_one_internal_email_error_message("");
+ setp_one_internal_email_sent("");
+ setp_one_internal_email_smtp_account_smtpsrv("");
+ setp_one_internal_email_smtp_account_user("");
+ setp_one_internal_email_smtp_account_From_User("");
+ setp_one_internal_email_smtp_account_port("");
+ settab_convention_pieces_jointes_result([]);
+ }
+
+
+
+
+ const [Get_Given_Email_Data_api, setGet_Given_Email_Data_api] = useState();
+ const [Get_Given_Email_Data_message, setGet_Given_Email_Data_message] = useState();
+ const [Get_Given_Email_Data_result, setGet_Given_Email_Data_result] = useState();
+ function Get_Given_Email_Data(local_selected_email_id) {
+
+
+ Clear_Detail_internal_email_Fields();
+
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("token", stored_cookie);
+ form.append("internal_mail_id", local_selected_email_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Internal_Mail/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) === "true") {
+ //console.log(" In Get_Given_Email_Data res.data.status = " + res.data.status);
+ console.log(" In Get_Given_Email_Data res.data.message r_class = " + res.data.message);
+ console.log(" In Get_Given_Email_Data res.data.message len = " + String(res.data.message).length);
+
+ setLoading(false);
+ setGet_Given_Email_Data_api("true");
+ if (String(res.data.message).length > 0) {
+ setGet_Given_Email_Data_result(res.data.message);
+ var mylocaltraining = JSON.parse(res.data.message);
+
+ if (mylocaltraining._id) {
+ setp_internal_email_id(mylocaltraining._id);
+ } else {
+ setp_internal_email_id("");
+ }
+
+ if (mylocaltraining.from) {
+ setp_internal_email_from(mylocaltraining.from);
+ } else {
+ setp_internal_email_from("");
+ }
+
+ if (mylocaltraining.cc) {
+ setp_internal_email_cc(mylocaltraining.cc);
+ } else {
+ setp_internal_email_cc("");
+ }
+
+ if (mylocaltraining.bcc) {
+ setp_internal_email_bcc(mylocaltraining.bcc);
+ } else {
+ setp_internal_email_bcc("");
+ }
+
+ if (mylocaltraining.subject) {
+ setp_internal_email_subject(mylocaltraining.subject);
+ } else {
+ setp_internal_email_subject("");
+ }
+
+ if (mylocaltraining.to) {
+ setp_internal_email_to(mylocaltraining.to);
+ } else {
+ setp_internal_email_to("");
+ }
+
+ if (mylocaltraining.message) {
+ setp_internal_email_message(mylocaltraining.message);
+ } else {
+ setp_internal_email_message("");
+ }
+
+ if (mylocaltraining.error_message) {
+ setp_internal_email_error_message(mylocaltraining.error_message);
+ } else {
+ setp_internal_email_error_message("");
+ }
+
+ if (mylocaltraining.sent) {
+ setp_internal_email_sent(mylocaltraining.sent);
+ } else {
+ setp_internal_email_sent("");
+ }
+
+ if (mylocaltraining.tab_saved_file_id) {
+ settab_sent_email_pieces_jointes(mylocaltraining.tab_saved_file_id);
+ } else {
+ settab_sent_email_pieces_jointes([]);
+ }
+
+ Disable_Internal_Email_DetailFields();
+
+ if (document.getElementById('myRef_detail_mail')) {
+ // myRef.current.scrollIntoView({ behavior: "smooth" });
+ var divh = document.getElementById('myRef_detail_mail').offsetTop + 500;
+ window.scrollTo({
+ top: divh,
+ behavior: "smooth",
+ });
+ }
+
+ // props.Get_Nb_Unread_Emails();
+
+ if (email_envoye_recu === "1") {
+ Get_All_Connected_Sent_User_Email();
+ } else {
+ Get_All_Connected_User_Email();
+ }
+ }
+
+ } else if (String(res.data.status) === String("Err_Connexion")) {
+ setLoading(false);
+ alert('Erreur: ' + res.data.message);
+ history.push("/Connexion");
+ }
+
+ else {
+ setLoading(false);
+ setGet_Given_Email_Data_api("false");
+ setGet_Given_Email_Data_message(res.data.message);
+ // alert(res.data.message);
+
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_Given_Email_Data = ', error);
+ setGet_Given_Email_Data_api("false");
+ alert(" Impossible de récuperer les données de l'email ");
+
+ })
+ }
+
+
+
+ const [display_internal_email, setdisplay_internal_email] = React.useState("");
+ const [internal_email_data_changed, setinternal_email_data_changed] = React.useState("");
+ const [internal_email_data_edit_mode, setinternal_email_data_edit_mode] = useState("");
+ const [add_one_internal_email, setadd_one_internal_email] = React.useState("");
+
+ const [reply_email, setreply_email] = React.useState("");
+
+ function Disable_Internal_Email_DetailFields() {
+
+ setinternal_email_data_edit_mode("0");
+
+ var liste_champs = ['detail_internal_mail_to', 'detail_internal_mail_sujet',
+ 'detail_internal_mail_message']
+
+
+ for (let i = 0; i < liste_champs.length; i++) {
+
+ if (document.getElementsByName(String(liste_champs[i])) && document.getElementsByName(String(liste_champs[i]))[0]) {
+ document.getElementsByName(String(liste_champs[i]))[0].disabled = true;
+ document.getElementsByName(String(liste_champs[i]))[0].style.backgroundColor = "#ECEFF1";
+
+ }
+ }
+
+ }
+
+
+
+
+ // -- Gestion pièces jointes
+
+ const [Download_one_attached_document_api, setDownload_one_attached_document_api] = useState();
+ const [Download_one_attached_document_result, setDownload_one_attached_document_result] = useState();
+ const [Download_one_attached_document_message, setDownload_one_attached_document_message] = useState();
+
+ const Download_one_attached_document = (event) => {
+ const stored_cookie = getCookie('tokenmysych');
+
+
+ var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
+ var token = stored_cookie;
+ var file_name = event.target.id;
+
+
+ var url = process.env.REACT_APP_API_URL + "myclass/api/Get_Stored_Downloaded_File/" + token + "/" + file_name;
+
+ setLoading(true);
+ axios.get(url, { responseType: 'blob', },)
+ .then((res) => {
+ setLoading(false);
+ fileDownload(res.data, nom_fiche_detaillee);
+ setDownload_one_attached_document_api("true");
+ }).catch((error) => {
+ setLoading(false);
+ console.error('Error:', error);
+ setDownload_one_attached_document_api("false");
+
+ });
+ }
+
+ const [tab_sent_email_pieces_jointes, settab_sent_email_pieces_jointes] = useState([]);
+
+ const [tab_convention_pieces_jointes_result, settab_convention_pieces_jointes_result] = useState([]);
+
+ const [file_1_name, setfile_1_name] = useState();
+
+ const [sessions_file_change_1_api, setsessions_file_change_1_api] = useState();
+ const [sessions_file_change_1_result, setsessions_file_change_1_result] = useState();
+ const [sessions_file_change_1_message, setsessions_file_change_1_message] = useState();
+ const sessions_file_change_1 = event => {
+
+ const fileUploaded = event.target.files[0];
+ let file_size = event.target.files[0].size;
+ let file_type = event.target.files[0].type;
+
+
+
+
+ console.log("file_size 2 = ", file_size, " file_type = ", file_type);
+ if (file_size > 10000000) {
+ // alert("Le fichier ne doit pas depasser un 1 Méga octets");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le fichier ne doit pas depasser un 1 Méga octets");
+ setalert_type("error");
+ // console.log("Le fichier ne doit pas depasser un 1 Méga octets");
+ return;
+ }
+
+ setfile_1_name(event.target.files[0]);
+
+ const formData = new FormData();
+ formData.append('File', fileUploaded);
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysych');
+
+ //formData.append("token", stored_cookie);
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ return;
+
+
+ };
+
+
+
+ const [sessions_file_change_1_convention_api, setsessions_file_change_1_convention_api] = useState();
+ const [sessions_file_change_1_convention_result, setsessions_file_change_1_convention_result] = useState();
+ const [sessions_file_change_1_convention_message, setsessions_file_change_1_convention_message] = useState();
+ const sessions_file_change_1_convention = event => {
+
+
+ const fileUploaded = event.target.files[0];
+ let file_size = event.target.files[0].size;
+ let file_type = event.target.files[0].type;
+
+
+ if (file_type !== "application/pdf") {
+ // alert("Le fichier n'est pas de type PDF");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le fichier n'est pas de type PDF");
+ setalert_type("error");
+ return;
+ }
+
+
+
+ if (file_size > 10000000) {
+ // alert("Le fichier ne doit pas depasser un 1 Méga octets");
+ //console.log("Le fichier ne doit pas depasser un 1 Méga octets");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le fichier ne doit pas depasser un 1 Méga octets");
+ setalert_type("error");
+ return;
+ }
+
+ //var new_node = {'name':event.target.files[0].name, 'type':event.target.files[0].type}
+
+
+ var new_tmp = [];
+
+ if (tab_convention_pieces_jointes_result && tab_convention_pieces_jointes_result.length > 0) {
+
+ tab_convention_pieces_jointes_result.map((x) => {
+ new_tmp.push(x);
+
+ });
+
+ }
+
+ new_tmp.push(event.target.files[0])
+
+ settab_convention_pieces_jointes_result(new_tmp);
+
+ return;
+
+
+ };
+
+
+ const [file_2_name, setfile_2_name] = useState();
+
+ const [sessions_file_change_2_api, setsessions_file_change_2_api] = useState();
+ const [sessions_file_change_2_result, setsessions_file_change_2_result] = useState();
+ const [sessions_file_change_2_message, setsessions_file_change_2_message] = useState();
+ const sessions_file_change_2 = event => {
+
+ const fileUploaded = event.target.files[0];
+ let file_size = event.target.files[0].size;
+ let file_type = event.target.files[0].type;
+
+
+ console.log("file_size 1 = ", file_size, " file_type = ", file_type);
+ if (file_size > 10000000) {
+ //alert("Le fichier ne doit pas depasser un 1 Méga octets");
+ //console.log("Le fichier ne doit pas depasser un 1 Méga octets");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le fichier ne doit pas depasser un 1 Méga octets");
+ setalert_type("error");
+ return;
+ }
+ setfile_2_name(event.target.files[0]);
+
+ const formData = new FormData();
+ formData.append('File', fileUploaded);
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysych');
+
+ //formData.append("token", stored_cookie);
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ return;
+
+
+ };
+
+
+ // Cette fonction permet d'enregister la fiche catalogue d'une formation
+ const [Record_Class_Catalogue_File_api, setRecord_Class_Catalogue_File_api] = useState();
+ const [Record_Class_Catalogue_File_result, setRecord_Class_Catalogue_File_result] = useState();
+ const [Record_Class_Catalogue_File_message, setRecord_Class_Catalogue_File_message] = useState();
+
+ function Record_Class_Catalogue_File() {
+
+ if (!p_detail_one_file_to_download_type_name) {
+ //alert(" Vous devez donner un nom à la pièce jointe");
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez donner un nom à la pièce jointe");
+ setalert_type("error");
+ return;
+ }
+
+ if (file_1_name && file_1_name.name) {
+ //console.log(" ### Traitement de : ", file_1_name.name);
+
+ const formData = new FormData();
+ formData.append('File', file_1_name);
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysych');
+
+ formData.append("token", stored_cookie);
+ formData.append("file_business_object", p_detail_one_file_to_download_type_name);
+ formData.append("file_name", file_1_name.name);
+ formData.append("status", "0");
+ formData.append("object_owner_collection", "myclass");
+ formData.append("object_owner_id", selected_id);
+ formData.append("type_document", "catalogue_file");
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ setLoading(true);
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Store_User_Downloaded_File/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+
+ setLoading(false);
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Success:', result['message']);
+ setRecord_Class_Catalogue_File_result(result['message']);
+ setRecord_Class_Catalogue_File_api("true");
+
+ // Get_List_Of_All_PJ(selected_id);
+ 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")
+ setdisplay_alert_mysy("1");
+ setalert_message(" La pièce jointe " + file_1_name.name + " a été bien enregistrée");
+ setalert_type("success");
+
+ }
+ else {
+ setRecord_Class_Catalogue_File_message(result['message']);
+ setRecord_Class_Catalogue_File_api("false");
+ //alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Record_Class_Catalogue_File Error:', error);
+ setRecord_Class_Catalogue_File_api("false");
+ // alert(" Impossible d'ajouter la pièce jointe");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'ajouter la pièce jointe");
+ setalert_type("error");
+ });
+
+ }
+
+
+ }
+
+
+
+
+ const [add_one_eu_to_class, setadd_one_eu_to_class] = useState("");
+
+ const [Record_All_PJ_api, setRecord_All_PJ_api] = useState();
+ const [Record_All_PJ_result, setRecord_All_PJ_result] = useState();
+ const [Record_All_PJ_message, setRecord_All_PJ_message] = useState();
+
+ function Record_All_PJ() {
+
+ if (!p_detail_one_file_to_download_type_name) {
+ //alert(" Vous devez donner un nom à la pièce jointe");
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez donner un nom à la pièce jointe");
+ setalert_type("error");
+ return;
+ }
+
+ if (file_1_name && file_1_name.name) {
+ //console.log(" ### Traitement de : ", file_1_name.name);
+
+ const formData = new FormData();
+ formData.append('File', file_1_name);
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysych');
+
+ formData.append("token", stored_cookie);
+ formData.append("file_business_object", p_detail_one_file_to_download_type_name);
+ formData.append("file_name", file_1_name.name);
+ formData.append("status", "0");
+ formData.append("object_owner_collection", "myclass");
+ formData.append("object_owner_id", selected_id);
+ formData.append("type_document", "");
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ setLoading(true);
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Store_User_Downloaded_File/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+
+ setLoading(false);
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Success:', result['message']);
+ setRecord_All_PJ_result(result['message']);
+ setRecord_All_PJ_api("true");
+
+ Get_List_Of_All_PJ(selected_id);
+ Get_Class_Catalogue_File(selected_id);
+ 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")
+ setdisplay_alert_mysy("1");
+ setalert_message(" La pièce jointe " + file_1_name.name + " a été bien enregistrée");
+ setalert_type("success");
+
+ }
+ else {
+ setRecord_All_PJ_message(result['message']);
+ setRecord_All_PJ_api("false");
+ //alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Record_All_PJ Error:', error);
+ setRecord_All_PJ_api("false");
+ // alert(" Impossible d'ajouter la pièce jointe");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'ajouter la pièce jointe");
+ setalert_type("error");
+ });
+
+ }
+
+
+ }
+
+
+ const [Delete_one_attached_document_api, setDelete_one_attached_document_api] = useState();
+ const [Delete_one_attached_document_result, setDelete_one_attached_document_result] = useState();
+ const [Delete_one_attached_document_message, setDelete_one_attached_document_message] = useState();
+
+ const Delete_one_attached_document = (event) => {
+ const stored_cookie = getCookie('tokenmysych');
+
+ var formData = new FormData();
+ var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
+ var file_name = event.target.id;
+
+
+ formData.append("token", stored_cookie);
+ formData.append("file_name", file_name);
+
+ var url = process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/";
+
+ setLoading(true);
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Success:', result['message']);
+ setDelete_one_attached_document_result(result['message']);
+ setDelete_one_attached_document_api("true");
+ Get_List_Of_All_PJ(selected_id);
+ Get_Class_Catalogue_File(selected_id);
+ // alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("success");
+
+ }
+ else {
+ setDelete_one_attached_document_message(result['message']);
+ setDelete_one_attached_document_api("false");
+ // alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Record_All_PJ Error:', error);
+ setDelete_one_attached_document_api("false");
+ // alert(" Impossible de supprimer le document");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de supprimer le document");
+ setalert_type("error");
+
+ });
+
+
+ }
+
+ function Delete_Email_Attached_Doc(event) {
+
+ var doc_to_del_name = event.target.id;
+ const myArray = tab_convention_pieces_jointes_result;
+
+ let new_myArray = myArray.filter(file => file.name !== String(doc_to_del_name));
+
+ //console.log(" new_myArray = ", new_myArray);
+
+
+ var new_tab = []
+ for (let i = 0; i < new_myArray.length; i++) {
+ new_tab.push(new_myArray[i]);
+ }
+
+ settab_convention_pieces_jointes_result(new_tab);
+ }
+
+
+
+
+ const [Get_Class_Catalogue_File_api, setGet_Class_Catalogue_File_api] = useState();
+ const [Get_Class_Catalogue_File_result, setGet_Class_Catalogue_File_result] = useState([]);
+ const [Get_Class_Catalogue_File_message, setGet_Class_Catalogue_File_message] = useState();
+
+ function Get_Class_Catalogue_File(local_employee_id) {
+
+ const formData = new FormData();
+
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysych');
+
+ formData.append("token", stored_cookie);
+ formData.append("filter_object_owner_collection", "myclass");
+ formData.append("filter_object_owner_id", local_employee_id);
+ formData.append("filter_type_document", "catalogue_file");
+
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+ setLoading(true);
+
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files_With_Filter/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Message :', result['message']);
+ setGet_Class_Catalogue_File_result(result['message']);
+ setGet_Class_Catalogue_File_api("true");
+
+ }
+ else {
+ setGet_Class_Catalogue_File_message(result['message']);
+ setGet_Class_Catalogue_File_api("false");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Get_Class_Catalogue_File Error:', error);
+ setGet_Class_Catalogue_File_api("false");
+ });
+
+ }
+
+
+
+
+ const [Get_List_Of_All_PJ_api, setGet_List_Of_All_PJ_api] = useState();
+ const [Get_List_Of_All_PJ_result, setGet_List_Of_All_PJ_result] = useState([]);
+ const [Get_List_Of_All_PJ_message, setGet_List_Of_All_PJ_message] = useState();
+
+ function Get_List_Of_All_PJ(local_employee_id) {
+
+ const formData = new FormData();
+
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysych');
+
+ formData.append("token", stored_cookie);
+ formData.append("object_owner_collection", "myclass");
+ formData.append("object_owner_id", local_employee_id);
+
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+ setLoading(true);
+
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Message :', result['message']);
+ setGet_List_Of_All_PJ_result(result['message']);
+ setGet_List_Of_All_PJ_api("true");
+
+ }
+ else {
+ setGet_List_Of_All_PJ_message(result['message']);
+ setGet_List_Of_All_PJ_api("false");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Get_List_Of_All_PJ Error:', error);
+ setGet_List_Of_All_PJ_api("false");
+ });
+
+ }
+
+
+
+ function Delete_file_1_name() {
+ setfile_1_name();
+ }
+
+ function Delete_file_2_name() {
+ setfile_2_name();
+ }
+
+ const [p_detail_one_file_to_download_type_name, setp_detail_one_file_to_download_type_name] = useState();
+
+ // -- end gestion pièces jointes
+
+
+ const [Create_Empty_Email_api, setCreate_Empty_Email_api] = useState();
+ const [Create_Empty_Email_message, setCreate_Empty_Email_message] = useState();
+ const [Create_Empty_Email_result, setCreate_Empty_Email_result] = useState();
+ function Create_Empty_Email() {
+ setLoading(true);
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+
+
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("token", stored_cookie);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Create_Empty_Internal_Mail/";
+
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ // console.log(" In Create_Empty_Email res.data.status = " + res.data.status);
+ // console.log(" In Create_Empty_Email res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ setCreate_Empty_Email_api("true");
+ setCreate_Empty_Email_result(res.data.message);
+ setselected_id(res.data.message)
+
+ }
+ else {
+ setselected_id("")
+ setCreate_Empty_Email_api("false");
+ setCreate_Empty_Email_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Create_Empty_Email : Not good man :( mysearchtext = ' + error);
+ setCreate_Empty_Email_api("false");
+ // alert(" Impossible d'ajouter l'évaluation l'UE ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'initialiser l'email");
+ setalert_type("error");
+
+ })
+ }
+
+
+
+ const [Update_New_Email_api, setUpdate_New_Email_api] = useState();
+ const [Update_New_Email_message, setUpdate_New_Email_message] = useState();
+ const [Update_New_Email_result, setUpdate_New_Email_result] = useState();
+ function Update_New_Email() {
+ setLoading(true);
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+ const stored_cookie = getCookie('tokenmysych');
+
+ form.append("token", stored_cookie);
+
+ form.append("tab_message_id", selected_id);
+ // form.append("to", p_one_internal_email_to);
+ form.append("from", p_one_internal_email_from);
+ form.append("cc", p_one_internal_email_cc);
+ form.append("bcc", p_one_internal_email_bcc);
+ form.append("subject", p_one_internal_email_subject);
+ form.append("message", p_one_internal_email_message);
+
+ if (!reply_email || reply_email !== '1') {
+ var tab_emails = []
+ for (var i = 0; i < list_mail.length; i++) {
+ tab_emails.push(list_mail[i].email)
+ }
+ form.append("to", tab_emails);
+ } else {
+ form.append("to", p_one_internal_email_to);
+ }
+
+
+
+
+ for (let i = 0; i < tab_convention_pieces_jointes_result.length; i++) {
+ form.append('File', tab_convention_pieces_jointes_result[i]);
+ }
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Message_To_Internal_Mail/";
+
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ // console.log(" In Update_New_Email res.data.status = " + res.data.status);
+ // console.log(" In Update_New_Email res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+
+ Get_All_Connected_User_Email();
+
+ setadd_one_internal_email("");
+ setdisplay_internal_email("");
+ Clear_Detail_internal_email_Fields();
+ Clear_One_Detail_internal_email_Fields();
+
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+
+ // props.Get_Nb_Unread_Emails();
+
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ setUpdate_New_Email_api("true");
+ setUpdate_New_Email_result(res.data.message);
+ setselected_id(res.data.message)
+
+
+
+ }
+ else {
+ setUpdate_New_Email_api("false");
+ setUpdate_New_Email_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Update_New_Email : Not good man :( mysearchtext = ' + error);
+ setUpdate_New_Email_api("false");
+ // alert(" Impossible d'ajouter l'évaluation l'UE ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de créer l'email");
+ setalert_type("error");
+
+ })
+ }
+
+
+ const [Delete_New_Empty_Email_api, setDelete_New_Empty_Email_api] = useState();
+ const [Delete_New_Empty_Email_message, setDelete_New_Empty_Email_message] = useState();
+ const [Delete_New_Empty_Email_result, setDelete_New_Empty_Email_result] = useState();
+ function Delete_New_Empty_Email() {
+ setLoading(true);
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+
+
+ const stored_cookie = getCookie('tokenmysych');
+
+ form.append("token", stored_cookie);
+
+ form.append("tab_message_id", selected_id);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Message_To_Internal_Mail/";
+
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ // console.log(" In Delete_New_Empty_Email res.data.status = " + res.data.status);
+ console.log(" In Delete_New_Empty_Email res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+
+ Get_All_Connected_User_Email();
+
+ setadd_one_internal_email("");
+ setdisplay_internal_email("");
+ Clear_Detail_internal_email_Fields();
+ Clear_One_Detail_internal_email_Fields();
+
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ setDelete_New_Empty_Email_api("true");
+ setDelete_New_Empty_Email_result(res.data.message);
+ setselected_id(res.data.message)
+
+ }
+ else {
+ setDelete_New_Empty_Email_api("false");
+ setDelete_New_Empty_Email_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Delete_New_Empty_Email : Not good man :( mysearchtext = ' + error);
+ setDelete_New_Empty_Email_api("false");
+ // alert(" Impossible d'ajouter l'évaluation l'UE ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de créer l'email");
+ setalert_type("error");
+
+ })
+ }
+
+
+
+ const myRef_corps_mail = useRef(null);
+
+ const myRef_detail_mail = useRef(null);
+
+ const myRef_head = useRef(null);
+
+ const [is_recherche, setis_recherche] = useState("0");
+ 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("");
+ }
+
+ const one_editorRef_message = useRef(null);
+
+ function editor_keyup() {
+
+ }
+
+ const [email_envoye_recu, setemail_envoye_recu] = useState("0");
+
+ const fixedVal_liste_mail_id = [];
+ const [list_mail, setlist_mail] = useState([...fixedVal_liste_mail_id]);
+
+
+ function reply_to_mail() {
+
+ Create_Empty_Email();
+ setreply_email("1");
+ setp_one_internal_email_from(p_internal_email_to);
+ setp_one_internal_email_cc(p_internal_email_cc);
+ setp_one_internal_email_bcc(p_internal_email_bcc);
+ setp_one_internal_email_subject("Re: " + String(p_internal_email_subject));
+ setp_one_internal_email_to(p_internal_email_from);
+
+ var reply_message = "
De : " + `${p_internal_email_from}` + "
Enovyé le : " + `${String(p_internal_email_sent).substring(0, 16)}` + "
À : " + `${p_internal_email_from}` + "
Sujet : " + `${p_internal_email_subject}` + "
";
+ reply_message = reply_message + String(p_internal_email_message);
+
+ setp_one_internal_email_message(reply_message);
+ settab_convention_pieces_jointes_result([]);
+ setadd_one_internal_email("1");
+ }
+ return (
+
+
+ {isLoading &&
}
+
+ {/*** Affichage des messages d'alerte*/}
+ {display_alert_mysy && String(display_alert_mysy) === "1" &&
+
+ }
+
+
Mes Emails
+
+
+
Utilisez les filtres !
+
+
+
+ {New_Option_Filter && New_Option_Filter.length > 0 &&
(data).value === String(p_filtre1))[0].label}
+ options={New_Option_Filter}
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_filtre1(value.value);
+
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+
+
+
+
+
+
+ {String(p_filtre1) !== "archive" &&
+ {p_filtre1 &&
+
{ setp_filtre1_value(e.target.value); }}
+ InputProps={{
+ endAdornment: (
+
+ {
+ setp_filtre1_value("");
+ }} />
+
+ ),
+ }}
+
+ />
+
+ }
+ }
+
+
+
+
+ {p_filtre1 &&
}
+ {p_filtre1 &&
}
+
+
+
+
+ {p_filtre2 &&
+
+
+
+ {New_Option_Filter && New_Option_Filter.length > 0 &&
(data).value === String(p_filtre2))[0].label}
+ options={New_Option_Filter}
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_filtre2(value.value);
+
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+
+
+
+ {String(p_filtre2).length > 2 && String(p_filtre2) !== "archive" &&
+
setp_filtre2_value(e.target.value)}
+ InputProps={{
+ endAdornment: (
+
+ {
+ setp_filtre2_value("");
+ }} />
+
+ ),
+ }}
+
+ />}
+
+
+
+
+
+
+ {String(p_filtre2).length > 3 &&
}
+
+ }
+
+
+ {
+
+
+ {
+ // Getall_TrainingSession();
+ setis_recherche("1");
+ }}
+ >Rechercher
+
+
+
+
+ {
+ clean_all_filters();
+ setis_recherche("");
+ }}>Annuler
+
+
+
+
+
}
+
+
+
+
+
+
+
+
+
+
+ {email_envoye_recu && email_envoye_recu === "0" && }
+ onClick={(e) => {
+ Clear_One_Detail_internal_email_Fields();
+ Clear_Detail_internal_email_Fields();
+ setadd_one_internal_email("");
+ setdisplay_internal_email("");
+
+ setemail_envoye_recu("1");
+ Get_All_Connected_Sent_User_Email();
+ }} style={{ fontFamily: 'DM Sans', fontSize: '10px', width: '15rem' }}
+ > Voir Emails Envoyés
+ }
+
+ {email_envoye_recu && email_envoye_recu === "1" && }
+ onClick={(e) => {
+ Clear_One_Detail_internal_email_Fields();
+ Clear_Detail_internal_email_Fields();
+ setadd_one_internal_email("");
+ setdisplay_internal_email("");
+
+ setemail_envoye_recu("0");
+ Get_All_Connected_User_Email();
+ }}
+ style={{ fontFamily: 'DM Sans', fontSize: '10px', width: '15rem', color: 'green', borderColor: 'green' }} >Voir Emails reçu
+ }
+
+
+
+
+
+
+
+
+
+ {
+ setSelectionModel(newSelectionModel);
+
+ }}
+ selectionModel={selectionModel}
+
+ localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
+ rows={Get_All_Connected_User_Email_result.map((item, index) => (
+ {
+ id: index,
+ _id: JSON.parse(item)._id,
+ from: JSON.parse(item).from,
+ subject: JSON.parse(item).subject,
+ to: JSON.parse(item).to,
+ cc: JSON.parse(item).cc,
+ bcc: JSON.parse(item).bcc,
+ message: JSON.parse(item).message,
+ read: JSON.parse(item).read,
+ statut: JSON.parse(item).statut,
+ sent: JSON.parse(item).sent,
+ error_message: JSON.parse(item).error_message,
+ smtp_account_From_User: JSON.parse(item).smtp_account_From_User,
+ smtp_account_user: JSON.parse(item).smtp_account_user,
+ smtp_account_port: JSON.parse(item).smtp_account_port,
+ }
+ ))}
+
+ columns={columns}
+ pageSize={10}
+ className="datagridclass"
+
+ onRowDoubleClick={(newSelectionModel) => {
+ Clear_One_Detail_internal_email_Fields();
+ Clear_Detail_internal_email_Fields();
+ setadd_one_internal_email("");
+ setdisplay_internal_email("1")
+ setselected_id(newSelectionModel.row._id);
+ setgridline_id(newSelectionModel.row.id);
+ Get_Given_Email_Data(newSelectionModel.row._id);
+ }}
+
+
+ rowsPerPageOptions={[10]}
+ //disableSelectionOnClick
+ components={{
+ Toolbar: GridToolbar,
+ }}
+ //sx={datagridSx}
+ getCellClassName={(params) => {
+
+
+ //field === "order_header_status"
+ if (params.field === "order_header_status" && String(params.value) == "0") {
+ return 'cell--status--brouillon';
+ }
+
+ }}
+ getRowClassName={(params) => {
+
+
+
+
+ // Pour la gestion de la couleur de zone double cliquée
+ if (String(params.row.id) === String(gridline_id)) {
+ return 'line--statut--selected';
+ }
+
+ else if (parseInt(String(params.row.id)) % 2 === 0) {
+ if (String(params.row.read) === "0") {
+ return 'line--statut--pair_not_read';
+ }
+ if (String(params.row.read) === "1") {
+ return 'line--statut--pair--read';
+ }
+ }
+ else if (parseInt(String(params.row.id)) % 2 !== 0) {
+ if (String(params.row.read) === "0") {
+ return 'line--statut--impair_not_read';
+ }
+ if (String(params.row.read) === "1") {
+ return 'line--statut--impair--read';
+ }
+ }
+ }}
+
+
+ />
+
+
+
+
+
+
+
+ {selectionModel && selectionModel.length >= 1 &&
+
Traitement en masse
+
+
{
+ if (value && value.value) {
+ if (String(value.value) === "supprimer"
+ || String(value.value) === "dupliquer" || String(value.value) === "exporter"
+ || String(value.value) === "inscrire"
+ || String(value.value) === "create_ent"
+ || String(value.value) === "disable_ent"
+ || String(value.value) === "archive_desarchive"
+ ) {
+ setactionmass_ftion_val(value.value);
+ }
+ else {
+ setactionmass_ftion_val();
+ }
+
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+ {selectionModel && selectionModel.length >= 1 &&
+ actionmass_ftion_val && String(actionmass_ftion_val).length > 2 &&
+
+
+ Traiter
+
+ }
+ modal
+ nested
+ position="center center"
+
+ >
+
+ {close => (
+
+
+ ×
+
+
MySy Information - {actionmass_ftion_val}
+
+ {' '}
+ {String(actionmass_ftion_val) === "supprimer" &&
+ Confirmer la suppression de {selectionModel.length} apprenants .
+ }
+
+ {String(actionmass_ftion_val) === "inscription" &&
+ Confirmer l'inscription de {selectionModel.length} apprenants à la session que vous aller choisir à présent.
+ }
+
+ {String(actionmass_ftion_val) === "exporter" &&
+ Confirmer l'export excel de {selectionModel.length} apprenant(s).
+ }
+
+ {String(actionmass_ftion_val) === "inscrire" &&
+ Confirmer l'inscription en masse de {selectionModel.length} apprenant(s).
+ }
+
+ {String(actionmass_ftion_val) === "create_ent" &&
+ Confirmer la création des comptes ENT en masse de {selectionModel.length} apprenant(s).
+ }
+
+ {String(actionmass_ftion_val) === "disable_ent" &&
+ Confirmer la désactivation des comptes ENT en masse de {selectionModel.length} apprenant(s).
+ }
+
+ {String(actionmass_ftion_val) === "archive_desarchive" &&
+ Confirmer la l'archivage / désarchivage en masse pour {selectionModel.length} lignes.
+ }
+
+
+
+
+ {
+ actionmass_ftion_Traitemet();
+ close();
+ }}> Valider
+
+
+
+ {
+ //console.log('modal closed ');
+ close();
+ }}
+ >
+ Annuler
+
+
+
+
+ )}
+
+
+ }
+
+ }
+
+
+
+
+
+
+
+
+
+ {
+ setreply_email("");
+ setadd_one_internal_email("1");
+ Clear_Detail_internal_email_Fields();
+ Clear_One_Detail_internal_email_Fields();
+ Create_Empty_Email();
+
+ if (document.getElementById('myRef_detail_mail')) {
+ // myRef.current.scrollIntoView({ behavior: "smooth" });
+ var divh = document.getElementById('myRef_detail_mail').offsetTop + 500;
+ window.scrollTo({
+ top: divh,
+ behavior: "smooth",
+ });
+ }
+
+ }}
+ className="detail_class_submenu bton_add_session"
+ id='menu_import_participant' name='menu_import_participant' style={{ maxWidth: '20rem' }}>Ecrire 1 email
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {String(display_internal_email) === "1" && String(add_one_internal_email) !== "1" &&
+
+
+
+
+
Envoyer à
+
+
+
+
+
+
+
+ }
+ onClick={(e) => {
+ reply_to_mail();
+ }}
+ style={{ fontFamily: 'DM Sans', fontSize: '10px', color: 'green', borderColor: 'green', height: '3rem', }} >Répondre
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ one_editorRef_message.current = editor}
+ //initialValue={field_programme_initial_value}
+
+ onKeyUp={editor_keyup}
+ value={p_internal_email_message}
+ disabled={true}
+ init={{
+ resize: false,
+ height: 600,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+ {
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ setdisplay_internal_email("");
+ setreply_email("");
+ setadd_one_internal_email("");
+ Clear_Detail_internal_email_Fields();
+ Clear_One_Detail_internal_email_Fields();
+ setgridline_id("");
+ }} className="bton_annule_dialog" >Fermer
+
+
+
+
+
+ {tab_sent_email_pieces_jointes &&
+
+
+
+ {tab_sent_email_pieces_jointes && tab_sent_email_pieces_jointes.map((val) => (
+
+
+
{((val).download_files_file_business_object)}
+ Télécharger
+
+
+
+
+
+
+ ))}
+
+
+
}
+
+
+
+
+
}
+
+ {String(add_one_internal_email) === "1" &&
+
+
+
+
+
+
+
+ Envoyer à
+
+ {(!reply_email || reply_email !== "1") &&
+
{
+ setlist_mail([
+ ...fixedVal_liste_mail_id,
+ ...newValue.filter((i) => fixedVal_liste_mail_id.indexOf(i) === -1),
+ ]);
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+ }
+
+ {reply_email && reply_email === "1" &&
+
+ {
+ setp_one_internal_email_to(e.target.value)
+ }}
+ />
+
+
+
}
+
+
+
+
+
+
Sujet
+
+
+ {
+ setp_one_internal_email_subject(e.target.value)
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+ one_editorRef_message.current = editor}
+ //initialValue={field_programme_initial_value}
+ onEditorChange={(newValue, editor) => {
+ setp_one_internal_email_message(one_editorRef_message.current.getContent());
+
+ }}
+
+ onKeyUp={editor_keyup}
+ value={p_one_internal_email_message}
+ disabled={false}
+ init={{
+ resize: false,
+ height: 600,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ajouter un fichier
+
+
+
+
+
+
+ {file_1_name && file_1_name.name &&
+
+ Nom du fichier
+ {
+ setp_detail_one_file_to_download_type_name(e.target.value);
+
+ }}
+ />
+
+
+
+
+ Fichier : {file_1_name.name} Supprimer
+ }
+
+ {Record_All_PJ_api && String(Record_All_PJ_api) === "true" &&
Pièce jointe enregistrée
}
+
+ {Record_All_PJ_api && String(Record_All_PJ_api) === "false" &&
{Record_All_PJ_message}
}
+
+
+
+
+
+ {file_1_name && file_1_name.name &&
+
+
+ } className="bton_enreg" style={{ "width": "80%" }}>ENREGISTRER LA PIECE
+
+
+
+
}
+
+
+ {tab_convention_pieces_jointes_result &&
+
+
+
+ {tab_convention_pieces_jointes_result && tab_convention_pieces_jointes_result.map((val) => (
+
+
+
{((val).name)}
+
+
+
Supprimer
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+ ×
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, la pièce jointe sera définitivement supprimée .
+
+
+
+
+
+ {
+
+ Delete_Email_Attached_Doc(event);
+ close();
+ }}
+ name={((val).name)} id={((val).name)}
+ > Valider
+
+
+
+ {
+ //console.log('modal closed ');
+ close();
+ }}
+ >
+ Annuler
+
+
+
+
+ )}
+
+
+
+ ))}
+
+
+
}
+
+
+
+
+
+
+
+
+
+
+
+ {
+ Update_New_Email();
+ }}
+ className="bton_enreg_dialog">Envoyer Mail
+
+
+
+ {
+ Delete_New_Empty_Email();
+ }} className="bton_annule_dialog" >annuler new mail
+
+
+
+
+
+
+
+
+
+
+
+
+
}
+
+
+
+ )
+}
+
+
+export default Module_Ent_Internal_Email_Management;
+
+
diff --git a/src/components/Module_Ent_Mes_Documents.js b/src/components/Module_Ent_Mes_Documents.js
index 77885f3..753aea9 100644
--- a/src/components/Module_Ent_Mes_Documents.js
+++ b/src/components/Module_Ent_Mes_Documents.js
@@ -983,7 +983,7 @@ registerLocale('fr', fr);
{props.my_title &&
{props.my_title} }
{!props.my_title &&
Tous vos documents }
-
+ {/*}
Utilisez les filtres !
@@ -1371,7 +1371,7 @@ registerLocale('fr', fr);
-
+
*/}
Choisir une Session ou une Promotion
diff --git a/src/components/Module_Ent_Mes_Formations.js b/src/components/Module_Ent_Mes_Formations.js
index aaf4def..4bdc90e 100644
--- a/src/components/Module_Ent_Mes_Formations.js
+++ b/src/components/Module_Ent_Mes_Formations.js
@@ -90,7 +90,7 @@ function PaperComponent(props) {
);
-}
+}
const useStyles = makeStyles((theme) => ({
@@ -113,7 +113,7 @@ const useStyles = makeStyles((theme) => ({
}));
const Module_Ent_Mes_Formations = (props) => {
-registerLocale('fr', fr);
+ registerLocale('fr', fr);
const classes = useStyles();
const history = useHistory();
@@ -181,16 +181,16 @@ registerLocale('fr', fr);
{ field: '_id', headerName: '_id', hide: true, disableExport: true, },
{ field: 'associated_session_id', headerName: 'associated_session_id', hide: true, disableExport: true, },
{ field: 'associated_inscription_id', headerName: 'associated_inscription_id', hide: true, disableExport: true, },
- { field: 'external_code', headerName: 'external_code', hide: false, minWidth: 200, flex: 1, renderCell: (params) =>
, },
- { field: 'title', headerName: 'title', hide: false, minWidth: 200, flex: 1, renderCell: (params) =>
, },
- { field: 'session_code_session', headerName: 'Code Promo', hide: false, minWidth: 200, flex: 1, renderCell: (params) =>
, },
+ { field: 'external_code', headerName: 'Code', hide: false, minWidth: 200, flex: 1, renderCell: (params) =>
, },
+ { field: 'title', headerName: 'Titre', hide: false, minWidth: 200, flex: 1, renderCell: (params) =>
, },
+ { field: 'session_code_session', headerName: 'Promotion / Session', hide: false, minWidth: 200, flex: 1, renderCell: (params) =>
, },
{ field: 'session_date_debut', headerName: 'Du', hide: false, minWidth: 200, flex: 1, renderCell: (params) =>
, },
{ field: 'session_date_fin', headerName: 'Au', hide: false, minWidth: 200, flex: 1, renderCell: (params) =>
, },
- { field: 'description', headerName: 'description', hide: true, Width: 1 },
+ { field: 'description', headerName: 'Description', hide: true, Width: 1 },
{ field: 'internal_url', headerName: 'internal_url', hide: true, Width: 1 },
- { field: 'objectif', headerName: 'objectif', hide: true, Width: 1 },
- { field: 'programme', headerName: 'programme', hide: true, Width: 1 },
- { field: 'prerequis', headerName: 'prerequis', hide: true, Width: 1 },
+ { field: 'objectif', headerName: 'Objectif', hide: true, Width: 1 },
+ { field: 'programme', headerName: 'Programme', hide: true, Width: 1 },
+ { field: 'prerequis', headerName: 'Prerequis', hide: true, Width: 1 },
]
@@ -390,7 +390,7 @@ registerLocale('fr', fr);
setLoading(true);
axios.post(myurl, form).then(res => {
// 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);
+ // console.log(" In Getall_Sequence_Of_Session res.data.message r_class = " + res.data.message);
setLoading(false);
if (String(res.data.status) === String("true")) {
@@ -2011,7 +2011,7 @@ registerLocale('fr', fr);
*/}
-
+
{
setaffichage_class("grid")
}}>
@@ -2026,210 +2026,210 @@ registerLocale('fr', fr);
- { affichage_class && String(affichage_class) === "list" &&
+ {affichage_class && String(affichage_class) === "list" &&
-
-
+
+
-
-
-
+
+
+ {
+ setSelectionModel(newSelectionModel);
+ /*if (newSelectionModel.length === 1)
+ handleClick_edit_employee_From_Line(newSelectionModel);*/
+ if (newSelectionModel.length !== 1) {
+ // setsubmenu();
+
+ }
+ }}
+ selectionModel={selectionModel}
+
+ localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
+ rows={New_Get_List_Ent_Formation_result.map((item, index) => (
+ {
+ id: index,
+ _id: (item)._id,
+ title: (item).title,
+ external_code: (item).external_code,
+ objectif: (item).objectif,
+ programme: (item).programme,
+ prerequis: (item).prerequis,
+ description: (item).description,
+
+ associated_session_id: (item).associated_session_id,
+ associated_inscription_id: (item).associated_inscription_id,
+ session_code_session: (item).session_code_session,
+ session_date_debut: (item).session_date_debut,
+ session_date_fin: (item).session_date_fin,
+ }
+ ))}
+
+ columns={columns_ent_mes_formations}
+ pageSize={10}
+ className="datagridclass"
+
+ onRowDoubleClick={(newSelectionModel) => {
+ setselected_id(newSelectionModel.row._id);
+ setgridline_id(newSelectionModel.row.id);
+ setselected_session_id(newSelectionModel.row.associated_session_id);
+ setselected_inscription_id(newSelectionModel.row.associated_inscription_id);
+
+ setselected_class_external_code(newSelectionModel.row.external_code);
+ setselected_code_session(newSelectionModel.row.session_code_session);
+
+
+ submenu_detail();
+
+ Get_Given_Class_Data(newSelectionModel.row._id);
+ Get_List_UE_From_Class_Id(newSelectionModel.row.class_id);
+ Getall_Class_List_Evalution(newSelectionModel.row.class_id);
+ handleClick_Class_Selected_From_Line(newSelectionModel.row.associated_session_id, newSelectionModel.row.associated_inscription_id);
+ }}
+
+ rowsPerPageOptions={[10]}
+ disableSelectionOnClick
+ components={{
+ Toolbar: GridToolbar,
+ }}
+ //sx={datagridSx}
+ getCellClassName={(params) => {
+
+ if (params.field === 'distantiel' && String(params.value) === "1") {
+ return 'cell--distantiel';
+ }
+ if (params.field === "presentiel" && String(params.value) == "1") {
+ return 'cell--presentiel';
+ }
+
+
+ //field === "statut"
+ if (params.field === "status" && String(params.value) == "0") {
+ return 'cell--statut--preinscrit';
+ }
+
+ if (params.field === "status" && String(params.value) == "1") {
+ return 'cell--statut--inscrit';
+ }
+
+ if (params.field === "status" && String(params.value) == "-1") {
+ return 'cell--statut--annule';
+ }
+
}}
- >
- {
- setSelectionModel(newSelectionModel);
- /*if (newSelectionModel.length === 1)
- handleClick_edit_employee_From_Line(newSelectionModel);*/
- if (newSelectionModel.length !== 1) {
- // setsubmenu();
+ getRowClassName={(params) => {
+ // Pour la gestion de la couleur de zone double cliquée
+ if (String(params.row.id) === String(gridline_id)) {
+ return 'line--statut--selected';
+ }
+ else if (parseInt(String(params.row.id)) % 2 === 0) {
+ return 'line--statut--pair';
+ }
+ else if (parseInt(String(params.row.id)) % 2 !== 0) {
+ return 'line--statut--impair';
+ }
- }
- }}
- selectionModel={selectionModel}
+ if (String(params.row.status) === "-1") {
+ return 'line--statut--annule';
+ }
+ if (String(params.row.status) === "0") {
+ return 'line--statut--preinscrit';
+ }
+ if (String(params.row.status) === "1") {
+ return 'line--statut--inscrit';
+ }
+ }}
+ getEstimatedRowHeight={() => 200}
+ getRowHeight={() => "auto"}
+ sx={{
+ "& .MuiDataGrid-cellContent": {
+ minHeight: 50,
- localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
- rows={New_Get_List_Ent_Formation_result.map((item, index) => (
- {
- id: index,
- _id: (item)._id,
- title: (item).title,
- external_code: (item).external_code,
- objectif: (item).objectif,
- programme: (item).programme,
- prerequis: (item).prerequis,
- description: (item).description,
-
- associated_session_id: (item).associated_session_id,
- associated_inscription_id: (item).associated_inscription_id,
- session_code_session: (item).session_code_session,
- session_date_debut: (item).session_date_debut,
- session_date_fin: (item).session_date_fin,
- }
- ))}
-
- columns={columns_ent_mes_formations}
- pageSize={10}
- className="datagridclass"
-
- onRowDoubleClick={(newSelectionModel) => {
- setselected_id(newSelectionModel.row._id);
- setgridline_id(newSelectionModel.row.id);
- setselected_session_id(newSelectionModel.row.associated_session_id);
- setselected_inscription_id(newSelectionModel.row.associated_inscription_id);
-
- setselected_class_external_code(newSelectionModel.row.external_code);
- setselected_code_session(newSelectionModel.row.session_code_session);
-
-
- submenu_detail();
-
- Get_Given_Class_Data(newSelectionModel.row._id);
- Get_List_UE_From_Class_Id(newSelectionModel.row.class_id);
- Getall_Class_List_Evalution(newSelectionModel.row.class_id);
- handleClick_Class_Selected_From_Line(newSelectionModel.row.associated_session_id, newSelectionModel.row.associated_inscription_id);
- }}
-
- rowsPerPageOptions={[10]}
- disableSelectionOnClick
- components={{
- Toolbar: GridToolbar,
- }}
- //sx={datagridSx}
- getCellClassName={(params) => {
-
- if (params.field === 'distantiel' && String(params.value) === "1") {
- return 'cell--distantiel';
- }
- if (params.field === "presentiel" && String(params.value) == "1") {
- return 'cell--presentiel';
- }
-
-
- //field === "statut"
- if (params.field === "status" && String(params.value) == "0") {
- return 'cell--statut--preinscrit';
- }
-
- if (params.field === "status" && String(params.value) == "1") {
- return 'cell--statut--inscrit';
- }
-
- if (params.field === "status" && String(params.value) == "-1") {
- return 'cell--statut--annule';
- }
-
- }}
- getRowClassName={(params) => {
- // Pour la gestion de la couleur de zone double cliquée
- if (String(params.row.id) === String(gridline_id)) {
- return 'line--statut--selected';
- }
- else if (parseInt(String(params.row.id)) % 2 === 0) {
- return 'line--statut--pair';
- }
- else if (parseInt(String(params.row.id)) % 2 !== 0) {
- return 'line--statut--impair';
- }
-
- if (String(params.row.status) === "-1") {
- return 'line--statut--annule';
- }
- if (String(params.row.status) === "0") {
- return 'line--statut--preinscrit';
- }
- if (String(params.row.status) === "1") {
- return 'line--statut--inscrit';
- }
- }}
- getEstimatedRowHeight={() => 200}
- getRowHeight={() => "auto"}
- sx={{
- "& .MuiDataGrid-cellContent": {
- minHeight: 50,
-
- }
- }}
- />
-
-
-
-
+ }
+ }}
+ />
+
+
+
+
}
{
affichage_class && String(affichage_class) === "grid" &&
-
+
{New_Get_List_Ent_Formation_result && New_Get_List_Ent_Formation_result.map((formation) => (
@@ -2269,14 +2269,14 @@ registerLocale('fr', fr);
{
String(submenu) === "detail" && Get_Given_Class_Data_result && Get_Given_Class_Data_result.length > 0 &&
-
+
-
-
Description
+
+
Description
- {JSON.parse(Get_Given_Class_Data_result).description &&
+ {JSON.parse(Get_Given_Class_Data_result).description &&
{parse(String(JSON.parse(Get_Given_Class_Data_result).description))}
@@ -2285,10 +2285,10 @@ registerLocale('fr', fr);
-
-
Objectif
+
+
Objectif
- {JSON.parse(Get_Given_Class_Data_result).objectif &&
+ {JSON.parse(Get_Given_Class_Data_result).objectif &&
{parse(String(JSON.parse(Get_Given_Class_Data_result).objectif))}
}
@@ -2296,17 +2296,17 @@ registerLocale('fr', fr);
-
-
-
- Programme
+
+
Programme
- {JSON.parse(Get_Given_Class_Data_result).programme &&
+ {JSON.parse(Get_Given_Class_Data_result).objectif &&
{parse(String(JSON.parse(Get_Given_Class_Data_result).programme))}
-
- }
+
}
+
+
+
@@ -2354,7 +2354,7 @@ registerLocale('fr', fr);
}
-
+
{
String(submenu) === "notes" && Get_Given_Class_Data_result && Get_Given_Class_Data_result.length > 0 &&
Notes
@@ -2526,7 +2526,7 @@ registerLocale('fr', fr);
-
+
{Get_List_Of_All_PJ_result &&
@@ -2535,7 +2535,7 @@ registerLocale('fr', fr);
{Get_List_Of_All_PJ_result && Get_List_Of_All_PJ_result.map((val) => (
Télécharger {(JSON.parse(val).file_business_object)}
-
+
))}
diff --git a/src/components/Module_Ent_Mes_Notes.js b/src/components/Module_Ent_Mes_Notes.js
index c17f358..df81fd7 100644
--- a/src/components/Module_Ent_Mes_Notes.js
+++ b/src/components/Module_Ent_Mes_Notes.js
@@ -374,7 +374,7 @@ const Module_Ent_Mes_Notes = (props) => {
{isLoading &&
}
-
+
{/*** Affichage des messages d'alerte*/}
{display_alert_mysy && String(display_alert_mysy) === "1" &&
@@ -389,7 +389,7 @@ const Module_Ent_Mes_Notes = (props) => {
Mes Notes
-
+ {/*}
Utilisez les filtres !
@@ -549,7 +549,7 @@ const Module_Ent_Mes_Notes = (props) => {
}
-
+
*/}
Choisir une Session ou une Promotion
{New_Get_List_Ent_Session_Promotion_result && New_Get_List_Ent_Session_Promotion_result.length > 0 &&
{
- ENT Full Planning
+ Mes Plannings
{/*
Utilisez les filtres !
diff --git a/src/components/Module_Internal_Email_Management.js b/src/components/Module_Internal_Email_Management.js
index ec98d7f..72949c7 100644
--- a/src/components/Module_Internal_Email_Management.js
+++ b/src/components/Module_Internal_Email_Management.js
@@ -529,7 +529,7 @@ const Module_Internal_Email_Management = (props) => {
var node = {
"_id": local_id,
"id": localid,
- "label": local_email,
+ "label": local_prenom+" "+local_nom+" <"+local_email+">",
"nom": local_nom,
"prenom": local_prenom,
"email": local_email,
@@ -2101,7 +2101,7 @@ const Module_Internal_Email_Management = (props) => {
- {String(props.check_user_acces_right("stagiaire", "write")) === "1" && selectionModel && selectionModel.length >= 1 &&
+ {selectionModel && selectionModel.length >= 1 &&
Traitement en masse
{
- {String(props.check_user_acces_right("stagiaire", "write")) === "1" && selectionModel && selectionModel.length >= 1 &&
+ {selectionModel && selectionModel.length >= 1 &&
actionmass_ftion_val && String(actionmass_ftion_val).length > 2 &&
@@ -2420,10 +2420,10 @@ const Module_Internal_Email_Management = (props) => {
-
+
Envoyer à
- {(!reply_email || reply_email !== "1") &&
+ {(!reply_email || reply_email !== "1") &&
}
- {reply_email && reply_email === "1" &&
+ {reply_email && reply_email === "1" &&
{
-
Sujet
+
Sujet
-
+
{
-
+
{
@@ -2700,7 +2700,7 @@ const Module_Internal_Email_Management = (props) => {
className="bton_enreg_dialog">Envoyer Mail
-
+
{
Delete_New_Empty_Email();
}} className="bton_annule_dialog" >annuler new mail
diff --git a/src/components/Module_Session_Notes_Classement.js b/src/components/Module_Session_Notes_Classement.js
index 3930422..839329a 100644
--- a/src/components/Module_Session_Notes_Classement.js
+++ b/src/components/Module_Session_Notes_Classement.js
@@ -215,7 +215,7 @@ const Module_Session_Notes_Classement = (props) => {
{ field: 'prenom', headerName: 'Prenom', minwidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , },
{ field: 'rang', headerName: 'Rang', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => , },
{
- field: 'note_finale', headerName: 'Noete finale', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => ,
+ field: 'note_finale', headerName: 'Note finale', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => ,
},
@@ -297,7 +297,7 @@ const Module_Session_Notes_Classement = (props) => {
//handleClose_option_button_vertical(e, option);
setAnchorEl(null);
- if (option && String(option) === "Jury Edit") {
+ if (option && String(option) === "Observ. Edit") {
setDialog_JURY_INFO_open(true);
}
@@ -451,7 +451,7 @@ const Module_Session_Notes_Classement = (props) => {
//handleClose_option_button_vertical(e, option);
setAnchorEl(null);
- if (option && String(option) === "Jury Edit") {
+ if (option && String(option) === "Observ. Edit") {
setDialog_JURY_INFO_open(true);
@@ -654,7 +654,7 @@ const Module_Session_Notes_Classement = (props) => {
const options_menu_vertical = [
'',
- 'Jury Edit',
+ 'Observ. Edit',
];
@@ -668,8 +668,8 @@ const Module_Session_Notes_Classement = (props) => {
};
const handleClose_option_button_vertical = (event, value) => {
- if (value && String(value) === "Jury Edit") {
- console.log("### Jury Edit= ", value);
+ if (value && String(value) === "Observ. Edit") {
+ console.log("### Observ. Edit= ", value);
}
@@ -2534,8 +2534,8 @@ const Module_Session_Notes_Classement = (props) => {
>
- Délibération du Jury
-
+ Observation
+
{Dialog_1_message}
@@ -2563,7 +2563,7 @@ const Module_Session_Notes_Classement = (props) => {
-
*/}
-
Validation
+ {/*
Validation
{New_Option_Valisation_Jury && New_Option_Valisation_Jury.length > 0 && jury_cell_editable === true &&
{
/>}
-
+
*/}
diff --git a/src/components/Modules_Mes_Documents.js b/src/components/Modules_Mes_Documents.js
index e76a8f8..c76ebc4 100644
--- a/src/components/Modules_Mes_Documents.js
+++ b/src/components/Modules_Mes_Documents.js
@@ -97,7 +97,7 @@ const useStyles = makeStyles((theme) => ({
backgroundColor: 'lightgray',
color: 'gray',
},
-}));
+}));
const Modules_Mes_Documents = (props) => {
@@ -1080,7 +1080,7 @@ const Modules_Mes_Documents = (props) => {
setdata_row_grouped_by(grouped_by);
setdata_row_grouped_field(grouped_by);
datagrid_grouped_by(grouped_by);
- setcookie_document_display_view("mysy_session_data_row_grouped_by", String(grouped_by), { path: '/' });
+ setcookie_document_display_view("mysy_document_data_row_grouped_by", String(grouped_by), { path: '/' });
}
const [document_display_view, setdocument_display_view] = useState("list");
@@ -1169,8 +1169,9 @@ const Modules_Mes_Documents = (props) => {
- {props.my_title &&
{props.my_title} }
- {!props.my_title &&
Tous vos documents }
+ {props.all_ged && props.my_title &&
{props.my_title} }
+ {props.all_ged && !props.my_title &&
Tous vos documents }
+
Utilisez les filtres !
diff --git a/src/components/Modules_Mes_Documents_old.js b/src/components/Modules_Mes_Documents_old.js
index 08c3e1f..cc96e33 100644
--- a/src/components/Modules_Mes_Documents_old.js
+++ b/src/components/Modules_Mes_Documents_old.js
@@ -43,7 +43,7 @@ import {
gridVisibleColumnFieldsSelector,
GridValueGetterParams,
GridPreferencePanelsValue,
-
+
} from '@mui/x-data-grid';
import AttachFileIcon from '@mui/icons-material/AttachFile';
//import { utils, writeFileXLSX } from "xlsx";
diff --git a/src/components/New_ButtonHilight_ENT_Student_2025.js b/src/components/New_ButtonHilight_ENT_Student_2025.js
index 21d1192..744f7c6 100644
--- a/src/components/New_ButtonHilight_ENT_Student_2025.js
+++ b/src/components/New_ButtonHilight_ENT_Student_2025.js
@@ -46,7 +46,7 @@ const New_ButtonHilight_ENT_Student_2025 = () => {
const [state, setstate] = useState("France");
const [userIp, setuserIp] = useState("172.71.122.128");
-
+
const controlNavbar = () => {
if (typeof window !== 'undefined') {
diff --git a/src/components/New_Navigation_ENT_Student_2025.js b/src/components/New_Navigation_ENT_Student_2025.js
index 139deef..b197dfb 100644
--- a/src/components/New_Navigation_ENT_Student_2025.js
+++ b/src/components/New_Navigation_ENT_Student_2025.js
@@ -12,7 +12,7 @@ const New_Navigation_ENT_Student_2025 = () => {
const history = useHistory();
const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']);
const [cookie_part, setCookie_part, removeCookie_part] = useCookies(['tokenmysypart']);
-
+
return (
diff --git a/src/components/Notes_Evaluation.js b/src/components/Notes_Evaluation.js
index 19cd1ec..f81d855 100644
--- a/src/components/Notes_Evaluation.js
+++ b/src/components/Notes_Evaluation.js
@@ -1155,7 +1155,7 @@ const Notes_Evaluation = (props) => {
"convocation_send_date": "",
"convocation_send_type": "",
};
- new_data2.push(node);
+ // new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Evaluation_Participant_List_result(new_data2);
diff --git a/src/components/Partner.js b/src/components/Partner.js
index f8dae1f..01b9e8d 100644
--- a/src/components/Partner.js
+++ b/src/components/Partner.js
@@ -2031,7 +2031,8 @@ const Partner = (props) => {
- {String(menu) !== "internal_email" &&
+ {String(menu) !== "internal_email" &&
+
EMAILS {
// monactivite_func();
@@ -2039,7 +2040,8 @@ const Partner = (props) => {
}
- {String(menu) === "internal_email" && EMAILS EMAILS {
// monactivite_func();
}}> }
@@ -2439,6 +2441,7 @@ const Partner = (props) => {
partner_owner_recid={conntected_account_partner_owner_recid}
type_user_connected={"partner_account"}
my_title={"Gestion Documentaire"}
+ all_ged={"Gestion 1"}
/>
}
@@ -3422,6 +3425,7 @@ const Partner = (props) => {
partner_owner_recid={conntected_account_partner_owner_recid}
type_user_connected={"partner_account"}
my_title={"Gestion Documentaire"}
+ all_ged={"1"}
/>
}
diff --git a/src/components/Student_Account_Ent.js b/src/components/Student_Account_Ent.js
index 839cc8f..23ec5b7 100644
--- a/src/components/Student_Account_Ent.js
+++ b/src/components/Student_Account_Ent.js
@@ -33,6 +33,7 @@ import Module_Ent_Mes_Formations from "./Module_Ent_Mes_Formations";
import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
import Module_Ent_Mes_Notes from "./Module_Ent_Mes_Notes";
+import Module_Ent_Internal_Email_Management from "./Module_Ent_Internal_Email_Management";
import { useParams } from 'react-router-dom'
@@ -69,7 +70,6 @@ function Student_Account_Ent() {
const location = useLocation();
useEffect(() => {
- var list_menu = ["affichage", "recherche", "upgradecompte", "profil_objectif", "mes_factures", "mes_documents"]
// getImage();
@@ -108,6 +108,8 @@ function Student_Account_Ent() {
Get_Ent_Message_Alert();
+ console.log(" ## setconnected_user_data = ", connected_user_data)
+
}, []);
@@ -210,7 +212,7 @@ function Student_Account_Ent() {
axios.post(myurl, form).then(res => {
// console.log(" In GetUserNameFromToken res.data.status = " + res.data.status);
- // console.log(" In GetUserNameFromToken res.data.message = " + res.data.message);
+ // console.log(" In GetUserNameFromToken res.data.message = " + res.data.message);
if (String(res.data.status) === String("true")) {
setusername(JSON.parse(res.data.message).email);
@@ -510,11 +512,14 @@ function Student_Account_Ent() {
}
+
+
{connected_user_data && connected_user_data.type &&
-
Espace numérique de travail 28/10/2025 }
+
Espace numérique de travail
+ }
{/*** Si on A DES MESSAGES d'ALERTE, alors, alors on AFFICHE la zonne */}
- {New_Get_Ent_Message_Alert_result && New_Get_Ent_Message_Alert_result.length > 0 &&
+ {connected_user_data && connected_user_data._id && New_Get_Ent_Message_Alert_result && New_Get_Ent_Message_Alert_result.length > 0 &&
{New_Get_Ent_Message_Alert_result && New_Get_Ent_Message_Alert_result.length > 0 &&
New_Get_Ent_Message_Alert_result.map((message) => (
@@ -544,7 +549,7 @@ function Student_Account_Ent() {
-
+
{String(menu) === String("apprenant_account_data") && }
@@ -570,13 +575,29 @@ function Student_Account_Ent() {
}
+
+ {String(menu) === String("mes_emails") &&
+
+
+
+
+ }
+
+
+
}
{/*** Si on A DES PASSSSS MESSAGES d'ALERTE, alors, alors on NNNNN'AFFICHE PASSSSSSSSSSSSla zonne */}
- {New_Get_Ent_Message_Alert_result.length <= 0 &&
+ {connected_user_data && connected_user_data._id && New_Get_Ent_Message_Alert_result.length <= 0 &&
@@ -605,6 +626,19 @@ function Student_Account_Ent() {
}
+ {String(menu) === String("mes_emails") &&
+
+
+
+
+ }
+
+
}
diff --git a/src/components/header_automatic_files/Header_ENT_Student.jsx b/src/components/header_automatic_files/Header_ENT_Student.jsx
index afdb220..6157209 100644
--- a/src/components/header_automatic_files/Header_ENT_Student.jsx
+++ b/src/components/header_automatic_files/Header_ENT_Student.jsx
@@ -14,6 +14,9 @@ import DialogTitle from '@mui/material/DialogTitle';
import Button from '@mui/material/Button';
import { useCookies } from "react-cookie";
+import axios from "axios";
+import Badge from '@mui/material/Badge';
+import { styled } from '@mui/material/styles';
import CancelPresentationIcon from '@mui/icons-material/CancelPresentation';
import { makeStyles } from "@material-ui/core/styles";
@@ -53,6 +56,30 @@ const useStyles = makeStyles((theme) => ({
},
}));
+const StyledBadge_mysy_color1 = styled(Badge)(({ }) => ({
+ '& .MuiBadge-badge': {
+ right: 0,
+ top: 0,
+ border: '2px solid #ffffff',
+ padding: '0 4px',
+ background: '#6a329f',
+ color: "#ffffff"
+ },
+}));
+
+
+const StyledBadge_mysy_red = styled(Badge)(({ }) => ({
+ '& .MuiBadge-badge': {
+ right: 0,
+ top: 0,
+ border: '2px solid ',
+ padding: '0 4px',
+ background: '#f44336',
+ color: "#ffffff",
+ },
+}));
+
+
const Header_ENT_Student = () => {
const history = useHistory();
const classes = useStyles();
@@ -68,10 +95,91 @@ const Header_ENT_Student = () => {
const [AccountMenu, setAccountMenu] = React.useState(null);
const [ProduitMenu, setproduitMenu] = React.useState(null);
+ const [nb_undread_mail, setnb_undread_mail] = React.useState("0");
+
+ const [Get_Nb_Unread_Emails_api, setGet_Nb_Unread_Emails_api] = useState();
+ const [Get_Nb_Unread_Emails_message, setGet_Nb_Unread_Emails_message] = useState();
+ const [Get_Nb_Unread_Emails_result, setGet_Nb_Unread_Emails_result] = useState([]);
+ function Get_Nb_Unread_Emails(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("token", stored_cookie);
+ form.append("related_collection_recid", stored_apprenant_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Nb_User_Internal_Mail_Not_Read/";
+
+ // setLoading(true);
+ axios.post(myurl, form).then(res => {
+ // setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_Nb_Unread_Emails res.data.status = " + res.data.status);
+ console.log(" In Get_Nb_Unread_Emails res.data.message r_class = " + res.data.message);
+ setGet_Nb_Unread_Emails_api("true");
+ setGet_Nb_Unread_Emails_result(res.data.message);
+ setnb_undread_mail(res.data.message)
+ }
+ else {
+ setGet_Nb_Unread_Emails_api("false");
+ setGet_Nb_Unread_Emails_message(res.data.message);
+ /* // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");*/
+ }
+
+ }).catch((error) => {
+ // setLoading(false);
+ console.warn('Not good man :( Get_Nb_Unread_Emails = ', error);
+ setGet_Nb_Unread_Emails_api("false");
+ alert("Impossible de récuperer la liste des emails");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [connected_user_data, setconnected_user_data] = useState();
+
+ function GetUserNameFromToken(event) {
+ const stored_cookie = getCookie('tokenmysych');
+ var form = new FormData();
+
+ form.append("token", stored_cookie);
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_user_account/";
+
+ axios.post(myurl, form).then(res => {
+ // console.log(" In GetUserNameFromToken res.data.status = " + res.data.status);
+ // console.log(" In GetUserNameFromToken res.data.message = " + res.data.message);
+ if (String(res.data.status) === String("true")) {
+
+ setconnected_user_data(JSON.parse(res.data.message));
+
+ }
+ else {
+ //console.log(" In GetUserNameFromToken res.data.status = " + res.data.status);
+ //console.log(" In GetUserNameFromToken res.data.message = " + res.data.message);
+ //setmyApiResponse("false");
+ //setmyApimyApiMessage("")
+ }
+
+
+ }).catch((error) => {
+ console.warn('In GetUserNameFromToken Not good man :( mysearchtext = ', error);
+ //setmyApiResponse("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
useEffect(() => {
var local_user_connect = 0;
var local_part_connect = 0;
+ GetUserNameFromToken();
+
+
if (typeof (stored_user) === "undefined" || String(stored_user) === '') {
setuserconnected("0");
local_user_connect = 0;
@@ -92,6 +200,11 @@ const Header_ENT_Student = () => {
//alert(" partner connected OK");
}
+ if (stored_apprenant_id && String(stored_apprenant_id).length > 5) {
+ Get_Nb_Unread_Emails();
+ }
+
+
}, []);
const handleAccountCreation = () => {
@@ -276,10 +389,20 @@ const Header_ENT_Student = () => {
Documents
-
Emails
+
Emails {
+ // monactivite_func();
+ }}>
+ {connected_user_data && connected_user_data.prenom &&
+
+ Bonjour {connected_user_data.prenom.charAt(0).toUpperCase() + connected_user_data.prenom.slice(1).toLocaleLowerCase()} {connected_user_data.nom.toUpperCase()}
+
+
}
+
+
diff --git a/src/pages/student_account_ent.js b/src/pages/student_account_ent.js
index 5e7fc92..82b369a 100644
--- a/src/pages/student_account_ent.js
+++ b/src/pages/student_account_ent.js
@@ -10,7 +10,7 @@ const student_account_ent = () => {
-
+
)
}
diff --git a/src/styles/components/_module_ent_mes_formations.scss b/src/styles/components/_module_ent_mes_formations.scss
index 31bada3..06045ac 100644
--- a/src/styles/components/_module_ent_mes_formations.scss
+++ b/src/styles/components/_module_ent_mes_formations.scss
@@ -2493,7 +2493,7 @@
font-family: 'Albert Sans';
font-style: normal;
font-weight: 700;
- font-size: 20px;
+ font-size: 18px;
line-height: 120%;
/* identical to box height, or 24px */
letter-spacing: 0.02em;