02/08/2024 - 12h

recette2
cherif 2024-08-02 12:08:03 +02:00
parent 158f3d0247
commit 1aa9027239
6 changed files with 547 additions and 46 deletions

View File

@ -4996,7 +4996,7 @@ const DisplayPartnerSession = (props) => {
if (String(res.data.status) === "true") {
//console.log(" In GetCurrentSession res.data.status = " + res.data.status);
console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message);
//console.log(" In GetCurrentSession res.data.message r_class = " + res.data.message);
//console.log(" In GetCurrentSession res.data.message len = " + String(res.data.message).length);
setLoading(false);
@ -19873,8 +19873,6 @@ const DisplayPartnerSession = (props) => {
/>
</div>}
{String(submenu) === String("evaluation") &&

View File

@ -76,6 +76,23 @@ const DisplayPartnerUnite_Enseignement = (props) => {
{ field: 'id', headerName: 'id', hide: true },
{ field: 'code', headerName: 'Code', flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'titre', headerName: 'Titre', flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'bloc', headerName: 'Bloc', flex: 1, hide: true, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'domain_id', headerName: 'Domaine', flex: 1, hide: false, editable: false, renderCell: (cellValues) => {
return (
<div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
{New_Get_List_Domaines_result && New_Get_List_Domaines_result.length > 0 && <nav>
{New_Get_List_Domaines_result.filter((data) => (data)._id === String(cellValues.row.domain_id))[0].label}
</nav>}
</div>
);
}
},
{ field: 'duration_concat', headerName: 'Durée', flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'duration', headerName: 'Durée', flex: 1, hide: true, editable: false },
{ field: 'duration_unite', headerName: 'Unit.', flex: 1, hide: true, editable: false },
@ -404,6 +421,18 @@ const DisplayPartnerUnite_Enseignement = (props) => {
setp_detail_code("");
}
if (local_ue.domain_id) {
setp_detail_domaine(local_ue.domain_id);
} else {
setp_detail_domaine("");
}
if (local_ue.bloc) {
setp_detail_bloc(local_ue.bloc);
} else {
setp_detail_bloc("");
}
if (local_ue.titre) {
setp_detail_titre(local_ue.titre);
} else {
@ -557,6 +586,16 @@ const DisplayPartnerUnite_Enseignement = (props) => {
document.getElementsByName("unit_duree")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("domaine") && document.getElementsByName("domaine")[0]) {
document.getElementsByName("domaine")[0].disabled = true;
document.getElementsByName("domaine")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementsByName("bloc") && document.getElementsByName("bloc")[0]) {
document.getElementsByName("bloc")[0].disabled = true;
document.getElementsByName("bloc")[0].style.backgroundColor = "#ECEFF1";
}
}
@ -580,11 +619,22 @@ const DisplayPartnerUnite_Enseignement = (props) => {
document.getElementsByName("description")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("domaine") && document.getElementsByName("domaine")[0]) {
document.getElementsByName("domaine")[0].disabled = false;
document.getElementsByName("domaine")[0].style.backgroundColor = "#FFFFFF";
}
if (document.getElementsByName("bloc") && document.getElementsByName("bloc")[0]) {
document.getElementsByName("bloc")[0].disabled = false;
document.getElementsByName("bloc")[0].style.backgroundColor = "#FFFFFF";
}
}
useEffect(() => {
Get_List_Domaines();
Getall_Parter_Unite_Enseignement();
@ -613,6 +663,8 @@ const DisplayPartnerUnite_Enseignement = (props) => {
setfield_objectif("");
setfield_programme("");
setfield_preprequis("");
setp_detail_domaine("");
setp_detail_bloc("");
}
@ -631,6 +683,9 @@ const DisplayPartnerUnite_Enseignement = (props) => {
form.append("code", p_detail_code);
form.append("titre", p_detail_titre);
form.append("domain_id", p_detail_domaine);
form.append("bloc", p_detail_bloc);
form.append("duration", p_detail_duration);
form.append("duration_unite", p_detail_duration_unite);
@ -779,6 +834,11 @@ const DisplayPartnerUnite_Enseignement = (props) => {
const [p_detail_code, setp_detail_code] = useState("");
const [p_detail_titre, setp_detail_titre] = useState("");
const [p_detail_bloc, setp_detail_bloc] = useState("");
const [p_detail_domaine, setp_detail_domaine] = useState("");
const [p_detail_support, setp_detail_support] = useState("");
const [p_detail_duration, setp_detail_duration] = useState("");
const [p_detail_duration_unite, setp_detail_duration_unite] = useState("");
@ -872,6 +932,86 @@ const DisplayPartnerUnite_Enseignement = (props) => {
{ "id": "1", "label": "", "value": "1" }, // Cette ligne pour couvrir l'ajout d'une ligne de filter. C'est fait expres.
]
const [New_Get_List_Domaines_result, setNew_Get_List_Domaines_result] = useState([]);
const [Get_List_Domaines_api, setGet_List_Domaines_api] = useState();
const [Get_List_Domaines_message, setGet_List_Domaines_message] = useState();
const [Get_List_Domaines_result, setGet_List_Domaines_result] = useState();
function Get_List_Domaines() {
var form = new FormData();
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Class_domaine/";
fetch(myurl,
{
method: 'POST',
body: form,
})
.then((data) => data.json())
.then((data) => {
//console.log(' IN Get_List_Domaines Success:', data['message'], "data['status'] = ", data['status']);
if (String(data['status']) === String("true")) {
setGet_List_Domaines_api("true");
setGet_List_Domaines_result(data['message']);
var new_data2 = [];
const new_data = 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": localid,
"_id": local_id,
"nom": local_nom,
"code": local_code,
"label": local_nom,
};
new_data2.push(node);
});
var node = {
"id": "",
"_id": "",
"nom": "",
"code": "",
"label": "",
};
new_data2.push(node);
if (new_data2.length > 0) {
setNew_Get_List_Domaines_result(new_data2);
// console.log(" ## new_data2 = ", new_data2);
// console.log(" ## New_Get_List_Domaines_result = ", New_Get_List_Domaines_result);
} else {
setNew_Get_List_Domaines_result([])
}
}
else {
setGet_List_Domaines_api("false");
setGet_List_Domaines_message(data['message']);
}
}).catch((error) => {
console.error('Error Get_List_Domaines :', error);
setGet_List_Domaines_api("false");
});
}
return (
<div className="displayPartnerunite_enseignement">
@ -1243,6 +1383,9 @@ const DisplayPartnerUnite_Enseignement = (props) => {
duration: JSON.parse(item).duration_concat,
duration_unite: JSON.parse(item).duration_unite,
domain_id: JSON.parse(item).domain_id,
bloc: JSON.parse(item).bloc,
}
))}
@ -1368,6 +1511,72 @@ const DisplayPartnerUnite_Enseignement = (props) => {
/>
</div>
<div className="session_caract"><b> Bloc </b><br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="block"
id="block"
InputLabelProps={{
shrink: true,
}}
//disabled={true}
className="disabled_style"
value={p_detail_bloc}
onChange={(e) => setp_detail_bloc(e.target.value)}
/>
</div>
{ue_data_edit_mode && String(ue_data_edit_mode) === "1" &&
New_Get_List_Domaines_result && New_Get_List_Domaines_result.length > 0 && <div className="training_caract">Domaine <br />
<Autocomplete
disablePortal
name="domaine"
id="domaine"
className="disabled_style"
options={New_Get_List_Domaines_result}
value={New_Get_List_Domaines_result.filter((data) => (data)._id === String(p_detail_domaine))[0].label}
onChange={(event, value) => {
if (value && value._id) {
setp_detail_domaine(value._id);
} else {
setp_detail_domaine("");
}
}}
renderInput={(params) => <TextField {...params} label="Domaine" />
}
/>
</div>}
{ue_data_edit_mode && String(ue_data_edit_mode) !== "1" &&
New_Get_List_Domaines_result && New_Get_List_Domaines_result.length > 0 && <div className="training_caract">Domaine <br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="unit_duree"
id="unit_duree"
InputLabelProps={{
shrink: true,
}}
//disabled={true}
className="disabled_style"
value={New_Get_List_Domaines_result.filter((data) => (data)._id === String(p_detail_domaine))[0].label}
/>
</div>}
{ue_data_edit_mode && String(ue_data_edit_mode) !== "1" && <div>
<div className="session_caract"> Durée <br />
<TextField
@ -1459,7 +1668,7 @@ const DisplayPartnerUnite_Enseignement = (props) => {
<div className="training_data">
<div className="training_text" style={{border:"1px solid"}} >
<div className="training_text" style={{ border: "1px solid" }} >
<div className="plus_produit_desabled">
<div className="titre_training_text"> Pré-requis (max 1000 caractères) </div>
<Editor
@ -1533,7 +1742,7 @@ const DisplayPartnerUnite_Enseignement = (props) => {
</div>
</div>
<div className="training_text" style= {{border:"1px solid"}} >
<div className="training_text" style={{ border: "1px solid" }} >
<div className="plus_produit_desabled">
<div className="titre_training_text"> Objectif (max 1000 caractères) </div>
<Editor
@ -1815,6 +2024,49 @@ const DisplayPartnerUnite_Enseignement = (props) => {
/>
</div>
<div className="session_caract"><b> Bloc </b><br />
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
required
name="bloc"
id="bloc"
InputLabelProps={{
shrink: true,
}}
//disabled={true}
className="disabled_style"
value={p_detail_bloc}
onChange={(e) => setp_detail_bloc(e.target.value)}
/>
</div>
{New_Get_List_Domaines_result && New_Get_List_Domaines_result.length > 0 && <div className="training_caract"> Domaine <br />
<Autocomplete
disablePortal
name="domaine"
id="domaine"
className="disabled_style"
options={New_Get_List_Domaines_result}
value={New_Get_List_Domaines_result.filter((data) => (data)._id === String(p_detail_domaine))[0].label}
onChange={(event, value) => {
if (value && value._id) {
setp_detail_domaine(value._id);
} else {
setp_detail_domaine("");
}
}}
renderInput={(params) => <TextField {...params} label="Domaine" />
}
/>
</div>}
<div>
<div className="session_caract"> Unité Durée <br />
@ -1940,7 +2192,7 @@ const DisplayPartnerUnite_Enseignement = (props) => {
</div>
</div>
<div className="training_text" style= {{border:"1px solid"}} >
<div className="training_text" style={{ border: "1px solid" }} >
<div className="plus_produit_desabled">
<div className="titre_training_text"> Objectif (max 1000 caractères) </div>
<Editor
@ -1972,7 +2224,7 @@ const DisplayPartnerUnite_Enseignement = (props) => {
</div>
<div className="training_text" style= {{border:"1px solid"}} >
<div className="training_text" style={{ border: "1px solid" }} >
<div className="plus_produit_desabled">
<div className="titre_training_text"> Programme (max 1000 caractères) </div>
<Editor

View File

@ -58,6 +58,8 @@ import Module_Selection_Evaluation_Apprenants from "./Module_Selection_Evaluatio
import AttachFileIcon from '@mui/icons-material/AttachFile';
import Module_Selection_Apprenants from "./Module_Selection_Apprenants";
import { FcAlarmClock, FcMultipleSmartphones, FcWorkflow } from "react-icons/fc";
const Groupe_Apprenant = (props) => {
const history = useHistory();
const [submenu, setsubmenu] = useState("");
@ -1773,6 +1775,25 @@ const Groupe_Apprenant = (props) => {
{ "id": "", "label": "", "value": "" },
]
const [Dialog_GRP_AUTOMATIC_message, setDialog_GRP_AUTOMATIC_message] = React.useState(false);
const [Dialog_GRP_AUTOMATIC_open, setDialog_GRP_AUTOMATIC_open] = React.useState(false);
const Dialog_GRP_AUTOMATIC_handleClose = () => {
//alert(" Utiliser le bouton 'fermer' ");
//setOpen(false);
};
const Dialog_GRP_AUTOMATIC_handleClose_buton = () => {
setDialog_GRP_AUTOMATIC_open(false);
};
const New_Option_Groupe_By = [
{ "id": "0", "label": "Ordre Alphabétique (nom)", "value": "0" },
{ "id": "1", "label": "Aléatoire", "value": "2" },
]
return (
<div className="groupe_apprenant">
@ -1780,6 +1801,193 @@ const Groupe_Apprenant = (props) => {
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
</div>}
{/*** Dialog GROUPE AUTOMATIC */}
<Dialog
open={Dialog_GRP_AUTOMATIC_open}
// onClose={Dialog_GRP_AUTOMATIC_handleClose}
className="displaypartnersession"
static
onClose={() => null}
>
<DialogTitle> Création automatique des groupes </DialogTitle>
<DialogContent className="DialogContent_width">
<DialogContentText>
</DialogContentText>
<div className="session_caract_Dialog" > <b> Nombre de Groupe </b>
<TextField
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
name="event_dialog_nb_grp"
id="event_dialog_nb_grp"
type="number"
fullWidth
inputProps={{ min: "1", max: "99", step: "1" }}
onChange={(e) => {
}
}
/>
</div>
<div className="session_caract_Dialog" > <b> Créer groupe par </b>
<Autocomplete
disablePortal
name="event_dialog_type_ressource"
id="event_dialog_type_ressource"
fullWidth
options={New_Option_Groupe_By}
onChange={(event, value) => {
}}
renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
}
/>
</div>
<div className="session_caract_Dialog" > <b>Formation </b> <br />
{New_Getall_Partner_Class_Reduice_Fields_result && New_Getall_Partner_Class_Reduice_Fields_result.length > 0 &&
<Autocomplete
disablePortal
name="detail_ftion"
id="detail_ftion"
//className="disabled_style"
fullWidth
//className="disabled_style enable_style"
options={New_Getall_Partner_Class_Reduice_Fields_result}
value={New_Getall_Partner_Class_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_class_id))[0].label}
onChange={(event, value) => {
if (value && value._id) {
setp_detail_class_id(value._id);
setp_detail_class_internal_url(value.internal_url);
setgrp_apprenant_data_changed("1");
} else {
setp_detail_class_id("");
setp_detail_class_internal_url("");
setgrp_apprenant_data_changed("1");
}
setp_detail_session_id("");
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
}
</div>
<div className="session_caract_Dialog" ><b> Classe </b> <br />
{New_Getall_Partner_Session_Reduice_Fields_result && New_Getall_Partner_Session_Reduice_Fields_result.length > 0 &&
<Autocomplete
disablePortal
name="detail_classe"
id="detail_classe"
fullWidth
options={New_Getall_Partner_Session_Reduice_Fields_result.filter((data) => (data).class_internal_url === String(p_detail_class_internal_url))}
value={New_Getall_Partner_Session_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_session_id))[0].label}
onChange={(event, value) => {
if (value && value._id) {
setp_detail_session_id(value._id);
setgrp_apprenant_data_changed("1");
} else {
setp_detail_session_id("");
setgrp_apprenant_data_changed("1");
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une option"
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
/>
}
/>
}
</div>
<div className="session_caract_Dialog" ><b>Type de Groupe </b> <br />
{New_Getall_Groupe_Apprenant_Type_result && New_Getall_Groupe_Apprenant_Type_result.length > 0 &&
<Autocomplete
disablePortal
name="detail_type_grp"
id="detail_type_grp"
fullWidth
options={New_Getall_Groupe_Apprenant_Type_result}
value={New_Getall_Groupe_Apprenant_Type_result.filter((data) => (data).code === String(p_detail_type_groupe_code))[0].label}
onChange={(event, value) => {
if (value && value.code) {
setp_detail_type_groupe_code(value.code);
setgrp_apprenant_data_changed("1");
} else {
setp_detail_type_groupe_code("");
setgrp_apprenant_data_changed("1");
}
}}
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={"Add_One_Sequence_Session_Ressource_Mass"} className="bton_enreg_dialog">Créer en masse</Button>
</div>
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
<Button onClick={Dialog_GRP_AUTOMATIC_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
</div>
</div>
</DialogActions>
</Dialog>
{/*** Fin ajout GROUPE AUTOMATIC */}
<h3> Les groupes d'apprenants </h3>
<div className="div_row">
@ -2213,6 +2421,18 @@ const Groupe_Apprenant = (props) => {
<div className="div_row" style={{ "border": "None" }}>
<div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
<Button variant="outlined"
className="detail_class_submenu bton_add_session bton_add_session_create_automatic" style={{ "width": "40%" }}
id='menu_import_participant' name='menu_import_participant' onClick={(event) => {
setDialog_GRP_AUTOMATIC_open(true);
}} > Subdivision automatique
&nbsp; <FcMultipleSmartphones />
</Button>
&nbsp;
<Button variant="outlined" onClick={Ajout_1_grp_apprenant}
className="detail_class_submenu bton_add_session"
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Grp &nbsp;
@ -2702,8 +2922,6 @@ const Groupe_Apprenant = (props) => {
</div>
<div className="session_caract"> <b> Classe </b> <br />
{New_Getall_Partner_Session_Reduice_Fields_result && New_Getall_Partner_Session_Reduice_Fields_result.length > 0 &&

View File

@ -421,6 +421,9 @@ const Module_Editique = (props) => {
}
useEffect(() => {
Getall_Partner_Digital_Sign_Status();
@ -477,6 +480,11 @@ const Module_Editique = (props) => {
const [selected_session_id, setselected_session_id] = useState("");
const [selected_internal_url, setselected_internal_url] = useState();
const [local_nb_valide_inscription_entreprise, setlocal_nb_valide_inscription_entreprise] = useState("");
const [local_nb_valide_inscription_individuelle, setlocal_nb_valide_inscription_individuelle] = useState();
const [local_selected_session_invoiced_statut, setlocal_selected_session_invoiced_statut] = useState();
const [selected_convention_id, setselected_convention_id] = useState("");
const [selected_convention_type, setselected_convention_type] = useState("");
@ -914,6 +922,19 @@ const Module_Editique = (props) => {
setsession_date_debut(mylocaltraining.date_debut);
}
if (mylocaltraining.nb_valide_inscription_entreprise) {
setlocal_nb_valide_inscription_entreprise(mylocaltraining.nb_valide_inscription_entreprise);
} else {
setlocal_nb_valide_inscription_entreprise("");
}
if (mylocaltraining.nb_valide_inscription_individuelle) {
setlocal_nb_valide_inscription_individuelle(mylocaltraining.nb_valide_inscription_individuelle);
} else {
setlocal_nb_valide_inscription_individuelle("");
}
}
@ -2566,8 +2587,9 @@ const Module_Editique = (props) => {
</div>}
{String(props.selected_session_invoiced_statut) !== "1" && String(props.selected_session_invoiced_statut) !== "2" &&
String(props.nb_valide_inscription_entreprise) === "0" && String(props.nb_valide_inscription_individuelle) === "0" && <div className="div_row" style={{ "height": "3rem", "marginLeft": "5px", "marginRight": "5px" }}>
String(local_nb_valide_inscription_entreprise) === "0" && String(local_nb_valide_inscription_individuelle) === "0" && <div className="div_row" style={{ "height": "3rem", "marginLeft": "5px", "marginRight": "5px" }}>
<div className="bton_action_server" style={{ width: "45%", float: "left", height: "2.5rem", paddingTop: "10px" }}

View File

@ -2038,9 +2038,11 @@ const Module_Session_Planification = (props) => {
<Dialog
open={Dialog_seq_1_open}
onClose={Dialog_seq_1_handleClose}
//onClose={Dialog_seq_1_handleClose}
className="displaypartnersession"
static
onClose={() => null}
>
@ -2232,9 +2234,11 @@ const Module_Session_Planification = (props) => {
<Dialog
open={Dialog_seq_ressource_1_open}
onClose={Dialog_seq_ressource_1_handleClose}
// onClose={Dialog_seq_ressource_1_handleClose}
className="displaypartnersession"
static
onClose={() => null}
>
@ -2426,9 +2430,11 @@ const Module_Session_Planification = (props) => {
<Dialog
open={Dialog_EVENT_SEMAINE_TYPE_open}
onClose={Dialog_EVENT_SEMAINE_TYPE_handleClose}
//onClose={Dialog_EVENT_SEMAINE_TYPE_handleClose}
className="module_agenda"
static
onClose={() => null}
>
@ -2717,8 +2723,10 @@ const Module_Session_Planification = (props) => {
<Dialog
open={Dialog_seq_CREATION_SEMAINE_TYPE_open}
onClose={Dialog_seq_CREATION_SEMAINE_TYPE_handleClose}
// onClose={Dialog_seq_CREATION_SEMAINE_TYPE_handleClose}
className="displaypartnersession displaypopop_for_sequence_model_week"
static
onClose={() => null}
>
<DialogTitle> {Dialog_seq_CREATION_SEMAINE_TYPE_message} </DialogTitle>
@ -3105,9 +3113,11 @@ const Module_Session_Planification = (props) => {
<Dialog
open={Dialog_DIALOG_AGENDA_open}
onClose={Dialog_DIALOG_AGENDA_handleClose}
// onClose={Dialog_DIALOG_AGENDA_handleClose}
className="module_agenda"
static
onClose={() => null}
>

View File

@ -4966,7 +4966,8 @@ const Partner_Commande = (props) => {
//onClose={Dialog_Order_handleClose}
className="partner_commande"
static
onClose={() => null}>
onClose={() => null}
>
<DialogTitle>{Dialog_1_message}</DialogTitle>
<DialogContent>