06/04/2024 - 21h19

recette2
cherif 2024-04-06 21:19:19 +02:00
parent d8de59e27b
commit e4d5914456
6 changed files with 3777 additions and 191 deletions

View File

@ -54,6 +54,7 @@ import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi"; import { PiDotsThree } from "react-icons/pi";
import Module_Editique from "./Module_Editique"; import Module_Editique from "./Module_Editique";
import Module_Attestation_Formation from "./Module_Attestation_Formation"; import Module_Attestation_Formation from "./Module_Attestation_Formation";
import Module_Evaluation_Positionnement from "./Module_Evaluation_Positionnement";
import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5"; import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
@ -2610,6 +2611,90 @@ const DisplayPartnerSession = (props) => {
} }
async function submenu_q_positionnement() {
setsubmenu("positionnement");
//await sleep(5);
if (!edit_session_form) {
desableSessionFields();
}
if (document.getElementById("q_positionnement")) {
document.getElementById("q_positionnement").style.backgroundColor = "#104277";
document.getElementById("q_positionnement").style.color = "white";
document.getElementById("q_positionnement").style.fontWeight = "bold";
}
if (document.getElementById("attestation")) {
document.getElementById("attestation").style.backgroundColor = "#d8edfc";
document.getElementById("attestation").style.color = "black";
document.getElementById("attestation").style.fontWeight = "normal";
}
if (document.getElementById("evaluation")) {
document.getElementById("evaluation").style.backgroundColor = "#d8edfc";
document.getElementById("evaluation").style.color = "black";
document.getElementById("evaluation").style.fontWeight = "normal";
}
if (document.getElementById("emargement")) {
document.getElementById("emargement").style.backgroundColor = "#d8edfc";
document.getElementById("emargement").style.color = "black";
document.getElementById("emargement").style.fontWeight = "normal";
}
if (document.getElementById("editique")) {
document.getElementById("editique").style.backgroundColor = "#d8edfc";
document.getElementById("editique").style.color = "black";
document.getElementById("editique").style.fontWeight = "normal";
}
if (document.getElementById("sequence_session")) {
document.getElementById("sequence_session").style.backgroundColor = "#d8edfc";
document.getElementById("sequence_session").style.color = "black";
document.getElementById("sequence_session").style.fontWeight = "normal";
}
if (document.getElementById("detail_session")) {
document.getElementById("detail_session").style.backgroundColor = "#d8edfc";
document.getElementById("detail_session").style.color = "black";
document.getElementById("detail_session").style.fontWeight = "normal";
}
if (document.getElementById("inscrit")) {
document.getElementById("inscrit").style.backgroundColor = "#d8edfc";
document.getElementById("inscrit").style.color = "black";
document.getElementById("inscrit").style.fontWeight = "normal";
}
if (document.getElementById("preinscrit")) {
document.getElementById("preinscrit").style.backgroundColor = "#d8edfc";
document.getElementById("preinscrit").style.color = "black";
document.getElementById("preinscrit").style.fontWeight = "normal";
}
if (document.getElementById("historique")) {
document.getElementById("historique").style.backgroundColor = "#d8edfc";
document.getElementById("historique").style.color = "black";
document.getElementById("historique").style.fontWeight = "normal";
}
if (document.getElementById("piece_jointe")) {
document.getElementById("piece_jointe").style.backgroundColor = "#d8edfc";
document.getElementById("piece_jointe").style.color = "black";
document.getElementById("piece_jointe").style.fontWeight = "normal";
}
}
function handleClickSessionManagement(event, cellValues) { function handleClickSessionManagement(event, cellValues) {
var code_session = cellValues.row.code_session; var code_session = cellValues.row.code_session;
setselected_code_session(cellValues.row.code_session); setselected_code_session(cellValues.row.code_session);
@ -11892,7 +11977,8 @@ const DisplayPartnerSession = (props) => {
<Button variant="outlined" onClick={submenu_emargement} className="detail_class_submenu" id='emargement' name='emargement'>Emargement </Button> <Button variant="outlined" onClick={submenu_emargement} className="detail_class_submenu" id='emargement' name='emargement'>Emargement </Button>
<Button variant="outlined" onClick={submenu_evaluation} className="detail_class_submenu" id='menu_eval' name='menu_eval'>Les avis</Button> <Button variant="outlined" onClick={submenu_evaluation} className="detail_class_submenu" id='menu_eval' name='menu_eval'>Les avis</Button>
<Button variant="outlined" onClick={submenu_attestation} className="detail_class_submenu" id='menu_eval' name='menu_eval'>Attestation</Button> <Button variant="outlined" onClick={submenu_attestation} className="detail_class_submenu" id='menu_eval' name='menu_eval'>Attestation</Button>
<Button variant="outlined" onClick={submenu_piece_jointe} className="detail_class_submenu" id='piece_jointe' name='contrat'>Pièces Jointes </Button> <Button variant="outlined" onClick={submenu_q_positionnement} className="detail_class_submenu" id='q_positionnement' name='q_positionnement'>Positionnement </Button>
<Button variant="outlined" onClick={submenu_piece_jointe} className="detail_class_submenu" id='piece_jointe' name='piece_jointe'>Pièces Jointes </Button>
<Button variant="outlined" onClick={submenu_historique} className="detail_class_submenu" id='historique' name='historique'>Historique </Button> <Button variant="outlined" onClick={submenu_historique} className="detail_class_submenu" id='historique' name='historique'>Historique </Button>
@ -12866,25 +12952,6 @@ const DisplayPartnerSession = (props) => {
/> />
</div> </div>
{/*<div className="session_caract"> Prix session <br />
<TextField sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="prix_session"
id="prix_session"
type="number"
InputLabelProps={{
shrink: true,
}}
inputProps={{ min: "1", max: "1000", step: "1" }}
disabled={false}
className="disabled_style"
value={p_prix_session}
onChange={(e) => {
setp_prix_session(e.target.value);
IssessionChanged();
}}
/>
</div>*/}
<div className="session_caract"> Prix session <br /> <div className="session_caract"> Prix session <br />
<TextField sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} <TextField sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
@ -17418,6 +17485,15 @@ const DisplayPartnerSession = (props) => {
</div>} </div>}
{String(submenu) === String("positionnement") && <div style={{ "border": "None" }}>
<Module_Evaluation_Positionnement conntected_employee_id={props.conntected_employee_id} related_collection={"session_formation"}
related_collection_recid={selected_session_id} />
</div>}
{String(submenu) === String("piece_jointe") && <div style={{ "border": "None" }}> {String(submenu) === String("piece_jointe") && <div style={{ "border": "None" }}>
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Les pièces jointes </nav> <nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Les pièces jointes </nav>

View File

@ -10,29 +10,14 @@ import { useHistory } from "react-router-dom";
import CheckOut from "./CheckOut"; import CheckOut from "./CheckOut";
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid'; import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css"; import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
import { Editor } from '@tinymce/tinymce-react';
import parse from 'html-react-parser';
import 'react-tooltip/dist/react-tooltip.css' import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
import add_plus from "../mysy_img/plus.png"; import Popup from 'reactjs-popup'
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 'reactjs-popup/dist/index.css';
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc"; import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
import DatePicker from "react-datepicker"; import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css"; import "react-datepicker/dist/react-datepicker.css";
import { format } from 'date-fns'
import moment from "moment";
import InputAdornment from '@mui/material/InputAdornment';
import { AiFillCloseCircle } from "react-icons/ai";
import Box from '@mui/material/Box'; import Box from '@mui/material/Box';
import { Typography, LinearProgress, sliderClasses } 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 Dialog from '@mui/material/Dialog';
import DialogActions from '@mui/material/DialogActions'; import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent'; import DialogContent from '@mui/material/DialogContent';
@ -40,37 +25,7 @@ import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle'; import DialogTitle from '@mui/material/DialogTitle';
import { TransitionProps } from '@mui/material/transitions'; import { TransitionProps } from '@mui/material/transitions';
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif"; import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
//import FullCalendar from "@fullcalendar/react";
import daygridPlugin from "@fullcalendar/daygrid";
//import interactionPlugin from "@fullcalendar/interaction";
//import timeGridPlugin from "@fullcalendar/timegrid";
import allLocales from '@fullcalendar/core/locales-all'
import { RepeatOnRounded } from "@mui/icons-material";
import { alignPropType } from "react-bootstrap/esm/types";
import ToggleSwitch from "./ToggleSwitch";
import ToggleSwitch_v2_mysy from "./ToggleSwitch_v2_mysy";
import Autocomplete from '@mui/material/Autocomplete'; import Autocomplete from '@mui/material/Autocomplete';
import FullCalendar, { formatDate } from "@fullcalendar/react";
import dayGridPlugin from "@fullcalendar/daygrid";
import timeGridPlugin from "@fullcalendar/timegrid";
import interactionPlugin from "@fullcalendar/interaction";
import { FcSearch } from "react-icons/fc";
import { Fab } from "@material-ui/core";
import {
ListItem,
ListItemText,
useTheme,
} from "@mui/material";
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
import ChevronRightIcon from '@mui/icons-material/ChevronRight';
import { TreeView } from '@mui/x-tree-view/TreeView';
import { TreeItem } from '@mui/x-tree-view/TreeItem';
import { IoMdAddCircle, IoIosRemoveCircleOutline } from "react-icons/io";
import { FcViewDetails, FcDisapprove, FcInfo } from "react-icons/fc";
import { gridClasses } from '@mui/x-data-grid'; import { gridClasses } from '@mui/x-data-grid';
import Link from '@mui/material/Link'; import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi"; import { PiDotsThree } from "react-icons/pi";
@ -217,7 +172,6 @@ const Module_Attestation_Formation = (props) => {
] ]
const New_Option_attestation_Masse = [ const New_Option_attestation_Masse = [
{ "id": "resend", "label": "(R)envoyer", "value": "resend" }, { "id": "resend", "label": "(R)envoyer", "value": "resend" },
] ]
const [gridline_id, setgridline_id] = useState(""); const [gridline_id, setgridline_id] = useState("");
@ -440,12 +394,10 @@ const Module_Attestation_Formation = (props) => {
async function actionmass_ftion_Traitemet() { async function actionmass_ftion_Traitemet() {
if (String(actionmass_attesation_val) === String("reinit")) { if (String(actionmass_attesation_val) === String("reinit")) {
alert(" ### reinit"); alert(" ### reinit");
} }
else if (String(actionmass_attesation_val) === String("resend")) { else if (String(actionmass_attesation_val) === String("resend")) {
@ -716,76 +668,7 @@ const Module_Attestation_Formation = (props) => {
</div>} </div>}
{/*}
{String(selected_convention_type) === "email" && <div className="session_caract_Dialog" > Type Document<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, width: '75%' }}
name="event_dialog_type_convention"
id="event_dialog_type_convention"
value="email"
/>
{String(selected_convention_type) === "email" && <label className="bton_image_class" style={{ "width": "20%", "float": "right", "height": "3.5rem", "paddingTop": "15px" }} onClick={(e) => {
if (selected_convention_email_test) {
var validRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
if (!selected_convention_email_test.match(validRegex)) {
alert("L'adresse email de test est invalide.");
return;
}
// Send_Stagiaire_Conventions_By_Email_Test();
} else {
alert("L'adresse email de test est invalide.");
}
}} > <FcSearch /> &nbsp; Test</label>}
</div>}
{String(selected_convention_type) === "pdf" && <div className="session_caract_Dialog" > Type Document<br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 } }}
name="event_dialog_type_convention"
id="event_dialog_type_convention"
value="pdf"
fullWidth
/>
</div>}
*/}
{/*String(selected_convention_type) === "email" && <div className="session_caract_Dialog" >
<Tooltip className="tooltip_css" id="test01" style={{ "fontSize": "12px" }} />
<a data-tooltip-id="test01" data-tooltip-html="Pour recevoir une email de test avant de l'envoyer">
Adresse email de test <FcInfo /> <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
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);
}
}
/>
</a>
</div>*/
}
{String(selected_convention_type) === "pdf" && <div className="session_caract_Dialog" > Recevoir un pré-envoie {String(selected_convention_type) === "pdf" && <div className="session_caract_Dialog" > Recevoir un pré-envoie
<TextField <TextField
@ -801,48 +684,7 @@ const Module_Attestation_Formation = (props) => {
</div> </div>
} }
{/*
{String(selected_convention_type) === "email" &&
String(actionmass_ftion_val) !== String("convention") && <div className="session_caract_Dialog" > Email destinaitaire
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_email_production_convention"
id="event_dialog_email_production_convention"
fullWidth
value={selected_convention_email_destinataire_prod}
onChange={(e) => {
setselected_convention_email_destinataire_prod(e.target.value);
}
}
/>
</div>
}
{String(selected_convention_type) === "pdf" &&
String(actionmass_ftion_val) !== String("convention") && <div className="session_caract_Dialog" > Email destinaitaire
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_email_production_convention"
id="event_dialog_email_production_convention"
fullWidth
value=""
/>
</div>
}
*/}
</DialogContent> </DialogContent>
<DialogActions> <DialogActions>
@ -1058,7 +900,7 @@ const Module_Attestation_Formation = (props) => {
else if (parseInt(String(params.row.id)) % 2 !== 0) { else if (parseInt(String(params.row.id)) % 2 !== 0) {
return 'line--statut--impair'; return 'line--statut--impair';
} }
}} }}
getRowClassName={(params) => { getRowClassName={(params) => {
@ -1194,8 +1036,6 @@ const Module_Attestation_Formation = (props) => {
</div> </div>
</div> </div>
</div> </div>
) )
} }

View File

@ -0,0 +1,858 @@
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 CheckOut from "./CheckOut";
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 Popup from 'reactjs-popup'
import 'reactjs-popup/dist/index.css';
import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import Box from '@mui/material/Box';
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 { TransitionProps } from '@mui/material/transitions';
import img_loading_spin from "./../mysy_img/mysy_spin_loading.gif";
import Autocomplete from '@mui/material/Autocomplete';
import { gridClasses } from '@mui/x-data-grid';
import Link from '@mui/material/Link';
import { PiDotsThree } from "react-icons/pi";
const Module_Evaluation_Positionnement = (props) => {
const myconntected_employee_id = props.conntected_employee_id;
const [selected_employee_id, setselected_employee_id] = useState(props.conntected_employee_id);
const history = useHistory();
const [isLoading, setLoading] = useState();
const columns_q_position = [
{ field: 'id', headerName: 'id', hide: true },
{ field: '_id', headerName: '_id', hide: true },
{ field: 'Form. Code', headerName: 'form_code', minwidth: 200, flex: 1, hideable: true, resizable: true, },
{ field: 'email', headerName: 'email', minwidth: 200, flex: 1, hideable: true, resizable: true, },
{ field: 'nom', headerName: 'nom', minwidth: 200, flex: 1, hide: false, editable: true, },
{ field: 'prenom', headerName: 'prenom', minwidth: 200, flex: 1, hide: false, editable: false, },
{
field: 'status', headerName: 'Statut', width: 100, editable: false, flex: true,
valueFormatter: (params) => {
if (String(params.value) === "0")
return "Init";
else if (String(params.value) === "1")
return "Envoyé";
else if (String(params.value) === "2")
return "Répondu";
else
return " ?";
},
},
{
field: 'date_envoie', headerName: 'Date Envoi', width: 150, editable: false,
valueFormatter: (params) => {
return String(params.value).substring(0, 16)
},
},
{/*
field: "voir", headerName: 'voir',
renderCell: (cellValues) => {
return (
<Button
onClick={(event) => {
//handleClick_valide_emargement(event, cellValues);
}}
>
<FcApproval />
</Button>
);
}
*/ },
{/*
field: "envoyer", headerName: 'Envoyer',
renderCell: (cellValues) => {
return (
<Button
onClick={(event) => {
//handleClick_valide_emargement(event, cellValues);
}}
>
<FcApproval />
</Button>
);
}
*/},
]
const [Dialog_1_message, setDialog_1_message] = React.useState(false);
const [Dialog_1_open, setDialog_1_open] = React.useState(false);
function Dialog_1_handle_change_participant_session(message) {
setDialog_1_message(message);
setDialog_1_open(true);
}
const Dialog_1_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_1_handleClose_buton = () => {
setDialog_1_open(false);
};
function Close_Dialog_Detail_Event_open() {
setDialog_1_open(false);
}
const [Dialog_LIST_POSITION_QUESTION_open, setDialog_LIST_POSITION_QUESTION_open] = React.useState(false);
const Dialog_LIST_POSITION_QUESTION_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_LIST_POSITION_QUESTION_handleClose_buton = () => {
setDialog_LIST_POSITION_QUESTION_open(false);
};
const [selectionModel_q_position, setselectionModel_q_position] = React.useState([]);
const [Getall_Survey_Q_Positionnement_By_Session_api, setGetall_Survey_Q_Positionnement_By_Session_api] = useState();
const [Getall_Survey_Q_Positionnement_By_Session_message, setGetall_Survey_Q_Positionnement_By_Session_message] = useState();
const [Getall_Survey_Q_Positionnement_By_Session_result, setGetall_Survey_Q_Positionnement_By_Session_result] = useState([]);
function Getall_Survey_Q_Positionnement_By_Session(event) {
setselectionModel_q_position([])
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("session_id", props.related_collection_recid);
form.append("formulaire_type", "pos");
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Survey_with_filter/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
// console.log(" In Getall_Survey_Q_Positionnement_By_Session res.data.status = " + res.data.status);
console.log(" In Getall_Survey_Q_Positionnement_By_Session res.data.message r_class = " + res.data.message);
setGetall_Survey_Q_Positionnement_By_Session_api("true");
setGetall_Survey_Q_Positionnement_By_Session_result(res.data.message);
}
else {
setGetall_Survey_Q_Positionnement_By_Session_api("false");
setGetall_Survey_Q_Positionnement_By_Session_message(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Survey_Q_Positionnement_By_Session = ', error);
setGetall_Survey_Q_Positionnement_By_Session_api("false");
//setmyApimyApiMessage("")
})
}
useEffect(() => {
setselected_session_id(props.related_collection_recid);
Getall_Survey_Q_Positionnement_By_Session();
}, [])
const New_Option_Type_Document = [
{ "id": "email", "label": "Email", "value": "email" },
]
const [selected_formulaire_id, setselected_formulaire_id] = useState();
const [selected_formulaire_type, setselected_formulaire_type] = useState("");
const [New_Getall_Partner_Formulaires_with_Filter, setNew_Getall_Partner_Formulaires_with_Filter] = useState([]);
const [Getall_Partner_Formulaires_with_Filter_api, setGetall_Partner_Formulaires_with_Filter_api] = useState();
const [Getall_Partner_Formulaires_with_Filter_message, setGetall_Partner_Formulaires_with_Filter_message] = useState();
const [Getall_Partner_Formulaires_with_Filter_result, setGetall_Partner_Formulaires_with_Filter_result] = useState([]);
function Getall_Partner_Formulaires_with_Filter(event) {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("type", "pos");
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Formulaire_with_filter/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In Getall_Partner_Formulaires_with_Filter res.data.status = " + res.data.status);
//console.log(" In Getall_Partner_Formulaires_with_Filter res.data.message r_class = " + res.data.message);
setGetall_Partner_Formulaires_with_Filter_api("true");
setGetall_Partner_Formulaires_with_Filter_result(res.data.message);
var new_data2 = [];
const new_data = res.data.message.map((x) => {
//---
var localid = JSON.parse(x).id;
var local_id = JSON.parse(x)._id;
var local_code = JSON.parse(x).code;
var local_nom = JSON.parse(x).nom;
//---
var node = {
"_id": local_id,
"id": localid,
"label": local_code + " " + local_nom,
"nom": local_nom,
"code": local_code,
};
new_data2.push(node);
});
var node = {
"_id": "",
"id": "",
"label": "",
"nom": "",
"code": "",
};
new_data2.push(node);
if (new_data2.length > 0)
setNew_Getall_Partner_Formulaires_with_Filter(new_data2);
}
else {
setGetall_Partner_Formulaires_with_Filter_api("false");
setGetall_Partner_Formulaires_with_Filter_message(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Not good man :( Getall_Partner_Formulaires_with_Filter = ', error);
setGetall_Partner_Formulaires_with_Filter_api("false");
//setmyApimyApiMessage("")
})
}
const [gridline_id, setgridline_id] = useState("");
const [selected_session_id, setselected_session_id] = useState("");
const [Create_List_Survey_For_Session_For_Inscrit_api, setCreate_List_Survey_For_Session_For_Inscrit_api] = useState();
const [Create_List_Survey_For_Session_For_Inscrit_message, setCreate_List_Survey_For_Session_For_Inscrit_message] = useState();
const [Create_List_Survey_For_Session_For_Inscrit_result, setCreate_List_Survey_For_Session_For_Inscrit_result] = useState();
function Create_List_Survey_For_Session_For_Inscrit() {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("session_id", props.related_collection_recid);
form.append("formulaire_id", selected_formulaire_id);
form.append("survey_type", "pos");
//alert(" mysession = "+mysession); zzzz
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Init_Survey_Tab_For_All_Session_Inscrit/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In UpdateStagiaireData res.data.status = " + res.data.status);
//console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message);
setCreate_List_Survey_For_Session_For_Inscrit_api("true");
setCreate_List_Survey_For_Session_For_Inscrit_result(res.data.message);
Getall_Survey_Q_Positionnement_By_Session();
alert(res.data.message);
} else if (String(res.data.status) === String("Err_Connexion")) {
alert('Erreur: ' + res.data.message);
history.push("/Connexion");
}
else {
setCreate_List_Survey_For_Session_For_Inscrit_api("false");
setCreate_List_Survey_For_Session_For_Inscrit_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Create_List_Survey_For_Session_For_Inscrit : Not good man :( mysearchtext = ' + error);
setCreate_List_Survey_For_Session_For_Inscrit_api("false");
alert(" Impossible d'initialiser la liste des enquête de positionnement ");
})
}
const New_Option_q_position_Masse = [
{ "id": "resend", "label": "(R)envoyer", "value": "resend" },
]
const [actionmass_q_position_val, setactionmass_q_position_val] = useState();
async function actionmass_ftion_Traitemet() {
if (String(actionmass_q_position_val) === String("reinit")) {
alert(" ### reinit");
}
else if (String(actionmass_q_position_val) === String("resend")) {
var tab_ids_survey = []
for (var i = 0; i < selectionModel_q_position.length; i++) {
var myid = parseInt(String(selectionModel_q_position[i]));
var line = JSON.parse(Getall_Survey_Q_Positionnement_By_Session_result[myid]);
var line_id = JSON.parse(Getall_Survey_Q_Positionnement_By_Session_result[myid])._id;
tab_ids_survey.push(line_id);
}
console.log(" ### tab_ids_survey === ", tab_ids_survey);
Send_Survey_By_Email_For_Ids(tab_ids_survey);
}
}
const [Send_Survey_By_Email_For_Ids_api, setSend_Survey_By_Email_For_Ids_api] = useState();
const [Send_Survey_By_Email_For_Ids_message, setSend_Survey_By_Email_For_Ids_message] = useState();
const [Send_Survey_By_Email_For_Ids_result, setSend_Survey_By_Email_For_Ids_result] = useState();
function Send_Survey_By_Email_For_Ids(tab_survey) {
var form = new FormData();
//form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
form.append("tab_ids", tab_survey);
//alert(" mysession = "+mysession);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Send_Survey_TabIds/";
setLoading(true);
axios.post(myurl, form).then(res => {
setLoading(false);
if (String(res.data.status) === String("true")) {
//console.log(" In UpdateStagiaireData res.data.status = " + res.data.status);
//console.log(" In UpdateStagiaireData res.data.message r_class = " + res.data.message);
setSend_Survey_By_Email_For_Ids_api("true");
setSend_Survey_By_Email_For_Ids_result(res.data.message);
Getall_Survey_Q_Positionnement_By_Session();
setselectionModel_q_position([]);
alert(res.data.message);
} else if (String(res.data.status) === String("Err_Connexion")) {
alert('Erreur: ' + res.data.message);
history.push("/Connexion");
}
else {
setSend_Survey_By_Email_For_Ids_api("false");
setSend_Survey_By_Email_For_Ids_message(res.data.message);
alert(res.data.message);
}
}).catch((error) => {
setLoading(false);
console.warn('Send_Survey_By_Email_For_Ids : Not good man :( mysearchtext = ' + error);
setSend_Survey_By_Email_For_Ids_api("false");
alert(" Impossible d'envoyer les demandes");
})
}
return (
<div className="module_evaluation_positionnement">
{isLoading && <div className="loader-container">
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
</div>}
<Dialog
open={Dialog_1_open}
onClose={Dialog_1_handleClose}
className="module_agenda"
>
<DialogTitle>MySy Information</DialogTitle>
<DialogContent className="DialogContent_width">
<DialogContentText>
{Dialog_1_message}
</DialogContentText>
<div className="session_caract_Dialog" >
<nav style={{ "float": "left", "width": "30%", "paddingTop": "15px" }}> Action a traiter </nav>
</div>
<div className="session_caract_Dialog" > <b>Action a traiter </b>
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_title"
id="event_dialog_title"
fullWidth
value={"action_server_to_run"}
/>
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
<Button onClick={"Update_One_Agenda_Event"} className="bton_enreg_dialog">Mettre à jour</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Close_Dialog_Detail_Event_open} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
{/* Dialog pour gerer les LIST_POSITION_QUESTION */}
<Dialog
open={Dialog_LIST_POSITION_QUESTION_open}
onClose={Dialog_LIST_POSITION_QUESTION_handleClose}
className="displaypartnersession"
>
<DialogTitle>MySy Information</DialogTitle>
<DialogContent className="DialogContent_width" style={{ "minHeight": "30rem" }}>
<DialogContentText>
{Dialog_1_message}
</DialogContentText>
<div className="session_caract_Dialog" > Choisir un questionnaire de positionnement
<Autocomplete
disablePortal
name="event_dialog_version_q_position"
id="event_dialog_version_q_position"
fullWidth
//className="disabled_style enable_style"
options={New_Getall_Partner_Formulaires_with_Filter}
onChange={(event, value) => {
if (value && value._id) {
setselected_formulaire_id(value._id);
} else {
setselected_formulaire_id("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>
</DialogContent>
<DialogActions>
<div className="div_row">
<div className="div_row_gauche">
<Button onClick={(e) => {
var tab_ids_inscription = []
for (var i = 0; i < selectionModel_q_position.length; i++) {
var myid = parseInt(String(selectionModel_q_position[i]));
var line = JSON.parse(selectionModel_q_position[myid]);
var line_id = JSON.parse(selectionModel_q_position[myid])._id;
tab_ids_inscription.push(line_id);
}
Create_List_Survey_For_Session_For_Inscrit();
Dialog_LIST_POSITION_QUESTION_handleClose_buton();
}}
className="bton_enreg_dialog">Initialiser la liste </Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_LIST_POSITION_QUESTION_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
{/* FIN Dialog pour gerer les LIST_POSITION_QUESTION */}
<div>
<div className="div_row" style={{ "textAlign": "right", "marginTop": "0.5rem" }}>
<Popup
trigger={
<Button className="bton_emarge">Initialiser le questionnaire</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">
{' '}
<font> Confirmez la ()initialisation l'enquête. <br />
<font color="red"> /!\ Si une enquête de positionnement existe pour cette session, elle sera supprimée et récréée </font>
</font>
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
Getall_Partner_Formulaires_with_Filter();
setDialog_LIST_POSITION_QUESTION_open(true);
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>
<Button className="bton_emarge" onClick={(event) => {
Getall_Survey_Q_Positionnement_By_Session();
}}>Actualiser la liste</Button><br />
</div>
<div className="session_data">
<div style={{ "border": "None", marginLeft: '5px', marginRight: '5px' }}>
<div style={{ height: 550, width: '100%', paddingRight: '5px' }}>
&nbsp;
<Box
sx={{
height: 500,
width: '100%',
paddingRight: '1px',
"& .MuiDataGrid-columnHeaders": {
backgroundColor: "#c8cfd5",
color: "black",
fontSize: 14
},
'& .line--statut--selected': {
backgroundColor: '#FBF2EF',
color: 'black',
},
'& .line--statut--pair': {
backgroundColor: 'rgba(235, 235, 235, .7)',
color: 'black',
},
[`& .${gridClasses.cell}`]: {
py: 1,
},
'& .line--attestion_envoye': {
backgroundColor: '#ccffcc',
color: 'black',
fontWeight: '600',
},
}}
>
<DataGrid
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
setselectionModel_q_position(newSelectionModel);
/*if (newSelectionModel.length === 1)
handleClick_edit_session_From_Line(newSelectionModel);*/
if (newSelectionModel.length !== 1) {
}
}}
selectionModel={selectionModel_q_position}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={Getall_Survey_Q_Positionnement_By_Session_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
email: JSON.parse(item).email,
nom: JSON.parse(item).nom,
prenom: JSON.parse(item).prenom,
status: JSON.parse(item).statut,
form_code: JSON.parse(item).formulaire.description,
}
))}
columns={columns_q_position}
pageSize={10}
className="datagridclass"
onRowDoubleClick={(newSelectionModel) => {
}}
rowsPerPageOptions={[10]}
disableSelectionOnClick
components={{
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(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';
}
}}
getRowClassName={(params) => {
if (String(params.row.status) === "1") {
return 'line--attestion_envoye';
}
// 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"}
sx={{
"& .MuiDataGrid-cellContent": {
minHeight: 50,
},
[`& .${gridClasses.cell}`]: {
py: 1,
},
}}
/>
</Box>
<br />
</div>
<div className="div_row">
{selectionModel_q_position && selectionModel_q_position.length >= 1 && <div className="block_en_mass">
<nav >Traitement en masse </nav>
&nbsp;
<Autocomplete
disablePortal
id="combo-box-demo"
className="block_en_mass_select"
fullWidth
options={New_Option_q_position_Masse}
onChange={(event, value) => {
if (value && value.value) {
if (String(value.value) === "reinit" || String(value.value) === "resend") {
setactionmass_q_position_val(value.value);
}
else {
setactionmass_q_position_val("");
}
}
}}
renderInput={(params) => <TextField {...params} placeholder="Choisir une option" />
}
/>
{actionmass_q_position_val && <nav className='block_en_mass_bton_action'>
<Popup
trigger={<Button className="bton_enreg" style={{ "width": "90%" }}>
<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">
{' '}
{String(actionmass_q_position_val) === "resend" &&
<font color="red"> Confirmer l'envoi de en masse de {selectionModel_q_position.length} attestation(s) de formation.
</font>}
</div>
<div className="gest_actions">
<div style={{ "width": "45%", "float": "left" }}>
<button className="gest_bton_popup" onClick={(event) => {
actionmass_ftion_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>
</nav>
}
</div>}
</div>
</div>
</div>
</div>
</div>
)
}
export default Module_Evaluation_Positionnement;

View File

@ -72,6 +72,7 @@ const Partner_Config_Formulaires = (props) => {
{ field: 'id', headerName: 'id', hide: true }, { field: 'id', headerName: 'id', hide: true },
{ field: 'code', headerName: 'code', flex: 1, hide: false, editable: false }, { field: 'code', headerName: 'code', flex: 1, hide: false, editable: false },
{ field: 'nom', headerName: 'nom', flex: 1, hide: false, editable: false }, { field: 'nom', headerName: 'nom', flex: 1, hide: false, editable: false },
{ field: 'type', headerName: 'Type', flex: 1, hide: false, editable: false },
{ field: 'description', headerName: 'description', flex: 1, hide: true, editable: false }, { field: 'description', headerName: 'description', flex: 1, hide: true, editable: false },
{ field: 'commentaire', headerName: 'commentaire', flex: 1, hide: true, editable: false }, { field: 'commentaire', headerName: 'commentaire', flex: 1, hide: true, editable: false },
@ -438,12 +439,18 @@ const Partner_Config_Formulaires = (props) => {
const [p_detail_from_commentaire, setp_detail_from_commentaire] = useState(""); const [p_detail_from_commentaire, setp_detail_from_commentaire] = useState("");
const [p_detail_from_list_question, setp_detail_from_list_question] = useState([]); const [p_detail_from_list_question, setp_detail_from_list_question] = useState([]);
const [p_detail_from_message_intro, setp_detail_from_message_intro] = useState("");
const [p_detail_from_type, setp_detail_from_type] = useState("");
const [p_detail_one_from_code, setp_detail_one_from_code] = useState(""); const [p_detail_one_from_code, setp_detail_one_from_code] = useState("");
const [p_detail_one_from_nom, setp_detail_one_from_nom] = useState(""); const [p_detail_one_from_nom, setp_detail_one_from_nom] = useState("");
const [p_detail_one_from_description, setp_detail_one_from_description] = useState(""); const [p_detail_one_from_description, setp_detail_one_from_description] = useState("");
const [p_detail_one_from_commentaire, setp_detail_one_from_commentaire] = useState(""); const [p_detail_one_from_commentaire, setp_detail_one_from_commentaire] = useState("");
const [p_detail_one_from_list_question, setp_detail_one_from_list_question] = useState([]); const [p_detail_one_from_list_question, setp_detail_one_from_list_question] = useState([]);
const [p_detail_one_from_message_intro, setp_detail_one_from_message_intro] = useState("");
const [p_detail_one_from_type, setp_detail_one_from_type] = useState("");
const [add_new_form, setadd_new_form] = useState(""); const [add_new_form, setadd_new_form] = useState("");
const [display_form, setdisplay_form] = useState(""); const [display_form, setdisplay_form] = useState("");
@ -484,6 +491,10 @@ const Partner_Config_Formulaires = (props) => {
if (mylocal_form_data.code) if (mylocal_form_data.code)
setp_detail_from_code(mylocal_form_data.code); setp_detail_from_code(mylocal_form_data.code);
setp_detail_from_type("");
if (mylocal_form_data.type)
setp_detail_from_type(mylocal_form_data.type);
setp_detail_from_nom(""); setp_detail_from_nom("");
if (mylocal_form_data.nom) if (mylocal_form_data.nom)
setp_detail_from_nom(mylocal_form_data.nom); setp_detail_from_nom(mylocal_form_data.nom);
@ -496,6 +507,11 @@ const Partner_Config_Formulaires = (props) => {
if (mylocal_form_data.commentaire) if (mylocal_form_data.commentaire)
setp_detail_from_commentaire(mylocal_form_data.commentaire); setp_detail_from_commentaire(mylocal_form_data.commentaire);
setp_detail_from_message_intro("");
if (mylocal_form_data.message_introduction)
setp_detail_from_message_intro(mylocal_form_data.message_introduction);
setp_detail_from_list_question([]); setp_detail_from_list_question([]);
if (mylocal_form_data.list_questions) { if (mylocal_form_data.list_questions) {
setp_detail_from_list_question(mylocal_form_data.list_questions); setp_detail_from_list_question(mylocal_form_data.list_questions);
@ -535,6 +551,12 @@ const Partner_Config_Formulaires = (props) => {
document.getElementsByName("detail_config_code")[0].style.backgroundColor = "#ECEFF1"; document.getElementsByName("detail_config_code")[0].style.backgroundColor = "#ECEFF1";
} }
if (document.getElementsByName("detail_config_type") && document.getElementsByName("detail_config_type")[0]) {
document.getElementsByName("detail_config_type")[0].disabled = true;
document.getElementsByName("detail_config_type")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("detail_config_nom") && document.getElementsByName("detail_config_nom")[0]) { if (document.getElementsByName("detail_config_nom") && document.getElementsByName("detail_config_nom")[0]) {
document.getElementsByName("detail_config_nom")[0].disabled = true; document.getElementsByName("detail_config_nom")[0].disabled = true;
document.getElementsByName("detail_config_nom")[0].style.backgroundColor = "#ECEFF1"; document.getElementsByName("detail_config_nom")[0].style.backgroundColor = "#ECEFF1";
@ -550,6 +572,11 @@ const Partner_Config_Formulaires = (props) => {
document.getElementsByName("detail_config_commentaire")[0].disabled = true; document.getElementsByName("detail_config_commentaire")[0].disabled = true;
document.getElementsByName("detail_config_commentaire")[0].style.backgroundColor = "#ECEFF1"; document.getElementsByName("detail_config_commentaire")[0].style.backgroundColor = "#ECEFF1";
} }
if (document.getElementsByName("detail_config_message_intro") && document.getElementsByName("detail_config_message_intro")[0]) {
document.getElementsByName("detail_config_message_intro")[0].disabled = true;
document.getElementsByName("detail_config_message_intro")[0].style.backgroundColor = "#ECEFF1";
}
} }
@ -562,6 +589,12 @@ const Partner_Config_Formulaires = (props) => {
document.getElementsByName("detail_config_code")[0].style.backgroundColor = "#FFFFFF"; document.getElementsByName("detail_config_code")[0].style.backgroundColor = "#FFFFFF";
} }
if (document.getElementsByName("detail_config_type") && document.getElementsByName("detail_config_type")[0]) {
document.getElementsByName("detail_config_type")[0].disabled = false;
document.getElementsByName("detail_config_type")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("detail_config_nom") && document.getElementsByName("detail_config_nom")[0]) { if (document.getElementsByName("detail_config_nom") && document.getElementsByName("detail_config_nom")[0]) {
document.getElementsByName("detail_config_nom")[0].disabled = false; document.getElementsByName("detail_config_nom")[0].disabled = false;
document.getElementsByName("detail_config_nom")[0].style.backgroundColor = "#FFFFFF"; document.getElementsByName("detail_config_nom")[0].style.backgroundColor = "#FFFFFF";
@ -577,6 +610,11 @@ const Partner_Config_Formulaires = (props) => {
document.getElementsByName("detail_config_commentaire")[0].disabled = false; document.getElementsByName("detail_config_commentaire")[0].disabled = false;
document.getElementsByName("detail_config_commentaire")[0].style.backgroundColor = "#FFFFFF"; document.getElementsByName("detail_config_commentaire")[0].style.backgroundColor = "#FFFFFF";
} }
if (document.getElementsByName("detail_config_message_intro") && document.getElementsByName("detail_config_message_intro")[0]) {
document.getElementsByName("detail_config_message_intro")[0].disabled = false;
document.getElementsByName("detail_config_message_intro")[0].style.backgroundColor = "#FFFFFF";
}
} }
@ -655,10 +693,14 @@ const Partner_Config_Formulaires = (props) => {
{ "id": "entier", "label": "Entier", "value": "entier" }, { "id": "entier", "label": "Entier", "value": "entier" },
{ "id": "qcm", "label": "QCM", "value": "qcm" }, { "id": "qcm", "label": "QCM", "value": "qcm" },
{ "id": "", "label": "", "value": "" }, { "id": "", "label": "", "value": "" },
] ]
const New_Option_type_Formulaire = [
{ "id": "pos", "label": "Q. Positionnement", "value": "pos" },
{ "id": "hot_eval", "label": "Eval. Chaud ", "value": "hot_eval" },
{ "id": "cool_eval", "label": "Eval. Froid", "value": "cool_eval" },
{ "id": "", "label": "", "value": "" },
]
function annule_edit_formulaire() { function annule_edit_formulaire() {
clear_detail_field(); clear_detail_field();
@ -685,6 +727,9 @@ const Partner_Config_Formulaires = (props) => {
form.append("nom", p_detail_from_nom); form.append("nom", p_detail_from_nom);
form.append("description", p_detail_from_description); form.append("description", p_detail_from_description);
form.append("commentaire", p_detail_from_commentaire); form.append("commentaire", p_detail_from_commentaire);
form.append("message_introduction", p_detail_from_message_intro);
form.append("type", p_detail_from_type);
form.append("form_id", selected_id); form.append("form_id", selected_id);
//console.log(" form == ", form); //console.log(" form == ", form);
@ -807,6 +852,8 @@ const Partner_Config_Formulaires = (props) => {
form.append("nom", p_detail_one_from_nom); form.append("nom", p_detail_one_from_nom);
form.append("description", p_detail_one_from_description); form.append("description", p_detail_one_from_description);
form.append("commentaire", p_detail_one_from_commentaire); form.append("commentaire", p_detail_one_from_commentaire);
form.append("message_introduction", p_detail_one_from_message_intro);
form.append("type", p_detail_one_from_type);
//console.log(" form == ", form); //console.log(" form == ", form);
@ -1494,6 +1541,7 @@ const Partner_Config_Formulaires = (props) => {
nom: JSON.parse(item).nom, nom: JSON.parse(item).nom,
description: JSON.parse(item).description, description: JSON.parse(item).description,
commentaire: JSON.parse(item).commentaire, commentaire: JSON.parse(item).commentaire,
type: JSON.parse(item).type,
} }
))} ))}
@ -1614,7 +1662,25 @@ const Partner_Config_Formulaires = (props) => {
value={p_detail_from_code} value={p_detail_from_code}
/> />
</div> </div>
{ New_Option_type_Formulaire.length > 0 && <div className="session_caract"> Type <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_config_type"
id="detail_config_type"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={New_Option_type_Formulaire.filter((data) => (data).value === String(p_detail_from_type))[0].label}
/>
</div>}
<div className="session_caract"> Nom <br /> <div className="session_caract"> Nom <br />
@ -1649,6 +1715,23 @@ const Partner_Config_Formulaires = (props) => {
/> />
</div> </div>
<div className="session_caract"> Message d'introduction <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_config_message_intro"
id="detail_config_message_intro"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_from_message_intro}
/>
</div>
<div className="session_caract"> Commentaire <br /> <div className="session_caract"> Commentaire <br />
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
@ -1814,6 +1897,32 @@ const Partner_Config_Formulaires = (props) => {
</div> </div>
{String(form_edit_mode) === "1" && New_Option_type_Formulaire.length > 0 && <div className="session_caract"> Type <br />
<Autocomplete
disablePortal
name="detail_config_type"
id="detail_config_type"
className="disabled_style"
options={New_Option_type_Formulaire}
value={New_Option_type_Formulaire.filter((data) => (data).value === String(p_detail_from_type))[0].label}
onChange={(event, value) => {
setconfig_data_changed("1");
if (value && value.value) {
setp_detail_from_type(value.value);
} else {
setp_detail_from_type("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>}
<div className="session_caract"> Nom <br /> <div className="session_caract"> Nom <br />
<TextField <TextField
@ -1855,6 +1964,28 @@ const Partner_Config_Formulaires = (props) => {
/> />
</div> </div>
<div className="session_caract"> Message d'introduction <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_config_message_intro"
id="detail_config_message_intro"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_from_message_intro}
onChange={(e) => {
setp_detail_from_message_intro(e.target.value);
setconfig_data_changed("1");
}}
multiline={true}
rows={2}
/>
</div>
<div className="session_caract"> Commentaire <br /> <div className="session_caract"> Commentaire <br />
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
@ -2042,6 +2173,31 @@ const Partner_Config_Formulaires = (props) => {
/> />
</div> </div>
{New_Option_type_Formulaire && <div className="session_caract"> Type <br />
<Autocomplete
disablePortal
name="detail_config_type"
id="detail_config_type"
className="disabled_style"
options={New_Option_type_Formulaire}
value={New_Option_type_Formulaire.filter((data) => (data).value === String(p_detail_one_from_type))[0].label}
onChange={(event, value) => {
if (value && value.value) {
setp_detail_one_from_type(value.value);
} else {
setp_detail_one_from_type("");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
</div>}
<div className="session_caract"> Nom <br /> <div className="session_caract"> Nom <br />
@ -2084,6 +2240,27 @@ const Partner_Config_Formulaires = (props) => {
/> />
</div> </div>
<div className="session_caract"> Message d'introduction <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="detail_config_message_intro"
id="detail_config_message_intro"
InputLabelProps={{
shrink: true,
}}
disabled={false}
className="disabled_style"
value={p_detail_one_from_message_intro}
onChange={(e) => {
setp_detail_one_from_message_intro(e.target.value);
}}
/>
</div>
<div className="session_caract"> Commentaire <br /> <div className="session_caract"> Commentaire <br />
<TextField <TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }} sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}

View File

@ -119,7 +119,7 @@ function SurveyDocument() {
setLoading(false); setLoading(false);
console.warn('get_Given_Survey_Data ee: Not good man :( = ', error); console.warn('get_Given_Survey_Data ee: Not good man :( = ', error);
setget_Given_Survey_Data_api("false"); setget_Given_Survey_Data_api("false");
get_Given_Survey_Data_message(" Impossible de recuperer les données") setget_Given_Survey_Data_message(" Impossible de recuperer les données")
}) })
} }
@ -144,7 +144,7 @@ function SurveyDocument() {
var form = new FormData(); var form = new FormData();
const myJSON = JSON.stringify(tab_variable); const myJSON = JSON.stringify(tab_variable);
form.append("survey_id", survey_id); form.append("survey_id", survey_id);
form.append("list_response", myJSON); form.append("list_response", myJSON);
@ -204,6 +204,9 @@ function SurveyDocument() {
<Header /> <Header />
<div className="div_row">
&nbsp;
</div>
{String(get_Given_Survey_Data_api) === "true" && <div style={{ "textAlign": "left", }}> {String(get_Given_Survey_Data_api) === "true" && <div style={{ "textAlign": "left", }}>
@ -223,7 +226,7 @@ function SurveyDocument() {
<div> <div>
<div className="question_box"> <div className="question_box">
{question.question} <br /> {question.question} <br />
{question.type && String(question.type) === "text" && {question.type && String(question.type) === "text" &&
@ -274,7 +277,7 @@ function SurveyDocument() {
{question.type && String(question.type) === "bool" && {question.type && String(question.type) === "bool" &&
<div> <div>
<FormControl> <FormControl>
<RadioGroup <RadioGroup
row row
aria-labelledby="demo-row-radio-buttons-group-label" aria-labelledby="demo-row-radio-buttons-group-label"

File diff suppressed because it is too large Load Diff