From 8f2763d93963ec360eda2cb6cdcc041e538ccbfb Mon Sep 17 00:00:00 2001 From: Cherif Date: Sun, 23 Nov 2025 21:14:28 +0100 Subject: [PATCH] 23/11/25 - 21h30 --- src/components/Account.js | 16 +- src/components/AddClassManual.js | 2 +- src/components/AddPartnerClient.js | 13 +- src/components/Apprenant.js | 17 +- src/components/Crm_Opportunite.js | 507 +- src/components/DisplayPartnerSession.js | 207 +- src/components/DisplayPartnerStagiaires.js | 17 +- .../DisplayPartnerTrainingsPagination.js | 4 +- src/components/Ent_Intranet.js | 2 +- src/components/Module_Editique.js | 18 +- src/components/Module_Ent_Mes_Notes.js | 53 +- src/components/Module_Ent_Message_Public.js | 423 + src/components/Modules_Mes_Documents.js | 411 +- .../PROD_FRONT_CODE/DisplayPartnerSession.js | 28412 ++++++++++++++++ .../Formation_Partner_Catalog.js | 721 - .../PROD_FRONT_CODE/New_C_Formation_2025.js | 483 - .../PROD_FRONT_CODE/Partner_Commande.js | 8783 ----- src/components/UpdatePartnerInfo.js | 17 +- src/styles/components/_addclassmanual.scss | 7 +- 19 files changed, 29586 insertions(+), 10527 deletions(-) create mode 100644 src/components/Module_Ent_Message_Public.js create mode 100644 src/components/PROD_FRONT_CODE/DisplayPartnerSession.js delete mode 100644 src/components/PROD_FRONT_CODE/Formation_Partner_Catalog.js delete mode 100644 src/components/PROD_FRONT_CODE/New_C_Formation_2025.js delete mode 100644 src/components/PROD_FRONT_CODE/Partner_Commande.js diff --git a/src/components/Account.js b/src/components/Account.js index 35ea1c0..ad983b1 100644 --- a/src/components/Account.js +++ b/src/components/Account.js @@ -22,7 +22,7 @@ import { useLocation } from "react-router-dom"; import { FaHandPointRight } from "react-icons/fa"; import Intranet_Factures_Client from "./Intranet_Factures_Client"; import Intranet_Tous_Documents from "./Intranet_Tous_Documents"; -import Modules_Mes_Documents from "./Modules_Mes_Documents_old"; +import Modules_Mes_Documents from "./Modules_Mes_Documents"; import Intranet_Mes_Stagiaires from "./Intranet_Mes_Stagiaires"; function Account() { @@ -109,7 +109,7 @@ function Account() { //console.log(" getImage: res.data.message.img = " + res.data.message); if (res.data.message.img.length > 0) { setisimage("True"); - } + } else { setisimage("False"); } @@ -442,7 +442,7 @@ function Account() { } {/** Menu pour un utilisateur NON type 'user' exemple un apprenant */} - {connected_user_data && connected_user_data.type && + {/*connected_user_data && connected_user_data.type && String(connected_user_data.type) !== "student" &&
INFORMATIONS PERSONNELLES
@@ -455,9 +455,8 @@ function Account() {
MES FACTURES

- {/*
SUPPRIMER MON COMPTE
-
*/} -
} + + */}
@@ -494,11 +493,6 @@ function Account() { filter_all_document={"0"} />} - {/*String(menu) === String("tout_documents") && connected_user_data && connected_user_data.partner_owner_recid && - connected_user_data.partner_client_id && - */} {String(menu) === String("modules_mes_documents") && connected_user_data && connected_user_data.partner_owner_recid && diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index 34c7ba3..40361ca 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -10579,7 +10579,7 @@ const AddClassManual = (props) => { } {String(selected_statistic_question_type) === "Moyenne" && -
} diff --git a/src/components/Crm_Opportunite.js b/src/components/Crm_Opportunite.js index a7a2251..f534c34 100644 --- a/src/components/Crm_Opportunite.js +++ b/src/components/Crm_Opportunite.js @@ -1,28 +1,24 @@ import React, { useRef, useState, useEffect } from "react"; import TextField from '@mui/material/TextField'; -import MenuItem from '@mui/material/MenuItem'; + import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css import Button from '@mui/material/Button'; import axios from "axios"; +import TextareaAutosize from '@mui/material/TextareaAutosize'; import { getCookie, setCookie } from 'react-use-cookie'; import { useHistory } from "react-router-dom"; -import CheckOut from "./CheckOut"; + import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; -import { Editor } from '@tinymce/tinymce-react'; -import parse from 'html-react-parser'; -import { FcViewDetails, FcDisapprove } from "react-icons/fc"; + import 'react-tooltip/dist/react-tooltip.css' import { Tooltip } from 'react-tooltip' -import add_plus from "../mysy_img/plus.png"; -import excel_icone from "../mysy_img/excel_icone.png"; -import participants from "../mysy_img/participants.png"; -import fileDownload from 'js-file-download' + import Autocomplete from '@mui/material/Autocomplete'; import Popup from 'reactjs-popup'; import 'reactjs-popup/dist/index.css'; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; -import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc"; + import fr from 'date-fns/locale/fr'; import { registerLocale } from 'react-datepicker'; import DatePicker from "react-datepicker"; @@ -32,8 +28,7 @@ import moment from "moment"; import InputAdornment from '@mui/material/InputAdornment'; import { AiFillCloseCircle } from "react-icons/ai"; import Box from '@mui/material/Box'; -import { Typography, LinearProgress } from '@mui/material'; -import styled from 'styled-components'; + import { CiTrash } from "react-icons/ci"; import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; import Dialog from '@mui/material/Dialog'; @@ -41,11 +36,9 @@ 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 { TransitionProps } from '@mui/material/transitions'; + import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; -import ToggleSwitch from "./ToggleSwitch"; -import ToggleSwitch_v2_mysy from "./ToggleSwitch_v2_mysy"; -import FileCopyIcon from '@mui/icons-material/FileCopy'; + import Link from '@mui/material/Link'; import { PiDotsThree } from "react-icons/pi"; @@ -101,7 +94,7 @@ const useStyles = makeStyles((theme) => ({ })); const CRM_Opportunite = (props) => { -registerLocale('fr', fr); + registerLocale('fr', fr); const classes_dialog = useStyles(); const history = useHistory(); @@ -1667,7 +1660,7 @@ registerLocale('fr', fr); > - MySy Information + MySy Information {Dialog_1_message} @@ -1711,7 +1704,7 @@ registerLocale('fr', fr); aria-labelledby="draggable-dialog-title" > - MySy Information + MySy Information {Dialog_1_message} @@ -1732,7 +1725,7 @@ registerLocale('fr', fr); }}> Devis } -
Titre
+
Titre
-
Description
- Description
+ { setp_detail_description(e.target.value); @@ -1767,7 +1764,7 @@ registerLocale('fr', fr); />
-
Client +
Client {New_Get_List_Partner_Clients_result && New_Get_List_Partner_Clients_result.length > 0 && Civilité +
- (data).value === String(p_detail_contact_civilite))[0].label} +
Civilité - onChange={(event, value) => { - if (value && value.value) { - setp_detail_contact_civilite(value.value); - setopport_changed("1"); + (data).value === String(p_detail_contact_civilite))[0].label} - } else { - setp_detail_contact_civilite(""); - setopport_changed("1"); + onChange={(event, value) => { + if (value && value.value) { + setp_detail_contact_civilite(value.value); + setopport_changed("1"); + } else { + setp_detail_contact_civilite(""); + setopport_changed("1"); + + } + }} + + renderInput={(params) => } - }} - - renderInput={(params) => - } - /> -
- } +
+
Nom Contact + Nom Contact - { - setp_detail_contact_nom(e.target.value); - setopport_changed("1"); - } - } - /> - -
- } - - {String(p_detail_partner_client_id).length < 2 && -
Email Contact - { - setp_detail_contact_email(e.target.value); - setopport_changed("1"); - } - } - /> - -
- } - - - - {String(p_detail_partner_client_id).length < 2 && -
Téléphone Contact - { - setp_detail_contact_telephone(e.target.value); - setopport_changed("1"); - } - } - /> - -
- } - - - -
Statut
- {New_Option_Status && New_Option_Status.length > 0 && - (data)._id === String(p_detail_statut_id))[0].label} - options={New_Option_Status} - onChange={(event, value) => { - if (value && value.value) { - setp_detail_statut(value.value); - setp_detail_statut_id(value._id); - setopport_changed("1"); - } else { - setp_detail_statut(""); - setp_detail_statut_id("") + value={p_detail_contact_nom} + onChange={(e) => { + setp_detail_contact_nom(e.target.value); setopport_changed("1"); } + } + /> + +
+
} + {String(p_detail_partner_client_id).length < 2 && + +
+ +
Email Contact + { + setp_detail_contact_email(e.target.value); + setopport_changed("1"); + } + } + /> + +
+ +
Téléphone Contact + { + setp_detail_contact_telephone(e.target.value); + setopport_changed("1"); + } + } + /> + +
+ +
} + +
+
Statut
+ {New_Option_Status && New_Option_Status.length > 0 && + (data)._id === String(p_detail_statut_id))[0].label} + options={New_Option_Status} + onChange={(event, value) => { + if (value && value.value) { + setp_detail_statut(value.value); + setp_detail_statut_id(value._id); + setopport_changed("1"); + } else { + setp_detail_statut(""); + setp_detail_statut_id("") + setopport_changed("1"); + } + + + }} + + renderInput={(params) => + } + />} + + + + +
+ + +
Probabilité de Gain
+ + {New_Option_Proba_Gain && (data).value === String(p_detail_probabilite_gain))[0].label} + onChange={(event, value) => { + if (value && value.value) { + setp_detail_probabilite_gain(value.value); + } else { + setp_detail_probabilite_gain(""); + } + setopport_changed("1"); }} - renderInput={(params) => } - +
+
+
Montant Gain (estimé) + Probabilité de Gain
+ name="dialog_opport_montant" + id="dialog_opport_montant" + type="number" + step="any" + className="disabled_style" - {New_Option_Proba_Gain && (data).value === String(p_detail_probabilite_gain))[0].label} - onChange={(event, value) => { - if (value && value.value) { - setp_detail_probabilite_gain(value.value); - } else { - setp_detail_probabilite_gain(""); + value={p_detail_revenu_cible} + onChange={(e) => { + setp_detail_revenu_cible(e.target.value); + setopport_changed("1"); } - setopport_changed("1"); - }} - renderInput={(params) => + +
+ + +
Priorité  
+ + +
+ +
+
+
Date Fermeture
+ { + setp_detail_date_fermeture(format(date, 'd/MM/yyyy')); + setopport_changed("1"); + + } + } + showTimeSelect={false} + dateFormat="dd/MM/yyyy" + className="disabled_style" + + locale={'fr'} /> - } - />} + +
+ +
Vendeur
+ {New_Getall_Training_Employee_No_Filter_result && New_Getall_Training_Employee_No_Filter_result.length > 0 && + (data)._id === p_detail_vendeur_id)[0].label || ""} -
+ onChange={(event, value) => { + if (value && value._id) { + setp_detail_vendeur_id(value._id); + setopport_changed("1"); + } else { + setp_detail_vendeur_id(""); + setopport_changed("1"); + } + }} + renderInput={(params) => Montant Gain (estimé) - { - setp_detail_revenu_cible(e.target.value); - setopport_changed("1"); - } - } - /> - -
- - - - - - -
Priorité  
- - - -
- - -
Date Fermeture
- { - setp_detail_date_fermeture(format(date, 'd/MM/yyyy')); - setopport_changed("1"); - - } - } - showTimeSelect={false} - dateFormat="dd/MM/yyyy" - className="disabled_style" - - locale={'fr'} - - /> - -
- -
Commentaire - { - setp_detail_commentaire(e.target.value); - setopport_changed("1"); - } - } - /> - -
- -
Vendeur
- - - {New_Getall_Training_Employee_No_Filter_result && New_Getall_Training_Employee_No_Filter_result.length > 0 && - (data)._id === p_detail_vendeur_id)[0].label || ""} - - - onChange={(event, value) => { - if (value && value._id) { - setp_detail_vendeur_id(value._id); - setopport_changed("1"); - } else { - setp_detail_vendeur_id(""); - setopport_changed("1"); + /> } - }} + />} - renderInput={(params) => - } - />} +
- @@ -2151,7 +2124,7 @@ registerLocale('fr', fr); {/* FIN Dialog pour gerer une OPPORTUNITE */} -

Mes Opportunités

+

Mes Opportunités

Utilisez les filtres !
diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 3feeacb..a120767 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -808,8 +808,10 @@ const DisplayPartnerSession = (props) => { field: 'comment_or_memo', headerName: 'Memo & Comment.', Width: 50, hide: false, editable: false, renderCell: (cellValues) => { return ( -
{ +
{ setp_detail_inscription_comment(cellValues.row.comment); setp_detail_inscription_memo(cellValues.row.memo); @@ -1377,9 +1379,10 @@ const DisplayPartnerSession = (props) => { field: 'comment_or_memo', headerName: 'Memo & Comment.', Width: 50, hide: false, editable: false, renderCell: (cellValues) => { return ( -
{ +
{ setp_detail_inscription_comment(cellValues.row.comment); setp_detail_inscription_memo(cellValues.row.memo); @@ -2289,7 +2292,7 @@ const DisplayPartnerSession = (props) => { var timeline_grp = []; const new_data = res.data.message.map((x) => { - + //--- var localid = JSON.parse(x).id; var local_id = JSON.parse(x)._id; @@ -12607,7 +12610,7 @@ const DisplayPartnerSession = (props) => { setLoading(false); console.warn('Not good man :( Get_Class_Default_Document_id = ', error); setGet_Class_Default_Document_id_api("false"); - // alert("Impossible de récupérer le document par défaut"); + // alert("Impossible de récupérer le document par défaut"); //setmyApimyApiMessage("") }) } @@ -12773,10 +12776,21 @@ const DisplayPartnerSession = (props) => { if (String(selected_convention_id).trim() === "") { - alert(" Vous devez choisir un document"); + + setdisplay_alert_mysy("1"); + setalert_message("Vous devez choisir un document."); + setalert_type("error"); return; } + var tab_my_inscription_ids = [] + for (var i = 0; i < selectionModel_insc.length; i++) { + + var local_id = parseInt(selectionModel_insc[i]); + var myid = JSON.parse(String(rowss_insc[local_id])); + tab_my_inscription_ids.push(myid['_id']); + } + form.append("class_internal_url", selected_internal_url); const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); @@ -12784,6 +12798,7 @@ const DisplayPartnerSession = (props) => { form.append("courrier_template_id", selected_convention_id); form.append("email_test", selected_convention_email_test); form.append("email_production", ""); + form.append("tab_ids", tab_my_inscription_ids); // pièce jointe form.append("file_business_object", ""); @@ -12795,14 +12810,17 @@ const DisplayPartnerSession = (props) => { } //form.append("File", list_files); - var myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Convention_From_Session_By_Email/"; + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Test_Prepare_and_Send_Convention_From_Session_By_Email/"; if (String(selected_convention_id) === "default_mail") { // Il s'agit d'envoyer les convention par defaut de type mail myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Default_Convention_From_Session_By_Email/"; } - + const response = window.confirm(" Email de test : Cette convention sera envoyée uniquement à " + String(selected_convention_email_test) + " . Continuer ?"); + if (!response) { + return; + } setLoading(true); fetch( myurl, @@ -12847,6 +12865,109 @@ const DisplayPartnerSession = (props) => { } + const [Send_Stagiaire_Convocation_By_Email_Test_api, setSend_Stagiaire_Convocation_By_Email_Test_api] = useState(); + const [Send_Stagiaire_Convocation_By_Email_Test_message, setSend_Stagiaire_Convocation_By_Email_Test_message] = useState(); + const [Send_Stagiaire_Convocation_By_Email_Test_result, setSend_Stagiaire_Convocation_By_Email_Test_result] = useState(); + function Send_Stagiaire_Convocation_By_Email_Test(event) { + + var form = new FormData(); + + + if (String(selected_convocation_id).trim() === "") { + setdisplay_alert_mysy("1"); + setalert_message("Vous devez choisir un document."); + setalert_type("error"); + return; + } + + var tab_my_inscription_ids = [] + for (var i = 0; i < selectionModel_insc.length; i++) { + + var local_id = parseInt(selectionModel_insc[i]); + var myid = JSON.parse(String(rowss_insc[local_id])); + tab_my_inscription_ids.push(myid['_id']); + } + + + form.append("class_internal_url", selected_internal_url); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("session_id", selected_session_id); + form.append("courrier_template_id", selected_convocation_id); + form.append("email_test", selected_convention_email_test); + form.append("email_production", ""); + form.append("tab_ids", tab_my_inscription_ids); + + + // pièce jointe + form.append("file_business_object", ""); + var list_files = new FormData(); + + for (let i = 0; i < tab_convention_pieces_jointes_result.length; i++) { + form.append('File', tab_convention_pieces_jointes_result[i]); + + } + //form.append("File", list_files); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Test_Prepare_and_Send_Convocation_From_Session_By_Email/"; + + if (String(selected_convention_id) === "default_mail") { + // Il s'agit d'envoyer les convention par defaut de type mail + myurl = process.env.REACT_APP_API_URL + "myclass/api/Prepare_and_Send_Default_Convocation_From_Session_By_Email/"; + } + + + + const response = window.confirm(" Email de test : Cette convocation sera envoyée uniquement à " + String(selected_convention_email_test) + " . Continuer ?"); + if (!response) { + return; + } + + + setLoading(true); + fetch( + myurl, + { + method: 'POST', + body: form, + } + ) + .then((response) => response.json()) + .then((result) => { + + // console.log(" In Send_Stagiaire_Convocation_By_Email_Test res.data.status = " + result['status']); + //console.log(" In Send_Stagiaire_Convocation_By_Email_Test res.data.message r_class = " + result['message']); + if (String(result['status']) === String("true")) { + setLoading(false); + setSend_Stagiaire_Convocation_By_Email_Test_api("true"); + setSend_Stagiaire_Convocation_By_Email_Test_result(result['message']); + + // alert(result['message']); + setdisplay_alert_mysy("1"); + setalert_message(result['message']); + setalert_type("success"); + Dialog_convention_handleClose_buton() + + } + else { + setLoading(false); + setSend_Stagiaire_Convocation_By_Email_Test_api("false"); + setSend_Stagiaire_Convocation_By_Email_Test_message(result['message']); + // alert(result['message']); + setdisplay_alert_mysy("1"); + setalert_message(result['message']); + setalert_type("error"); + } + + }).catch((error) => { + setLoading(false); + console.warn('Not good man :( Send_Stagiaire_Convocation_By_Email_Test = ', error); + setSend_Stagiaire_Convocation_By_Email_Test_api("false"); + alert("Impossible d'envoyer l'email de test "); + //setmyApimyApiMessage("") + }) + } + const [Get_Stagiaire_List_Email_Com_api, setGet_Stagiaire_List_Email_Com_api] = useState(); @@ -14839,7 +14960,6 @@ const DisplayPartnerSession = (props) => { form.append("tab_ids", tab_my_inscription_ids); - console.log(" ### form = ", form); // pièce jointe form.append("file_business_object", ""); @@ -17220,36 +17340,55 @@ const DisplayPartnerSession = (props) => {
} - {String(selected_convention_type) === "email" &&
Type Document
- - name="event_dialog_type_convention" - id="event_dialog_type_convention" + + + - value="email" + + name="event_dialog_email_test_convention" + id="event_dialog_email_test_convention" + + fullWidth + + value={selected_convention_email_test} + onChange={(e) => { + setselected_convention_email_test(e.target.value); + } + } + /> + - {String(selected_convention_type) === "email" && } -
} +
} {String(selected_convention_type) === "pdf" &&
Type Document
{
} - {String(selected_convention_type) === "email" &&
+ {/*String(selected_convention_type) === "email" && - } + */} @@ -20435,7 +20574,7 @@ const DisplayPartnerSession = (props) => { {/** Affichage Timeline */} {/*** Fin affichage timeline */} - + {(!display_session_with_alert || display_session_with_alert !== true) &&
@@ -28187,7 +28326,7 @@ const DisplayPartnerSession = (props) => { {String(submenu) === String("attestation") &&
+ related_collection_recid={selected_session_id} class_id={session_selected_class_id} />
} diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js index 6cee12c..eb09936 100644 --- a/src/components/DisplayPartnerStagiaires.js +++ b/src/components/DisplayPartnerStagiaires.js @@ -6909,7 +6909,7 @@ const DisplayPartnerStagiaires = (props) => { const New_Option_Filter = [ { "id": "email", "label": "Email ", "value": "email" }, { "id": "nom", "label": "Nom ", "value": "nom" }, - { "id": "code_session", "label": "Code Promo", "value": "code_session" }, + { "id": "code_session", "label": "Code Session/Promo", "value": "code_session" }, { "id": "class_title", "label": "Titre Formation", "value": "class_title" }, { "id": "client_nom", "label": "Lié au Client (nom client) ", "value": "client_nom" }, { "id": "archive", "label": "Archive", "value": "archive" }, @@ -7641,8 +7641,6 @@ const DisplayPartnerStagiaires = (props) => {
} - -
} @@ -12141,12 +12139,8 @@ const DisplayPartnerStagiaires = (props) => {
-
- Pièces jointes -
- - {String(props.check_user_acces_right("stagiaire", "write")) === "1" &&
+ {String(props.check_user_acces_right("stagiaire", "write")) === "1" &&
} - {Get_List_Of_All_PJ_result &&
+ {/*Get_List_Of_All_PJ_result &&
Liste des pièces jointes
@@ -12276,9 +12270,9 @@ const DisplayPartnerStagiaires = (props) => { ))}
-
} +
*/} + - ------------------
{ my_title={"Gestion Documentaire"} object_owner_collection={"inscription"} object_owner_id={selected_id} + authorize_deletion={"1"} />
diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index 9179def..f1756ee 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -2970,7 +2970,7 @@ const DistplayPartnerTraningsPage = (props) => {
-
+
FERMER
@@ -2989,7 +2989,7 @@ const DistplayPartnerTraningsPage = (props) => {
-
+
FERMER
diff --git a/src/components/Ent_Intranet.js b/src/components/Ent_Intranet.js index 23488a6..fe318f3 100644 --- a/src/components/Ent_Intranet.js +++ b/src/components/Ent_Intranet.js @@ -1,6 +1,6 @@ import React, { useRef, useState, useMemo, useEffect } from "react"; import { useForm } from "react-hook-form"; -import axios from "axios"; +import axios from "axios"; import { useHistory } from "react-router-dom"; import { getCookie, } from 'react-use-cookie'; import { useParams } from 'react-router-dom'; diff --git a/src/components/Module_Editique.js b/src/components/Module_Editique.js index f608e80..8a65c33 100644 --- a/src/components/Module_Editique.js +++ b/src/components/Module_Editique.js @@ -831,6 +831,20 @@ const Module_Editique = (props) => { new_data2.push(node); }); + var node2 = { + "_id": "", + "id": "", + "label": "", + "ref_interne": "", + "nom": "", + "sujet": "", + "type_doc": "", + "cible": "", + "joint_pdf": "", + + }; + new_data2.push(node2); + if (new_data2.length > 0) setNew_Get_List_Stagiaire_Convocations_result(new_data2); @@ -2422,7 +2436,7 @@ const Module_Editique = (props) => {
- + {(String(selected_convention_type) === "email" || String(selected_convention_type) === "pdf") && New_Get_List_Stagiaire_Convocations_result.length > 0 &&
Choisir une convocation @@ -2437,7 +2451,7 @@ const Module_Editique = (props) => { onChange={(event, value) => { if (value && value._id) { - setselected_convocation_id(value._id); + setselected_convocation_id(value._id); if (String(value._id) === "default_mail") { setselected_convention_type("email"); diff --git a/src/components/Module_Ent_Mes_Notes.js b/src/components/Module_Ent_Mes_Notes.js index df81fd7..80d89cd 100644 --- a/src/components/Module_Ent_Mes_Notes.js +++ b/src/components/Module_Ent_Mes_Notes.js @@ -1,6 +1,6 @@ import React, { useRef, useState, useEffect } from "react"; import TextField from '@mui/material/TextField'; -import MenuItem from '@mui/material/MenuItem'; + import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css import Button from '@mui/material/Button'; import axios from "axios"; @@ -8,70 +8,35 @@ import { getCookie, setCookie } from 'react-use-cookie'; import { useHistory } from "react-router-dom"; import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; -import { Editor } from '@tinymce/tinymce-react'; -import { FcViewDetails, FcDisapprove } from "react-icons/fc"; -import 'react-tooltip/dist/react-tooltip.css' -import { Tooltip } from 'react-tooltip' -import Checkbox from '@mui/material/Checkbox'; -import excel_icone from "../mysy_img/excel_icone.png"; -import fileDownload from 'js-file-download' -import { FcInfo } from "react-icons/fc"; -import Popup from 'reactjs-popup'; +import 'react-tooltip/dist/react-tooltip.css' + import 'reactjs-popup/dist/index.css'; -import { FcAcceptDatabase, } from "react-icons/fc"; -import { format } from 'date-fns' -import InputAdornment from '@mui/material/InputAdornment'; -import { AiFillCloseCircle, AiOutlineConsoleSql } from "react-icons/ai"; + import Box from '@mui/material/Box'; -import { CiTrash } from "react-icons/ci"; -import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; -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 { Fab } from "@material-ui/core"; -import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io"; -import { AiTwotoneSave } from "react-icons/ai"; -import { FcEditImage } from "react-icons/fc"; -import ToggleSwitch from "./ToggleSwitch"; -import { FcSpeaker } from "react-icons/fc"; + import Autocomplete from '@mui/material/Autocomplete'; -import { FcOpenedFolder } from "react-icons/fc"; -import Module_Absence from "./Module_Absence"; -import { RiMoreFill } from "react-icons/ri"; + import fr from 'date-fns/locale/fr'; import { registerLocale } from 'react-datepicker'; -import DatePicker from "react-datepicker"; + import "react-datepicker/dist/react-datepicker.css"; import moment from "moment"; import 'moment/locale/fr'; -import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; -import { gridClasses } from '@mui/x-data-grid'; + import Link from '@mui/material/Link'; import { PiDotsThree } from "react-icons/pi"; -import { - GridToolbarContainer, GridToolbarExport, GridToolbarColumnsButton, - GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExportContainer, useGridApiContext, - gridFilteredSortedRowIdsSelector, - gridVisibleColumnFieldsSelector, - GridValueGetterParams, - GridPreferencePanelsValue, - -} from '@mui/x-data-grid'; -import * as XLSX from 'xlsx'; import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; -import CancelPresentationIcon from '@mui/icons-material/CancelPresentation'; import { makeStyles } from "@material-ui/core/styles"; import Paper from '@material-ui/core/Paper'; import Draggable from 'react-draggable'; -import { IconButton } from '@material-ui/core'; + function PaperComponent(props) { return ( diff --git a/src/components/Module_Ent_Message_Public.js b/src/components/Module_Ent_Message_Public.js new file mode 100644 index 0000000..355b952 --- /dev/null +++ b/src/components/Module_Ent_Message_Public.js @@ -0,0 +1,423 @@ +import React, { useRef, useState, useEffect } from "react"; +import TextField from '@mui/material/TextField'; +import fileDownload from 'js-file-download'; +import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css +import Button from '@mui/material/Button'; +import axios from "axios"; +import { getCookie, setCookie } from 'react-use-cookie'; +import { useHistory } from "react-router-dom"; +import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; +import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; +import 'react-tooltip/dist/react-tooltip.css' +import 'reactjs-popup/dist/index.css'; +import "react-datepicker/dist/react-datepicker.css"; +import 'moment/locale/fr'; +import Box from '@mui/material/Box'; +import { Tooltip } from 'react-tooltip' +import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; +import TextareaAutosize from '@mui/material/TextareaAutosize'; +import Autocomplete from '@mui/material/Autocomplete'; +import { FcOpenedFolder } from "react-icons/fc"; +import { gridClasses } from '@mui/x-data-grid'; +import Link from '@mui/material/Link'; +import { PiDotsThree } from "react-icons/pi"; +import { makeStyles } from "@material-ui/core/styles"; +import Paper from '@material-ui/core/Paper'; +import Draggable from 'react-draggable'; +import InputAdornment from '@mui/material/InputAdornment'; +import { AiFillCloseCircle } from "react-icons/ai"; +import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; +import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; +import Dialog from '@mui/material/Dialog'; +import DialogActions from '@mui/material/DialogActions'; +import DialogContent from '@mui/material/DialogContent'; +import DialogTitle from '@mui/material/DialogTitle'; +import DialogContentText from '@mui/material/DialogContentText'; +import CancelPresentationIcon from '@mui/icons-material/CancelPresentation'; +import { IconButton } from '@material-ui/core'; +import MoreVertIcon from '@mui/icons-material/MoreVert'; +import Menu from '@mui/material/Menu'; +import MenuItem from '@mui/material/MenuItem'; +import { + GridToolbarContainer, GridToolbarExport, GridToolbarColumnsButton, + GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExportContainer, useGridApiContext, + gridFilteredSortedRowIdsSelector, + gridVisibleColumnFieldsSelector, + GridValueGetterParams, + GridPreferencePanelsValue, + +} from '@mui/x-data-grid'; +import * as XLSX from 'xlsx'; +import { FcInfo } from "react-icons/fc"; + + +import { FcAcceptDatabase, FcPlanner } from "react-icons/fc"; + +function PaperComponent(props) { + return ( + + + + ); +} + + +const useStyles = makeStyles((theme) => ({ + + dialog: { + position: 'absolute', + // left: 10, + top: 400 + }, + + paper: { + overflowY: 'unset', + }, + customizedButton: { + position: 'absolute', + left: '98%', + top: '-3%', + backgroundColor: 'lightgray', + color: 'gray', + }, +})); + +const Module_Ent_Message_Public = (props) => { + const classes = useStyles(); + const history = useHistory(); + + const [isLoading, setLoading] = useState(); + + function ExpandableCell_50({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + + function ExpandableCell_50_bg_hiligt({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + + function ExpandableCell_50_bg_hiligt_red_color({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + + + function Display_Colunm_text({ value }) { + + return ( +
+ {value}  + +
+ ); + } + + + const columns_ent_message = [ + { field: '_id', headerName: '_id', hide: true, editable: false, Width: 0 }, + { field: 'id', headerName: 'id', hide: true, Width: 0 }, + + { field: 'code', headerName: 'code', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'priorite', headerName: 'priorite', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'message', headerName: 'message', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'date_debut', headerName: 'date_debut', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'date_fin', headerName: 'date_fin', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + + ] + + const [Get_All_Ent_Message_Public_api, setGet_All_Ent_Message_Public_api] = useState(); + const [Get_All_Ent_Message_Public_message, setGet_All_Ent_Message_Public_message] = useState(); + const [Get_All_Ent_Message_Public_result, setGet_All_Ent_Message_Public_result] = useState([]); + function Get_All_Ent_Message_Public() { + + 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_Ent_Alert_Message/"; + + axios.post(myurl, form).then(res => { + // console.log(" In Get_All_Ent_Message_Public res.data.status = " + res.data.status); + //console.log(" In Get_All_Ent_Message_Public res.data.message r_class = " + res.data.message); + + if (String(res.data.status) === String("true")) { + + setGet_All_Ent_Message_Public_api("true"); + setGet_All_Ent_Message_Public_result(res.data.message); + } + else { + setGet_All_Ent_Message_Public_api("false"); + setGet_All_Ent_Message_Public_message(res.data.message); + } + + }).catch((error) => { + console.warn('Not good man :( Get_All_Ent_Message_Public = ', error); + setGet_All_Ent_Message_Public_api("false"); + //setmyApimyApiMessage("") + }) + } + + + const [selectionModel_ent_lessage, setselectionModel_ent_lessage] = React.useState([]); + + useEffect(() => { + Get_All_Ent_Message_Public(); + + }, []) + + + + const [display_alert_mysy, setdisplay_alert_mysy] = useState(""); + const [alert_message, setalert_message] = useState(""); + const [alert_type, setalert_type] = useState(""); + + function clear_alert_message() { + setalert_message(""); + } + function clear_alert_type() { + setalert_type(""); + } + function clear_display_alert_mysy() { + setdisplay_alert_mysy(""); + } + + return ( +
+ + {isLoading &&
+
+
} + + {/*** Affichage des messages d'alerte*/} + {display_alert_mysy && String(display_alert_mysy) === "1" && + + } + {/*** FIN Affichage des messages d'alerte*/} + + +
+
+ + {Get_All_Notes_Of_Evaluations_result && Get_All_Notes_Of_Evaluations_result.length > 0 &&
+   + + { + setselectionModel_ent_lessage(newSelectionModel); + /*if (newSelectionModel.length === 1) + handleClick_edit_session_From_Line(newSelectionModel);*/ + if (newSelectionModel.length !== 1) { + + } + }} + selectionModel={selectionModel_ent_lessage} + + localeText={frFR.components.MuiDataGrid.defaultProps.localeText} + rows={Get_All_Ent_Message_Public_result.map((item, index) => ( + { + id: index, + _id: JSON.parse(item)._id, + code: JSON.parse(item).code, + priorite: JSON.parse(item).priorite, + message: JSON.parse(item).message, + date_debut: JSON.parse(item).date_debut, + date_fin: JSON.parse(item).date_fin, + + } + ))} + + columns={columns_ent_message} + pageSize={10} + className="datagridclass" + + onRowDoubleClick={(newSelectionModel) => { + + }} + + rowsPerPageOptions={[10]} + disableSelectionOnClick + components={{ + Toolbar: GridToolbar, + }} + //sx={datagridSx} + getCellClassName={(params) => { + //field === 'distantiel' + if (params.field === 'distantiel' && String(params.value) === "1") { + return 'cell--distantiel'; + } + if (params.field === "presentiel" && String(params.value) == "1") { + return 'cell--presentiel'; + } + + + //field === "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'; + } + + }} + getEstimatedRowHeight={() => 200} + getRowHeight={() => "auto"} + + /> + +
+ +
} + + +
+ +
+ + + +
+ ); +} + +export default Module_Ent_Message_Public; diff --git a/src/components/Modules_Mes_Documents.js b/src/components/Modules_Mes_Documents.js index c76ebc4..3c0374f 100644 --- a/src/components/Modules_Mes_Documents.js +++ b/src/components/Modules_Mes_Documents.js @@ -13,6 +13,9 @@ import { DataGrid, frFR, GridToolbar, } from '@mui/x-data-grid'; +import { FcCancel } from "react-icons/fc"; +import Popup from 'reactjs-popup'; +import 'reactjs-popup/dist/index.css'; import { useCookies } from "react-cookie"; import { DataGridPro } from '@mui/x-data-grid-pro'; import * as XLSX from 'xlsx'; @@ -54,7 +57,7 @@ import AttachFileIcon from '@mui/icons-material/AttachFile'; import { IconButton } from '@material-ui/core'; import MoreVertIcon from '@mui/icons-material/MoreVert'; import Menu from '@mui/material/Menu'; - +import { CiTrash } from "react-icons/ci"; import Document_Affichage_Grid from "./Document_Affichage_Grid"; import Dialog from '@mui/material/Dialog'; import DialogActions from '@mui/material/DialogActions'; @@ -97,7 +100,7 @@ const useStyles = makeStyles((theme) => ({ backgroundColor: 'lightgray', color: 'gray', }, -})); +})); const Modules_Mes_Documents = (props) => { @@ -248,92 +251,163 @@ const Modules_Mes_Documents = (props) => { }, - - { - field: 'bton_vertif', headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center", - renderCell: (cellValues,) => { + field: 'Supprimer', headerName: 'Supprimer', minWidth: 50, flex: 1, maxWidth: 100, hide: false, editable: false, + renderCell: (cellValues) => { return ( + <> + {props && props.authorize_deletion && props.authorize_deletion === "1" && + - - - { - handleClick_option_button_vertical(e); - - setprint_doc_id(cellValues.row._id); - setprint_file_extention(cellValues.row.file_extention); - setprint_file_business_object(cellValues.row.file_business_object); - - }} - > - - - { - - }} - - slotProps={{ - paper: { - style: { - maxHeight: ITEM_HEIGHT * 4.5, - width: '20ch', - boxShadow: "-3px 4px 0px -30px #000000", - borderRadius: '0px !important', - lineHeight: '3rem' - }, - }, - }} - > - {options_menu_vertical.map((option) => ( - { - - if (option && String(option) === "Télécharger") { - setselected_id(cellValues.row._id); - print_document_pdf(print_doc_id, print_file_extention, print_file_business_object); - } - - if (option && String(option) === "Visualiser") { - setselected_id(cellValues.row._id); - - - preview_document_pdf(print_doc_id, print_file_extention, print_file_business_object); - setselected_doc_name(print_file_business_object); - setDialog_Preview_Doc_open(true); - - } - - setAnchorEl(null); - + onClick={(event) => { + // handleClick_delete(event, cellValues); }} > - {option} - - ))} - - + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + En confirmant cette opération, le document sera définitivement supprimé.
+ + +
+
+
+ + +
+
+ +
+
+
+ )} +
} + + {props.authorize_deletion !== "1" && } + + ); - }, + } + }, + + + /* + { + field: 'bton_vertif', headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center", + renderCell: (cellValues,) => { + return ( + + + + ); + }, + },*/ ] @@ -419,6 +493,7 @@ const Modules_Mes_Documents = (props) => { if (props.partner_client_id && props.type_document && autorized_type_document.includes(String(props.type_document)) && props.partner_owner_recid === "") { + setmyprops_type_document(props.type_document); setp_filtre1("filter_type_document"); setp_filtre1_value(props.type_document); @@ -438,8 +513,6 @@ const Modules_Mes_Documents = (props) => { Get_List_Of_All_PJ(); } - - }, []) const [display_detail_invoice, setdisplay_detail_invoice] = React.useState(); @@ -593,7 +666,7 @@ const Modules_Mes_Documents = (props) => { - const New_Option_Filter = [ + var New_Option_Filter = [ { "id": "filter_file_business_object", "label": "Nom Document", "value": "filter_file_business_object" }, { "id": "filter_type_document", "label": "Type Document", "value": "filter_type_document" }, { "id": "filter_nom_client", "label": "Nom Client", "value": "filter_nom_client" }, @@ -605,6 +678,31 @@ const Modules_Mes_Documents = (props) => { { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. ] + if (props && props.object_owner_collection && props.object_owner_collection === "inscription") { + New_Option_Filter = [ + { "id": "filter_file_business_object", "label": "Nom Document", "value": "filter_file_business_object" }, + { "id": "filter_type_document", "label": "Type Document", "value": "filter_type_document" }, + { "id": "filter_nom_client", "label": "Nom Client", "value": "filter_nom_client" }, + { "id": "date_creation", "label": "Date Création (jj/mm/aaaa) ", "value": "date_creation" }, + { "id": "filter_formation_external_code", "label": "Lié a la Formation (code externe)", "value": "filter_formation_external_code" }, + { "id": "filter_session_code", "label": "Lié a la session (code session)", "value": "filter_session_code" }, + { "id": "", "label": "", "value": "" }, + { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. + ] + } + else if (props && props.object_owner_collection && props.object_owner_collection === "partner_client") { + New_Option_Filter = [ + { "id": "filter_file_business_object", "label": "Nom Document", "value": "filter_file_business_object" }, + { "id": "filter_type_document", "label": "Type Document", "value": "filter_type_document" }, + { "id": "filter_nom_prenom_mail_inscrit", "label": "Nom/Prénom/Email inscrit", "value": "filter_nom_prenom_mail_inscrit" }, + { "id": "date_creation", "label": "Date Création (jj/mm/aaaa) ", "value": "date_creation" }, + { "id": "filter_formation_external_code", "label": "Lié a la Formation (code externe)", "value": "filter_formation_external_code" }, + { "id": "filter_session_code", "label": "Lié a la session (code session)", "value": "filter_session_code" }, + { "id": "", "label": "", "value": "" }, + { "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres. + ] + } + @@ -1086,6 +1184,83 @@ const Modules_Mes_Documents = (props) => { const [document_display_view, setdocument_display_view] = useState("list"); const [cookie_document_display_view, setcookie_document_display_view, removecookie_document_display_view] = useCookies(['mysy_document_display_view,']); + const [Delete_List_document_api, setDelete_List_document_api] = useState(); + const [Delete_List_document_result, setDelete_List_document_result] = useState(); + const [Delete_List_document_message, setDelete_List_document_message] = useState(); + const Delete_List_document = (local_tab_ids) => { + const stored_cookie = getCookie('tokenmysypart'); + + var formData = new FormData(); + + + formData.append("token", stored_cookie); + formData.append("tab_ids", local_tab_ids); + + + fetch( + process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File_from_Ids/", + { + method: 'POST', + body: formData, + } + ) + .then((response) => response.json()) + .then((result) => { + + //console.log(" ## result['status'] = ", result['status']) + if (String(result['status']) === String("true")) { + //console.log('Success:', result['message']); + setDelete_List_document_result(result['message']); + setDelete_List_document_api("true"); + if (props.partner_client_id && props.type_document && autorized_type_document.includes(String(props.type_document)) && + props.partner_owner_recid === "") { + setmyprops_type_document(props.type_document); + setp_filtre1("filter_type_document"); + setp_filtre1_value(props.type_document); + Get_All_Documents_With_Filter(); + + + } else if (props.partner_client_id && props.type_document && String(props.type_document) === "all" && + props.partner_owner_recid === "") { + + Get_All_Documents_With_Filter(); + } + + else if (props.partner_owner_recid && props.partner_client_id === "") { + + Get_All_Documents_With_Filter(); + } + + else { + + Get_List_Of_All_PJ(); + } + + setdisplay_alert_mysy("1"); + setalert_message(result['message']); + setalert_type("success"); + + } + else { + setDelete_List_document_message(result['message']); + setDelete_List_document_api("false"); + setdisplay_alert_mysy("1"); + setalert_message(result['message']); + setalert_type("error"); + } + + }) + .catch((error) => { + console.error(' Record_All_PJ Error:', error); + setDelete_List_document_api("false"); + alert(" Impossible de supprimer le document") + + }); + + + } + + return (
@@ -1171,7 +1346,7 @@ const Modules_Mes_Documents = (props) => { {props.all_ged && props.my_title &&

{props.my_title}

} {props.all_ged && !props.my_title &&

Tous vos documents

} - +
Utilisez les filtres !
@@ -1936,75 +2111,7 @@ const Modules_Mes_Documents = (props) => {
 
- {/*
- {Get_List_Of_All_PJ_result &&
-
- Liste des pièces jointes
-
- {Get_List_Of_All_PJ_result && Get_List_Of_All_PJ_result.map((val) => ( -
- - - Supprimer - - - } - modal - nested - position="center center" - > - {close => ( -
- -
MySy Information
-
- {' '} - - En confirmant cette opération, la pièce jointe sera définitivement supprimée.
- - -
-
-
- - -
-
- -
-
-
- )} -
- -
- ))} -
-
-
} -
*/}
 
diff --git a/src/components/PROD_FRONT_CODE/DisplayPartnerSession.js b/src/components/PROD_FRONT_CODE/DisplayPartnerSession.js new file mode 100644 index 0000000..f81d434 --- /dev/null +++ b/src/components/PROD_FRONT_CODE/DisplayPartnerSession.js @@ -0,0 +1,28412 @@ +import React, { useRef, useState, useEffect } from "react"; +import TextField from '@mui/material/TextField'; +import MenuItem from '@mui/material/MenuItem'; +import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css +import Button from '@mui/material/Button'; +import axios from "axios"; +import { getCookie, setCookie } from 'react-use-cookie'; +import { useHistory } from "react-router-dom"; +import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; +import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; +import { Editor } from '@tinymce/tinymce-react'; +import { FcViewDetails, FcDisapprove, FcInfo, FcExpired, FcTimeline } from "react-icons/fc"; +import 'react-tooltip/dist/react-tooltip.css' +import { Tooltip } from 'react-tooltip' +import TextareaAutosize from '@mui/material/TextareaAutosize'; +import excel_icone from "../mysy_img/excel_icone.png"; +import participants from "../mysy_img/participants.png"; +import fileDownload from 'js-file-download'; +import Popup from 'reactjs-popup'; +import 'reactjs-popup/dist/index.css'; +import { FcSearch } from "react-icons/fc"; +import { FcAlarmClock, FcMultipleSmartphones, FcWorkflow, FcComments } from "react-icons/fc"; + +import fr from 'date-fns/locale/fr'; +import { registerLocale } from 'react-datepicker'; +import DatePicker from "react-datepicker"; + +import "react-datepicker/dist/react-datepicker.css"; +import { format } from 'date-fns' +import moment from "moment"; +import 'moment/locale/fr'; +import { useCookies } from "react-cookie"; +import InputAdornment from '@mui/material/InputAdornment'; +import { AiFillCloseCircle } from "react-icons/ai"; +import Box from '@mui/material/Box'; +import { Typography, LinearProgress } from '@mui/material'; +import styled from 'styled-components'; +import { CiTrash } from "react-icons/ci"; +import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; +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 { Fab } from "@material-ui/core"; +import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io"; +import { AiTwotoneSave } from "react-icons/ai"; +import ToggleSwitch from "./ToggleSwitch"; +import Module_Historique_Action from "./Module_Historique_Action"; +import Module_Session_Notes_Classement from "./Module_Session_Notes_Classement"; + +import Autocomplete from '@mui/material/Autocomplete'; +import { FcOpenedFolder } from "react-icons/fc"; +import { gridClasses } from '@mui/x-data-grid'; +import Link from '@mui/material/Link'; +import { PiDotsThree } from "react-icons/pi"; +import Module_Editique from "./Module_Editique"; +import Module_Attestation_Formation from "./Module_Attestation_Formation"; +import Module_Evaluation_Positionnement from "./Module_Evaluation_Positionnement"; +import { IoAddCircleOutline } from "react-icons/io5"; +import { FcApproval, FcAcceptDatabase, FcPrint, FcPlanner } from "react-icons/fc"; +import { CiBoxList } from "react-icons/ci"; +import FullCalendar from "@fullcalendar/react"; +import daygridPlugin from "@fullcalendar/daygrid"; +import interactionPlugin from "@fullcalendar/interaction"; +import timeGridPlugin from "@fullcalendar/timegrid"; + +import Radio from '@mui/material/Radio'; +import RadioGroup from '@mui/material/RadioGroup'; +import FormControlLabel from '@mui/material/FormControlLabel'; +import FormControl from '@mui/material/FormControl'; +import FormLabel from '@mui/material/FormLabel'; +import { FaUserPen } from "react-icons/fa6"; +import allLocales from '@fullcalendar/core/locales-all'; + +import Module_Session_Planification from "./Module_Session_Planification"; +import Module_Session_Evaluation from "./Module_Session_Evaluation"; + +import AccountTreeIcon from '@mui/icons-material/AccountTree'; +import FormGroup from '@mui/material/FormGroup'; + +import Checkbox from '@mui/material/Checkbox'; + +import { + GridToolbarContainer, GridToolbarExport, GridToolbarColumnsButton, + GridToolbarFilterButton, GridToolbarDensitySelector, GridToolbarExportContainer, useGridApiContext, + gridFilteredSortedRowIdsSelector, + gridVisibleColumnFieldsSelector, + +} from '@mui/x-data-grid'; +import * as XLSX from 'xlsx'; + +import { makeStyles } from "@material-ui/core/styles"; +import Paper from '@material-ui/core/Paper'; +import Draggable from 'react-draggable'; +import { IconButton } from '@material-ui/core'; +import CancelPresentationIcon from '@mui/icons-material/CancelPresentation'; + +import { DataGridPro } from '@mui/x-data-grid-pro'; + +import { useCallback, } from "react"; +import { DndProvider, useDrag } from "react-dnd"; +import { useDrop } from 'react-dnd' + +import { HTML5Backend } from "react-dnd-html5-backend"; +import update from "immutability-helper"; +import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; +import MoreVertIcon from '@mui/icons-material/MoreVert'; +import Menu from '@mui/material/Menu'; +import 'moment/locale/fr'; +import Timeline, { + TimelineHeaders, + SidebarHeader, + DateHeader, + TimelineMarkers, + CustomMarker, + TodayMarker, + CursorMarker +} from 'react-calendar-timeline'; + +import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos'; +import ArrowBackIosNewIcon from '@mui/icons-material/ArrowBackIosNew'; + +import randomColor from "randomcolor"; +import 'moment/locale/he' + +function PaperComponent(props) { + return ( + + + + ); +} + + +const useStyles = makeStyles((theme) => ({ + + dialog: { + position: 'absolute', + // left: 10, + top: 400 + }, + + paper: { + overflowY: 'unset', + }, + customizedButton: { + position: 'absolute', + left: '98%', + top: '-3%', + backgroundColor: 'lightgray', + color: 'gray', + }, +})); + + + + +const DisplayPartnerSession = (props) => { + registerLocale('fr', fr); + const stored_cookie_session_display_view = getCookie('mysy_session_display_view'); + const stored_cookie_session_data_row_grouped_by = getCookie('mysy_session_data_row_grouped_by'); + + const classes = useStyles(); + + const history = useHistory(); + const [submenu, setsubmenu] = useState(""); + const [rowss, setRows] = useState([]); + + const [actionmass_preinsc_val, setactionmass_preinsc_val] = useState(); + const [one_SessionstartDateInscription, setone_SessionstartDateInscription] = useState(); + const [one_SessionendDateInscription, setone_SessionendDateInscription] = useState(); + const [one_SessionendDate, setone_SessionendDate] = useState(); + const [one_SessionstartDate, setone_SessionstartDate] = useState(); + const [one_urlpreview_certif, setone_urlpreview_certif] = useState(); + const [one_field_contenu_ftion, setone_field_contenu_ftion] = useState(""); + + const filters = [ + { value: 'code_session', label: 'Code Session' }, + { value: 'class_title', label: 'Titre Formation' }, + { value: 'certif', label: 'Certification' } + ] + + const [selectedfilt1, setselectedfilt1] = useState(""); + const [selectedfilt2, setselectedfilt2] = useState(""); + const [selectedfilt3, setselectedfilt3] = useState(""); + const [reftrainingtoupdate, setreftrainingtoupdate] = useState(); + const [externalcodetraining_toupdate, setexternalcodetraining_toupdate] = useState(); + + + const [is_recherche, setis_recherche] = useState("0"); + + + const [selectedtraining, setselectedtraining] = useState([]) + + const BorderLinearProgress = styled(LinearProgress)(() => ({ + height: "20px", + width: "60px", + borderRadius: "2px", + backgroundColor: " #ebf5fb", + "& .MuiLinearProgress-bar": { + backgroundColor: "#1bd900", + transition: "none", + transformOrigin: "left", + }, + })); + + function ExpandableCell_50({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + + + + function Display_Colunm_text({ value }) { + + return ( +
+ {value}  + +
+ ); + } + + + const [datagrid_columns_size_model1, setdatagrid_columns_size_model1] = useState(200); + const [datagrid_columns_size_model2, setdatagrid_columns_size_model2] = useState(100); + + + const ITEM_HEIGHT_PROMO = 48; + const ITEM_HEIGHT = 48; + + + const [anchorEl_promo, setanchorEl_promo] = React.useState(null); + const [anchorEl, setAnchorEl] = React.useState(null); + + const open_promo = Boolean(anchorEl_promo); + const open = Boolean(anchorEl); + + const options_menu_vertical_promotion = [ + 'Décaler', + 'Archiver/Désarch.', + 'Supprimer', + ]; + + const options_menu_vertical = [ + 'Renvoyer Conf.', + 'Annuler Insc.', + ]; + + + + const handleClick_option_button_vertical_promo = (event) => { + setanchorEl_promo(event.currentTarget); + }; + const handleClick_option_button_vertical = (event) => { + setAnchorEl(event.currentTarget); + }; + + + const handleClose_option_button_vertical_promo = (event, value) => { + setanchorEl_promo(null); + }; + const handleClose_option_button_vertical = (event, value) => { + setAnchorEl(null); + }; + + + + const columns = [ + { field: 'id', headerName: 'id', hide: true, disableExport: true, }, + { field: '_id', headerName: '_id', hide: true, disableExport: true, }, + { field: 'class_id', headerName: 'class_id', hide: true, disableExport: true, }, + { field: 'class_lms_class_code', headerName: 'class_lms_class_code', hide: true, disableExport: true, }, + { field: 'is_bpf', headerName: 'is_bpf', hide: true, }, + + { field: 'session_alert_message', headerName: 'session_alert_message', hide: true, disableExport: true, }, + { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, disableExport: true, }, + + { + field: 'is_session_alert', headerName: '', hide: false, Width: 50, flex: 1, disableExport: true, + renderCell: (cellValues) => { + return ( +
+ {cellValues.row.is_session_alert && String(cellValues.row.is_session_alert) === "1" && } + {cellValues.row.is_session_alert && String(cellValues.row.is_session_alert) !== "1" && ""} + +
+ + ); + } + + }, + + { field: 'code_session', headerName: 'Code Session', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, + { field: 'session_title', headerName: 'Titre', hide: false, flex: 1, minWidth: 250, renderCell: (params) => , }, + + { + field: 'statut', headerName: 'Statut', hide: true, width: datagrid_columns_size_model2, + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.statut) === "1" && "Actif"}  + {String(cellValues.row.statut) !== "1" && "Inactif"}  +
+ + ); + }, + + }, + + { + field: 'etape', headerName: 'Etape', hide: false, width: datagrid_columns_size_model2, renderCell: (params) => , + + }, + + { + field: 'archive', headerName: 'Archivé', hide: true, Width: 50, editable: false, renderCell: (cellValues) => { + return ( +
+ {String(cellValues.row.archive) === "1" && "Oui"}  + {String(cellValues.row.archive) !== "1" && "Non"}  + +
+ + ); + }, + }, + + + + { field: 'class_external_code', headerName: 'Code Formation', align: "center", hideable: true, flex: 1, hide: true, minWidth: 150, renderCell: (params) => , }, + { field: 'date_debut', headerName: 'Debut', hide: false, minWidth: 150, renderCell: (params) => , }, + { field: 'date_fin', headerName: 'Fin', minWidth: 150, renderCell: (params) => , }, + + { + field: 'mode_animation', headerName: 'Mode', width: datagrid_columns_size_model2, + renderCell: (cellValues) => { + return ( + +
+ {String(cellValues.row.mode_animation) === "0" && "Prés."}  + {String(cellValues.row.mode_animation) === "1" && "Dist."}  + {String(cellValues.row.mode_animation) === "2" && "Hybr."}  + +
+ + ); + }, + }, + + + { field: 'formateur', headerName: 'Formateur', minWidth: datagrid_columns_size_model1, hide: true, hideable: true, renderCell: (params) => , }, + { field: 'nb_participant', headerName: 'Nb Parti.', minWidth: datagrid_columns_size_model2, align: "center", hide: false, renderCell: (params) => , }, + { + field: 'taux_remplissage', headerName: 'Remplissage', align: "center", flex: 1, minWidth: 100, maxWidth: 150, flex: 1, + align: "left", + renderCell: (params) => { + return ( + <> + + {`${(params?.row.taux_remplissage * 100).toFixed(0)}%`} + + ); + }, + }, + { field: 'nb_inscrit', headerName: 'Insc', minWidth: 20, align: "center", hide: true, hideable: true, renderCell: (params) => , }, + { field: 'nb_preinscrit', headerName: 'Preinsc.', minWidth: 20, align: "center", hide: false, hideable: true, renderCell: (params) => , }, + { + field: 'prix_session', headerName: 'Prix', minWidth: 20, align: "center", + renderCell: (params) => , + }, + { field: 'title', headerName: 'Formation', minWidth: 250, flex: 1, align: "center", hide: true, hideable: true, renderCell: (params) => , }, + { field: 'domaine', headerName: 'Domaine', minWidth: datagrid_columns_size_model1, align: "center", hide: true, renderCell: (params) => , }, + { field: 'published', headerName: 'publié', minWidth: datagrid_columns_size_model1, align: "center", hide: true, renderCell: (params) => , }, + + { field: 'site_formation_id', headerName: 'site_formation_id', with: 0, align: "center", hide: true, disableExport: true, }, + + + { field: 'qty_in_quotation', headerName: 'Place Non validé ', with: 150, align: "center", hide: false, renderCell: (params) => , }, + { field: 'qty_in_quotation_list_quotation', headerName: 'List Devis ', with: 150, align: "center", hide: false, renderCell: (params) => , }, + + { field: 'site_formation_nom', headerName: 'Site Ftion', with: 150, align: "center", hide: true, renderCell: (params) => , }, + + { + field: 'invoiced_statut', headerName: 'Facturé', minWidth: 100, flex: 1, maxWidth: 150, hide: false, editable: false, + renderCell: (cellValues) => { + return ( +
+ {String(cellValues.row.invoiced_statut) === "2" && "Oui"} + {String(cellValues.row.invoiced_statut) === "1" && "Part."} + {String(cellValues.row.invoiced_statut) !== "1" && String(cellValues.row.invoiced_statut) !== "2" && "Non"} +
+ ); + }, + }, + + { field: 'duration', headerName: 'Durée', minWidth: datagrid_columns_size_model2, align: "center", hide: true, renderCell: (params) => , }, + + { + field: 'bton_vertif', headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center", disableExport: true, + renderCell: (cellValues) => { + return ( +
+ {String(props.check_user_acces_right("session", "write")) === "1" && } +
+ ); + }, + }, + ] + + + const [session_debut_for_decalage, setsession_debut_for_decalage] = React.useState(''); + const [session_fin_for_decalage, setsession_fin_for_decalage] = React.useState(''); + + const [session_new_debut_for_decalage, setsession_new_debut_for_decalage] = React.useState(''); + const [session_id_for_decalage, setsession_id_for_decalage] = React.useState(''); + + const [promo_archive_status, setpromo_archive_status] = React.useState(''); + + const [working_cellValues_promo, setworking_cellValues_promo] = useState(false); + const [dialogOpen_supp_promo, setdialogOpen_supp_promo] = useState(false); + const Dialog_menuitem_close_supp_prmo = () => { + setdialogOpen_supp_promo(false) + }; + + + const [dialogOpen_archive, setdialogOpen_archive] = useState(false); + const Dialog_menuitem_close_archive = () => { + setdialogOpen_archive(false) + }; + + const options_menu_vertical_preinsc = [ + '', + 'Mise à jour', + 'Valider Insc.', + 'Refuser Insc.', + 'Supprimer', + + ]; + const [working_cellValues_preisnc, setworking_cellValues_preisnc] = useState(false); + const [anchorEl_preinsc, setAnchorEl_preinsc] = React.useState(null); + const open_preinsc = Boolean(anchorEl_preinsc); + const handleClick_option_button_vertical_preinsc = (event) => { + setAnchorEl_preinsc(event.currentTarget); + }; + const handleClose_option_button_vertical_preinsc = (event, value) => { + setAnchorEl_preinsc(null); + }; + + + const [dialogOpen_refus_inscription, setdialogOpen_refus_inscription] = useState(false); + const Dialog_menuitem_close_refus_inscription = () => { + setdialogOpen_refus_inscription(false) + }; + + + const [dialogOpen_suppr_preinscription, setdialogOpen_suppr_preinscription] = useState(false); + const Dialog_menuitem_suppr_preinscription = () => { + setdialogOpen_suppr_preinscription(false) + }; + + const columns_preinscrit = [ + { field: 'id', headerName: 'id', hide: true }, + { field: '_id', headerName: '_id', hide: true }, + + { + field: 'civilite', headerName: 'Civ.', minWidth: 90, flex: 1, maxWidth: 100, hide: false, editable: false, editable: false, + + renderCell: (cellValues) => { + return ( + +
+ {New_civilite && New_civilite.length > 0 && cellValues.row.civilite && + + } + +
+ + ); + }, + }, + + { field: 'nom', headerName: 'nom', minWidth: 200, flex: 1, hide: false, editable: true, renderCell: (params) => , }, + { field: 'prenom', headerName: 'prenom', minWidth: 200, flex: 1, hide: false, editable: true, renderCell: (params) => , }, + { field: 'email', headerName: 'email', minWidth: 200, flex: 1, flex: 1, renderCell: (params) => , }, + + { field: 'telephone', headerName: 'telephone', minWidth: 150, flex: 1, flex: 1, renderCell: (params) => , }, + + { field: 'client_rattachement_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'client_rattachement_id', headerName: 'Client_id', Width: 0, hide: true, editable: false, }, + + { + field: 'client_facture', headerName: 'Client Fact.', minWidth: 150, flex: 1, hide: false, editable: false, + + renderCell: (cellValues) => { + return ( +
+ {New_Get_List_Partner_Clients_result && New_Get_List_Partner_Clients_result.length > 0 && } +
+ + ); + } + }, + + { field: 'employeur', headerName: 'Employeur', minWidth: 150, flex: 1, maxWidth: 200, hide: true, editable: true, renderCell: (params) => , }, + { field: 'opco', headerName: 'Centre Opco', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: false }, + { + field: 'modefinancement', headerName: 'Financement', minWidth: 100, flex: 1, maxWidth: 150, hide: true, editable: false, + renderCell: (cellValues) => { + return ( + +
+ {New_Financement && New_Financement.length > 0 && cellValues.row.modefinancement && + + } + +
+ + ); + }, + }, + { field: 'amount', headerName: 'Montant Formation', minWidth: 100, flex: 1, maxWidth: 150, type: 'number', flex: 1, editable: true, renderCell: (params) => , }, + { + field: "update", headerName: 'Mise à jour', + renderCell: (cellValues) => { + return ( + <> + {String(props.check_user_acces_right("session", "write")) === "1" && { + handleClick_accept(event, cellValues); + }} + > + + + } + modal + nested + position="center center" + > + {close => ( +
+ +
MySy Information
+
+ {' '} + + Confirmer la mise à jour des informations du stagiaire +
+
+
+ + +
+
+ +
+
+
+ )} +
} + + + + ); + } + }, + + + { + field: 'bton_vertif', headerName: 'Gestion', minWidth: 50, flex: 1, maxWidth: 100, hideable: true, hide: false, editable: false, align: "center", + renderCell: (cellValues) => { + return ( +
+ + {String(props.check_user_acces_right("session", "write")) === "1" &&