recette2
parent
d46e95777f
commit
9c82c9df27
|
@ -627,6 +627,8 @@ const Module_Session_Planification = (props) => {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const [Dialog_seq_choix_model_emargement_message, setDialog_seq_choix_model_emargement_message] = React.useState(false);
|
const [Dialog_seq_choix_model_emargement_message, setDialog_seq_choix_model_emargement_message] = React.useState(false);
|
||||||
const [Dialog_seq_choix_model_emargement_open, setDialog_seq_choix_model_emargement_open] = React.useState(false);
|
const [Dialog_seq_choix_model_emargement_open, setDialog_seq_choix_model_emargement_open] = React.useState(false);
|
||||||
|
|
||||||
|
@ -930,7 +932,6 @@ const Module_Session_Planification = (props) => {
|
||||||
|
|
||||||
const [New_Getall_Training_Materiel_No_Filter_result, setNew_Getall_Training_Materiel_No_Filter_result] = useState([]);
|
const [New_Getall_Training_Materiel_No_Filter_result, setNew_Getall_Training_Materiel_No_Filter_result] = useState([]);
|
||||||
|
|
||||||
|
|
||||||
const [Getall_Training_Materiel_No_Filter_api, setGetall_Training_Materiel_No_Filter_api] = useState();
|
const [Getall_Training_Materiel_No_Filter_api, setGetall_Training_Materiel_No_Filter_api] = useState();
|
||||||
const [Getall_Training_Materiel_No_Filter_message, setGetall_Training_Materiel_No_Filter_message] = useState();
|
const [Getall_Training_Materiel_No_Filter_message, setGetall_Training_Materiel_No_Filter_message] = useState();
|
||||||
const [Getall_Training_Materiel_No_Filter_result, setGetall_Training_Materiel_No_Filter_result] = useState();
|
const [Getall_Training_Materiel_No_Filter_result, setGetall_Training_Materiel_No_Filter_result] = useState();
|
||||||
|
|
|
@ -305,6 +305,81 @@ const Notes_Evaluation = (props) => {
|
||||||
Delete_Given_Evaluation(cellValues.row._id);
|
Delete_Given_Evaluation(cellValues.row._id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const columns_sequence_ressources_affectation = [
|
||||||
|
{ field: 'id', headerName: 'id', hide: true },
|
||||||
|
{ field: '_id', headerName: '_id', hide: true, minWidth: 200, },
|
||||||
|
{ field: 'related_target_collection_id', headerName: 'related_target_collection_id', minWidth: 200, hide: true, flex: 1, minWidth: 150, maxWidth: 300 },
|
||||||
|
{ field: 'related_target_collection', headerName: 'related_target_collection', minWidth: 150, hide: true, editable: false, resizable: true },
|
||||||
|
{ field: 'type_ressource', headerName: 'Type', minWidth: 150, hide: true, editable: false },
|
||||||
|
{ field: 'related_target_collection_object', headerName: 'object', minWidth: 200, hide: false, editable: false, resizable: true, flex: 1, },
|
||||||
|
{ field: 'related_target_collection_id_nom', headerName: 'nom', minWidth: 200, hide: false, editable: false, resizable: true, flex: 1, },
|
||||||
|
{ field: 'poste', headerName: 'Poste', minWidth: 200, hide: false, editable: false, flex: 1, },
|
||||||
|
{ field: 'comment', headerName: 'Comment', width: 200, hide: false, editable: false },
|
||||||
|
{
|
||||||
|
field: "delete", headerName: 'Supprimer',
|
||||||
|
renderCell: (cellValues) => {
|
||||||
|
return (
|
||||||
|
|
||||||
|
<Popup
|
||||||
|
trigger={<Button
|
||||||
|
|
||||||
|
onClick={(event) => {
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<CiTrash />
|
||||||
|
|
||||||
|
</Button>}
|
||||||
|
modal
|
||||||
|
nested
|
||||||
|
position="center center"
|
||||||
|
>
|
||||||
|
{close => (
|
||||||
|
<div>
|
||||||
|
<button className="gest_close" onClick={close}>
|
||||||
|
×
|
||||||
|
</button>
|
||||||
|
<div className="gest_header"> MySy Information </div>
|
||||||
|
<div className="gest_content">
|
||||||
|
{' '}
|
||||||
|
|
||||||
|
En confirmant cette opération, la ressource sera <i><font color="red"> définitivement supprimée</font></i>. <br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className="gest_actions">
|
||||||
|
<div style={{ "width": "45%", "float": "left" }}>
|
||||||
|
<button className="gest_bton_popup" onClick={(event) => {
|
||||||
|
|
||||||
|
// Delete_Sequence_Session_Ressource_Data(cellValues.row._id);
|
||||||
|
console.log('cellValues.row = ', cellValues.row);
|
||||||
|
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>
|
||||||
|
|
||||||
|
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const [Delete_Given_Evaluation_api, setDelete_Given_Evaluation_api] = useState();
|
const [Delete_Given_Evaluation_api, setDelete_Given_Evaluation_api] = useState();
|
||||||
|
@ -774,6 +849,75 @@ const Notes_Evaluation = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const [New_Getall_Training_Materiel_No_Filter_result, setNew_Getall_Training_Materiel_No_Filter_result] = useState([]);
|
||||||
|
|
||||||
|
const [Getall_Training_Materiel_No_Filter_api, setGetall_Training_Materiel_No_Filter_api] = useState();
|
||||||
|
const [Getall_Training_Materiel_No_Filter_message, setGetall_Training_Materiel_No_Filter_message] = useState();
|
||||||
|
const [Getall_Training_Materiel_No_Filter_result, setGetall_Training_Materiel_No_Filter_result] = useState();
|
||||||
|
function Getall_Training_Materiel_No_Filter(event) {
|
||||||
|
|
||||||
|
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_Ressource_Materielle_no_filter/";
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
//console.log(" In Getall_Training_Materiel_No_Filter res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In Getall_Training_Materiel_No_Filter res.data.message r_class = " + res.data.message);
|
||||||
|
setGetall_Training_Materiel_No_Filter_api("true");
|
||||||
|
setGetall_Training_Materiel_No_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_nom = JSON.parse(x).nom;
|
||||||
|
var local_ref_interne = JSON.parse(x).ref_interne;
|
||||||
|
|
||||||
|
|
||||||
|
//---
|
||||||
|
var node = {
|
||||||
|
"_id": local_id,
|
||||||
|
"id": localid,
|
||||||
|
"label": local_nom,
|
||||||
|
"nom": local_nom,
|
||||||
|
"ref_interne": local_ref_interne,
|
||||||
|
|
||||||
|
};
|
||||||
|
new_data2.push(node);
|
||||||
|
});
|
||||||
|
|
||||||
|
if (new_data2.length > 0)
|
||||||
|
setNew_Getall_Training_Materiel_No_Filter_result(new_data2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setGetall_Training_Materiel_No_Filter_api("false");
|
||||||
|
setGetall_Training_Materiel_No_Filter_message(res.data.message);
|
||||||
|
alert(res.data.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
console.warn('Not good man :( Getall_Training_Materiel_No_Filter = ', error);
|
||||||
|
setGetall_Training_Materiel_No_Filter_api("false");
|
||||||
|
alert(" Impossible de recuperer la liste du materiel");
|
||||||
|
//setmyApimyApiMessage("")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const [New_Getall_Evaluation_Participant_List_result, setNew_Getall_Evaluation_Participant_List_result] = useState([]);
|
const [New_Getall_Evaluation_Participant_List_result, setNew_Getall_Evaluation_Participant_List_result] = useState([]);
|
||||||
|
|
||||||
const [Getall_Evaluation_Participant_List_api, setGetall_Evaluation_Participant_List_api] = useState();
|
const [Getall_Evaluation_Participant_List_api, setGetall_Evaluation_Participant_List_api] = useState();
|
||||||
|
@ -1385,6 +1529,7 @@ const Notes_Evaluation = (props) => {
|
||||||
Getall_Partner_List_UE();
|
Getall_Partner_List_UE();
|
||||||
Getall_Partner_Type_Evalution_List();
|
Getall_Partner_Type_Evalution_List();
|
||||||
Getall_Training_Employee_No_Filter();
|
Getall_Training_Employee_No_Filter();
|
||||||
|
Getall_Training_Materiel_No_Filter();
|
||||||
|
|
||||||
Getall_Partner_Evaluation();
|
Getall_Partner_Evaluation();
|
||||||
|
|
||||||
|
@ -1806,6 +1951,7 @@ const Notes_Evaluation = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function submenu_ressources() {
|
async function submenu_ressources() {
|
||||||
|
Getall_List_note_evaluation_Ressource(selected_id);
|
||||||
await sleep(5);
|
await sleep(5);
|
||||||
setsubmenu("ressources");
|
setsubmenu("ressources");
|
||||||
inactive_active_menu_header("ressources");
|
inactive_active_menu_header("ressources");
|
||||||
|
@ -2300,7 +2446,7 @@ const Notes_Evaluation = (props) => {
|
||||||
|
|
||||||
var nom_fichier_cmd = "export_notes.xlsx";
|
var nom_fichier_cmd = "export_notes.xlsx";
|
||||||
|
|
||||||
var url = process.env.REACT_APP_API_URL + "myclass/api/Export_To_Excel_List_Participant_To_Evaluation/" + stored_cookie + "/" + selected_id+"/";
|
var url = process.env.REACT_APP_API_URL + "myclass/api/Export_To_Excel_List_Participant_To_Evaluation/" + stored_cookie + "/" + selected_id + "/";
|
||||||
|
|
||||||
|
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
@ -2326,6 +2472,330 @@ const Notes_Evaluation = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// -- Debut gestion des ressources
|
||||||
|
const [Getall_List_note_evaluation_Ressource_api, setGetall_List_note_evaluation_Ressource_api] = useState();
|
||||||
|
const [Getall_List_note_evaluation_Ressource_message, setGetall_List_note_evaluation_Ressource_message] = useState();
|
||||||
|
const [Getall_List_note_evaluation_Ressource_result, setGetall_List_note_evaluation_Ressource_result] = useState([]);
|
||||||
|
function Getall_List_note_evaluation_Ressource(local_note_evaluation_id) {
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
form.append("note_evaluation_id", local_note_evaluation_id);
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_note_evaluation_Ressource_Affectation/";
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
//console.log(" In Getall_List_note_evaluation_Ressource res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In Getall_List_note_evaluation_Ressource res.data.message r_class = " + res.data.message);
|
||||||
|
setGetall_List_note_evaluation_Ressource_api("true");
|
||||||
|
setGetall_List_note_evaluation_Ressource_result(res.data.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setGetall_List_note_evaluation_Ressource_api("false");
|
||||||
|
setGetall_List_note_evaluation_Ressource_message(res.data.message);
|
||||||
|
alert(res.data.message)
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
setLoading(false);
|
||||||
|
console.warn('Not good man :( Getall_List_note_evaluation_Ressource = ', error);
|
||||||
|
setGetall_List_note_evaluation_Ressource_api("false");
|
||||||
|
alert("Impossible de récuperer la liste des ressources de la sequence")
|
||||||
|
//setmyApimyApiMessage("")
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const [selectionModel_ressource, setselectionModel_ressource] = React.useState([]);
|
||||||
|
|
||||||
|
function submenu_add_one_Ressource() {
|
||||||
|
setDialog_seq_ressource_1_open(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const [Dialog_seq_ressource_1_message, setDialog_seq_ressource_1_message] = React.useState(false);
|
||||||
|
const [Dialog_seq_ressource_1_open, setDialog_seq_ressource_1_open] = React.useState(false);
|
||||||
|
|
||||||
|
|
||||||
|
function Dialog_1_handle_change_participant_session(message) {
|
||||||
|
setDialog_seq_ressource_1_message(message);
|
||||||
|
setDialog_seq_ressource_1_open(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
const Dialog_seq_ressource_1_handleClose = () => {
|
||||||
|
//alert(" Utiliser le bouton 'fermer' ");
|
||||||
|
//setOpen(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const Dialog_seq_ressource_1_handleClose_buton = () => {
|
||||||
|
setDialog_seq_ressource_1_open(false);
|
||||||
|
};
|
||||||
|
|
||||||
|
const New_Option_Type_Ressource = [
|
||||||
|
{ "id": "0", "label": "Employe", "value": "ressource_humaine" },
|
||||||
|
{ "id": "1", "label": "Materiel", "value": "ressource_materielle" },
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
const [Dialog_seq_ressource_1_selected_type_ressource, setDialog_seq_ressource_1_selected_type_ressource] = React.useState();
|
||||||
|
const [Dialog_seq_ressource_1_selected_ressource_id, setDialog_seq_ressource_1_selected_ressource_id] = React.useState();
|
||||||
|
const [Dialog_seq_ressource_1_selected_ressource_poste, setDialog_seq_ressource_1_selected_ressource_poste] = React.useState();
|
||||||
|
|
||||||
|
|
||||||
|
const datagridSx = {
|
||||||
|
borderRadius: 2,
|
||||||
|
marginRight: 1,
|
||||||
|
marginLeft: 1,
|
||||||
|
border: 0,
|
||||||
|
"& .MuiDataGrid-main": { borderRadius: 0 },
|
||||||
|
|
||||||
|
"& .MuiDataGrid-virtualScrollerRenderZone": {
|
||||||
|
"& .MuiDataGrid-row": {
|
||||||
|
"&:nth-child(2n)": { backgroundColor: "rgba(235, 235, 235, .7)" }
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"& .MuiDataGrid-columnHeaders": {
|
||||||
|
backgroundColor: "#c8cfd5",
|
||||||
|
color: "black",
|
||||||
|
fontSize: 16
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
const [Add_One_Sequence_Session_mass, setAdd_One_Sequence_Session_mass] = useState();
|
||||||
|
|
||||||
|
const [Add_One_Sequence_Session_Ressource_api, setAdd_One_Sequence_Session_Ressource_api] = useState();
|
||||||
|
const [Add_One_Sequence_Session_Ressource_message, setAdd_One_Sequence_Session_Ressource_message] = useState();
|
||||||
|
const [Add_One_Sequence_Session_Ressource_result, setAdd_One_Sequence_Session_Ressource_result] = useState();
|
||||||
|
const Add_One_Sequence_Session_Ressource = event => {
|
||||||
|
|
||||||
|
var new_ressource_type = Dialog_seq_ressource_1_selected_type_ressource;
|
||||||
|
var new_ressource_id = Dialog_seq_ressource_1_selected_ressource_id;
|
||||||
|
var new_ressource_poste = Dialog_seq_ressource_1_selected_ressource_poste;
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
form.append("note_evaluation_id", selected_id);
|
||||||
|
form.append("poste", new_ressource_poste);
|
||||||
|
form.append("related_target_collection", new_ressource_type);
|
||||||
|
form.append("related_target_collection_id", new_ressource_id);
|
||||||
|
|
||||||
|
if (String("new_ressource_type") === "ressource_humaine" && String(new_ressource_poste).trim() === "") {
|
||||||
|
alert(" Vous devez préciser le poste occupé pour cette ressrouce");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//console.log(" form == ", form);
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Note_Evaluation_Affectation_Ressource_Poste/";
|
||||||
|
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
//console.log(" In Add_One_Sequence_Session_Ressource res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In Add_One_Sequence_Session_Ressource res.data.message r_class = " + res.data.message);
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
setAdd_One_Sequence_Session_Ressource_api("true");
|
||||||
|
setAdd_One_Sequence_Session_Ressource_result(res.data.message);
|
||||||
|
|
||||||
|
Getall_List_note_evaluation_Ressource(selected_id);
|
||||||
|
|
||||||
|
setDialog_seq_ressource_1_selected_type_ressource();
|
||||||
|
setDialog_seq_ressource_1_selected_ressource_id();
|
||||||
|
setDialog_seq_ressource_1_selected_ressource_poste();
|
||||||
|
|
||||||
|
alert(res.data.message);
|
||||||
|
Dialog_seq_ressource_1_handleClose_buton();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setAdd_One_Sequence_Session_Ressource_api("false");
|
||||||
|
setAdd_One_Sequence_Session_Ressource_message(res.data.message);
|
||||||
|
alert(res.data.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
console.warn('UpdateStagiaireData : Not good man :( Add_One_Sequence_Session_Ressource = ' + error);
|
||||||
|
setAdd_One_Sequence_Session_Ressource_api("false");
|
||||||
|
alert(" Impossible d'ajouter la ressource à la séquence");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const [Delete_Sequence_Session_Ressource_Data_api, setDelete_Sequence_Session_Ressource_Data_api] = useState();
|
||||||
|
const [Delete_Sequence_Session_Ressource_Data_message, setDelete_Sequence_Session_Ressource_Data_message] = useState();
|
||||||
|
const [Delete_Sequence_Session_Ressource_Data_result, setDelete_Sequence_Session_Ressource_Data_result] = useState();
|
||||||
|
function Delete_Sequence_Session_Ressource_Data(local_seq_ressource_id) {
|
||||||
|
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
form.append("_id", local_seq_ressource_id);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Sequence_Affectation_Ressource_Poste/";
|
||||||
|
setLoading(true);
|
||||||
|
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
//console.log(" In Delete_Sequence_Session_Ressource_Data res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In Delete_Sequence_Session_Ressource_Data res.data.message r_class = " + res.data.message);
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
setDelete_Sequence_Session_Ressource_Data_api("true");
|
||||||
|
setDelete_Sequence_Session_Ressource_Data_result(res.data.message);
|
||||||
|
|
||||||
|
Getall_List_note_evaluation_Ressource(selected_id);
|
||||||
|
|
||||||
|
alert(res.data.message)
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setDelete_Sequence_Session_Ressource_Data_api("false");
|
||||||
|
setDelete_Sequence_Session_Ressource_Data_message(res.data.message);
|
||||||
|
|
||||||
|
alert(res.data.message);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
setLoading(false);
|
||||||
|
console.warn('Delete_Sequence_Session_Ressource_Data : Not good man :( mysearchtext = ' + error);
|
||||||
|
setDelete_Sequence_Session_Ressource_Data_api("false");
|
||||||
|
alert(" Impossible de supprimer la sequence");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const [tab_selected_sequence_id, settab_selected_sequence_id] = useState([]);
|
||||||
|
function GetSelectedRows_Sequence_Ids() {
|
||||||
|
|
||||||
|
|
||||||
|
var tab_tmp = []
|
||||||
|
for (var i = 0; i < selectionModel_evalutions.length; i++) {
|
||||||
|
var myid = parseInt(String(selectionModel_evalutions[i]));
|
||||||
|
//var line = JSON.parse(rowss[myid]);
|
||||||
|
tab_tmp.push(myid);
|
||||||
|
}
|
||||||
|
return tab_tmp;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async function actionmass_sequence_Traitement() {
|
||||||
|
|
||||||
|
setAdd_One_Sequence_Session_mass("1");
|
||||||
|
var liste_formation = GetSelectedRows_Sequence_Ids();
|
||||||
|
|
||||||
|
var tab_seq_mongo_ids = [];
|
||||||
|
|
||||||
|
/* 22/05/24 : Retravailler ce code pour le module note_evaluation.
|
||||||
|
for (var i = 0; i < selectionModel_evalutions.length; i++) {
|
||||||
|
|
||||||
|
var line_id = selectionModel_evalutions[i];
|
||||||
|
var mongo_id = JSON.parse(Getall_Sequence_Of_Session_result[line_id])._id;
|
||||||
|
tab_seq_mongo_ids.push(mongo_id);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
settab_selected_sequence_id(tab_seq_mongo_ids);
|
||||||
|
|
||||||
|
|
||||||
|
if (String(actionmass_sequence_val) === "ajout_ressource") {
|
||||||
|
setDialog_seq_ressource_1_open(true);
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (String(actionmass_sequence_val) === "supprimer") {
|
||||||
|
|
||||||
|
// Delete_Sequence_Session_Data_Mass(tab_seq_mongo_ids);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const [actionmass_sequence_val, setactionmass_sequence_val] = useState();
|
||||||
|
|
||||||
|
|
||||||
|
const [Add_One_Sequence_Session_Ressource_Mass_api, setAdd_One_Sequence_Session_Ressource_Mass_api] = useState();
|
||||||
|
const [Add_One_Sequence_Session_Ressource_Mass_message, setAdd_One_Sequence_Session_Ressource_Mass_message] = useState();
|
||||||
|
const [Add_One_Sequence_Session_Ressource_Mass_result, setAdd_One_Sequence_Session_Ressource_Mass_result] = useState();
|
||||||
|
const Add_One_Sequence_Session_Ressource_Mass = tab_ids => {
|
||||||
|
|
||||||
|
var new_ressource_type = Dialog_seq_ressource_1_selected_type_ressource;
|
||||||
|
var new_ressource_id = Dialog_seq_ressource_1_selected_ressource_id;
|
||||||
|
var new_ressource_poste = Dialog_seq_ressource_1_selected_ressource_poste;
|
||||||
|
|
||||||
|
var form = new FormData();
|
||||||
|
|
||||||
|
|
||||||
|
const stored_cookie = getCookie('tokenmysypart');
|
||||||
|
form.append("token", stored_cookie);
|
||||||
|
form.append("tab_sequence_session_id", tab_selected_sequence_id);
|
||||||
|
form.append("poste", new_ressource_poste);
|
||||||
|
form.append("related_target_collection", new_ressource_type);
|
||||||
|
form.append("related_target_collection_id", new_ressource_id);
|
||||||
|
|
||||||
|
//console.log(" form == ", form);
|
||||||
|
|
||||||
|
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Sequence_Affectation_Ressource_Poste_Mass/";
|
||||||
|
|
||||||
|
|
||||||
|
setLoading(true);
|
||||||
|
axios.post(myurl, form).then(res => {
|
||||||
|
//console.log(" In Add_One_Sequence_Session_Ressource_Mass res.data.status = " + res.data.status);
|
||||||
|
//console.log(" In Add_One_Sequence_Session_Ressource_Mass res.data.message r_class = " + res.data.message);
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
if (String(res.data.status) === String("true")) {
|
||||||
|
setAdd_One_Sequence_Session_Ressource_Mass_api("true");
|
||||||
|
setAdd_One_Sequence_Session_Ressource_Mass_result(res.data.message);
|
||||||
|
|
||||||
|
Getall_List_note_evaluation_Ressource(selected_id);
|
||||||
|
|
||||||
|
setDialog_seq_ressource_1_selected_type_ressource();
|
||||||
|
setDialog_seq_ressource_1_selected_ressource_id();
|
||||||
|
setDialog_seq_ressource_1_selected_ressource_poste();
|
||||||
|
|
||||||
|
setAdd_One_Sequence_Session_mass();
|
||||||
|
//settab_selected_sequence_id([]);
|
||||||
|
|
||||||
|
alert(res.data.message);
|
||||||
|
Dialog_seq_ressource_1_handleClose_buton();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
setAdd_One_Sequence_Session_Ressource_Mass_api("false");
|
||||||
|
setAdd_One_Sequence_Session_Ressource_Mass_message(res.data.message);
|
||||||
|
alert(res.data.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
|
||||||
|
|
||||||
|
setLoading(false);
|
||||||
|
console.warn('UpdateStagiaireData : Not good man :( Add_One_Sequence_Session_Ressource_Mass = ' + error);
|
||||||
|
setAdd_One_Sequence_Session_Ressource_Mass_api("false");
|
||||||
|
alert(" Impossible d'ajouter la ressource à la séquence");
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// -- end gestion des ressources
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="note_evaluation">
|
<div className="note_evaluation">
|
||||||
|
@ -2333,6 +2803,145 @@ const Notes_Evaluation = (props) => {
|
||||||
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
<div className="mysy_spinner"> <img src={img_loading_spin} /> </div>
|
||||||
</div>}
|
</div>}
|
||||||
|
|
||||||
|
{/*** Dialog Ajout Ressources */}
|
||||||
|
|
||||||
|
<Dialog
|
||||||
|
open={Dialog_seq_ressource_1_open}
|
||||||
|
onClose={Dialog_seq_ressource_1_handleClose}
|
||||||
|
|
||||||
|
className="displaypartnersession"
|
||||||
|
|
||||||
|
>
|
||||||
|
|
||||||
|
<DialogTitle>Ajout ressource </DialogTitle>
|
||||||
|
<DialogContent className="DialogContent_width">
|
||||||
|
<DialogContentText>
|
||||||
|
{Dialog_seq_ressource_1_message}
|
||||||
|
</DialogContentText>
|
||||||
|
|
||||||
|
|
||||||
|
<div className="session_caract_Dialog" > Type de ressource
|
||||||
|
<Autocomplete
|
||||||
|
disablePortal
|
||||||
|
name="event_dialog_type_ressource"
|
||||||
|
id="event_dialog_type_ressource"
|
||||||
|
fullWidth
|
||||||
|
|
||||||
|
options={New_Option_Type_Ressource}
|
||||||
|
onChange={(event, value) => {
|
||||||
|
if (value && value.value) {
|
||||||
|
|
||||||
|
setDialog_seq_ressource_1_selected_type_ressource(value.value);
|
||||||
|
}
|
||||||
|
|
||||||
|
}}
|
||||||
|
|
||||||
|
renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
{String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_humaine" && <div className="session_caract_Dialog" > Ressource Humaine
|
||||||
|
|
||||||
|
<Autocomplete
|
||||||
|
disablePortal
|
||||||
|
name="event_dialog_ressource_id"
|
||||||
|
id="event_dialog_ressource_id"
|
||||||
|
fullWidth
|
||||||
|
options={New_Getall_Training_Employee_No_Filter_result}
|
||||||
|
|
||||||
|
onChange={(event, value) => {
|
||||||
|
if (value && value._id) {
|
||||||
|
setDialog_seq_ressource_1_selected_ressource_id(value._id);
|
||||||
|
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
|
||||||
|
renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
{String(Dialog_seq_ressource_1_selected_type_ressource) === "ressource_materielle" && <div className="session_caract_Dialog" > Ressource Materiel
|
||||||
|
|
||||||
|
<Autocomplete
|
||||||
|
disablePortal
|
||||||
|
name="event_dialog_ressource_id"
|
||||||
|
id="event_dialog_ressource_id"
|
||||||
|
fullWidth
|
||||||
|
options={New_Getall_Training_Materiel_No_Filter_result}
|
||||||
|
|
||||||
|
onChange={(event, value) => {
|
||||||
|
if (value && value._id) {
|
||||||
|
setDialog_seq_ressource_1_selected_ressource_id(value._id);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
|
||||||
|
renderInput={(params) => <TextField {...params} placeholder="Choisir une option " />
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
<div className="session_caract_Dialog" > Poste
|
||||||
|
<TextField
|
||||||
|
sx={{ '& legend': { display: 'none' }, '& fieldset': { top: 0 }, }}
|
||||||
|
|
||||||
|
name="event_dialog_title"
|
||||||
|
id="event_dialog_title"
|
||||||
|
|
||||||
|
|
||||||
|
fullWidth
|
||||||
|
|
||||||
|
value={Dialog_seq_ressource_1_selected_ressource_poste}
|
||||||
|
onChange={(e) => {
|
||||||
|
|
||||||
|
setDialog_seq_ressource_1_selected_ressource_poste(e.target.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</DialogContent>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<DialogActions>
|
||||||
|
<div className="div_row">
|
||||||
|
<div className="div_row_gauche">
|
||||||
|
|
||||||
|
<Button onClick={Add_One_Sequence_Session_Ressource} className="bton_enreg_dialog">Ajouter</Button>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="div_row_droite" style={{ "textAlign": 'center' }}>
|
||||||
|
<Button onClick={Dialog_seq_ressource_1_handleClose_buton} className="bton_annule_dialog" >Fermer</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</DialogActions>
|
||||||
|
|
||||||
|
|
||||||
|
</Dialog>
|
||||||
|
|
||||||
|
{/*** Fin ajout ressource */}
|
||||||
<h3> Les Evaluations </h3>
|
<h3> Les Evaluations </h3>
|
||||||
<div className="div_row">
|
<div className="div_row">
|
||||||
<div className="titre1"> Utilisez les filtres !</div>
|
<div className="titre1"> Utilisez les filtres !</div>
|
||||||
|
@ -3602,7 +4211,7 @@ const Notes_Evaluation = (props) => {
|
||||||
className="disabled_style"
|
className="disabled_style"
|
||||||
//className="disabled_style enable_style"
|
//className="disabled_style enable_style"
|
||||||
options={New_Getall_Partner_Class_Reduice_Fields_result}
|
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}
|
value={New_Getall_Partner_Class_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_class_id))[0].label}
|
||||||
//value={New_Getall_Partner_Session_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_class_id))[0].label}
|
//value={New_Getall_Partner_Session_Reduice_Fields_result.filter((data) => (data)._id === String(p_detail_class_id))[0].label}
|
||||||
onChange={(event, value) => {
|
onChange={(event, value) => {
|
||||||
if (value && value._id) {
|
if (value && value._id) {
|
||||||
|
@ -4294,6 +4903,83 @@ const Notes_Evaluation = (props) => {
|
||||||
{String(submenu) === "ressources" && <div>
|
{String(submenu) === "ressources" && <div>
|
||||||
<h3> Ressources Humaines & Materielles</h3>
|
<h3> Ressources Humaines & Materielles</h3>
|
||||||
|
|
||||||
|
<div className="session_data">
|
||||||
|
<div style={{ "border": "None" }}>
|
||||||
|
|
||||||
|
<div style={{ height: 550, width: '100%', paddingRight: '1px' }}>
|
||||||
|
|
||||||
|
<Box
|
||||||
|
sx={{
|
||||||
|
height: 500,
|
||||||
|
width: '100%',
|
||||||
|
paddingRight: '1px',
|
||||||
|
|
||||||
|
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<DataGrid
|
||||||
|
checkboxSelection
|
||||||
|
onSelectionModelChange={(newSelectionModel) => {
|
||||||
|
setselectionModel_ressource(newSelectionModel);
|
||||||
|
|
||||||
|
}}
|
||||||
|
//selectionModel={selectionModel_evalutions}
|
||||||
|
|
||||||
|
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
|
||||||
|
rows={Getall_List_note_evaluation_Ressource_result.map((item, index) => (
|
||||||
|
{
|
||||||
|
id: index,
|
||||||
|
_id: JSON.parse(item)._id,
|
||||||
|
related_target_collection_id: JSON.parse(item).related_target_collection_id,
|
||||||
|
related_target_collection: JSON.parse(item).related_target_collection,
|
||||||
|
type_ressource: JSON.parse(item).related_target_collection_object,
|
||||||
|
related_target_collection_object: JSON.parse(item).related_target_collection_object,
|
||||||
|
related_target_collection_id_nom: JSON.parse(item).related_target_collection_id_nom,
|
||||||
|
poste: JSON.parse(item).poste,
|
||||||
|
}
|
||||||
|
))}
|
||||||
|
|
||||||
|
columns={columns_sequence_ressources_affectation}
|
||||||
|
pageSize={10}
|
||||||
|
className="datagridclass"
|
||||||
|
|
||||||
|
onRowDoubleClick={(newSelectionModel) => {
|
||||||
|
|
||||||
|
}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
rowsPerPageOptions={[10]}
|
||||||
|
disableSelectionOnClick
|
||||||
|
components={{
|
||||||
|
Toolbar: GridToolbar,
|
||||||
|
}}
|
||||||
|
sx={datagridSx}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/>
|
||||||
|
</Box>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div className="div_row_gauche div_row_gauche_etendu" style={{ "textAlign": "left", "paddingLeft": "5px" }}>
|
||||||
|
|
||||||
|
<Button variant="outlined" onClick={submenu_add_one_Ressource}
|
||||||
|
className="detail_class_submenu bton_add_session"
|
||||||
|
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Ressource
|
||||||
|
<IoAddCircleOutline style={{ "fontSize": "x-large", "color": "green" }} />
|
||||||
|
</Button>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>}
|
</div>}
|
||||||
|
|
||||||
{String(submenu) === "selection" && <div className="div_row session_data">
|
{String(submenu) === "selection" && <div className="div_row session_data">
|
||||||
|
|
|
@ -422,7 +422,7 @@ const Partner_Config_Ftion_Initiale = (props) => {
|
||||||
|
|
||||||
async function Disable_Config_Type_Eval_DetailFields() {
|
async function Disable_Config_Type_Eval_DetailFields() {
|
||||||
|
|
||||||
await sleep(5);
|
await sleep(10);
|
||||||
|
|
||||||
setconfig_type_eval_edit_mode("0");
|
setconfig_type_eval_edit_mode("0");
|
||||||
|
|
||||||
|
@ -433,8 +433,10 @@ const Partner_Config_Ftion_Initiale = (props) => {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementsByName("detail_config_nom")[0]) {
|
if (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";
|
||||||
|
console.log(" ICIIII ")
|
||||||
}
|
}
|
||||||
|
|
||||||
if (document.getElementsByName("detail_config_desc")[0]) {
|
if (document.getElementsByName("detail_config_desc")[0]) {
|
||||||
|
@ -448,7 +450,7 @@ const Partner_Config_Ftion_Initiale = (props) => {
|
||||||
|
|
||||||
async function Annule_Type_Eval_DetailFields() {
|
async function Annule_Type_Eval_DetailFields() {
|
||||||
|
|
||||||
|
setconfig_type_eval_edit_mode("0");
|
||||||
var line1 = New_Getall_Parter_config_type_evaluation_result.filter((data) => (data)._id === String(selected_type_eval_id))
|
var line1 = New_Getall_Parter_config_type_evaluation_result.filter((data) => (data)._id === String(selected_type_eval_id))
|
||||||
|
|
||||||
|
|
||||||
|
@ -460,9 +462,7 @@ const Partner_Config_Ftion_Initiale = (props) => {
|
||||||
setp_detail_config_nom(line1[0].nom);
|
setp_detail_config_nom(line1[0].nom);
|
||||||
setp_detail_config_description(line1[0].description);
|
setp_detail_config_description(line1[0].description);
|
||||||
|
|
||||||
await sleep(5);
|
|
||||||
|
|
||||||
Disable_Config_Type_Eval_DetailFields();
|
|
||||||
|
|
||||||
if (document.getElementById('myRef')) {
|
if (document.getElementById('myRef')) {
|
||||||
var divh = document.getElementById('myRef').offsetTop;
|
var divh = document.getElementById('myRef').offsetTop;
|
||||||
|
@ -472,6 +472,8 @@ const Partner_Config_Ftion_Initiale = (props) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Disable_Config_Type_Eval_DetailFields();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue