21/07/2024 - 12h
parent
91e20eddb3
commit
618d156c22
|
@ -964,7 +964,7 @@ const Module_Session_Evaluation = (props) => {
|
|||
|
||||
//console.log(" ### actionmass_evaluation = ", value);
|
||||
|
||||
if (String(value) === "demande evaluation") {
|
||||
if (String(value) === "demande evaluation" || String(value.value) === "export_evaluation") {
|
||||
setactionmass_eval_val(value);
|
||||
//console.log(" ### LAAA = ", value);
|
||||
}
|
||||
|
@ -1010,7 +1010,10 @@ const Module_Session_Evaluation = (props) => {
|
|||
}
|
||||
|
||||
//SendEvaluationEmail_Many_Ids(tab_ids_inscription);
|
||||
Send_Survey_By_Email_For_Ids(tab_ids_survey);
|
||||
if (String(actionmass_eval_formateur) === "demande evaluation")
|
||||
Send_Survey_By_Email_For_Ids(tab_ids_survey);
|
||||
else if (String(actionmass_eval_formateur) === "export_evaluation")
|
||||
Export_Selected_Survey_PDF(tab_ids_survey);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1031,7 +1034,10 @@ const Module_Session_Evaluation = (props) => {
|
|||
|
||||
|
||||
//SendEvaluationEmail_Many_Ids(tab_ids_inscription);
|
||||
Send_Survey_By_Email_For_Ids(tab_ids_inscription);
|
||||
if (String(actionmass_eval_val) === "demande evaluation")
|
||||
Send_Survey_By_Email_For_Ids(tab_ids_inscription);
|
||||
else if (String(actionmass_eval_val) === "export_evaluation")
|
||||
Export_Selected_Survey_PDF(tab_ids_inscription);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1061,8 +1067,11 @@ const Module_Session_Evaluation = (props) => {
|
|||
}
|
||||
|
||||
|
||||
//SendEvaluationEmail_Many_Ids(tab_ids_inscription);
|
||||
Send_Survey_By_Email_For_Ids(tab_ids_inscription);
|
||||
//SendEvaluationEmail_Many_Ids(tab_ids_inscription); setactionmass_eval_val
|
||||
if (String(actionmass_eval_froid) === "demande evaluation")
|
||||
Send_Survey_By_Email_For_Ids(tab_ids_inscription);
|
||||
else if (String(actionmass_eval_froid) === "export_evaluation")
|
||||
Export_Selected_Survey_PDF(tab_ids_inscription);
|
||||
|
||||
}
|
||||
|
||||
|
@ -1148,6 +1157,7 @@ const Module_Session_Evaluation = (props) => {
|
|||
|
||||
const New_Option_Evaluation_Masse = [
|
||||
{ "id": "demande evaluation", "label": "Envoyer demande Evaluation", "value": "demande evaluation" },
|
||||
{ "id": "export_evaluation", "label": "Export Evaluation (PDF) ", "value": "export_evaluation" },
|
||||
]
|
||||
|
||||
useEffect(() => {
|
||||
|
@ -1285,6 +1295,44 @@ const Module_Session_Evaluation = (props) => {
|
|||
}
|
||||
|
||||
|
||||
function Export_Selected_Survey_PDF(tab_ids_survey) {
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
|
||||
|
||||
|
||||
if (tab_ids_survey.length <= 0) {
|
||||
alert(" Aucune ligne selectionnée ");
|
||||
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();
|
||||
|
||||
|
||||
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)
|
||||
|
||||
}
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.error('Error:', error);
|
||||
alert(" Impossible d'exporter les réponses ")
|
||||
|
||||
});
|
||||
|
||||
|
||||
setLoading(false);
|
||||
}
|
||||
|
||||
|
||||
|
||||
const [Dialog_1_message, setDialog_1_message] = React.useState(false);
|
||||
|
||||
const [Dialog_LIST_HOT_EVALUATION_QUESTION_open, setDialog_LIST_HOT_EVALUATION_QUESTION_open] = React.useState(false);
|
||||
|
@ -1747,6 +1795,10 @@ const Module_Session_Evaluation = (props) => {
|
|||
setSelectionModel_evaluation(newSelectionModel_evaluation);
|
||||
//console.log("ch selected--" + newSelectionModel_evaluation);
|
||||
|
||||
if( selectionModel_evaluation.length <= 0 ){
|
||||
setactionmass_eval_val("");
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
selectionModel={selectionModel_evaluation}
|
||||
|
@ -1811,7 +1863,7 @@ const Module_Session_Evaluation = (props) => {
|
|||
/>
|
||||
</Box>
|
||||
|
||||
{selectionModel_evaluation && String(selectionModel_evaluation) !== "" && selectionModel_evaluation.length >= 0 &&
|
||||
{selectionModel_evaluation && String(selectionModel_evaluation) !== "" && selectionModel_evaluation.length > 0 &&
|
||||
<div className="block_en_mass">
|
||||
|
||||
<nav >Traitement en masse / Evaluation</nav>
|
||||
|
@ -1826,10 +1878,8 @@ const Module_Session_Evaluation = (props) => {
|
|||
options={New_Option_Evaluation_Masse}
|
||||
onChange={(event, value) => {
|
||||
if (value && value.value) {
|
||||
if (String(value.value) === "demande evaluation") {
|
||||
|
||||
if (String(value.value) === "demande evaluation" || String(value.value) === "export_evaluation") {
|
||||
setactionmass_eval_val(value.value);
|
||||
|
||||
}
|
||||
else {
|
||||
setactionmass_eval_val("");
|
||||
|
@ -1868,8 +1918,14 @@ const Module_Session_Evaluation = (props) => {
|
|||
<div className="gest_header"> MySy Information </div>
|
||||
<div className="gest_content">
|
||||
{' '}
|
||||
{actionmass_eval_val && String(actionmass_eval_val) === "demande evaluation" && <nav>
|
||||
Confirmer l'envoi de la demande d'évaluation pour {selectionModel_evaluation.length} ligne(s).
|
||||
</nav>}
|
||||
|
||||
{actionmass_eval_val && String(actionmass_eval_val) === "export_evaluation" && <nav>
|
||||
Confirmer l'export PDF des évaluations pour {selectionModel_evaluation.length} ligne(s).
|
||||
</nav>}
|
||||
|
||||
Confirmer l'action <b> {actionmass_eval_val} </b> en masse.
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
|
@ -2035,6 +2091,10 @@ const Module_Session_Evaluation = (props) => {
|
|||
setSelectionModel_evaluation_cold(newSelectionModel_evaluation);
|
||||
//console.log("ch selected--" + newSelectionModel_evaluation);
|
||||
|
||||
if( selectionModel_evaluation_cold.length <= 0 ){
|
||||
setactionmass_eval_froid("");
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
selectionModel={selectionModel_evaluation_cold}
|
||||
|
@ -2099,7 +2159,7 @@ const Module_Session_Evaluation = (props) => {
|
|||
/>
|
||||
</Box>
|
||||
|
||||
{selectionModel_evaluation_cold && selectionModel_evaluation_cold.length >= 0 &&
|
||||
{selectionModel_evaluation_cold && selectionModel_evaluation_cold.length > 0 &&
|
||||
<div className="block_en_mass">
|
||||
<nav >Traitement en masse / Evaluation froid</nav>
|
||||
|
||||
|
@ -2113,7 +2173,7 @@ const Module_Session_Evaluation = (props) => {
|
|||
options={New_Option_Evaluation_Masse}
|
||||
onChange={(event, value) => {
|
||||
if (value && value.value) {
|
||||
if (String(value.value) === "demande evaluation") {
|
||||
if (String(value.value) === "demande evaluation" || String(value.value) === "export_evaluation") {
|
||||
|
||||
setactionmass_eval_froid(value.value);
|
||||
|
||||
|
@ -2133,7 +2193,7 @@ const Module_Session_Evaluation = (props) => {
|
|||
}
|
||||
/>
|
||||
|
||||
{actionmass_eval_froid && String(actionmass_eval_froid) !== "" && String(actionmass_eval_froid).length > 1 &&
|
||||
{actionmass_eval_froid && String(actionmass_eval_froid) !== "" && String(selectionModel_evaluation_cold).length > 0 &&
|
||||
selectionModel_evaluation_cold.length > 0 &&
|
||||
<Popup
|
||||
trigger={<Button className="bton_enreg" >
|
||||
|
@ -2154,7 +2214,16 @@ const Module_Session_Evaluation = (props) => {
|
|||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
Confirmer l'action <b> {actionmass_eval_froid} </b> en masse.
|
||||
|
||||
|
||||
{actionmass_eval_froid && String(actionmass_eval_froid) === "demande evaluation" && <nav>
|
||||
Confirmer l'envoi de la demande d'évaluation pour {selectionModel_evaluation_cold.length} ligne(s).
|
||||
</nav>}
|
||||
|
||||
{actionmass_eval_froid && String(actionmass_eval_froid) === "export_evaluation" && <nav>
|
||||
Confirmer l'export PDF des évaluations pour {selectionModel_evaluation_cold.length} ligne(s).
|
||||
</nav>}
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
|
@ -2320,6 +2389,10 @@ const Module_Session_Evaluation = (props) => {
|
|||
setselectionModel_evaluation_formateur(newSelectionModel_evaluation);
|
||||
//console.log("ch selected--" + newSelectionModel_evaluation);
|
||||
|
||||
if( selectionModel_evaluation_formateur.length <= 0 ){
|
||||
setactionmass_eval_formateur("");
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
selectionModel={selectionModel_evaluation_formateur}
|
||||
|
@ -2384,7 +2457,7 @@ const Module_Session_Evaluation = (props) => {
|
|||
/>
|
||||
</Box>
|
||||
|
||||
{selectionModel_evaluation_formateur && selectionModel_evaluation_formateur.length >= 0 &&
|
||||
{selectionModel_evaluation_formateur && selectionModel_evaluation_formateur.length > 0 &&
|
||||
<div className="block_en_mass">
|
||||
<nav >Traitement en masse / Evaluation Formateur</nav>
|
||||
|
||||
|
@ -2398,7 +2471,7 @@ const Module_Session_Evaluation = (props) => {
|
|||
options={New_Option_Evaluation_Masse}
|
||||
onChange={(event, value) => {
|
||||
if (value && value.value) {
|
||||
if (String(value.value) === "demande evaluation") {
|
||||
if (String(value.value) === "demande evaluation" || String(value.value) === "export_evaluation") {
|
||||
|
||||
setactionmass_eval_formateur(value.value);
|
||||
|
||||
|
@ -2418,9 +2491,9 @@ const Module_Session_Evaluation = (props) => {
|
|||
}
|
||||
/>
|
||||
|
||||
|
||||
|
||||
{actionmass_eval_formateur && String(actionmass_eval_formateur) !== "" && String(actionmass_eval_formateur).length > 1 &&
|
||||
selectionModel_evaluation_formateur.length > 0 &&
|
||||
{actionmass_eval_formateur && String(actionmass_eval_formateur) !== "" && selectionModel_evaluation_formateur.length > 0 &&
|
||||
<Popup
|
||||
trigger={<Button className="bton_enreg" >
|
||||
<FcAcceptDatabase /> Traiter
|
||||
|
@ -2440,7 +2513,15 @@ const Module_Session_Evaluation = (props) => {
|
|||
<div className="gest_content">
|
||||
{' '}
|
||||
|
||||
Confirmer l'action <b> {actionmass_eval_formateur} </b> en masse.
|
||||
|
||||
{actionmass_eval_formateur && String(actionmass_eval_formateur) === "demande evaluation" && <nav>
|
||||
Confirmer l'envoi de la demande d'évaluation pour {selectionModel_evaluation_formateur.length} ligne(s).
|
||||
</nav>}
|
||||
|
||||
{actionmass_eval_formateur && String(actionmass_eval_formateur) === "export_evaluation" && <nav>
|
||||
Confirmer l'export PDF des évaluations pour {selectionModel_evaluation_formateur.length} ligne(s).
|
||||
</nav>}
|
||||
|
||||
</div>
|
||||
<div className="gest_actions">
|
||||
<div style={{ "width": "45%", "float": "left" }}>
|
||||
|
|
Loading…
Reference in New Issue