11/02/2025 - 21h

recette2
cherif 2025-02-11 20:41:27 +01:00
parent 28331070cf
commit 52dd804959
5 changed files with 217 additions and 74 deletions

View File

@ -1638,7 +1638,7 @@ const Config_Documents_Super_Admin = (props) => {
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Document_with_filter/";
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Partner_Document_with_filter_Admin/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
@ -2275,7 +2275,7 @@ const Config_Documents_Super_Admin = (props) => {
</Dialog>
<h3> Configuration documents </h3>
<h3> Configuration documents (Admin) </h3>
<div className="div_row">
<div className="titre1"> Utilisez les filtres !</div>
<div className="div_row" style={{ "marginBottom": "5px" }}>

View File

@ -72,35 +72,35 @@ import { IconButton } from '@material-ui/core';
function PaperComponent(props) {
return (
<Draggable
handle="#draggable-dialog-title"
cancel={'[class*="MuiDialogContent-root"]'}
>
<Paper {...props} />
</Draggable>
<Draggable
handle="#draggable-dialog-title"
cancel={'[class*="MuiDialogContent-root"]'}
>
<Paper {...props} />
</Draggable>
);
}
}
const useStyles = makeStyles((theme) => ({
const useStyles = makeStyles((theme) => ({
dialog: {
position: 'absolute',
// left: 10,
top: 400
position: 'absolute',
// left: 10,
top: 400
},
paper: {
overflowY: 'unset',
overflowY: 'unset',
},
customizedButton: {
position: 'absolute',
left: '98%',
top: '-3%',
backgroundColor: 'lightgray',
color: 'gray',
position: 'absolute',
left: '98%',
top: '-3%',
backgroundColor: 'lightgray',
color: 'gray',
},
}));
}));
const Employes = (props) => {
const classes = useStyles();
@ -6773,6 +6773,74 @@ const Employes = (props) => {
}
const [selectionModel_evaluation, setSelectionModel_evaluation] = React.useState([]);
const New_Option_Evaluation_Masse = [
{ "id": "export_evaluation", "label": "Export Evaluation (PDF) ", "value": "export_evaluation" },
]
const [actionmass_eval_val, setactionmass_eval_val] = useState();
async function actionmass_Evaluation_Traitemet() {
var tab_ids_inscription = [];
for (var i = 0; i < selectionModel_evaluation_formateur.length; i++) {
var myid = parseInt(String(selectionModel_evaluation_formateur[i]));
var line_id = JSON.parse(rowss_evaluation_formateur[myid])._id;
tab_ids_inscription.push(line_id);
}
if (String(actionmass_eval_val) === "export_evaluation")
Export_Selected_Survey_PDF(tab_ids_inscription, "Evaluation formateur", "chaud");
}
function Export_Selected_Survey_PDF(tab_ids_survey, type_export, used_datagrid) {
const stored_cookie = getCookie('tokenmysypart');
if (tab_ids_survey.length <= 0) {
// alert(" Aucune ligne selectionnée ");
setdisplay_alert_mysy("1");
setalert_message("Aucune ligne selectionnée ");
setalert_type("error");
return;
}
var nom_fichier_cmd = "export_evaluation.zip";
var url = process.env.REACT_APP_API_URL + "myclass/api/Export_To_Excel_Survey_with_filter_Tab_Survey_Id/" + stored_cookie + "/" + tab_ids_survey.toString() + "/" + String(type_export);
setLoading(true);
axios.get(url, { responseType: 'blob', },)
.then((res) => {
setLoading(false);
//console.log(" In Export_Dashbord_to_CSV res.data = " + res.data);
if (String(res.data) === String("false")) {
alert("Impossible d'exporter les réponses (2) ");
} else {
fileDownload(res.data, nom_fichier_cmd);
if (used_datagrid === "chaud") {
setselectionModel_evaluation_formateur([]);
setactionmass_eval_val("");
}
}
}).catch((error) => {
setLoading(false);
console.error('Error:', error);
alert(" Impossible d'exporter les réponses ")
});
setLoading(false);
}
return (
<div className="employes">
@ -6821,7 +6889,7 @@ const Employes = (props) => {
aria-labelledby="draggable-dialog-title"
>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">MySy Information</DialogTitle>
<DialogTitle style={{ cursor: 'move' }} id="draggable-dialog-title">MySy Information</DialogTitle>
<DialogContent className="DialogContent_width" style={{ "minHeight": "20rem" }}>
@ -8386,7 +8454,7 @@ const Employes = (props) => {
height: 500,
width: '100%',
paddingRight: '1px',
fontFamily:"Plus Jakarta Sans, sans-serif", color:'#EEF1F6',
fontFamily: "Plus Jakarta Sans, sans-serif", color: '#EEF1F6',
// Gestion des cellule a distance ou presentiel
'& .cell--distantiel': {
@ -10275,44 +10343,8 @@ const Employes = (props) => {
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) => {
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';
}
}}*/
/>
</Box>
@ -11408,7 +11440,7 @@ const Employes = (props) => {
checkboxSelection
onSelectionModelChange={(newSelectionModel_evaluation) => {
setselectionModel_evaluation_formateur(newSelectionModel_evaluation);
//console.log("ch selected--" + newSelectionModel_evaluation);
// console.log("ch selected--" + newSelectionModel_evaluation);
}}
@ -11474,13 +11506,99 @@ const Employes = (props) => {
/>
</Box>
{selectionModel_evaluation_formateur && selectionModel_evaluation_formateur.length > 0 &&
<div className="block_en_mass">
<nav >Traitement en masse / Evaluation</nav>
&nbsp;
<Autocomplete
disablePortal
id="combo-box-demo"
className="block_en_mass_select"
fullWidth
options={New_Option_Evaluation_Masse}
onChange={(event, value) => {
if (value && value.value) {
if (String(value.value) === "export_evaluation") {
setactionmass_eval_val(value.value);
}
else {
setactionmass_eval_val("");
}
}
else {
setactionmass_eval_val("");
}
}}
renderInput={(params) => <TextField {...params} placeholder="Choisir une option" />
}
/>
{actionmass_eval_val && String(actionmass_eval_val) !== "" &&
selectionModel_evaluation_formateur.length > 0 &&
<Popup
trigger={<Button className="bton_enreg" >
<FcAcceptDatabase /> Traiter
</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">
{' '}
{actionmass_eval_val && String(actionmass_eval_val) === "export_evaluation" && <nav>
Confirmer l'export PDF des évaluations pour {selectionModel_evaluation.length} ligne(s).
</nav>}
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
actionmass_Evaluation_Traitemet();
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>
}
<br />
</div>
}
<br />
</div>

View File

@ -1968,9 +1968,6 @@ const Module_Session_Evaluation = (props) => {
<br />
</div>

View File

@ -1190,6 +1190,8 @@
width: 50%;
float: left;
margin-bottom: 1rem;
margin-top: 15px;
margin-left: 0px;
}
.block_en_mass_select {
@ -1741,7 +1743,26 @@
text-align: center;
}
}
.block_en_mass {
width: 50%;
float: left;
margin-bottom: 1rem;
margin-top: 15px;
margin-left: 0px;
}
.block_en_mass_select {
width: 45%;
float: left;
margin-bottom: 1rem;
}
.block_en_mass_bton_action {
width: 45%;
float: left;
margin-bottom: 1rem;
padding-top: 0.5rem !important;
} }
@media only screen and (min-width: 1200px) {
.okUpdateData {
@ -1970,11 +1991,18 @@
}
.block_en_mass {
width: 50%;
float: left;
margin-bottom: 1rem;
margin-top: 15px;
margin-left: 0px;
}
.block_en_mass_select {
width: 45%;
float: left;
margin-bottom: 1rem;
}
.session_open_close {