recette2
cherif 2024-04-21 13:54:04 +02:00
parent 567bfaaf1a
commit 8dc18ab154
3 changed files with 214 additions and 336 deletions

View File

@ -5,13 +5,13 @@ import NotFound from './pages/NotFound'
import Contact from './pages/Contact'
import Connexion from './pages/Connexion'
import Login from './pages/Login';
import Recherche from "./pages/recherche_new";
import Recherche_new_v2 from "./pages/recherche_new_v2";
import TestUrl from "./pages/testurl";
import Account from "./pages/account";
import DisplayDetailClass from "./pages/displaydetailclass";
import DisplayDetailClass_new_v2 from "./pages/displaydetailclass_new_v2";
import DisplayDetailClassAction from "./pages/displaydetailclassaction";
import DisplayDetailArticle from "./pages/displaydetailarticle";
import Acceuil from "./pages/acceuil";
import Partner from "./pages/partner";
@ -19,17 +19,17 @@ import CreateAccount from "./pages/createaccount";
import PartnerLogin from "./pages/partnerlogin";
import PartnerLogin0 from "./pages/partnerlogin0";
import PartnerLogin1 from "./pages/partnerlogin1";
import Footer from "./pages/footer";
import RechecheArticles from "./pages/recherchearticles";
import AddArticle from "./pages/addarticle";
import ResetUserPwd from "./pages/resetuserpwd";
import DeleteUserAccount from "./pages/deleteuseraccount";
import QuiSommesNous from "./pages/quisommesnous";
import ContactezNous from "./pages/contactez_nous";
import CoupDeCoeur from "./pages/coupdecoeur";
import AccountUserActivated from "./pages/accountuseractivated";
import ProduitsService from "./pages/produitservice";
import scrollToTop from "react-scroll-to-top";
import Recherche_new from "./pages/recherche_new";
import Recherche_old from "./pages/recherche";
import UserSignFirst from "./pages/usersigninfirst";

View File

@ -1914,8 +1914,6 @@ const DisplayPartnerSession = (props) => {
}
if (String(actionmass_preinsc_val) === String("valide_inscr")) {
Accept_List_Inscritpion(tab_mongo_preins_ids);
@ -9740,9 +9738,10 @@ const DisplayPartnerSession = (props) => {
]
const New_Option_PreInscription = [
{ "id": "update_client", "label": "Demande MAJ Client", "value": "update_client" },
{ "id": "valide_inscr", "label": "Valider Inscription", "value": "valide_inscr" },
{ "id": "refuse_inscr", "label": "Refuser Inscription", "value": "refuse_inscr" },
{ "id": "update_client", "label": "Demande MAJ Client", "value": "update_client" },
]

View File

@ -1,18 +1,17 @@
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 Rating from '@mui/material/Rating';
import { gridClasses } from '@mui/x-data-grid';
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
import Box from '@mui/material/Box';
import { FcViewDetails, FcDisapprove } from "react-icons/fc";
import 'react-tooltip/dist/react-tooltip.css'
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint, FcAlarmClock, FcMultipleSmartphones, FcWorkflow } from "react-icons/fc";
import { FcCancel, FcApproval, FcAcceptDatabase, } from "react-icons/fc";
import 'reactjs-popup/dist/index.css';
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import { CiTrash } from "react-icons/ci";
@ -21,15 +20,7 @@ import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
import { useParams } from 'react-router-dom'
import Header from "./Header";
import Footer from "./Fotter";
import { FcInfo } from "react-icons/fc";
import { Document, Page } from 'react-pdf';
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 Radio from '@mui/material/Radio';
import { daDK } from "@mui/material/locale";
import Checkbox from '@mui/material/Checkbox';
import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
import Popup from 'reactjs-popup';
@ -82,259 +73,84 @@ function UpdateAttendeeList() {
const columns_preinscrit = [
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'civilite', headerName: 'Civ.', minWidth: 100, flex: 1, maxWidth: 100, hide: false, editable: true, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{
field: 'civilite', headerName: 'Civ.', minWidth: 100, flex: 1, maxWidth: 100, hide: false, editable: true,
type: "singleSelect",
valueOptions: [
{ value: 'm', label: 'M' },
{ value: 'mme', label: 'Mme' },
{ value: 'neutre', label: 'Neutre' }
],
renderCell: (params) => {
return (
<div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
{params.value && String(params.value) === "m" && "M"}
{params.value && String(params.value) === "mme" && "Mme"}
{params.value && String(params.value) === "neutre" && "Neutre"}
</div>
);
}
},
{ field: 'nom', headerName: 'nom', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'prenom', headerName: 'prenom', minWidth: 150, flex: 1, hide: false, editable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'email', headerName: 'email', minWidth: 150, flex: 1, flex: 1, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{
field: "update", headerName: 'Mise à jour',
renderCell: (cellValues) => {
return (
{ field: 'email', headerName: 'email', minWidth: 150, flex: 1, editable: true, renderCell: (params) => <ExpandableCell_50 {...params} />, },
<Popup
trigger={<Button
onClick={(event) => {
// handleClick_accept(event, cellValues);
}}
>
<FcAcceptDatabase />
</Button>}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
Confirmer la mise à jour des informations du stagiaire
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
// handleClick_update_data(event, cellValues);
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
);
}
},
{
field: "valide", headerName: 'Valider',
renderCell: (cellValues) => {
return (
<Popup
trigger={<Button
onClick={(event) => {
// handleClick_accept(event, cellValues);
}}
>
<FcApproval />
</Button>}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
En confirmant cette opération, l'inscription du stagiaire sera définitivement validée. <br />
Il (le stagiaire) sera automatiquement notifié par email de la validation de son inscription. <br />
Le stagiaire passera de l'onglet "préinscrit" vers l'onglet "inscription".<br />
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
// handleClick_accept(event, cellValues);
//console.log('modal closed ');
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
);
}
},
{
field: "refuse", headerName: 'Refuser',
renderCell: (cellValues) => {
return (
<Popup
trigger={<Button
onClick={(event) => {
// handleClick_refuse(event, cellValues);
}}
>
<FcCancel />
</Button>}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
En confirmant cette opération, l'inscription du stagiaire sera <i><font color="red"> refusée</font></i>. <br />
Il (le stagiaire) sera automatiquement <i><font color="red"> notifié par email du refus de son inscription. </font></i> <br />
<br /> Motif du refus : <br />
<textarea name='motif_refus' id="motif_refus" style={{ "width": "80%" }}
rows="3" maxlength="180" />
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
// handleClick_refuse(event, cellValues);
//console.log('modal closed ');
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
);
}
},
{
field: "delete", headerName: 'Supprimer',
renderCell: (cellValues) => {
return (
<Popup
trigger={<Button
onClick={(event) => {
//handleClick_delete(event, cellValues);
}}
>
<CiTrash />
</Button>}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
En confirmant cette opération, l'inscription du stagiaire sera <i><font color="red"> définitivement supprimée</font></i>. <br />
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
// handleClick_delete(event, cellValues);
//console.log('modal closed ');
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
);
}
}
]
const [Getall_Client_Communication_Contact_api, setGetall_Client_Communication_Contact_api] = useState();
const [Getall_Client_Communication_Contact_message, setGetall_Client_Communication_Contact_message] = useState();
const [Getall_Client_Communication_Contact_result, setGetall_Client_Communication_Contact_result] = useState([]);
function Getall_Client_Communication_Contact(event) {
var form = new FormData();
form.append("_id", client_id);
form.append("partner_owner_recid", partner_owner_recid);
//console.log(" ### Getall_Client_Communication_Contact form = ", form)
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Client_Communication_Contact_NO_TOKEN/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Client_Communication_Contact res.data.status = " + res.data.status);
//console.log(" In Getall_Client_Communication_Contact res.data.message r_class = " + res.data.message);
setGetall_Client_Communication_Contact_api("true");
setGetall_Client_Communication_Contact_result(res.data.message);
}
else {
setGetall_Client_Communication_Contact_api("false");
setGetall_Client_Communication_Contact_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Client_Communication_Contact = ', error);
setGetall_Client_Communication_Contact_api("false");
alert(" Impossible de recuperer la liste des stagiaires")
//setmyApimyApiMessage("")
})
}
const [Partner_Recid, setPartner_Recid] = useState("");
const [class_internal_url, setclass_internal_url] = useState("");
const [New_Getall_TrainingParticipant_result, setNew_Getall_TrainingParticipant_result] = useState([]);
@ -345,13 +161,10 @@ function UpdateAttendeeList() {
var form = new FormData();
form.append("client_rattachement_id", client_id);
form.append("session_id", session_id);
form.append("partner_owner_recid", partner_owner_recid);
form.append("status", "0");
form.append("status", "0");
//console.log(" ### Getall_TrainingParticipant form = ", form)
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Statgaire_List_Partner_with_filter_FOR_ONLY_INSCRIPTION_NO_TOKEN/";
@ -378,10 +191,10 @@ function UpdateAttendeeList() {
var local_nom = JSON.parse(x).nom;
var local_prenom = JSON.parse(x).prenom;
var local_email = JSON.parse(x).email;
var local_civilite = JSON.parse(x).civilite;
setPartner_Recid(String(JSON.parse(x).partner_owner_recid))
setclass_internal_url(String(JSON.parse(x).class_internal_url))
//---
var node = {
@ -390,6 +203,7 @@ function UpdateAttendeeList() {
"nom": local_nom,
"prenom": local_prenom,
"email": local_email,
"civilite": local_civilite,
};
new_data2.push(node);
@ -402,8 +216,6 @@ function UpdateAttendeeList() {
setNew_Getall_TrainingParticipant_result(new_data2);
}
}
else {
setGetall_TrainingParticipant_api("false");
@ -424,6 +236,7 @@ function UpdateAttendeeList() {
Getall_TrainingParticipant();
Getall_Client_Communication_Contact();
window.scrollTo({
top: 0,
behavior: "smooth",
@ -431,43 +244,11 @@ function UpdateAttendeeList() {
}, [])
function change_survey_data(e) {
var tmp = tab_variable;
tmp[String(e.name)] = e.value;
settab_variable(tmp)
}
const [value, setValue] = React.useState('female');
const handleChange = (event) => {
setValue(event.target.value);
};
const [selected_qcm_value, setselected_qcm_value] = React.useState('');
const handleChange_qcm = (event) => {
document.getElementsByName(event.target.name)[0].value = event.target.value;
// setselected_qcm_value(event.target.value);
change_survey_data(event.target);
};
function OnchangeCellDataGrid(params) {
// params = la nouvelle lignes
console.log(params);
console.log(" ### zzz params = ", params);
var num_line = params.id; // ==> Id de la ligne changé
var colomn = params.field; // ==> colonne de la ligne changé
@ -483,9 +264,10 @@ function UpdateAttendeeList() {
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['nom'] = new_value
tmp['nom'] = new_value;
tmp['prenom'] = (x).prenom;
tmp['email'] = (x).email;
tmp['civilite'] = (x).civilite;
return tmp;
@ -497,9 +279,33 @@ function UpdateAttendeeList() {
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['nom'] = (x).nom;
tmp['prenom'] = new_value
tmp['prenom'] = new_value;
tmp['email'] = (x).email;
tmp['civilite'] = (x).civilite;
return tmp;
}
if (String(num_line) === String(localid) && colomn === "civilite") {
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['email'] = (x).email;
tmp['civilite'] = new_value;
return tmp;
}
if (String(num_line) === String(localid) && colomn === "email") {
var tmp = {};
tmp['id'] = (x).id;
tmp['_id'] = (x)._id;
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['email'] = new_value;
tmp['civilite'] = (x).civilite;
return tmp;
}
@ -511,11 +317,15 @@ function UpdateAttendeeList() {
tmp['nom'] = (x).nom;
tmp['prenom'] = (x).prenom;
tmp['email'] = (x).email;
tmp['civilite'] = (x).civilite;
return tmp;
});
console.log(" ### updatedData = ", updatedData);
setNew_Getall_TrainingParticipant_result([]);
setNew_Getall_TrainingParticipant_result(updatedData);
@ -524,7 +334,7 @@ function UpdateAttendeeList() {
const [Record_New_Attendee_Data_api, setRecord_New_Attendee_Data_api] = useState();
const [Record_New_Attendee_Data_message, setRecord_New_Attendee_Data_message] = useState();
const [Record_New_Attendee_Data_result, setRecord_New_Attendee_Data_result] = useState();
const [Record_New_Attendee_Data_result, setRecord_New_Attendee_Data_result] = useState([]);
function Record_New_Attendee_Data() {
var form = new FormData();
@ -539,7 +349,7 @@ function UpdateAttendeeList() {
const stored_cookie = getCookie('tokenmysypart');
form.append("client_id", client_id);
form.append("session_id", session_id);
form.append("list_attendee_data", new_attende_dat_JSON);
form.append("list_attendee_data", new_attende_dat_JSON);
form.append("partner_recid", Partner_Recid);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Client_Update_Liste_Attendee_No_Token/";
@ -581,6 +391,37 @@ function UpdateAttendeeList() {
<Header />
<div className="div_row">
&nbsp;
</div>
{Getall_Client_Communication_Contact_result && Getall_Client_Communication_Contact_result.length > 0 && <div className="div_row" style={{ "width": "90%", "marginLeft": "5%", "background": "white", }}>
<div style={{ textAlign: 'left' }}>
<nav style={{ textAlign: 'left' }}>
<b> Bonjour {JSON.parse(Getall_Client_Communication_Contact_result).civilite} {JSON.parse(Getall_Client_Communication_Contact_result).nom} </b>
</nav>
Merci de completer les informations des participants à session de formation ci-dessous. <br />
</div>
<br />
{Getall_TrainingParticipant_result && Getall_TrainingParticipant_result.length > 0 &&
<div style={{ textAlign: 'left' }}>
<b> Formation : </b> {JSON.parse(Getall_TrainingParticipant_result[0]).title} <br />
<b> Code Session : </b> {JSON.parse(Getall_TrainingParticipant_result[0]).title} <br />
<b> Titre Session : </b> {JSON.parse(Getall_TrainingParticipant_result[0]).session_titre} <br />
<b> Date début : </b> {JSON.parse(Getall_TrainingParticipant_result[0]).date_du} <br />
<b> Date fin : </b> {JSON.parse(Getall_TrainingParticipant_result[0]).date_au} <br />
</div>
}
<br />
</div>}
<div className="div_row">
&nbsp;
</div>
@ -636,8 +477,7 @@ function UpdateAttendeeList() {
nom: item.nom,
prenom: (item).prenom,
email: (item).email,
civilite: (item).civilite,
}
))}
@ -664,25 +504,62 @@ function UpdateAttendeeList() {
/>
</Box>
<br />
</div>
</div>
<br />
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
<Button variant="contained" className="bton_enreg" onClick={Record_New_Attendee_Data}>Envoyer
</Button>
<Popup
trigger={
<Button variant="contained" className="bton_enreg" onClick={Record_New_Attendee_Data}>Mettre à jour
</Button>}
modal
nested
position="center center"
>
{close => (
<div>
<button className="gest_close" onClick={close}>
&times;
</button>
<div className="gest_header"> MySy Information </div>
<div className="gest_content">
{' '}
En confirmant cette opération, les données des préinscrits seront mises à jour.
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
Record_New_Attendee_Data(event);
close();
}}> Valider </button>
</div>
<div style={{ "width": "45%", "float": "right" }}>
<button
className="gest_bton_popup"
onClick={() => {
//console.log('modal closed ');
close();
}}
>
Annuler
</button>
</div>
</div>
</div>
)}
</Popup>
</div>
@ -693,30 +570,32 @@ function UpdateAttendeeList() {
</Button>
</div>
<div className="div_row" style={{ "border": "None" }}>
&nbsp;
</div>
<div style={{ "width": "90%", "marginLeft": "5%", "background": "#F2F4F4", overflow: "auto", "paddingBottom": "1rem" }}>
<div style={{ "width": "100%", "background": "#F2F4F4", overflow: "auto", "paddingBottom": "1rem" }}>
<br />
{/*get_Given_Survey_Data_result && get_Given_Survey_Data_result.length > 0 && <div className="question_box_entete">
<Display_Action_And_Class classId={JSON.parse(get_Given_Survey_Data_result).class_internal_url} action={""} />
{class_internal_url && String(class_internal_url).length > 2 && <div className="question_box_entete">
<Display_Action_And_Class classId={class_internal_url} action={""} />
</div>*/}
</div>}
</div>
</div>}
{(!Getall_TrainingParticipant_result || Getall_TrainingParticipant_result.length <= 0) && <div style={{ height: "40vh" }}>
<div className="div_row">
{(!Getall_TrainingParticipant_result || Getall_TrainingParticipant_result.length <= 0) && <div style={{
height: "40vh", "width": "100%",
"background": "#F2F4F4", overflow: "auto", "paddingBottom": "1rem",
"marginTop":"5rem", "color":"red", fontWeight:'700', "fontSize":"20px"
}}>
Le document est invalide
Le document est invalide
</div>}
</div>}
</div>
<div className="div_row">
&nbsp;