diff --git a/src/components/Module_Session_Planification.js b/src/components/Module_Session_Planification.js
index 1e0ee81..b1ec310 100644
--- a/src/components/Module_Session_Planification.js
+++ b/src/components/Module_Session_Planification.js
@@ -764,8 +764,6 @@ const Module_Session_Planification = (props) => {
setDelete_Sequence_Session_Data_api("true");
setDelete_Sequence_Session_Data_result(res.data.message);
- Getall_Sequence_Of_Session(selected_session_id);
-
setDialog_seq_ressource_1_selected_type_ressource("");
setDialog_seq_ressource_1_selected_ressource_id("");
setDialog_seq_ressource_1_selected_ressource_poste("");
@@ -781,6 +779,8 @@ const Module_Session_Planification = (props) => {
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
+
+ Getall_Sequence_Of_Session(selected_session_id);
}
else {
setDelete_Sequence_Session_Data_api("false");
@@ -1206,7 +1206,14 @@ const Module_Session_Planification = (props) => {
form.append("ue_id", p_detail_sequence_ue_id);
form.append("ue_planif_line_id", p_detail_sequence_ue_planif_line_id);
- //console.log(" form == ", form);
+ var tab_grp_apprenant_ids = []
+ for (var i = 0; i < val_grp_apprenant.length; i++) {
+ tab_grp_apprenant_ids.push(val_grp_apprenant[i]._id)
+ }
+
+ form.append("tab_grp_apprenant_ids", tab_grp_apprenant_ids);
+
+ // console.log(" form == ", form);
var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Session_Sequence_Return_New_Seq_Data/";
@@ -1565,6 +1572,14 @@ const Module_Session_Planification = (props) => {
var local_session_ue_titre = JSON.parse(x).ue_titre;
var local_session_ue_code = JSON.parse(x).ue_code;
+ var local_tab_grp_apprenant_ids = []
+ if (JSON.parse(x).tab_grp_apprenant_ids) {
+ setval_grp_apprenant(JSON.parse(x).tab_grp_apprenant_ids);
+ local_tab_grp_apprenant_ids = JSON.parse(x).tab_grp_apprenant_ids
+ } else {
+ setval_grp_apprenant([]);
+ }
+
var local_session_grp_apprenant_id = JSON.parse(x).grp_apprenant_id;
var local_session_ue_planif_line_id = JSON.parse(x).unite_enseignement_planif_id;
@@ -1602,6 +1617,7 @@ const Module_Session_Planification = (props) => {
"local_grp_apprenant_id": local_session_grp_apprenant_id,
"local_ue_planif_line_id": local_session_ue_planif_line_id,
+ "tab_grp_apprenant_ids": local_tab_grp_apprenant_ids,
};
new_data2.push(node);
@@ -1633,6 +1649,146 @@ const Module_Session_Planification = (props) => {
}
+
+ const [Getall_Sequence_Of_Session_With_Filter_result_planning_view, setGetall_Sequence_Of_Session_With_Filter_result_planning_view] = useState([]);
+
+ const [Getall_Sequence_Of_Session_With_Filter_api, setGetall_Sequence_Of_Session_With_Filter_api] = useState();
+ const [Getall_Sequence_Of_Session_With_Filter_message, setGetall_Sequence_Of_Session_With_Filter_message] = useState();
+ const [Getall_Sequence_Of_Session_With_Filter_result, setGetall_Sequence_Of_Session_With_Filter_result] = useState([]);
+ function Getall_Sequence_Of_Session_With_Filter(local_session_id, local_grp_apprenant_id, local_unite_enseignement_planif_id) {
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("session_id", local_session_id);
+ form.append("grp_apprenant_id", local_grp_apprenant_id);
+ form.append("unite_enseignement_planif_id", local_unite_enseignement_planif_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Session_Sequence_List_With_Filter/";
+
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Sequence_Of_Session_With_Filter res.data.status = " + res.data.status);
+ // console.log(" In Getall_Sequence_Of_Session_With_Filter res.data.message r_class = " + res.data.message);
+ setGetall_Sequence_Of_Session_With_Filter_api("true");
+ setGetall_Sequence_Of_Session_With_Filter_result(res.data.message);
+ setGetall_Sequence_Of_Session_result(res.data.message);
+
+ //console.log(" ##NB_Sequence = ", res.data.message.length);
+ setnb_sequence(res.data.message.length);
+ //props.setnb_sequence(res.data.message.length);
+
+ var new_data2 = [];
+ const new_data = res.data.message.map((x) => {
+
+ //console.log(" ### new_data XXX = ", x);
+
+ //---
+ var localid = JSON.parse(x)._id; // on donne volontairement a l'id la valeur de '_id'
+ var local_id = JSON.parse(x)._id;
+ var local_title = JSON.parse(x).sequence_title;
+ var local_start = new Date(moment(JSON.parse(x).sequence_start, "DD/MM/YYYY hh:mm"))
+ var local_end = new Date(moment(JSON.parse(x).sequence_end, "DD/MM/YYYY hh:mm"))
+
+ var local_volume_theorique = JSON.parse(x).volume_theorique;
+ var local_agenda = JSON.parse(x).agenda;
+ var local_objectif = JSON.parse(x).objectif;
+ var local_session_id = JSON.parse(x).session_id;
+ var local_session_comment = JSON.parse(x).commentaire;
+ var local_session_type = JSON.parse(x).type;
+
+ var local_session_ue_id = JSON.parse(x).ue_id;
+ var local_session_ue_titre = JSON.parse(x).ue_titre;
+ var local_session_ue_code = JSON.parse(x).ue_code;
+
+ var local_tab_grp_apprenant_ids = []
+ if (JSON.parse(x).tab_grp_apprenant_ids) {
+ setval_grp_apprenant(JSON.parse(x).tab_grp_apprenant_ids);
+ local_tab_grp_apprenant_ids = JSON.parse(x).tab_grp_apprenant_ids
+ } else {
+ setval_grp_apprenant([]);
+ }
+
+ var local_session_grp_apprenant_id = JSON.parse(x).grp_apprenant_id;
+
+ var local_session_ue_planif_line_id = JSON.parse(x).unite_enseignement_planif_id;
+ var local_session_color = JSON.parse(x).grp_apprenant_color;
+ var local_session_grp_code = JSON.parse(x).grp_apprenant_code;
+
+ var local_mode_animation = JSON.parse(x).mode_animation;
+
+ // Si il n'y pas de relief avec le groupe d'apprenant, on va introduire un relief avec la notion de présentiel et distantiel
+ if (local_session_color === "" && local_mode_animation === "1") {
+ // sequence en distantiel, on va mettre un code couleur
+ local_session_color = "#4ea860"
+ }
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "title": local_title,
+ "start": local_start,
+ "end": local_end,
+ "grp_code": local_session_grp_code,
+ "color": local_session_color,
+ "local_volume_theorique": local_volume_theorique,
+ "local_agenda": local_agenda,
+ "local_mode_animation": local_mode_animation,
+
+ "local_objectif": local_objectif,
+ "local_comment": local_session_comment,
+ "local_type": local_session_type,
+ "local_ue_id": local_session_ue_id,
+ "local_ue_titre": local_session_ue_titre,
+ "local_ue_code": local_session_ue_code,
+
+ "local_grp_apprenant_id": local_session_grp_apprenant_id,
+ "local_ue_planif_line_id": local_session_ue_planif_line_id,
+ "tab_grp_apprenant_ids": local_tab_grp_apprenant_ids,
+
+ };
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0) {
+ setGetall_Sequence_Of_Session_With_Filter_result_planning_view(new_data2);
+ setGetall_Sequence_Of_Session_result_planning_view(new_data2);
+ // console.log(" ### new_data2 Getall_Sequence_Of_Session_With_Filter = ", new_data2);
+ }
+
+
+ }
+ else {
+ setGetall_Sequence_Of_Session_With_Filter_api("false");
+ setGetall_Sequence_Of_Session_With_Filter_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Sequence_Of_Session_With_Filter = ', error);
+ setGetall_Sequence_Of_Session_With_Filter_api("false");
+ alert("Impossible de récuperer la liste des séquences")
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+
+
const [New_Getall_Partner_Modele_Planning_result_planning_view, setNew_Getall_Partner_Modele_Planning_result_planning_view] = useState([]);
const [Getall_Partner_Modele_Planning_api, setGetall_Partner_Modele_Planning_api] = useState();
@@ -1909,7 +2065,8 @@ const Module_Session_Planification = (props) => {
const Dialog_DIALOG_AGENDA_handleClose_buton = () => {
- setNew_Get_List_Given_UE_Planif_lines_result([])
+ setNew_Get_List_Given_UE_Planif_lines_result([]);
+ setval_grp_apprenant([]);
var node = {
@@ -2032,6 +2189,12 @@ const Module_Session_Planification = (props) => {
form.append("sequence_end", new_end_date);
form.append("_id", local_selected_sequence_id);
+ var tab_grp_apprenant_ids = []
+ for (var i = 0; i < val_grp_apprenant.length; i++) {
+ tab_grp_apprenant_ids.push(val_grp_apprenant[i]._id)
+ }
+
+ form.append("tab_grp_apprenant_ids", tab_grp_apprenant_ids);
// console.log(" form == ", form);
@@ -2418,7 +2581,7 @@ const Module_Session_Planification = (props) => {
setGetall_List_Sequence_Ressource_result([]);
setselectionModel_sequence([]);
- // console.log(" ### arg.event.extendedProps = ", arg.event.extendedProps);
+ // console.log(" ### arg.event.extendedProps = ", arg.event.extendedProps);
//console.log(" ### arg.event.extendedProps.local_type = ", arg.event.extendedProps.local_type);
@@ -2450,6 +2613,13 @@ const Module_Session_Planification = (props) => {
setp_detail_event_type("");
+ if (arg.event.extendedProps.tab_grp_apprenant_ids) {
+ setval_grp_apprenant(arg.event.extendedProps.tab_grp_apprenant_ids);
+ }
+ else
+ val_grp_apprenant([]);
+
+
if (arg.event.extendedProps.local_ue_id) {
setp_detail_sequence_ue_id(arg.event.extendedProps.local_ue_id);
Get_List_Given_UE_Planif_lines(arg.event.extendedProps.local_ue_id);
@@ -2691,6 +2861,12 @@ const Module_Session_Planification = (props) => {
form.append("ue_planif_line_id", p_detail_sequence_ue_planif_line_id);
+ var tab_grp_apprenant_ids = []
+ for (var i = 0; i < val_grp_apprenant.length; i++) {
+ tab_grp_apprenant_ids.push(val_grp_apprenant[i]._id)
+ }
+
+ form.append("tab_grp_apprenant_ids", tab_grp_apprenant_ids);
form.append("_id", selected_sequence_id);
@@ -2944,6 +3120,8 @@ const Module_Session_Planification = (props) => {
setGetall_List_Sequence_Ressource_result([]);
setselectionModel_sequence([]);
setDialog_DIALOG_AGENDA_open(true);
+
+ setval_grp_apprenant([]);
}
};
@@ -3005,7 +3183,6 @@ const Module_Session_Planification = (props) => {
//---
var node = {
"_id": "",
- "id": "",
"label": "",
"code": "",
"nom": "",
@@ -3718,6 +3895,10 @@ const Module_Session_Planification = (props) => {
const [position_h_choix_planning, setposition_h_choix_planning] = useState('700');
+ const fixedVal_grp_apprenant = [];
+ const [val_grp_apprenant, setval_grp_apprenant] = useState([...fixedVal_grp_apprenant]);
+
+
return (
@@ -4512,6 +4693,8 @@ const Module_Session_Planification = (props) => {
+
+
Titre
@@ -6158,7 +6341,7 @@ const Module_Session_Planification = (props) => {
-
Groupe apprenants
+ {/*
Groupe apprenants
{New_Getall_Partner_Groupe_Inscrit_result && New_Getall_Partner_Groupe_Inscrit_result.length > 0 &&
{
}
/>}
+ */}
+
+
Groupe apprenants
+
+ {New_Getall_Partner_Groupe_Inscrit_result && New_Getall_Partner_Groupe_Inscrit_result.length > 0 &&
(data)._id === String(p_detail_sequence_groupe_apprenant_id))[0].label}
+ options={New_Getall_Partner_Groupe_Inscrit_result}
+ /* onChange={(event, value) => {
+ if (value && value._id) {
+ setp_detail_sequence_groupe_apprenant_id(value._id);
+ } else {
+ setp_detail_sequence_groupe_apprenant_id("");
+ }
+
+ }}*/
+
+
+ multiple
+ onChange={(event, newValue) => {
+ setval_grp_apprenant([
+ ...fixedVal_grp_apprenant,
+ ...newValue.filter((i) => fixedVal_grp_apprenant.indexOf(i) === -1),
+ ]);
+
+ console.log(" ### val_grp_apprenant = ", val_grp_apprenant)
+
+ }}
+ value={val_grp_apprenant}
+
+ renderInput={(params) =>
+ }
+ />}
+
@@ -6486,6 +6707,30 @@ const Module_Session_Planification = (props) => {
+ {props.origin && props.origin === "promotion" &&
+ Filtre :
+ {New_Getall_Partner_Groupe_Inscrit_result && New_Getall_Partner_Groupe_Inscrit_result.length > 0 &&
(data)._id === String(p_detail_sequence_groupe_apprenant_id))[0].label}
+ options={New_Getall_Partner_Groupe_Inscrit_result}
+ onChange={(event, value) => {
+ if (value && value._id) {
+ Getall_Sequence_Of_Session_With_Filter(selected_session_id, value._id, "");
+ } else {
+ Getall_Sequence_Of_Session_With_Filter(selected_session_id, "", "");
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+ }
+
{display_view && String(display_view) === "list" &&
@@ -6737,7 +6982,7 @@ const Module_Session_Planification = (props) => {
-
+ zzzz
+
+
+ );
+}
+
+
+const useStyles = makeStyles((theme) => ({
+
+ dialog: {
+ position: 'absolute',
+ // left: 10,
+ top: 400
+ },
+
+ paper: {
+ overflowY: 'unset',
+ },
+ customizedButton: {
+ position: 'absolute',
+ left: '98%',
+ top: '-3%',
+ backgroundColor: 'lightgray',
+ color: 'gray',
+ },
+}));
+
+const AddClassManual = (props) => {
+ registerLocale('fr', fr);
+ const history = useHistory();
+ const url = process.env.REACT_APP_API_URL + "/myclass/api/add_partner_account/";
+ const [inputs, setInputs] = useState({});
+
+ const [mypublished, setmypublished] = useState("0");
+ const [mypublished_label, setmypublished_label] = useState("-");
+
+ const [mypublished_catalog_prive, setmypublished_catalog_prive] = useState("0");
+ const [mypublished_catalog_prive_label, setmypublished_catalog_prive_label] = useState("-");
+
+ const [mytrainingsupport, setmytrainingsupport] = useState("n/a");
+ const [mytrainingsupport_label, setmytrainingsupport_label] = useState("-");
+
+ const [mytrainingdurationunit, setmytrainingdurationunit] = useState("heure");
+
+ const [mytrainingdirectinscription, setmytrainingdirectinscription] = useState("");
+
+ const [mycpf, setmycpf] = useState("0");
+ const [mycpf_label, setmycpf_label] = useState("Non");
+
+ const [mycertif, setmycertif] = useState("0");
+ const [mycertif_label, setmycertif_label] = useState("Non");
+
+ const [mypresence, setmypresence] = useState("0");
+ const [mypresence_label, setmypresence_label] = useState("Non");
+
+
+ const [mydistance, setmydistance] = useState("0");
+ const [mydistance_label, setmydistance_label] = useState("Non");
+
+
+ var date_today_90j = new Date();
+ date_today_90j.setDate(date_today_90j.getDate() + 90);
+
+
+ var date_today_30j = new Date();
+ date_today_30j.setDate(date_today_30j.getDate() + 30);
+
+
+ var date_today_minus_180j = new Date();
+ date_today_minus_180j.setDate(date_today_minus_180j.getDate() - 180);
+
+
+
+ const [default_doc_modification, setdefault_doc_modification] = useState("0");
+
+
+ const [importmessage, setimportmessage] = useState("");
+ const [myApiResponse, setmyApiResponse] = useState("");
+ const setText = "coucou";
+ const [ShowModal, setShowModal] = useState(true);
+ const [result, setResult] = useState("");
+ const [isupdateclass, setisupdateclass] = useState(false);
+ const [testval, settestval] = useState("");
+ const [displayedinternalurl, setdisplayedinternalurl] = useState("");
+ const [datamodification, setdatamodification] = useState("0");
+ const [datelieu, setdatelieu] = useState("");
+
+ const [plus_produit_enabled, setplus_produit_enabled] = useState("");
+ const [mots_cle_enabled, setmots_cle_enabled] = useState("");
+ const [zone_diffusion_enabled, setzone_diffusion_enabled] = useState("");
+
+ function ExpandableCell_50({ value }) {
+ const [expanded, setExpanded] = React.useState(false);
+
+ return (
+
+ );
+ }
+
+
+ const [selectionModel_list_unite_enseignement, setselectionModel_list_unite_enseignement] = React.useState([]);
+
+ const columns_list_unite_enseignement = [
+ { field: 'id', headerName: 'id', hide: true },
+ { field: '_id', headerName: '_id', hide: true },
+ { field: 'code', headerName: 'Code', minWidth: 150, flex: 1, renderCell: (params) => , },
+ { field: 'titre', headerName: 'Titre', minWidth: 150, flex: 1, renderCell: (params) => , },
+ { field: 'credit', headerName: 'Credit', minWidth: 100, flex: 1, renderCell: (params) => , },
+ { field: 'coefficient', headerName: 'Coef.', minWidth: 100, flex: 1, renderCell: (params) => , },
+ {
+ field: 'pres_dist_hyp', headerName: 'Animation', minWidth: 150, flex: 1,
+ renderCell: (cellValues) => {
+ return (
+
+ {cellValues.row.pres_dist_hyp && String(cellValues.row.pres_dist_hyp) === "1" && "Distanciel"}
+ {cellValues.row.pres_dist_hyp && String(cellValues.row.pres_dist_hyp) === "0" && "Présentiel"}
+ {cellValues.row.pres_dist_hyp && String(cellValues.row.pres_dist_hyp) === "2" && "Hybride"}
+
+
+ );
+ }
+ },
+ {
+ field: 'is_noted', headerName: 'Evalué', minWidth: 100, flex: 1, renderCell: (params) => ,
+ renderCell: (cellValues) => {
+ return (
+
+ {cellValues.row.is_noted && String(cellValues.row.is_noted) === "1" && "Oui"}
+ {cellValues.row.is_noted && String(cellValues.row.is_noted) === "0" && "Non"}
+
+
+
+ );
+ }
+ },
+ { field: 'seuil_validation', headerName: 'Seuil val.', minWidth: 100, flex: 1, renderCell: (params) => , },
+
+
+ { field: 'duration_concat', headerName: 'Durée', minWidth: 100, flex: 1, renderCell: (params) => , },
+ { field: 'duration', headerName: 'Durée', minWidth: 150, hide: true, flex: 1, renderCell: (params) => , },
+ { field: 'duration_unite', headerName: 'Unit.', minWidth: 150, hide: true, editable: false, renderCell: (params) => , },
+
+ {
+ field: "delete", headerName: 'Supprimer',
+ renderCell: (cellValues) => {
+ return (
+ <>
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, l'UE définitivement supprimée de cette formation .
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+ }
+ >
+ );
+ }
+ },
+
+ ]
+
+ const columns_list_finance_data = [
+ { field: 'id', headerName: 'id', hide: true },
+ { field: '_id', headerName: '_id', hide: true },
+ { field: 'code', headerName: 'Code', minWidth: 150, flex: 1, renderCell: (params) => , },
+ { field: 'description', headerName: 'Decription', minWidth: 150, flex: 1, renderCell: (params) => , },
+ { field: 'montant', headerName: 'Montant', minWidth: 150, flex: 1, renderCell: (params) => , },
+ { field: 'type_cout', headerName: 'Type Cout', minWidth: 150, flex: 1, renderCell: (params) => , },
+ {
+ field: 'inclus_calcul', headerName: 'Inclus Calcul', minWidth: 150, flex: 1, renderCell: (params) => ,
+ renderCell: (cellValues) => {
+ return (
+
+ {cellValues.row.inclus_calcul && String(cellValues.row.inclus_calcul) === "1" && "Oui"}
+ {cellValues.row.inclus_calcul && String(cellValues.row.inclus_calcul) === "0" && "Non"}
+
+
+
+ );
+ }
+ },
+ { field: 'commentaire', headerName: 'commentaire', minWidth: 150, flex: 1, renderCell: (params) => , },
+
+ {
+ field: "delete", headerName: 'Supprimer',
+ renderCell: (cellValues) => {
+ return (
+
+ <>
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, la caractéristique financière sera définitivement supprimée de cette formation .
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+ }
+ >
+
+
+ );
+ }
+ },
+ ]
+
+ const [selectionModel_list_finance_data, setselectionModel_list_finance_data] = React.useState([]);
+
+
+ const [selectionModel_list_evaluation_nite_enseignement, setselectionModel_list_evaluation_nite_enseignement] = React.useState([]);
+
+ const columns_list_evaluation_unite_enseignement = [
+ { field: 'id', headerName: 'id', hide: true },
+ { field: '_id', headerName: '_id', hide: true },
+ { field: 'class_id', headerName: 'class_id', Width: 0, hide: true, },
+
+ { field: 'class_ue_id', headerName: 'class_ue_id', Width: 0, hide: true },
+
+ {
+ field: 'class_ue_code', headerName: 'Code UE', minWidth: 150, flex: 1, renderCell: (params) => ,
+ renderCell: (cellValues) => {
+ return (
+
+ {New_Getall_Class_List_UE_result && New_Getall_Class_List_UE_result.length > 0 &&
+ {New_Getall_Class_List_UE_result.filter((data) => (data)._id === String(cellValues.row.class_ue_id))[0].label}
+
+ {/*cellValues.row.class_ue_id*/}
+ }
+
+
+
+
+ );
+ }
+ },
+
+
+ { field: 'type_evaluation_id', headerName: 'type_evaluation_id', Width: 0, hide: true, },
+
+ {
+ field: 'type_evaluation_code', headerName: 'Type Eval', minWidth: 150, flex: 1, renderCell: (params) => ,
+ renderCell: (cellValues) => {
+ return (
+
+ {New_Getall_Partner_Type_Evalution_List_result && New_Getall_Partner_Type_Evalution_List_result.length > 0 &&
+ {New_Getall_Partner_Type_Evalution_List_result.filter((data) => (data)._id === String(cellValues.row.type_evaluation_id))[0].label}
+ }
+
+
+
+
+ );
+ }
+ },
+ { field: 'ponderation_type_eval', headerName: 'Poids. Type Eval.', minWidth: 150, flex: 1, renderCell: (params) => , },
+
+
+ { field: 'max_note', headerName: 'max_note', minWidth: 150, flex: 1, renderCell: (params) => , },
+
+ {
+ field: "delete", headerName: 'Supprimer',
+ renderCell: (cellValues) => {
+ return (
+
+ <>
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, l'évaluation définitivement supprimée de l'UE ainsi que de la formation .
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+ }
+ >
+
+ );
+ }
+ },
+
+ ]
+
+
+ function handleClick_delete_evaluation_ue_class(event, cellValues) {
+ Delete_Given_Evaluation_UE_Class(cellValues.row._id);
+ }
+
+
+ const [Delete_Given_Evaluation_UE_Class_api, setDelete_Given_Evaluation_UE_Class_api] = useState();
+ const [Delete_Given_Evaluation_UE_Class_message, setDelete_Given_Evaluation_UE_Class_message] = useState();
+ const [Delete_Given_Evaluation_UE_Class_result, setDelete_Given_Evaluation_UE_Class_result] = useState();
+ function Delete_Given_Evaluation_UE_Class(local_evaluation_ue_id) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("class_ue_evaluation_id", local_evaluation_ue_id);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_Class_UE_Evaluation/";
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Delete_Given_Evaluation_UE_Class res.data.status = " + res.data.status);
+ //console.log(" In Delete_Given_Evaluation_UE_Class res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ setDelete_Given_Evaluation_UE_Class_api("true");
+ setDelete_Given_Evaluation_UE_Class_result(res.data.message);
+
+ Getall_Class_List_Evalution();
+
+ setadd_ue_evalution("");
+ setselected_ue_id("");
+ setselected_eu_evalution_id("");
+ setsetgridline_evaluation_ue_id("");
+ setp_detail_max_note("");
+ setp_detail_ponderation_type_eval("");
+ setclass_unite_enseignement_type_evaluation_id("");
+
+ }
+ else {
+ setDelete_Given_Evaluation_UE_Class_api("false");
+ setDelete_Given_Evaluation_UE_Class_message(res.data.message);
+
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ // alert(res.data.message);
+
+
+ }
+
+ }).catch((error) => {
+
+ console.warn('Delete_Given_Evaluation_UE_Class : Not good man :( mysearchtext = ' + error);
+ setDelete_Given_Evaluation_UE_Class_api("false");
+ alert(" Impossible de supprimer l'évaluation ");
+ })
+ }
+
+
+ function handleClick_delete_UE_From_Class(event, cellValues) {
+ Delete_Given_UE_From_Class(cellValues.row._id);
+ }
+
+ const [Delete_Given_UE_From_Class_api, setDelete_Given_UE_From_Class_api] = useState();
+ const [Delete_Given_UE_From_Class_message, setDelete_Given_UE_From_Class_message] = useState();
+ const [Delete_Given_UE_From_Class_result, setDelete_Given_UE_From_Class_result] = useState();
+ function Delete_Given_UE_From_Class(local_ue_id) {
+
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ if (props.mytrainingclass['class_id'])
+ form.append("class_id", props.mytrainingclass['class_id']);
+ else
+ form.append("class_id", selected_class_id);
+
+
+ form.append("ue_id", local_ue_id);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_UE_From_Class/";
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Delete_Given_UE_From_Class res.data.status = " + res.data.status);
+ //console.log(" In Delete_Given_UE_From_Class res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ setDelete_Given_UE_From_Class_api("true");
+ setDelete_Given_UE_From_Class_result(res.data.message);
+ Getall_Class_List_UE();
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+ }
+ else {
+ setDelete_Given_UE_From_Class_api("false");
+ setDelete_Given_UE_From_Class_message(res.data.message);
+
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ // alert(res.data.message);
+
+ }
+
+ }).catch((error) => {
+
+ console.warn('Delete_Given_UE_From_Class : Not good man :( mysearchtext = ' + error);
+ setDelete_Given_UE_From_Class_api("false");
+ alert(" Impossible de supprimer l'UE ");
+ })
+ }
+
+ const [ue_gridline_id, setue_gridline_id] = useState("");
+
+ const [New_Getall_Class_List_UE_result, setNew_Getall_Class_List_UE_result] = useState([]);
+
+ const [Getall_Class_List_UE_api, setGetall_Class_List_UE_api] = useState();
+ const [Getall_Class_List_UE_message, setGetall_Class_List_UE_message] = useState();
+ const [Getall_Class_List_UE_result, setGetall_Class_List_UE_result] = useState([]);
+ function Getall_Class_List_UE(event) {
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ if (props.mytrainingclass['class_id'])
+ form.append("class_id", props.mytrainingclass['class_id']);
+ else if (selected_class_id)
+ form.append("class_id", selected_class_id);
+ else
+ form.append("class_internal_url", props.mytrainingclass['class_internal_url']);
+
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Unite_Enseignement_Of_Given_Class/";
+
+ setLoading(true);
+
+ axios.post(myurl, form).then(res => {
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Class_List_UE res.data.status = " + res.data.status);
+ // console.log(" In Getall_Class_List_UE res.data.message r_class = " + res.data.message);
+ setGetall_Class_List_UE_api("true");
+ setGetall_Class_List_UE_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_titre = JSON.parse(x).titre;
+
+
+ var local_credit = JSON.parse(x).credit;
+ var local_pres_dist_hyp = JSON.parse(x).pres_dist_hyp;
+ var local_is_noted = JSON.parse(x).is_noted;
+ var local_coefficient = JSON.parse(x).coefficient;
+ var local_seuil_validation = JSON.parse(x).seuil_validation;
+
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_code + " - " + String(local_titre).substring(0, 20),
+ "code": local_code,
+ "titre": local_titre,
+ "credit": local_credit,
+ "pres_dist_hyp": local_pres_dist_hyp,
+ "is_noted": local_is_noted,
+ "coefficient": local_coefficient,
+ "seuil_validation": local_seuil_validation,
+
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "code": "",
+ "titre": "",
+ "credit": "",
+ "pres_dist_hyp": "",
+ "is_noted": "",
+ "coefficient": "",
+ "seuil_validation": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Getall_Class_List_UE_result(new_data2);
+ }
+ else {
+ setGetall_Class_List_UE_api("false");
+ setGetall_Class_List_UE_message(res.data.message);
+ //alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+
+ setLoading(false);
+ console.warn('Not good man :( Getall_Class_List_UE = ', error);
+ setGetall_Class_List_UE_api("false");
+ alert(" Impossible de recuperer la liste des UE de la formation");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ // Debut Gestion Finance
+ const New_Option_Type_Cout = [
+ { "id": "fixe", "label": "Charge Fixe", "value": "fixe" },
+ { "id": "variable", "label": "Charge Variable", "value": "variable" },
+ { "id": "produit", "label": "Produit", "value": "produit" },
+ { "id": "autre", "label": "Autre", "value": "autre" },
+ { "id": "", "label": "", "value": "" },
+ ]
+
+
+ const [add_one_finance_data_to_class, setadd_one_finance_data_to_class] = useState("");
+ const [display_finance_data_to_class, setdisplay_finance_data_to_class] = useState("");
+ const [edit_finance_data_to_class, setedit_finance_data_to_class] = useState("");
+
+ const [selected_finance_data_id, setselected_finance_data_id] = useState("");
+ const [finance_data_gridline_id, setfinance_data_gridline_id] = useState("");
+ const [p_detail_fin_data_code, setp_detail_fin_data_code] = useState("");
+ const [p_detail_fin_data_description, setp_detail_fin_data_description] = useState("");
+ const [p_detail_fin_data_commentaire, setp_detail_fin_data_commentaire] = useState("");
+ const [p_detail_fin_data_montant, setp_detail_fin_data_montant] = useState("");
+ const [p_detail_fin_data_type_cout, setp_detail_fin_data_type_cout] = useState("");
+
+ const [p_detail_fin_data_inclus_calcul, setp_detail_fin_data_inclus_calcul] = useState("");
+
+ function clean_financial_data_fields() {
+ setp_detail_fin_data_code("");
+ setp_detail_fin_data_description("");
+ setp_detail_fin_data_commentaire("");
+ setp_detail_fin_data_montant("");
+ setp_detail_fin_data_type_cout("");
+ setadd_one_finance_data_to_class("");
+ setdisplay_finance_data_to_class("");
+ setedit_finance_data_to_class("");
+ setp_detail_fin_data_inclus_calcul("");
+
+ }
+
+ const [New_Getall_Class_Finance_Caracteristic_result, setNew_Getall_Class_Finance_Caracteristic_result] = useState([]);
+
+ const [Getall_Class_Finance_Caracteristic_api, setGetall_Class_Finance_Caracteristic_api] = useState();
+ const [Getall_Class_Finance_Caracteristic_message, setGetall_Class_Finance_Caracteristic_message] = useState();
+ const [Getall_Class_Finance_Caracteristic_result, setGetall_Class_Finance_Caracteristic_result] = useState([]);
+ function Getall_Class_Finance_Caracteristic(event) {
+
+ var form = new FormData();
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ form.append("related_collection", "myclass");
+
+ if (props.mytrainingclass['class_id'])
+ form.append("related_collection_id", props.mytrainingclass['class_id']);
+ else if (selected_class_id)
+ form.append("related_collection_id", selected_class_id);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Financial_Caracteristique_no_filter/";
+
+ setLoading(true);
+
+ axios.post(myurl, form).then(res => {
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Class_Finance_Caracteristic res.data.status = " + res.data.status);
+ // console.log(" In Getall_Class_Finance_Caracteristic res.data.message r_class = " + res.data.message);
+ setGetall_Class_Finance_Caracteristic_api("true");
+ setGetall_Class_Finance_Caracteristic_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_description = JSON.parse(x).description;
+ var local_commentaire = JSON.parse(x).commentaire;
+ var local_montant = JSON.parse(x).montant;
+ var local_type_cout = JSON.parse(x).type_cout;
+ var local_inclus_calcul = JSON.parse(x).inclus_calcul;
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_code,
+ "code": local_code,
+ "description": local_description,
+ "commentaire": local_commentaire,
+ "montant": local_montant,
+ "type_cout": local_type_cout,
+ "inclus_calcul": local_inclus_calcul,
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "code": "",
+ "description": "",
+ "commentaire": "",
+ "montant": "",
+ "type_cout": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Getall_Class_Finance_Caracteristic_result(new_data2);
+ }
+ else {
+ setGetall_Class_Finance_Caracteristic_api("false");
+ setGetall_Class_Finance_Caracteristic_message(res.data.message);
+ //alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+
+ setLoading(false);
+ console.warn('Not good man :( Getall_Class_Finance_Caracteristic = ', error);
+ setGetall_Class_Finance_Caracteristic_api("false");
+ alert(" Impossible de recuperer la liste des UE de la formation");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [Add_Update_Financial_Caracteristic_api, setAdd_Update_Financial_Caracteristic_api] = useState();
+ const [Add_Update_Financial_Caracteristic_message, setAdd_Update_Financial_Caracteristic_message] = useState();
+ const [Add_Update_Financial_Caracteristic_result, setAdd_Update_Financial_Caracteristic_result] = useState();
+ function Add_Update_Financial_Caracteristic() {
+ setLoading(true);
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ form.append("related_collection", "myclass");
+ if (props.mytrainingclass['class_id'])
+ form.append("related_collection_id", props.mytrainingclass['class_id']);
+ else
+ form.append("related_collection_id", selected_class_id);
+
+ form.append("code", p_detail_fin_data_code);
+ form.append("description", p_detail_fin_data_description);
+ form.append("commentaire", p_detail_fin_data_commentaire);
+ form.append("montant", p_detail_fin_data_montant);
+ form.append("type_cout", p_detail_fin_data_type_cout);
+
+ if (p_detail_fin_data_inclus_calcul) {
+ form.append("inclus_calcul", "1");
+ } else {
+ form.append("inclus_calcul", "0");
+ }
+
+
+ var myurl = "";
+
+ if (String(selected_finance_data_id).length < 5) {
+
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Financial_Caracteristique/";
+
+ } else {
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Financial_Caracteristique/";
+ form.append("_id", selected_finance_data_id);
+ }
+
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ // console.log(" In Add_Update_Financial_Caracteristic res.data.status = " + res.data.status);
+ //console.log(" In Add_Update_Financial_Caracteristic res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ setAdd_Update_Financial_Caracteristic_api("true");
+ setAdd_Update_Financial_Caracteristic_result(res.data.message);
+ clean_financial_data_fields();
+
+ Getall_Class_Finance_Caracteristic();
+
+ Dialog_Financial_Data_handleClose_buton();
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+
+ }
+ else {
+ setAdd_Update_Financial_Caracteristic_api("false");
+ setAdd_Update_Financial_Caracteristic_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Add_Update_Financial_Caracteristic : Not good man :( mysearchtext = ' + error);
+ setAdd_Update_Financial_Caracteristic_api("false");
+ // alert(" Impossible d'ajouter l'évaluation l'UE ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'ajouter l'évaluation l'UE");
+ setalert_type("error");
+
+ })
+ }
+
+ const [Delete_Given_Financial_Caracteristique_api, setDelete_Given_Financial_Caracteristique_api] = useState();
+ const [Delete_Given_Financial_Caracteristique_message, setDelete_Given_Financial_Caracteristique_message] = useState();
+ const [Delete_Given_Financial_Caracteristique_result, setDelete_Given_Financial_Caracteristique_result] = useState();
+ function Delete_Given_Financial_Caracteristique(fi_ca_id) {
+
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("tab_id", fi_ca_id);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Delete_List_Financial_Caracteristique/";
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Delete_Given_Financial_Caracteristique res.data.status = " + res.data.status);
+ //console.log(" In Delete_Given_Financial_Caracteristique res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ setDelete_Given_Financial_Caracteristique_api("true");
+ setDelete_Given_Financial_Caracteristique_result(res.data.message);
+ clean_financial_data_fields();
+
+ Getall_Class_Finance_Caracteristic();
+
+ Dialog_Financial_Data_handleClose_buton();
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+ }
+ else {
+ setDelete_Given_Financial_Caracteristique_api("false");
+ setDelete_Given_Financial_Caracteristique_message(res.data.message);
+
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ // alert(res.data.message);
+
+ }
+
+ }).catch((error) => {
+
+ console.warn('Delete_Given_Financial_Caracteristique : Not good man :( mysearchtext = ' + error);
+ setDelete_Given_Financial_Caracteristique_api("false");
+ alert(" Impossible de supprimer la donnée ");
+ })
+ }
+
+ function Annule_Add_One_Caracteristique_fina_DetailFields() {
+ setp_detail_fin_data_code("");
+ setp_detail_fin_data_description("");
+ setp_detail_fin_data_commentaire("");
+ setp_detail_fin_data_montant("");
+ setp_detail_fin_data_type_cout("");
+ setadd_one_finance_data_to_class("");
+ setdisplay_finance_data_to_class("");
+ setedit_finance_data_to_class("");
+
+ }
+
+ // Fin Gestion Finance
+
+ const [New_Getall_Partner_List_UE_result, setNew_Getall_Partner_List_UE_result] = useState([]);
+
+ const [Getall_Partner_List_UE_api, setGetall_Partner_List_UE_api] = useState();
+ const [Getall_Partner_List_UE_message, setGetall_Partner_List_UE_message] = useState();
+ const [Getall_Partner_List_UE_result, setGetall_Partner_List_UE_result] = useState();
+ function Getall_Partner_List_UE(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_Unite_Enseignement_no_filter/";
+
+ setLoading(true);
+
+ axios.post(myurl, form).then(res => {
+
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Partner_List_UE res.data.status = " + res.data.status);
+ // console.log(" In Getall_Partner_List_UE res.data.message r_class = " + res.data.message);
+ setGetall_Partner_List_UE_api("true");
+ setGetall_Partner_List_UE_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_titre = JSON.parse(x).titre;
+
+ var local_ects = JSON.parse(x).ects;
+ var local_seuil_validation = JSON.parse(x).seuil_validation;
+
+
+ var local_credit = JSON.parse(x).credit;
+ var local_pres_dist_hyp = JSON.parse(x).pres_dist_hyp;
+ var local_is_noted = JSON.parse(x).is_noted;
+
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_code,
+ "code": local_code,
+ "titre": local_titre,
+ "credit": local_credit,
+ "pres_dist_hyp": local_pres_dist_hyp,
+ "is_noted": local_is_noted,
+
+ "ects": local_ects,
+ "seuil_validation": local_seuil_validation,
+
+ };
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0)
+ setNew_Getall_Partner_List_UE_result(new_data2);
+ }
+ else {
+ setGetall_Partner_List_UE_api("false");
+ setGetall_Partner_List_UE_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+
+ setLoading(false);
+ console.warn('Not good man :( Getall_Partner_List_UE = ', error);
+ setGetall_Partner_List_UE_api("false");
+ alert(" Impossible de recuperer la liste des UE de la formation");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [New_Getall_Partner_Type_Evalution_List_result, setNew_Getall_Partner_Type_Evalution_List_result] = useState([]);
+
+ const [Getall_Partner_Type_Evalution_List_api, setGetall_Partner_Type_Evalution_List_api] = useState();
+ const [Getall_Partner_Type_Evalution_List_message, setGetall_Partner_Type_Evalution_List_message] = useState();
+ const [Getall_Partner_Type_Evalution_List_result, setGetall_Partner_Type_Evalution_List_result] = useState([]);
+ function Getall_Partner_Type_Evalution_List(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_Type_Evaluation/";
+
+ setLoading(true);
+
+ axios.post(myurl, form).then(res => {
+
+
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Partner_Type_Evalution_List res.data.status = " + res.data.status);
+ //console.log(" In Getall_Partner_Type_Evalution_List res.data.message r_class = " + res.data.message);
+ setGetall_Partner_Type_Evalution_List_api("true");
+ setGetall_Partner_Type_Evalution_List_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,
+ "code": local_code,
+ "nom": local_nom,
+
+
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "code": "",
+ "nom": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Getall_Partner_Type_Evalution_List_result(new_data2);
+ }
+ else {
+ setGetall_Partner_Type_Evalution_List_api("false");
+ setGetall_Partner_Type_Evalution_List_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+
+ setLoading(false);
+ console.warn('Not good man :( Getall_Partner_Type_Evalution_List = ', error);
+ setGetall_Partner_Type_Evalution_List_api("false");
+ alert(" Impossible de recuperer la liste des types d'evaluation");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ 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(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ if (props.mytrainingclass['class_id'])
+ form.append("class_id", props.mytrainingclass['class_id']);
+ else
+ form.append("class_id", selected_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_type_evaluation_id = JSON.parse(x).type_evaluation_id;
+ var local_max_note = JSON.parse(x).max_note;
+ var local_ponderation_type_eval = JSON.parse(x).ponderation_type_eval;
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_class_id,
+ "class_id": local_class_id,
+ "class_ue_id": local_class_ue_id,
+ "type_evaluation_id": local_type_evaluation_id,
+ "max_note": local_max_note,
+ "ponderation_type_eval": local_ponderation_type_eval,
+
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "class_id": "",
+ "class_ue_id": "",
+ "type_evaluation_id": "",
+ "max_note": "",
+ "ponderation_type_eval": ""
+
+ };
+ 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);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).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 formation");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const presentiel = [
+ {
+ value: '1',
+ label: 'Oui',
+ },
+ {
+ value: '0',
+ label: 'Non',
+ },
+
+ ];
+
+ const support_training_list = [
+ {
+ value: 'video',
+ label: 'Video',
+ },
+ {
+ value: 'document',
+ label: 'Document',
+ },
+ {
+ value: 'réalité virtuelle',
+ label: 'Réalité Virtuelle',
+ },
+ {
+ value: 'mixte',
+ label: 'Mixte',
+ },
+ {
+ value: 'autre',
+ label: 'Autre',
+ },
+ {
+ value: 'n/a',
+ label: 'n/a',
+ },
+
+ ];
+
+
+ const New_support_training_list = [
+ {
+ value: 'video',
+ label: 'Video',
+ },
+ {
+ value: 'document',
+ label: 'Document',
+ },
+ {
+ value: 'réalité virtuelle',
+ label: 'Réalité Virtuelle',
+ },
+ {
+ value: 'mixte',
+ label: 'Mixte',
+ },
+ {
+ value: 'autre',
+ label: 'Autre',
+ },
+ {
+ value: 'n/a',
+ label: 'n/a',
+ },
+
+ ];
+ const duration_unit_list = [
+ {
+ value: 'heure',
+ label: 'Heures',
+ },
+
+ {
+ value: 'jour',
+ label: 'Jours',
+ },
+ {
+ value: 'semaine',
+ label: 'Semaines',
+ },
+ {
+ value: 'mois',
+ label: 'Mois',
+ },
+ {
+ value: 'user_rythme',
+ label: 'Rythme stagiaire',
+ }
+ ];
+
+
+ const New_duration_unit_list = [
+ {
+ value: 'heure',
+ label: 'Heures',
+ },
+
+ {
+ value: 'jour',
+ label: 'Jours',
+ },
+ {
+ value: 'semaine',
+ label: 'Semaines',
+ },
+ {
+ value: 'mois',
+ label: 'Mois',
+ },
+ {
+ value: 'user_rythme',
+ label: 'Rythme stagiaire',
+ }
+ ];
+
+
+
+ const publiee = [
+ {
+ value: '1',
+ label: 'Oui',
+ },
+ {
+ value: '0',
+ label: 'Non',
+ },
+
+ ];
+
+
+
+ function handleOnClose(event) {
+ setShowModal(false);
+ }
+
+
+
+ function DeleteClass(event) {
+
+ var code = document.getElementsByName("external_code")[0].value;
+ var server_address = "127.0.0.1";
+ //var server_address = "89.156.84.196";
+
+
+
+ var formData = new FormData();
+ const stored_cookie = getCookie('tokenmysypart');
+ formData.append("token", stored_cookie);
+ formData.append("class_internal_url", props.mytrainingclass['ref']);
+
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/delete_Class_by_internal_url/";
+ setLoading(true);
+ fetch(
+ myurl,
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+ //console.log('Success:', result['message'], "result['status'] = ", result['status']);
+ setimportmessage(result['message']);
+ setmyApiResponse(result['status']);
+
+
+ if (String(result['status']) === "true") {
+ //alert(result['status']+" -- "+myApiResponse+' mess = '+result['message']);
+ document.getElementsByName("external_code")[0].value = "";
+ document.getElementsByName("title")[0].value = "";
+
+ //document.getElementsByName("objectif")[0].value = "";
+ //document.getElementsByName("programme")[0].value = "";
+ //document.getElementsByName("prerequis")[0].value = "";
+
+
+ //document.getElementsByName("description2")[0].value = "";
+
+ document.getElementsByName("distentiel")[0].value = "";
+ document.getElementsByName("price")[0].value = "";
+ document.getElementsByName("domaine")[0].value = "";
+ document.getElementsByName("duree")[0].value = "";
+ //document.getElementsByName("mots_cle")[0].value = "";
+ //document.getElementsByName("plus_produit")[0].value = "";
+ document.getElementsByName("url")[0].value = "";
+ document.getElementsByName("lms_class_code")[0].value = "";
+ document.getElementsByName("class_inscription_url")[0].value = "";
+ document.getElementsByName("metier")[0].value = "";
+
+ document.getElementsByName("note")[0].value = "";
+
+ //document.getElementsByName("objectif")[0].value = "";
+ //document.getElementsByName("programme")[0].value = "";
+ //document.getElementsByName("prerequis")[0].value = "";
+ // alert(" La formation a été correctement supprimée.");
+
+ history.push({
+ pathname: "/Partner/",
+ state: {
+ current_pack: props.currentpack, local_sub_menu: 'affichage', price: "",
+ period: "", new_pack: ""
+ }
+ });
+ window.location.reload();
+ } else if (String(result['status']) === "false") {
+ // alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+
+ } else if (String(result['status']) === String("Err_Connexion")) {
+ alert('Erreur: ' + result['message']);
+ history.push("/Connexion");
+ }
+
+
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error('Error:', error);
+ setmyApiResponse("false");
+ });
+ }
+
+ const [New_Getall_Training_Employee_No_Filter_result, setNew_Getall_Training_Employee_No_Filter_result] = useState([]);
+
+ const [Getall_Training_Employee_No_Filter_api, setGetall_Training_Employee_No_Filter_api] = useState();
+ const [Getall_Training_Employee_No_Filter_message, setGetall_Training_Employee_No_Filter_message] = useState();
+ const [Getall_Training_Employee_No_Filter_result, setGetall_Training_Employee_No_Filter_result] = useState();
+ function Getall_Training_Employee_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_Humaine_no_filter/";
+
+
+
+ axios.post(myurl, form).then(res => {
+
+ setLoading(true);
+
+ if (String(res.data.status) === String("true")) {
+ setLoading(false);
+ //console.log(" In Getall_Training_Employee_No_Filter res.data.status = " + res.data.status);
+ //console.log(" In Getall_Training_Employee_No_Filter res.data.message r_class = " + res.data.message);
+ setGetall_Training_Employee_No_Filter_api("true");
+ setGetall_Training_Employee_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_prenom = JSON.parse(x).prenom;
+ var local_ismanager = JSON.parse(x).ismanager;
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom + " " + local_prenom,
+ "nom": local_nom,
+ "prenom": local_prenom,
+ "ismanager": local_ismanager
+ };
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0)
+ setNew_Getall_Training_Employee_No_Filter_result(new_data2);
+
+ }
+ else {
+ setGetall_Training_Employee_No_Filter_api("false");
+ setGetall_Training_Employee_No_Filter_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Training_Employee_No_Filter = ', error);
+ setGetall_Training_Employee_No_Filter_api("false");
+ alert(" Impossible de recuperer la liste des employés");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [history_securite_read, sethistory_securite_read] = useState("");
+
+ useEffect(() => {
+
+ Get_List_Domaines();
+ Get_List_Metiers();
+ Get_List_Categorie();
+
+ Get_Partner_Object_Specific_Fields("myclass");
+ Getall_Training_Employee_No_Filter();
+ Get_List_Niveau_Formation();
+
+ setfield_description("");
+ setfield_objectif("");
+ setfield_programme("");
+ setfield_prerequis("");
+ setfield_mots_cle("");
+ setfield_plus_produit("");
+ setfield_datelieu("");
+ setfield_zone_diffusion("");
+ setmyApiResponse();
+ Getall_Partner_Type_Evalution_List();
+ Getall_Class_List_Evalution();
+ setfield_contenu_attestation("");
+ Getall_Parter_referentiel_padagogique();
+
+ fillfield();
+
+ sethistory_securite_read(props.check_user_acces_right("historique", "read"))
+
+ if (props.mytrainingclass['class_external_code']) {
+ getClassImage();
+ //console.log("props.mytrainingclass['plus_produit'] = " + props.mytrainingclass['plus_produit']);
+ setplus_produit_enabled(props.mytrainingclass['plus_produit']);
+ setmots_cle_enabled(props.mytrainingclass['mots_cle']);
+ setzone_diffusion_enabled(props.mytrainingclass['zone_diffusion']);
+ Getall_Class_List_UE();
+ Getall_Partner_List_UE();
+ }
+
+ setdatamodification("0");
+
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ submenu_detail_formation();
+
+ }, [props.mytrainingclass['ref'],]);
+
+
+ const [mytraining_ref_peda_id, setmytraining_ref_peda_id] = useState("");
+
+
+ const [New_Getall_Parter_referentiel_padagogique_result, setNew_Getall_Parter_referentiel_padagogique_result] = useState([]);
+
+ const [Getall_Parter_referentiel_padagogique_api, setGetall_Parter_referentiel_padagogique_api] = useState();
+ const [Getall_Parter_referentiel_padagogique_message, setGetall_Parter_referentiel_padagogique_message] = useState();
+ const [Getall_Parter_referentiel_padagogique_result, setGetall_Parter_referentiel_padagogique_result] = useState([]);
+ function Getall_Parter_referentiel_padagogique(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_Ref_Pedagogique_no_filter/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Parter_referentiel_padagogique res.data.status = " + res.data.status);
+ //console.log(" In Getall_Parter_referentiel_padagogique res.data.message r_class = " + res.data.message);
+ setGetall_Parter_referentiel_padagogique_api("true");
+ setGetall_Parter_referentiel_padagogique_result(res.data.message);
+ //setRows(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_commentaire = JSON.parse(x).commentaire;
+ var local_code = JSON.parse(x).code;
+ var local_description = JSON.parse(x).description;
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_code,
+ "commentaire": local_commentaire,
+ "code": local_code,
+ "description": local_description,
+
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "commentaire": "",
+ "code": "",
+ "description": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Getall_Parter_referentiel_padagogique_result(new_data2);
+
+ }
+ else {
+ setGetall_Parter_referentiel_padagogique_api("false");
+ setGetall_Parter_referentiel_padagogique_message(res.data.message);
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Parter_referentiel_padagogique = ', error);
+ setGetall_Parter_referentiel_padagogique_api("false");
+ alert(" Impossible de recuperer la liste des référentiels pédagogiques");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+ const [field_description, setfield_description] = useState("");
+ const [field_objectif, setfield_objectif] = useState("");
+ const [field_programme, setfield_programme] = useState("");
+
+ const [field_methode_pedago, setfield_methode_pedago] = useState("");
+ const [field_handicap, setfield_handicap] = useState("");
+
+ const [field_suivi_eval, setfield_suivi_eval] = useState("");
+
+
+ const [field_prerequis, setfield_prerequis] = useState("");
+ const [field_pourqui, setfield_pourqui] = useState("");
+ const [field_mots_cle, setfield_mots_cle] = useState("");
+ const [field_plus_produit, setfield_plus_produit] = useState("");
+
+ const [field_datelieu, setfield_datelieu] = useState("");
+ const [field_zone_diffusion, setfield_zone_diffusion] = useState("");
+
+ const [selected_class_id, setselected_class_id] = useState("");
+
+ const [field_contenu_attestation, setfield_contenu_attestation] = useState("");
+
+
+ function fillfield(event) {
+ setisupdateclass(true);
+ // DisableTraining();
+ var val = props.mytrainingclass['ref'];
+
+
+ // si la reference n'est pas rempli, alors on fait de la creation
+ // si non il s'agit get pour un update/
+ if (!val) {
+ setisupdateclass(false);
+ return;
+ }
+
+
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("internal_url", val);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_partner_class/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ // console.log(" In get_partner_class res.data.status = " + res.data.status);
+ if (String(res.data.status) === String("true") && res.data.message.length > 0) {
+ setLoading(false);
+ // console.log(" In get_partner_class res.data.message r_class = " + res.data.message);
+ setmyApiResponse("True");
+ setResult(res.data.message);
+
+
+ var mylocaltraining = JSON.parse(res.data.message);
+
+
+ if (mylocaltraining) {
+ setdisplayedinternalurl(mylocaltraining.internal_url);
+
+ if (mylocaltraining._id) {
+ setselected_class_id(mylocaltraining._id);
+ Get_List_Of_All_PJ(mylocaltraining._id);
+ Get_Class_Catalogue_File(mylocaltraining._id);
+ }
+
+ //document.getElementsByName("external_code")[0].value = mylocaltraining.external_code;
+ setp_detail_external_code(mylocaltraining.external_code);
+ setp_detail_title(mylocaltraining.title);
+
+ //document.getElementsByName("title")[0].value = mylocaltraining.title;
+
+
+
+ if (mylocaltraining.objectif) {
+ //document.getElementsByName("objectif")[0].value = mylocaltraining.objectif;
+ //alert(" laaaaa ");
+ setfield_objectif(mylocaltraining.objectif);
+ }
+
+
+ if (mylocaltraining.programme) {
+ //document.getElementsByName("programme")[0].value = mylocaltraining.programme;
+ setfield_programme(mylocaltraining.programme);
+ }
+
+
+ if (mylocaltraining.methode_pedagogique) {
+ //document.getElementsByName("programme")[0].value = mylocaltraining.programme;
+ setfield_methode_pedago(mylocaltraining.methode_pedagogique);
+ }
+
+
+ if (mylocaltraining.suivi_eval) {
+ //document.getElementsByName("programme")[0].value = mylocaltraining.programme;
+ setfield_suivi_eval(mylocaltraining.suivi_eval);
+ }
+
+ if (mylocaltraining.condition_handicape) {
+ //document.getElementsByName("programme")[0].value = mylocaltraining.programme;
+ setfield_handicap(mylocaltraining.condition_handicape);
+ }
+
+
+ if (mylocaltraining.pourqui) {
+ //document.getElementsByName("programme")[0].value = mylocaltraining.programme;
+ setfield_pourqui(mylocaltraining.pourqui);
+ }
+
+
+
+ if (mylocaltraining.note_finale_calculation_rule_id) {
+ setselected_class_note_calculation_id(mylocaltraining.note_finale_calculation_rule_id);
+ } else {
+ setselected_class_note_calculation_id("");
+ }
+
+
+
+ if (mylocaltraining.prerequis) {
+ //document.getElementsByName("prerequis")[0].value = mylocaltraining.prerequis;
+ setfield_prerequis(mylocaltraining.prerequis);
+ }
+
+ //document.getElementsByName("description2")[0].value = mylocaltraining.description;
+ setfield_description(mylocaltraining.description);
+
+
+ setp_formateur_label("-");
+ if (mylocaltraining.formateur_id) {
+ setp_formateur_id(mylocaltraining.formateur_id);
+ setp_formateur_label(mylocaltraining.formateur_nom_prenom);
+ //console.log(" #### mylocaltraining.formateur_nom_prenom = ", mylocaltraining.formateur_nom_prenom);
+
+ } else {
+ setp_formateur_id("");
+ setp_formateur_label("-");
+
+ }
+
+ if (mylocaltraining.presentiel.distantiel) {
+
+
+ setmydistance(mylocaltraining.presentiel.distantiel);
+ var result2 = presentiel.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.presentiel.distantiel)))
+ if (result2[0]) {
+ setmydistance_label(result2[0].label);
+
+ }
+ } else {
+ setmydistance("0");
+ setmydistance_label("Non");
+ }
+
+
+ if (mylocaltraining.presentiel.presentiel) {
+
+
+ setmypresence(mylocaltraining.presentiel.presentiel);
+ var result2 = presentiel.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.presentiel.presentiel)))
+ if (result2[0]) {
+ setmypresence_label(result2[0].label);
+
+
+ }
+ } else {
+ setmypresence("0");
+ setmypresence_label("Non");
+ }
+
+
+ //setmypresence(mylocaltraining.presentiel.presentiel);
+
+ if (mylocaltraining.published) {
+ setmypublished(mylocaltraining.published);
+ var result2 = publiee.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.published)))
+ if (result2[0])
+ setmypublished_label(result2[0].label);
+ }
+ else {
+ setmypublished("0");
+ setmypublished_label("Non");
+ }
+
+
+ if (mylocaltraining.published_catalog_prive) {
+
+ setmypublished_catalog_prive(mylocaltraining.published_catalog_prive);
+ var result3 = publiee.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.published_catalog_prive)))
+ if (result3[0]) {
+ setmypublished_catalog_prive_label(result3[0].label);
+ }
+ }
+ else {
+ setmypublished_catalog_prive("0");
+ setmypublished_catalog_prive_label("Non");
+ }
+
+
+ if (mylocaltraining.cpf) {
+ setmycpf(mylocaltraining.cpf);
+ var result2 = cpf.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.cpf)))
+ if (result2[0])
+ setmycpf_label(result2[0].label);
+ }
+ else {
+ setmycpf("0");
+ setmycpf_label("Non");
+ }
+
+
+ if (mylocaltraining.support) {
+ setmytrainingsupport(mylocaltraining.support);
+
+ var result2 = New_support_training_list.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.support)))
+ if (result2[0])
+ setmytrainingsupport_label(result2[0].label);
+
+ }
+ else {
+ setmytrainingsupport("n/a");
+ setmytrainingsupport_label("Autre");
+ }
+
+ if (mylocaltraining.duration_unit) {
+ setmytrainingdurationunit(mylocaltraining.duration_unit);
+ //console.log(" ### duration_unit = ", mylocaltraining.duration_unit);
+ }
+ else {
+ setmytrainingdurationunit("heure");
+ }
+
+
+
+ if (mylocaltraining.certif) {
+ setmycertif(mylocaltraining.certif);
+ var result2 = certif.filter((local_mymanager) => local_mymanager.value === String((mylocaltraining.certif)));
+
+
+ if (result2[0]) {
+ setmycertif_label(result2[0].label);
+
+ }
+ }
+ else {
+ setmycertif("0");
+ setmycertif_label("Non");
+ }
+
+ if (mylocaltraining.class_level && String(mylocaltraining.class_level).trim() !== "") {
+ setp_class_level(mylocaltraining.class_level);
+ setp_class_level_label(mylocaltraining.class_level_description);
+
+ }
+ else {
+ setp_class_level("2");
+ setp_class_level_label("Aucune certification");
+ }
+
+
+ if (mylocaltraining.price) {
+ document.getElementsByName("price")[0].value = mylocaltraining.price;
+ setp_detail_price(mylocaltraining.price);
+ }
+ else
+ setp_detail_price("");
+
+
+ if (mylocaltraining.archive) {
+ setp_detail_archive(mylocaltraining.archive);
+ }
+ else
+ setp_detail_archive("0");
+
+
+
+ if (mylocaltraining.referentiel_padagogique_id) {
+ setmytraining_ref_peda_id(mylocaltraining.referentiel_padagogique_id);
+ }
+ else
+ setmytraining_ref_peda_id("");
+
+
+ if (mylocaltraining.domaine) {
+ setmytrainingdomaine(mylocaltraining.domaine);
+ //console.log(" ### mylocaltraining.domaine = ", mylocaltraining.domaine);
+ }
+ else
+ setmytrainingdomaine("");
+
+
+ if (mylocaltraining.metier) {
+ setmytrainingmetier(mylocaltraining.metier);
+ //console.log(" ### mylocaltraining.metier = ", mylocaltraining.metier);
+ }
+ else
+ setmytrainingmetier("");
+
+
+ if (mylocaltraining.categorie) {
+ setmytrainingcategorie(mylocaltraining.categorie);
+ //console.log(" ### mylocaltraining.metier = ", mylocaltraining.metier);
+ }
+ else
+ setmytrainingcategorie("");
+
+
+
+ if (mylocaltraining.duration) {
+ // document.getElementsByName("duree")[0].value = mylocaltraining.duration;
+ setp_detail_duree(mylocaltraining.duration);
+ }
+ else
+ setp_detail_duree("");
+
+
+ //document.getElementsByName("mots_cle")[0].value = "";
+ if (mylocaltraining.mots_cle) {
+ //document.getElementsByName("mots_cle")[0].value = mylocaltraining.mots_cle;
+ setfield_mots_cle(mylocaltraining.mots_cle);
+ }
+
+
+
+
+ document.getElementsByName("note")[0].value = "";
+ if (mylocaltraining.note) {
+ //document.getElementsByName("note")[0].value = mylocaltraining.note;
+ setp_detail_note(mylocaltraining.note);
+ } else {
+ setp_detail_note("");
+ }
+
+ //document.getElementsByName("plus_produit")[0].value = "";
+ if (mylocaltraining.plus_produit) {
+ setfield_plus_produit(mylocaltraining.plus_produit);
+ }
+
+
+ if (mylocaltraining.contenu_attestation) {
+ setfield_contenu_attestation(mylocaltraining.contenu_attestation);
+ }
+
+ document.getElementsByName("url")[0].value = "";
+ if (mylocaltraining.url) {
+ //document.getElementsByName("url")[0].value = mylocaltraining.url;
+ setp_detail_url(mylocaltraining.note);
+ } else {
+ setp_detail_url("");
+ }
+
+ document.getElementsByName("lms_class_code")[0].value = "";
+
+ if (mylocaltraining.lms_class_code) {
+ //document.getElementsByName("lms_class_code")[0].value = mylocaltraining.lms_class_code;
+ setp_detail_lms_class_code(mylocaltraining.lms_class_code);
+ } else {
+ setp_detail_lms_class_code("");
+ }
+
+
+ if (mylocaltraining.version) {
+ //document.getElementsByName("lms_class_code")[0].value = mylocaltraining.lms_class_code;
+ setp_detail_version_catalogue(mylocaltraining.version);
+ } else {
+ setp_detail_version_catalogue("");
+ }
+
+
+ if (mylocaltraining.recyclage_delai) {
+ setp_detail_recyclage_delai(mylocaltraining.recyclage_delai);
+ } else {
+ setp_detail_recyclage_delai("0");
+ }
+
+ if (mylocaltraining.inscription_direct) {
+ setmytrainingdirectinscription(mylocaltraining.inscription_direct);
+ } else {
+ setmytrainingdirectinscription("");
+ }
+
+
+ if (mylocaltraining.recyclage_alert) {
+ setp_detail_recyclage_alert(mylocaltraining.recyclage_alert);
+ } else {
+ setp_detail_recyclage_alert("0");
+ }
+
+
+ document.getElementsByName("class_inscription_url")[0].value = "";
+ if (mylocaltraining.class_inscription_url) {
+ //document.getElementsByName("class_inscription_url")[0].value = mylocaltraining.class_inscription_url;
+ setp_detail_class_inscription_url(mylocaltraining.note);
+ } else {
+ setp_detail_class_inscription_url("");
+ }
+
+ document.getElementsByName("class_banner_img_url")[0].value = "";
+ if (mylocaltraining.img_banner_detail_class) {
+ //document.getElementsByName("class_banner_img_url")[0].value = mylocaltraining.img_banner_detail_class;
+ setp_detail_class_banner_img_url(mylocaltraining.note);
+ } else {
+ setp_detail_class_banner_img_url("");
+ }
+
+ //document.getElementsByName("zone_diffusion")[0].value = "";
+ if (mylocaltraining.zone_diffusion_str) {
+ //document.getElementsByName("zone_diffusion")[0].value = mylocaltraining.zone_diffusion_str;
+ document.getElementsByName("zone_diffusion_v2")[0].value = mylocaltraining.zone_diffusion_str;
+ }
+
+
+
+ getClassImage(mylocaltraining._id);
+ /*
+ * Update 22/10/2023 :
+ Gestion des champs spécifiques. ils commencent tous par 'my_'
+ */
+
+ //console.log(" #### props.rows_champs_specifics = ", props.rows_champs_specifics);
+ for (let i = 0; i < rows_champs_specifics.length; i++) {
+
+ var field_name = JSON.parse(rows_champs_specifics[i]).field_name;
+ var field_type = JSON.parse(rows_champs_specifics[i]).field_type;
+ var field_label = JSON.parse(rows_champs_specifics[i]).field_label;
+ var is_mandatory = JSON.parse(rows_champs_specifics[i]).is_mandatory;
+
+ //console.log(" field_name = ", field_name);
+
+ if (mylocaltraining.hasOwnProperty(field_name)) {
+ var local_valeur = mylocaltraining[String(field_name)]
+
+ if (document.getElementById(String(field_name)))
+ document.getElementById(String(field_name)).value = local_valeur;
+
+ var new_val = { 'field_name': field_name, 'field_value': local_valeur }
+ var johnIndex = findIndexByProperty(spec_field_updated_values, 'field_name', field_name);
+
+ if (johnIndex > -1) {
+ spec_field_updated_values[johnIndex] = new_val;
+
+ } else {
+ spec_field_updated_values.push(new_val);
+ }
+
+ } else {
+ if (document.getElementById(String(field_name)))
+ document.getElementById(String(field_name)).value = "";
+ }
+ }
+
+ setspec_field_updated_values_hooks(spec_field_updated_values);
+ /*
+ * end Update 22/10/2023 :
+ */
+
+ }
+
+ }
+ else if (String(res.data.status) === String("true") && res.data.message.length <= 0) {
+ setLoading(false);
+ setdisplay_alert_mysy("1");
+ setalert_message("Aucune information récupérées");
+ setalert_type("warning");
+ }
+ else {
+ setLoading(false);
+ //console.log(" In test res.data.status = "+res.data.status);
+ //console.log(" In test res.data.message = "+res.data.message);
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ }
+
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( mysearchtext = ', error);
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+ const [title_limite, settitle_limite] = useState(120);
+
+ const editorRef_description = useRef(null);
+ const [editorRef_description_limite, seteditorRef_description_limite] = useState(5000);
+
+
+ const editorRef_objectif = useRef(null);
+ const [editorRef_objectif_limite, seteditorRef_objectif] = useState(5000);
+
+ const editorRef_programme = useRef(null);
+ const [editorRef_programme_limite, seteditorRef_programme] = useState(5000);
+
+
+ const editorRef_methode_pedago = useRef(null);
+ const [editorRef_methode_pedago_limite, seteditorRef_methode_pedago] = useState(2000);
+
+ const editorRef_handicap = useRef(null);
+ const [editorRef_handicap_limite, seteditorRef_handicap_limite] = useState(2000);
+
+ const editorRef_suivi_eval = useRef(null);
+ const [editorRef_suivi_eval_limite, seteditorRef_suivi_eval_limite] = useState(2000);
+
+ const editorRef_prerequis = useRef(null);
+ const editorRef_pourqui = useRef(null);
+ const editorRef_mots_cle = useRef(null);
+ const editorRef_plus_produit = useRef(null);
+ const editorRef_zone_diffusion = useRef(null);
+ const editorRef_date_lieu = useRef(null);
+
+ const editorRef_contenu_attestation = useRef(null);
+ const [editorRef_contenu_attestation_limite, seteditorRef_contenu_attestation_limite] = useState(1000);
+
+
+ const [waiting_before_redirect, setwaiting_before_redirect] = React.useState(true);
+
+ function RecordTraining(event) {
+
+ var code = document.getElementsByName("external_code")[0].value;
+
+ if (code.length < 1) {
+ setdisplay_alert_mysy("1");
+ setalert_message("Le Champ 'code' est obligatoire");
+ setalert_type("error");
+ return;
+ }
+
+
+ // console.log(" ### titre = ", p_detail_title);
+
+ var title = p_detail_title;
+ if (String(title).length > title_limite) {
+
+ setdisplay_alert_mysy("1");
+ setalert_message("Champ 'Titre', limite depassée !");
+ setalert_type("error");
+
+ return;
+ }
+
+ if (title.length < 1) {
+ // alert(" Le Champ 'Titre' est obligatoire")
+ setdisplay_alert_mysy("1");
+ setalert_message("Le Champ 'Titre' est obligatoire");
+ setalert_type("error");
+ return;
+ }
+
+
+ var presentiel = mypresence;
+ var distentiel = mydistance;
+ var domaine = mytrainingdomaine;
+
+ var mypublier = mypublished;
+ var mypublier_catalog_prive = mypublished_catalog_prive;
+ var niveau_ftion = p_class_level;
+ var price = document.getElementsByName("price")[0].value;
+ var duree = document.getElementsByName("duree")[0].value;
+ var url = document.getElementsByName("url")[0].value;
+ var lms_class_code = p_detail_lms_class_code;
+ var class_inscription_url = document.getElementsByName("class_inscription_url")[0].value;
+
+ var mymetier = mytrainingmetier;
+
+ var mycategorie = mytrainingcategorie;
+ var version = p_detail_version_catalogue;
+
+ var mynote = document.getElementsByName("note")[0].value;
+ var localmycpf = mycpf;
+ var local_mycertif = mycertif;
+
+ var trainingSupport = mytrainingsupport;
+ var banniereImg = document.getElementsByName("class_banner_img_url")[0].value;
+
+
+ var pourqui = "";
+ if (editorRef_pourqui.current) {
+ pourqui = editorRef_pourqui.current.getContent();
+ }
+
+ var objectif = "";
+ if (editorRef_objectif.current) {
+ objectif = editorRef_objectif.current.getContent();
+ if (parse(objectif.replace(/(<([^>]+)>)/ig, '')).length > editorRef_objectif_limite) {
+ // alert(" Champ 'Objectif', limite depassée !");
+ setdisplay_alert_mysy("1");
+ setalert_message("Champ 'Objectif', limite depassée !");
+ setalert_type("error");
+ return;
+ }
+ }
+
+ if (objectif.length < 1) {
+ // alert(" Le Champ 'Objectif' est obligatoire");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le Champ 'Objectif' est obligatoire");
+ setalert_type("error");
+ return;
+ }
+
+ var programme = "";
+ if (editorRef_programme.current) {
+ programme = editorRef_programme.current.getContent();
+
+ if (parse(programme.replace(/(<([^>]+)>)/ig, '')).length > editorRef_programme_limite) {
+ //alert(" Champ 'Programme', limite depassée !");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Champ 'Programme', limite depassée !");
+ setalert_type("error");
+ return;
+ }
+ }
+
+ var methode_pedago = "";
+ if (editorRef_methode_pedago.current) {
+ methode_pedago = editorRef_methode_pedago.current.getContent();
+
+ if (parse(methode_pedago.replace(/(<([^>]+)>)/ig, '')).length > editorRef_methode_pedago_limite) {
+ // alert(" Champ 'Méthode pédagogique', limite depassée !");
+ setdisplay_alert_mysy("1");
+ setalert_message("Champ 'Méthode pédagogique', limite depassée !");
+ setalert_type("error");
+ return;
+ }
+ }
+
+ var handicap = "";
+ if (editorRef_handicap.current) {
+ handicap = editorRef_handicap.current.getContent();
+
+ if (parse(handicap.replace(/(<([^>]+)>)/ig, '')).length > editorRef_handicap_limite) {
+ // alert(" Champ 'Handicape', limite depassée !");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Champ 'Handicape', limite depassée !");
+ setalert_type("error");
+ return;
+ }
+ }
+
+
+ var suivi_eval = "";
+ if (editorRef_suivi_eval.current) {
+ suivi_eval = editorRef_suivi_eval.current.getContent();
+
+ if (parse(suivi_eval.replace(/(<([^>]+)>)/ig, '')).length > editorRef_suivi_eval_limite) {
+ // alert(" Champ 'Suivi et Evaluation', limite depassée !");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Champ 'Suivi et Evaluation', limite depassée !");
+ setalert_type("error");
+ return;
+ }
+ }
+
+
+ var prerequis = "";
+ if (editorRef_prerequis.current) {
+ prerequis = editorRef_prerequis.current.getContent();
+ }
+
+ var description = "";
+ if (editorRef_description.current) {
+ description = editorRef_description.current.getContent();
+
+ if (parse(description.replace(/(<([^>]+)>)/ig, '')).length > editorRef_description_limite) {
+ //alert(" Champ 'Description', limite depassée !");
+ setdisplay_alert_mysy("1");
+ setalert_message("Champ 'Description', limite depassée !");
+ setalert_type("error");
+ return;
+ }
+ }
+
+ if (description.length < 1) {
+ // alert(" Le Champ 'Description' est obligatoire");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le Champ 'Description' est obligatoire");
+ setalert_type("error");
+ return;
+ }
+
+ var mots_cle = "";
+ if (editorRef_mots_cle.current) {
+ mots_cle = editorRef_mots_cle.current.getContent();
+ }
+
+ var plus_produit = "";
+ if (editorRef_plus_produit.current) {
+ plus_produit = editorRef_plus_produit.current.getContent();
+ }
+
+ var contenu_attestation = "";
+ if (editorRef_contenu_attestation.current) {
+ contenu_attestation = editorRef_contenu_attestation.current.getContent();
+
+ if (parse(contenu_attestation.replace(/(<([^>]+)>)/ig, '')).length > editorRef_contenu_attestation_limite) {
+ // alert(" Champ 'Suivi et Evaluation', limite depassée !");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Champ 'Contenu Attestation', limite depassée !");
+ setalert_type("error");
+ return;
+ }
+
+ }
+
+
+ // Verification si il y a plus de 3 mot clés separés par des ";"
+ mots_cle = mots_cle.replace(/(<([^>]+)>)/ig, '');
+ mots_cle = mots_cle.replaceAll(" ", '');
+ mots_cle = mots_cle.replaceAll(",", ";");
+
+
+ var words = mots_cle.split(';');
+
+ var traited_list_mot_cle = []
+ for (let i = 0; i < words.length; i++) {
+ //console.log(" ### alanlyse du mot "+String(words[i]))
+ if (words[i] && String(words[i]).length > 2 && String(words[i]).length < 50)
+ traited_list_mot_cle.push(String(words[i]));
+ else if (words[i] && (String(words[i]).length < 2 || String(words[i]).length > 50)) {
+ // alert(" Chaque mot clé doit faire entre 2 et 50 caractères. Le mot '" + String(words[i]) + "' est incorrecte");
+ setdisplay_alert_mysy("1");
+ setalert_message("Chaque mot clé doit faire entre 2 et 50 caractères. Le mot '" + String(words[i]) + "' est incorrecte");
+ setalert_type("error");
+ return;
+ }
+
+ }
+
+ //console.log(" ## traited_list_mot_cle = ", traited_list_mot_cle);
+
+ if (traited_list_mot_cle.length > 3) {
+ // alert(" Il a plus de 3 mots clés. le max autorisé est 3");
+ setdisplay_alert_mysy("1");
+ setalert_message("Il a plus de 3 mots clés. le max autorisé est 3");
+ setalert_type("error");
+ return;
+ }
+
+ var list_mot_cle_string = traited_list_mot_cle.toString().replaceAll(",", ";");
+
+ //console.log(" ## list_mot_cle_string = ", list_mot_cle_string);
+
+ //return;
+
+
+ var myurl = "";
+
+ if (isupdateclass) {
+ // Il s'agit d'une mise à jour
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/update_class/";
+ //alert("Il s'agit d'une mise à jour");
+
+ } else {
+ // Il s'agit d'une creation
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/create_class/";
+ //alert(" Il s'agit d'une creation ");
+ }
+
+
+ //alert(" OK Enreg code = "+code+" distentiel = "+distentiel+" duree = "+duree);
+ const formData = new FormData();
+
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+
+ const stored_cookie = getCookie('tokenmysypart');
+ formData.append("token", stored_cookie);
+
+ if (props.mytrainingclass['class_id'])
+ formData.append("class_id", props.mytrainingclass['class_id']);
+ else
+ formData.append("class_id", selected_class_id);
+
+
+
+
+ formData.append('external_code', code);
+ formData.append('title', title);
+
+ formData.append('objectif', objectif);
+ formData.append('programme', programme);
+
+ formData.append('methode_pedagogique', methode_pedago);
+ formData.append('condition_handicape', handicap);
+
+ formData.append('suivi_eval', suivi_eval);
+
+ formData.append('prerequis', prerequis);
+
+ formData.append('description', description);
+ formData.append('formateur_id', p_formateur_id);
+ // formData.append('presentiel', presentiel);
+ formData.append('domaine', domaine);
+ // formData.append('distantiel', distentiel);
+ formData.append('class_level', niveau_ftion);
+ formData.append('price', price);
+ formData.append('duration', duree);
+ formData.append('duration_unit', mytrainingdurationunit);
+ formData.append('url', url);
+ formData.append('lms_class_code', lms_class_code);
+ formData.append('class_inscription_url', class_inscription_url);
+ formData.append('mots_cle', list_mot_cle_string);
+ formData.append('plus_produit', plus_produit);
+ formData.append('internal_url', displayedinternalurl);
+ formData.append('zone_diffusion', "");
+ formData.append('metier', mymetier);
+ formData.append('categorie', mycategorie);
+ formData.append('version', version);
+ formData.append('referentiel_padagogique_id', mytraining_ref_peda_id);
+
+
+
+ formData.append('recyclage_delai', p_detail_recyclage_delai);
+ formData.append('recyclage_periodicite', p_detail_recyclage_periodicite);
+ formData.append('recyclage_alert', p_detail_recyclage_alert);
+
+ formData.append('inscription_direct', mytrainingdirectinscription);
+
+ formData.append('note', mynote);
+
+ formData.append('published', mypublier);
+
+ formData.append('published_catalog_prive', mypublier_catalog_prive);
+
+ formData.append('cpf', localmycpf);
+
+ formData.append('certif', local_mycertif);
+
+ // console.log(" function mycertif = ", local_mycertif);
+
+ formData.append('pourqui', pourqui);
+ formData.append('support', trainingSupport);
+ formData.append('img_banner_detail_class', banniereImg);
+ formData.append('img_url', banniereImg);
+
+ formData.append('note_finale_calculation_rule_id', selected_class_note_calculation_id);
+
+ formData.append('contenu_attestation', contenu_attestation);
+
+
+ console.log(" ### formData = ", formData)
+ /*
+ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenaire
+ */
+ for (let i = 0; i < spec_field_updated_values_hooks.length; i++) {
+ var local_value = String(spec_field_updated_values_hooks[i].field_value);
+
+ if (String(spec_field_updated_values_hooks[i].field_type) === "float") {
+
+ local_value = local_value.replaceAll(",", ".");
+
+ if (isNaN(local_value)) {
+ // alert("Le champ " + spec_field_updated_values_hooks[i].field_label + " doit être numérique.");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le champ " + spec_field_updated_values_hooks[i].field_label + " doit être numérique.");
+ setalert_type("error");
+ return;
+ }
+
+ }
+ else if (String(spec_field_updated_values_hooks[i].field_type) === "string") {
+
+ }
+ if (String(spec_field_updated_values_hooks[i].is_mandatory) === "1") {
+ if (String(local_value).trim().length <= 0) {
+ // alert("Le champ " + spec_field_updated_values_hooks[i].field_label + " est obligatoire.");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le champ " + spec_field_updated_values_hooks[i].field_label + " est obligatoire.");
+ setalert_type("error");
+ return;
+ }
+
+ }
+
+ formData.append(String(spec_field_updated_values_hooks[i].field_name), local_value);
+ }
+
+ //console.log(" formData = "+formData);
+ setLoading(true);
+
+ fetch(
+ myurl,
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ //console.log('Success:', result['message'], "result['status'] = ", result['status'], "result['class_id'] = ", result['class_id']);
+ setLoading(false);
+ setimportmessage(result['message']);
+ setmyApiResponse(result['status']);
+ setdatamodification("0");
+
+ if (String(result['status']) === "true") {
+
+
+ var myclass_id = String(result['class_id']);
+
+
+ if (String(userimgclassprofilchanged) === "1")
+ sendClassImage(myclass_id);
+ }
+
+ //alert(result['status'] + " -- " + myApiResponse + ' mess = ' + result['message']);
+
+ if (String(result['status']) === "true") {
+
+
+ var txt = "La formation a été correctement ajoutée / mise à jour.";
+ setdisplay_alert_mysy("1");
+ setalert_message(txt);
+ setalert_type("success");
+
+ // alert(" La formation a été correctement ajoutée / mise à jour. Vous allez être redirigé vers la liste des formations.");
+ /*
+ if (waiting_before_redirect === false) {
+ history.push({
+ pathname: "/Partner/",
+ state: {
+ current_pack: props.currentpack, local_sub_menu: 'affichage', price: "",
+ period: "", new_pack: ""
+ }
+ });
+ window.location.reload();
+ }*/
+
+
+ /* history.push({
+ pathname: "/Partner/",
+ state: {
+ current_pack: props.currentpack, local_sub_menu: 'affichage', price: "",
+ period: "", new_pack: ""
+ }
+ });
+ window.location.reload();*/
+ }
+
+ else {
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+ }
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error('Error:', error);
+ setmyApiResponse("false");
+ });
+ };
+
+
+
+ function Record_Training_Calcul_Note(event) {
+
+ const formData = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ formData.append("token", stored_cookie);
+ formData.append('note_finale_calculation_rule_id', selected_class_note_calculation_id);
+ formData.append('internal_url', props.mytrainingclass['ref']);
+ if (props.mytrainingclass['class_id'])
+ formData.append("class_id", props.mytrainingclass['class_id']);
+ else
+ formData.append("class_id", selected_class_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/update_class/";
+
+ // console.log(" formData = ", formData);
+ setLoading(true);
+
+ fetch(
+ myurl,
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ //console.log('Success:', result['message'], "result['status'] = ", result['status'], "result['class_id'] = ", result['class_id']);
+ setLoading(false);
+
+ setdatamodification("0");
+
+ if (String(result['status']) === "true") {
+ var myclass_id = String(result['class_id']);
+
+ if (String(userimgclassprofilchanged) === "1")
+ sendClassImage(myclass_id);
+ }
+
+ //alert(result['status'] + " -- " + myApiResponse + ' mess = ' + result['message']);
+
+ if (String(result['status']) === "true") {
+
+
+ var txt = "La formation a été correctement ajoutée / mise à jour.";
+ setdisplay_alert_mysy("1");
+ setalert_message(txt);
+ setalert_type("success");
+
+
+ }
+
+ else {
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+ }
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error('Error:', error);
+ setmyApiResponse("false");
+ });
+ };
+
+ function DataUpdated() {
+ if (String(props.check_user_acces_right("formation", "write")) === "1") {
+ setdatamodification("1");
+ setimportmessage();
+ }
+
+ }
+
+ const [mytrainingcategorie, setmytrainingcategorie] = useState("");
+
+ const [New_Get_List_Categorie_result, setNew_Get_List_Categorie_result] = useState([]);
+
+ const [Get_List_Categorie_api, setGet_List_Categorie_api] = useState();
+ const [Get_List_Categorie_message, setGet_List_Categorie_message] = useState();
+ const [Get_List_Categorie_result, setGet_List_Categorie_result] = useState();
+ function Get_List_Categorie() {
+ 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_Categorie/";
+ setLoading(true);
+ fetch(myurl,
+ {
+ method: 'POST',
+ body: form,
+ })
+ .then((data) => data.json())
+ .then((data) => {
+ setLoading(false);
+ // console.log(' IN Get_List_Categorie Success:', data['message'], "data['status'] = ", data['status']);
+
+ if (String(data['status']) === String("true")) {
+ setGet_List_Categorie_api("true");
+ setGet_List_Categorie_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_nom = JSON.parse(x).nom;
+ var local_code = JSON.parse(x).code;
+ var local_class_domaine_id = JSON.parse(x).class_domaine_id;
+ var local_class_domaine_nom = JSON.parse(x).class_domaine_nom;
+
+
+ //---
+ var node = {
+ "id": localid,
+ "_id": local_id,
+ "label": local_nom,
+ "nom": local_nom,
+ "code": local_code,
+ "class_domaine_id": local_class_domaine_id,
+ "class_domaine_nom": local_class_domaine_nom,
+
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "id": "",
+ "_id": "",
+ "label": "",
+ "nom": "",
+ "code": "",
+ "class_domaine_id": "",
+ "class_domaine_nom": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0) {
+ setNew_Get_List_Categorie_result(new_data2);
+ //console.log(" ### new_data2 ", new_data2);
+ //console.log(" ### setNew_Get_List_Categorie_result ", New_Get_List_Categorie_result);
+ } else {
+ setNew_Get_List_Categorie_result([]);
+ }
+
+
+ }
+ else {
+ setGet_List_Categorie_api("false");
+ setGet_List_Categorie_message(data['message']);
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.error('Error Get_List_Categorie :', error);
+ setGet_List_Categorie_api("false");
+ });
+
+ }
+
+
+ const [mytrainingmetier, setmytrainingmetier] = useState("");
+
+ const [New_Get_List_Metiers_result, setNew_Get_List_Metiers_result] = useState([]);
+
+ const [Get_List_Metiers_api, setGet_List_Metiers_api] = useState();
+ const [Get_List_Metiers_message, setGet_List_Metiers_message] = useState();
+ const [Get_List_Metiers_result, setGet_List_Metiers_result] = useState();
+ function Get_List_Metiers() {
+ 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_metier/";
+ setLoading(true);
+ fetch(myurl,
+ {
+ method: 'POST',
+ body: form,
+ })
+ .then((data) => data.json())
+ .then((data) => {
+ setLoading(false);
+ // console.log(' IN Get_List_Metiers Success:', data['message'], "data['status'] = ", data['status']);
+
+ if (String(data['status']) === String("true")) {
+ setGet_List_Metiers_api("true");
+ setGet_List_Metiers_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_nom = JSON.parse(x).nom;
+ var local_code = JSON.parse(x).code;
+ var local_class_domaine_id = JSON.parse(x).class_domaine_id;
+ var local_class_domaine_nom = JSON.parse(x).class_domaine_nom;
+
+
+ //---
+ var node = {
+ "id": localid,
+ "_id": local_id,
+ "label": local_nom,
+ "nom": local_nom,
+ "code": local_code,
+ "class_domaine_id": local_class_domaine_id,
+ "class_domaine_nom": local_class_domaine_nom,
+
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "id": "",
+ "_id": "",
+ "label": "",
+ "nom": "",
+ "code": "",
+ "class_domaine_id": "",
+ "class_domaine_nom": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0) {
+ setNew_Get_List_Metiers_result(new_data2);
+ //console.log(" ### new_data2 ", new_data2);
+ //console.log(" ### setNew_Get_List_Metiers_result ", New_Get_List_Metiers_result);
+ } else {
+ setNew_Get_List_Metiers_result([]);
+ }
+
+
+ }
+ else {
+ setGet_List_Metiers_api("false");
+ setGet_List_Metiers_message(data['message']);
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.error('Error Get_List_Metiers :', error);
+ setGet_List_Metiers_api("false");
+ });
+
+ }
+
+
+ const handleChangeMetierTraining = (event) => {
+ const name = event.target.name;
+ const value = event.target.value;
+
+ setmytrainingmetier(value);
+ setdatamodification("1");
+
+ }
+
+
+ const [mytrainingdomaine, setmytrainingdomaine] = useState("");
+
+
+
+ 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");
+ });
+ }
+
+ const [New_Get_List_Regle_Calcul_Note_Formation_result, setNew_Get_List_Regle_Calcul_Note_Formation_result] = useState([]);
+
+ const [Get_List_Regle_Calcul_Note_Formation_api, setGet_List_Regle_Calcul_Note_Formation_api] = useState();
+ const [Get_List_Regle_Calcul_Note_Formation_message, setGet_List_Regle_Calcul_Note_Formation_message] = useState();
+ const [Get_List_Regle_Calcul_Note_Formation_result, setGet_List_Regle_Calcul_Note_Formation_result] = useState();
+ function Get_List_Regle_Calcul_Note_Formation() {
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("tab_related_collection", "myclass");
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_base_calcul_note_class_and_ue_With_Filter";
+
+ fetch(myurl,
+ {
+ method: 'POST',
+ body: form,
+ })
+ .then((data) => data.json())
+ .then((data) => {
+ // console.log(' IN Get_List_Regle_Calcul_Note_Formation Success:', data['message'], "data['status'] = ", data['status']);
+
+ if (String(data['status']) === String("true")) {
+ setGet_List_Regle_Calcul_Note_Formation_api("true");
+ setGet_List_Regle_Calcul_Note_Formation_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_related_collection = JSON.parse(x).related_collection;
+ var local_calcul_rule = JSON.parse(x).calcul_rule;
+ var local_nom = JSON.parse(x).nom;
+ var local_fonction_name = JSON.parse(x).fonction_name;
+
+
+ //---
+ var node = {
+ "id": localid,
+ "_id": local_id,
+ "related_collection": local_related_collection,
+ "calcul_rule": local_calcul_rule,
+ "label": local_nom,
+ "nom": local_nom,
+ "fonction_name": local_fonction_name,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+
+ "id": "",
+ "_id": "",
+ "related_collection": "",
+ "calcul_rule": "",
+ "label": "",
+ "nom": "",
+ "fonction_name": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0) {
+ setNew_Get_List_Regle_Calcul_Note_Formation_result(new_data2);
+
+ // console.log(" ## new_data2 = ", new_data2);
+ // console.log(" ## New_Get_List_Regle_Calcul_Note_Formation_result = ", New_Get_List_Regle_Calcul_Note_Formation_result);
+ } else {
+ setNew_Get_List_Regle_Calcul_Note_Formation_result([])
+ }
+ }
+ else {
+ setGet_List_Regle_Calcul_Note_Formation_api("false");
+ setGet_List_Regle_Calcul_Note_Formation_message(data['message']);
+ }
+
+ }).catch((error) => {
+ console.error('Error Get_List_Regle_Calcul_Note_Formation :', error);
+ setGet_List_Regle_Calcul_Note_Formation_api("false");
+ });
+ }
+
+
+ const handleChangeDomaineTraining = (event) => {
+ const name = event.target.name;
+ const value = event.target.value;
+
+ setmytrainingdomaine(value);
+ setdatamodification("1");
+
+ }
+
+
+ function alertactivecompte() {
+ //alert(" ispending = ===== " + props.ispending);
+ if (String(props.ispending) === String("1")) {
+ //alert(" Vous devez ajouter un mode de Paiement pour acceder à cette fonctionnalité");
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez ajouter un mode de Paiement pour acceder à cette fonctionnalité");
+ setalert_type("error");
+ return;
+ }
+ }
+
+ const [isimgclassSelected, setisimgclassSelected] = useState(false);
+ const [isimgclassSelectedfile, setisimgclassSelectedfile] = useState(false);
+ const [userimgclassprofil, setuserimgclassprofil] = useState();
+ const [userimgclassprofilchanged, setuserimgclassprofilchanged] = useState("");
+
+ const imglogoclasschangeHandler = (event) => {
+
+
+ let file_size = event.target.files[0].size;
+
+ //or if you like to have name and type
+ //console.log(event.target.files);
+
+ let file_name = event.target.files[0].name;
+ let file_type = event.target.files[0].type;
+
+
+
+ //alert("file_size = "+file_size+" file_type = "+file_type+" a = "+a);
+ if (file_size > 10000000) {
+ // alert("L'image ne doit pas dépasser un 1 Méga octets");
+ setdisplay_alert_mysy("1");
+ setalert_message("L'image ne doit pas dépasser un 1 Méga octets");
+ setalert_type("error");
+ return;
+ }
+ setisimgclassSelected(event.target.files[0]);
+ setisimgclassSelectedfile(true);
+
+ setuserimgclassprofil(URL.createObjectURL(event.target.files[0]));
+ setuserimgclassprofilchanged("1");
+ };
+
+
+ const [isimgclassdeleted, setisimgclassdeleted] = useState("");
+ const [isimgclassdeleted_message, setisimgclassdeleted_message] = useState("");
+
+ function removeRecodedClassImage() {
+ var class_external_code = "";
+ if (document.getElementsByName("external_code")[0].value && document.getElementsByName("external_code")[0].value.length > 3) {
+ class_external_code = document.getElementsByName("external_code")[0].value;
+ } else {
+ // alert(" Vous devez saisir le code externe de la formation avant d'enregistrer une image. Le code externe prend au moins 3 caractères");
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez saisir le code externe de la formation avant d'enregistrer une image. Le code externe prend au moins 3 caractères");
+ setalert_type("error");
+ return;
+ }
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("class_external_code", class_external_code);
+ form.append("related_collection", "myclass");
+ form.append("related_collection_recid", selected_class_id);
+ form.append("type", "partner");
+ setLoading(true);
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/DeleteRecodedClassImage/",
+ {
+ method: 'POST',
+ body: form,
+ }
+ ).then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+
+ //console.log(' removeRecodedClassImage : status:', result['status']);
+ //console.log('removeRecodedClassImage : Success:', result['message']);
+
+ setisimgclassSelected(false);
+
+ if (String(result['status']) === String("true")) {
+ setisimgclassdeleted("1");
+ setuserimgclassprofil("");
+ }
+ else if (String(result['status']) === String("Err_Connexion")) {
+ alert('Erreur: ' + result['message']);
+ history.push("/Connexion");
+ return;
+ }
+
+ else {
+ setisimgclassdeleted("0");
+ setisimgclassdeleted_message(result['message']);
+ setisimgclassSelected(true);
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error('Error:');
+ setisimgclassSelected(true);
+ setisimgclassdeleted("0");
+ setisimgclassdeleted_message(result['message']);
+ });
+
+ }
+
+ const [isimgclassSaved, setisimgclassSaved] = useState("");
+ const [isimgclassSaved_message, setisimgclassSaved_message] = useState("");
+ function sendClassImage(local_myclass_id) {
+
+ var class_external_code = "";
+
+ if (document.getElementsByName("external_code")[0].value && document.getElementsByName("external_code")[0].value.length > 3) {
+ class_external_code = document.getElementsByName("external_code")[0].value;
+ } else {
+ // alert(" Vous devez saisir le code externe de la formation avant d'enregistrer une image. Le code externe prend au moins 3 caractères");
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez saisir le code externe de la formation avant d'enregistrer une image. Le code externe prend au moins 3 caractères");
+ setalert_type("error");
+ return;
+ }
+
+
+ var formData = new FormData();
+ formData.append('File', isimgclassSelected);
+ const stored_cookie = getCookie('tokenmysypart');
+ formData.append("token", stored_cookie);
+ formData.append("class_external_code", class_external_code);
+ formData.append("related_collection", "myclass");
+ formData.append("related_collection_recid", local_myclass_id);
+ formData.append("type", "myclass");
+
+ setLoading(true);
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/recordClassImage/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ ).then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+ //console.log('status:', result['status']);
+ //console.log('Success:', result['message']);
+ setisimgclassSelected(false);
+
+ if (String(result['status']) == String("true")) {
+ setisimgclassSaved("1");
+ }
+ else {
+ setisimgclassSaved("0");
+ setisimgclassSaved_message(result['message']);
+ setisimgclassSelected(true);
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error('Error:');
+ setisimgclassSelected(true);
+ setisimgclassSaved("0");
+ setisimgclassSaved_message(result['message']);
+ });
+ };
+
+
+ const [myclassimage, setmyclassimage] = useState();
+ const [isclassimage, setisclassimage] = useState();
+
+ function getClassImage(local_class_id) {
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/getRecodedClassImage/";
+
+ var class_external_code = props.mytrainingclass['class_external_code'];
+
+ if (class_external_code.length < 3) {
+ //console.log("Le code externe prend au moins 3 caractères");
+ return;
+ }
+
+
+ var form = new FormData();
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type", "partner");
+ form.append("related_collection", "myclass");
+ form.append("related_collection_recid", local_class_id);
+ form.append("class_external_code", class_external_code);
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+
+ if (res.data.status != "False") {
+ setLoading(false);
+ //console.log(" getClassImage : In test res.data.status = " + res.data.status);
+ //console.log(" getClassImage: res.data.message.img = " + res.data.message);
+
+ if (res.data.message && res.data.message.img && res.data.message.img.length > 0) {
+ setisclassimage("True");
+
+ setisclassimage(res.data.message.img);
+ var ch_img = "data:image/png;base64," + res.data.message.img;
+ setuserimgclassprofil(ch_img);
+
+ }
+ else {
+ setisclassimage("False");
+ setuserimgclassprofil();
+ }
+
+ }
+ else {
+ //console.log(" In Erreur res.data.status = " + res.data.status);
+ //console.log(" In Erreur res.data.message = " + res.data.message);
+ setisclassimage("False");
+ setuserimgclassprofil();
+ //alert("4");
+ }
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('getClassImage ee: Not good man :( getClassImage = ');
+ setisclassimage("False");
+ setuserimgclassprofil("");
+ })
+
+ }
+
+
+ const [activepack, setactivepack] = useState();
+ function ActivePackStandard() {
+
+ history.push({
+ pathname: "/Partner/",
+ state: {
+ current_pack: props.currentpack, local_sub_menu: 'checkout', price: "50",
+ period: "mensuelle", new_pack: "standard"
+ }
+ });
+ window.location.reload();
+ }
+
+ function ActivePackGold() {
+
+ history.push({
+ pathname: "/Partner/",
+ state: {
+ current_pack: props.currentpack, local_sub_menu: 'checkout', price: "50",
+ period: "mensuelle", new_pack: "gold"
+ }
+ });
+ window.location.reload();
+ }
+
+
+
+ function change_zone_diffsion() {
+ setfield_zone_diffusion(document.getElementById("zone_diffusion_v2").value)
+ }
+
+
+ function UndoModif() {
+ setfield_description("");
+ setfield_objectif("");
+ setfield_programme("");
+
+ setfield_methode_pedago("");
+ setfield_handicap("");
+
+
+ setfield_prerequis("");
+ setfield_mots_cle("");
+ setfield_plus_produit("");
+ setfield_contenu_attestation("");
+ setfield_datelieu("");
+ setfield_zone_diffusion("");
+ seteditor_tochange("");
+
+
+ fillfield();
+ if (props.mytrainingclass['class_external_code']) {
+
+ //console.log("props.mytrainingclass['plus_produit'] = " + props.mytrainingclass['plus_produit']);
+ setplus_produit_enabled(props.mytrainingclass['plus_produit']);
+ setmots_cle_enabled(props.mytrainingclass['mots_cle']);
+ setzone_diffusion_enabled(props.mytrainingclass['zone_diffusion']);
+ }
+
+ setdatamodification("0");
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ }
+
+ const [editor_tochange, seteditor_tochange] = useState("");
+ function editor_keyup() {
+ seteditor_tochange("1");
+ }
+
+ const cpf = [
+ {
+ value: '1',
+ label: 'Oui',
+ },
+ {
+ value: '0',
+ label: 'Non',
+ },
+
+ ];
+
+
+ const certif = [
+ {
+ value: '1',
+ label: 'Oui',
+ },
+ {
+ value: '0',
+ label: 'Non',
+ },
+
+ ];
+
+ const inscription_direct = [
+ {
+ value: '1',
+ label: 'Oui',
+ },
+ {
+ value: '0',
+ label: 'Non',
+ },
+ {
+ value: '',
+ label: '',
+ },
+
+ ];
+
+ function retourList() {
+ props.closeTrainingForm();
+
+ }
+
+ const [isLoading, setLoading] = useState();
+
+ // Gestion champs specifiques
+
+ /*
+ *** ALGORITHME
+ 1 - Récuperer la liste des champs specifiques de la collection concernée - Array : list_nom_champs_spec
+ 2 - Récupérer les caracteristiques de champs champs spécifique : "id, nom, label, type valeur, etc"
+ - avec un champ 'value' à vide. Mettre dans le tableau JSON, 'spec_champs_valeur'
+
+ 3 - Créer une nouvelle table qui permettra de gerer les hook : const [rows_champs_specifics, setrows_champs_specifics] = useState([]);
+ 4 - Afficher en html les elements 'rows_champs_specifics'
+ 5 - Gerer la modification avec la fonction 'change_champs_spec_handle'
+ 6 - On recuperer les valeur lors du click d'enregistrement.
+
+ */
+
+
+ const list_nom_champs_spec = []
+ const [spec_champs_valeur, setspec_champs_valeur] = useState([]);
+
+ //const spec_champs_valeur = ""
+
+ const [Get_Partner_Object_Specific_Fields_api, setGet_Partner_Object_Specific_Fields_api] = useState();
+ const [Get_Partner_Object_Specific_Fields_message, setGet_Partner_Object_Specific_Fields_message] = useState();
+ const [Get_Partner_Object_Specific_Fields_result, setGet_Partner_Object_Specific_Fields_result] = useState();
+ function Get_Partner_Object_Specific_Fields(local_collection_obj_metier) {
+
+ var form = new FormData();
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("object_name", local_collection_obj_metier);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Object_Specific_Valide_Displayed_Fields/";
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) === String("true")) {
+ setLoading(false);
+ //console.log(" In Get_Partner_Object_Specific_Fields res.data.status = " + res.data.status);
+ //console.log(" In Get_Partner_Object_Specific_Fields res.data.message r_class = " + res.data.message);
+
+ setGet_Partner_Object_Specific_Fields_api("true");
+ setGet_Partner_Object_Specific_Fields_result(res.data.message);
+
+
+ setrows_champs_specifics(res.data.message);
+
+
+ }
+ else {
+ setGet_Partner_Object_Specific_Fields_api("false");
+ setGet_Partner_Object_Specific_Fields_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_Partner_Object_Specific_Fields = ', error);
+ setGet_Partner_Object_Specific_Fields_api("false");
+ //alert(" Impossible de recuperer la liste des collection et champs personnalisables");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de recuperer la liste des collection et champs personnalisables");
+ setalert_type("error");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [New_Get_List_Niveau_Formation_result, setNew_Get_List_Niveau_Formation_result] = useState([]);
+
+ const [Get_List_Niveau_Formation_api, setGet_List_Niveau_Formation_api] = useState();
+ const [Get_List_Niveau_Formation_message, setGet_List_Niveau_Formation_message] = useState();
+ const [Get_List_Niveau_Formation_result, setGet_List_Niveau_Formation_result] = useState([]);
+ function Get_List_Niveau_Formation() {
+ var form = new FormData();
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Class_Niveau_Formation/";
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ setLoading(true);
+ fetch(myurl,
+ {
+ method: 'POST',
+ body: form,
+ })
+ .then((data) => data.json())
+ .then((data) => {
+ setLoading(false);
+ //console.log(' IN Get_List_Niveau_Formation Success:', data['message'], "data['status'] = ", data['status']);
+
+ if (String(data['status']) === String("true")) {
+ setGet_List_Niveau_Formation_api("true");
+ setGet_List_Niveau_Formation_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_description = JSON.parse(x).description;
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_description,
+ "description": local_description,
+ "code": local_code,
+
+ };
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Niveau_Formation_result(new_data2);
+
+
+
+
+ }
+ else {
+ setGet_List_Niveau_Formation_api("false");
+ setGet_List_Niveau_Formation_message(data['message']);
+ // alert(data['message'])
+ setdisplay_alert_mysy("1");
+ setalert_message(data['message']);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.error('Error Get_List_Niveau_Formation :', error);
+ setGet_List_Niveau_Formation_api("false");
+ // alert(" Impossible de récupérer la liste des niveaux de formation");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de récupérer la liste des niveaux de formation");
+ setalert_type("error");
+
+ });
+
+ }
+
+
+
+ //const [rows_champs_specifics, setrows_champs_specifics] = useState([]);
+
+ // Cas spécifique de cette page.
+ const [rows_champs_specifics, setrows_champs_specifics] = useState(props.rows_champs_specifics);
+
+ const [display_champs_specifics, setdisplay_champs_specifics] = useState("0");
+
+ function afficher_champs_spec() {
+
+ setdisplay_champs_specifics("1");
+ //setrows_champs_specifics(spec_champs_valeur);
+
+ }
+
+ function findIndexByProperty(data, key, value) {
+ for (var i = 0; i < data.length; i++) {
+
+ if (data[i][key] == value) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+
+ function findValueByProperty(data, key, value) {
+ for (var i = 0; i < data.length; i++) {
+ if (data[i][key] == value) {
+
+ var tmp_val = JSON.parse(data[i]);
+
+ return tmp_val.field_value
+
+ }
+ }
+ return "";
+ }
+
+
+ const spec_field_updated_values = []
+ const [spec_field_updated_values_hooks, setspec_field_updated_values_hooks] = useState([]);
+
+
+ function change_champs_spec_handle() {
+
+ for (let i = 0; i < rows_champs_specifics.length; i++) {
+
+ var field_name = JSON.parse(rows_champs_specifics[i]).field_name;
+ var field_type = JSON.parse(rows_champs_specifics[i]).field_type;
+ var field_label = JSON.parse(rows_champs_specifics[i]).field_label;
+ var is_mandatory = JSON.parse(rows_champs_specifics[i]).is_mandatory;
+
+
+ if (document.getElementsByName(String(field_name))[0]) {
+
+ var field_value = document.getElementsByName(String(field_name))[0].value;
+ var new_val = { 'field_name': field_name, 'field_value': field_value, 'field_type': field_type, 'field_label': field_label, 'is_mandatory': is_mandatory }
+ var johnIndex = findIndexByProperty(spec_field_updated_values, 'field_name', field_name);
+ if (johnIndex > -1) {
+ spec_field_updated_values[johnIndex] = new_val;
+
+ } else {
+ spec_field_updated_values.push(new_val);
+ }
+ }
+
+ }
+
+ //setrows_champs_specifics(spec_champs_valeur);
+
+ //console.log(" OUTT spec_field_updated_values = ", spec_field_updated_values);
+ setspec_field_updated_values_hooks(spec_field_updated_values)
+ }
+ // -- end champs specifiques
+
+
+ const [p_formateur_id, setp_formateur_id] = useState("");
+ const [p_formateur_label, setp_formateur_label] = useState("-");
+
+ const [p_class_level, setp_class_level] = useState("2");
+ const [p_class_level_label, setp_class_level_label] = useState("Aucune certification");
+
+
+
+ // -- Gestion pièces jointes
+
+ const [Download_one_attached_document_api, setDownload_one_attached_document_api] = useState();
+ const [Download_one_attached_document_result, setDownload_one_attached_document_result] = useState();
+ const [Download_one_attached_document_message, setDownload_one_attached_document_message] = useState();
+
+ const Download_one_attached_document = (event) => {
+ const stored_cookie = getCookie('tokenmysypart');
+
+
+ var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
+ var token = stored_cookie;
+ var file_name = event.target.id;
+
+
+ var url = process.env.REACT_APP_API_URL + "myclass/api/Get_Stored_Downloaded_File/" + token + "/" + file_name;
+
+ setLoading(true);
+ axios.get(url, { responseType: 'blob', },)
+ .then((res) => {
+ setLoading(false);
+ fileDownload(res.data, nom_fiche_detaillee);
+ setDownload_one_attached_document_api("true");
+ }).catch((error) => {
+ setLoading(false);
+ console.error('Error:', error);
+ setDownload_one_attached_document_api("false");
+
+ });
+ }
+
+
+ const [tab_convention_pieces_jointes_result, settab_convention_pieces_jointes_result] = useState([]);
+
+ const [file_1_name, setfile_1_name] = useState();
+
+ const [sessions_file_change_1_api, setsessions_file_change_1_api] = useState();
+ const [sessions_file_change_1_result, setsessions_file_change_1_result] = useState();
+ const [sessions_file_change_1_message, setsessions_file_change_1_message] = useState();
+ const sessions_file_change_1 = event => {
+
+ const fileUploaded = event.target.files[0];
+ let file_size = event.target.files[0].size;
+ let file_type = event.target.files[0].type;
+
+
+
+
+ console.log("file_size 2 = ", file_size, " file_type = ", file_type);
+ if (file_size > 10000000) {
+ // alert("Le fichier ne doit pas depasser un 1 Méga octets");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le fichier ne doit pas depasser un 1 Méga octets");
+ setalert_type("error");
+ // console.log("Le fichier ne doit pas depasser un 1 Méga octets");
+ return;
+ }
+
+ setfile_1_name(event.target.files[0]);
+
+ const formData = new FormData();
+ formData.append('File', fileUploaded);
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysypart');
+
+ //formData.append("token", stored_cookie);
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ return;
+
+
+ };
+
+
+
+ const [sessions_file_change_1_convention_api, setsessions_file_change_1_convention_api] = useState();
+ const [sessions_file_change_1_convention_result, setsessions_file_change_1_convention_result] = useState();
+ const [sessions_file_change_1_convention_message, setsessions_file_change_1_convention_message] = useState();
+ const sessions_file_change_1_convention = event => {
+
+
+ const fileUploaded = event.target.files[0];
+ let file_size = event.target.files[0].size;
+ let file_type = event.target.files[0].type;
+
+
+ if (file_type !== "application/pdf") {
+ // alert("Le fichier n'est pas de type PDF");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le fichier n'est pas de type PDF");
+ setalert_type("error");
+ return;
+ }
+
+
+
+ if (file_size > 10000000) {
+ // alert("Le fichier ne doit pas depasser un 1 Méga octets");
+ //console.log("Le fichier ne doit pas depasser un 1 Méga octets");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le fichier ne doit pas depasser un 1 Méga octets");
+ setalert_type("error");
+ return;
+ }
+
+ //var new_node = {'name':event.target.files[0].name, 'type':event.target.files[0].type}
+
+
+ var new_tmp = [];
+
+ if (tab_convention_pieces_jointes_result && tab_convention_pieces_jointes_result.length > 0) {
+
+ tab_convention_pieces_jointes_result.map((x) => {
+ new_tmp.push(x);
+
+ });
+
+ }
+
+ new_tmp.push(event.target.files[0])
+
+ settab_convention_pieces_jointes_result(new_tmp);
+
+ console.log(" tab_convention_pieces_jointes_result = ", tab_convention_pieces_jointes_result)
+
+
+ return;
+
+
+ };
+
+ const [file_2_name, setfile_2_name] = useState();
+
+ const [sessions_file_change_2_api, setsessions_file_change_2_api] = useState();
+ const [sessions_file_change_2_result, setsessions_file_change_2_result] = useState();
+ const [sessions_file_change_2_message, setsessions_file_change_2_message] = useState();
+ const sessions_file_change_2 = event => {
+
+ const fileUploaded = event.target.files[0];
+ let file_size = event.target.files[0].size;
+ let file_type = event.target.files[0].type;
+
+
+ console.log("file_size 1 = ", file_size, " file_type = ", file_type);
+ if (file_size > 10000000) {
+ //alert("Le fichier ne doit pas depasser un 1 Méga octets");
+ //console.log("Le fichier ne doit pas depasser un 1 Méga octets");
+ setdisplay_alert_mysy("1");
+ setalert_message("Le fichier ne doit pas depasser un 1 Méga octets");
+ setalert_type("error");
+ return;
+ }
+ setfile_2_name(event.target.files[0]);
+
+ const formData = new FormData();
+ formData.append('File', fileUploaded);
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysypart');
+
+ //formData.append("token", stored_cookie);
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ return;
+
+
+ };
+
+
+ // Cette fonction permet d'enregister la fiche catalogue d'une formation
+ const [Record_Class_Catalogue_File_api, setRecord_Class_Catalogue_File_api] = useState();
+ const [Record_Class_Catalogue_File_result, setRecord_Class_Catalogue_File_result] = useState();
+ const [Record_Class_Catalogue_File_message, setRecord_Class_Catalogue_File_message] = useState();
+
+ function Record_Class_Catalogue_File() {
+
+ if (!p_detail_one_file_to_download_type_name) {
+ //alert(" Vous devez donner un nom à la pièce jointe");
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez donner un nom à la pièce jointe");
+ setalert_type("error");
+ return;
+ }
+
+ if (file_1_name && file_1_name.name) {
+ //console.log(" ### Traitement de : ", file_1_name.name);
+
+ const formData = new FormData();
+ formData.append('File', file_1_name);
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysypart');
+
+ formData.append("token", stored_cookie);
+ formData.append("file_business_object", p_detail_one_file_to_download_type_name);
+ formData.append("file_name", file_1_name.name);
+ formData.append("status", "0");
+ formData.append("object_owner_collection", "myclass");
+ formData.append("object_owner_id", selected_class_id);
+ formData.append("type_document", "catalogue_file");
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ setLoading(true);
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Store_User_Downloaded_File/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+
+ setLoading(false);
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Success:', result['message']);
+ setRecord_Class_Catalogue_File_result(result['message']);
+ setRecord_Class_Catalogue_File_api("true");
+
+ // Get_List_Of_All_PJ(selected_class_id);
+ setfile_1_name();
+ setp_detail_one_file_to_download_type_name();
+ //GetCurrentClass_trainingsession();
+ // alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée")
+ setdisplay_alert_mysy("1");
+ setalert_message(" La pièce jointe " + file_1_name.name + " a été bien enregistrée");
+ setalert_type("success");
+
+ }
+ else {
+ setRecord_Class_Catalogue_File_message(result['message']);
+ setRecord_Class_Catalogue_File_api("false");
+ //alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Record_Class_Catalogue_File Error:', error);
+ setRecord_Class_Catalogue_File_api("false");
+ // alert(" Impossible d'ajouter la pièce jointe");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'ajouter la pièce jointe");
+ setalert_type("error");
+ });
+
+ }
+
+
+ }
+
+
+
+
+ const [add_one_eu_to_class, setadd_one_eu_to_class] = useState("");
+
+ const [Record_All_PJ_api, setRecord_All_PJ_api] = useState();
+ const [Record_All_PJ_result, setRecord_All_PJ_result] = useState();
+ const [Record_All_PJ_message, setRecord_All_PJ_message] = useState();
+
+ function Record_All_PJ() {
+
+ if (!p_detail_one_file_to_download_type_name) {
+ //alert(" Vous devez donner un nom à la pièce jointe");
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez donner un nom à la pièce jointe");
+ setalert_type("error");
+ return;
+ }
+
+ if (file_1_name && file_1_name.name) {
+ //console.log(" ### Traitement de : ", file_1_name.name);
+
+ const formData = new FormData();
+ formData.append('File', file_1_name);
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysypart');
+
+ formData.append("token", stored_cookie);
+ formData.append("file_business_object", p_detail_one_file_to_download_type_name);
+ formData.append("file_name", file_1_name.name);
+ formData.append("status", "0");
+ formData.append("object_owner_collection", "myclass");
+ formData.append("object_owner_id", selected_class_id);
+ formData.append("type_document", "");
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ setLoading(true);
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Store_User_Downloaded_File/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+
+ setLoading(false);
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Success:', result['message']);
+ setRecord_All_PJ_result(result['message']);
+ setRecord_All_PJ_api("true");
+
+ Get_List_Of_All_PJ(selected_class_id);
+ Get_Class_Catalogue_File(selected_class_id);
+ setfile_1_name();
+ setp_detail_one_file_to_download_type_name();
+ //GetCurrentClass_trainingsession();
+ // alert(" La pièce jointe " + file_1_name.name + " a été bien enregistrée")
+ setdisplay_alert_mysy("1");
+ setalert_message(" La pièce jointe " + file_1_name.name + " a été bien enregistrée");
+ setalert_type("success");
+
+ }
+ else {
+ setRecord_All_PJ_message(result['message']);
+ setRecord_All_PJ_api("false");
+ //alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Record_All_PJ Error:', error);
+ setRecord_All_PJ_api("false");
+ // alert(" Impossible d'ajouter la pièce jointe");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'ajouter la pièce jointe");
+ setalert_type("error");
+ });
+
+ }
+
+
+ }
+
+
+ const [Delete_one_attached_document_api, setDelete_one_attached_document_api] = useState();
+ const [Delete_one_attached_document_result, setDelete_one_attached_document_result] = useState();
+ const [Delete_one_attached_document_message, setDelete_one_attached_document_message] = useState();
+
+ const Delete_one_attached_document = (event) => {
+ const stored_cookie = getCookie('tokenmysypart');
+
+ var formData = new FormData();
+ var nom_fiche_detaillee = "Fiche_Detaillee.pdf";
+ var file_name = event.target.id;
+
+
+ formData.append("token", stored_cookie);
+ formData.append("file_name", file_name);
+
+ var url = process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/";
+
+ setLoading(true);
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Delete_Stored_Downloaded_File/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Success:', result['message']);
+ setDelete_one_attached_document_result(result['message']);
+ setDelete_one_attached_document_api("true");
+ Get_List_Of_All_PJ(selected_class_id);
+ Get_Class_Catalogue_File(selected_class_id);
+ // alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("success");
+
+ }
+ else {
+ setDelete_one_attached_document_message(result['message']);
+ setDelete_one_attached_document_api("false");
+ // alert(result['message']);
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Record_All_PJ Error:', error);
+ setDelete_one_attached_document_api("false");
+ // alert(" Impossible de supprimer le document");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de supprimer le document");
+ setalert_type("error");
+
+ });
+
+
+ }
+
+
+ const Delete_one_attached_document_convention = (event) => {
+ var file_name = event.target.id;
+
+ }
+
+
+
+ const [Get_Class_Catalogue_File_api, setGet_Class_Catalogue_File_api] = useState();
+ const [Get_Class_Catalogue_File_result, setGet_Class_Catalogue_File_result] = useState([]);
+ const [Get_Class_Catalogue_File_message, setGet_Class_Catalogue_File_message] = useState();
+
+ function Get_Class_Catalogue_File(local_employee_id) {
+
+ const formData = new FormData();
+
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysypart');
+
+ formData.append("token", stored_cookie);
+ formData.append("filter_object_owner_collection", "myclass");
+ formData.append("filter_object_owner_id", local_employee_id);
+ formData.append("filter_type_document", "catalogue_file");
+
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+ setLoading(true);
+
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files_With_Filter/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Message :', result['message']);
+ setGet_Class_Catalogue_File_result(result['message']);
+ setGet_Class_Catalogue_File_api("true");
+
+ }
+ else {
+ setGet_Class_Catalogue_File_message(result['message']);
+ setGet_Class_Catalogue_File_api("false");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Get_Class_Catalogue_File Error:', error);
+ setGet_Class_Catalogue_File_api("false");
+ });
+
+ }
+
+
+
+
+ const [Get_List_Of_All_PJ_api, setGet_List_Of_All_PJ_api] = useState();
+ const [Get_List_Of_All_PJ_result, setGet_List_Of_All_PJ_result] = useState([]);
+ const [Get_List_Of_All_PJ_message, setGet_List_Of_All_PJ_message] = useState();
+
+ function Get_List_Of_All_PJ(local_employee_id) {
+
+ const formData = new FormData();
+
+ //formData.append('token', 'K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA');
+ const stored_cookie = getCookie('tokenmysypart');
+
+ formData.append("token", stored_cookie);
+ formData.append("object_owner_collection", "myclass");
+ formData.append("object_owner_id", local_employee_id);
+
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+ setLoading(true);
+
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ setLoading(false);
+
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Message :', result['message']);
+ setGet_List_Of_All_PJ_result(result['message']);
+ setGet_List_Of_All_PJ_api("true");
+
+ }
+ else {
+ setGet_List_Of_All_PJ_message(result['message']);
+ setGet_List_Of_All_PJ_api("false");
+ }
+
+ })
+ .catch((error) => {
+ setLoading(false);
+ console.error(' Get_List_Of_All_PJ Error:', error);
+ setGet_List_Of_All_PJ_api("false");
+ });
+
+ }
+
+
+
+ function Delete_file_1_name() {
+ setfile_1_name();
+ }
+
+ function Delete_file_2_name() {
+ setfile_2_name();
+ }
+
+ const [p_detail_one_file_to_download_type_name, setp_detail_one_file_to_download_type_name] = useState();
+
+ // -- end gestion pièces jointes
+
+ const [submenu, setsubmenu] = useState("");
+
+ function submenu_color_management(current_menu) {
+ const list_sous_menu = ["detail_formation", "unite_enseignement", "admission", "piece_jointe", "note_evaluation", "statistiques",
+ "historique", "aide_ia", "finance", "documents"]
+
+ for (let i = 0; i < list_sous_menu.length; i++) {
+
+ var sous_menu = list_sous_menu[i];
+ if (String(sous_menu) !== current_menu) {
+ if (document.getElementById(sous_menu)) {
+ document.getElementById(sous_menu).style.backgroundColor = "#d8edfc";
+ document.getElementById(sous_menu).style.color = "black";
+ document.getElementById(sous_menu).style.fontWeight = "normal";
+ }
+ }
+
+ }
+
+ if (document.getElementById(current_menu)) {
+ document.getElementById(current_menu).style.backgroundColor = "#107758";
+ document.getElementById(current_menu).style.color = "white";
+ document.getElementById(current_menu).style.fontWeight = "bold";
+ }
+
+ }
+
+
+ function submenu_detail_formation() {
+ setsubmenu("detail_formation");
+ submenu_color_management("detail_formation");
+ }
+
+ function submenu_unite_enseignement() {
+ setsubmenu("unite_enseignement");
+ submenu_color_management("unite_enseignement");
+ }
+
+ function submenu_admission() {
+ setsubmenu("admission");
+ submenu_color_management("admission");
+ }
+
+ function submenu_note_evaluation() {
+ setsubmenu("note_evaluation");
+ submenu_color_management("note_evaluation");
+ Getall_Class_List_Evalution();
+
+ Get_List_Regle_Calcul_Note_Formation();
+ }
+
+
+ function submenu_piece_jointe() {
+ setsubmenu("piece_jointe");
+ submenu_color_management("piece_jointe");
+ }
+
+ function submenu_documents() {
+ Get_List_Stagiaire_Convocations_Mail();
+ Get_List_Stagiaire_Convocations_PDF();
+ Get_List_Convention_Individuelle_Mail();
+ Get_List_Convention_Individuelle_PDF();
+
+ Get_List_Convention_Entreprise_Mail();
+ Get_List_Convention_Entreprise_PDF();
+
+ Getall_Partner_Formulaires_Eval_Froid();
+ Getall_Partner_Formulaires_Eval_Chaud();
+ Getall_Partner_Formulaires_Eval_Formateur();
+
+ Get_List_Attestation_PDF();
+ Get_List_Attestation_Email();
+
+ Getall_Partner_Formulaires_Q_Position();
+ Get_Given_Class_Default_Documents();
+ setsubmenu("documents");
+ submenu_color_management("documents");
+ }
+
+ function submenu_aide_ia() {
+ setsubmenu("aide_ia");
+ submenu_color_management("aide_ia");
+ }
+
+
+ function submenu_statistiques() {
+ setsubmenu("statistiques");
+ submenu_color_management("statistiques");
+ Getall_Employee_Statistic_Question_List();
+ Get_Qualiopi_Indic_Apprenant_Formation("1");
+ Get_Qualiopi_Indic_Nb_Heure("1");
+ Get_Indic_Class_CA_HT("1");
+ }
+
+ function submenu_finance() {
+ setsubmenu("finance");
+ submenu_color_management("finance");
+ Getall_Class_Finance_Caracteristic();
+ }
+
+ function submenu_historique() {
+ setsubmenu("historique");
+ submenu_color_management("historique");
+
+ }
+
+
+ const myRef = useRef(null)
+
+ const [p_detail_external_code, setp_detail_external_code] = useState("");
+ const [p_detail_title, setp_detail_title] = useState("");
+ const [p_detail_duree, setp_detail_duree] = useState("");
+ const [p_detail_url, setp_detail_url] = useState("");
+ const [p_detail_lms_class_code, setp_detail_lms_class_code] = useState("");
+
+ const [p_detail_version_catalogue, setp_detail_version_catalogue] = useState("");
+
+ const [p_detail_recyclage_delai, setp_detail_recyclage_delai] = useState("0");
+ const [p_detail_recyclage_periodicite, setp_detail_recyclage_periodicite] = useState("mois");
+ const [p_detail_recyclage_alert, setp_detail_recyclage_alert] = useState("0");
+
+ const [p_detail_class_inscription_url, setp_detail_class_inscription_url] = useState("");
+ const [p_detail_class_banner_img_url, setp_detail_class_banner_img_url] = useState("");
+ const [p_detail_note, setp_detail_note] = useState("");
+ const [p_detail_price, setp_detail_price] = useState("");
+
+ const [p_detail_archive, setp_detail_archive] = useState("");
+
+ const [selected_ue_id, setselected_ue_id] = useState("");
+ const [selected_ue_credit_ects, setselected_ue_credit_ects] = useState("");
+ const [selected_ue_is_noted, setselected_ue_is_noted] = useState("");
+ const [selected_ue_pres_dist_hyp, setselected_ue_pres_dist_hyp] = useState("");
+ const [selected_ue_coefficient, setselected_ue_coefficient] = useState("");
+ const [selected_ue_seuil_validation, setselected_ue_seuil_validation] = useState("");
+
+
+ const [selected_class_note_calculation_id, setselected_class_note_calculation_id] = useState("");
+
+
+
+ const New_Option_Is_Noted = [
+ { "id": "1", "label": "Oui", "value": "1" },
+ { "id": "0", "label": "Non", "value": "0" },
+ { "id": "", "label": "", "value": "" },
+ ]
+
+
+
+
+ const New_Option_pres_dist_hyp = [
+ { "id": "1", "label": "Distanciel", "value": "1" },
+ { "id": "2", "label": "Hybride", "value": "2" },
+ { "id": "0", "label": "Présentiel", "value": "0" },
+ { "id": "", "label": "", "value": "" },
+ ]
+
+ const [Dialog_Unite_Enseignement_open, setDialog_Unite_Enseignement_open] = React.useState(false);
+ const Dialog_Unite_Enseignement_handleClose = () => {
+ setDialog_Unite_Enseignement_open(false);
+ setselected_ue_id("");
+ setselected_ue_credit_ects("");
+ setselected_ue_is_noted("");
+ setselected_ue_pres_dist_hyp("");
+ setadd_one_eu_to_class("");
+ setselected_ue_coefficient("");
+ setselected_ue_seuil_validation("");
+
+ };
+
+
+ function clean_ue_data() {
+ setselected_ue_id("");
+ setselected_ue_credit_ects("");
+ setselected_ue_seuil_validation("");
+ setselected_ue_is_noted("");
+ setselected_ue_pres_dist_hyp("");
+ setadd_one_eu_to_class("");
+ setselected_ue_coefficient("");
+
+ }
+
+ const Dialog_Unite_Enseignement_handleClose_buton = () => {
+ setDialog_Unite_Enseignement_open(false);
+ setselected_ue_id("");
+ setselected_ue_credit_ects("");
+ setselected_ue_seuil_validation("");
+ setselected_ue_is_noted("");
+ setselected_ue_pres_dist_hyp("");
+ setadd_one_eu_to_class("");
+ setselected_ue_coefficient("");
+ };
+
+ const [Dialog_1_message, setDialog_1_message] = React.useState(false);
+
+ const [Add_Update_UE_To_Class_api, setAdd_Update_UE_To_Class_api] = useState();
+ const [Add_Update_UE_To_Class_message, setAdd_Update_UE_To_Class_message] = useState();
+ const [Add_Update_UE_To_Class_result, setAdd_Update_UE_To_Class_result] = useState();
+ function Add_Update_UE_To_Class() {
+ setLoading(true);
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ if (props.mytrainingclass['class_id'])
+ form.append("class_id", props.mytrainingclass['class_id']);
+ else
+ form.append("class_id", selected_class_id);
+
+ form.append("ue_id", selected_ue_id);
+ form.append("credit", selected_ue_credit_ects);
+ form.append("coefficient", selected_ue_coefficient);
+ form.append("pres_dist_hyp", selected_ue_pres_dist_hyp);
+ form.append("is_noted", selected_ue_is_noted);
+ form.append("seuil_validation", selected_ue_seuil_validation);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_UE_To_Class/";
+
+
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ // console.log(" In Add_Update_UE_To_Class res.data.status = " + res.data.status);
+ //console.log(" In Add_Update_UE_To_Class res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ setAdd_Update_UE_To_Class_api("true");
+ setAdd_Update_UE_To_Class_result(res.data.message);
+ Getall_Class_List_UE();
+ Dialog_Unite_Enseignement_handleClose_buton();
+
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+
+
+ }
+ else {
+ setAdd_Update_UE_To_Class_api("false");
+ setAdd_Update_UE_To_Class_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Add_Update_UE_To_Class : Not good man :( mysearchtext = ' + error);
+ setAdd_Update_UE_To_Class_api("false");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'ajouter l'UE à la formation");
+ setalert_type("error");
+ // alert(" Impossible d'ajouter l'UE à la formation ");
+
+ })
+ }
+
+
+ const [Add_Update_Evaluation_to_UE_api, setAdd_Update_Evaluation_to_UE_api] = useState();
+ const [Add_Update_Evaluation_to_UE_message, setAdd_Update_Evaluation_to_UE_message] = useState();
+ const [Add_Update_Evaluation_to_UE_result, setAdd_Update_Evaluation_to_UE_result] = useState();
+ function Add_Update_Evaluation_to_UE() {
+ setLoading(true);
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+
+ form.append("max_note", p_detail_max_note);
+ form.append("ponderation_type_eval", p_detail_ponderation_type_eval);
+
+ var myurl = "";
+
+ if (String(add_ue_evalution) === "1") {
+ if (props.mytrainingclass['class_id'])
+ form.append("class_id", props.mytrainingclass['class_id']);
+ else
+ form.append("class_id", selected_class_id);
+
+ form.append("class_ue_id", selected_ue_id);
+ form.append("type_evaluation_id", selected_eu_evalution_id);
+
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Class_UE_Evaluation/";
+ } else {
+ form.append("class_ue_evaluation_id", class_unite_enseignement_type_evaluation_id);
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Class_UE_Evaluation/";
+ }
+
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ // console.log(" In Add_Update_Evaluation_to_UE res.data.status = " + res.data.status);
+ //console.log(" In Add_Update_Evaluation_to_UE res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ setAdd_Update_Evaluation_to_UE_api("true");
+ setAdd_Update_Evaluation_to_UE_result(res.data.message);
+
+ setadd_ue_evalution("");
+ setselected_ue_id("");
+ setselected_eu_evalution_id("");
+ setsetgridline_evaluation_ue_id("");
+ setp_detail_max_note("");
+ setp_detail_ponderation_type_eval("");
+ setclass_unite_enseignement_type_evaluation_id("");
+ Getall_Class_List_Evalution();
+
+
+ Dialog_Evaluation_Unite_Enseignement_handleClose_buton();
+
+ // alert(res.data.message)
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+
+ }
+ else {
+ setAdd_Update_Evaluation_to_UE_api("false");
+ setAdd_Update_Evaluation_to_UE_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Add_Update_Evaluation_to_UE : Not good man :( mysearchtext = ' + error);
+ setAdd_Update_Evaluation_to_UE_api("false");
+ // alert(" Impossible d'ajouter l'évaluation l'UE ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'ajouter l'évaluation l'UE");
+ setalert_type("error");
+
+ })
+ }
+
+
+ const [gridline_ue_id, setgridline_ue_id] = useState("");
+
+ const sleep = (milliseconds) => {
+ return new Promise(resolve => setTimeout(resolve, milliseconds))
+ }
+
+
+ const filter_New_Get_List_Metiers_result = () => {
+
+ var local_tab = New_Get_List_Metiers_result.filter((data) => data.class_domaine_id === String(String(mytrainingdomaine).trim()))
+ console.log(" ### local_tab = ", local_tab);
+
+ local_tab.push({
+ "id": "",
+ "_id": "",
+ "label": "",
+ "nom": "",
+ "code": "",
+ "class_domaine_id": "",
+ "class_domaine_nom": "",
+
+ })
+
+
+ return local_tab;
+
+ };
+
+
+ const [Dialog_Evaluation_Unite_Enseignement_open, setDialog_Evaluation_Unite_Enseignement_open] = React.useState(false);
+
+ const Dialog_Evaluation_Unite_Enseignement_handleClose = () => {
+ setDialog_Evaluation_Unite_Enseignement_open(false);
+
+ };
+ const Dialog_Evaluation_Unite_Enseignement_handleClose_buton = () => {
+ setDialog_Evaluation_Unite_Enseignement_open(false);
+
+ };
+
+ const [selected_eu_evalution_id, setselected_eu_evalution_id] = React.useState("");
+ const [setgridline_evaluation_ue_id, setsetgridline_evaluation_ue_id] = React.useState("");
+
+ const [class_unite_enseignement_type_evaluation_id, setclass_unite_enseignement_type_evaluation_id] = React.useState("");
+
+ const [p_detail_max_note, setp_detail_max_note] = React.useState("");
+
+ const [p_detail_ponderation_type_eval, setp_detail_ponderation_type_eval] = React.useState("");
+
+
+ const [add_ue_evalution, setadd_ue_evalution] = React.useState("");
+
+
+ const [New_Getall_Employee_Statistic_Question_List_result, setNew_Getall_Employee_Statistic_Question_List_result] = useState([]);
+
+ const [Getall_Employee_Statistic_Question_List_api, setGetall_Employee_Statistic_Question_List_api] = useState();
+ const [Getall_Employee_Statistic_Question_List_message, setGetall_Employee_Statistic_Question_List_message] = useState();
+ const [Getall_Employee_Statistic_Question_List_result, setGetall_Employee_Statistic_Question_List_result] = useState([]);
+ function Getall_Employee_Statistic_Question_List(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("related_collection", "");
+ form.append("related_collection_id", "");
+ form.append("class_id", selected_class_id);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Entity_Question_List_With_Stat_For_Given_related_collection_id/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Employee_Statistic_Question_List res.data.status = " + res.data.status);
+ //console.log(" In Getall_Employee_Statistic_Question_List res.data.message r_class = " + res.data.message);
+ setGetall_Employee_Statistic_Question_List_api("true");
+ setGetall_Employee_Statistic_Question_List_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).question_id;
+ var local_question_id = JSON.parse(x).question_id;
+ var local_question_question = JSON.parse(x).question_question;
+ var local_question_type = JSON.parse(x).question_type;
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "question_id": local_question_id,
+ "label": local_question_question,
+ "question_question": local_question_question,
+ "question_type": local_question_type,
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "_id": "",
+ "id": "",
+ "question_id": "",
+ "label": "",
+ "question_question": "",
+ };
+
+ new_data2.push(node);
+
+
+ if (new_data2.length > 0)
+ setNew_Getall_Employee_Statistic_Question_List_result(new_data2);
+
+ }
+ else {
+ setGetall_Employee_Statistic_Question_List_api("false");
+ setGetall_Employee_Statistic_Question_List_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Employee_Statistic_Question_List = ', error);
+ setGetall_Employee_Statistic_Question_List_api("false");
+ // alert(" Impossible de recuperer la liste des questions ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de recuperer la liste des questions");
+ setalert_type("error");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [selected_statistic_question_id, setselected_statistic_question_id] = useState("");
+ const [selected_statistic_question_type, setselected_statistic_question_type] = useState("");
+
+ const [p_filter_date_from, setp_filter_date_from] = useState(date_today_minus_180j.toLocaleDateString('fr-FR'));
+ const [p_filter_date_to, setp_filter_date_to] = useState(date_today_30j.toLocaleDateString('fr-FR'));
+
+
+ const [Global_Getall_Qry_Survey_Data_result_JSON, setGlobal_Getall_Qry_Survey_Data_result_JSON] = useState([]);
+
+ const [Getall_Qry_Survey_Data_result_JSON, setGetall_Qry_Survey_Data_result_JSON] = useState([]);
+ const [Getall_Qry_Survey_Data_api, setGetall_Qry_Survey_Data_api] = useState();
+ const [Getall_Qry_Survey_Data_message, setGetall_Qry_Survey_Data_message] = useState();
+ const [Getall_Qry_Survey_Data_result, setGetall_Qry_Survey_Data_result] = useState([]);
+ function Getall_Qry_Survey_Data(event) {
+
+ var form = new FormData();
+ const stored_cookie = getCookie('tokenmysypart');
+
+ var date_from = "";
+ if (p_filter_date_from) {
+ date_from = p_filter_date_from;
+
+ }
+
+ var date_to = "";
+ if (p_filter_date_to) {
+ date_to = p_filter_date_to;
+
+ }
+
+
+ form.append("token", stored_cookie);
+ form.append("periode_start_date", date_from);
+ form.append("periode_end_date", date_to);
+ form.append("related_collection", "");
+ form.append("related_collection_id", "");
+ form.append("question_id", selected_statistic_question_id);
+ form.append("class_id", selected_class_id);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Survey_Stat_Data_For_Given_related_collection_id/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Getall_Qry_Survey_Data res.data.status = " + res.data.status);
+ // console.log(" In Getall_Qry_Survey_Data res.data.message r_class = " + res.data.message);
+
+ var json_data = JSON.parse(res.data.message[0]);
+
+ //console.log(" ### json_data = ", json_data);
+ var jsonObj0 = json_data.data
+
+ //console.log(" ### jsonObj0 = ", jsonObj0);
+
+ var new_data2 = [];
+ const new_data = jsonObj0.map((x) => {
+ var month_year = (x).month_year;
+ var type_question = (x).type_question;
+ var label = (x).label;
+ var value = parseFloat((x).value);
+ var count = (x).count;
+ var nb_question_response = parseFloat((x).nb_question_response);
+ var somme_question_response = parseFloat((x).somme_question_response);
+ var moyenne_question_response = parseFloat((x).moyenne_question_response);
+
+
+ //---
+ var node = {
+ "month_year": month_year,
+ "label": label,
+ "type_question": type_question,
+ "value": parseFloat(String(value)),
+ "count": count,
+ "nb_question_response": parseInt(String(nb_question_response)),
+ "somme_question_response": parseFloat(String(somme_question_response)),
+ "moyenne_question_response": parseFloat(String(moyenne_question_response)),
+
+ };
+ new_data2.push(node);
+ });
+
+ setGetall_Qry_Survey_Data_result_JSON(new_data2);
+ //setGetall_Qry_Survey_Data_result_JSON(JSON.parse('[' + res.data.message + ']'));
+
+ //console.log(" ### new_data2 011 = ", new_data2);
+
+
+ var jsonObj0_global = json_data.global
+ //console.log(" ### jsonObj0_global= ", jsonObj0_global);
+ setGlobal_Getall_Qry_Survey_Data_result_JSON(jsonObj0_global);
+
+
+
+ setGetall_Qry_Survey_Data_api("true");
+ setGetall_Qry_Survey_Data_result(res.data.message);
+
+
+ }
+ else {
+ setGetall_Qry_Survey_Data_api("false");
+ setGetall_Qry_Survey_Data_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Qry_Survey_Data = ', error);
+ setGetall_Qry_Survey_Data_api("false");
+ // alert("Impossible de récuperer les données demandées");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de récuperer les données demandées");
+ setalert_type("error");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+ const [Get_Qualiopi_Indic_Apprenant_Formation_api, setGet_Qualiopi_Indic_Apprenant_Formation_api] = useState();
+ const [Get_Qualiopi_Indic_Apprenant_Formation_message, setGet_Qualiopi_Indic_Apprenant_Formation_message] = useState();
+ const [Get_Qualiopi_Indic_Apprenant_Formation_result, setGet_Qualiopi_Indic_Apprenant_Formation_result] = useState([]);
+ function Get_Qualiopi_Indic_Apprenant_Formation(local_from_beginning) {
+
+ var form = new FormData();
+ const stored_cookie = getCookie('tokenmysypart');
+
+ var date_from = "";
+ if (p_filter_date_from) {
+ date_from = p_filter_date_from;
+
+ }
+
+ var date_to = "";
+ if (p_filter_date_to) {
+ date_to = p_filter_date_to;
+
+ }
+
+
+ form.append("token", stored_cookie);
+ form.append("session_start_date", date_from);
+ form.append("session_end_date", date_to);
+ form.append("tab_formation_ids", selected_class_id);
+ form.append("from_beginning", local_from_beginning);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Taux_Success_For_List_Class/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_Qualiopi_Indic_Apprenant_Formation res.data.status = " + res.data.status);
+ // console.log(" In Get_Qualiopi_Indic_Apprenant_Formation res.data.message r_class = " + res.data.message);
+
+ var json_data = JSON.parse(res.data.message[0]);
+
+ // console.log(" ### json_data = ", json_data);
+ var jsonObj0 = json_data.data
+ if (json_data.total_nb_inscrit) {
+ setqualiopi_indic_nb_apprenant(json_data.total_nb_inscrit)
+ } else {
+ setqualiopi_indic_nb_apprenant("");
+ }
+
+ if (json_data.taux_success) {
+ setqualiopi_indic_taux_sucess(json_data.taux_success)
+ } else {
+ setqualiopi_indic_taux_sucess("");
+ }
+
+
+ //console.log(" ### jsonObj0 = ", jsonObj0);
+
+ setGet_Qualiopi_Indic_Apprenant_Formation_api("true");
+ setGet_Qualiopi_Indic_Apprenant_Formation_result(res.data.message);
+
+
+ }
+ else {
+ setGet_Qualiopi_Indic_Apprenant_Formation_api("false");
+ setGet_Qualiopi_Indic_Apprenant_Formation_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_Qualiopi_Indic_Apprenant_Formation = ', error);
+ setGet_Qualiopi_Indic_Apprenant_Formation_api("false");
+ // alert("Impossible de récuperer les données demandées");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de récuperer les données demandées");
+ setalert_type("error");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+ const [Get_Qualiopi_Indic_Nb_Heure_api, setGet_Qualiopi_Indic_Nb_Heure_api] = useState();
+ const [Get_Qualiopi_Indic_Nb_Heure_message, setGet_Qualiopi_Indic_Nb_Heure_message] = useState();
+ const [Get_Qualiopi_Indic_Nb_Heure_result, setGet_Qualiopi_Indic_Nb_Heure_result] = useState([]);
+ function Get_Qualiopi_Indic_Nb_Heure(local_from_beginning) {
+
+ var form = new FormData();
+ const stored_cookie = getCookie('tokenmysypart');
+
+ var date_from = "";
+ if (p_filter_date_from) {
+ date_from = p_filter_date_from;
+
+ }
+
+ var date_to = "";
+ if (p_filter_date_to) {
+ date_to = p_filter_date_to;
+
+ }
+
+
+ form.append("token", stored_cookie);
+ form.append("session_start_date", date_from);
+ form.append("session_end_date", date_to);
+ form.append("tab_formation_ids", selected_class_id);
+ form.append("from_beginning", local_from_beginning);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_Session_For_List_Class/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_Qualiopi_Indic_Nb_Heure res.data.status = " + res.data.status);
+ // console.log(" In Get_Qualiopi_Indic_Nb_Heure res.data.message r_class = " + res.data.message);
+
+ var json_data = JSON.parse(res.data.message[0]);
+
+ // console.log(" ### json_data = ", json_data);
+ var jsonObj0 = json_data.data
+
+ if (json_data.total_nb_heure) {
+ setqualiopi_indic_nb_heure(json_data.total_nb_heure)
+ } else {
+ setqualiopi_indic_nb_heure("")
+ }
+ //console.log(" ### jsonObj0 = ", jsonObj0);
+
+ setGet_Qualiopi_Indic_Nb_Heure_api("true");
+ setGet_Qualiopi_Indic_Nb_Heure_result(res.data.message);
+
+
+ }
+ else {
+ setGet_Qualiopi_Indic_Nb_Heure_api("false");
+ setGet_Qualiopi_Indic_Nb_Heure_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_Qualiopi_Indic_Nb_Heure = ', error);
+ setGet_Qualiopi_Indic_Nb_Heure_api("false");
+ // alert("Impossible de récuperer les données demandées");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de récuperer les données demandées");
+ setalert_type("error");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [Get_Indic_Class_CA_HT_api, setGet_Indic_Class_CA_HT_api] = useState();
+ const [Get_Indic_Class_CA_HT_message, setGet_Indic_Class_CA_HT_message] = useState();
+ const [Get_Indic_Class_CA_HT_result, setGet_Indic_Class_CA_HT_result] = useState([]);
+ function Get_Indic_Class_CA_HT(local_from_beginning) {
+
+ var form = new FormData();
+ const stored_cookie = getCookie('tokenmysypart');
+
+ var date_from = "";
+ if (p_filter_date_from) {
+ date_from = p_filter_date_from;
+
+ }
+
+ var date_to = "";
+ if (p_filter_date_to) {
+ date_to = p_filter_date_to;
+
+ }
+
+
+ form.append("token", stored_cookie);
+ form.append("periode_start_date", date_from);
+ form.append("periode_end_date", date_to);
+ form.append("tab_formation_ids", selected_class_id);
+ form.append("from_beginning", local_from_beginning);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Qery_List_Factures_For_List_Class/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_Indic_Class_CA_HT res.data.status = " + res.data.status);
+ console.log(" In Get_Indic_Class_CA_HT res.data.message r_class = " + res.data.message);
+
+ var json_data = JSON.parse(res.data.message[0]);
+
+ // console.log(" ### json_data = ", json_data.data[0]);
+
+
+ if (json_data.data[0] && json_data.data[0].TotalAmount_HT) {
+ setindic_class_ca_ht(json_data.data[0].TotalAmount_HT)
+ } else {
+ setindic_class_ca_ht("")
+ }
+ //console.log(" ### jsonObj0 = ", jsonObj0);
+
+ setGet_Indic_Class_CA_HT_api("true");
+ setGet_Indic_Class_CA_HT_result(res.data.message);
+
+
+ }
+ else {
+ setGet_Indic_Class_CA_HT_api("false");
+ setGet_Indic_Class_CA_HT_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_Indic_Class_CA_HT = ', error);
+ setGet_Indic_Class_CA_HT_api("false");
+ // alert("Impossible de récuperer les données demandées");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de récuperer les données demandées");
+ setalert_type("error");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const otherSetting = {
+ height: 300,
+ yAxis: [{ label: '' }],
+ grid: { horizontal: true },
+ sx: {
+ [`& .${axisClasses.left} .${axisClasses.label}`]: {
+ transform: 'translateX(-10px)',
+ },
+ },
+ };
+
+ const valueFormatter = (value) => `${value}`;
+
+ const [display_view, setdisplay_view] = useState("bars");
+ function func_display_line_view() {
+ setdisplay_view("line");
+ }
+
+ function func_display_bars_view() {
+ setdisplay_view("bars");
+ }
+
+
+
+ function Export_Statistic_to_Excel(local_dashbord_internal_id) {
+
+ const stored_cookie = getCookie('tokenmysypart');
+
+ var date_from = "";
+ if (p_filter_date_from) {
+ date_from = p_filter_date_from;
+ date_from = date_from.replaceAll('/', "-")
+
+ }
+
+ var date_to = "";
+ if (p_filter_date_to) {
+ date_to = p_filter_date_to;
+ date_to = date_to.replaceAll('/', "-")
+ }
+
+
+
+
+ var nom_fichier_cmd_excel = "export_excel.xlsx";
+ var local_related_collection = "inscription";
+ //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- local_dashbord_internal_id = ", local_dashbord_internal_id);
+
+ var url = process.env.REACT_APP_API_URL + "myclass/api/Export_Excel_Survey_Stat_Data_For_Given_related_collection_id/" + stored_cookie + "/" + local_related_collection + "/-/" + date_from + "/" + date_to + "/" + selected_statistic_question_id + "/" + selected_class_id + "/";
+
+ //console.log(" nom_fichier_cmd = ", nom_fichier_cmd, " --- selected_id = ", selected_id, " --- url =", url);
+
+ // console.log(" #### url = ", url)
+
+ setLoading(true);
+ axios.get(url, { responseType: 'blob', },)
+ .then((res) => {
+ setLoading(false);
+ //console.log(" In Export_Dashbord_to_CSV res.data = " + res.data);
+ if (String(res.data) === String("false")) {
+ // alert("Impossible d'exporter les données (2) ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'exporter les données (2)");
+ setalert_type("error");
+ } else {
+ fileDownload(res.data, nom_fichier_cmd_excel)
+
+ }
+ }).catch((error) => {
+ setLoading(false);
+ console.error('Error:', error);
+ // alert(" Impossible d'exporter les données ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible d'exporter les données");
+ setalert_type("error");
+
+ });
+
+ }
+
+ const Dialog_mysy_ia_handleClose = () => {
+
+ setDialog_mysy_ia_open(false)
+
+ };
+
+ const classes = useStyles();
+
+ const [text_for_ia, settext_for_ia] = useState("");
+
+ const [fiels_of_text_replacement_ia, setfiels_of_text_replacement_ia] = useState("");
+
+ function function_of_text_replacement_ia(text_result) {
+ if (fiels_of_text_replacement_ia === "description")
+ setfield_description(text_result);
+
+ else if (fiels_of_text_replacement_ia === "objectif")
+ setfield_objectif(text_result)
+
+ else if (fiels_of_text_replacement_ia === "programme")
+ setfield_programme(text_result)
+
+ else if (fiels_of_text_replacement_ia === "prerequis")
+ setfield_prerequis(text_result)
+
+ else if (fiels_of_text_replacement_ia === "plusproduit")
+ setfield_plus_produit(text_result)
+
+ else if (fiels_of_text_replacement_ia === "contenuattestation")
+ setfield_contenu_attestation(text_result)
+
+ DataUpdated();
+ }
+
+ const [Dialog_mysy_ia_open, setDialog_mysy_ia_open] = React.useState(false);
+
+ const [display_alert_mysy, setdisplay_alert_mysy] = useState("");
+ const [alert_message, setalert_message] = useState("");
+ const [alert_type, setalert_type] = useState("");
+
+ function clear_alert_message() {
+ setalert_message("");
+ }
+ function clear_alert_type() {
+ setalert_type("");
+ }
+
+ function clear_display_alert_mysy() {
+ setdisplay_alert_mysy("");
+ }
+
+ const [Dialog_Financial_Data_open, setDialog_Financial_Data_open] = React.useState(false);
+
+ const Dialog_Financial_Data_handleClose_buton = () => {
+ setDialog_Financial_Data_open(false);
+ setp_detail_fin_data_code("");
+ setp_detail_fin_data_description("");
+ setp_detail_fin_data_commentaire("");
+ setp_detail_fin_data_montant("");
+ setp_detail_fin_data_type_cout("");
+ setadd_one_finance_data_to_class("");
+ setdisplay_finance_data_to_class("");
+ setedit_finance_data_to_class("");
+ setselected_finance_data_id("");
+ };
+
+
+ const [qualiopi_indic_nb_apprenant, setqualiopi_indic_nb_apprenant] = React.useState("");
+ const [qualiopi_indic_nb_heure, setqualiopi_indic_nb_heure] = React.useState("");
+ const [qualiopi_indic_taux_sucess, setqualiopi_indic_taux_sucess] = React.useState("");
+ const [indic_class_ca_ht, setindic_class_ca_ht] = React.useState("");
+
+
+ const [selected_default_Convention_individuelle_PDF, setselected_default_Convention_individuelle_PDF] = useState("");
+
+ const [New_Get_List_Convention_Individuelle_PDF_result, setNew_Get_List_Convention_Individuelle_PDF_result] = useState([]);
+
+ const [Get_List_Convention_Individuelle_PDF_api, setGet_List_Convention_Individuelle_PDF_api] = useState();
+ const [Get_List_Convention_Individuelle_PDF_message, setGet_List_Convention_Individuelle_PDF_message] = useState();
+ const [Get_List_Convention_Individuelle_PDF_result, setGet_List_Convention_Individuelle_PDF_result] = useState();
+ function Get_List_Convention_Individuelle_PDF() {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type_doc", "pdf");
+ form.append("courrier_template_type_document_ref_interne", "CONVENTION_STAGIAIRE_INDIVIDUELLE");
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Conventions_Stagiaire_With_Filter/";
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Get_List_Convention_Individuelle_PDF res.data.status = " + res.data.status);
+ //console.log(" In Get_List_Convention_Individuelle_PDF res.data.message r_class = " + res.data.message);
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+
+
+ setGet_List_Convention_Individuelle_PDF_api("true");
+ setGet_List_Convention_Individuelle_PDF_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_ref_interne = JSON.parse(x).ref_interne;
+ var local_nom = JSON.parse(x).nom;
+ var local_sujet = JSON.parse(x).sujet;
+ var local_type_doc = JSON.parse(x).type_doc;
+ var local_cible = JSON.parse(x).cible;
+ var local_joint_pdf = JSON.parse(x).joint_pdf;
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "ref_interne": local_ref_interne,
+ "nom": local_nom,
+ "sujet": local_sujet,
+ "type_doc": local_type_doc,
+ "cible": local_cible,
+ "joint_pdf": local_joint_pdf,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "ref_interne": "",
+ "nom": "",
+ "sujet": "",
+ "type_doc": "",
+ "cible": "",
+ "joint_pdf": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Convention_Individuelle_PDF_result(new_data2);
+ else
+ setNew_Get_List_Convention_Individuelle_PDF_result([]);
+
+ }
+ else {
+ setGet_List_Convention_Individuelle_PDF_api("false");
+ setGet_List_Convention_Individuelle_PDF_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_List_Convention_Individuelle_PDF = ', error);
+ setGet_List_Convention_Individuelle_PDF_api("false");
+ alert("Impossible de récupérer les modèles de Convention individuelles PDF");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [selected_default_Convention_entreprise_PDF, setselected_default_Convention_entreprise_PDF] = useState("");
+
+ const [New_Get_List_Convention_Entreprise_PDF_result, setNew_Get_List_Convention_Entreprise_PDF_result] = useState([]);
+
+ const [Get_List_Convention_Entreprise_PDF_api, setGet_List_Convention_Entreprise_PDF_api] = useState();
+ const [Get_List_Convention_Entreprise_PDF_message, setGet_List_Convention_Entreprise_PDF_message] = useState();
+ const [Get_List_Convention_Entreprise_PDF_result, setGet_List_Convention_Entreprise_PDF_result] = useState();
+ function Get_List_Convention_Entreprise_PDF() {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type_doc", "pdf");
+ form.append("courrier_template_type_document_ref_interne", "CONVENTION_STAGIAIRE_ENTREPRISE");
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Conventions_Stagiaire_With_Filter/";
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Get_List_Convention_Entreprise_PDF res.data.status = " + res.data.status);
+ //console.log(" In Get_List_Convention_Entreprise_PDF res.data.message r_class = " + res.data.message);
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+
+
+ setGet_List_Convention_Entreprise_PDF_api("true");
+ setGet_List_Convention_Entreprise_PDF_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_ref_interne = JSON.parse(x).ref_interne;
+ var local_nom = JSON.parse(x).nom;
+ var local_sujet = JSON.parse(x).sujet;
+ var local_type_doc = JSON.parse(x).type_doc;
+ var local_cible = JSON.parse(x).cible;
+ var local_joint_pdf = JSON.parse(x).joint_pdf;
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "ref_interne": local_ref_interne,
+ "nom": local_nom,
+ "sujet": local_sujet,
+ "type_doc": local_type_doc,
+ "cible": local_cible,
+ "joint_pdf": local_joint_pdf,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "ref_interne": "",
+ "nom": "",
+ "sujet": "",
+ "type_doc": "",
+ "cible": "",
+ "joint_pdf": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Convention_Entreprise_PDF_result(new_data2);
+ else
+ setNew_Get_List_Convention_Entreprise_PDF_result([]);
+
+ }
+ else {
+ setGet_List_Convention_Entreprise_PDF_api("false");
+ setGet_List_Convention_Entreprise_PDF_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_List_Convention_Entreprise_PDF = ', error);
+ setGet_List_Convention_Entreprise_PDF_api("false");
+ alert("Impossible de récupérer les modèles de Convention Entreprise PDF");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [selected_default_Convention_individuelle_Mail, setselected_default_Convention_individuelle_Mail] = useState("");
+
+ const [New_Get_List_Convention_Individuelle_Mail_result, setNew_Get_List_Convention_Individuelle_Mail_result] = useState([]);
+
+ const [Get_List_Convention_Individuelle_Mail_api, setGet_List_Convention_Individuelle_Mail_api] = useState();
+ const [Get_List_Convention_Individuelle_Mail_message, setGet_List_Convention_Individuelle_Mail_message] = useState();
+ const [Get_List_Convention_Individuelle_Mail_result, setGet_List_Convention_Individuelle_Mail_result] = useState();
+ function Get_List_Convention_Individuelle_Mail() {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type_doc", "email");
+ form.append("courrier_template_type_document_ref_interne", "CONVENTION_STAGIAIRE_INDIVIDUELLE");
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Conventions_Stagiaire_With_Filter/";
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Get_List_Convention_Individuelle_Mail res.data.status = " + res.data.status);
+ //console.log(" In Get_List_Convention_Individuelle_Mail res.data.message r_class = " + res.data.message);
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+
+
+ setGet_List_Convention_Individuelle_Mail_api("true");
+ setGet_List_Convention_Individuelle_Mail_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_ref_interne = JSON.parse(x).ref_interne;
+ var local_nom = JSON.parse(x).nom;
+ var local_sujet = JSON.parse(x).sujet;
+ var local_type_doc = JSON.parse(x).type_doc;
+ var local_cible = JSON.parse(x).cible;
+ var local_joint_pdf = JSON.parse(x).joint_pdf;
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "ref_interne": local_ref_interne,
+ "nom": local_nom,
+ "sujet": local_sujet,
+ "type_doc": local_type_doc,
+ "cible": local_cible,
+ "joint_pdf": local_joint_pdf,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "ref_interne": "",
+ "nom": "",
+ "sujet": "",
+ "type_doc": "",
+ "cible": "",
+ "joint_pdf": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Convention_Individuelle_Mail_result(new_data2);
+ else
+ setNew_Get_List_Convention_Individuelle_Mail_result([]);
+
+
+ }
+ else {
+ setGet_List_Convention_Individuelle_Mail_api("false");
+ setGet_List_Convention_Individuelle_Mail_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_List_Convention_Individuelle_Mail = ', error);
+ setGet_List_Convention_Individuelle_Mail_api("false");
+ alert("Impossible de récupérer les modèles de Convention individuelles mail");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [selected_default_Convention_entreprise_Mail, setselected_default_Convention_entreprise_Mail] = useState("");
+
+ const [New_Get_List_Convention_Entreprise_Mail_result, setNew_Get_List_Convention_Entreprise_Mail_result] = useState([]);
+
+ const [Get_List_Convention_Entreprise_Mail_api, setGet_List_Convention_Entreprise_Mail_api] = useState();
+ const [Get_List_Convention_Entreprise_Mail_message, setGet_List_Convention_Entreprise_Mail_message] = useState();
+ const [Get_List_Convention_Entreprise_Mail_result, setGet_List_Convention_Entreprise_Mail_result] = useState();
+ function Get_List_Convention_Entreprise_Mail() {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type_doc", "email");
+ form.append("courrier_template_type_document_ref_interne", "CONVENTION_STAGIAIRE_ENTREPRISE");
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Conventions_Stagiaire_With_Filter/";
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Get_List_Convention_Entreprise_Mail res.data.status = " + res.data.status);
+ //console.log(" In Get_List_Convention_Entreprise_Mail res.data.message r_class = " + res.data.message);
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+
+
+ setGet_List_Convention_Entreprise_Mail_api("true");
+ setGet_List_Convention_Entreprise_Mail_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_ref_interne = JSON.parse(x).ref_interne;
+ var local_nom = JSON.parse(x).nom;
+ var local_sujet = JSON.parse(x).sujet;
+ var local_type_doc = JSON.parse(x).type_doc;
+ var local_cible = JSON.parse(x).cible;
+ var local_joint_pdf = JSON.parse(x).joint_pdf;
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "ref_interne": local_ref_interne,
+ "nom": local_nom,
+ "sujet": local_sujet,
+ "type_doc": local_type_doc,
+ "cible": local_cible,
+ "joint_pdf": local_joint_pdf,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "ref_interne": "",
+ "nom": "",
+ "sujet": "",
+ "type_doc": "",
+ "cible": "",
+ "joint_pdf": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Convention_Entreprise_Mail_result(new_data2);
+ else
+ setNew_Get_List_Convention_Entreprise_Mail_result([]);
+
+
+ }
+ else {
+ setGet_List_Convention_Entreprise_Mail_api("false");
+ setGet_List_Convention_Entreprise_Mail_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_List_Convention_Entreprise_Mail = ', error);
+ setGet_List_Convention_Entreprise_Mail_api("false");
+ alert("Impossible de récupérer les modèles de Convention entreprise mail");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [selected_default_Stagiaire_Convocations_Mail, setselected_default_Stagiaire_Convocations_Mail] = useState("");
+
+ const [New_Get_List_Stagiaire_Convocations_Mail_result, setNew_Get_List_Stagiaire_Convocations_Mail_result] = useState([]);
+
+ const [Get_List_Stagiaire_Convocations_Mail_api, setGet_List_Stagiaire_Convocations_Mail_api] = useState();
+ const [Get_List_Stagiaire_Convocations_Mail_message, setGet_List_Stagiaire_Convocations_Mail_message] = useState();
+ const [Get_List_Stagiaire_Convocations_Mail_result, setGet_List_Stagiaire_Convocations_Mail_result] = useState();
+ function Get_List_Stagiaire_Convocations_Mail() {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type_doc", "email");
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Convocations_Stagiaire_With_Filter/";
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Get_List_Stagiaire_Convocations_Mail res.data.status = " + res.data.status);
+ //console.log(" In Get_List_Stagiaire_Convocations_Mail res.data.message r_class = " + res.data.message);
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+
+
+ setGet_List_Stagiaire_Convocations_Mail_api("true");
+ setGet_List_Stagiaire_Convocations_Mail_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_ref_interne = JSON.parse(x).ref_interne;
+ var local_nom = JSON.parse(x).nom;
+ var local_sujet = JSON.parse(x).sujet;
+ var local_type_doc = JSON.parse(x).type_doc;
+ var local_cible = JSON.parse(x).cible;
+ var local_joint_pdf = JSON.parse(x).joint_pdf;
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "ref_interne": local_ref_interne,
+ "nom": local_nom,
+ "sujet": local_sujet,
+ "type_doc": local_type_doc,
+ "cible": local_cible,
+ "joint_pdf": local_joint_pdf,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "ref_interne": "",
+ "nom": "",
+ "sujet": "",
+ "type_doc": "",
+ "cible": "",
+ "joint_pdf": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Stagiaire_Convocations_Mail_result(new_data2);
+ else
+ setNew_Get_List_Stagiaire_Convocations_Mail_result([]);
+
+
+ }
+ else {
+ setGet_List_Stagiaire_Convocations_Mail_api("false");
+ setGet_List_Stagiaire_Convocations_Mail_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_List_Stagiaire_Convocations_Mail = ', error);
+ setGet_List_Stagiaire_Convocations_Mail_api("false");
+ alert("Impossible de récupérer les modèles de convocations");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+
+ const [selected_default_attestation_PDF, setselected_default_attestation_PDF] = useState("");
+
+ const [New_Get_List_Attestation_PDF_result, setNew_Get_List_Attestation_PDF_result] = useState([]);
+
+ const [Get_List_Attestation_PDF_api, setGet_List_Attestation_PDF_api] = useState();
+ const [Get_List_Attestation_PDF_message, setGet_List_Attestation_PDF_message] = useState();
+ const [Get_List_Attestation_PDF_result, setGet_List_Attestation_PDF_result] = useState();
+ function Get_List_Attestation_PDF() {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type_doc", "pdf");
+ form.append("courrier_template_type_document_ref_interne", "ATTESTATION_FORMATION");
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Modele_Attestion_Formation_With_Filter/";
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Get_List_Attestation_PDF res.data.status = " + res.data.status);
+ //console.log(" In Get_List_Attestation_PDF res.data.message r_class = " + res.data.message);
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+
+
+ setGet_List_Attestation_PDF_api("true");
+ setGet_List_Attestation_PDF_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_ref_interne = JSON.parse(x).ref_interne;
+ var local_nom = JSON.parse(x).nom;
+ var local_sujet = JSON.parse(x).sujet;
+ var local_type_doc = JSON.parse(x).type_doc;
+ var local_cible = JSON.parse(x).cible;
+ var local_joint_pdf = JSON.parse(x).joint_pdf;
+
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "ref_interne": local_ref_interne,
+ "nom": local_nom,
+ "sujet": local_sujet,
+ "type_doc": local_type_doc,
+ "cible": local_cible,
+ "joint_pdf": local_joint_pdf,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "ref_interne": "",
+ "nom": "",
+ "sujet": "",
+ "type_doc": "",
+ "cible": "",
+ "joint_pdf": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Attestation_PDF_result(new_data2);
+ else
+ setNew_Get_List_Attestation_PDF_result([])
+
+ }
+ else {
+ setGet_List_Attestation_PDF_api("false");
+ setGet_List_Attestation_PDF_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_List_Attestation_PDF = ', error);
+ setGet_List_Attestation_PDF_api("false");
+ alert("Impossible de récupérer les modèles d'attestation PDF");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [selected_default_attestation_Email, setselected_default_attestation_Email] = useState("");
+
+ const [New_Get_List_Attestation_Email_result, setNew_Get_List_Attestation_Email_result] = useState([]);
+
+ const [Get_List_Attestation_Email_api, setGet_List_Attestation_Email_api] = useState();
+ const [Get_List_Attestation_Email_message, setGet_List_Attestation_Email_message] = useState();
+ const [Get_List_Attestation_Email_result, setGet_List_Attestation_Email_result] = useState();
+ function Get_List_Attestation_Email() {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type_doc", "email");
+ form.append("courrier_template_type_document_ref_interne", "ATTESTATION_FORMATION");
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Modele_Attestion_Formation_With_Filter/";
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Get_List_Attestation_Email res.data.status = " + res.data.status);
+ //console.log(" In Get_List_Attestation_Email res.data.message r_class = " + res.data.message);
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+
+
+ setGet_List_Attestation_Email_api("true");
+ setGet_List_Attestation_Email_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_ref_interne = JSON.parse(x).ref_interne;
+ var local_nom = JSON.parse(x).nom;
+ var local_sujet = JSON.parse(x).sujet;
+ var local_type_doc = JSON.parse(x).type_doc;
+ var local_cible = JSON.parse(x).cible;
+ var local_joint_pdf = JSON.parse(x).joint_pdf;
+
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "ref_interne": local_ref_interne,
+ "nom": local_nom,
+ "sujet": local_sujet,
+ "type_doc": local_type_doc,
+ "cible": local_cible,
+ "joint_pdf": local_joint_pdf,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "ref_interne": "",
+ "nom": "",
+ "sujet": "",
+ "type_doc": "",
+ "cible": "",
+ "joint_pdf": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Attestation_Email_result(new_data2);
+ else
+ setNew_Get_List_Attestation_Email_result([])
+
+ }
+ else {
+ setGet_List_Attestation_Email_api("false");
+ setGet_List_Attestation_Email_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_List_Attestation_Email = ', error);
+ setGet_List_Attestation_Email_api("false");
+ alert("Impossible de récupérer les modèles d'attestation Email");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+ const [selected_default_Stagiaire_Convocations_PDF, setselected_default_Stagiaire_Convocations_PDF] = useState("");
+
+ const [New_Get_List_Stagiaire_Convocations_PDF_result, setNew_Get_List_Stagiaire_Convocations_PDF_result] = useState([]);
+
+ const [Get_List_Stagiaire_Convocations_PDF_api, setGet_List_Stagiaire_Convocations_PDF_api] = useState();
+ const [Get_List_Stagiaire_Convocations_PDF_message, setGet_List_Stagiaire_Convocations_PDF_message] = useState();
+ const [Get_List_Stagiaire_Convocations_PDF_result, setGet_List_Stagiaire_Convocations_PDF_result] = useState();
+ function Get_List_Stagiaire_Convocations_PDF() {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type_doc", "pdf");
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_List_Convocations_Stagiaire_With_Filter/";
+ setLoading(true);
+
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In Get_List_Stagiaire_Convocations_PDF res.data.status = " + res.data.status);
+ //console.log(" In Get_List_Stagiaire_Convocations_PDF res.data.message r_class = " + res.data.message);
+ setLoading(false);
+ if (String(res.data.status) === String("true")) {
+
+
+ setGet_List_Stagiaire_Convocations_PDF_api("true");
+ setGet_List_Stagiaire_Convocations_PDF_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_ref_interne = JSON.parse(x).ref_interne;
+ var local_nom = JSON.parse(x).nom;
+ var local_sujet = JSON.parse(x).sujet;
+ var local_type_doc = JSON.parse(x).type_doc;
+ var local_cible = JSON.parse(x).cible;
+ var local_joint_pdf = JSON.parse(x).joint_pdf;
+
+
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_nom,
+ "ref_interne": local_ref_interne,
+ "nom": local_nom,
+ "sujet": local_sujet,
+ "type_doc": local_type_doc,
+ "cible": local_cible,
+ "joint_pdf": local_joint_pdf,
+
+ };
+ new_data2.push(node);
+ });
+
+ var node = {
+ "_id": "",
+ "id": "",
+ "label": "",
+ "ref_interne": "",
+ "nom": "",
+ "sujet": "",
+ "type_doc": "",
+ "cible": "",
+ "joint_pdf": "",
+
+ };
+ new_data2.push(node);
+
+ if (new_data2.length > 0)
+ setNew_Get_List_Stagiaire_Convocations_PDF_result(new_data2);
+ else
+ setNew_Get_List_Stagiaire_Convocations_PDF_result([])
+
+ }
+ else {
+ setGet_List_Stagiaire_Convocations_PDF_api("false");
+ setGet_List_Stagiaire_Convocations_PDF_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_List_Stagiaire_Convocations_PDF = ', error);
+ setGet_List_Stagiaire_Convocations_PDF_api("false");
+ alert("Impossible de récupérer les modèles de convocations PDF");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [selected_default_Formulaires_Eval_Formateur, setselected_default_Formulaires_Eval_Formateur] = useState("");
+
+ const [New_Getall_Partner_Formulaires_Eval_Formateur, setNew_Getall_Partner_Formulaires_Eval_Formateur] = useState([]);
+
+ const [Getall_Partner_Formulaires_Eval_Formateur_api, setGetall_Partner_Formulaires_Eval_Formateur_api] = useState();
+ const [Getall_Partner_Formulaires_Eval_Formateur_message, setGetall_Partner_Formulaires_Eval_Formateur_message] = useState();
+ const [Getall_Partner_Formulaires_Eval_Formateur_result, setGetall_Partner_Formulaires_Eval_Formateur_result] = useState([]);
+ function Getall_Partner_Formulaires_Eval_Formateur(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type", "human_eval");
+
+ 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_Eval_Formateur res.data.status = " + res.data.status);
+ //console.log(" In Getall_Partner_Formulaires_Eval_Formateur res.data.message r_class = " + res.data.message);
+ setGetall_Partner_Formulaires_Eval_Formateur_api("true");
+ setGetall_Partner_Formulaires_Eval_Formateur_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_Eval_Formateur(new_data2);
+ }
+ else {
+ setGetall_Partner_Formulaires_Eval_Formateur_api("false");
+ setGetall_Partner_Formulaires_Eval_Formateur_message(res.data.message);
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Partner_Formulaires_Eval_Formateur = ', error);
+ setGetall_Partner_Formulaires_Eval_Formateur_api("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [selected_default_Formulaires_Eval_Chaud, setselected_default_Formulaires_Eval_Chaud] = useState("");
+
+ const [New_Getall_Partner_Formulaires_Eval_Chaud, setNew_Getall_Partner_Formulaires_Eval_Chaud] = useState([]);
+
+ const [Getall_Partner_Formulaires_Eval_Chaud_api, setGetall_Partner_Formulaires_Eval_Chaud_api] = useState();
+ const [Getall_Partner_Formulaires_Eval_Chaud_message, setGetall_Partner_Formulaires_Eval_Chaud_message] = useState();
+ const [Getall_Partner_Formulaires_Eval_Chaud_result, setGetall_Partner_Formulaires_Eval_Chaud_result] = useState([]);
+ function Getall_Partner_Formulaires_Eval_Chaud(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type", "hot_eval");
+
+ 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_Eval_Chaud res.data.status = " + res.data.status);
+ //console.log(" In Getall_Partner_Formulaires_Eval_Chaud res.data.message r_class = " + res.data.message);
+ setGetall_Partner_Formulaires_Eval_Chaud_api("true");
+ setGetall_Partner_Formulaires_Eval_Chaud_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_Eval_Chaud(new_data2);
+ }
+ else {
+ setGetall_Partner_Formulaires_Eval_Chaud_api("false");
+ setGetall_Partner_Formulaires_Eval_Chaud_message(res.data.message);
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Partner_Formulaires_Eval_chaud = ', error);
+ setGetall_Partner_Formulaires_Eval_Chaud_api("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [selected_default_Formulaires_Eval_Froid, setselected_default_Formulaires_Eval_Froid] = useState("");
+
+ const [New_Getall_Partner_Formulaires_Eval_Froid, setNew_Getall_Partner_Formulaires_Eval_Froid] = useState([]);
+
+ const [Getall_Partner_Formulaires_Eval_Froid_api, setGetall_Partner_Formulaires_Eval_Froid_api] = useState();
+ const [Getall_Partner_Formulaires_Eval_Froid_message, setGetall_Partner_Formulaires_Eval_Froid_message] = useState();
+ const [Getall_Partner_Formulaires_Eval_Froid_result, setGetall_Partner_Formulaires_Eval_Froid_result] = useState([]);
+ function Getall_Partner_Formulaires_Eval_Froid(event) {
+
+ var form = new FormData();
+
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("type", "cold_eval");
+
+ 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_Eval_Froid res.data.status = " + res.data.status);
+ //console.log(" In Getall_Partner_Formulaires_Eval_Froid res.data.message r_class = " + res.data.message);
+ setGetall_Partner_Formulaires_Eval_Froid_api("true");
+ setGetall_Partner_Formulaires_Eval_Froid_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_Eval_Froid(new_data2);
+ }
+ else {
+ setGetall_Partner_Formulaires_Eval_Froid_api("false");
+ setGetall_Partner_Formulaires_Eval_Froid_message(res.data.message);
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Partner_Formulaires_Eval_Froid = ', error);
+ setGetall_Partner_Formulaires_Eval_Froid_api("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [selected_default_Formulaires_Q_Position, setselected_default_Formulaires_Q_Position] = useState("");
+
+ const [New_Getall_Partner_Formulaires_Q_Position, setNew_Getall_Partner_Formulaires_Q_Position] = useState([]);
+
+ const [Getall_Partner_Formulaires_Q_Position_api, setGetall_Partner_Formulaires_Q_Position_api] = useState();
+ const [Getall_Partner_Formulaires_Q_Position_message, setGetall_Partner_Formulaires_Q_Position_message] = useState();
+ const [Getall_Partner_Formulaires_Q_Position_result, setGetall_Partner_Formulaires_Q_Position_result] = useState([]);
+ function Getall_Partner_Formulaires_Q_Position(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_Q_Position res.data.status = " + res.data.status);
+ //console.log(" In Getall_Partner_Formulaires_Q_Position res.data.message r_class = " + res.data.message);
+ setGetall_Partner_Formulaires_Q_Position_api("true");
+ setGetall_Partner_Formulaires_Q_Position_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_Q_Position(new_data2);
+ }
+ else {
+ setGetall_Partner_Formulaires_Q_Position_api("false");
+ setGetall_Partner_Formulaires_Q_Position_message(res.data.message);
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Getall_Partner_Formulaires_Q_Position = ', error);
+ setGetall_Partner_Formulaires_Q_Position_api("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+ const [Update_Class_Default_Document_api, setUpdate_Class_Default_Document_api] = useState();
+ const [Update_Class_Default_Document_message, setUpdate_Class_Default_Document_message] = useState();
+ const [Update_Class_Default_Document_result, setUpdate_Class_Default_Document_result] = useState();
+ function Update_Class_Default_Document() {
+ setLoading(true);
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+ const stored_cookie = getCookie('tokenmysypart');
+
+ form.append("token", stored_cookie);
+
+ form.append("class_id", selected_class_id);
+ // form.append("to", p_one_internal_email_to);
+ form.append("EVAL_FORMATION_HOT", selected_default_Formulaires_Eval_Chaud);
+ form.append("EVAL_FORMATION_COLD", selected_default_Formulaires_Eval_Froid);
+ form.append("EVAL_FORMATION_FORMATEUR", selected_default_Formulaires_Eval_Formateur);
+
+ form.append("QUESTION_POSITIONNEMENT", selected_default_Formulaires_Q_Position);
+
+ form.append("CONVOCATION_STAGIAIRE_MAIL", selected_default_Stagiaire_Convocations_Mail);
+ form.append("CONVOCATION_STAGIAIRE_PDF", selected_default_Stagiaire_Convocations_PDF);
+
+ form.append("CONVENTION_STAGIAIRE_INDIVIDUELLE_MAIL", selected_default_Convention_individuelle_Mail);
+ form.append("CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF", selected_default_Convention_individuelle_PDF);
+
+ form.append("CONVENTION_STAGIAIRE_ENTREPRISE_MAIL", selected_default_Convention_entreprise_Mail);
+ form.append("CONVENTION_STAGIAIRE_ENTREPRISE_PDF", selected_default_Convention_entreprise_PDF);
+
+ form.append("ATTESTATION_FORMATION_MAIL", selected_default_attestation_Email);
+ form.append("ATTESTATION_FORMATION_PDF", selected_default_attestation_PDF);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Update_Class_Default_Document/";
+
+ axios.post(myurl, form).then(res => {
+ setLoading(false);
+ // console.log(" In Update_Class_Default_Document res.data.status = " + res.data.status);
+ // console.log(" In Update_Class_Default_Document res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("success");
+
+ setdefault_doc_modification("0");
+
+ setUpdate_Class_Default_Document_api("true");
+ setUpdate_Class_Default_Document_result(res.data.message);
+
+ }
+ else {
+ setUpdate_Class_Default_Document_api("false");
+ setUpdate_Class_Default_Document_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Update_Class_Default_Document : Not good man :( mysearchtext = ' + error);
+ setUpdate_Class_Default_Document_api("false");
+ // alert(" Impossible d'ajouter l'évaluation l'UE ");
+ setdisplay_alert_mysy("1");
+ setalert_message("Impossible de mettre à jour les documents par défaut");
+ setalert_type("error");
+
+ })
+ }
+
+ const [Get_Given_Class_Default_Documents_api, setGet_Given_Class_Default_Documents_api] = useState();
+ const [Get_Given_Class_Default_Documents_message, setGet_Given_Class_Default_Documents_message] = useState();
+ const [Get_Given_Class_Default_Documents_result, setGet_Given_Class_Default_Documents_result] = useState();
+ function Get_Given_Class_Default_Documents() {
+
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("class_id", selected_class_id);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Given_Class_List_Default_Documents/";
+
+ setLoading(true);
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) === "true") {
+ //console.log(" In Get_Given_Class_Default_Documents res.data.status = " + res.data.status);
+ //console.log(" In Get_Given_Class_Default_Documents res.data.message r_class = " + res.data.message);
+ //console.log(" In Get_Given_Class_Default_Documents res.data.message len = " + String(res.data.message).length);
+
+ setLoading(false);
+ setGet_Given_Class_Default_Documents_api("true");
+ setdefault_doc_modification("0");
+
+ if (String(res.data.message).length > 0) {
+ setGet_Given_Class_Default_Documents_result(res.data.message);
+
+ const new_data = res.data.message.map((x) => {
+ var mylocaltraining = JSON.parse(x);
+
+ if (mylocaltraining.CONVOCATION_STAGIAIRE_MAIL) {
+ setselected_default_Stagiaire_Convocations_Mail(mylocaltraining.CONVOCATION_STAGIAIRE_MAIL);
+ }
+
+ if (mylocaltraining.CONVOCATION_STAGIAIRE_PDF) {
+ setselected_default_Stagiaire_Convocations_PDF(mylocaltraining.CONVOCATION_STAGIAIRE_PDF);
+ }
+
+ if (mylocaltraining.QUESTION_POSITIONNEMENT) {
+ setselected_default_Formulaires_Q_Position(mylocaltraining.QUESTION_POSITIONNEMENT);
+ }
+
+ if (mylocaltraining.CONVENTION_STAGIAIRE_INDIVIDUELLE_MAIL) {
+ setselected_default_Convention_individuelle_Mail(mylocaltraining.CONVENTION_STAGIAIRE_INDIVIDUELLE_MAIL);
+ }
+
+ if (mylocaltraining.CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF) {
+ setselected_default_Convention_individuelle_PDF(mylocaltraining.CONVENTION_STAGIAIRE_INDIVIDUELLE_PDF);
+ }
+
+ if (mylocaltraining.CONVENTION_STAGIAIRE_ENTREPRISE_MAIL) {
+ setselected_default_Convention_entreprise_Mail(mylocaltraining.CONVENTION_STAGIAIRE_ENTREPRISE_MAIL);
+ }
+
+ if (mylocaltraining.CONVENTION_STAGIAIRE_ENTREPRISE_PDF) {
+ setselected_default_Convention_entreprise_PDF(mylocaltraining.CONVENTION_STAGIAIRE_ENTREPRISE_PDF);
+ }
+
+ if (mylocaltraining.EVAL_FORMATION_HOT) {
+ setselected_default_Formulaires_Eval_Chaud(mylocaltraining.EVAL_FORMATION_HOT);
+ }
+
+ if (mylocaltraining.EVAL_FORMATION_COLD) {
+ setselected_default_Formulaires_Eval_Froid(mylocaltraining.EVAL_FORMATION_COLD);
+ }
+
+ if (mylocaltraining.EVAL_FORMATION_FORMATEUR) {
+ setselected_default_Formulaires_Eval_Formateur(mylocaltraining.EVAL_FORMATION_FORMATEUR);
+ }
+
+ if (mylocaltraining.ATTESTATION_FORMATION_PDF) {
+ console.log(" ### eeee = ", mylocaltraining.ATTESTATION_FORMATION_PDF)
+ setselected_default_attestation_PDF(mylocaltraining.ATTESTATION_FORMATION_PDF);
+ }
+
+ if (mylocaltraining.ATTESTATION_FORMATION_MAIL) {
+ console.log(" ### iii = ", mylocaltraining.ATTESTATION_FORMATION_MAIL)
+ setselected_default_attestation_Email(mylocaltraining.ATTESTATION_FORMATION_MAIL);
+ }
+
+
+ });
+
+ }
+
+ } else if (String(res.data.status) === String("Err_Connexion")) {
+ setLoading(false);
+ alert('Erreur: ' + res.data.message);
+ history.push("/Connexion");
+ }
+
+ else {
+ setLoading(false);
+ setGet_Given_Class_Default_Documents_api("false");
+ setGet_Given_Class_Default_Documents_message(res.data.message);
+ // alert(res.data.message);
+
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ setLoading(false);
+ console.warn('Not good man :( Get_Given_Class_Default_Documents = ', error);
+ setGet_Given_Class_Default_Documents_api("false");
+ alert(" Impossible de récuperer les documents par défaut ");
+
+ })
+ }
+
+
+
+ return (
+
+ {isLoading &&
}
+
+ {/*** Affichage des messages d'alerte*/}
+ {display_alert_mysy && String(display_alert_mysy) === "1" &&
+
+ }
+ {/*** FIN Affichage des messages d'alerte*/}
+
+
+ {/* Dialog pour gerer les Financial_Data */}
+
+ {/* FIN Dialog pour gerer les Financial_Data */}
+
+
+
+ {/*** GESTION IA */}
+
+ {/*** FIN GESTION IA */}
+
+
+ {/* Dialog pour gerer les Unite_Enseignement */}
+
+ {/* FIN Dialog pour gerer les Unite_Enseignement */}
+
+
+
+ {/* Dialog pour gerer une EVALUATION à une Unite_Enseignement */}
+
+ {/* FIN Dialog pour gerer une EVALUATION à une Unite_Enseignement */}
+
+
+
+
+ {String(props.mytrainingclass.ref).trim() !== "" &&
+
+
+
+
+
+
}
+ {String(props.mytrainingclass.ref).trim() !== "" && p_detail_title &&
+ Formation : {p_detail_title}
+
}
+
+
+
+
+
+
+
+ {props.formation_initiale && String(props.formation_initiale) === "1" &&
+
+
+
+
+
+
+
+ {String(props.mytrainingclass.ref).trim() !== "" &&
+
}
+
+
+
+
+ {String(history_securite_read) === "1" &&
}
+
+
+ {String(props.mytrainingclass.ref).trim() !== "" &&
+
}
+
+
+
+
}
+
+ {String(props.formation_initiale) !== "1" &&
+
+
+
+ {String(props.mytrainingclass.ref).trim() !== "" && }
+
+ {String(props.mytrainingclass.ref).trim() !== "" &&
+ }
+
+
}
+
+ {submenu && String(submenu) === "unite_enseignement" &&
+
+
+
+
+ {
+ setselectionModel_list_unite_enseignement(newSelectionModel);
+ /*if (newSelectionModel.length === 1)
+ handleClick_edit_session_From_Line(newSelectionModel);*/
+ if (newSelectionModel.length !== 1) {
+
+ }
+ }}
+ selectionModel={selectionModel_list_unite_enseignement}
+
+ localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
+ rows={Getall_Class_List_UE_result.map((item, index) => (
+ {
+ id: index,
+ _id: JSON.parse(item)._id,
+ code: JSON.parse(item).code,
+ titre: JSON.parse(item).titre,
+
+ credit: JSON.parse(item).credit,
+ pres_dist_hyp: JSON.parse(item).pres_dist_hyp,
+ is_noted: JSON.parse(item).is_noted,
+ coefficient: JSON.parse(item).coefficient,
+ seuil_validation: JSON.parse(item).seuil_validation,
+
+ duration: JSON.parse(item).duration,
+ duration_unite: JSON.parse(item).duration_unite,
+ duration_concat: JSON.parse(item).duration_concat,
+
+ }
+ ))}
+
+ columns={columns_list_unite_enseignement}
+ pageSize={10}
+ className="datagridclass"
+
+ onRowDoubleClick={(newSelectionModel) => {
+ if (String(props.check_user_acces_right("formation", "write")) === "1") {
+ clean_ue_data();
+ setgridline_ue_id(newSelectionModel.row.id);
+ setselected_ue_id(newSelectionModel.row._id)
+
+ var current_class_ue_data = New_Getall_Class_List_UE_result.filter((ue_data) => ue_data._id === String((newSelectionModel.row._id)))
+
+ // console.log(" ### current_class_ue_data[0] = ", current_class_ue_data[0]);
+ setselected_ue_credit_ects(current_class_ue_data[0]['credit']);
+ setselected_ue_is_noted(current_class_ue_data[0]['is_noted']);
+ setselected_ue_pres_dist_hyp(current_class_ue_data[0]['pres_dist_hyp']);
+ setselected_ue_coefficient(current_class_ue_data[0]['coefficient']);
+ setselected_ue_seuil_validation(current_class_ue_data[0]['seuil_validation']);
+ setadd_one_eu_to_class("0");
+ setDialog_Unite_Enseignement_open(true);
+ }
+
+
+ }}
+
+
+
+ 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(ue_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) => {
+
+ // Pour la gestion de la couleur de zone double cliquée
+ if (String(params.row.id) === String(ue_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,
+ },
+ }}
+
+
+ />
+
+
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
}
+
+
+
}
+
+ {submenu && String(submenu) === "admission" &&
}
+
+ {submenu && String(submenu) === "note_evaluation" &&
+
+
+
+
+ {
+ setselectionModel_list_evaluation_nite_enseignement(newSelectionModel);
+ /*if (newSelectionModel.length === 1)
+ handleClick_edit_session_From_Line(newSelectionModel);*/
+ if (newSelectionModel.length !== 1) {
+
+ }
+ }}
+ selectionModel={selectionModel_list_evaluation_nite_enseignement}
+
+ localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
+ rows={Getall_Class_List_Evalution_result.map((item, index) => (
+ {
+ id: index,
+ _id: JSON.parse(item)._id,
+ class_id: JSON.parse(item).class_id,
+ class_ue_id: JSON.parse(item).class_ue_id,
+ type_evaluation_id: JSON.parse(item).type_evaluation_id,
+ max_note: JSON.parse(item).max_note,
+ ponderation_type_eval: JSON.parse(item).ponderation_type_eval,
+ }
+ ))}
+
+ columns={columns_list_evaluation_unite_enseignement}
+ pageSize={10}
+ className="datagridclass"
+
+ onRowDoubleClick={(newSelectionModel) => {
+ if (String(props.check_user_acces_right("formation", "write")) === "1") {
+ setadd_ue_evalution("0");
+ setsetgridline_evaluation_ue_id(newSelectionModel.row.id);
+ setselected_eu_evalution_id(newSelectionModel.row.type_evaluation_id)
+ setselected_ue_id(newSelectionModel.row.class_ue_id);
+ setp_detail_max_note(newSelectionModel.row.max_note);
+ setp_detail_ponderation_type_eval(newSelectionModel.row.ponderation_type_eval);
+ setclass_unite_enseignement_type_evaluation_id(newSelectionModel.row._id);
+
+ Getall_Partner_Type_Evalution_List();
+
+ setDialog_Evaluation_Unite_Enseignement_open(true);
+ }
+ }}
+
+
+
+ rowsPerPageOptions={[10]}
+ disableSelectionOnClick
+ components={{
+ Toolbar: GridToolbar,
+ }}
+ //sx={datagridSx}
+ getCellClassName={(params) => {
+
+ }}
+
+ getRowClassName={(params) => {
+
+ // Pour la gestion de la couleur de zone double cliquée
+ if (String(params.row.id) === String(ue_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,
+ },
+ }}
+
+
+ />
+
+
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
}
+
+
+
+
+
+
+ {New_Get_List_Regle_Calcul_Note_Formation_result && New_Get_List_Regle_Calcul_Note_Formation_result.length > 0 &&
+
+ Règle de calcul de la note finale:
+
+ (data)._id === String(selected_class_note_calculation_id))[0].calcul_rule}>
+
+
+
+
+ (data)._id === String(selected_class_note_calculation_id))[0].label}
+ onChange={(event, value) => {
+ if (value && value._id) {
+ setselected_class_note_calculation_id(value._id);
+ DataUpdated();
+
+ } else {
+ setselected_class_note_calculation_id("");
+ DataUpdated();
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+ }
+
+
+
+ {String(props.ispending) === String("0") &&
+
+
+ {(String(datamodification) === String("1") || String(editor_tochange) === String("1")) &&
+ } className="bton_enreg2">ENREGISTRER LA REGLE
+
+ }
+
+
+ {(String(datamodification) === String("1") || String(editor_tochange) === String("1")) && String(props.mytrainingclass.ref) !== "" &&
+ } className="bton_suppr2"> ANNULER LES MODIFICATIONS
+
+
}
+
+
}
+
+
+
+
}
+
+ {submenu && String(submenu) === "piece_jointe" &&
+
+
+
+
+
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
+
+
+ {file_1_name && file_1_name.name &&
+
+ Nom du fichier
+ {
+ setp_detail_one_file_to_download_type_name(e.target.value);
+
+ }}
+ />
+
+
+
+
+ Fichier : {file_1_name.name}
Supprimer
+ }
+
+ {Record_All_PJ_api && String(Record_All_PJ_api) === "true" &&
Pièce jointe enregistrée
}
+
+ {Record_All_PJ_api && String(Record_All_PJ_api) === "false" &&
{Record_All_PJ_message}
}
+
+
+
}
+
+
+ {file_1_name && file_1_name.name &&
+
+
+ } className="bton_enreg" style={{ "width": "80%" }}>ENREGISTRER LA PIECE
+
+
+
+
}
+
+ {Get_List_Of_All_PJ_result &&
+
+
+
+ {Get_List_Of_All_PJ_result && Get_List_Of_All_PJ_result.map((val) => (
+
+
+
{(JSON.parse(val).file_business_object)}
+
+ Télécharger
+
+
+
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
Supprimer
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, la pièce jointe sera définitivement supprimée.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+ }
+
+
+ ))}
+
+
+
}
+
+
+
+
+
}
+
+ {submenu && String(submenu) === "detail_formation" &&
+
+
+ {p_detail_archive && String(p_detail_archive) === "1" &&
+
Document Archivé
}
+
+
+ Infos Générales
+
+
+
+
+
+
+
+ {
+ setp_detail_external_code(e.target.value);
+ }
+ }
+
+
+ />
+
+
+
+ {
+ setp_detail_title(e.target.value);
+ }
+ }
+ />
+
+
+
+
+
{
+ if (value && value._id) {
+ setp_formateur_id(value._id);
+ setp_formateur_label(value.label)
+ DataUpdated();
+
+ } else {
+ setp_formateur_id("");
+ setp_formateur_label("")
+ DataUpdated();
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
+
+
+
+
+
{
+ if (value && value.value) {
+
+ setmycpf(value.value);
+ setmycpf_label(value.label);
+ setdatamodification("1");
+
+ } else {
+ setmycpf("");
+ setmycpf_label("");
+ setdatamodification("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
{
+ if (value && value.value) {
+
+ setmycertif(value.value);
+ setmycertif_label(value.label);
+ setdatamodification("1");
+
+ console.log(" ### setmycertif = ", value.value)
+
+ } else {
+ setmycertif("");
+ setmycertif_label("");
+ setdatamodification("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
{
+ if (value && value.code) {
+ setp_class_level(value.code);
+ setp_class_level_label(value.description)
+ DataUpdated();
+
+ } else {
+ setp_class_level("");
+ setp_class_level_label("")
+ DataUpdated();
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
{
+ if (value && value.value) {
+ // console.log(" value = ", value);
+ setmypublished(value.value);
+ setmypublished_label(value.label);
+ setdatamodification("1");
+
+ } else {
+ setmypublished("");
+ setmypublished_label("");
+ setdatamodification("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
+
{
+ if (value && value.value) {
+ // console.log(" value = ", value);
+ setmypublished_catalog_prive(value.value);
+ setmypublished_catalog_prive_label(value.label);
+ setdatamodification("1");
+
+ } else {
+ setmypublished_catalog_prive("");
+ setmypublished_catalog_prive_label("");
+ setdatamodification("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
+
+
+
+
{
+ if (value && value.value) {
+
+ setmytrainingsupport(value.value);
+ setdatamodification("1");
+ setmytrainingsupport_label(value.label)
+
+ } else {
+ setmytrainingsupport("");
+ setdatamodification("1");
+ setmytrainingsupport_label("")
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+ {New_Get_List_Domaines_result && New_Get_List_Domaines_result.length > 0 &&
+
(data)._id === String(mytrainingdomaine))[0].label}
+
+ onChange={(event, value) => {
+ setdatamodification("1");
+ if (value && value._id) {
+ setmytrainingdomaine(value._id);
+ setmytrainingmetier("");
+ setmytrainingcategorie("");
+ } else {
+ setmytrainingdomaine("");
+ setmytrainingmetier("");
+ setmytrainingcategorie("");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+ {New_Get_List_Metiers_result && New_Get_List_Metiers_result.length > 0 && mytrainingdomaine &&
+
+
data.class_domaine_id === String(String(mytrainingdomaine).trim()))}
+
+ value={New_Get_List_Metiers_result.filter((data) => (data)._id === String(mytrainingmetier))[0].label}
+
+
+ onChange={(event, value) => {
+
+ if (value && value._id) {
+ setmytrainingmetier(value._id);
+ setdatamodification("1");
+ } else {
+ setmytrainingmetier("");
+ setdatamodification("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+ {(!mytrainingdomaine || String(mytrainingdomaine).trim().length <= 0 || String(mytrainingdomaine).trim() === "") &&
+
{
+
+
+ if (value && value._id) {
+
+ setmytrainingmetier(value.metier);
+ setdatamodification("1");
+ } else {
+ setmytrainingmetier("");
+ setdatamodification("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+ {New_Get_List_Categorie_result && New_Get_List_Categorie_result.length > 0 && mytrainingdomaine &&
+
+
data.class_domaine_id === String(String(mytrainingdomaine).trim()))}
+
+ value={New_Get_List_Categorie_result.filter((data) => (data)._id === String(mytrainingcategorie))[0].label}
+
+
+ onChange={(event, value) => {
+
+ if (value && value._id) {
+ setmytrainingcategorie(value._id);
+ setdatamodification("1");
+ } else {
+ setmytrainingcategorie("");
+ setdatamodification("1");
+
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+ {(!mytrainingdomaine || String(mytrainingdomaine).trim().length <= 0 || String(mytrainingdomaine).trim() === "") &&
+
{
+
+ if (value && value._id) {
+
+ setmytrainingcategorie(value.metier);
+ setdatamodification("1");
+ } else {
+ setmytrainingcategorie("");
+ setdatamodification("1");
+
+
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+ {New_Getall_Parter_referentiel_padagogique_result && New_Getall_Parter_referentiel_padagogique_result.length > 0 &&
+
(data)._id === String(mytraining_ref_peda_id))[0].label}
+
+ onChange={(event, value) => {
+ setdatamodification("1");
+
+ if (value && value._id) {
+ setmytraining_ref_peda_id(value._id);
+ } else {
+ setmytraining_ref_peda_id("");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+ {/* -- début champs durée & prix **/}
+
+
+
+ Durée & Prix
+
+
+
+
+
+
+
+
+
+ {
+ setp_detail_duree(e.target.value);
+ }
+ }
+ />
+
+
+
+
{
+ if (value && value.value) {
+ setmytrainingdurationunit(value.value);
+ setdatamodification("1");
+ } else {
+ setmytrainingdurationunit("");
+ setdatamodification("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+
+
+
+
+
+ {
+ setp_detail_price(e.target.value);
+ }
+ }
+ />
+
+
+
+
+
+
+
+
+ Divers
+
+
+
+
+
+
+
+
+ {
+ setp_detail_url(e.target.value);
+ }
+ }
+ />
+
+
+
+ {
+ setp_detail_lms_class_code(e.target.value);
+ }
+ }
+ />
+
+
+
+
+ {
+ setp_detail_class_inscription_url(e.target.value);
+ }
+ }
+ />
+
+
+
+
+
+
+
+
+ {
+ setp_detail_note(e.target.value);
+ }
+ }
+ />
+
+
+
+ {
+ setp_detail_version_catalogue(e.target.value);
+ }
+ }
+ />
+
+
+
+ {
+ setp_detail_recyclage_delai(e.target.value);
+ }
+ }
+ />
+
+
+
+ {
+ setp_detail_recyclage_alert(e.target.value);
+ }
+ }
+ />
+
+
+
+ {inscription_direct && inscription_direct.length > 0 &&
(data).value === String(mytrainingdirectinscription))[0].label}
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setmytrainingdirectinscription(value.value);
+ setdatamodification("1");
+ } else {
+ setmytrainingdirectinscription("");
+ setdatamodification("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+
+
+
+
+
+
+
+
+
+ {/* -- début champs specifiques **/}
+
+ {rows_champs_specifics &&
+ rows_champs_specifics.length > 0 &&
+
+
+ Champs spécifiques
+
}
+
+
+
+
+ {rows_champs_specifics &&
+ rows_champs_specifics.map((champ_spec) => (
+
+
+ {String(JSON.parse(champ_spec).field_type) === "float" &&
+ {
+ change_champs_spec_handle(e.target.value);
+ //setEmployee_data_changed("1");
+ }}
+ />}
+
+ {String(JSON.parse(champ_spec).field_type) === "string" && {
+ change_champs_spec_handle(e.target.value);
+ //setEmployee_data_changed("1");
+ }}
+ />}
+
+
+ ))}
+
+
+
+
+ {/* -- end champs specifiques **/}
+
+
}
+
+ {String(history_securite_read) === "1" && String(submenu) === String("historique") &&
+
+
}
+
+ {submenu && String(submenu) === "aide_ia" &&
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
}
+
+ {submenu && String(submenu) === "finance" && String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
+
+
+
+
+ {
+ setselectionModel_list_finance_data(newSelectionModel);
+ /*if (newSelectionModel.length === 1)
+ handleClick_edit_session_From_Line(newSelectionModel);*/
+ if (newSelectionModel.length !== 1) {
+
+ }
+ }}
+ selectionModel={selectionModel_list_finance_data}
+
+ localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
+ rows={Getall_Class_Finance_Caracteristic_result.map((item, index) => (
+ {
+ id: index,
+ _id: JSON.parse(item)._id,
+ code: JSON.parse(item).code,
+ description: JSON.parse(item).description,
+ commentaire: JSON.parse(item).commentaire,
+ montant: JSON.parse(item).montant,
+ type_cout: JSON.parse(item).type_cout,
+ inclus_calcul: JSON.parse(item).inclus_calcul,
+
+ }
+ ))}
+
+ columns={columns_list_finance_data}
+ pageSize={10}
+ className="datagridclass"
+
+ onRowDoubleClick={(newSelectionModel) => {
+ if (String(props.check_user_acces_right("formation", "write")) === "1") {
+ setfinance_data_gridline_id(newSelectionModel.row.id);
+ setselected_finance_data_id(newSelectionModel.row._id)
+
+ var current_class_finance_data = New_Getall_Class_Finance_Caracteristic_result.filter((finance_data) => finance_data._id === String((newSelectionModel.row._id)))
+
+
+ // console.log(" ### current_class_ue_data = ", current_class_finance_data);
+ setp_detail_fin_data_code(current_class_finance_data[0]['code']);
+ setp_detail_fin_data_description(current_class_finance_data[0]['description']);
+ setp_detail_fin_data_commentaire(current_class_finance_data[0]['commentaire']);
+ setp_detail_fin_data_montant(current_class_finance_data[0]['montant']);
+ setp_detail_fin_data_type_cout(current_class_finance_data[0]['type_cout']);
+ if (String(current_class_finance_data[0]['inclus_calcul']) === "1")
+ setp_detail_fin_data_inclus_calcul(true);
+ else
+ setp_detail_fin_data_inclus_calcul(false);
+
+
+ setDialog_Financial_Data_open(true);
+ }
+
+ }}
+
+
+
+ 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(finance_data_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) => {
+
+ // Pour la gestion de la couleur de zone double cliquée
+ if (String(params.row.id) === String(finance_data_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,
+ },
+ }}
+
+
+ />
+
+
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
}
+
+
+
+
+
+
+
}
+
+ {submenu && String(submenu) === "documents" &&
+
+
+
+ Choix des documents par défaut
+
+
+
+
+
+ {/*** Question positionnement */}
+
+
+
Q. Positionnement
+
+
+ {New_Getall_Partner_Formulaires_Q_Position.length > 0 &&
Choisir un modèle par défault
+
(data)._id === String(selected_default_Formulaires_Q_Position))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Formulaires_Q_Position(value._id);
+ else
+ setselected_default_Formulaires_Q_Position("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+ {/*** Evaluation à chaud */}
+
+
+
Evaluation à chaud
+
+
+ {New_Getall_Partner_Formulaires_Eval_Chaud.length > 0 &&
Choisir un modèle par défault
+
(data)._id === String(selected_default_Formulaires_Eval_Chaud))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Formulaires_Eval_Chaud(value._id);
+ else
+ setselected_default_Formulaires_Eval_Chaud("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+ {/*** Evaluation à froid */}
+
+
+
Evaluation à froid
+
+
+
+ {New_Getall_Partner_Formulaires_Eval_Froid.length > 0 &&
Choisir un modèle par défault
+
(data)._id === String(selected_default_Formulaires_Eval_Froid))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Formulaires_Eval_Froid(value._id);
+ else
+ setselected_default_Formulaires_Eval_Froid("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+ {/*** Evaluation formateur */}
+
+
+
Evaluation formateur
+
+
+ {New_Getall_Partner_Formulaires_Eval_Formateur.length > 0 &&
Choisir un modèle par défault
+
(data)._id === String(selected_default_Formulaires_Eval_Formateur))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Formulaires_Eval_Formateur(value._id);
+ else
+ setselected_default_Formulaires_Eval_Formateur("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+
+ {/*** Convention Individuelle */}
+
+
+
Conventions Individuelles
+
+ {New_Get_List_Convention_Individuelle_PDF_result.length > 0 &&
Choisir un modèle par défault (PDF)
+
(data)._id === String(selected_default_Convention_individuelle_PDF))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Convention_individuelle_PDF(value._id);
+ else
+ setselected_default_Convention_individuelle_PDF("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+ {New_Get_List_Convention_Individuelle_Mail_result.length > 0 &&
Choisir un modèle par défault (Email)
+
(data)._id === String(selected_default_Convention_individuelle_Mail))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Convention_individuelle_Mail(value._id);
+ else
+ setselected_default_Convention_individuelle_Mail("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+
+ {/*** Convention Entreprise */}
+
+
+
Conventions Entreprise
+
+ {New_Get_List_Convention_Entreprise_PDF_result.length > 0 &&
Choisir un modèle par défault (PDF)
+
(data)._id === String(selected_default_Convention_entreprise_PDF))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Convention_entreprise_PDF(value._id);
+ else
+ setselected_default_Convention_entreprise_PDF("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+ {New_Get_List_Convention_Entreprise_Mail_result.length > 0 &&
Choisir un modèle par défault (Email)
+
(data)._id === String(selected_default_Convention_entreprise_Mail))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Convention_entreprise_Mail(value._id);
+ else
+ setselected_default_Convention_entreprise_Mail("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+
+ {/*** Convocation */}
+
+
+
Convocations
+
+ {New_Get_List_Stagiaire_Convocations_PDF_result.length > 0 &&
Choisir un modèle par défault (PDF)
+
(data)._id === String(selected_default_Stagiaire_Convocations_PDF))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Stagiaire_Convocations_PDF(value._id);
+ else
+ setselected_default_Stagiaire_Convocations_PDF("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+ {New_Get_List_Stagiaire_Convocations_Mail_result.length > 0 &&
Choisir un modèle par défault (Email)
+
(data)._id === String(selected_default_Stagiaire_Convocations_Mail))[0].label}
+
+ onChange={(event, value) => {
+
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_Stagiaire_Convocations_Mail(value._id);
+ else
+ setselected_default_Stagiaire_Convocations_Mail("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+
+ {/*** Attestation */}
+
+
+
Attestation Ftion
+
+ {New_Get_List_Attestation_PDF_result.length > 0 &&
Choisir un modèle par défault (PDF)
+
(data)._id === String(selected_default_attestation_PDF))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_attestation_PDF(value._id);
+ else
+ setselected_default_attestation_PDF("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+ {New_Get_List_Attestation_Email_result.length > 0 &&
Choisir un modèle par défault (Email)
+
(data)._id === String(selected_default_attestation_Email))[0].label}
+
+ onChange={(event, value) => {
+ setdefault_doc_modification("1");
+ if (value && value._id)
+ setselected_default_attestation_Email(value._id);
+ else
+ setselected_default_attestation_Email("")
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" && String(default_doc_modification) === "1" &&
+
+
/!\ Pensez à enregistrer les modifications
}
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
+
+
+
+
+
+ }
+
+
}
+
+
+
+
+
+
+
+ {submenu && String(submenu) === "detail_formation" &&
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+ {String(datamodification) === String("1") &&
+
/!\ Pensez à enregistrer les modifications
+
}
+
+ {String(props.ispending) === String("0") &&
+
+ {(String(datamodification) === String("1") || String(editor_tochange) === String("1")) &&
+ } className="bton_enreg2">ENREGISTRER LA FORMATION
+
+ }
+
+ {String(datamodification) !== String("1") && String(editor_tochange) !== String("1") && String(props.mytrainingclass.ref) !== "" &&
+
+
+
} className="bton_suppr2"> SUPPRIMER LA FORMATION
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, la formation sera définitivement supprimée.
+ Avant, assurez-vous de n'avoir aucune session rattachée à la formation.
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+
+
+
+ }
+
+
+ {(String(datamodification) === String("1") || String(editor_tochange) === String("1")) && String(props.mytrainingclass.ref) !== "" &&
+ } className="bton_suppr2"> ANNULER LES MODIFICATIONS
+
+
}
+
+
}
+
+ {String(props.ispending) !== String("0") &&
+
+ datamodification = {datamodification}
+ {String(datamodification) === String("1") &&
+ }
+
+
+ {String(datamodification) === String("0") &&
+ }
+
+
+
+ } className="bton_suppr2"> Supprimer
+
+
+
+
}
+
+
+ {String(myApiResponse) === String("true") && importmessage &&
+
+ {importmessage}
+
+
}
+
+ {String(myApiResponse) === String("false") &&
+
+ {importmessage}
+
+
}
+
}
+
+
+
+
+
+
+
+
editorRef_description.current = editor}
+ initialValue={field_description}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated()
+ seteditor_tochange("");
+ }
+ }}
+
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
editorRef_objectif.current = editor}
+ initialValue={field_objectif}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
editorRef_programme.current = editor}
+ initialValue={field_programme}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
Ressources Pédagogiques et techniques (max 1000 caractères)
+
editorRef_methode_pedago.current = editor}
+ initialValue={field_methode_pedago}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
Suivi et Évaluation (max 1000 caractères)
+
editorRef_suivi_eval.current = editor}
+ initialValue={field_suivi_eval}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
+
Accès handicapé (max 1000 caractères)
+
editorRef_handicap.current = editor}
+ initialValue={field_handicap}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
+
editorRef_prerequis.current = editor}
+ initialValue={field_prerequis}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
Pour Qui ?
+
editorRef_pourqui.current = editor}
+ initialValue={field_pourqui}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
Mots clés
+
editorRef_mots_cle.current = editor}
+ initialValue={field_mots_cle}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
editorRef_plus_produit.current = editor}
+ initialValue={field_plus_produit}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
editorRef_contenu_attestation.current = editor}
+ initialValue={field_contenu_attestation}
+ onKeyUp={editor_keyup}
+ disabled={!Boolean(props.check_user_acces_right("formation", "write"))}
+ onEditorChange={(newValue, editor) => {
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated();
+ seteditor_tochange("");
+ }
+ }}
+ init={{
+ resize: false,
+ height: 300,
+ menubar: true,
+ plugins: [
+ 'advlist', 'autolink', 'lists', 'link', 'image', 'charmap', 'print', 'preview', 'anchor', 'searchreplace',
+ 'visualblocks', 'code', 'fullscreen', 'insertdatetime', 'media', 'table', 'paste', 'code', 'help', 'wordcount',
+ 'lists', 'link', 'image', 'charmap', 'preview', 'anchor', 'searchreplace', 'visualblocks',
+
+ ],
+ toolbar: 'undo redo | casechange blocks | bold italic backcolor | ' +
+ 'alignleft aligncenter alignright alignjustify | ' +
+ 'bullist numlist checklist outdent indent | removeformat ',
+
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+ {(String(props.currentpack).toLocaleLowerCase() === String("gold") ||
+ String(props.currentpack).toLocaleLowerCase() === String("mesure"))
+ &&
+
+
+
}
+
+
+
+ {String(props.currentpack).toLocaleLowerCase() === String("decouverte") &&
+
+
+
+ Passer au Standard
+
+
+
+ {/*
+
+ Passer au Gold
+ */}
+
+
+
+ Passer au Standard
+
+
+
+ }
+
+ {String(props.currentpack).toLocaleLowerCase() === String("standard") &&
+
+
+ {/*
+
+ Passer au Gold
+
+*/}
+
+
+
+ }
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+ Fiche catalogue
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+ {Get_Class_Catalogue_File_result && Get_Class_Catalogue_File_result.length <= 0 &&
+
+
}
+ {file_1_name && file_1_name.name &&
+
+ Nom du fichier
+ {
+ setp_detail_one_file_to_download_type_name(e.target.value);
+
+ }}
+ />
+
+
+
+
+ Fichier : {file_1_name.name}
Supprimer
+ }
+
+ {Record_Class_Catalogue_File_api && String(Record_Class_Catalogue_File_api) === "true" &&
Pièce jointe enregistrée
}
+
+ {Record_Class_Catalogue_File_api && String(Record_Class_Catalogue_File_api) === "false" &&
{Record_Class_Catalogue_File_message}
}
+
+
+
}
+
+
+ {file_1_name && file_1_name.name &&
+
+
+ } className="bton_enreg" style={{ "width": "80%", fontFamily: "DM Sans" }}>ENREGISTRER LA PIECE
+
+
+
+
}
+
+ {Get_Class_Catalogue_File_result &&
+
+
+
+ {Get_Class_Catalogue_File_result && Get_Class_Catalogue_File_result.map((val) => (
+
+
+
{(JSON.parse(val).file_business_object)}
Télécharger
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
Supprimer
+
+
+ }
+ modal
+ nested
+ position="center center"
+ >
+ {close => (
+
+
+
MySy Information
+
+ {' '}
+
+ En confirmant cette opération, la pièce jointe sera définitivement supprimée.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ )}
+ }
+
+
+ ))}
+
+
+
}
+
+
+
}
+
+
+
+
+
+
+ Image de profil
+

+
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+
+ Supprimer l'image
+ {/*isimgclassSelected && */}
+ {isimgclassdeleted && String(isimgclassdeleted) === "1" && {isimgclassdeleted_message}}
+ {isimgclassdeleted && String(isimgclassdeleted) === "0" && {isimgclassdeleted_message}}
+ {isimgclassSelected && String(isimgclassSaved) === "0" && {isimgclassSaved_message}}
+
}
+
+
+ {String(props.check_user_acces_right("formation", "write")) === "1" &&
+
+ L'image doit etre carrée.
+
+
+ Les formats autorisés sont : ['jpg', 'jpeg', 'png', 'jpe', 'webp']
+
+
+ Les dimensions recommandées: 128pixels X 128pixels -- 144pixels X 144pixels -- 168pixels X 168pixels
+ Les dimensions maximales sont de 256pixels X 256pixels
+
+
+ La taille de l'image ne doit pas dépasser 1 mega octet
+
+ }
+
+
+
+
+
+
+
+ {String(datamodification) === String("1") &&
+
/!\ Pensez à enregistrer les modifications
+
}
+
+ {String(props.ispending) === String("0") &&
+
+
+ {(String(datamodification) === String("1") || String(editor_tochange) === String("1")) &&
+ } className="bton_enreg2">ENREGISTRER LA FORMATION
+
+ }
+
+ {/*String(datamodification) === String("0") &&
+ }>MODIFIER
+
+ */ }
+
+
+
+ {String(datamodification) !== String("1") && String(editor_tochange) !== String("1") && String(props.check_user_acces_right("formation", "write")) === "1" &&
+ String(props.mytrainingclass.ref) !== "" &&
+ } className="bton_suppr2"> SUPPRIMER LA FORMATION
+
+
+ }
+
+
+ {(String(datamodification) === String("1") || String(editor_tochange) === String("1")) && String(props.check_user_acces_right("formation", "write")) === "1" &&
+ String(props.mytrainingclass.ref) !== "" &&
+ } className="bton_suppr2"> ANNULER LES MODIFICATIONS
+
+
}
+
+
}
+
+ {String(props.ispending) !== String("0") && String(props.check_user_acces_right("formation", "write")) === "1" &&
+ {String(datamodification) === String("1") &&
+ }
+
+
+ {String(datamodification) === String("0") &&
+ }
+
+
+
+ } className="bton_suppr2"> Supprimer
+
+
+
+
}
+
+
+ {String(myApiResponse) === String("true") && importmessage &&
+
+ {importmessage}
+
+
}
+
+ {String(myApiResponse) === String("false") &&
+
+ {importmessage}
+
+
}
+
+
}
+
+ {submenu && String(submenu) === "statistiques" &&
+
+
Les statistiques
+
+
+
+
+
+
+
+
+
+
+
Nombre d'apprenants
+
+
+
{qualiopi_indic_nb_apprenant}
+
+
+
+
+
Nb heures dispensé
+
+
+
{qualiopi_indic_nb_heure}
+
+
+
+
+
Taux de réussite
+
+
+
{qualiopi_indic_taux_sucess}%
+
+
+
+
Chiffre d'affaire (HT) *
+
+
+
{indic_class_ca_ht} €
+
+
Sous réserve de la répartition des factures entre les différentes parties prenantes, en fonction des montants et des pourcentages convenus.
+
+
+
+
+
+
+
+
+
+
+
+
Les indicateurs personalisés
+
+
+ Choisir une question
+ {New_Getall_Employee_Statistic_Question_List_result && New_Getall_Employee_Statistic_Question_List_result.length > 0 &&
+
+
+
+
(data)._id === String(selected_statistic_question_id))[0].label}
+
+ onChange={(event, value) => {
+
+
+ if (value && value._id) {
+ setselected_statistic_question_id(value.question_id);
+ setselected_statistic_question_type(value.question_type);
+ } else {
+ setselected_statistic_question_id("");
+ setselected_statistic_question_type("");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
+ }
+
+
+ {selected_statistic_question_id && String(selected_statistic_question_id) !== "d" &&
+
+
+
+
+
+ Date Debut
+ {
+ setp_filter_date_from(format(date, 'dd/MM/yyyy'));
+
+ }
+ }
+ showTimeSelect={false}
+ dateFormat="dd/MM/yyyy"
+ className="disabled_style session_caract_Dialog_DatePicker"
+ locale={'fr'}
+
+ />
+
+
+
+
+
+
+
+ Date Fin
+ {
+ setp_filter_date_to(format(date, 'dd/MM/yyyy'));
+
+ }
+ }
+ showTimeSelect={false}
+ dateFormat="dd/MM/yyyy"
+ className="disabled_style session_caract_Dialog_DatePicker"
+ />
+
+
+
+
+
+
+
+
}
+
+
+ {String(selected_statistic_question_id) !== "" &&
}
+
+
+
+ {Getall_Qry_Survey_Data_result_JSON && Getall_Qry_Survey_Data_result_JSON.length > 0 &&
+ Getall_Qry_Survey_Data_result_JSON &&
+
+ {display_view && String(display_view) === "bars" &&
+ Affichage
+ Export
+ Ligne
+ Bar
+
+
}
+
+ {display_view && String(display_view) === "line" &&
+ Affichage
+ Export
+ Ligne
+ Bar
+
}
+
+
+ {display_view && String(display_view) === "bars" &&
+
+
+
+
+ {Getall_Qry_Survey_Data_result_JSON && Getall_Qry_Survey_Data_result_JSON.length > 0 &&
+ Getall_Qry_Survey_Data_result_JSON &&
+
+ context.location === 'tick'
+ ? `${month.slice(0, 2)}` + "\n" + `${month.slice(3, 7)}`
+ : `${month}`,
+ }]}
+ series={[
+ { dataKey: 'nb_question_response', label: 'NB', valueFormatter },
+ { dataKey: 'value', label: `${selected_statistic_question_type}`, color: '#FA7070', valueFormatter },
+
+
+ ]}
+ {...otherSetting}
+ margin={{ right: 15, left: 100 }}
+ height={450}
+ />}
+
+
+ }
+
+ {display_view && String(display_view) === "line" &&
+
+
+
+
+
+ {Getall_Qry_Survey_Data_result_JSON && Getall_Qry_Survey_Data_result_JSON.length > 0 &&
+ Getall_Qry_Survey_Data_result_JSON &&
+
+
+
+ context.location === 'tick'
+ ? `${month.slice(0, 2)}` + " \n" + `${month.slice(3, 7)}`
+ : `${month}`,
+ }]}
+ series={[
+ { dataKey: 'nb_question_response', label: 'NB', valueFormatter: (value) => (value == null ? 'NaN' : value.toString()), },
+ { dataKey: 'value', label: `${selected_statistic_question_type}`, color: '#FA7070', valueFormatter: (value) => (value == null ? 'NaN' : value.toString()), },
+ ]}
+
+ margin={{ right: 15, left: 100 }}
+ height={450}
+ />
+
+
+
+ }
+
+
+
+
+ }
+
+
+ {Global_Getall_Qry_Survey_Data_result_JSON &&
+
+ Nombre total d'enquêtes sur la période : {Global_Getall_Qry_Survey_Data_result_JSON['global_nb_question_response']}
+
+ {String(selected_statistic_question_type) === "Somme" &&
+
+ Nombre de réponses 'Oui' sur la période : {Global_Getall_Qry_Survey_Data_result_JSON['global_somme_question_response']}
+
+ }
+
+ {String(selected_statistic_question_type) === "Moyenne" &&
+
+ Somme totale d'enquêtes sur la période : {Global_Getall_Qry_Survey_Data_result_JSON['global_somme_question_response']}
+ Moyenne Globale sur la période : {Global_Getall_Qry_Survey_Data_result_JSON['global_moyenne_question_response']}
+ }
+
+
}
+
}
+
+
+
}
+
+
+
+ );
+}
+
+export default AddClassManual;
diff --git a/src/components/PROD_100326/Inscription_Information.js b/src/components/PROD_100326/Inscription_Information.js
new file mode 100644
index 0000000..632bf4d
--- /dev/null
+++ b/src/components/PROD_100326/Inscription_Information.js
@@ -0,0 +1,2295 @@
+import React, { useState, useEffect, useRef } from "react";
+
+import { getCookie, setCookie } from 'react-use-cookie';
+import Box from '@mui/material/Box';
+
+import InputAdornment from '@mui/material/InputAdornment';
+
+import TextField from '@mui/material/TextField';
+import AccountCircle from '@mui/icons-material/AccountCircle';
+import PhoneIcon from '@mui/icons-material/Phone'
+import AddReactionIcon from '@mui/icons-material/AddReaction';
+import Autocomplete from '@mui/material/Autocomplete';
+import HomeWorkIcon from '@mui/icons-material/HomeWork';
+import AssignmentSharpIcon from '@mui/icons-material/AssignmentSharp';
+import EmailIcon from '@mui/icons-material/Email'
+
+import { Button } from "reactstrap";
+
+import axios from "axios";
+import MenuItem from '@mui/material/MenuItem';
+import { Redirect } from 'react-router-dom'
+import { Editor } from '@tinymce/tinymce-react';
+import SendIcon from '@mui/icons-material/Send';
+import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
+import Rating from '@mui/material/Rating';
+import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
+
+function Inscription_Information(props) {
+
+
+ const [action, setaction] = useState(props.action);
+ const [class_internal_url, setclass_internal_url] = useState(props.internal_url);
+ ;
+
+ const New_civilite = [
+ { "id": "mme", "label": "Mme", "value": "mme" },
+ { "id": "m", "label": "M", "value": "m" },
+ { "id": "neutre", "label": "Neutre", "value": "neutre" },
+ ]
+
+ const modefinancement = [
+ {
+ value: 'cpf',
+ label: 'CPF',
+ },
+ {
+ value: 'perso',
+ label: 'Fonds Propres',
+ },
+ {
+ value: 'entreprise',
+ label: 'Votre entreprise',
+ },
+
+ {
+ value: 'mixte_cpf_perso',
+ label: 'CPF & Fonds Propres',
+ },
+ {
+ value: 'autre',
+ label: 'Autre',
+ },
+
+ ];
+
+
+ const opco = [
+ {
+ value: 'opco Paris',
+ label: 'paris',
+ },
+ {
+ value: 'opco Nanterre',
+ label: 'Nanterre',
+ },
+ {
+ value: 'inconnu',
+ label: 'inconnu',
+ },
+ ];
+
+ const [myopco, setmyopco] = useState("");
+ function handleChangeOpco(event) {
+ setmyopco(event.target.value);
+ };
+
+
+ const [mysession, setmysession] = useState("");
+ const [monfinancement, setmonfinancement] = useState("");
+
+ function handleChangeSession(event) {
+ setmysession(event.target.value);
+ };
+
+ function handleChangeFinancement(event) {
+ setmonfinancement(event.target.value);
+ };
+
+
+ function clean_leads_data() {
+ setleads_nom("");
+ setleads_prenom("");
+ setleads_email("");
+ setleads_phone("");
+ setleads_employeur("");
+ setleads_message("");
+
+ setleads_modefinance("");
+ setleads_opco("inconnu");
+
+ }
+
+ const [leads_nom, setleads_nom] = useState("");
+ const [leads_prenom, setleads_prenom] = useState("");
+ const [leads_email, setleads_email] = useState("");
+ const [leads_phone, setleads_phone] = useState("");
+ const [leads_employeur, setleads_employeur] = useState("");
+ const [leads_message, setleads_message] = useState("");
+ const [leads_modefinance, setleads_modefinance] = useState("");
+ const [leads_opco, setleads_opco] = useState("inconnu");
+
+
+ const [RecordData_api, setRecordData_api] = useState("");
+ const [RecordData_status, setRecordData_status] = useState("");
+ const [RecordData_message, setRecordData_message] = useState("");
+
+ function RecordData() {
+ const formData = new FormData();
+ const url = process.env.REACT_APP_API_URL + "myclass/api/AddStagiairetoClass/";
+
+ var nom = leads_nom;
+
+ // console.log(" ## leads_nom ==", leads_nom)
+
+ if (String(nom).trim().length <= 0) {
+ document.getElementsByName("nom")[0].style.borderColor = "red";
+ setdisplay_alert_mysy("1");
+ setalert_message("Le nom est obligatoire");
+ setalert_type("error")
+
+ return;
+ }
+
+
+ var civilite = civilite_stagiaire
+ if (String(civilite).trim().length <= 0) {
+ civilite = "Neutre"
+ }
+
+
+ var prenom = leads_prenom;
+ if (String(prenom).trim().length <= 0) {
+ document.getElementsByName("prenom")[0].style.borderColor = "red";
+ setdisplay_alert_mysy("1");
+ setalert_message("Le prenom est obligatoire");
+ setalert_type("error")
+
+ return;
+ }
+
+
+
+ var telephone = leads_phone;
+ if (String(telephone).trim().length < 10) {
+ document.getElementsByName("telephone")[0].style.borderColor = "red";
+ setdisplay_alert_mysy("1");
+ setalert_message("Le numero de telephone doit comporter 10 chiffres");
+ setalert_type("error")
+ return;
+ }
+
+ var email = leads_email;
+ var re2 = /\S+@\S+\.\S+/;
+ if (re2.test(email) === false) {
+ document.getElementsByName("email")[0].style.borderColor = "red";
+ setdisplay_alert_mysy("1");
+ setalert_message("L'adresse email est incorrect");
+ setalert_type("error")
+ return;
+ }
+
+
+ var modefinancement = leads_modefinance;
+ if (String(modefinancement).trim().length <= 0 && props.mytrainingdirectinscription !== "1") {
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez choisir une mode de financement");
+ setalert_type("error")
+ return;
+ }
+
+
+ var opco = leads_opco;
+ if (String(opco).trim().length <= 0 && props.mytrainingdirectinscription !== "1") {
+ setdisplay_alert_mysy("1");
+ setalert_message("Vous devez choisir un centre Opco");
+ setalert_type("error")
+ return;
+ }
+
+
+
+ var session = mysession;
+ if (String(nom).trim().length <= 0) {
+ setdisplay_alert_mysy("1");
+ setalert_message("Le nom est obligatoire");
+ setalert_type("error")
+ return;
+ }
+
+
+ var employeur = leads_employeur;
+
+
+ // var class_internal_url = document.getElementsByName("adr_country")[0].value;
+
+ formData.append('civilite', civilite);
+ formData.append('nom', nom);
+ formData.append('employeur', employeur);
+ formData.append('prenom', prenom);
+ formData.append('telephone', telephone);
+ formData.append('email', email);
+ formData.append('modefinancement', modefinancement);
+ formData.append('opco', opco);
+ formData.append('session_id', session);
+ formData.append('class_internal_url', props.internal_url);
+ formData.append('price', props.trainig_price);
+
+ if (props.mytrainingdirectinscription !== "1") {
+ /* Ceci est une preinscription faite par un end user, depuis le font, donc on force le 'status' à 0 (0 = préinscription)*/
+ formData.append('status', '0');
+ }
+ else if (props.mytrainingdirectinscription === "1") {
+ /* Ceci est une inscription direct faite par un end user, depuis le font, donc on force le 'status' à 1 (1 = Inscription OK)*/
+ formData.append('status', '1');
+ }
+
+ /*
+ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenaire
+ */
+ for (let i = 0; i < spec_field_updated_values_hooks.length; i++) {
+ if (String(spec_field_updated_values_hooks[i].field_name) === "float") {
+
+ }
+ else if (String(spec_field_updated_values_hooks[i].field_name) === "string") {
+
+ }
+
+ formData.append(String(spec_field_updated_values_hooks[i].field_name), String(spec_field_updated_values_hooks[i].field_value));
+ }
+
+ fetch(
+ url,
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ //console.log('Success:', result['message'], "result['status'] = ", result['status']);
+ setRecordData_api(result['status']);
+ setRecordData_status(result['status']);
+ setRecordData_message(result['message']);
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ if (String(result['status']) === "true") {
+ clean_leads_data();
+ setdisplay_alert_mysy("1");
+ setalert_message("Votre demande d'inscription a bien été prise en compte. Vous allez recevoir une email de confirmation dans votre boite email. Merci.");
+ setalert_type("success");
+ } else {
+ setdisplay_alert_mysy("1");
+ setalert_message(result['message']);
+ setalert_type("error")
+ }
+
+ })
+ .catch((error) => {
+ console.error('Error:', error);
+ setRecordData_api("false");
+ setRecordData_status("false");
+ setRecordData_message();
+ });
+
+
+ };
+
+ const [New_GetListOpco_result, setNew_GetListOpco_result] = useState([]);
+
+ const [GetListOpco_api, setGetListOpco_api] = useState();
+ const [GetListOpco_message, setGetListOpco_message] = useState();
+ const [GetListOpco_result, setGetListOpco_result] = useState();
+ function GetListOpco(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/GetListOpco/";
+
+ fetch(myurl,
+ {
+ method: 'POST',
+ body: form,
+ })
+ .then((data) => data.json())
+ .then((data) => {
+ // console.log(' GetListOpco Success:', data['message'], "data['status'] = ", data['status']);
+
+ if (String(data['status']) === String("true")) {
+ //console.log("erreur rrrr:" + data['status'])
+
+ setGetListOpco_api("true");
+ setGetListOpco_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_id_code = JSON.parse(x).id_code;
+ var local_idcc = JSON.parse(x).idcc;
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": local_id_code,
+ "id_code": local_id_code,
+ "idcc": local_idcc,
+
+ };
+ new_data2.push(node);
+ });
+
+
+ if (new_data2.length > 0)
+ setNew_GetListOpco_result(new_data2);
+
+ }
+ else {
+ setGetListOpco_api("false");
+ setGetListOpco_message(data['message'])
+
+ }
+
+ }).catch((error) => {
+ console.error('Error:', error);
+ setGetListOpco_api("false");
+ });
+
+ }
+
+
+ const [closeform, setcloseform] = useState("");
+ function close_inscription_form() {
+
+ window.location.reload();
+ }
+
+ const [New_GetCurrentClass_result, setNew_GetCurrentClass_result] = useState([]);
+
+ const [GetCurrentClass_api, setGetCurrentClass_api] = useState();
+ const [GetCurrentClass_message, setGetCurrentClass_message] = useState();
+ const [GetCurrentClass_result, setGetCurrentClass_result] = useState();
+ function GetCurrentClass_trainingsession(event) {
+
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("class_internal_url", props.internal_url);
+ form.append("token", stored_cookie);
+ form.append("archive", "0");
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
+
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) !== "false") {
+ //console.log(" In GetCurrentClass_trainingsession res.data.status = " + res.data.status);
+ //console.log(" In GetCurrentClass_trainingsession res.data.message r_class = " + res.data.message);
+ setGetCurrentClass_api("true");
+ setGetCurrentClass_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_session = JSON.parse(x).code_session;
+ var local_titre = JSON.parse(x).titre;
+ var local_mode_animation = JSON.parse(x).mode_animation;
+ var local_date_debut = JSON.parse(x).date_debut;
+ var local_date_fin = JSON.parse(x).date_fin;
+
+ var local_ville = JSON.parse(x).ville;
+ var local_code_postal = JSON.parse(x).code_postal;
+ var local_session_ondemande = JSON.parse(x).session_ondemande;
+
+ var text_label = "";
+
+ if (String(local_session_ondemande) === "1") {
+ text_label = "A la demande (" + String(local_code_session).substring(0, 15) + ")";
+ }
+ else {
+ if (local_date_debut == local_date_fin) {
+ text_label = "Le " + local_date_debut
+ } else {
+ text_label = local_date_debut + " au " + local_date_fin
+ }
+ }
+
+
+ if (local_mode_animation == "0") {
+ text_label = text_label + " - Présentiel à " + local_ville + ", " + local_code_postal
+ }
+ else if (local_mode_animation == "1") {
+ text_label = text_label + " - Distanciel"
+ } else if (local_mode_animation == "2") {
+ text_label = text_label + " - Hybrid"
+ }
+
+ //---
+ var node = {
+ "_id": local_id,
+ "id": localid,
+ "label": text_label,
+ "titre": local_titre,
+ "code_session": local_code_session,
+ "mode_animation": local_mode_animation,
+ "date_debut": local_date_debut,
+ "date_fin": local_date_fin,
+
+ };
+ new_data2.push(node);
+ });
+
+
+ if (new_data2.length > 0)
+ setNew_GetCurrentClass_result(new_data2);
+
+ }
+ else {
+ setGetCurrentClass_api("false");
+ setGetCurrentClass_message(res.data.message);
+ }
+
+ }).catch((error) => {
+ console.warn('Not good man :( GetCurrentClass_trainingsession = ', error);
+ setGetCurrentClass_api("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [class_sales_price, setclass_sales_price] = useState("0");
+
+ useEffect(() => {
+
+
+ //Get_Partner_Object_Specific_Fields("inscription");
+
+ if (String(props.action).toLocaleLowerCase() !== "inscription" &&
+ String(props.action).toLocaleLowerCase() !== "information") {
+
+
+ CheckEvaluationToken();
+ // setclass_sales_price(props.trainig_price);
+
+ }
+
+ setclass_sales_price(props.trainig_price);
+ GetCurrentClass_trainingsession();
+ GetListOpco();
+
+
+ }, []);
+
+
+ // Cette fonction verifier si le token de l'evaluation est valide
+ //si $action != 'information' et 'inscription', alors la valeur est forcement celle d'un token.
+ const [tokenEval_api, settokenEval_api] = useState();
+ const [tokenEval_message, settokenEval_message] = useState();
+ const [tokenEval_result, settokenEval_result] = useState();
+ function CheckEvaluationToken() {
+
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+ const stored_cookie = getCookie('tokenmysych');
+ form.append("eval_token", props.action);
+ form.append("class_internal_url", props.internal_url);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/ckeckEvaluationToken/";
+
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) !== "false") {
+ //console.log(" In tokenEval_trainingsession res.data.status = " + res.data.status);
+ //console.log(" In tokenEval_trainingsession res.data.message r_class = " + res.data.message);
+ settokenEval_api("true");
+ settokenEval_result(res.data.message);
+ }
+ else {
+ settokenEval_api("false");
+ settokenEval_message(res.data.message);
+ }
+
+ }).catch((error) => {
+ console.warn('Not good man :( CheckEvaluationToken = ', error);
+ settokenEval_api("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ function clearfileds() {
+ if (document.getElementsByName("nom")[0]) {
+ document.getElementsByName("nom")[0].value = "";
+ }
+
+ if (document.getElementsByName("prenom")[0]) {
+ document.getElementsByName("prenom")[0].value = "";
+ }
+
+ if (document.getElementsByName("email")[0]) {
+ document.getElementsByName("email")[0].value = "";
+ }
+
+ if (document.getElementsByName("telephone")[0]) {
+ document.getElementsByName("telephone")[0].value = "";
+ }
+
+ if (document.getElementsByName("employeur")[0]) {
+ document.getElementsByName("employeur")[0].value = "";
+ }
+
+
+ }
+
+
+ function clearfileds_info() {
+ if (document.getElementsByName("nom_info")[0]) {
+ document.getElementsByName("nom_info")[0].value = "";
+ }
+
+ if (document.getElementsByName("prenom_info")[0]) {
+ document.getElementsByName("prenom_info")[0].value = "";
+ }
+
+ if (document.getElementsByName("email_info")[0]) {
+ document.getElementsByName("email_info")[0].value = "";
+ }
+
+ if (document.getElementsByName("telephone_info")[0]) {
+ document.getElementsByName("telephone_info")[0].value = "";
+ }
+
+ if (document.getElementsByName("employeur_info")[0]) {
+ document.getElementsByName("employeur_info")[0].value = "";
+ }
+
+
+ }
+
+ const [AnnulerFction_status, setAnnulerFction_status] = useState("");
+ function AnnulerFction() {
+ clearfileds();
+ setRecordData_status("false");
+ setmysession("");
+ }
+
+
+ const [AnnulerFction_info_status, setAnnulerFction_info_status] = useState("");
+ function AnnulerFction_info() {
+ clearfileds_info();
+ setAnnulerFction_info_status("false");
+
+ if (props.Close_info_form)
+ props.Close_info_form();
+ }
+
+
+ const editorRef_description = useRef(null);
+ const [field_description, setfield_description] = useState("");
+ const [editor_tochange, seteditor_tochange] = useState("");
+ function editor_keyup() {
+ seteditor_tochange("1");
+ }
+
+
+ const editorRef_evaluation = useRef(null);
+ const [field_evaluation, setfield_evaluation] = useState("");
+ const [editor_evaluation_tochange, seteditor_evaluation_tochange] = useState("");
+ function editor_evalution_keyup() {
+ seteditor_evaluation_tochange("1");
+ }
+
+
+
+ const [datamodification, setdatamodification] = useState("0");
+ function DataUpdated() {
+ setdatamodification("1");
+ }
+
+
+
+ const [SendInformationRequest_api, setSendInformationRequest_api] = useState("");
+ const [SendInformationRequest_status, setSendInformationRequest_status] = useState("");
+ const [SendInformationRequest_message, setSendInformationRequest_message] = useState("");
+
+ function SendInformationRequest() {
+ const formData = new FormData();
+ const url = process.env.REACT_APP_API_URL + "myclass/api/RenseignementClass/";
+
+
+ if (is_company === "0") {
+
+ var nom = valnom_info;
+ console.log(" nom = ", nom,);
+ if (String(nom).trim().length <= 2) {
+ document.getElementsByName("nom_info")[0].style.borderColor = "red";
+ // alert(" Le nom d'utilisateur est obligatoire 1 ");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le nom est obligatoire ");
+ setalert_type("error");
+ return;
+ }
+
+ var prenom = valprenom_info;
+ if (String(prenom).trim().length <= 2) {
+ document.getElementsByName("telephone_info")[0].style.borderColor = "red";
+ // alert(" Le prenom d'utilisateur est obligatoire ");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le prenom est obligatoire ");
+ setalert_type("error");
+ return;
+ }
+
+
+ var telephone = valtelephone_info;
+ if (String(telephone).trim().length < 10) {
+ document.getElementsByName("telephone_info")[0].style.borderColor = "red";
+ // alert(" Le numero de telephone doit comporter 10 chiffres ");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le numero de telephone doit comporter 10 chiffres ");
+ setalert_type("error");
+ return;
+ }
+
+ var email = valemail_info;
+ var re2 = /\S+@\S+\.\S+/;
+ if (re2.test(email) === false) {
+ // alert("L'email est incorrect ");
+ document.getElementsByName("email_info")[0].style.borderColor = "red";
+ setdisplay_alert_mysy("1");
+ setalert_message("L'adresse email est incorrect ");
+ setalert_type("error");
+ return;
+ }
+
+
+
+ var employeur = ""
+ if (valemployeur_info) {
+ employeur = valemployeur_info;
+ }
+
+ }
+
+ if (is_company === "1") {
+
+ var nom = raison_sociale;
+ if (String(raison_sociale).trim().length <= 2) {
+ setdisplay_alert_mysy("1");
+ setalert_message(" La raison sociale est obligatoire ");
+ setalert_type("error");
+ return;
+ }
+
+
+
+ var telephone = telephone_requester;
+ if (String(telephone_requester).trim().length < 10) {
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le numero de telephone doit comporter 10 chiffres ");
+ setalert_type("error");
+ return;
+ }
+
+ var email = email_requester;
+ var re2 = /\S+@\S+\.\S+/;
+ if (re2.test(email_requester) === false) {
+ setdisplay_alert_mysy("1");
+ setalert_message("L'adresse email est incorrect ");
+ setalert_type("error");
+ return;
+ }
+
+
+ if (String(nom_requester).trim().length <= 2) {
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le nom du demandeur est invalide ");
+ setalert_type("error");
+ return;
+ }
+
+
+
+
+ var prenom = String(prenom_requester).trim();
+ if (String(prenom_requester).trim().length <= 2) {
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le prenom du demandeur est invalide ");
+ setalert_type("error");
+ return;
+ }
+
+ var employeur = ""
+ if (valemployeur_info) {
+ employeur = valemployeur_info;
+ }
+
+ }
+
+ var message = "";
+ if (editorRef_description.current) {
+ message = editorRef_description.current.getContent();
+ }
+
+
+
+
+ formData.append('nom', nom);
+ formData.append('employeur', employeur);
+ formData.append('prenom', prenom);
+ formData.append('telephone', telephone);
+ formData.append('email', email);
+ formData.append('message', message);
+ formData.append('class_internal_url', props.internal_url);
+
+ formData.append('raison_sociale', raison_sociale);
+ formData.append('siret', siret);
+ formData.append('email_requester', email_requester);
+ formData.append('telephone_requester', telephone_requester);
+ formData.append('nom_requester', nom_requester);
+ formData.append('prenom_requester', prenom_requester);
+ formData.append('nb_person_info', nb_person_info);
+
+ formData.append('class_sales_price', class_sales_price);
+
+ formData.append('is_company', is_company);
+
+ // console.log(" ### formData = ", formData);
+
+ fetch(
+ url,
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ //console.log('Success:', result['message'], "result['status'] = ", result['status']);
+ setSendInformationRequest_api(result['status']);
+ setSendInformationRequest_status(result['status']);
+ setSendInformationRequest_message(result['message']);
+
+ })
+ .catch((error) => {
+ console.error('Error:', error);
+ setSendInformationRequest_api("false");
+ setSendInformationRequest_status("false");
+ setSendInformationRequest_message();
+ });
+
+
+ };
+
+
+ const [SendEvaluationClass_api, setSendEvaluationClass_api] = useState("");
+ const [SendEvaluationClass_status, setSendEvaluationClass_status] = useState("");
+ const [SendEvaluationClass_message, setSendEvaluationClass_message] = useState("");
+
+ function SendEvaluationClass() {
+ const formData = new FormData();
+ const url = process.env.REACT_APP_API_URL + "myclass/api/Evaluation_Class/";
+
+
+ var message = "";
+ if (editorRef_evaluation.current) {
+ message = editorRef_evaluation.current.getContent();
+ }
+
+
+
+ /*
+ var pedagogie = "";
+ var ele = document.getElementsByName('pedagogie');
+
+ for (let i = 0; i < ele.length; i++) {
+ if (ele[i].checked)
+ pedagogie = ele[i].value;
+ }
+
+ var logistique = "";
+ ele = document.getElementsByName('log');
+
+ for (let i = 0; i < ele.length; i++) {
+ if (ele[i].checked)
+ logistique = ele[i].value;
+ }
+
+ */
+ if (!RatingValue) {
+
+ // alert(" Aidez-nous à nous améliorer, donnez une appréciation globale svp. Le point N° 1. Merci d'avance")
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(" Aidez-nous à nous améliorer, donnez une appréciation globale svp. Le point N° 1. Merci d'avance");
+ setalert_type("error");
+ return;
+ }
+
+ if (!RatinpedagogiegValue) {
+
+ // alert(" Aidez-nous à nous améliorer, donnez une appréciation sur notre pédagigie svp. Le point N° 2. Merci d'avance")
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(" Aidez-nous à nous améliorer, donnez une appréciation sur notre pédagigie svp. Le point N° 2. Merci d'avance");
+ setalert_type("error");
+ return;
+ }
+
+
+
+
+ formData.append('inscription_id', props.eval_token);
+ formData.append('eval_note', RatingValue);
+ formData.append('eval_pedagogie', RatinpedagogiegValue);
+ formData.append('eval_eval', message);
+ formData.append('class_internal_url', class_internal_url);
+
+ fetch(
+ url,
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+ //console.log('Success:', result['message'], "result['status'] = ", result['status']);
+
+ if (String(result['status']) === "true") {
+ setSendEvaluationClass_api("true");
+ } else if (String(result['status']) === "false") {
+ setSendEvaluationClass_api("false");
+ setSendEvaluationClass_message(result['message']);
+ }
+
+
+ })
+ .catch((error) => {
+ console.error('Error:', error);
+ setSendEvaluationClass_api("false");
+
+ });
+
+ };
+
+ const [RatingValue, setRatingValue] = useState(0);
+ const [RatinpedagogiegValue, setRatinpedagogiegValue] = useState(0);
+
+
+ const [valnom_info, setvalnom_info] = useState("");
+ const [valprenom_info, setvalprenom_info] = useState("");
+ const [valemail_info, setvalemail_info] = useState("");
+ const [valtelephone_info, setvaltelephone_info] = useState("");
+
+ const [valemployeur_info, setvalemployeur_info] = useState("");
+
+ const [nb_person_info, setnb_person_info] = useState("1");
+
+ const [cpany_siret, setcpany_siret] = useState("");
+
+ const [is_company, setis_company] = useState("0");
+
+ const New_Option_is_cpany = [
+ { "id": "1", "label": "Entreprise ", "value": "1" },
+ { "id": "0", "label": "Particulier ", "value": "0" },
+
+ ]
+
+
+ const [raison_sociale, setraison_sociale] = useState("");
+ const handle_raison_sociale = event => {
+ var val = event.target.value;
+ setraison_sociale(val);
+ };
+
+
+ const [siret, setsiret] = useState("");
+ const handle_siret = event => {
+ var val = event.target.value;
+ setsiret(val);
+ };
+
+
+ const [email_requester, setemail_requester] = useState("");
+ const handle_email_requester = event => {
+ var val = event.target.value;
+ setemail_requester(val);
+ };
+
+ const [telephone_requester, settelephone_requester] = useState("");
+ const handle_telephone_requester = event => {
+ var val = event.target.value;
+ settelephone_requester(val);
+ };
+
+
+ const [nom_requester, setnom_requester] = useState("");
+ const handle_nom_requester = event => {
+ var val = event.target.value;
+ setnom_requester(val);
+ };
+
+
+ const [prenom_requester, setprenom_requester] = useState("");
+ const handle_prenom_requester = event => {
+ var val = event.target.value;
+ setprenom_requester(val);
+ };
+
+
+
+
+ const handlervalnom_info = event => {
+ var val = event.target.value;
+ setvalnom_info(val);
+ };
+
+
+ const handlervalprenom_info = event => {
+ var val = event.target.value;
+ setvalprenom_info(val);
+ };
+
+
+ const handlervalemail_info = event => {
+ var val = event.target.value;
+ setvalemail_info(val);
+ };
+
+
+ const handlervaltelephone_info = event => {
+ var val = event.target.value;
+ setvaltelephone_info(val);
+ };
+
+
+ const handlerval_nb_person_info = event => {
+ var val = event.target.value;
+ setnb_person_info(val);
+ };
+
+ const handlervalemployeur_info = event => {
+ var val = event.target.value;
+ setvalemployeur_info(val);
+ };
+
+ // Gestion champs specifiques
+
+ /*
+ *** ALGORITHME
+ 1 - Récuperer la liste des champs specifiques de la collection concernée - Array : list_nom_champs_spec
+ 2 - Récupérer les caracteristiques de champs champs spécifique : "id, nom, label, type valeur, etc"
+ - avec un champ 'value' à vide. Mettre dans le tableau JSON, 'spec_champs_valeur'
+
+ 3 - Créer une nouvelle table qui permettra de gerer les hook : const [rows_champs_specifics, setrows_champs_specifics] = useState([]);
+ 4 - Afficher en html les elements 'rows_champs_specifics'
+ 5 - Gerer la modification avec la fonction 'change_champs_spec_handle'
+ 6 - On recuperer les valeur lors du click d'enregistrement.
+
+ */
+
+
+ const list_nom_champs_spec = []
+ const [spec_champs_valeur, setspec_champs_valeur] = useState([]);
+
+ //const spec_champs_valeur = ""
+
+ const [Get_Partner_Object_Specific_Fields_api, setGet_Partner_Object_Specific_Fields_api] = useState();
+ const [Get_Partner_Object_Specific_Fields_message, setGet_Partner_Object_Specific_Fields_message] = useState();
+ const [Get_Partner_Object_Specific_Fields_result, setGet_Partner_Object_Specific_Fields_result] = useState();
+ function Get_Partner_Object_Specific_Fields(local_collection_obj_metier) {
+
+ var form = new FormData();
+ const stored_cookie = getCookie('tokenmysypart');
+ form.append("token", stored_cookie);
+ form.append("object_name", local_collection_obj_metier);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Object_Specific_Valide_Displayed_Fields/";
+
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In Get_Partner_Object_Specific_Fields res.data.status = " + res.data.status);
+ //console.log(" In Get_Partner_Object_Specific_Fields res.data.message r_class = " + res.data.message);
+
+ setGet_Partner_Object_Specific_Fields_api("true");
+ setGet_Partner_Object_Specific_Fields_result(res.data.message);
+ setrows_champs_specifics(res.data.message);
+
+ }
+ else {
+ setGet_Partner_Object_Specific_Fields_api("false");
+ setGet_Partner_Object_Specific_Fields_message(res.data.message);
+ // alert(res.data.message);
+ setdisplay_alert_mysy("1");
+ setalert_message(res.data.message);
+ setalert_type("error");
+ }
+
+ }).catch((error) => {
+ console.warn('Not good man :( Get_Partner_Object_Specific_Fields = ', error);
+ setGet_Partner_Object_Specific_Fields_api("false");
+ alert(" Impossible de recuperer la liste des collection et champs personnalisables");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const [rows_champs_specifics, setrows_champs_specifics] = useState([]);
+ const [display_champs_specifics, setdisplay_champs_specifics] = useState("0");
+
+ function afficher_champs_spec() {
+
+ setdisplay_champs_specifics("1");
+ //setrows_champs_specifics(spec_champs_valeur);
+
+ }
+
+ function findIndexByProperty(data, key, value) {
+ for (var i = 0; i < data.length; i++) {
+
+ if (data[i][key] == value) {
+ return i;
+ }
+ }
+ return -1;
+ }
+
+
+ function findValueByProperty(data, key, value) {
+ for (var i = 0; i < data.length; i++) {
+ if (data[i][key] == value) {
+
+ var tmp_val = JSON.parse(data[i]);
+
+ return tmp_val.field_value
+
+ }
+ }
+ return "";
+ }
+
+
+ const spec_field_updated_values = []
+ const [spec_field_updated_values_hooks, setspec_field_updated_values_hooks] = useState([]);
+
+
+ function change_champs_spec_handle() {
+
+ for (let i = 0; i < rows_champs_specifics.length; i++) {
+
+ var field_name = JSON.parse(rows_champs_specifics[i]).field_name;
+ var field_type = JSON.parse(rows_champs_specifics[i]).field_type;
+ var field_label = JSON.parse(rows_champs_specifics[i]).field_label;
+ var is_mandatory = JSON.parse(rows_champs_specifics[i]).is_mandatory;
+
+
+ if (document.getElementsByName(String(field_name))[0]) {
+
+ var field_value = document.getElementsByName(String(field_name))[0].value;
+ var new_val = { 'field_name': field_name, 'field_value': field_value, 'field_type': field_type, 'field_label': field_label, 'is_mandatory': is_mandatory }
+ var johnIndex = findIndexByProperty(spec_field_updated_values, 'field_name', field_name);
+ if (johnIndex > -1) {
+ spec_field_updated_values[johnIndex] = new_val;
+
+ } else {
+ spec_field_updated_values.push(new_val);
+ }
+ }
+
+ }
+
+ //setrows_champs_specifics(spec_champs_valeur);
+
+ //console.log(" OUTT spec_field_updated_values = ", spec_field_updated_values);
+ setspec_field_updated_values_hooks(spec_field_updated_values)
+ }
+ // -- end champs specifiques
+
+ const [civilite_stagiaire, setcivilite_stagiaire] = useState("");
+
+ const [display_alert_mysy, setdisplay_alert_mysy] = useState("");
+ const [alert_message, setalert_message] = useState("");
+ const [alert_type, setalert_type] = useState("");
+
+ function clear_alert_message() {
+ setalert_message("");
+ }
+ function clear_alert_type() {
+ setalert_type("");
+ }
+ function clear_display_alert_mysy() {
+ setdisplay_alert_mysy("");
+ }
+
+
+ return (
+
+
+
+ {/*** Affichage des messages d'alerte*/}
+ {display_alert_mysy && String(display_alert_mysy) === "1" &&
+
+ }
+ {/*** FIN Affichage des messages d'alerte*/}
+
+ {String(RecordData_status) === "true" &&
+ String(action).toLocaleLowerCase() === "inscription" &&
+
+
+ Votre inscription a bien été prise en compte.
+ Vous allez recevoir une email de confirmation dans votre boite email.
+ Merci.
+
}
+
+ {String(SendInformationRequest_status) === "true" &&
+ String(action).toLocaleLowerCase() === "information" &&
+
+
+ Votre demande d'information a été prise en compte.
+ Merci.
+
}
+
+
+ {(String(RecordData_status) === "false" ||
+ String(RecordData_status).length === 0) &&
+ String(action).toLocaleLowerCase() === "inscription" &&
+ String(AnnulerFction_status) !== "1" &&
+
+
+
:not(style)': { m: 1 }, width: '100%', }}>
+ {String(RecordData_status) === "false" &&
+ {RecordData_message}
+
+
}
+
+
Je m'inscris
+
+
+ Choisir une session
+
+
+
+
+ {New_GetCurrentClass_result && New_GetCurrentClass_result.length > 0 &&
+
(data).label === String(p_client_invoice_paiement_condition_code))[0].label}
+ options={New_GetCurrentClass_result}
+ className="disabled_style"
+ onChange={(event, value) => {
+ if (value && value._id) {
+ setmysession(value._id)
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+
+
+
+
+
+
+
+
+
+
+ {mysession &&
+
+
+
+
{
+
+ if (value && value.value) {
+ setcivilite_stagiaire(value.value);
+ }
+
+ }}
+ renderInput={(params) =>
+
+
+ }
+
+ />
+
+
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_nom}
+ onChange={(e) => {
+ setleads_nom(e.target.value);
+ }}
+ />
+
+
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_prenom}
+ onChange={(e) => {
+ setleads_prenom(e.target.value);
+ }}
+ />
+
+
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_email}
+ onChange={(e) => {
+ setleads_email(e.target.value);
+ }}
+ />
+
+
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_phone}
+ onChange={(e) => {
+ setleads_phone(e.target.value);
+ }}
+ />
+
+
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_employeur}
+ onChange={(e) => {
+ setleads_employeur(e.target.value);
+ }}
+ />
+
+
+
+
+
+
+
+
}
+
+
+ {mysession &&
+
:not(style)': { m: 1 }, width: '100%', }}>
+
+ {/*<>
+ {
+
+ if (value && value.value) {
+ setcivilite_stagiaire(value.value);
+ }
+
+ }}
+ renderInput={(params) =>
+
+
+ }
+
+ />
+
+
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_nom}
+ onChange={(e) => {
+ setleads_nom(e.target.value);
+ }}
+ />
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_prenom}
+ onChange={(e) => {
+ setleads_prenom(e.target.value);
+ }}
+ />
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_email}
+ onChange={(e) => {
+ setleads_email(e.target.value);
+ }}
+ />
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_phone}
+ onChange={(e) => {
+ setleads_phone(e.target.value);
+ }}
+ />
+
+
+
+
+ ),
+ }}
+ variant="standard"
+ value={leads_employeur}
+ onChange={(e) => {
+ setleads_employeur(e.target.value);
+ }}
+ />
+
+ {/* -- début champs specifiques ** /}
+
+
+
+ {rows_champs_specifics &&
+ rows_champs_specifics.filter((spec_field) => JSON.parse(spec_field).is_public === "1").map((champ_spec) => (
+
+
+ {String(JSON.parse(champ_spec).field_type) === "float" &&
+
+
+ ),
+ }}
+ variant="standard"
+ />}
+
+ {String(JSON.parse(champ_spec).field_type) === "string" &&
+
+
+ ),
+ }}
+ variant="standard"
+ />}
+
+
+
+
+
+ ))}
+
+
+
+
+ {/* -- end champs specifiques ** /}
+
+ > */}
+ {props.mytrainingdirectinscription !== "1" && <>
+
+ Nous vous aidons à financer la formation
+
+
+ :not(style)': { m: 1 }, width: '100%', }}>
+
+
+ Choisir le mode financement
+
+
+
+ {modefinancement && modefinancement.length > 0 &&
+
(data).label === String(p_client_invoice_paiement_condition_code))[0].label}
+ options={modefinancement}
+ className="disabled_style"
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setmonfinancement(value.value);
+ setleads_modefinance(value.value);
+
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+
+
+
+
+
+
+
+ {monfinancement && String(monfinancement) !== "perso" &&
+
+ :not(style)': { m: 1 }, width: '100%', }}>
+
+
+
+ Choisir votre centre de rattachement
+
+
+
+ {New_GetListOpco_result && New_GetListOpco_result.length > 0 &&
+
(data).label === String(p_client_invoice_paiement_condition_code))[0].label}
+ options={New_GetListOpco_result}
+ className="disabled_style"
+ onChange={(event, value) => {
+ if (value && value.idcc_code) {
+ setmyopco(value.idcc_code)
+ setleads_opco(value.idcc_code)
+ } else {
+ setmyopco("inconnu")
+ setleads_opco("inconnu")
+ }
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+
+
+
+
+
Laisser "vide" si vous ne le connaissez pas.
+
+
+
+ }
+
+
+ >}
+
+ }
+
+
+
+
+ {props.mytrainingdirectinscription !== "1" && }
+
+ {props.mytrainingdirectinscription === "1" && }
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+
+
+ {
+
+
}
+
+
*/
+ }
+
+
+
}
+
+ {/* Gestion de la note/evaluation */}
+
+
+ {
+ (String(RecordData_status) === "false" ||
+ String(RecordData_status).length === 0) &&
+ String(action).toLocaleLowerCase() === "evaluation" &&
+ String(AnnulerFction_status) !== "1" &&
+ String(SendEvaluationClass_api) === "true" &&
+
+ Votre évaluation a bien été prise en compte. Merci.
+
+
+
+ }
+
+
+ {
+ (String(RecordData_status) === "false" ||
+ String(RecordData_status).length === 0) &&
+ String(action).toLocaleLowerCase() === "evaluation" &&
+ String(AnnulerFction_status) !== "1" &&
+ String(SendEvaluationClass_api) !== "true" &&
+
+ {String(SendEvaluationClass_api) === "false" &&
+
+ {SendEvaluationClass_message}
+
+
+
}
+
+
Demande d'evaluation
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+
+ }>Envoyer évaluation {}
+
+
+
+ {
+
+
}
+
+
+ }
+
+
+
+
+
+
+ }
+
+ {/* Gestion des demandes d'information */}
+
+
+ {props.inscritpion === "2" && New_Option_is_cpany && New_Option_is_cpany.length > 0 &&
(data).value === String(is_company))[0].label}
+ options={New_Option_is_cpany}
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setis_company(value.value);
+ }
+
+ setraison_sociale("");
+ setsiret("");
+ setemail_requester("");
+ settelephone_requester("");
+ setnom_requester("");
+ setprenom_requester("");
+
+ setvalnom_info("");
+ setvalprenom_info("");
+ setvalemail_info("");
+ setvaltelephone_info("");
+ setvalemployeur_info("");
+ setnb_person_info("1");
+
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+
+
+
+ {
+ is_company && String(is_company) === "0" && (String(SendInformationRequest_status) === "false" ||
+ String(SendInformationRequest_status).length === 0) &&
+ String(action).toLocaleLowerCase() === "information" &&
+ String(AnnulerFction_info_status) !== "false" &&
+
+
+ {String(RecordData_status) === "false" &&
+ {RecordData_message}
+
+
}
+
+
+
+
+
+
+
+
+ ),
+ }}
+ onChange={handlervalnom_info}
+ variant="standard"
+ />
+
+
+
+
+ ),
+ }}
+ onChange={handlervalprenom_info}
+ variant="standard"
+ />
+
+
+
+
+ ),
+ }}
+ onChange={handlervalemail_info}
+ variant="standard"
+ />
+
+
+
+
+ ),
+ }}
+ onChange={handlervaltelephone_info}
+ variant="standard"
+ />
+
+
+
+
+ ),
+ }}
+ onChange={handlervalemployeur_info}
+ variant="standard"
+ />
+
+
+
+ {/* -- début champs specifiques ** /}
+
+
+
+
Vos champs spécifiques 2
+
+ {rows_champs_specifics &&
+ rows_champs_specifics.map((champ_spec) => (
+
+
{String(JSON.parse(champ_spec).is_mandatory) === "1" && {JSON.parse(champ_spec).field_label} }
+ {String(JSON.parse(champ_spec).is_mandatory) !== "1" && {JSON.parse(champ_spec).field_label} }
+ {
+ change_champs_spec_handle(e.target.value);
+ //setEmployee_data_changed("1");
+ }}
+ //onChange={change_champs_spec_handle}
+
+
+ />
+
+ ))}
+
+
+
+
+ {/* -- end champs specifiques **/}
+
+
+
+
+
+
Dites nous en plus sur votre besoin :)
+ Votre message
+
editorRef_description.current = editor}
+ initialValue={field_description}
+ onKeyUp={editor_keyup}
+ onEditorChange={(newValue, editor) => {
+
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated()
+ seteditor_tochange("");
+ }
+ }}
+
+ init={{
+ resize: false,
+ height: 300,
+ menubar: false,
+ plugins: [
+ 'advlist autolink lists link image charmap print preview anchor',
+ 'searchreplace visualblocks code fullscreen',
+ 'insertdatetime media table paste code help wordcount'
+ ],
+ toolbar: false,
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+ }>Envoyer {}
+
+
+
+
+ {
+
+
}
+
*/
+
+ }
+
+
+
+
+
+ }
+
+
+ {
+ is_company && String(is_company) === "1" && (String(SendInformationRequest_status) === "false" ||
+ String(SendInformationRequest_status).length === 0) &&
+ String(action).toLocaleLowerCase() === "information" &&
+ String(AnnulerFction_info_status) !== "false" &&
+
+
+ {String(RecordData_status) === "false" &&
+ {RecordData_message}
+
+
}
+
+
+
+
+
+
+
+
+ ),
+ }}
+ onChange={handle_raison_sociale}
+ variant="standard"
+ />
+
+
+
+
+ ),
+ }}
+ onChange={handle_siret}
+ variant="standard"
+ />
+
+
+
+
+
+ ),
+ }}
+ onChange={handle_email_requester}
+ variant="standard"
+ />
+
+
+
+
+ ),
+ }}
+ onChange={handle_telephone_requester}
+ variant="standard"
+ />
+
+
+
+
+ ),
+ }}
+ onChange={handle_nom_requester}
+ variant="standard"
+ />
+
+
+
+
+ ),
+ }}
+ onChange={handle_prenom_requester}
+ variant="standard"
+ />
+
+
+
+ ),
+ }}
+ value={nb_person_info}
+ onChange={handlerval_nb_person_info}
+ variant="standard"
+ />
+
+
+
+
+
+
+
+
+
Dites nous en plus sur votre besoin :)
+
+
+ Votre message
+
editorRef_description.current = editor}
+ initialValue={field_description}
+ onKeyUp={editor_keyup}
+ onEditorChange={(newValue, editor) => {
+
+ if (String(editor_tochange) === "1") {
+ //alert(" change");
+ DataUpdated()
+ seteditor_tochange("");
+ }
+ }}
+
+ init={{
+ resize: false,
+ height: 400,
+ menubar: false,
+ plugins: [
+ 'advlist autolink lists link image charmap print preview anchor',
+ 'searchreplace visualblocks code fullscreen',
+ 'insertdatetime media table paste code help wordcount'
+ ],
+ toolbar: false,
+ content_style: 'body { font-family:DM Sans,sans-serif; font-size:14px; }'
+ }}
+ />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+ }>Envoyer {}
+
+
+
+
+ {
+
+
}
+
+
+ */}
+
+
+
+
+
+ }
+
+
+
+ );
+}
+export default Inscription_Information;
\ No newline at end of file
diff --git a/src/components/PROD_100326/detail_formation_automatic_files/new_detail_formation_2025.js b/src/components/PROD_100326/detail_formation_automatic_files/new_detail_formation_2025.js
new file mode 100644
index 0000000..215b3d1
--- /dev/null
+++ b/src/components/PROD_100326/detail_formation_automatic_files/new_detail_formation_2025.js
@@ -0,0 +1,2990 @@
+import React, { useRef, useState, useEffect } from "react";
+import "./new_s_detail_formation_2025.css";
+import { useParams } from 'react-router-dom'
+import axios from "axios";
+import { FcInfo } from "react-icons/fc";
+import 'reactjs-popup/dist/index.css';
+import fileDownload from 'js-file-download';
+import { Helmet } from "react-helmet";
+import 'react-slideshow-image/dist/styles.css'
+import 'react-tooltip/dist/react-tooltip.css'
+import { Tooltip } from 'react-tooltip'
+import slideimg1 from "../../mysy_img/education.jpg";
+import slideimg4 from "../../mysy_img/mysy_img.png";
+
+import img_met_program from "../../mysy_img/met_programmation.jpg";
+
+import img_met_graphisme from "../../mysy_img/metier_graphisme.jpg";
+
+import img_met_autre from "../../mysy_img/met_autre.jpg";
+import img_met_digital from "../../mysy_img/met_digital.jpg";
+import img_met_management from "../../mysy_img/met_management.jpg";
+
+
+import img_met_dev_perso from "../../mysy_img/metier_dev_perso.jpg";
+import img_met_rh from "../../mysy_img/met_rh.jpg";
+
+import img_met_bureautic from "../../mysy_img/met_burautic.jpg";
+import img_met_vente from "../../mysy_img/met_vente.jpg";
+import img_met_sport from "../../mysy_img/met_sport.png";
+import img_met_sante_nat from "../../mysy_img/met_sante_nat.jpeg";
+
+import Social_X_icon from '../../img_new_design_2025/social_i_X.png';
+import Social_Link_icon from '../../img_new_design_2025/social_i_Link.png';
+import Social_Fa_icon from '../../img_new_design_2025/social_i_Fa.png';
+
+/*
+/!\ important: les images du slides doivent avoir une dimension de : 250 X 450
+*/
+import { Button, } from "reactstrap";
+import { useHistory } from "react-router-dom";
+import { useCookies } from "react-cookie";
+
+import { confirmAlert } from 'react-confirm-alert';
+//import { Rating } from 'react-simple-star-rating';
+import Rating from '@mui/material/Rating';
+import parse from 'html-react-parser';
+import Inscription from "./../Inscription_Information";
+import SendIcon from '@mui/icons-material/Send';
+
+
+import Accordion from '@mui/material/Accordion';
+import AccordionDetails from '@mui/material/AccordionDetails';
+import AccordionSummary from '@mui/material/AccordionSummary';
+import Typography from '@mui/material/Typography';
+import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
+
+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';
+
+
+const New_C_Detail_Formation_2025 = (props) => {
+ const { classId, action } = useParams();
+ const [result, setResult] = useState("");
+ const [myApiResponse, setmyApiResponse] = useState();
+ const [DetailTraining, setDetailTraining] = useState([]);
+ const [closepopup, setclosepopup] = useState(0);
+ const [country_code, setcountry_code] = useState("");
+ const [country_name, setcountry_name] = useState("");
+ const [city, setcity] = useState("");
+ const [postal, setpostal] = useState("");
+ const [latitude, setlatitude] = useState("");
+ const [longitude, setlongitude] = useState("");
+ const [IPv4, setIPv4] = useState("");
+ const [state, setstate] = useState("");
+ const [userIp, setuserIp] = useState("");
+ const [mynote, setmynote] = useState(0);
+ const [userconnected, setuserconnected] = useState("0");
+ const [partnerconnected, setpartnerconnected] = useState("0");
+ const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']);
+ const [cookie_part, setCookie_part, removeCookie_part] = useCookies(['tokenmysypart']);
+
+ const [inscritpion, setinscritpion] = useState("");
+ const [ratingvalue, setratingvalue] = useState(0);
+
+ const [partnaire_tva, setpartnaire_tva] = useState("");
+
+ const [text_size, settext_size] = useState("0");
+
+ const socialIconStyles = {
+ width: '24px',
+ height: '24px',
+ cursor: 'pointer',
+ };
+
+ const socialIconStyles_mobile = {
+ width: '24px',
+ height: '24px',
+ cursor: 'pointer',
+ };
+
+ // Gestion des Cookies
+ const stored_partner = cookie_part.tokenmysypart;
+ const stored_user = cookie.tokenmysych;
+
+
+ const [childdata, setchilddata] = useState();
+
+
+ // Cette fonction verifier si le token de l'evaluation est valide
+ //si $action != 'information' et 'inscription', alors la valeur est forcement celle d'un token.
+ const [tokenEval_api, settokenEval_api] = useState();
+ const [tokenEval_message, settokenEval_message] = useState();
+ const [tokenEval_result, settokenEval_result] = useState();
+ function CheckEvaluationToken() {
+
+ var form = new FormData();
+ //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA");
+
+ form.append("eval_token", action);
+ form.append("class_internal_url", classId);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/MySyckeckEvaluationToken/";
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In CheckEvaluationToken res.data.status = " + res.data.status);
+ //console.log(" In CheckEvaluationToken res.data.message r_class = " + res.data.message);
+
+
+ if (String(res.data.status) !== "false") {
+ settokenEval_api("true");
+ settokenEval_result(res.data.message);
+ }
+ else {
+ //console.log(" In tokenEval_trainingsession res.data.status = " + res.data.status);
+ settokenEval_api("false");
+ settokenEval_message(res.data.message);
+ }
+
+ }).catch((error) => {
+ console.warn('Not good man :( CheckEvaluationToken = ', error);
+ settokenEval_api("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [mytrainingdirectinscription, setmytrainingpreinscription] = useState("");
+
+ useEffect(() => {
+
+ async function funclocaltoken() {
+ if (action && String(action).toLocaleLowerCase() !== "inscription" &&
+ String(action).toLocaleLowerCase() !== "information") {
+
+ CheckEvaluationToken();
+ }
+ }
+
+
+ var local_user_connect = 0;
+ var local_part_connect = 0;
+
+ if (typeof (stored_user) === "undefined" || String(stored_user) === '') {
+ setuserconnected("0");
+ local_user_connect = 0;
+ } else {
+ setuserconnected("1");
+ local_user_connect = 1;
+ }
+
+ if (typeof (stored_partner) === "undefined" || String(stored_partner) === '') {
+ setpartnerconnected("0");
+ local_part_connect = 0;
+ } else {
+ setpartnerconnected("1");
+ local_part_connect = 1;
+ }
+
+ async function fetchData() {
+ const result = await axios('https://geolocation-db.com/json/',);
+ setuserIp(result.data.IPv4);
+ setcountry_code(result.data.country_code);
+ setcountry_name(result.data.country_name);
+ setcity(result.data.city);
+ setpostal(result.data.postal);
+ setlatitude(result.data.latitude);
+ setlongitude(result.data.longitude);
+ setIPv4(result.data.IPv4);
+ setstate(result.data.state);
+ setuserIp(result.data.IPv4);
+ submenu_datelieu();
+ }
+ fetchData();
+
+
+ GetCurrentClass_trainingsession();
+ Display();
+ GetAssociatedTraning();
+
+
+ funclocaltoken();
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+
+ }, []);
+
+
+ function contactUs(e) {
+
+ var sender_mail = "";
+ var sender_tel = "";
+ var token = "";
+ if (String(userconnected) === "0") {
+ sender_mail = document.getElementsByName("usermail")[0].value;
+ sender_tel = document.getElementsByName("usernumtel")[0].value;
+ if (sender_mail.length == 0 && sender_tel.length == 0) {
+ alert(" Les information fournies sont incorrectes ");
+ return;
+ }
+ } else {
+ token = String(stored_user)
+
+ }
+
+
+ var useravis = document.getElementsByName("useravis")[0].value;
+ var usersupqual = document.getElementsByName("userqualsup")[0].value;
+ var usernote = document.getElementsByName("usernote")[0].value;
+
+ if (useravis.length < 20 || usersupqual.length < 20 || usernote.length < 0) {
+ alert("Merci de saisir le nombre minimum de caractère requis pour les champs ");
+ return;
+ }
+
+
+ var re = /\S+@\S+\.\S+/;
+ if (re.test(sender_mail) == false) {
+ alert("l'email est incorrecte");
+ return;
+ }
+
+
+ ////console.log("contacter " + sender_mail + " - " + sender_tel + " - ")
+
+
+ //alert("contacter "+sender_mail+" - "+sender_tel+" - "+usermessage+" - url = "
+ //+process.env.REACT_APP_API_URL+" - user_ip ="+IPv4+" - "+latitude);
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/add_user_message/";
+ var form = new FormData();
+ form.append("type", "email");
+ form.append("recever_mail", "");
+ form.append("recever_tel", "");
+ form.append("sender_mail", sender_mail);
+ form.append("sender_tel", sender_tel);
+ form.append("object", DetailTraining["external_code"]);
+ form.append("token", "");
+ form.append("user_ip", IPv4);
+ form.append("user_country_code", country_code);
+ form.append("user_country_name", country_name);
+ form.append("user_city", city);
+ form.append("user_postal", postal);
+ form.append("user_latitude", latitude);
+ form.append("user_longitude", longitude);
+ form.append("user_state", state);
+
+ axios.post(myurl, form).then(res => {
+ if (res.data.status != "False") {
+ //console.log(" In test res.data.status = " + res.data.status);
+ //console.log(" In test res.data.message = " + res.data.message);
+ setclosepopup(1);
+ document.getElementsByName("usermail")[0].value = "";
+ document.getElementsByName("usernumtel")[0].value = "";
+ document.getElementsByName("usercomment")[0].value = "";
+ }
+ else {
+ //console.log(" contact-nous statut = " + res.data.status);
+ //console.log(" contact-nous res.data.message = " + res.data.message);
+ }
+ }).catch((error) => {
+ console.warn('contact-nous Not good man :( mysearchtext = ');
+
+ })
+
+
+ }
+
+
+ /* Cette variable accompagne la gestion des images par defaut.
+ idée : si la valeur de "DetailTraining.metier" != "management, digital, office, rh, vente, dev_perso"
+ alors l'utilisateur à créer une formation avec un metier qui n'est pas geré, donc on met une image par defaut
+ */
+ const [ismetiermanaged, setismetiermanaged] = useState();
+ const liste_metier = ["management", "digital", "office", "rh", "vente", "dev_perso"];
+
+
+ const [nb_pave_a_afficher, setnb_pave_a_afficher] = useState();
+
+ const [isdatadock, setisdatadock] = useState();
+ const [isqualiopi, setisqualiopi] = useState();
+ const [iscertitrace, setiscertitrace] = useState();
+ const [isbureaucertitrace, setisbureaucertitrace] = useState();
+ const [iscertifvoltaire, setiscertifvoltaire] = useState();
+ const [partnair_name, setpartnair_name] = useState();
+ const [website_partenaire, setwebsite_partenaire] = useState();
+
+ const [class_sales_price, setclass_sales_price] = useState("0");
+
+ const [myclassimage, setmyclassimage] = useState();
+ const [isclassimage, setisclassimage] = useState("False");
+ const [userimgclassprofil, setuserimgclassprofil] = useState("");
+
+ const [class_img_stored_in_bdd, setclass_img_stored_in_bdd] = useState("");
+
+ function getClassImage_no_token(class_id, class_external_code) {
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/getRecodedClassImage_no_token/";
+
+ var form = new FormData();
+
+ form.append("type", "partner");
+ form.append("related_collection", "myclass");
+ form.append("related_collection_recid", class_id);
+ form.append("class_external_code", class_external_code);
+
+
+ axios.post(myurl, form).then(res => {
+
+ if (res.data.status != "False") {
+
+ //console.log(" getClassImage : In test res.data.status = " + res.data.status);
+ console.log(" getClassImage: res.data.message.img = " + res.data.message);
+
+ if (res.data.message.img.length > 0) {
+ setisclassimage("True");
+ }
+ else {
+ setisclassimage("False");
+ }
+ setisclassimage(res.data.message.img);
+ var ch_img = "data:image/png;base64," + res.data.message.img;
+ setclass_img_stored_in_bdd(ch_img);
+ }
+ else {
+ //console.log(" In Erreur res.data.status = " + res.data.status);
+ //console.log(" In Erreur res.data.message = " + res.data.message);
+ setisclassimage("False");
+ setuserimgclassprofil();
+ setclass_img_stored_in_bdd();
+ }
+ }).catch((error) => {
+
+ console.warn('getClassImage ee: Not good man :( getClassImage = ');
+ setisclassimage("False");
+ setuserimgclassprofil("");
+ setclass_img_stored_in_bdd("");
+ })
+
+ }
+
+
+ const [Get_Class_Catalogue_File_api, setGet_Class_Catalogue_File_api] = useState();
+ const [Get_Class_Catalogue_File_result, setGet_Class_Catalogue_File_result] = useState([]);
+ const [Get_Class_Catalogue_File_message, setGet_Class_Catalogue_File_message] = useState();
+
+ function Get_Class_Catalogue_File(class_id) {
+
+ const formData = new FormData();
+
+ formData.append("filter_object_owner_collection", "myclass");
+ formData.append("filter_object_owner_id", class_id);
+ formData.append("filter_type_document", "catalogue_file");
+
+
+ //formData.append("class_internal_url", internal_url);
+ //console.log("token = " + stored_cookie);
+
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/Get_List_object_owner_collection_Stored_Files_With_Filter_No_Token/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ )
+ .then((response) => response.json())
+ .then((result) => {
+
+ //console.log(" ## result['status'] = ", result['status'])
+ if (String(result['status']) === String("true")) {
+ //console.log('Message :', result['message']);
+ setGet_Class_Catalogue_File_result(result['message']);
+ setGet_Class_Catalogue_File_api("true");
+
+ }
+ else {
+ setGet_Class_Catalogue_File_message(result['message']);
+ setGet_Class_Catalogue_File_api("false");
+ }
+
+ })
+ .catch((error) => {
+
+ console.error(' Get_Class_Catalogue_File Error:', error);
+ setGet_Class_Catalogue_File_api("false");
+ });
+
+ }
+
+
+
+
+
+ function Display(e) {
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_class/";
+ var form = new FormData();
+ form.append("internal_url", classId);
+
+ var my_local_user_connect;
+ var my_local_part_connect;
+ if (typeof (stored_user) === "undefined" || String(stored_user) === '') {
+ my_local_user_connect = 0;
+ } else {
+ my_local_user_connect = 1;
+ }
+
+ if (typeof (stored_partner) === "undefined" || String(stored_partner) === '') {
+ my_local_part_connect = 0;
+ } else {
+ my_local_part_connect = 1;
+ }
+
+
+
+ if (String(my_local_user_connect) === "1") {
+ form.append("token", stored_user);
+ form.append("connection_type", "user");
+ }
+ else if (String(my_local_part_connect) === "1") {
+ form.append("token", stored_partner);
+ form.append("connection_type", "partner");
+ }
+ else {
+ form.append("token", "");
+ form.append("connection_type", "");
+ }
+
+ // Ajout des info IP user
+ form.append("user_ip", IPv4);
+ form.append("user_country_code", country_code);
+ form.append("user_country_name", country_name);
+ form.append("user_city", city);
+ form.append("user_postal", postal);
+ form.append("user_latitude", latitude);
+ form.append("user_longitude", longitude);
+ form.append("user_state", state);
+
+ var cpt_pave = 0;
+ //alert("myurl = "+myurl);
+
+ axios.post(myurl, form).then(res => {
+ // console.log(" In Display res.data.status = " + res.data.status);
+ // console.log(" In Display res.data.message = " + res.data.message);
+ if (String(res.data.status) === String("true")) {
+
+ if (res.data.message.length > 0) {
+ setmyApiResponse("True");
+
+ if (String(JSON.parse(res.data.message).coeur) !== String("1") &&
+ String(JSON.parse(res.data.message).freeacces) !== String("1")) {
+
+ //alert(" ce n'est pas un coeur = " + JSON.parse(res.data.message).coeur)
+ // Verification si on est en e connecté ou non.
+ var local_user_connect = 0;
+ var local_part_connect = 0;
+
+ if (typeof (stored_user) === "undefined" || String(stored_user) === '') {
+ setuserconnected("0");
+ local_user_connect = 0;
+ } else {
+ setuserconnected("1");
+ local_user_connect = 1;
+ }
+
+ if (typeof (stored_partner) === "undefined" || String(stored_partner) === '') {
+ setpartnerconnected("0");
+ local_part_connect = 0;
+ } else {
+ setpartnerconnected("1");
+ local_part_connect = 1;
+ }
+
+ if (local_user_connect === 0 && local_part_connect === 0) {
+ confirmAlert({
+ title: 'Connexion ?',
+ message: 'Connectez-vous pour acceder au detail de cette formation',
+ buttons: [
+ {
+ label: 'Vous avez un compte',
+ onClick: () => { history.push("/mysy-training-login/training/" + classId) }
+ },
+ {
+ label: "Vous n'avez pas de compte",
+ onClick: () => { history.push("/create_account") }
+ },
+
+ ],
+ closeOnEscape: false,
+ closeOnClickOutside: false,
+ keyCodeForClose: [8, 32],
+ willUnmount: () => { },
+ afterClose: () => { },
+ onClickOutside: () => { },
+ onKeypress: () => { },
+ onKeypressEscape: () => { },
+ });
+
+
+ }
+ } else {
+ //alert(" c'est pas un coeur = " + JSON.parse(res.data.message).coeur)
+ }
+ }
+ else {
+ setmyApiResponse("False");
+ }
+ //console.log(" In displaydetailclass res.data.status = " + res.data.status);
+ //console.log(" In displaydetailclass res.data.message = " + res.data.message);
+ //console.log(" In displaydetailclass taille res.data.message = " + res.data.message.length);
+ setResult(res.data.message);
+ setDetailTraining(JSON.parse(res.data.message));
+
+
+ getClassImage_no_token(JSON.parse(res.data.message)._id, JSON.parse(res.data.message).external_code);
+
+
+ Get_Class_Catalogue_File(JSON.parse(res.data.message)._id);
+
+
+ if (JSON.parse(res.data.message).note) {
+ setratingvalue(JSON.parse(res.data.message).note);
+ }
+
+ if (JSON.parse(res.data.message).partnaire_tva) {
+ setpartnaire_tva(JSON.parse(res.data.message).partnaire_tva);
+ } else {
+ setpartnaire_tva("");
+ }
+
+ if (JSON.parse(res.data.message).inscription_direct) {
+ setmytrainingpreinscription(JSON.parse(res.data.message).inscription_direct);
+ } else {
+ setmytrainingpreinscription("");
+ }
+
+
+ if (JSON.parse(res.data.message).isdatadock) {
+ setisdatadock(JSON.parse(res.data.message).isdatadock);
+ }
+
+ if (JSON.parse(res.data.message).business_prices && JSON.parse(res.data.message).business_prices.length == 1) {
+ setclass_sales_price(JSON.parse(res.data.message).business_prices[0].discounted_price);
+
+ } else {
+ setclass_sales_price(JSON.parse(res.data.message).price);
+ setclass_sales_price(JSON.parse(res.data.message).price);
+ }
+
+
+ if (JSON.parse(res.data.message).isqualiopi) {
+ setisqualiopi(JSON.parse(res.data.message).isqualiopi);
+ }
+
+
+ if (JSON.parse(res.data.message).iscertitrace) {
+ setiscertitrace(JSON.parse(res.data.message).iscertitrace);
+ }
+
+ if (JSON.parse(res.data.message).isbureaucertitrace) {
+ setisbureaucertitrace(JSON.parse(res.data.message).isbureaucertitrace);
+ }
+
+ if (JSON.parse(res.data.message).iscertifvoltaire) {
+ setiscertifvoltaire(JSON.parse(res.data.message).iscertifvoltaire);
+ }
+
+ if (JSON.parse(res.data.message).nom_partenaire) {
+ setpartnair_name(JSON.parse(res.data.message).nom_partenaire);
+ }
+
+ if (JSON.parse(res.data.message).nb_pave_a_afficher) {
+ setnb_pave_a_afficher(JSON.parse(res.data.message).nb_pave_a_afficher);
+ //console.log(" ### NB setnb_pave_a_afficher = ", JSON.parse(res.data.message).nb_pave_a_afficher);
+ }
+
+
+ if (JSON.parse(res.data.message).website_partenaire) {
+ setwebsite_partenaire(JSON.parse(res.data.message).website_partenaire);
+ }
+
+ // Verifier si le metier est geré
+ if (JSON.parse(res.data.message).metier) {
+ if (!liste_metier.includes(JSON.parse(res.data.message).metier)) {
+ setismetiermanaged("0"); // j'ai une valeur dans metier, mais qui n'est pas geré
+ }
+ }
+ else {
+ setismetiermanaged("0");
+ }
+
+ if (JSON.parse(res.data.message).img_url && String(JSON.parse(res.data.message).img_url).length > 0) {
+ setismetiermanaged("1");
+ }
+
+ if (JSON.parse(res.data.message).text_size) {
+ settext_size(JSON.parse(res.data.message).text_size);
+
+ //"block_crossell_meme_orga"
+ var local_tmp;
+ var val;
+ var footer_top;
+ var main_h;
+ var main_h_px;
+
+
+ //console.log("nb_partner_certificat = ", JSON.parse(res.data.message).nb_partner_certificat);
+
+ /*
+ if (window.screen.width < 601) {
+
+ var decalage_pr_certificat = parseInt(String(JSON.parse(res.data.message).nb_partner_certificat)) * 150;
+ //console.log("decalage_pr_certificat = ", decalage_pr_certificat);
+
+ var local_val = parseInt(String(JSON.parse(res.data.message).nb_pave_a_afficher));
+
+ //console.log("### local_val = ", local_val)
+ if (local_val >= 5) {
+ //console.log(" ON PASSE au MAX")
+ var local_tmp_val = 2300 + decalage_pr_certificat;
+ var local_main_h_px = 4000 + decalage_pr_certificat;
+ //console.log("### local_tmp_val = ", local_tmp_val, " local_main_h_px = ",local_main_h_px);
+ local_tmp = local_tmp_val + "px";
+ main_h_px = local_main_h_px + "px";
+
+ if (String(action).toLowerCase() === "information" || String(action).toLowerCase() === "inscription") {
+
+ var local_tmp_val = 2800 + decalage_pr_certificat;
+ var local_main_h_px = 4500 + decalage_pr_certificat;
+ local_tmp = local_tmp_val + "px";
+ main_h_px = local_main_h_px + "px";
+ }
+
+ } else {
+ //console.log(" ON PASSE au MIN");
+ var local_tmp_val = 2100 + decalage_pr_certificat;
+ var local_main_h_px = 4800 + decalage_pr_certificat;
+
+ local_tmp = local_tmp_val + "px";
+ main_h_px = local_main_h_px + "px";
+
+ if (String(action).toLowerCase() === "information" || String(action).toLowerCase() === "inscription") {
+ var local_tmp_val = 2600 + decalage_pr_certificat;
+ var local_main_h_px = 5300 + decalage_pr_certificat;
+ local_tmp = local_tmp_val + "px";
+ main_h_px = local_main_h_px + "px";
+ }
+ }
+ // document.getElementById('mob_block_cross_sell_cat').style.top = local_tmp;
+ //document.getElementById('mobile').style.height = main_h_px;
+
+ }
+
+ if (window.screen.width >= 601 && window.screen.width <= 991) {
+
+ var local_val = parseInt(String(JSON.parse(res.data.message).nb_pave_a_afficher));
+ if (local_val >= 5) {
+ //console.log(" ON PASSE au MAX")
+ local_tmp = "2000px";
+ main_h_px = "2700px";
+
+ if (String(action).toLowerCase() === "information" || String(action).toLowerCase() === "inscription") {
+ local_tmp = "2500px";
+ main_h_px = "3200px";
+ }
+
+ } else {
+ console.log(" ON PASSE au MIN");
+ local_tmp = "1700px";
+ main_h_px = "2500px";
+
+ if (String(action).toLowerCase() === "information" || String(action).toLowerCase() === "inscription") {
+ local_tmp = "2200px";
+ main_h_px = "3000px";
+ }
+
+ }
+ document.getElementById('block_crossell_meme_orga').style.top = local_tmp;
+ document.getElementById('desktop').style.height = main_h_px;
+
+
+ }
+
+ if (window.screen.width >= 992 && window.screen.width <= 1199) {
+
+ var local_val = parseInt(String(JSON.parse(res.data.message).nb_pave_a_afficher));
+ if (local_val >= 5) {
+ console.log(" ON PASSE au MAX")
+ local_tmp = "2000px";
+ main_h_px = "2800px";
+
+ if (String(action).toLowerCase() === "information" || String(action).toLowerCase() === "inscription") {
+ local_tmp = "2500px";
+ main_h_px = "3200px";
+ }
+
+ } else {
+ console.log(" ON PASSE au MIN");
+ local_tmp = "1700px";
+ main_h_px = "2500px";
+
+ if (String(action).toLowerCase() === "information" || String(action).toLowerCase() === "inscription") {
+ local_tmp = "2200px";
+ main_h_px = "3000px";
+ }
+
+ }
+ document.getElementById('block_crossell_meme_orga').style.top = local_tmp;
+ document.getElementById('desktop').style.height = main_h_px;
+ }
+
+ if (window.screen.width >= 1200) {
+ var local_val = parseInt(String(JSON.parse(res.data.message).nb_pave_a_afficher));
+ if (local_val >= 5) {
+ console.log(" ON PASSE au MAX")
+ local_tmp = "2000px";
+ main_h_px = "2800px";
+
+ if (String(action).toLowerCase() === "information" || String(action).toLowerCase() === "inscription") {
+ local_tmp = "2500px";
+ main_h_px = "3200px";
+ }
+
+ } else {
+ //console.log(" ON PASSE au MIN");
+ local_tmp = "1700px";
+ main_h_px = "2500px";
+
+ if (String(action).toLowerCase() === "information" || String(action).toLowerCase() === "inscription") {
+ local_tmp = "2300px";
+ main_h_px = "3000px";
+ }
+ }
+
+ if (document.getElementById('block_crossell_meme_orga')) {
+ document.getElementById('block_crossell_meme_orga').style.top = local_tmp;
+ }
+ document.getElementById('desktop').style.height = main_h_px;
+ }
+
+ */
+
+ }
+ }
+ else {
+ //console.log(" In Erreur res.data.status = " + res.data.status);
+ //console.log(" In Erreur res.data.message = " + res.data.message);
+ setmyApiResponse("false");
+ history.push("/formation-inconnue/");
+
+ }
+
+
+ }).catch((error) => {
+ console.warn('Not good man :( Display = ', error);
+ //console.log(error);
+ setmyApiResponse("false");
+
+ })
+
+
+ }
+
+ const [associatedtraining_api, setassociatedtraining_api] = useState("");
+ const [associatedtraining_message, setassociatedtraining_message] = useState("");
+ function GetAssociatedTraning(e) {
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_associated_class_of_partnair/";
+ var form = new FormData();
+ form.append("internal_url", classId);
+ // Ajout des info IP user
+ form.append("user_ip", IPv4);
+ form.append("user_country_code", country_code);
+ form.append("user_country_name", country_name);
+ form.append("user_city", city);
+ form.append("user_postal", postal);
+ form.append("user_latitude", latitude);
+ form.append("user_longitude", longitude);
+ form.append("user_state", state);
+
+
+ //alert("myurl = "+myurl);
+
+ axios.post(myurl, form).then(res => {
+ if (String(res.data.status) !== String("false")) {
+ //console.log(" In GetAssociatedTraning res.data.status = " + res.data.status);
+ //console.log(" In GetAssociatedTraning res.data.message = " + res.data.message);
+ setassociatedtraining_api("True");
+ setassociatedtraining_message(res.data.message);
+
+ }
+ else {
+ //console.log(" In Erreur res.data.status = " + res.data.status);
+ //console.log(" In Erreur res.data.message = " + res.data.message);
+ setassociatedtraining_api("False");
+ }
+
+
+ }).catch((error) => {
+ console.warn('Not good man :( GetAssociatedTraning = ');
+ setassociatedtraining_api("False");
+
+ })
+
+
+ }
+
+ const history = useHistory();
+
+ const fadeImages = [
+ {
+ url: slideimg1,
+ },
+
+ {
+ url: slideimg4,
+ },
+ ];
+
+
+ function CheckAvis(e) {
+
+ const val = document.getElementById("useravis").value
+ //alert(" evalu " + val);
+ if (val.length < 20) {
+ alert(" Le champ 'Avis' doit etre plus renseigné");
+ }
+ //alert(val);
+ }
+
+ function CheckNote(e) {
+ const val = e.target.value;
+
+ if (isNaN(val)) {
+ //alert(val + " is not a number
mynote = "+mynote);
+ document.getElementById("usernote").value = mynote;
+ } else {
+ if (val > 5) {
+ alert(" Valeur Maxi doit etre 5");
+ document.getElementById("usernote").value = mynote;
+ } else {
+ setmynote(val);
+ }
+ }
+
+ }
+
+ const [submenu, setsubmenu] = useState("datelieu");
+
+ function submenu_info() {
+ setsubmenu("formateur");
+ //if (document.getElementsByName("menu_formateur")[0])
+ // document.getElementsByName('menu_formateur')[0].focus();
+
+ if (document.getElementsByName("menu_datelieu")[0])
+ document.getElementsByName('menu_datelieu')[0].blur();
+
+ if (document.getElementsByName("submenu_divers")[0])
+ document.getElementsByName('submenu_divers')[0].blur();
+ }
+
+ function submenu_datelieu() {
+ setsubmenu("datelieu");
+ //if (document.getElementsByName("menu_datelieu")[0])
+ // document.getElementsByName('menu_datelieu')[0].focus();
+
+ if (document.getElementsByName("menu_formateur")[0])
+ document.getElementsByName('menu_formateur')[0].blur();
+
+ if (document.getElementsByName("submenu_divers")[0])
+ document.getElementsByName('submenu_divers')[0].blur();
+ }
+
+
+ function submenu_divers() {
+ setsubmenu("divers");
+ //if (document.getElementsByName("submenu_divers")[0])
+ //document.getElementsByName('submenu_divers')[0].focus();
+
+ if (document.getElementsByName("menu_datelieu")[0])
+ document.getElementsByName('menu_datelieu')[0].blur();
+
+ if (document.getElementsByName("submenu_divers")[0])
+ document.getElementsByName('submenu_divers')[0].blur();
+ }
+
+
+ function Inscription_bton(event) {
+ if (DetailTraining["internal_url"] && String(DetailTraining["class_inscription_url"]).length > 10) {
+ window.open(
+ String(DetailTraining["class_inscription_url"]),
+ '_blank'
+ );
+
+ } else {
+ setinscritpion("1");
+
+ }
+
+
+ if (document.getElementById('myRef_informe')) {
+ var divh = document.getElementById('myRef_informe').offsetTop;
+ window.scrollTo({
+ top: divh,
+ behavior: "smooth",
+ });
+ }
+
+
+ }
+
+ function Contact_bton(event) {
+ setinscritpion("2");
+
+
+ if (document.getElementById('myRef_informe')) {
+ var divh = document.getElementById('myRef_informe').offsetTop;
+ window.scrollTo({
+ top: divh,
+ behavior: "smooth",
+ });
+ }
+
+
+ }
+
+
+ const [GetCurrentClass_api, setGetCurrentClass_api] = useState();
+ const [GetCurrentClass_message, setGetCurrentClass_message] = useState();
+ const [GetCurrentClass_result, setGetCurrentClass_result] = useState();
+ function GetCurrentClass_trainingsession(event) {
+
+ var form = new FormData();
+
+ form.append("class_internal_url", classId);
+
+ form.append("token", stored_partner);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetActiveSessionFormation_List/";
+
+ axios.post(myurl, form).then(res => {
+ //console.log(" In GetCurrentClass_trainingsession res.data.status = " + res.data.status);
+ // console.log(" In GetCurrentClass_trainingsession res.data.message r_class = " + res.data.message);
+
+ if (String(res.data.status) === String("true")) {
+ //console.log(" In GetCurrentClass_trainingsession res.data.status = " + res.data.status);
+ //console.log(" In GetCurrentClass_trainingsession res.data.message r_class = " + res.data.message);
+ setGetCurrentClass_api("true");
+ setGetCurrentClass_result(res.data.message);
+
+ }
+ else {
+ setGetCurrentClass_api("false");
+ setGetCurrentClass_message(res.data.message);
+ }
+
+ }).catch((error) => {
+ console.warn('Not good man :( GetCurrentClass_trainingsession = ', error);
+ setGetCurrentClass_api("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+ const handleAccountCreation = () => {
+ history.push("/create_account")
+ };
+
+ const handleAccountConnexion = () => {
+ history.push("/Connexion")
+ };
+
+ function handleAccountLogout() {
+
+ if (String(userconnected) === String("1")) {
+ user_logout();
+ }
+ else if (String(partnerconnected) === String("1")) {
+ part_logout();
+ }
+ }
+
+
+ function part_logout_confirmation() {
+ /* si c'est une connexion partner qui est active */
+ if (typeof (stored_part) != "undefined") {
+ setCookie_part("tokenmysypart", "", { path: '/' });
+ }
+ history.push("/recherche-formation");
+ }
+
+ function part_logout() {
+ confirmAlert({
+ title: '',
+ message: 'Confirmez la deconnexion (pro)',
+ buttons: [
+ {
+ label: 'Oui',
+ onClick: () => part_logout_confirmation()
+ },
+ {
+ label: 'Non',
+ onClick: () => { return }
+ }
+ ]
+ });
+ }
+
+
+ function user_logout_confirmation() {
+ /* si c'est une connexion partner qui est active */
+ if (typeof (stored_user) != "undefined") {
+ setCookie("tokenmysych", "");
+ }
+ history.push("/recherche-formation");
+ }
+
+ function user_logout() {
+ confirmAlert({
+ title: '',
+ message: 'Confirmez la deconnexion (user)',
+ buttons: [
+ {
+ label: 'Oui',
+ onClick: () => user_logout_confirmation()
+ },
+ {
+ label: 'Non',
+ onClick: () => { return }
+ }
+ ]
+ });
+ }
+
+
+ function Close_info_form() {
+ setinscritpion("");
+
+ {/*
+ document.getElementById('mob_block_cross_sell_cat').style.display = "flex";
+ if (window.screen.width < 601) {
+ var meme_orga_top = document.getElementById('mob_block_cross_sell_cat').style.top;
+ var displaydetailclass_new_v2_hei = document.getElementById('mobile').style.height;
+ var sticky_div_hilight_top = document.getElementById('sticky_div_hilight_pave').style.top;
+
+ var new_meme_orga_top = parseInt(meme_orga_top) - 900;
+ var new_displaydetailclass_new_v2_hei = parseInt(displaydetailclass_new_v2_hei) - 900;
+ var new_sticky_div_hilight_top = parseInt(sticky_div_hilight_top) - 900;
+
+
+ document.getElementById('mob_block_cross_sell_cat').style.top = new_meme_orga_top + "px";
+ document.getElementById('mobile').style.height = new_displaydetailclass_new_v2_hei + "px";
+ document.getElementById('sticky_div_hilight_pave').style.top = new_sticky_div_hilight_top + "px";
+
+
+ }
+
+
+ else if (window.screen.width >= 601 && window.screen.width <= 991) {
+ var meme_orga_top = document.getElementById('block_crossell_meme_orga').style.top;
+ var displaydetailclass_new_v2_hei = document.getElementById('desktop').style.height;
+ var new_meme_orga_top = parseInt(meme_orga_top) - 900;
+ var new_displaydetailclass_new_v2_hei = parseInt(displaydetailclass_new_v2_hei) - 900;
+
+ document.getElementById('block_crossell_meme_orga').style.top = new_meme_orga_top + "px";
+ document.getElementById('desktop').style.height = new_displaydetailclass_new_v2_hei + "px";
+
+ }
+ else if (window.screen.width >= 992 && window.screen.width <= 1199) {
+ var meme_orga_top = document.getElementById('block_crossell_meme_orga').style.top;
+ var displaydetailclass_new_v2_hei = document.getElementById('desktop').style.height;
+ var new_meme_orga_top = parseInt(meme_orga_top) - 500;
+ var new_displaydetailclass_new_v2_hei = parseInt(displaydetailclass_new_v2_hei) - 500;
+
+ document.getElementById('block_crossell_meme_orga').style.top = new_meme_orga_top + "px";
+ document.getElementById('desktop').style.height = new_displaydetailclass_new_v2_hei + "px";
+ }
+ else if (window.screen.width >= 1200) {
+ var meme_orga_top = document.getElementById('block_crossell_meme_orga').style.top;
+ var displaydetailclass_new_v2_hei = document.getElementById('desktop').style.height;
+ var new_meme_orga_top = parseInt(meme_orga_top) - 500;
+ var new_displaydetailclass_new_v2_hei = parseInt(displaydetailclass_new_v2_hei) - 500;
+
+ document.getElementById('block_crossell_meme_orga').style.top = new_meme_orga_top + "px";
+ document.getElementById('desktop').style.height = new_displaydetailclass_new_v2_hei + "px";
+
+
+ }
+ */}
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ }
+
+ function Close_inscrip_form() {
+ setinscritpion();
+ {/* document.getElementById('mob_block_cross_sell_cat').style.display = "flex";
+
+ if (window.screen.width < 601) {
+ var meme_orga_top = document.getElementById('mob_block_cross_sell_cat').style.top;
+ var displaydetailclass_new_v2_hei = document.getElementById('mobile').style.height;
+ var sticky_div_hilight_top = document.getElementById('sticky_div_hilight_pave').style.top;
+
+ var new_meme_orga_top = parseInt(meme_orga_top) - 900;
+ var new_displaydetailclass_new_v2_hei = parseInt(displaydetailclass_new_v2_hei) - 900;
+ var new_sticky_div_hilight_top = parseInt(sticky_div_hilight_top) - 900;
+
+ document.getElementById('mob_block_cross_sell_cat').style.top = new_meme_orga_top + "px";
+ document.getElementById('mobile').style.height = new_displaydetailclass_new_v2_hei + "px";
+ document.getElementById('sticky_div_hilight_pave').style.top = new_sticky_div_hilight_top + "px";
+ }
+ else if (window.screen.width >= 601 && window.screen.width <= 991) {
+ var meme_orga_top = document.getElementById('block_crossell_meme_orga').style.top;
+ var displaydetailclass_new_v2_hei = document.getElementById('desktop').style.height;
+ var new_meme_orga_top = parseInt(meme_orga_top) - 900;
+ var new_displaydetailclass_new_v2_hei = parseInt(displaydetailclass_new_v2_hei) - 900;
+
+ document.getElementById('block_crossell_meme_orga').style.top = new_meme_orga_top + "px";
+ document.getElementById('desktop').style.height = new_displaydetailclass_new_v2_hei + "px";
+
+ }
+ else if (window.screen.width >= 992 && window.screen.width <= 1199) {
+ var meme_orga_top = document.getElementById('block_crossell_meme_orga').style.top;
+ var displaydetailclass_new_v2_hei = document.getElementById('desktop').style.height;
+ var new_meme_orga_top = parseInt(meme_orga_top) - 500;
+ var new_displaydetailclass_new_v2_hei = parseInt(displaydetailclass_new_v2_hei) - 500;
+
+ document.getElementById('block_crossell_meme_orga').style.top = new_meme_orga_top + "px";
+ document.getElementById('desktop').style.height = new_displaydetailclass_new_v2_hei + "px";
+ }
+ else if (window.screen.width >= 1200) {
+ var meme_orga_top = document.getElementById('block_crossell_meme_orga').style.top;
+ var displaydetailclass_new_v2_hei = document.getElementById('desktop').style.height;
+ var new_meme_orga_top = parseInt(meme_orga_top) - 500;
+ var new_displaydetailclass_new_v2_hei = parseInt(displaydetailclass_new_v2_hei) - 500;
+
+ document.getElementById('block_crossell_meme_orga').style.top = new_meme_orga_top + "px";
+ document.getElementById('desktop').style.height = new_displaydetailclass_new_v2_hei + "px";
+
+
+ }
+
+*/}
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ }
+
+
+ const [expanded, setExpanded] = React.useState(false);
+
+ const handleChange = (panel) => (event, isExpanded) => {
+ setExpanded(isExpanded ? panel : false);
+ };
+
+ const myRef_informe = useRef(null)
+
+ const [Dialog_contact_message, setDialog_contact_message] = React.useState(false);
+ const [Dialog_contact_open, setDialog_contact_open] = React.useState(false);
+ function Dialog_contact_handle_change_participant_session(message) {
+ setDialog_contact_message(message);
+ setDialog_contact_open(true);
+ }
+
+ const Dialog_contact_handleClose = () => {
+
+ };
+
+ const Dialog_contact_handleClose_buton = () => {
+
+ setDialog_contact_open(false);
+ clear_contact_message_fields();
+
+ };
+
+ const [contact_message_nom_prenom, setcontact_message_nom_prenom] = React.useState("");
+ const [contact_message_email, setcontact_message_email] = React.useState("");
+ const [contact_message_phone, setcontact_message_phone] = React.useState("");
+ const [contact_message_sujet, setcontact_message_sujet] = React.useState("");
+ const [contact_message_message, setcontact_message_message] = React.useState("");
+
+ function clear_contact_message_fields() {
+ setcontact_message_nom_prenom("");
+ setcontact_message_email("");
+ setcontact_message_phone("");
+ setcontact_message_sujet("");
+ setcontact_message_sujet("");
+ setcontact_message_message("");
+ }
+
+ function Send_Contact_Message(e) {
+
+ var sender_mail = "";
+ var sender_tel = "";
+ var token = "";
+
+ ////console.log("contacter " + sender_mail + " - " + sender_tel + " - ")
+
+ var mysubject = contact_message_sujet;
+ var mymessage = contact_message_message;
+ var mysender_name = contact_message_nom_prenom;
+ var mysender_email = contact_message_email;
+
+
+ //alert("contacter "+mysender_email+" - "+mymessage+" - url = "
+ //+process.env.REACT_APP_API_URL+" - user_ip ="+IPv4+" - "+latitude);
+
+ var re = /\S+@\S+\.\S+/;
+ if (re.test(mysender_email) == false) {
+ alert("l'email est incorrecte");
+ return;
+ }
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/add_user_message/";
+ var form = new FormData();
+ form.append("type", "email");
+ form.append("recever_mail", "contact@mysy-training.com");
+ form.append("recever_tel", "+33769203945");
+ form.append("sender_mail", mysender_email);
+ form.append("sender_tel", sender_tel);
+ form.append("object", mysubject);
+ form.append("message", mymessage);
+ form.append("sender_name", mysender_name);
+ form.append("token", "");
+ form.append("user_ip", IPv4);
+ form.append("user_country_code", country_code);
+ form.append("user_country_name", country_name);
+ form.append("user_city", city);
+ form.append("user_postal", postal);
+ form.append("user_latitude", latitude);
+ form.append("user_longitude", longitude);
+ form.append("user_state", state);
+
+
+ // console.log("## form = ", form);
+
+
+
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) === String("false")) {
+
+ alert(res.data.message);
+ }
+
+ else if (String(res.data.status) === String("true")) {
+ Dialog_contact_handleClose_buton();
+ alert(res.data.message);
+
+ }
+ else {
+
+ }
+ }).catch((error) => {
+ console.warn('contact-nous Not good man :( mysearchtext = ');
+
+ })
+ }
+
+
+ const [Download_one_attached_document_no_token_api, setDownload_one_attached_document_no_token_api] = useState();
+ const [Download_one_attached_document_no_token_result, setDownload_one_attached_document_no_token_result] = useState();
+ const [Download_one_attached_document_no_token_message, setDownload_one_attached_document_no_token_message] = useState();
+
+ const Download_one_attached_document_no_token = (event) => {
+
+ var nom_fiche_detaillee = "Fiche_catalogue.pdf";
+ var file_name = event.target.id;
+
+
+ var url = process.env.REACT_APP_API_URL + "myclass/api/Get_Stored_Downloaded_File_From_Id_WITHOUT_TOKEN/" + file_name;
+
+ //console.log(" ### url = ", url);
+
+
+ axios.get(url, { responseType: 'blob', },)
+ .then((res) => {
+ fileDownload(res.data, nom_fiche_detaillee);
+ setDownload_one_attached_document_no_token_api("true");
+ }).catch((error) => {
+ console.error('Error:', error);
+ setDownload_one_attached_document_no_token_api("false");
+
+ });
+ }
+
+
+
+ /// ----
+ return (
+
+
+
+
+
+
+
+ {`${DetailTraining["title"]}`}
+
+
+ {/*** GESTION Contact */}
+
+ {/*** FIN GESTION Contact */}
+
+
+
+
+
+
+
+
+
+
+
+ {DetailTraining["title"]}
+
+
+
+
+
+
+
+
+
+
+
+
+ {String(ismetiermanaged) !== "0" && String(ismetiermanaged) !== "1" &&
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("it") &&
+

}
+
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("graphisme") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("management") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("digital") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("office") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("rh") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("vente") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("dev_perso") &&
+

}
+
+
+
+
}
+
+ {String(ismetiermanaged) === "0" &&
+

+
+
}
+
+ {String(ismetiermanaged) === "1" &&
+

+
}
+
+
+
+
+
+ {String(DetailTraining["price"]) && String(DetailTraining["price"]) === String("0") &&
+
+
Gratuit
+
+
Eligible CPF
+
+
+ }
+
+ {String(DetailTraining["price"]) && String(DetailTraining["price"]) !== String("0") && String(DetailTraining["price"]) === String("0") && (!DetailTraining.business_prices || Object.keys(DetailTraining.business_prices).length <= 0)
+ && DetailTraining["price"] &&
+
+
+ {parseFloat(String(DetailTraining["partnaire_tva"])) > 0 && <> {String(DetailTraining["price"])} € HT >}
+ {parseFloat(String(DetailTraining["partnaire_tva"])) <= 0 && <> {String(DetailTraining["price"])} € TTC >}
+
+
+
}
+
+ {String(DetailTraining["price"]) && String(DetailTraining["price"]) !== String("0") && DetailTraining.business_prices && Object.keys(DetailTraining.business_prices).length > 0
+ && DetailTraining["price"] &&
+
+
+
+ {parseFloat(String(DetailTraining["partnaire_tva"])) > 0 && <> {String(DetailTraining.business_prices[0].discounted_price)} € HT >}
+ {parseFloat(String(DetailTraining["partnaire_tva"])) <= 0 && <> {String(DetailTraining.business_prices[0].discounted_price)} € TTC >}
+
+
+
+
+ {DetailTraining.business_prices && DetailTraining.business_prices.length > 0 &&
+
+
+ {parseFloat(String(DetailTraining["partnaire_tva"])) > 0 && <> {String(DetailTraining["price"])} € HT >}
+ {parseFloat(String(DetailTraining["partnaire_tva"])) <= 0 && <> {String(DetailTraining["price"])} € TTC >}
+
+
+
+ (- {String(DetailTraining.business_prices[0].discount)} % )
+
}
+
}
+
+
+
+
+ {String(action).toLowerCase() !== "information" && String(action).toLowerCase() !== "inscription" &&
+
+
+
+
+
+
+
+ M'informer
+
+
+
+
+
+
+
}
+
+
+
+
+
+
+
+ Caractéristiques
+
+
+
+
+
+
+
+
+
+
+ A Distance
+
+
+
+
+ {DetailTraining.presentiel && DetailTraining.presentiel.distantiel === "1" && " Oui "}
+ {DetailTraining.presentiel && DetailTraining.presentiel.distantiel === "0" && " Non "}
+
+
+
+
+
+
+
+
+
+
+ Présentiel
+
+
+
+
+ {DetailTraining.presentiel && DetailTraining.presentiel.presentiel === "1" && " Oui "}
+ {DetailTraining.presentiel && DetailTraining.presentiel.presentiel === "0" && " Non "}
+
+
+
+
+
+
+
+
+
+
+ Durée
+
+
+
+ {String(DetailTraining["duration_unit"]) !== "user_rythme" &&
+
+ {DetailTraining["duration"]} {DetailTraining["duration_unit"]}(s)
+
+ }
+
+ {String(DetailTraining["duration_unit"]) === "user_rythme" &&
+
+ A votre rythme
+
+ }
+
+
+
+
+
+
+
+
+ Certification
+
+
+
+
+
+ {DetailTraining["certif"] && String(DetailTraining["certif"]) !== String("1") && " Non "
+ }
+ {DetailTraining["certif"] && String(DetailTraining["certif"]) === String("1") && " Oui "
+ }
+
+
+
+
+
+
+
+
+
+
+ Support
+
+
+
+
+
+ {DetailTraining["support"] && {String(DetailTraining["support"]).charAt(0).toUpperCase() + String(DetailTraining["support"]).slice(1)} }
+ {!DetailTraining["support"] && "Non précisé"}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Organisme de formation
+
+
+
+ {partnair_name && {
+ e.preventDefault();
+ window.open(
+ website_partenaire,
+ '_blank'
+ );
+
+ }}
+ > {partnair_name} }
+
+
+
+
+
+
+

+
+
+
+
+

+
+
+
+
+

+
+
+
+
+
+
+
+
+
+ < nav ref={myRef_informe} id="myRef_informe">
+
+ {(String(inscritpion) === "2" || String(inscritpion) === "1") &&
+
}
+
+
+
+
+
+
+
+
+
+
+
+ {GetCurrentClass_result && GetCurrentClass_result.length > 0 &&
+
+
+
+ Les sessions
+
+
+
+
+
+
+ {GetCurrentClass_result && GetCurrentClass_result.slice(0, 5).map((formation) => (
+ -
+ {(JSON.parse(formation).session_ondemande) && (JSON.parse(formation).session_ondemande) === "1" && Sessions de formation à la demande ({(JSON.parse(formation).code_session).substring(0, 15)})}
+
+ {(!(JSON.parse(formation).session_ondemande) || (JSON.parse(formation).session_ondemande) === "0") &&
+ {(JSON.parse(formation).mode_animation) === "2" &&
+ (JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
+
+ {(JSON.parse(formation).date_debut).substring(0, 10)} au
+ {(JSON.parse(formation).date_fin).substring(0, 10)}
+
+ Animation Hybride
+
+ - {(JSON.parse(formation).adresse)} {(JSON.parse(formation).code_postal)}
+
+ }
+
+ {(JSON.parse(formation).mode_animation) === "2" &&
+ (JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
+
+ Le
+ {(JSON.parse(formation).date_fin).substring(0, 10)}
+
+ Animation Hybride
+
+ - {(JSON.parse(formation).adresse)} {(JSON.parse(formation).code_postal)}
+
+ }
+
+
+
+ {(JSON.parse(formation).mode_animation) === "1" &&
+ (JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
+
+ {(JSON.parse(formation).date_debut).substring(0, 10)} au
+ {(JSON.parse(formation).date_fin).substring(0, 10)} A Distance
+ }
+
+ {(JSON.parse(formation).mode_animation) === "1" &&
+ (JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
+
+ Le
+ {(JSON.parse(formation).date_fin).substring(0, 10)} A Distance
+ }
+
+
+ {(JSON.parse(formation).mode_animation) === "0" &&
+ (JSON.parse(formation).date_debut).substring(0, 10) !== (JSON.parse(formation).date_fin).substring(0, 10) &&
+
+ {(JSON.parse(formation).date_debut).substring(0, 10)} au {(JSON.parse(formation).date_fin).substring(0, 10)} En Présentiel -
+ {(JSON.parse(formation).adresse)} {(JSON.parse(formation).code_postal)}
+ }
+
+ {(JSON.parse(formation).mode_animation) === "0" &&
+ (JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
+
+ Le {(JSON.parse(formation).date_fin).substring(0, 10)} En Présentiel -
+ {(JSON.parse(formation).adresse)} {(JSON.parse(formation).code_postal)}
+ }
+
+ }
+
+
+ ))}
+
+
+
+
+
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Objectif
+
+
+ {DetailTraining["objectif"] &&
+ {parse(String(DetailTraining["objectif"]))}
+
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Programme
+
+
+ {DetailTraining["programme"] &&
+ {parse(String(DetailTraining["programme"]))}sticky_div_hilight
+
+ }
+
+
+
+
+
+
+
+
+ {DetailTraining["tab_ue_detail_data"] && DetailTraining["tab_ue_detail_data"].length > 0 && < div className="mob_info_page_title_desc_long_txt" >
+
+ Modules
+
+
+
+ {DetailTraining["tab_ue_detail_data"] &&
+
+
+ {DetailTraining["tab_ue_detail_data"] && DetailTraining["tab_ue_detail_data"].map((val) => (
+
+
+
+ }
+ aria-controls={val._id}
+ id={val._id}
+ >
+
+
+ {val.titre}
+
+
+
+
+ {parse(String(val.description).replace(/(<([^>]+)>)/ig, ''))}
+
+
+
+
+
+
+
+ ))}
+
+
+
}
+
+
}
+
+
+
+
+
+ {DetailTraining["pourqui"] &&
+
+
+ Pour Qui
+
+
+ {DetailTraining["pourqui"] &&
+ {parse(String(DetailTraining["pourqui"]))}
+
+ }
+
+
}
+
+
+
+
+
+
+
+
+ {DetailTraining["prerequis"] &&
+
+
+ Pré-requis
+
+
+ {DetailTraining["prerequis"] &&
+ {parse(String(DetailTraining["prerequis"]))}
+
+ }
+
+
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {associatedtraining_message && associatedtraining_message.length > 0 &&
+
+ Cela pourrait aussi vous intéresser
+
}
+
+
+
+ {associatedtraining_message && String(associatedtraining_api) === "True" &&
+ associatedtraining_message.slice(0, 3).map((formation) => (
+
+
+
+
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("it") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("graphisme") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("management") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("digital") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("office") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("rh") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("vente") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("sport") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("sante_nat") &&
+

}
+
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("dev_perso") &&
+

}
+
+ {!JSON.parse(formation).metier &&

}
+
+
+
+
+
+ {JSON.parse(formation).cpf && (String(JSON.parse(formation).cpf)) === "1" &&
+ "Éligible au CPF"}
+
+ {!JSON.parse(formation).cpf || String(JSON.parse(formation).cpf) !== "1" &&
+ "NON Éligible au CPF"}
+
+
+
+
+
+
+
+
+
+ {JSON.parse(formation).note && String(JSON.parse(formation).note).length === 1 &&
+ parseInt(String(JSON.parse(formation).note)) <= 5 &&
+ }
+
+
+
+ {parse(String(JSON.parse(formation).title))}
+
+
+ {JSON.parse(formation).price &&
+
+ {parseFloat(String(JSON.parse(formation).partnaire_tva)) > 0 && <>{(String(JSON.parse(formation).price))} € HT >}
+ {parseFloat(String(JSON.parse(formation).partnaire_tva)) <= 0 && <>{(String(JSON.parse(formation).price))} € TTC >}
+
+
+
}
+
+
+
+
+
+
+
{
+ e.preventDefault();
+ //test(props.formation.external_code);
+ window.open(
+ "/Display-Detail-formation/" + JSON.parse(formation).internal_url,
+ '_self'
+ );
+
+
+ }}>
+
+ Voir les détails
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {ratingvalue && String(ratingvalue).length > 0 &&
+ parseFloat(String(ratingvalue)) <= 5 &&
+ }
+
+
+
+ {DetailTraining["title"]}
+
+
+
+
+
+ {DetailTraining["cpf"] && String(DetailTraining["cpf"]) === "1" &&
+ "Éligible au CPF"}
+
+ {!DetailTraining["cpf"] || String(DetailTraining["cpf"]) !== "1" &&
+ "NON Éligible au CPF"}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
}
+
+
+
+ {DetailTraining["pourqui"] && String(DetailTraining["pourqui"]).length > 2 &&
+
+ Pour Qui
+
+ {DetailTraining["pourqui"] &&
+ {parse(String(DetailTraining["pourqui"]))}
+
+
+
+ }
+
}
+
+
+
+ {DetailTraining["prerequis"] && String(DetailTraining["prerequis"]).length > 2 &&
+
+ Pré-requis
+
+ {DetailTraining["prerequis"] &&
+ {parse(String(DetailTraining["prerequis"]))}
+
+
+
+
+ }
+
}
+
+
+
+
+ {DetailTraining["plus_produit"] && String(DetailTraining["plus_produit"]).length > 2 &&
+
+ Points forts
+
+ {DetailTraining["plus_produit"] &&
+ {parse(String(DetailTraining["plus_produit"]))}
+
+
+
+
+ }
+
}
+
+
+
+
+
+
+
+
+ {/****** Stick droire */}
+
+
+
+
+
+
+
+ {class_img_stored_in_bdd && String(class_img_stored_in_bdd).length > 50 &&
+
+

+
+ }
+
+ {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && String(ismetiermanaged) !== "0" && String(ismetiermanaged) !== "1" &&
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("it") &&
+

}
+
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("graphisme") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("management") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("digital") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("office") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("rh") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("vente") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("sport") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("sante_nat") &&
+

}
+
+ {(!DetailTraining.img_url || String(DetailTraining.img_url).length <= 0) &&
+ DetailTraining.metier && String(DetailTraining.metier).toLocaleLowerCase() === String("dev_perso") &&
+

}
+
+
+
}
+
+ {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && String(ismetiermanaged) === "0" &&
+

+
+
}
+
+ {(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && String(ismetiermanaged) === "1" &&
+

+
+
}
+
+
+
+
+ {String(DetailTraining["price"]) && String(DetailTraining["price"]) === String("0") &&
+
+
Gratuit
+
+
+ {DetailTraining["cpf"] && String(DetailTraining["cpf"]) === "1" &&
Éligible CPF
}
+ {(!DetailTraining["cpf"] || String(DetailTraining["cpf"]) !== "1") &&
Non Élig. CPF
}
+
+ }
+
+ {String(DetailTraining["price"]) && String(DetailTraining["price"]) !== String("0") && (!DetailTraining.business_prices || Object.keys(DetailTraining.business_prices).length <= 0)
+ && DetailTraining["price"] &&
+
+
+
+ {parseFloat(String(DetailTraining["partnaire_tva"])) > 0 && <> {String(DetailTraining["price"])} € HT >}
+ {parseFloat(String(DetailTraining["partnaire_tva"])) <= 0 && <> {String(DetailTraining["price"])} € TTC >}
+
+
+ {DetailTraining["cpf"] && String(DetailTraining["cpf"]) === "1" &&
Éligible CPF
}
+ {(!DetailTraining["cpf"] || String(DetailTraining["cpf"]) !== "1") &&
Non Élig. CPF
}
+
+
+
+
}
+
+ {String(DetailTraining["price"]) && String(DetailTraining["price"]) !== String("0") && DetailTraining.business_prices && Object.keys(DetailTraining.business_prices).length > 0
+ && DetailTraining["price"] &&
+
+
+
+
+ {parseFloat(String(DetailTraining["partnaire_tva"])) > 0 && <> {String(DetailTraining.business_prices[0].discounted_price)} € HT >}
+ {parseFloat(String(DetailTraining["partnaire_tva"])) <= 0 && <> {String(DetailTraining.business_prices[0].discounted_price)} € TTC >}
+
+
+
+
+
Eligle CFP
+
+
+ {DetailTraining.business_prices && DetailTraining.business_prices.length > 0 &&
+
+
+ {parseFloat(String(DetailTraining["partnaire_tva"])) > 0 && <> {String(DetailTraining["price"])} € HT >}
+ {parseFloat(String(DetailTraining["partnaire_tva"])) <= 0 && <> {String(DetailTraining["price"])} € TTC >}
+
+
+ (- {String(DetailTraining.business_prices[0].discount)} % )
+
}
+
+
}
+
+
+
+
Caractéristiques
+
+
+
+
+
+
+
+
+
+
+
+ Durée
+
+
+
+
+ {String(DetailTraining["duration_unit"]) !== "user_rythme" &&
+
+ {DetailTraining["duration"]} {DetailTraining["duration_unit"]}(s)
+
+
+ }
+
+ {String(DetailTraining["duration_unit"]) === "user_rythme" &&
+
+ VR
+
+
+ }
+
+
+
+
+
+
+
+
+ Certification
+
+
+
+
+
+
+ {DetailTraining["certif"] && String(DetailTraining["certif"]) !== String("1") &&
+
+ Non
+ }
+ {DetailTraining["certif"] && String(DetailTraining["certif"]) === String("1") &&
+
+ Oui
+ }
+
+
+
+
+
+
+
+
+
+
+
+ Distanciel
+
+
+
+
+ {DetailTraining.presentiel && DetailTraining.presentiel.distantiel === "1" &&
Oui
}
+ {DetailTraining.presentiel && DetailTraining.presentiel.distantiel !== "1" &&
Non
}
+
+
+
+
+
+
+
+
+
+
+
+ Présentiel
+
+
+
+
+ {DetailTraining.presentiel && DetailTraining.presentiel.presentiel === "1" &&
Oui
}
+ {DetailTraining.presentiel && DetailTraining.presentiel.presentiel !== "1" &&
Non
}
+
+
+
+
+
+
+
+
+
+
+ Support
+
+
+
+ {DetailTraining["support"] &&
+
+ {String(DetailTraining["support"]).charAt(0).toUpperCase() + String(DetailTraining["support"]).slice(1)}
+ }
+ {!DetailTraining["support"] &&
+
+ Non précisé
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {String(action).toLowerCase() !== "information" && String(action).toLowerCase() !== "inscription" &&
}
+
+
+ {String(isqualiopi) === "1" &&
+
+
+

+
+
+
}
+ {String(isqualiopi) === "1" &&
}
+
+ {String(isdatadock) === "1" &&
+
+

+
+
+
+
}
+ {String(isdatadock) === "1" &&
}
+
+
+ {String(iscertifvoltaire) === "1" &&
+

+
+
}
+
+
+
+
+
+
+
+
+
+ Organisme de formation
+
+
+
+
+ {partnair_name && {
+ e.preventDefault();
+ window.open(
+ website_partenaire,
+ '_blank'
+ );
+
+ }}
+ > {partnair_name} }
+
+
+
+
+
+
+
+
+

+
+
+
+

+
+
+
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {associatedtraining_message && String(associatedtraining_api) === "True" && associatedtraining_message.length > 0 &&
+
Cela pourrait aussi vous intéresser
}
+
+
+ {associatedtraining_message && String(associatedtraining_api) === "True" &&
+ associatedtraining_message.slice(0, 3).map((formation) => (
+
+
+
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("it") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("graphisme") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("management") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("digital") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("office") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("rh") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("vente") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("sport") &&
+

}
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("sante_nat") &&
+

}
+
+
+ {JSON.parse(formation).metier && String(JSON.parse(formation).metier).toLocaleLowerCase() === String("dev_perso") &&
+

}
+
+ {!JSON.parse(formation).metier &&

}
+
+
+
+
+
+
+ {JSON.parse(formation).cpf && (String(JSON.parse(formation).cpf)) === "1" &&
+
+ Éligible CPF
}
+
+ {!JSON.parse(formation).cpf || String(JSON.parse(formation).cpf) !== "1" &&
+
+ NON Éligible CPF
}
+
+
+
+
+
+
+
+
+ {JSON.parse(formation).note && String(JSON.parse(formation).note).length >= 1 &&
+ parseInt(String(JSON.parse(formation).note)) <= 5 &&
+
+ }
+
+
+
{parse(String(JSON.parse(formation).title)).substring(0, 50)}
+
+
+ {JSON.parse(formation).price &&
+
+ {parseFloat(String(JSON.parse(formation).partnaire_tva)) > 0 && <>{(String(JSON.parse(formation).price))} € HT >}
+ {parseFloat(String(JSON.parse(formation).partnaire_tva)) <= 0 && <>{(String(JSON.parse(formation).price))} € TTC >}
+
}
+
+
+
+
+
+
+
+
{
+ e.preventDefault();
+ //test(props.formation.external_code);
+ window.open(
+ "/Display-Detail-formation/" + JSON.parse(formation).internal_url,
+ '_self'
+ );
+
+
+ }}>
+
+ Voir les détails
+
+
+
+
+
+
+
+
+ ))}
+
+
+
+
+
+
+ )
+}
+
+
+export default New_C_Detail_Formation_2025;
\ No newline at end of file
diff --git a/src/components/detail_formation_automatic_files/new_detail_formation_2025.js b/src/components/detail_formation_automatic_files/new_detail_formation_2025.js
index 1369242..a132d85 100644
--- a/src/components/detail_formation_automatic_files/new_detail_formation_2025.js
+++ b/src/components/detail_formation_automatic_files/new_detail_formation_2025.js
@@ -146,7 +146,7 @@ const New_C_Detail_Formation_2025 = (props) => {
})
}
-
+ const [mytrainingdirectinscription, setmytrainingpreinscription] = useState("");
useEffect(() => {
async function funclocaltoken() {
@@ -550,6 +550,14 @@ const New_C_Detail_Formation_2025 = (props) => {
}
+ if (JSON.parse(res.data.message).inscription_direct) {
+ setmytrainingpreinscription(JSON.parse(res.data.message).inscription_direct);
+ } else {
+ setmytrainingpreinscription("");
+ }
+
+
+
if (JSON.parse(res.data.message).isdatadock) {
setisdatadock(JSON.parse(res.data.message).isdatadock);
}
@@ -1776,13 +1784,15 @@ const New_C_Detail_Formation_2025 = (props) => {
{String(inscritpion) === "2" &&
+ Close_info_form={Close_info_form} trainig_price={class_sales_price} inscritpion={inscritpion}
+ mytrainingdirectinscription={mytrainingdirectinscription} />
}
{String(inscritpion) === "1" &&
+ Close_info_form={Close_inscrip_form} trainig_price={class_sales_price} inscritpion={inscritpion}
+ mytrainingdirectinscription={mytrainingdirectinscription} />
@@ -2238,17 +2248,20 @@ const New_C_Detail_Formation_2025 = (props) => {