qsdsq
parent
155517fb6b
commit
40d3405351
|
@ -1042,6 +1042,9 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
const [selected_session_id, setselected_session_id] = useState();
|
||||
const [selected_code_session, setselected_code_session] = useState();
|
||||
const [selected_internal_url, setselected_internal_url] = useState();
|
||||
|
||||
const [selected_class_id, setselected_class_id] = useState();
|
||||
|
||||
const [selected_class_title, setselected_class_title] = useState();
|
||||
const [selected_participant_email, setselected_participant_email] = useState();
|
||||
|
||||
|
@ -2505,6 +2508,106 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
|
||||
|
||||
|
||||
const [New_Get_Inscrit_List_Evaluation_Par_UE_result, setNew_Get_Inscrit_List_Evaluation_Par_UE_result] = useState([]);
|
||||
const [tab_inscrit_evaluation_ue_id, settab_inscrit_evaluation_ue_id] = useState([]);
|
||||
|
||||
const [Get_Inscrit_List_Evaluation_Par_UE_api, setGet_Inscrit_List_Evaluation_Par_UE_api] = useState();
|
||||
const [Get_Inscrit_List_Evaluation_Par_UE_message, setGet_Inscrit_List_Evaluation_Par_UE_message] = useState();
|
||||
const [Get_Inscrit_List_Evaluation_Par_UE_result, setGet_Inscrit_List_Evaluation_Par_UE_result] = useState();
|
||||
function Get_Inscrit_List_Evaluation_Par_UE(local_inscription_id) {
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("inscription_id", local_inscription_id);
|
||||
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Inscrit_List_EU_Type_Evaluation/";
|
||||
|
||||
setLoading(true);
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
setLoading(false);
|
||||
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Get_Inscrit_List_Evaluation_Par_UE res.data.status = " + res.data.status);
|
||||
//console.log(" In Get_Inscrit_List_Evaluation_Par_UE res.data.message r_class = " + res.data.message);
|
||||
setGet_Inscrit_List_Evaluation_Par_UE_api("true");
|
||||
setGet_Inscrit_List_Evaluation_Par_UE_result(res.data.message);
|
||||
|
||||
var new_data2 = [];
|
||||
|
||||
var tab_tmp = []
|
||||
const new_data = res.data.message.map((x) => {
|
||||
|
||||
//---
|
||||
var localid = JSON.parse(x).id;
|
||||
var local_id = JSON.parse(x)._id;
|
||||
var local_class_id = JSON.parse(x).class_id;
|
||||
var local_class_eu_id = JSON.parse(x).class_eu_id;
|
||||
var local_class_eu_code = JSON.parse(x).class_eu_code;
|
||||
var local_type_eval__id = JSON.parse(x).type_eval__id;
|
||||
var local_type_eval_code = JSON.parse(x).type_eval_code;
|
||||
var local_type_eval_nom = JSON.parse(x).type_eval_nom;
|
||||
|
||||
tab_tmp.push(local_type_eval__id);
|
||||
|
||||
//---
|
||||
var node = {
|
||||
"_id": local_id,
|
||||
"id": localid,
|
||||
"label": local_class_eu_code + " - " + local_type_eval_code,
|
||||
"class_id": local_class_id,
|
||||
"class_eu_id": local_class_eu_id,
|
||||
"class_eu_code": local_class_eu_code,
|
||||
"type_eval__id": local_type_eval__id,
|
||||
"type_eval_code": local_type_eval_code,
|
||||
"type_eval_nom": local_type_eval_nom,
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
||||
|
||||
});
|
||||
|
||||
//---
|
||||
var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"class_id": "",
|
||||
"class_eu_id": "",
|
||||
"class_eu_code": "",
|
||||
"type_eval__id": "",
|
||||
"type_eval_code": "",
|
||||
"type_eval_nom": "",
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
||||
|
||||
if (new_data2.length > 0) {
|
||||
setNew_Get_Inscrit_List_Evaluation_Par_UE_result(new_data2);
|
||||
settab_inscrit_evaluation_ue_id(tab_tmp)
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
setGet_Inscrit_List_Evaluation_Par_UE_api("false");
|
||||
setGet_Inscrit_List_Evaluation_Par_UE_message(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Get_Inscrit_List_Evaluation_Par_UE = ', error);
|
||||
setGet_Inscrit_List_Evaluation_Par_UE_api("false");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
const [nb_stagiaire_Inscrit, setnb_stagiaire_Inscrit] = useState("0");
|
||||
const hiddenFileInput_session = React.useRef(null);
|
||||
const [Edite_session, setEdite_session] = useState();
|
||||
|
@ -2607,6 +2710,100 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
}
|
||||
|
||||
|
||||
|
||||
const [New_Getall_Class_List_Evalution_result, setNew_Getall_Class_List_Evalution_result] = useState([]);
|
||||
|
||||
const [Getall_Class_List_Evalution_api, setGetall_Class_List_Evalution_api] = useState();
|
||||
const [Getall_Class_List_Evalution_message, setGetall_Class_List_Evalution_message] = useState();
|
||||
const [Getall_Class_List_Evalution_result, setGetall_Class_List_Evalution_result] = useState([]);
|
||||
function Getall_Class_List_Evalution(local_class_id) {
|
||||
|
||||
var form = new FormData();
|
||||
|
||||
const stored_cookie = getCookie('tokenmysypart');
|
||||
form.append("token", stored_cookie);
|
||||
form.append("class_id", local_class_id);
|
||||
|
||||
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Class_Evaluation/";
|
||||
|
||||
setLoading(true);
|
||||
|
||||
axios.post(myurl, form).then(res => {
|
||||
|
||||
|
||||
setLoading(false);
|
||||
if (String(res.data.status) === String("true")) {
|
||||
//console.log(" In Getall_Class_List_Evalution res.data.status = " + res.data.status);
|
||||
//console.log(" In Getall_Class_List_Evalution res.data.message r_class = " + res.data.message);
|
||||
setGetall_Class_List_Evalution_api("true");
|
||||
setGetall_Class_List_Evalution_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_class_id = JSON.parse(x).class_id;
|
||||
var local_class_ue_id = JSON.parse(x).class_ue_id;
|
||||
var local_class_ue_code = JSON.parse(x).class_ue_code;
|
||||
var local_type_evaluation_id = JSON.parse(x).type_evaluation_id;
|
||||
var local_type_evaluation_code = JSON.parse(x).type_evaluation_code;
|
||||
var local_max_note = JSON.parse(x).max_note;
|
||||
|
||||
|
||||
//---
|
||||
var node = {
|
||||
"_id": local_id,
|
||||
"id": localid,
|
||||
"label": local_type_evaluation_code + "-" + local_class_ue_code,
|
||||
"class_id": local_class_id,
|
||||
"class_ue_id": local_class_ue_id,
|
||||
"class_ue_code": local_class_ue_code,
|
||||
"type_evaluation_id": local_type_evaluation_id,
|
||||
"type_evaluation_code": local_type_evaluation_code,
|
||||
"max_note": local_max_note,
|
||||
|
||||
|
||||
};
|
||||
new_data2.push(node);
|
||||
});
|
||||
|
||||
//---
|
||||
var node = {
|
||||
"_id": "",
|
||||
"id": "",
|
||||
"label": "",
|
||||
"class_id": "",
|
||||
"class_ue_id": "",
|
||||
"class_ue_code": "",
|
||||
"type_evaluation_id": "",
|
||||
"type_evaluation_code": "",
|
||||
"max_note": "",
|
||||
|
||||
};
|
||||
new_data2.push(node);
|
||||
|
||||
if (new_data2.length > 0)
|
||||
setNew_Getall_Class_List_Evalution_result(new_data2);
|
||||
}
|
||||
else {
|
||||
setGetall_Class_List_Evalution_api("false");
|
||||
setGetall_Class_List_Evalution_message(res.data.message);
|
||||
alert(res.data.message);
|
||||
}
|
||||
|
||||
}).catch((error) => {
|
||||
|
||||
setLoading(false);
|
||||
console.warn('Not good man :( Getall_Class_List_Evalution = ', error);
|
||||
setGetall_Class_List_Evalution_api("false");
|
||||
alert(" Impossible de recuperer la liste des évaluations de la formatio");
|
||||
//setmyApimyApiMessage("")
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
useEffect(() => {
|
||||
Getall_TrainingParticipant();
|
||||
Getall_TrainingSession();
|
||||
|
@ -5853,6 +6050,9 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
const icon = <CheckBoxOutlineBlankIcon fontSize="small" />;
|
||||
const checkedIcon = <CheckBoxIcon fontSize="small" />;
|
||||
|
||||
const [ueChanged, setueChanged] = useState("");
|
||||
|
||||
|
||||
return (
|
||||
<div className="displaypartnerstagiaire">
|
||||
{isLoading && <div className="loader-container">
|
||||
|
@ -7351,7 +7551,12 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
onRowDoubleClick={(newSelectionModel) => {
|
||||
///setuserimgclassprofil("");
|
||||
|
||||
Get_List_UE_From_Class_Id(newSelectionModel.row.class_id); // zzzzz
|
||||
Get_List_UE_From_Class_Id(newSelectionModel.row.class_id);
|
||||
|
||||
Getall_Class_List_Evalution(newSelectionModel.row.class_id);
|
||||
|
||||
setselected_internal_url(newSelectionModel.row.class_internal_url);
|
||||
setselected_class_id(newSelectionModel.row.class_id);
|
||||
|
||||
setselected_row_data_json_age('');
|
||||
setgridline_id(newSelectionModel.row.id);
|
||||
|
@ -7370,6 +7575,7 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
}
|
||||
|
||||
Get_Inscrit_List_UE(newSelectionModel.row._id);
|
||||
Get_Inscrit_List_Evaluation_Par_UE(newSelectionModel.row._id);
|
||||
setselected_row_data_json(JSON.parse(rowss[newSelectionModel.row.id]));
|
||||
setDialog_stagiaire_open(true);
|
||||
|
||||
|
@ -9902,60 +10108,146 @@ const DisplayPartnerStagiaires = (props) => {
|
|||
{String(props.formation_initiale) === "1" && String(submenu) === "ue" && String(addOneParticipant) !== "1" && <div className="div_row" style={{ "border": "None", "background": '#F8F9F9', "padding": '5px' }}>
|
||||
|
||||
<h3> Gestion des UE d'un inscrit </h3>
|
||||
<div className="div_row">
|
||||
|
||||
<div className="session_caract"> <b>Unite D'enseignement </b> <br />
|
||||
{New_Get_List_UE_From_Class_Id_result && New_Get_List_UE_From_Class_Id_result.length > 0 &&
|
||||
|
||||
<Autocomplete
|
||||
multiple
|
||||
name="detail_ue"
|
||||
id="detail_ue"
|
||||
//className="disabled_style"
|
||||
disablePortal
|
||||
disableCloseOnSelect
|
||||
getOptionLabel={(option) => option.label}
|
||||
|
||||
|
||||
<div className="session_caract"> <b>Unite D'enseignement </b> <br />
|
||||
{New_Get_List_UE_From_Class_Id_result && New_Get_List_UE_From_Class_Id_result.length > 0 &&
|
||||
//className="disabled_style enable_style"
|
||||
//options={New_Getall_Partner_List_UE_result}
|
||||
options={New_Get_List_UE_From_Class_Id_result}
|
||||
defaultValue={New_Get_List_UE_From_Class_Id_result.filter((data) => {
|
||||
if (tab_inscrit_ue_id.includes(String(data._id))) {
|
||||
|
||||
<Autocomplete
|
||||
multiple
|
||||
name="detail_ue"
|
||||
id="detail_ue"
|
||||
//className="disabled_style"
|
||||
disablePortal
|
||||
disableCloseOnSelect
|
||||
getOptionLabel={(option) => option.label}
|
||||
return data;
|
||||
}
|
||||
})}
|
||||
//defaultValue={[New_Get_List_UE_From_Class_Id_result[0], New_Get_List_UE_From_Class_Id_result[2],]}
|
||||
renderOption={(props, option, { selected }) => (
|
||||
<li {...props}>
|
||||
<Checkbox
|
||||
icon={icon}
|
||||
checkedIcon={checkedIcon}
|
||||
style={{ marginRight: 8 }}
|
||||
checked={selected}
|
||||
/>
|
||||
{option.label}
|
||||
</li>
|
||||
)}
|
||||
// style={{ width: 500 }}
|
||||
|
||||
onChange={(event, value) => {
|
||||
setueChanged("1");
|
||||
console.log(" ### value = ", value);
|
||||
|
||||
|
||||
//className="disabled_style enable_style"
|
||||
//options={New_Getall_Partner_List_UE_result}
|
||||
options={New_Get_List_UE_From_Class_Id_result}
|
||||
defaultValue={New_Get_List_UE_From_Class_Id_result.filter((data) => {
|
||||
if (tab_inscrit_ue_id.includes(String(data._id))) {
|
||||
|
||||
return data;
|
||||
}}
|
||||
|
||||
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une UE "
|
||||
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
|
||||
|
||||
/>
|
||||
}
|
||||
})}
|
||||
//defaultValue={[New_Get_List_UE_From_Class_Id_result[0], New_Get_List_UE_From_Class_Id_result[2],]}
|
||||
renderOption={(props, option, { selected }) => (
|
||||
<li {...props}>
|
||||
<Checkbox
|
||||
icon={icon}
|
||||
checkedIcon={checkedIcon}
|
||||
style={{ marginRight: 8 }}
|
||||
checked={selected}
|
||||
/>
|
||||
{option.label}
|
||||
</li>
|
||||
)}
|
||||
// style={{ width: 500 }}
|
||||
|
||||
onChange={(event, value) => {
|
||||
|
||||
console.log(" ### value = ", value);
|
||||
|
||||
|
||||
|
||||
}}
|
||||
|
||||
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir une UE "
|
||||
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
|
||||
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div className="session_caract"> <b>Evaluation </b> <br />
|
||||
{New_Getall_Class_List_Evalution_result && New_Getall_Class_List_Evalution_result.length > 0 &&
|
||||
|
||||
<Autocomplete
|
||||
multiple
|
||||
name="detail_ue"
|
||||
id="detail_ue"
|
||||
//className="disabled_style"
|
||||
disablePortal
|
||||
disableCloseOnSelect
|
||||
getOptionLabel={(option) => option.label}
|
||||
|
||||
|
||||
//className="disabled_style enable_style"
|
||||
//options={New_Getall_Partner_List_UE_result}
|
||||
options={New_Getall_Class_List_Evalution_result}
|
||||
defaultValue={New_Getall_Class_List_Evalution_result.filter((data) => {
|
||||
if (tab_inscrit_evaluation_ue_id.includes(String(data.type_evaluation_id))) {
|
||||
|
||||
return data;
|
||||
}
|
||||
})}
|
||||
|
||||
renderOption={(props, option, { selected }) => (
|
||||
<li {...props}>
|
||||
<Checkbox
|
||||
icon={icon}
|
||||
checkedIcon={checkedIcon}
|
||||
style={{ marginRight: 8 }}
|
||||
checked={selected}
|
||||
/>
|
||||
{option.label}
|
||||
</li>
|
||||
)}
|
||||
// style={{ width: 500 }}
|
||||
|
||||
onChange={(event, value) => {
|
||||
setueChanged("1");
|
||||
console.log(" ### value = ", value);
|
||||
|
||||
|
||||
|
||||
}}
|
||||
|
||||
renderInput={(params) => <TextField {...params} label="" placeholder="Choisir un type d'évaluation "
|
||||
inputProps={{ ...params.inputProps, style: { fontSize: 12, height: "1.4rem" } }}
|
||||
|
||||
/>
|
||||
}
|
||||
/>
|
||||
|
||||
}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div className="div_row">
|
||||
{ueChanged && String(ueChanged) === "1" && <div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
|
||||
/!\ Pensez à enregistrer les modifications
|
||||
</div>}
|
||||
|
||||
{<div className="div_row" style={{ "border": "None", "color": "orange", "textAlign": "center" }}>
|
||||
|
||||
|
||||
|
||||
{ueChanged && String(ueChanged) === "1" && <div className="div_row">
|
||||
|
||||
<div className="div_row_gauche" style={{ "textAlign": 'left', 'marginLeft': '15px' }}>
|
||||
<Button variant="contained" className="bton_enreg" onClick={"CreateSessionFormation"}>Enregistrer les modifications
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="div_row_droite" style={{ "textAlign": 'right', 'marginRight': '15px' }}>
|
||||
<Button variant="contained" className="bton_annule" onClick={"annuleSessionUpdate"}>Annuler les modifications
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
</div>}
|
||||
|
||||
</div>}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue