-
-
{String(add_one_suivi_ped) === "1" && String(display_given_suivi_ped) !== "1" &&
Nouveau suivi pédagogique
diff --git a/src/components/Config_Champs_Personnalise.js b/src/components/Config_Champs_Personnalise.js
index 50a1871..8dd02f8 100644
--- a/src/components/Config_Champs_Personnalise.js
+++ b/src/components/Config_Champs_Personnalise.js
@@ -4,32 +4,20 @@ import MenuItem from '@mui/material/MenuItem';
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
import Button from '@mui/material/Button';
import axios from "axios";
-import { getCookie, setCookie } from 'react-use-cookie';
+import { getCookie } from 'react-use-cookie';
import { useHistory } from "react-router-dom";
-import CheckOut from "./CheckOut";
+
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
import "react-draft-wysiwyg/dist/react-draft-wysiwyg.css";
-import { Editor } from '@tinymce/tinymce-react';
-import parse from 'html-react-parser';
-import { FcViewDetails, FcDisapprove } from "react-icons/fc";
+import Autocomplete from '@mui/material/Autocomplete';
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
-import add_plus from "../mysy_img/plus.png";
-import excel_icone from "../mysy_img/excel_icone.png";
-import participants from "../mysy_img/participants.png";
-import fileDownload from 'js-file-download'
import Popup from 'reactjs-popup';
import 'reactjs-popup/dist/index.css';
-import { FcCancel, FcApproval, FcAcceptDatabase, FcPrint } from "react-icons/fc";
-import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
-import { format } from 'date-fns'
-import moment from "moment";
import InputAdornment from '@mui/material/InputAdornment';
import { AiFillCloseCircle } from "react-icons/ai";
import Box from '@mui/material/Box';
-import { Typography, LinearProgress } from '@mui/material';
-import styled from 'styled-components';
import { CiTrash } from "react-icons/ci";
import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md";
import Dialog from '@mui/material/Dialog';
@@ -37,12 +25,9 @@ import DialogActions from '@mui/material/DialogActions';
import DialogContent from '@mui/material/DialogContent';
import DialogContentText from '@mui/material/DialogContentText';
import DialogTitle from '@mui/material/DialogTitle';
-import { TransitionProps } from '@mui/material/transitions';
-import { IoAddCircleOutline, IoCloseCircleOutline } from "react-icons/io5";
+import { IoAddCircleOutline } from "react-icons/io5";
import { gridClasses } from '@mui/x-data-grid';
-
import Module_Alert_Confirmation from "./Module_Alert_Confirmation";
-
import CancelPresentationIcon from '@mui/icons-material/CancelPresentation';
import { makeStyles } from "@material-ui/core/styles";
import Paper from '@material-ui/core/Paper';
@@ -588,6 +573,8 @@ const Config_Champs_Personnalise = (props) => {
})
}
+ const [New_Get_Obj_Metier_Eligible_Cham_Spe_result, setNew_Get_Obj_Metier_Eligible_Cham_Spe_result] = useState([]);
+
const [Get_Obj_Metier_Eligible_Cham_Spe_api, setGet_Obj_Metier_Eligible_Cham_Spe_api] = useState();
const [Get_Obj_Metier_Eligible_Cham_Spe_message, setGet_Obj_Metier_Eligible_Cham_Spe_message] = useState();
const [Get_Obj_Metier_Eligible_Cham_Spe_result, setGet_Obj_Metier_Eligible_Cham_Spe_result] = useState();
@@ -608,6 +595,37 @@ const Config_Champs_Personnalise = (props) => {
setGet_Obj_Metier_Eligible_Cham_Spe_api("true");
setGet_Obj_Metier_Eligible_Cham_Spe_result(res.data.message);
+ var new_data2 = [];
+ const new_data = res.data.message.map((x) => {
+
+ //---
+ var local_objet_metier = JSON.parse(x).objet_metier;
+ var local_nom = JSON.parse(x).nom;
+
+
+ //---
+ var node = {
+ "objet_metier": local_objet_metier,
+ "label": local_nom,
+ "local_nom": local_nom,
+ };
+ new_data2.push(node);
+ });
+
+ //---
+ var node = {
+ "objet_metier": "",
+ "label": "",
+ "local_nom": "",
+ };
+
+ new_data2.push(node);
+
+
+ if (new_data2.length > 0)
+ setNew_Get_Obj_Metier_Eligible_Cham_Spe_result(new_data2);
+
+
}
else {
setGet_Obj_Metier_Eligible_Cham_Spe_api("false");
@@ -635,8 +653,6 @@ const Config_Champs_Personnalise = (props) => {
Getall_Partner_Personalised_Fields_No_filter();
// myRef_head.current.scrollIntoView({ behavior: "smooth" });
-
-
window.scrollTo({
top: 0,
behavior: "smooth",
@@ -722,25 +738,12 @@ const Config_Champs_Personnalise = (props) => {
function Enable_Partner_PersonalFields() {
setpersonal_field_data_edit_mode("1");
- if (document.getElementsByName("field_name")[0]) {
- document.getElementsByName("field_name")[0].disabled = false;
- document.getElementsByName("field_name")[0].style.backgroundColor = "#FFFFFF";
- }
if (document.getElementsByName("field_label")[0]) {
document.getElementsByName("field_label")[0].disabled = false;
document.getElementsByName("field_label")[0].style.backgroundColor = "#FFFFFF";
}
- if (document.getElementsByName("related_collection")[0]) {
- document.getElementsByName("related_collection")[0].disabled = false;
- document.getElementsByName("related_collection")[0].style.backgroundColor = "#FFFFFF";
- }
-
- if (document.getElementsByName("field_type")[0]) {
- document.getElementsByName("field_type")[0].disabled = false;
- document.getElementsByName("field_type")[0].style.backgroundColor = "#FFFFFF";
- }
if (document.getElementsByName("is_mandatory")[0]) {
document.getElementsByName("is_mandatory")[0].disabled = false;
@@ -773,6 +776,19 @@ const Config_Champs_Personnalise = (props) => {
const [personal_field_data_edit_mode, setpersonal_field_data_edit_mode] = useState("");
+ function Annule_Add_One_specific_Fields() {
+ clear_detail_fields();
+ setpersonal_field_data_changed("");
+ setpersonal_field_data_edit_mode("");
+ setdisplay_personalised_field("");
+ setadd_one_personal_field("");
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
+
+ }
+
const [add_one_personal_field, setadd_one_personal_field] = React.useState();
function submenu_add_one_personal_field() {
@@ -788,6 +804,14 @@ const Config_Champs_Personnalise = (props) => {
setdisplay_personalised_field();
setadd_one_personal_field("1");
+ if (document.getElementById('myRef_detail')) {
+ var divh = document.getElementById('myRef_detail').offsetTop;
+ window.scrollTo({
+ top: divh,
+ behavior: "smooth",
+ });
+ }
+
}
@@ -795,37 +819,37 @@ const Config_Champs_Personnalise = (props) => {
const [p_detail_field_label, setp_detail_field_label] = useState("");
const [p_detail_related_collection, setp_detail_related_collection] = useState("");
const [p_detail_related_collection_name, setp_detail_related_collection_name] = useState("");
- const [p_detail_is_displayed, setp_detail_is_displayed] = useState("");
+ const [p_detail_is_displayed, setp_detail_is_displayed] = useState("0");
const [p_detail_is_displayed_label, setp_detail_is_displayed_label] = useState("");
- const [p_detail_is_public, setp_detail_is_public] = useState("");
+ const [p_detail_is_public, setp_detail_is_public] = useState("0");
const [p_detail_is_public_label, setp_detail_is_public_label] = useState("");
- const [p_detail_field_type, setp_detail_field_type] = useState("");
+ const [p_detail_field_type, setp_detail_field_type] = useState("string");
const [p_detail_field_type_label, setp_detail_field_type_label] = useState("");
- const [p_detail_is_mandatory, setp_detail_is_mandatory] = useState("");
+ const [p_detail_is_mandatory, setp_detail_is_mandatory] = useState("0");
const [p_detail_is_mandatory_label, setp_detail_is_mandatory_label] = useState("");
const [p_one_detail_field_name, setp_one_detail_field_name] = useState("");
const [p_one_detail_field_label, setp_one_detail_field_label] = useState("");
const [p_one_detail_related_collection, setp_one_detail_related_collection] = useState("");
- const [p_one_detail_is_displayed, setp_one_detail_is_displayed] = useState("");
- const [p_one_detail_is_public, setp_one_detail_is_public] = useState("");
+ const [p_one_detail_is_displayed, setp_one_detail_is_displayed] = useState("0");
+ const [p_one_detail_is_public, setp_one_detail_is_public] = useState("0");
const [p_one_detail_field_type, setp_one_detail_field_type] = useState("");
- const [p_one_detail_is_mandatory, setp_one_detail_is_mandatory] = useState("");
+ const [p_one_detail_is_mandatory, setp_one_detail_is_mandatory] = useState("0");
function clear_detail_fields() {
setp_detail_field_name("");
setp_detail_field_label();
setp_detail_related_collection("");
setp_detail_related_collection_name("");
- setp_detail_is_displayed("");
- setp_detail_is_public("");
- setp_detail_field_type("");
+ setp_detail_is_displayed("0");
+ setp_detail_is_public("0");
+ setp_detail_field_type("string");
setp_detail_field_type_label("");
- setp_detail_is_mandatory("");
+ setp_detail_is_mandatory("0");
setp_detail_is_mandatory_label("");
setp_detail_is_displayed_label("");
setp_detail_is_public_label("");
@@ -840,10 +864,10 @@ const Config_Champs_Personnalise = (props) => {
setp_one_detail_field_name("");
setp_one_detail_field_label();
setp_one_detail_related_collection("");
- setp_one_detail_is_displayed("");
- setp_one_detail_is_public("");
- setp_one_detail_field_type("");
- setp_one_detail_is_mandatory("");
+ setp_one_detail_is_displayed("0");
+ setp_one_detail_is_public("0");
+ setp_one_detail_field_type("string");
+ setp_one_detail_is_mandatory("0");
}
function Fermer_specific_Fields() {
@@ -852,6 +876,10 @@ const Config_Champs_Personnalise = (props) => {
clear_one_detail_fields();
setSelectionModel([]);
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
}
@@ -872,22 +900,34 @@ const Config_Champs_Personnalise = (props) => {
form.append("field_name", p_detail_field_name);
}
else {
- alert(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'");
+ // alert(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'");
+ setalert_type("error");
return;
}
if (!p_detail_field_name.startsWith('my_')) {
- alert(" Le nom technique du champ doit commencer impérativement par 'my_'");
+ // alert(" Le nom technique du champ doit commencer impérativement par 'my_'");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le nom technique du champ doit commencer impérativement par 'my_'");
+ setalert_type("error");
return;
}
if (String(p_detail_field_name).length < 6) {
- alert(" Le nom technique du champ doit au moins 6 caractères");
+ // alert(" Le nom technique du champ doit au moins 6 caractères");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le nom technique du champ doit au moins 6 caractères");
+ setalert_type("error");
return;
}
var tmp_val = String(p_detail_field_name).replaceAll("my_", "");
if (!tmp_val.match(/^[0-9a-z]+$/)) {
- alert(" Sur le nom technique, les information apres le 'my_' doit être alphanumerique. Vous avez saisi : " + String(tmp_val));
+ var txt = " Sur le nom technique, les information apres le 'my_' doit être alphanumerique. Vous avez saisi : " + String(tmp_val);
+ setdisplay_alert_mysy("1");
+ setalert_message(txt);
+ setalert_type("error");
return;
}
@@ -895,11 +935,17 @@ const Config_Champs_Personnalise = (props) => {
if (p_detail_field_label)
form.append("field_label", p_detail_field_label);
else {
- alert(" Vous devez definir le label du champ ");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir le label du champ ");
+ setalert_type("error");
return;
}
if (String(p_detail_field_label).length < 3) {
- alert(" Le label du champ doit faire au moins 3 caractères");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le label du champ doit faire au moins 3 caractères");
+ setalert_type("error");
return;
}
@@ -907,7 +953,10 @@ const Config_Champs_Personnalise = (props) => {
if (p_detail_related_collection)
form.append("related_collection", p_detail_related_collection);
else {
- alert(" Vous devez definir l'entité");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir l'entité");
+ setalert_type("error");
return;
}
@@ -915,7 +964,10 @@ const Config_Champs_Personnalise = (props) => {
if (p_detail_is_displayed)
form.append("is_displayed", p_detail_is_displayed);
else {
- alert(" Vous devez definir si le champ est affichable");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir si le champ est affichable");
+ setalert_type("error");
return;
}
@@ -929,7 +981,10 @@ const Config_Champs_Personnalise = (props) => {
if (p_detail_field_type)
form.append("field_type", p_detail_field_type);
else {
- alert(" Vous devez definir le type du champ");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir le type du champ");
+ setalert_type("error");
return;
}
@@ -937,7 +992,10 @@ const Config_Champs_Personnalise = (props) => {
if (p_detail_is_mandatory)
form.append("is_mandatory", p_detail_is_mandatory);
else {
- alert(" Vous devez definir si le champ est obligatoire");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir si le champ est obligatoire");
+ setalert_type("error");
return;
}
@@ -1005,15 +1063,24 @@ const Config_Champs_Personnalise = (props) => {
form.append("field_name", p_one_detail_field_name);
}
else {
- alert(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'");
+ // alert(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir le technique du champ. Il doit commencer impérativement par 'my_'");
+ setalert_type("error");
return;
}
if (!p_one_detail_field_name.startsWith('my_')) {
- alert(" Le nom technique du champ doit commencer impérativement par 'my_'");
+ // alert(" Le nom technique du champ doit commencer impérativement par 'my_'");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le nom technique du champ doit commencer impérativement par 'my_'");
+ setalert_type("error");
return;
}
if (String(p_one_detail_field_name).length < 6) {
- alert(" Le nom technique du champ doit au moins 6 caractères");
+ // alert(" Le nom technique du champ doit au moins 6 caractères");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le nom technique du champ doit au moins 6 caractères");
+ setalert_type("error");
return;
}
@@ -1021,11 +1088,17 @@ const Config_Champs_Personnalise = (props) => {
if (p_one_detail_field_label)
form.append("field_label", p_one_detail_field_label);
else {
- alert(" Vous devez definir le label du champ ");
+ // alert(" Vous devez definir le label du champ ");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir le label du champ ");
+ setalert_type("error");
return;
}
if (String(p_one_detail_field_label).length < 3) {
- alert(" Le label du champ doit faire au moins 3 caractères");
+ // alert(" Le label du champ doit faire au moins 3 caractères");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Le label du champ doit faire au moins 3 caractères");
+ setalert_type("error");
return;
}
@@ -1033,7 +1106,10 @@ const Config_Champs_Personnalise = (props) => {
if (p_one_detail_related_collection)
form.append("related_collection", p_one_detail_related_collection);
else {
- alert(" Vous devez definir l'entité");
+ // alert(" Vous devez definir l'entité");
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir l'entité");
+ setalert_type("error");
return;
}
@@ -1041,7 +1117,10 @@ const Config_Champs_Personnalise = (props) => {
if (p_one_detail_is_displayed)
form.append("is_displayed", p_one_detail_is_displayed);
else {
- alert(" Vous devez definir si le champ est affichable");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir si le champ est affichable");
+ setalert_type("error");
return;
}
@@ -1055,7 +1134,10 @@ const Config_Champs_Personnalise = (props) => {
if (p_one_detail_field_type)
form.append("field_type", p_one_detail_field_type);
else {
- alert(" Vous devez definir le type du champ");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir le type du champ");
+ setalert_type("error");
return;
}
@@ -1063,7 +1145,10 @@ const Config_Champs_Personnalise = (props) => {
if (p_one_detail_is_mandatory)
form.append("is_mandatory", p_one_detail_is_mandatory);
else {
- alert(" Vous devez definir si le champ est obligatoire");
+
+ setdisplay_alert_mysy("1");
+ setalert_message(" Vous devez definir si le champ est obligatoire");
+ setalert_type("error");
return;
}
@@ -1094,6 +1179,7 @@ const Config_Champs_Personnalise = (props) => {
setdisplay_alert_mysy("1");
setalert_message(res.data.message);
setalert_type("success");
+
if (document.getElementById('myRef_head')) {
var divh = document.getElementById('myRef_head').offsetTop;
window.scrollTo({
@@ -1136,6 +1222,24 @@ const Config_Champs_Personnalise = (props) => {
}
+
+ const New_Option_Oui_Non = [
+ {
+ value: '1',
+ label: 'Oui',
+ },
+ {
+ value: '0',
+ label: 'Non',
+ },
+ ];
+
+ const New_Option_Field_Type = [
+ { "id": "float", "label": "Numérique", "value": "float" },
+ { "id": "string", "label": "Alphanumérique", "value": "string" },
+
+ ]
+
return (
{/*** Affichage des messages d'alerte*/}
@@ -1177,7 +1281,7 @@ const Config_Champs_Personnalise = (props) => {
>
-
MySy Information
+
MySy Information
{Dialog_1_message}
@@ -1199,7 +1303,7 @@ const Config_Champs_Personnalise = (props) => {
- Configuration documents
+ Configuration champs spécifiques
Utilisez les filtres !
@@ -1540,32 +1644,12 @@ const Config_Champs_Personnalise = (props) => {
{String(display_personalised_field) === "1" && String(add_one_personal_field) !== "1" &&
-
Détail champ personnalisé {selected_field_name}
+
Détail champ personnalisé {selected_field_name}
-
- {String(personal_field_data_edit_mode) !== "1" &&
-
-
- Entité métier
-
-
-
}
-
- {String(personal_field_data_edit_mode) === "1" &&
Entité métier
+
+ Entité métier
{
InputLabelProps={{
shrink: true,
}}
- select
disabled={false}
className="disabled_style"
- value={p_detail_related_collection}
- onChange={(e) => {
- setp_detail_related_collection(e.target.value);
- setpersonal_field_data_changed("1");
- }}
- >
- {Get_Obj_Metier_Eligible_Cham_Spe_result &&
- Get_Obj_Metier_Eligible_Cham_Spe_result.map((mycollection) => (
-
- {JSON.parse(mycollection).nom}
+ value={p_detail_related_collection_name}
+ />
-
- ))}
-
-
-
}
+
- {String(personal_field_data_edit_mode) !== "1" &&
Type (numérique / Alphanumérique)
- Type (Numérique / Alphanumérique)
+ {New_Option_Field_Type && New_Option_Field_Type.length > 0 && {
}}
disabled={false}
className="disabled_style"
- value={p_detail_field_type_label}
- />
-
}
-
- {String(personal_field_data_edit_mode) === "1" &&
Type (numérique / Alphanumérique)
- {
- setp_detail_field_type(e.target.value);
- setpersonal_field_data_changed("1");
- }}
- >
- numérique
- Alphanumérique
-
-
-
}
+ value={New_Option_Field_Type.filter((data) => (data).value === String(p_detail_field_type))[0].label}
+ />}
+
{String(personal_field_data_edit_mode) !== "1" &&
Obligatoire
- 0 && {
}}
disabled={false}
className="disabled_style"
- value={p_detail_is_mandatory_label}
- />
+ value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_mandatory))[0].label}
+ />}
}
{String(personal_field_data_edit_mode) === "1" &&
Obligatoire
-
0 && {
- setp_detail_is_mandatory(e.target.value);
- setpersonal_field_data_changed("1");
- }}
- >
- Oui
- Non
+ options={New_Option_Oui_Non}
+ value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_mandatory))[0].label}
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_detail_is_mandatory(value.value);
+ setpersonal_field_data_changed("1");
-
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
}
{String(personal_field_data_edit_mode) !== "1" &&
Affichable
- 0 && {
}}
disabled={false}
className="disabled_style"
- value={p_detail_is_displayed_label}
- />
+ value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_displayed))[0].label}
+ />}
}
{String(personal_field_data_edit_mode) !== "1" &&
@@ -1747,7 +1791,8 @@ const Config_Champs_Personnalise = (props) => {
Champ public
-
0 && {
}}
disabled={false}
className="disabled_style"
- value={p_detail_is_public_label}
- />
+ value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_public))[0].label}
+ />}
}
{String(personal_field_data_edit_mode) === "1" &&
Affichable
-
0 && {
- setp_detail_is_displayed(e.target.value);
- setpersonal_field_data_changed("1");
+ options={New_Option_Oui_Non}
+ value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_displayed))[0].label}
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_detail_is_displayed(value.value);
+ setpersonal_field_data_changed("1");
+
+ }
}}
- >
- Oui
- Non
-
+
+ renderInput={(params) =>
+ }
+ />}
+
}
{String(personal_field_data_edit_mode) === "1" &&
@@ -1792,27 +1838,28 @@ const Config_Champs_Personnalise = (props) => {
Champ public
-
0 && {
- setp_detail_is_public(e.target.value);
- setpersonal_field_data_changed("1");
+ options={New_Option_Oui_Non}
+ value={New_Option_Oui_Non.filter((data) => (data).value === String(p_detail_is_public))[0].label}
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_detail_is_public(value.value);
+ setpersonal_field_data_changed("1");
+ }
}}
- >
- Oui
- Non
-
+
+ renderInput={(params) =>
+ }
+ />}
+
}
@@ -1865,7 +1912,11 @@ const Config_Champs_Personnalise = (props) => {
{String(display_personalised_field) !== "1" && String(add_one_personal_field) === "1" &&
-
Ajout d'un nouveau champ spécifique
+
+
Ajout d'un nouveau champ spécifique
@@ -1901,6 +1952,34 @@ const Config_Champs_Personnalise = (props) => {
+
Entité métier
+ {New_Get_Obj_Metier_Eligible_Cham_Spe_result && New_Get_Obj_Metier_Eligible_Cham_Spe_result.length > 0 &&
+
(data).objet_metier === String(p_one_detail_related_collection))[0].label}
+
+ onChange={(event, value) => {
+ if (value && value.objet_metier) {
+ setp_one_detail_related_collection(value.objet_metier);
+ setpersonal_field_data_changed("1");
+ } else {
+ setp_one_detail_related_collection("");
+ setpersonal_field_data_changed("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />}
+
+
@@ -1948,81 +2027,80 @@ const Config_Champs_Personnalise = (props) => {
-
Type
(numérique / Alphanumérique)
-
Type (Numérique / Alphanumérique)
+ {
- setp_one_detail_field_type(e.target.value);
- setpersonal_field_data_changed("1");
- }}
- >
- numérique
- Alphanumérique
+ options={New_Option_Field_Type}
+
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_one_detail_field_type(value.value);
+ setpersonal_field_data_changed("1");
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
-
Obligatoire
- {
- setp_one_detail_is_mandatory(e.target.value);
- setpersonal_field_data_changed("1");
- }}
- >
- Oui
- Non
+ options={New_Option_Oui_Non}
-
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_one_detail_is_mandatory(value.value);
+ setpersonal_field_data_changed("1");
+
+ }
+ }}
+
+ renderInput={(params) =>
+ }
+ />
Affichable
- {
- setp_one_detail_is_displayed(e.target.value);
- setpersonal_field_data_changed("1");
+ options={New_Option_Oui_Non}
+
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_one_detail_is_displayed(value.value);
+ setpersonal_field_data_changed("1");
+
+ }
}}
- >
- Oui
- Non
-
+
+ renderInput={(params) =>
+ }
+ />
@@ -2030,27 +2108,28 @@ const Config_Champs_Personnalise = (props) => {
Champ public
-
{
- setp_one_detail_is_public(e.target.value);
- setpersonal_field_data_changed("1");
+ options={New_Option_Oui_Non}
+
+ onChange={(event, value) => {
+ if (value && value.value) {
+ setp_one_detail_is_public(value.value);
+ setpersonal_field_data_changed("1");
+
+ }
}}
- >
- Oui
- Non
-
+
+ renderInput={(params) =>
+ }
+ />
@@ -2071,7 +2150,7 @@ const Config_Champs_Personnalise = (props) => {
- Annuler
+ Annuler
diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js
index 50264ad..c36f774 100644
--- a/src/components/DisplayPartnerSession.js
+++ b/src/components/DisplayPartnerSession.js
@@ -3887,10 +3887,7 @@ const DisplayPartnerSession = (props) => {
submenu_color_management("detail_session");
-
- await sleep(2);
if (edit_session_form === false) {
-
desableSessionFields();
}
@@ -4166,24 +4163,8 @@ const DisplayPartnerSession = (props) => {
setnb_stagiaire_Inscrit("0");
/* Activation des champs spécifiques */
-
- // Pour les champs spécifiques
-
- submenu_detail_session();
-
- 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))) {
-
- document.getElementsByName(String(field_name)).disabled = false;
- document.getElementsByName(String(field_name)).backgroundColor = "#FFFFFF";
- }
- }
+ setsubmenu("detail_session");
+ submenu_color_management("detail_session");
setgridline_id('');
setsequence_gridline_id("");
@@ -4195,6 +4176,19 @@ const DisplayPartnerSession = (props) => {
behavior: "smooth",
});
+ 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))) {
+ document.getElementsByName(String(field_name)).disabled = false;
+ document.getElementsByName(String(field_name)).backgroundColor = "#FFFFFF";
+ }
+ }
+
}
@@ -5799,14 +5793,6 @@ const DisplayPartnerSession = (props) => {
const [one_editorRef_contenu_ftion_limite, setone_editorRef_description_limite] = useState(800);
const [field_contenu_ftion, setfield_contenu_ftion] = useState("");
- function editor_contenu_ftion_keyup() {
- setsessionChanged(true);
- }
-
-
- function one_editor_contenu_ftion_keyup() {
- setsessionChanged(true);
- }
function One_annuleSessionUpdate() {
@@ -5817,8 +5803,16 @@ const DisplayPartnerSession = (props) => {
setCreateSessionFormation_message();
setone_CreateSessionFormation_api();
setone_CreateSessionFormation_message();
- setone_CreateSessionFormation_result()
- setaddOneSession();
+ setone_CreateSessionFormation_result([])
+ setaddOneSession("");
+
+ setsubmenu("");
+ setselected_code_session("");
+
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
}
@@ -5965,9 +5959,7 @@ const DisplayPartnerSession = (props) => {
// Pour les champs spécifiques
-
-
- if (String(addOneSession) !== "1") {
+ if (String(addOneSession) !== "1") {
for (let i = 0; i < rows_champs_specifics.length; i++) {
var field_name = JSON.parse(rows_champs_specifics[i]).field_name;
@@ -5986,6 +5978,7 @@ const DisplayPartnerSession = (props) => {
setfields1desabled(true);
+
}
let [edit_session_form, setedit_session_form] = useState(false);
@@ -7112,7 +7105,7 @@ const DisplayPartnerSession = (props) => {
setnb_valide_inscription_individuelle("");
}
- if (mylocaltraining.archive) {
+ if (mylocaltraining.archive) {
setp_detail_archive(mylocaltraining.archive);
} else {
setp_detail_archive("");
@@ -7583,17 +7576,17 @@ const DisplayPartnerSession = (props) => {
return currentDate.getTime() < selectedDate.getTime();
};
- function One_annuleSessionUpdate() {
- One_clearSessionFields();
- //GetCurrentSession(selected_code_session);
- setsessionChanged(false);
- setCreateSessionFormation_api();
- setCreateSessionFormation_message();
- setone_CreateSessionFormation_api();
- setone_CreateSessionFormation_message();
- setone_CreateSessionFormation_result()
- setaddOneSession();
- }
+ /* function One_annuleSessionUpdate() {
+ One_clearSessionFields();
+ //GetCurrentSession(selected_code_session);
+ setsessionChanged(false);
+ setCreateSessionFormation_api();
+ setCreateSessionFormation_message();
+ setone_CreateSessionFormation_api();
+ setone_CreateSessionFormation_message();
+ setone_CreateSessionFormation_result()
+ setaddOneSession();
+ }*/
const [SessionendDateInscription, setSessionendDateInscription] = useState();
const [New_GetCurrentPartnerClass_result, setNew_GetCurrentPartnerClass_result] = useState([]);
@@ -18119,7 +18112,7 @@ const DisplayPartnerSession = (props) => {
setinfo_affiche_date_fin(JSON.parse(rowss[session_selected_row_id]).date_fin);
setinfo_affiche_etape(JSON.parse(rowss[session_selected_row_id]).session_etape);
- var nb_place_dispo = String(parseInt(String(JSON.parse(rowss[session_selected_row_id]).nb_participant)) - parseInt(String(JSON.parse(rowss[session_selected_row_id]).nb_inscrit)))
+ var nb_place_dispo = String(parseInt(String(JSON.parse(rowss[session_selected_row_id]).nb_participant)) - parseInt(String(JSON.parse(rowss[session_selected_row_id]).nb_inscrit)))
//console.log(" ### nb_place_dispo = ", nb_place_dispo);
setinfo_affiche_place_disponible(nb_place_dispo);
@@ -21148,7 +21141,11 @@ const DisplayPartnerSession = (props) => {
-
{
+ setaddOneSession("1");
+ submenu_add_one_session();
+
+ }}
className="detail_class_submenu bton_add_session"
id='menu_import_participant' name='menu_import_participant'>Ajout 1 Promo
@@ -21210,8 +21207,6 @@ const DisplayPartnerSession = (props) => {
{String(submenu) === String("detail_session") &&
-
-
{String(addOneSession) !== "1" &&
{p_detail_archive && String(p_detail_archive) === "1" &&
@@ -22010,106 +22005,6 @@ const DisplayPartnerSession = (props) => {
}
-
- {/* {edit_session_form &&
Présentiel
-
-
{
- if (value && value.value) {
- setp_session_presentiel(value.value);
- setp_session_presentiel_label(value.label);
- IssessionChanged();
-
- } else {
- setp_session_presentiel("");
- setp_session_presentiel_label("");
- IssessionChanged();
- }
- }}
-
- renderInput={(params) =>
- }
- />
-
-
- }
-
- {!edit_session_form &&
Présentiel
-
-
-
}
-
-
- {edit_session_form &&
A distance
-
-
{
- if (value && value.value) {
- setp_session_distance(value.value);
- setp_session_distance_label(value.label);
- IssessionChanged();
-
- } else {
- setp_session_distance("");
- setp_session_distance_label("");
- IssessionChanged();
- }
- }}
-
- renderInput={(params) =>
- }
- />
-
-
- }
-
- {!edit_session_form &&
A distance
-
-
-
}
- */}
-
-
{!edit_session_form &&
Inclus au BPF
{
- {/*
-
Contenu de la formation (max 800 caractères)
- (à afficher sur l'attestation)
- {!fields1desabled && }
- {!fields1desabled && }
-
- editorRef_contenu_ftion.current = editor}
- initialValue={field_contenu_ftion}
- onKeyUp={editor_contenu_ftion_keyup}
- disabled={fields1desabled}
-
- init={{
- resize: false,
-
- height: 200,
- 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:Helvetica,Arial,sans-serif; font-size:12px; }'
- }}
- />
-
-
-
*/}
@@ -22231,8 +22097,8 @@ const DisplayPartnerSession = (props) => {
{rows_champs_specifics &&
rows_champs_specifics.map((champ_spec) => (
-
{JSON.parse(champ_spec).field_label}
-
+
{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} }
{String(JSON.parse(champ_spec).field_type) === "float" &&
{
- {/*
Présentiel
-
{
- if (value && value.value) {
- setp_one_session_presentiel(value.value);
- setp_one_session_presentiel_label(value.label);
- }
- }}
-
- renderInput={(params) =>
- }
- />
-
-
-
-
-
A distance
-
{
- if (value && value.value) {
- setp_one_session_distance(value.value);
- setp_one_session_distance_label(value.label);
- }
- }}
-
- renderInput={(params) =>
- }
- />
-
- */}
- {/*
-
Contenu de la formation (max 800 caractères)
- (à afficher sur l'attestation)
- {!fields1desabled && }
- {!fields1desabled && }
-
- one_editorRef_contenu_ftion.current = editor}
- initialValue={one_field_contenu_ftion}
- onKeyUp={one_editor_contenu_ftion_keyup}
- disabled={false}
-
- init={{
- resize: false,
-
- height: 200,
- 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:Helvetica,Arial,sans-serif; font-size:12px; }'
- }}
- />
-
-
-
*/}
@@ -23025,8 +22814,8 @@ const DisplayPartnerSession = (props) => {
{rows_champs_specifics &&
rows_champs_specifics.map((champ_spec) => (
-
{JSON.parse(champ_spec).field_label}
-
+
{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} }
{String(JSON.parse(champ_spec).field_type) === "float" &&
{
const stored_cookie = getCookie('tokenmysypart');
form.append("token", stored_cookie);
- form.append("archive", "0");
+ form.append("archive", "0");
var myurl = process.env.REACT_APP_API_URL + "myclass/api/GetAllValideSessionPartner_List/";
setLoading(true);
@@ -7167,7 +7167,7 @@ const DisplayPartnerStagiaires = (props) => {
>
- MySy Information
+ MySy Information
{Dialog_1_message}
@@ -9549,7 +9549,8 @@ const DisplayPartnerStagiaires = (props) => {
{rows_champs_specifics &&
rows_champs_specifics.map((champ_spec) => (
- {JSON.parse(champ_spec).field_label}
+
{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} }
{String(JSON.parse(champ_spec).field_type) === "float" &&
{
{rows_champs_specifics &&
rows_champs_specifics.map((champ_spec) => (
- {JSON.parse(champ_spec).field_label}
+
{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} }
{String(JSON.parse(champ_spec).field_type) === "float" &&
{
setliste_sessions_file_change_api("true");
clean_all_filters();
Getall_Training_Employee_No_Filter();
+
setdisplay_alert_mysy("1");
setalert_message(" Les employés ont été correctement importés");
setalert_type("success");
@@ -9161,8 +9162,8 @@ const Employes = (props) => {
{rows_champs_specifics &&
rows_champs_specifics.map((champ_spec) => (
- {JSON.parse(champ_spec).field_label}
-
+
{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} }
{String(JSON.parse(champ_spec).field_type) === "float" &&
{
Ajouter un Employé
+ }}> Ajouter un Employé
@@ -10087,8 +10088,8 @@ const Employes = (props) => {
{rows_champs_specifics &&
rows_champs_specifics.map((champ_spec) => (
-
{JSON.parse(champ_spec).field_label}
-
+
{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} }
{String(JSON.parse(champ_spec).field_type) === "float" &&
{
+
+ const { type, categorie } = useParams();
+ const { NewSearchText } = useParams();
+ const [v11, setv11] = useState("");
+ const [userconnected, setuserconnected] = useState("0");
+ const [TrainingSupport, setTrainingSupport] = useState("");
+ const [TrainingType, setTrainingType] = useState("");
+ const [TrainingCertif, setTrainingCertif] = useState("");
+ const [TrainingCPF, setTrainingCPF] = useState("");
+ const [TrainingLang, setTrainingLang] = useState("");
+ const [TrainingPrice, setTrainingPrice] = useState("");
+ const [SearchText, setSearchText] = useState("");
+ const [SearchcitiesText, setSearchcitiesText] = useState("");
+ const [result, setResult] = useState("");
+ const [myApiResponse, setmyApiResponse] = useState("false");
+ const [displayAllClasses, setdisplayAllClasses] = useState("0");
+ const [showelement, setshowelement] = useState("init");
+ const [country_code, setcountry_code] = useState("FR");
+ const [country_name, setcountry_name] = useState("France");
+ const [city, setcity] = useState("Paris");
+ const [postal, setpostal] = useState("75001");
+ const [latitude, setlatitude] = useState("48.861000061035156");
+ const [longitude, setlongitude] = useState("2.3380000591278076");
+ const [IPv4, setIPv4] = useState("172.71.122.128");
+ const [state, setstate] = useState("France");
+ const [userIp, setuserIp] = useState("172.71.122.128");
+ const [currentPage, setCurrentPage] = useState(1);
+ const [currentPage2, setCurrentPage2] = useState(1);
+ const [fin, setfin] = useState(0);
+ const [ismobilephone, setismobilephone] = useState();
+ const [TrainingDistanciel, setTrainingDistanciel] = useState();
+ const textInput = useRef(null);
+ const scrollDiv = useRef(null);
+
+ const [url_subdomain, seturl_subdomain] = useState(window.location.host.split(".")[0]);
+
+
+ const [textplaceholder, settextplaceholder] = useState("");
+ const [empltysearch, setempltysearch] = useState("1");
+ const [empltycitiessearch, setempltycitiessearch] = useState("1");
+
+ const [filtredistance, setfiltredistance] = useState("0");
+ const continent = ['oui', 'non'];
+ const [selectedcontinent, setselectedcontinent] = useState("");
+ const [newresult, setnewresult] = useState();
+ const stored_user = getCookie('tokenmysych');
+ const history = useHistory();
+ const [besoinaiderecherche, setbesoinaiderecherche] = useState("");
+ const [istrier, setistrier] = useState();
+ const [selectmetier, setselectmetier] = useState();
+ const [initAllfiter, setinitAllfiter] = useState();
+ const testDivRef = useRef(null);
+ const [partcookie, setpartCookie, removepartCookie] = useCookies(['tokenmysypart']);
+ const inputEl = useRef(null);
+
+
+
+
+ const url = process.env.REACT_APP_API_URL + "myclass/api/add_user_account/";
+ const {
+ register,
+ formState: { errors },
+ handleSubmit,
+ watch,
+ } = useForm();
+ const pwd = useRef({});
+ pwd.current = watch("pwd", "");
+
+
+
+ const onSubmit = async (data) => {
+
+ searchFunction();
+ };
+
+ const [Trainingdistance, setTrainingdistance] = useState(0);
+ const handleInput = (e) => {
+ setTrainingdistance(e.target.value);
+ }
+
+ const [Trainingduration, setTrainingduration] = useState(0);
+ const handleInputDuration = (e) => {
+ setTrainingduration(e.target.value);
+ }
+
+
+ function showdisplayfilter(event) {
+
+ if (showelement == "true") {
+ setshowelement("false");
+ document.getElementById('block_partner').style.top = "5200px"
+ document.getElementById('pieddepage_v2').style.top = "5800px"
+ }
+ else if (showelement == "false") {
+ setshowelement("true");
+ document.getElementById('block_partner').style.top = "6300px"
+ document.getElementById('pieddepage_v2').style.top = "6800px"
+ }
+
+
+ }
+
+ function clearsearchtext(event) {
+ setSearchText("");
+ setResult([]);
+ document.getElementById("SearchText").value = "";
+ setempltysearch("1")
+ setbesoinaiderecherche("");
+ settext("");
+ DisplayXfirstClas();
+ }
+
+ const [suggestion2, setsuggestion2] = useState([]);
+ const [suggestioncities, setsuggestioncities] = useState([]);
+
+ function SearchTextHandle(event) {
+ setempltysearch("0");
+ setSearchText(event.target.value);
+
+ var val = String(event.target.value).toLocaleLowerCase();
+ let matches = [];
+ // 13/01 : A faire absolument. j'ai bloqué car bug d'affichage (pas au bon endroit)
+
+ if (String(val).length > 2) {
+ matches = suggestedwords.filter(usr => {
+ //alert(JSON.parse(usr).name );
+ const regex = new RegExp(`${val}`, "gi");
+ return JSON.parse(usr).name.match(regex);
+ }
+
+ )
+
+ }
+
+ //console.log("matches = " + matches);
+ setsuggestion2(matches);
+ settext(event.target.value);
+ }
+
+ function SearchcitiesHandle(event) {
+ setempltycitiessearch("0");
+ setSearchcitiesText(event.target.value);
+
+ var val = String(event.target.value).toLocaleLowerCase().trimStart();
+ const regex = new RegExp(`^${val}`, "gi");
+
+ let matches = [];
+
+ if (String(val).length > 2) {
+ matches = suggestedcities.filter(usr => {
+ return JSON.parse(usr).ville.match(regex);
+ })
+ }
+
+ //console.log("matches = " + matches);
+ setsuggestioncities(matches);
+ setcities(event.target.value);
+
+ }
+
+
+ const [v1, setv1] = useState();
+ const [v2, setv2] = useState();
+
+
+ function TrainingSupportHandle(event) {
+ setsupportchecked("1");
+ var toto = "";
+ var filtre1 = "";
+ var filtre2 = "";
+ var filtre3 = "";
+
+ var crit_TrainingSupport = "";
+ var crit_TrainingSupport22 = "";
+
+
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+
+ //console.log("crit_TrainingSupport = ", crit_TrainingSupport);
+
+ if (crit_TrainingSupport.length > 0) {
+ filtre1 = result.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+ setv11(filtre1);
+ }
+ else if (crit_TrainingSupport.length <= 0) {
+ /* l'utilisateur a choisi d'annuler le filter */
+ annulefiltresupportchecked();
+ return;
+ //filtre1 = result;
+ //setv11(filtre1);
+ }
+ }
+
+ /*
+
+
+
+ if (document.querySelector('input[name="TrainingSupport"]:checked')) {
+ crit_TrainingSupport = document.querySelector('input[name="TrainingSupport"]:checked').value;
+ if (crit_TrainingSupport.length > 0) {
+ filtre1 = result.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+ setv11(filtre1);
+ }
+ else if (crit_TrainingSupport.length <= 0 || String(crit_TrainingSupport) === String("NA")) {
+ filtre1 = result;
+ setv11(filtre1);
+ }
+
+ }
+ */
+
+
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value;
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+
+ }
+
+ // recuperation du filtre du type (cours, tuto, etc)
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value;
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType);
+
+ }
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value;
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+ }
+ // Recup du filtre de prix
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ if (range_price.min && range_price.max) {
+ filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) &&
+ Number(JSON.parse(maformation).price) <= Number(range_price.max)
+ );
+
+ setv11(filtre1);
+ }
+
+
+ setnewresult(filtre1);
+
+ //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType);
+ //console.log("############################ filtre1 = " + filtre1);
+ setCurrentPage2(1);
+ //console.log(" ????????????????????????????filtre2 = "+filtre2);
+
+ }
+
+
+
+ function TrainingCertifHandle(event) {
+
+ var ele = document.querySelector('input[name="TrainingCertif"]:checked').value
+
+ var toto = "";
+ var filtre1 = "";
+ var filtre2 = "";
+ var filtre3 = "";
+
+ setcertifchecked("");
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ setcertifchecked("1");
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value
+ if (crit_TrainingCertif.length > 0) {
+ //alert(" laa = " + crit_TrainingCertif);
+ //console.log(result)
+ filtre1 = result.filter((maformation) => String(JSON.parse(maformation).certif) === String(crit_TrainingCertif));
+ setv11(filtre1);
+ }
+
+ } else {
+
+ filtre1 = result;
+ setv11(filtre1);
+ }
+
+ /*
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.querySelector('input[name="TrainingSupport"]:checked')) {
+ crit_TrainingSupport = document.querySelector('input[name="TrainingSupport"]:checked').value
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+
+ }
+ */
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+
+ }
+
+
+ // recuperation du filtre du CPF
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value
+ if (crit_TrainingCPF.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF);
+
+ }
+
+
+ // recuperation du filtre du type
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingType);
+
+ }
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+
+ }
+
+ // Recup du filtre de prix
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ if (range_price.min && range_price.max) {
+ filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) &&
+ Number(JSON.parse(maformation).price) <= Number(range_price.max)
+ );
+
+ setv11(filtre1);
+ }
+
+
+ setnewresult(filtre1);
+ //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType);
+ //console.log("############################ filtre1 = " + filtre1);
+ setCurrentPage2(1);
+ //console.log(" ????????????????????????????filtre2 = "+filtre2);
+
+
+ return;
+ }
+
+
+
+ // Pour le CPF
+ const [cpfchecked, setcpfchecked] = useState();
+ function TrainingCPFHandle(event) {
+
+ var ele = document.querySelector('input[name="TrainingCPF"]:checked').value
+ var myelement;
+
+ if (document.getElementById('rech_middlebox')) {
+ myelement = document.getElementById('rech_middlebox');
+ }
+
+
+ var toto = "";
+ var filtre1 = "";
+ var filtre2 = "";
+ var filtre3 = "";
+
+ setcpfchecked("");
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ setcpfchecked("1");
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value
+ if (crit_TrainingCPF.length > 0) {
+ //alert(" crit_TrainingCPF = " + crit_TrainingCPF);
+
+ filtre1 = result.filter((maformation) => String(JSON.parse(maformation).cpf) === String(crit_TrainingCPF));
+ setv11(filtre1);
+ //console.log(" #### ",filtre1);
+ }
+
+ } else {
+
+ filtre1 = result;
+ setv11(filtre1);
+ }
+
+ // recuperation du filtre du certificat
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+
+ }
+
+
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+
+ }
+
+
+ // recuperation du filtre du type
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingType);
+
+ }
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+
+
+
+ }
+
+ // Recup du filtre de prix
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ if (range_price.min && range_price.max) {
+ filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) &&
+ Number(JSON.parse(maformation).price) <= Number(range_price.max)
+ );
+
+ setv11(filtre1);
+ }
+
+
+ setnewresult(filtre1);
+ //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType);
+ //console.log("############################ filtre1 = " + filtre1);
+ setCurrentPage2(1);
+ //console.log(" ????????????????????????????filtre2 = "+filtre2);
+ if (myelement) {
+ myelement.scrollIntoView({ behavior: 'smooth' });
+ }
+
+ return;
+ }
+
+
+ // END PR CPF
+ function TrainingTypeHandle(event) {
+
+ settypechecked("1");
+ var toto = "";
+ var filtre1 = "";
+ var filtre2 = "";
+ var filtre3 = "";
+
+ var myelement;
+
+ if (document.getElementById('rech_middlebox')) {
+ myelement = document.getElementById('rech_middlebox');
+ }
+
+ var crit_TrainingPrice = "";
+
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value
+ if (crit_TrainingType.length > 0) {
+ filtre1 = result.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType);
+ setv11(filtre1);
+ }
+
+ } else {
+
+ filtre1 = result;
+ setv11(filtre1);
+ }
+
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+
+ }
+
+
+ // recuperation du filtre du CPF
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value
+ if (crit_TrainingCPF.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF);
+
+ }
+
+ // recuperation du filtre du certificat
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+
+ }
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+
+ }
+
+ // Recup du filtre de prix
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ if (range_price.min && range_price.max) {
+ filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) &&
+ Number(JSON.parse(maformation).price) <= Number(range_price.max)
+ );
+
+ setv11(filtre1);
+ }
+
+
+ setnewresult(filtre1);
+ //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType);
+ //console.log("############################ filtre1 = " + filtre1);
+ setCurrentPage2(1);
+ //console.log(" ????????????????????????????filtre2 = "+filtre2);
+
+ if (myelement) {
+ // 👇 Will scroll smoothly to the top of the next section
+ myelement.scrollIntoView({ behavior: 'smooth' });
+
+ }
+
+
+ return;
+
+
+
+
+
+ }
+
+
+ function TrainingLangHandle(event) {
+ setTrainingLang(event.target.value);
+ alert("newresult newresultnewresultnewresult = " + newresult);
+ }
+
+
+ function TrainingPriceHandle(event) {
+
+
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ setTrainingPrice(event.target.value);
+ var toto = "";
+ var filtre1 = "";
+
+
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ var myprices = crit_TrainingPrice.split(':');
+ if (range_price.min && range_price.max) {
+ filtre1 = result.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) &&
+ Number(JSON.parse(maformation).price) <= Number(range_price.max)
+ );
+ //console.log(" PRICEEEEEEEEEEEEEEEE = "+filtre1);
+ setv11(filtre1);
+ }
+ else {
+ //alert(" Annulation du filtre prix");
+ filtre1 = result;
+ setv11(filtre1);
+ }
+
+
+
+ // Recuperation des autres filtres.
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+ }
+
+ // recuperation du filtre du CPF
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value
+ if (crit_TrainingCPF.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF);
+
+ }
+
+
+ // recuperation du filtre du certification
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value;
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+ }
+
+ // recuperation du filtre du type (cours, tuto, etc)
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value;
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType);
+ }
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value;
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+
+ }
+
+
+ setnewresult(filtre1);
+ setCurrentPage2(1);
+
+ }
+
+
+ // Traitement du filtre presentiel / distantiel
+ function TrainingDistancielHandle(event) {
+
+
+ isonsite();
+ setlieuchecked("1");
+ var toto = "";
+ var filtre1 = "";
+ var filtre0 = [];
+ var filtre01 = [];
+ var my_ville = "";
+ var my_cp = "";
+
+ if (document.getElementById("ville")) {
+ my_ville = crit_TrainingSupport = document.getElementById("ville").value;
+ my_ville = my_ville.trim();
+
+ }
+
+ if (document.getElementById("zip_code")) {
+ my_cp = crit_TrainingSupport = document.getElementById("zip_code").value;
+ my_cp = my_cp.trim();
+
+ }
+
+ var crit_Trainingdistance = "";
+ // Recuperation du filtre principale modifié dans ce event (distance)
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value;
+ //alert("crit_Trainingdistance = " + crit_Trainingdistance);
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+
+ if (String(crit_Trainingdistance) === String("1")) {
+
+ filtre1 = result.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = result.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+
+ // Traitement du nom de la ville
+ if (my_ville.length > 3) {
+
+ var filtre2 = filtre1.map(obj => {
+
+ if (JSON.parse(obj).datelieu) {
+
+ var tmp = JSON.parse(obj).datelieu.length
+ var i = 0;
+ while (i < tmp) {
+ //console.log(JSON.parse(obj).datelieu[i]);
+ //console.log(" ville =" + JSON.parse(obj).datelieu[i].ville)
+ if (JSON.parse(obj).datelieu[i].ville === my_ville) {
+ return obj
+ }
+ i++;
+ }
+ }
+
+ });
+
+ var filtre3 = filtre2.filter(function (element) {
+ return element !== undefined;
+ });
+
+
+ filtre1 = filtre3;
+ }
+
+ // Traitement du zip code
+ if (my_cp.length > 2) {
+
+ var filtre2 = filtre1.map(obj => {
+
+ if (JSON.parse(obj).datelieu) {
+
+ var tmp = JSON.parse(obj).datelieu.length
+ var i = 0;
+ while (i < tmp) {
+ //console.log(JSON.parse(obj).datelieu[i]);
+ //console.log(" ville =" + JSON.parse(obj).datelieu[i].ville)
+ if (JSON.parse(obj).datelieu[i].code_postal.startsWith(my_cp)) {
+ return obj
+ }
+ i++;
+ }
+ }
+
+ });
+
+ var filtre3 = filtre2.filter(function (element) {
+ return element !== undefined;
+ });
+
+
+ filtre1 = filtre3;
+ }
+
+ setv11(filtre1);
+
+
+ }
+ else if (String(crit_Trainingdistance) === String("NA")) {
+
+ filtre1 = result;
+ setv11(filtre1);
+ }
+ }
+ else if (crit_Trainingdistance.length <= 0) {
+
+ filtre1 = result;
+ setv11(filtre1);
+ }
+ }
+
+
+ /* Recuperation des autres filtres */
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+ }
+
+ // recuperation du filtre du certification
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value;
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+ }
+
+ // recuperation du filtre du CPF
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value
+ if (crit_TrainingCPF.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF);
+
+ }
+
+
+ // recuperation du filtre du type (cours, tuto, etc)
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value;
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType);
+ }
+
+ // Recup du filtre de prix
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ if (range_price.min && range_price.max) {
+ filtre1 = filtre1.filter((maformation) => Number(JSON.parse(maformation).price) >= Number(range_price.min) &&
+ Number(JSON.parse(maformation).price) <= Number(range_price.max)
+ );
+
+ setv11(filtre1);
+ }
+
+
+ setnewresult(filtre1);
+ setCurrentPage2(1);
+ }
+
+
+
+ function displayAllClassesHandle(event) {
+ setdisplayAllClasses(event.target.checked);
+ if (event.target.checked == true)
+ document.getElementById("SearchText").disabled = true;
+ else
+ document.getElementById("SearchText").disabled = false;
+ }
+
+
+ const [suggestedwords, setsuggestedwords] = useState([]);
+ const [texte, settext] = useState("");
+
+ const [cities, setcities] = useState("");
+
+ const [suggestedcities, setsuggestedcities] = useState([]);
+
+
+
+ useEffect(() => {
+
+ var ip = "";
+
+ Get_Subdomain_Partner_Data(window.location.host)
+ async function fetchData() {
+ // const result = await axios('https://geolocation-db.com/json/',);
+
+
+
+ /* setuserIp("172.71.122.128");
+ setcountry_code("FR");
+ setcountry_name("France");
+ setcity("Paris");
+ setpostal("75001");
+ setlatitude("48.861000061035156");
+ setlongitude("2.3380000591278076");
+ setIPv4("172.71.122.128");
+ setstate("France");*/
+
+ let windowWidth = window.innerWidth;
+
+ if (showelement === "init") {
+
+ if (windowWidth < 601) {
+ setismobilephone(true);
+ setshowelement("false");
+ settextplaceholder("Plus de 10 000 formations (gratuites, payantes...)");
+
+ } else if (windowWidth >= 601) {
+ setismobilephone(false);
+ setshowelement("true");
+ //settextplaceholder("Ex : graphiste ...sur plus de 10 000 formations (gratuites, payantes,..)");
+ settextplaceholder("Recherche par Titre, Description, Contenu video ... sur plus de 10 000 formations (gratuites, payantes,..)");
+ }
+ }
+
+
+ if (categorie && String(categorie).length > 0) {
+
+ getClassByMetier_categorie(categorie);
+
+ }
+ else {
+
+ DisplayXfirstClas(result.data);
+
+ }
+ }
+
+
+ fetchData();
+
+ const listener = event => {
+ if (event.code === "Enter" || event.code === "NumpadEnter") {
+ event.preventDefault();
+ searchFunction();
+ }
+ };
+ document.addEventListener("keydown", listener);
+
+
+ if (typeof (stored_user) === "undefined" || String(stored_user) === '') {
+ setuserconnected("0");
+ } else {
+ setuserconnected("1");
+ }
+
+
+ setinitAllfiter();
+
+ whosisconnected();
+
+ if (categorie) {
+ //console.log(" ### categorie = ", categorie);
+ setmymetier(categorie);
+ } else {
+ setmymetier();
+ }
+
+ //document.getElementById("_1234").checked = true;
+
+
+
+ }, [initAllfiter, categorie]);
+
+
+
+
+ function DisplayClassByDomainFilter() {
+ var tab_domaine = list_domaine.split(";")
+ //console.log("tab_domaine = ", tab_domaine)
+
+ if (tab_domaine.length <= 0) {
+ setdomaine_v11(domaine_v11_orig);
+ DisplayXfirstClas();
+ return;
+ }
+
+
+
+ }
+
+ const handleChangeMetier = (event) => {
+
+ var local_list_metier = ""
+
+
+ for (let i = 0; i < event.length; i++) {
+ const label = event[i].label;
+ const value = event[i].value;
+
+ local_list_metier += value + ";"
+
+ }
+
+ //console.log(" ### local_list_metier = ",local_list_metier);
+ setlist_metier(local_list_metier);
+ //TrainingMetierHandle();
+
+ // Verification si on a une valeur
+ if (event.length > 0 && local_list_metier.trim().length > 0) {
+ getClassByMetier(local_list_metier);
+ } else {
+ DisplayClassByDomainFilter();
+ }
+
+ }
+
+
+
+ const [domaine_metier, setdomaine_metier] = useState([]);
+ const [domaine_metier_orig, setdomaine_metier_orig] = useState([]);
+
+ const [domaine_formation, setdomaine_formation] = useState([]);
+
+ const [domaine_v11, setdomaine_v11] = useState("");
+ const [domaine_v11_orig, setdomaine_v11_orig] = useState("");
+
+ const [list_domaine, setlist_domaine] = useState("");
+ const [list_metier, setlist_metier] = useState("");
+
+ const handleChangeDomaine = (event) => {
+
+
+ if (event.length <= 0) {
+ setdomaine_v11(domaine_v11_orig);
+ DisplayXfirstClas();
+ return;
+ }
+ //console.log(domaine_metier);
+ //console.log(" taille =" + event.length);
+ //console.log(domaine_v11_orig);
+
+ var tt = domaine_v11_orig;
+ var dump = [];
+ var local_list_domaine = ""
+
+
+ for (let i = 0; i < event.length; i++) {
+ const label = event[i].label;
+ const value = event[i].value;
+
+ local_list_domaine += value + ";"
+
+ tt = domaine_v11_orig.filter((maformation) => maformation.domaine === String(value));
+ //console.log(" TT = ", tt);
+
+ for (let i2 = 0; i2 < tt.length; i2++) {
+ //console.log(" push de ", tt[i2])
+ dump.push(tt[i2]);
+ }
+
+ setlist_domaine(local_list_domaine);
+ setdomaine_v11(dump);
+ }
+
+ getClassByDomaine(local_list_domaine);
+
+
+
+ }
+
+
+
+ const currentTableData2 = useMemo(() => {
+ if (newresult) {
+ const firstPageIndex = (currentPage2 - 1) * PageSize;
+ const lastPageIndex = firstPageIndex + PageSize;
+ setfin(1);
+ return newresult.slice(firstPageIndex, lastPageIndex);
+ }
+
+
+ if (result) {
+ const firstPageIndex = (currentPage2 - 1) * PageSize;
+ const lastPageIndex = firstPageIndex + PageSize;
+ setfin(1);
+ return result.slice(firstPageIndex, lastPageIndex);
+ }
+ else {
+ return [];
+ setfin(0);
+ }
+ }, [currentPage2]);
+
+ function searchFunction(e) {
+ // Nettoyage du resultat precedent.
+ setResult([]);
+
+ var crit_TrainingSupport = "";
+ var crit_TrainingType = "";
+ var crit_TrainingCertif = "";
+ var crit_TrainingLang = "";
+ var crit_TrainingPresentiel = "";
+ var crit_TrainingPrice = "";
+ var crit_TrainingDuration = "";
+ var my_ville = "";
+
+ var my_cp = "";
+
+ var my_domaine = "";
+
+
+
+ if (document.getElementById("searchdomain"))
+ my_domaine = document.getElementById("searchdomain").value;
+
+
+
+ //Get Criterias
+ var crit_SearchText = document.getElementById("SearchText").value;
+
+ if (document.getElementById("TrainingSupport"))
+ crit_TrainingSupport = document.getElementById("TrainingSupport").value;
+
+ if (document.getElementById("TrainingType"))
+ crit_TrainingType = document.getElementById("TrainingType").value;
+
+ if (document.getElementById("TrainingCertif"))
+ crit_TrainingCertif = document.getElementById("TrainingCertif").value;
+ if (crit_TrainingCertif.length == 0)
+ crit_TrainingCertif = "NA";
+
+
+ if (document.getElementById("TrainingLang"))
+ crit_TrainingLang = document.getElementById("TrainingLang").value;
+
+ if (document.getElementById("TrainingPresentiel"))
+ crit_TrainingPresentiel = document.getElementById("TrainingPresentiel").value;
+
+ if (document.getElementById("TrainingPrice"))
+ crit_TrainingPrice = document.getElementById("TrainingPrice").value;
+
+ if (document.getElementById("duration"))
+ crit_TrainingDuration = document.getElementById("duration").value;
+
+
+ if (document.getElementById("ville")) {
+ my_ville = crit_TrainingSupport = document.getElementById("ville").value;
+
+ }
+
+ if (document.getElementById("zip_code")) {
+ my_cp = crit_TrainingSupport = document.getElementById("zip_code").value;
+
+ }
+
+
+ var crit_Trainingdistance = Trainingdistance;
+
+ //console.log(" my_domaine = ", my_domaine);
+
+ /*console.log('SearchText = ' + crit_SearchText + ' - TrainingSupport = ' + crit_TrainingSupport +
+ ' - TrainingType = ' + crit_TrainingType + ' - TrainingCertif ' + crit_TrainingCertif +
+ " Langue = " + crit_TrainingLang + " TrainingPrice = " + crit_TrainingPrice +
+ " - Distance = " + crit_Trainingdistance + " -- Presentiel :" + crit_TrainingPresentiel +
+ " - Duration = " + crit_TrainingDuration + " - stored_user_cookie = " + stored_user);*/
+
+
+ var form = new FormData();
+ form.append("search_text", crit_SearchText);
+
+
+ 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_part) === "undefined" || String(stored_part) === '') {
+ 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_part);
+ form.append("connection_type", "partner");
+ }
+ else {
+ form.append("token", "");
+ form.append("connection_type", "");
+ }
+ form.append("certif", crit_TrainingCertif);
+ form.append("support", crit_TrainingSupport);
+ form.append("type", crit_TrainingType);
+ form.append("lang", crit_TrainingLang);
+ form.append("price", crit_TrainingPrice);
+ form.append("distance", crit_Trainingdistance);
+ form.append("duration", crit_TrainingDuration);
+
+
+ // 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);
+ form.append("subdomain", window.location.host.split(".")[0]);
+
+
+ var myurl = ""
+ if (displayAllClasses == true) {
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class_Given_partner_owner_recid_No_Login/";
+ }
+ else {
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/recherche_text_simple_for_partner_catalog/";
+
+ }
+
+ // alert("myurl = " + myurl);
+ axios.post(myurl, form).then(res => {
+ if (String(res.data.status) != String("false")) {
+ //console.log(" In test res.data.status = " + res.data.status);
+ //console.log(" In test res.data.message = " + res.data.message);
+ setmyApiResponse("True");
+ setResult(res.data.message)
+
+ //Verification si le resutlat est vide
+ if (res.data.message.length <= 0) {
+ setbesoinaiderecherche("1");
+ }
+ /*if (scrollDiv.current) {
+ scrollDiv.current.scrollIntoView({ behavior: "smooth" });
+ }*/
+
+ var myelement;
+
+ if (document.getElementById('rech_middlebox')) {
+ myelement = document.getElementById('rech_middlebox');
+ }
+
+ if (myelement) {
+ myelement.scrollIntoView({ behavior: 'smooth' });
+ }
+
+ }
+
+ else {
+ //console.log(" In test res.data.status = " + res.data.status);
+ //console.log(" In test res.data.message = " + res.data.message);
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ //textInput.current.focus();
+ }
+
+
+ }).catch((error) => {
+ // console.warn('Not good man :( mysearchtext = ');
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ })
+
+ // window.scrollTo(0, 600);
+
+
+
+
+ }
+
+ // Cette fonction affiche les X premieres formations
+ function DisplayXfirstClas(ip) {
+
+ // Nettoyage du resultat precedent.
+ setResult([]);
+
+
+
+ //Get Criterias
+ var crit_SearchText = "";
+ var myurl = "";
+
+ var form = new FormData();
+ form.append("search_text", crit_SearchText);
+
+
+ if (typeof (NewSearchText) === "undefined" || String(NewSearchText) === '') {
+ crit_SearchText = "";
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/get_all_class_Given_partner_owner_recid_No_Login/";
+ form.append("subdomain", window.location.host.split(".")[0]);
+
+ //console.log(" ######### laaaaaaaaaaaaa subdomain = ", window.location.host.split(".")[0])
+
+
+ } else {
+ crit_SearchText = NewSearchText;
+ myurl = process.env.REACT_APP_API_URL + "myclass/api/recherche_text_simple_for_partner_catalog/";
+
+ }
+
+
+
+
+
+ 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_part) === "undefined" || String(stored_part) === '') {
+ 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_part);
+ form.append("connection_type", "partner");
+ }
+ else {
+ form.append("token", "");
+ form.append("connection_type", "");
+ }
+
+ form.append("certif", "");
+ form.append("support", "");
+ form.append("type", "");
+ form.append("lang", "");
+ form.append("price", "");
+ form.append("distance", "");
+ form.append("duration", "");
+ form.append("cpf", "");
+
+
+
+ // Ajout des info IP user
+ if (ip) {
+ //console.log(" ### with IP");
+ form.append("user_ip", ip.IPv4);
+ form.append("user_country_code", ip.country_code);
+ form.append("user_country_name", ip.country_name);
+ form.append("user_city", ip.city);
+ form.append("user_postal", ip.postal);
+ form.append("user_latitude", ip.latitude);
+ form.append("user_longitude", ip.longitude);
+ form.append("user_state", ip.state);
+ }
+ else {
+ //console.log(" ### with OUT IP");
+ 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(" rrtt ");
+ }
+
+
+ //alert("myurl = " + myurl);
+ axios.post(myurl, form).then(res => {
+ if (String(res.data.status) != String("false")) {
+ //console.log(" In test res.data.status = " + res.data.status);
+ //console.log(" In DisplayXfirstClas res.data.message = " + res.data.message);
+
+ setmyApiResponse("True");
+ setResult(res.data.message)
+ // textInput.current.focus();
+ setbesoinaiderecherche("");
+
+ }
+ else {
+ //console.log(" In test res.data.status = " + res.data.status);
+ //console.log(" In test res.data.message = " + res.data.message);
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ //textInput.current.focus();
+ }
+
+
+ }).catch((error) => {
+ // console.warn('Not good man :( mysearchtext = ');
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ })
+
+
+ }
+
+ function trier(e) {
+
+ setistrier();
+ var trierpar = ""
+ if (document.getElementById("trierpar"))
+ trierpar = document.getElementById("trierpar").value;
+
+ if (String(trierpar) === String("duration")) {
+ setCurrentPage2(1);
+ setCurrentPage(1);
+
+ if (typeof (newresult) === "undefined" || String(newresult) === '') {
+
+ //console.log(" AVANT TRIE : [0].duration = " + JSON.parse(result[0]).duration + " - [1].duration = " + JSON.parse(result[1]).duration)
+ result.sort(function (a, b) {
+ return JSON.parse(a).duration - JSON.parse(b).duration;
+ });
+
+ //console.log("APRES TRIE : [0].duration = " + JSON.parse(result[0]).duration + " - [1].duration = " + JSON.parse(result[1]).duration)
+ setistrier("1");
+ }
+ else if (typeof (newresult) !== "undefined" || newresult.length > 0) {
+ newresult.sort(function (a, b) {
+ return JSON.parse(a).duration - JSON.parse(b).duration;
+ });
+ }
+ }
+
+ else if (String(trierpar) === String("price")) {
+ setCurrentPage2(1);
+
+ if (typeof (newresult) === "undefined" || String(newresult) === '') {
+ //console.log(" AVANT TRIE : [0].price = " + JSON.parse(result[0]).price + " - [1].price = " + JSON.parse(result[1]).price);
+ result.sort(function (a, b) {
+ return JSON.parse(a).price - JSON.parse(b).price;
+ });
+ //console.log("APRES TRIE : [0].price = " + JSON.parse(result[0]).price + " - [1].price = " + JSON.parse(result[1]).price);
+ setistrier("2");
+ }
+ else if (typeof (newresult) !== "undefined" || newresult.length > 0) {
+ newresult.sort(function (a, b) {
+ return JSON.parse(a).price - JSON.parse(b).price;
+ });
+ }
+ }
+
+ else if (String(trierpar) === String("note")) {
+ setCurrentPage2(1);
+
+ if (typeof (newresult) === "undefined" || String(newresult) === '') {
+ //console.log(" AVANT TRIE : [0].price = " + JSON.parse(result[0]).price + " - [1].price = " + JSON.parse(result[1]).price);
+ result.sort(function (a, b) {
+ return JSON.parse(b).note - JSON.parse(a).note;
+ });
+ //console.log("APRES TRIE : [0].price = " + JSON.parse(result[0]).price + " - [1].price = " + JSON.parse(result[1]).price);
+ setistrier("2");
+ }
+ else if (typeof (newresult) !== "undefined" || newresult.length > 0) {
+ newresult.sort(function (a, b) {
+ return JSON.parse(b).note - JSON.parse(a).note;
+ });
+ }
+ }
+
+ }
+
+
+ function getClassByMetier_categorie(mycate) {
+
+ var mymetier = mycate;
+
+
+ // Nettoyage du resultat precedent.
+ setResult([]);
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_class_by_metier/";
+
+ /*if (mymetier === "tout") {
+ //alert(" tout et sortir");
+ setinitAllfiter("1");
+ return;
+
+ }*/
+
+ var form = new FormData();
+ form.append("metier", mymetier);
+ form.append("token", "");
+
+
+ //alert("myurl = "+myurl);
+ axios.post(myurl, form).then(res => {
+ if (String(res.data.status) != String("false")) {
+
+ setmyApiResponse("True");
+ setResult(res.data.message)
+ //textInput.current.focus();
+ setbesoinaiderecherche("");
+ setnewresult("");
+ //console.log(" In getClassByMetier res.data.status = " + res.data.status);
+ //console.log(" In getClassByMetier res.data.message = " + res.data.message);
+ //setnewresult(res.data.message);
+ setCurrentPage2(1);
+ if (scrollDiv.current) {
+ scrollDiv.current.scrollIntoView({ behavior: "smooth" });
+ }
+
+ // reinitialisation de tous les filtre
+
+ //setmyApimyApiMessage("OK")
+ //console.log("taille = "+res.data.message.length);
+ }
+ else {
+ //console.log(" In getClassByMetier res.data.status = " + res.data.status);
+ //console.log(" In getClassByMetier res.data.message = " + res.data.message);
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ //textInput.current.focus();
+ }
+
+
+ }).catch((error) => {
+ console.warn(' getClassByMetier : Not good man :( mysearchtext = ');
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ })
+
+ }
+
+
+ function getClassByDomaine(List_Domaine) {
+
+ // Nettoyage du resultat precedent.
+ setResult([]);
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_class_by_domaine/";
+
+ /*if (mymetier === "tout") {
+ //alert(" tout et sortir");
+ setinitAllfiter("1");
+ return;
+
+ }*/
+
+ var form = new FormData();
+ form.append("domaine", List_Domaine);
+ form.append("token", "");
+
+
+ //alert("myurl = "+myurl);
+ axios.post(myurl, form).then(res => {
+ if (String(res.data.status) != String("false")) {
+
+ setmyApiResponse("True");
+ setResult(res.data.message)
+ //textInput.current.focus();
+ setbesoinaiderecherche("");
+ setnewresult("");
+ //console.log(" In getClassByDomaine res.data.status = " + res.data.status);
+ //console.log(" In getClassByDomaine res.data.message = " + res.data.message);
+ //setnewresult(res.data.message);
+ setCurrentPage2(1);
+ if (scrollDiv.current) {
+ scrollDiv.current.scrollIntoView({ behavior: "smooth" });
+ }
+
+ // reinitialisation de tous les filtre
+
+ //setmyApimyApiMessage("OK")
+ //console.log("taille = "+res.data.message.length);
+ }
+ else {
+ //console.log(" In getClassByMetier res.data.status = " + res.data.status);
+ //console.log(" In getClassByMetier res.data.message = " + res.data.message);
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ //textInput.current.focus();
+ }
+
+
+ }).catch((error) => {
+ console.warn(' getClassByMetier : Not good man :( mysearchtext = ');
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ })
+
+ }
+
+ function ReinitFilters() {
+ // Reinitialisation des filtre
+ annulefiltrecertif();
+ annulefiltresupportchecked();
+ annulefiltretypechecked();
+ annulefiltrelieuchecked();
+ annulefiltrecpf();
+ }
+
+ const [mymetier, setmymetier] = useState("");
+
+ function getClassByMetier(my_liste_metier) {
+
+
+ if (NewSearchText && NewSearchText.length > 2) {
+ alert(" Réinitialiser les filtres pour utiliser cette fonctionalité");
+ return;
+ }
+ var myelement;
+
+ if (document.getElementById('rech_middlebox')) {
+ myelement = document.getElementById('rech_middlebox');
+ }
+
+ var check_metier = "";
+ if (document.querySelector('input[name="metier_radio"]:checked')) {
+
+ check_metier = document.querySelector('input[name="metier_radio"]:checked').value;
+ }
+
+ setmymetier(check_metier);
+ ReinitFilters();
+
+
+ if (check_metier === "tout") {
+ // Nettoyage du resultat precedent.
+ setResult([]);
+ setnewresult("");
+ //alert(" tout et sortir");
+
+ setdomaine_v11(domaine_v11_orig);
+ DisplayXfirstClas();
+ //setResult([]);
+
+ /*const pieces = window.location.href.split("/")
+ const last = pieces[pieces.length - 1]
+ const last2 = pieces[pieces.length - 2]
+
+ if (last === "Recherche_new_v2" || last2 === "Recherche_new_v2") {
+ console.log(" ## RELAOD");
+ window.location.reload(true);
+ } else {
+
+
+ history.push("/Recherche_new_v2");
+ }
+ */
+ if (myelement) {
+ // 👇 Will scroll smoothly to the top of the next section
+ myelement.scrollIntoView({ behavior: 'smooth' });
+ }
+ return;
+
+ }
+
+
+
+ // Nettoyage du resultat precedent.
+ setResult([]);
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_class_by_metier/";
+
+
+ var form = new FormData();
+ form.append("metier", check_metier);
+ form.append("token", "");
+
+ //console.log(" recherif pour metier ", check_metier);
+ //alert("myurl = "+myurl);
+ axios.post(myurl, form).then(res => {
+ if (String(res.data.status) != String("false")) {
+
+ setmyApiResponse("True");
+ setResult(res.data.message)
+ //textInput.current.focus();
+ setbesoinaiderecherche("");
+ setnewresult("");
+ //console.log(" In getClassByMetier res.data.status = " + res.data.status);
+ //console.log(" In getClassByMetier res.data.message = " + res.data.message);
+ //setnewresult(res.data.message);
+ setCurrentPage2(1);
+ if (scrollDiv.current) {
+ scrollDiv.current.scrollIntoView({ behavior: "smooth" });
+ }
+
+ // reinitialisation de tous les filtre
+
+ //setmyApimyApiMessage("OK")
+ //console.log("taille = "+res.data.message.length);
+ }
+ else {
+ //console.log(" In getClassByMetier res.data.status = " + res.data.status);
+ //console.log(" In getClassByMetier res.data.message = " + res.data.message);
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ //textInput.current.focus();
+ }
+
+
+ }).catch((error) => {
+ console.warn(' getClassByMetier : Not good man :( mysearchtext = ');
+ setmyApiResponse("False");
+ //setmyApimyApiMessage("")
+ })
+
+ //console.log(" ICI MOVE TO ");
+ if (myelement) {
+ // 👇 Will scroll smoothly to the top of the next section
+ myelement.scrollIntoView({ behavior: 'smooth' });
+ }
+
+ }
+
+
+ const [PartnerMenu, setPartnerMenu] = React.useState(null);
+ const [AccountMenu, setAccountMenu] = React.useState(null);
+ const [ProduitMenu, setproduitMenu] = React.useState(null);
+ const [AvisMenu, setavisMenu] = React.useState(null);
+
+
+
+ const PartnerMenu_Close = () => {
+ setPartnerMenu(null);
+ };
+
+ const AccountMenu_Close = () => {
+ setAccountMenu(null);
+ };
+
+
+ const ProduitMenu_Close = () => {
+ setproduitMenu(null);
+ };
+
+ const handlePartnerMenu = (event) => {
+ setPartnerMenu(event.currentTarget);
+ };
+
+ const handleAccountMenu = (event) => {
+ setAccountMenu(event.currentTarget);
+ };
+
+
+ const handleProduitMenu = (event) => {
+ setproduitMenu(event.currentTarget);
+ };
+
+
+
+
+ const handleClose_Account = () => {
+ //alert(" my account");
+ setAccountMenu(null);
+ };
+
+ const handleBlogMenu = (event) => {
+ setproduitMenu(event.currentTarget);
+ history.push("/Recherche-Article-formation")
+ };
+
+ const handleQuisommesNousMenu = (event) => {
+ setproduitMenu(event.currentTarget);
+ history.push("/qui-sommes-nous")
+ };
+
+ const handleAccountConnexion = () => {
+ setAccountMenu(null);
+ history.push("/Connexion")
+ };
+
+ const handleMyAccount = () => {
+ setAccountMenu(null);
+ history.push("/mysy-user-account")
+ };
+
+
+ const handleMyPartnerAccount = () => {
+ setAccountMenu(null);
+ history.push("/Partner")
+ };
+
+
+ const handleAccountCreation = () => {
+ setAccountMenu(null);
+ history.push("/create_account")
+ };
+
+ const handlePartnerConnexion = () => {
+ setAccountMenu(null);
+ history.push("/PartnerLogin")
+ };
+
+
+ const handleProduitService = () => {
+ setproduitMenu(null);
+ history.push("/tarifs_produits_services/")
+ };
+
+ const handleAvis = () => {
+ setavisMenu(null);
+ history.push("/Recherche-Article-formation")
+ };
+
+ function test() {
+ alert(" coucou");
+ }
+
+
+ const [someoneconnected, setsomeoneconnected] = useState("0");
+ const [partnerconnected, setpartnerconnected] = useState("0");
+ const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']);
+
+ const stored_part = getCookie('tokenmysypart');
+
+
+
+ function whosisconnected() {
+ 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");
+ setsomeoneconnected("1");
+ local_user_connect = 1;
+ //alert(" user connected OK");
+ }
+
+ if (typeof (stored_part) === "undefined" || String(stored_part) === '') {
+ setpartnerconnected("0");
+ local_part_connect = 0;
+ } else {
+ setpartnerconnected("1");
+ setsomeoneconnected("1");
+ local_part_connect = 1;
+ //alert(" partner connected OK");
+ }
+ }
+
+ function handleAccountLogout() {
+
+ if (String(userconnected) === String("1")) {
+ user_logout();
+ }
+ else if (String(partnerconnected) === String("1")) {
+ part_logout();
+ }
+ }
+
+ 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 handleAccountConnexion_v2() {
+
+ if (String(userconnected) === String("1")) {
+ handleMyAccount();
+ }
+ else if (String(partnerconnected) === String("1")) {
+ handleMyPartnerAccount();
+ }
+ }
+
+
+ function part_logout_confirmation() {
+ /* si c'est une connexion partner qui est active */
+ if (typeof (stored_part) != "undefined") {
+ const stored_cookie = getCookie('tokenmysypart');
+ var acces_right_token_name = stored_cookie + "_uar";
+
+ setpartCookie("tokenmysypart", "", { path: '/' });
+
+ setpartCookie(acces_right_token_name, "", { path: '/' });
+ removeCookie(acces_right_token_name, { path: '/' });
+
+ }
+ setsomeoneconnected("0");
+ setDialog_1_open(false);
+ 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 }
+ }
+ ]
+ });
+ }
+
+ const [range_price, setrange_price] = useState({ min: 0, max: 9999, });
+ function rangevalue() {
+ alert(range_price.max + " - " + range_price.min);
+ //console.log(" range = " + range_price);
+ }
+
+ const [trainingonsite, settrainingonsite] = useState()
+ function isonsite() {
+ settrainingonsite(document.querySelector('input[name="TrainingPresentiel"]:checked').value)
+
+ }
+
+ const [certifchecked, setcertifchecked] = useState();
+ function annulefiltrecertif() {
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ var radio = document.querySelector('input[name="TrainingCertif"]:checked');
+ radio.checked = false;
+ setcertifchecked("");
+
+ var toto = "";
+ var filtre1 = "";
+
+
+ // Reinitialisation
+ filtre1 = result;
+ setv11(filtre1);
+
+
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+
+ }
+
+ // recuperation du filtre du CPF
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value;
+ if (crit_TrainingCPF.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF);
+
+ }
+
+ // recuperation du filtre du type
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingType);
+
+ }
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+
+ }
+
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ setnewresult(filtre1);
+ //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType);
+ //console.log("############################ filtre1 = " + filtre1);
+ setCurrentPage2(1);
+ //console.log(" ????????????????????????????filtre2 = "+filtre2);
+
+ }
+ return;
+
+
+ }
+
+
+ function annulefiltrecpf() {
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ var radio = document.querySelector('input[name="TrainingCPF"]:checked');
+ radio.checked = false;
+ setcpfchecked("");
+
+ var toto = "";
+ var filtre1 = "";
+
+
+ // Reinitialisation
+ filtre1 = result;
+ setv11(filtre1);
+
+ // recuperation du filtre de la certification
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value;
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+
+ }
+
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+
+ }
+
+
+ // recuperation du filtre du type
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingType);
+
+ }
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+
+ }
+
+ var crit_TrainingPrice = range_price.min + ":" + range_price.max;
+
+ setnewresult(filtre1);
+ //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType);
+ //console.log("############################ filtre1 = " + filtre1);
+ setCurrentPage2(1);
+ //console.log(" ????????????????????????????filtre2 = "+filtre2);
+
+ }
+ return;
+
+
+ }
+
+ const [supportchecked, setsupportchecked] = useState();
+ function annulefiltresupportchecked() {
+ //var radio = document.querySelector('input[name="TrainingSupport"]:checked');
+ //radio.checked = false;
+ setsupportchecked("");
+ var crit_TrainingSupport = "";
+ var toto = "";
+ var filtre1 = "";
+
+
+
+ // Reinitialisation
+ filtre1 = result;
+ setv11(filtre1);
+
+ // recuperation du filtre de la certification
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value;
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+
+ }
+
+
+ // recuperation du filtre du CPF
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value;
+ if (crit_TrainingCPF.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF);
+
+ }
+
+
+ // recuperation du filtre du type (cours, tuto, etc)
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value;
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType);
+
+ }
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value;
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+ }
+ // Recup du filtre de prix
+ var crit_TrainingPrice = "";
+
+ setnewresult(filtre1);
+
+ //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType);
+ //console.log("############################ filtre1 = " + filtre1);
+ setCurrentPage2(1);
+ //console.log(" ????????????????????????????filtre2 = "+filtre2);
+ }
+
+
+ const [typechecked, settypechecked] = useState();
+ function annulefiltretypechecked() {
+
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ var radio = document.querySelector('input[name="TrainingType"]:checked');
+ radio.checked = false;
+ settypechecked("");
+
+ var toto = "";
+ var filtre1 = "";
+ var filtre2 = "";
+ var filtre3 = "";
+
+
+
+ // Reinitialisation
+ filtre1 = result;
+ setv11(filtre1);
+ //alert("rinitialisation")
+ ;
+
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+
+ }
+
+ // recuperation du filtre du certificat
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+
+ }
+
+ // recuperation du filtre du CPF
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value;
+ if (crit_TrainingCPF.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF);
+
+ }
+
+
+ // recuperation du filtre de la distance
+ var crit_Trainingdistance = "";
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ crit_Trainingdistance = document.querySelector('input[name="TrainingPresentiel"]:checked').value
+ if (crit_Trainingdistance.length > 0) {
+ // filtre presentiel = 1
+ if (String(crit_Trainingdistance) === String("1")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.distantiel === "1");
+ setv11(filtre1);
+
+ }
+ else if (String(crit_Trainingdistance) === String("0")) {
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).presentiel.presentiel === "1");
+ setv11(filtre1);
+ }
+ }
+
+ }
+
+
+ setnewresult(filtre1);
+ //alert("crit_TrainingCertif = " + crit_TrainingCertif + " ET crit_TrainingSupport = " + crit_TrainingSupport + " ET crit_TrainingType = " + crit_TrainingType);
+ //console.log("############################ filtre1 = " + filtre1);
+ setCurrentPage2(1);
+ //console.log(" ????????????????????????????filtre2 = "+filtre2);
+ }
+ return;
+
+ }
+
+
+ const [lieuchecked, setlieuchecked] = useState();
+ function annulefiltrelieuchecked() {
+ if (document.querySelector('input[name="TrainingPresentiel"]:checked')) {
+ var radio = document.querySelector('input[name="TrainingPresentiel"]:checked');
+ radio.checked = false;
+ setlieuchecked("");
+ var toto = "";
+ var filtre1 = "";
+ settrainingonsite('');
+
+
+
+ //reinitialisation des filtres
+ filtre1 = result;
+ setv11(filtre1);
+
+ // Annulation de la suggestion de villes
+ setsuggestioncities([]);
+
+
+ /* Recuperation des autres filtres */
+ // recuperation du filtre du support
+ var crit_TrainingSupport = "";
+ if (document.getElementById("supoort_list_derou")) {
+ crit_TrainingSupport = document.getElementById("supoort_list_derou").value;
+ if (crit_TrainingSupport.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).support === crit_TrainingSupport);
+ }
+
+ // recuperation du filtre du certification
+ var crit_TrainingCertif = "";
+ if (document.querySelector('input[name="TrainingCertif"]:checked')) {
+ crit_TrainingCertif = document.querySelector('input[name="TrainingCertif"]:checked').value;
+ if (crit_TrainingCertif.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).certif === crit_TrainingCertif);
+ }
+
+ // recuperation du filtre du CPF
+ var crit_TrainingCPF = "";
+ if (document.querySelector('input[name="TrainingCPF"]:checked')) {
+ crit_TrainingCPF = document.querySelector('input[name="TrainingCPF"]:checked').value;
+ if (crit_TrainingCPF.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).cpf === crit_TrainingCPF);
+
+ }
+
+ // recuperation du filtre du type (cours, tuto, etc)
+ var crit_TrainingType = "";
+ if (document.querySelector('input[name="TrainingType"]:checked')) {
+ crit_TrainingType = document.querySelector('input[name="TrainingType"]:checked').value;
+ if (crit_TrainingType.length > 0)
+ filtre1 = filtre1.filter((maformation) => JSON.parse(maformation).type === crit_TrainingType);
+ }
+ setnewresult(filtre1);
+ setCurrentPage2(1);
+ }
+ }
+
+ function OnblurHandle(e) {
+ setTimeout(() => {
+ setsuggestion2([])
+ }, 100)
+ }
+
+
+ function OnSuggestionHandler(text) {
+ var val = text;
+ settext(val);
+ }
+
+ function OnCitiesSuggestionHandler(text) {
+ var val = text;
+ setcities(val);
+ document.getElementById("ville").value = val;
+ LeaveCity();
+ // Annulation de la suggestion de villes
+ setsuggestioncities([]);
+ }
+
+ function publiecatalogue() {
+
+ history.push("/Partner", { mysy_arg: 'partner' });
+ }
+
+ function LeaveCity() {
+ TrainingDistancielHandle();
+ }
+
+ function LeaveZipCode() {
+ TrainingDistancielHandle();
+ }
+
+ const Recherche_Domaine_Metier = (event) => {
+
+ //console.log(" ### liste domaine = ", list_domaine);
+ //console.log(" ### liste metier = ", list_metier);
+
+ }
+
+ const [displayAllmetiers, setdisplayAllmetiers] = useState();
+
+ function DisplayAllmetier() {
+ if (displayAllmetiers)
+ setdisplayAllmetiers(false);
+ else
+ setdisplayAllmetiers(true);
+ }
+
+
+ function init_Filter_Change_url() {
+ history.push("/");
+ window.location.reload();
+
+ /* window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });*/
+
+ }
+
+ function message_to_init_Filter_Change_url() {
+ alert(" Réinitialiser les filtres pour réactivier cette fonctionnalité")
+
+ }
+
+
+ const [Dialog_1_message, setDialog_1_message] = React.useState(false);
+ const [Dialog_1_open, setDialog_1_open] = React.useState(false);
+ function Dialog_1_handle_change_participant_session(message) {
+ setDialog_1_message(message);
+ setDialog_1_open(true);
+ }
+
+ const Dialog_1_handleClose = () => {
+ //alert(" Utiliser le bouton 'fermer' ");
+ //setOpen(false);
+ };
+
+ const Dialog_1_handleClose_buton = () => {
+ setDialog_1_open(false);
+ };
+
+
+ //console.log(" c'est url_subdomain ", url_subdomain);
+
+ const [subdomain_recid, setsubdomain_recid] = useState("");
+ const [my_theme_code, setmy_theme_code] = useState("");
+
+
+ const [New_Get_Subdomain_Partner_Data_result, setNew_Get_Subdomain_Partner_Data_result] = useState([]);
+
+ const [Get_Subdomain_Partner_Data_api, setGet_Subdomain_Partner_Data_api] = useState();
+ const [Get_Subdomain_Partner_Data_message, setGet_Subdomain_Partner_Data_message] = useState();
+ const [Get_Subdomain_Partner_Data_result, setGet_Subdomain_Partner_Data_result] = useState();
+ function Get_Subdomain_Partner_Data(local_url_subdomain) {
+
+ let domain = local_url_subdomain;
+ if (local_url_subdomain.includes("://")) {
+ domain = url.split('://')[1];
+ }
+
+ // console.log(" ### local_url_subdomain = ", local_url_subdomain);
+
+ const subdomain = domain.split('.')[0];
+
+ //console.log(" ### subdomain = ", subdomain);
+
+ var form = new FormData();
+
+ form.append("subdomain", subdomain);
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Data_From_Subdomain/";
+
+ axios.post(myurl, form).then(res => {
+
+ if (String(res.data.status) === "true") {
+ //console.log(" In Get_Subdomain_Partner_Data res.data.status = " + res.data.status);
+ // console.log(" In Get_Subdomain_Partner_Data res.data.message r_class = " + res.data.message);
+ setGet_Subdomain_Partner_Data_api("true");
+ setGet_Subdomain_Partner_Data_result(res.data.message);
+
+ var new_data2 = [];
+ const new_data = res.data.message.map((x) => {
+
+ //---
+
+ var _id = JSON.parse(x)._id;
+ var recid = JSON.parse(x).recid;
+ var nom = JSON.parse(x).nom;
+
+ var catalog_pub_logo = JSON.parse(x).catalog_pub_logo;
+ var catalog_pub_banniere_img = JSON.parse(x).catalog_pub_banniere_img;
+
+ var theme_code = JSON.parse(x).theme_code;
+
+ var catalog_pub_message_1_txt = JSON.parse(x).catalog_pub_message_1_txt;
+
+ var catalog_pub_cgv_pdf = ""
+ if (JSON.parse(x).catalog_pub_cgv_pdf)
+ catalog_pub_cgv_pdf = JSON.parse(x).catalog_pub_cgv_pdf;
+
+
+ var catalog_pub_cgu_pdf = ""
+ if (JSON.parse(x).catalog_pub_cgu_pdf)
+ catalog_pub_cgu_pdf = JSON.parse(x).catalog_pub_cgu_pdf;
+
+ var catalog_pub_mention_legale_pdf = ""
+ if (JSON.parse(x).catalog_pub_mention_legale_pdf)
+ catalog_pub_mention_legale_pdf = JSON.parse(x).catalog_pub_mention_legale_pdf;
+
+
+
+ var catalog_pub_message_1_taille = "12"
+ if (JSON.parse(x).catalog_pub_message_1_taille)
+ catalog_pub_message_1_taille = JSON.parse(x).catalog_pub_message_1_taille;
+
+ var catalog_pub_message_1_color = "#000000";
+ if (JSON.parse(x).catalog_pub_message_1_color)
+ catalog_pub_message_1_color = JSON.parse(x).catalog_pub_message_1_color;
+
+ var catalog_pub_message_1_gras = "400"
+ if (JSON.parse(x).catalog_pub_message_1_gras)
+ catalog_pub_message_1_gras = JSON.parse(x).catalog_pub_message_1_gras;
+
+
+ var catalog_pub_message_2_txt = ""
+ if (JSON.parse(x).catalog_pub_message_2_txt)
+ catalog_pub_message_2_txt = JSON.parse(x).catalog_pub_message_2_txt;
+
+
+ var catalog_pub_message_2_taille = "12"
+ if (JSON.parse(x).catalog_pub_message_2_taille)
+ catalog_pub_message_2_taille = JSON.parse(x).catalog_pub_message_2_taille;
+
+ var catalog_pub_message_2_color = "#000000"
+ if (JSON.parse(x).catalog_pub_message_2_color)
+ catalog_pub_message_2_color = JSON.parse(x).catalog_pub_message_2_color;
+
+ var catalog_pub_message_2_gras = "400"
+ if (JSON.parse(x).catalog_pub_message_2_gras)
+ catalog_pub_message_2_gras = JSON.parse(x).catalog_pub_message_2_gras;
+
+
+
+ var catalog_pub_message_3_txt = ""
+ if (JSON.parse(x).catalog_pub_message_3_txt)
+ catalog_pub_message_3_txt = JSON.parse(x).catalog_pub_message_3_txt;
+
+ var catalog_pub_message_3_taille = "12"
+ if (JSON.parse(x).catalog_pub_message_3_taille)
+ catalog_pub_message_3_taille = JSON.parse(x).catalog_pub_message_3_taille;
+
+ var catalog_pub_message_3_color = "#000000";
+ if (JSON.parse(x).catalog_pub_message_3_color)
+ catalog_pub_message_3_color = JSON.parse(x).catalog_pub_message_3_color;
+
+ var catalog_pub_message_3_gras = "400"
+ if (JSON.parse(x).catalog_pub_message_3_gras)
+ catalog_pub_message_3_gras = JSON.parse(x).catalog_pub_message_3_gras;
+
+ // Indicateur 1
+ var catalog_pub_indicateur_1_txt = ""
+ if (JSON.parse(x).catalog_pub_indicateur_1_txt)
+ catalog_pub_indicateur_1_txt = JSON.parse(x).catalog_pub_indicateur_1_txt;
+
+ var catalog_pub_indicateur_1_color = "#000000";
+ if (JSON.parse(x).catalog_pub_indicateur_1_color)
+ catalog_pub_indicateur_1_color = JSON.parse(x).catalog_pub_indicateur_1_color;
+
+ var catalog_pub_indicateur_1_gras = "400"
+ if (JSON.parse(x).catalog_pub_indicateur_1_gras)
+ catalog_pub_indicateur_1_gras = JSON.parse(x).catalog_pub_indicateur_1_gras;
+
+ var catalog_pub_indicateur_1_taille = "12"
+ if (JSON.parse(x).catalog_pub_indicateur_1_taille)
+ catalog_pub_indicateur_1_taille = JSON.parse(x).catalog_pub_indicateur_1_taille;
+
+ // Indicateur 2
+ var catalog_pub_indicateur_2_txt = ""
+ if (JSON.parse(x).catalog_pub_indicateur_2_txt)
+ catalog_pub_indicateur_2_txt = JSON.parse(x).catalog_pub_indicateur_2_txt;
+
+ var catalog_pub_indicateur_2_color = "#000000";
+ if (JSON.parse(x).catalog_pub_indicateur_2_color)
+ catalog_pub_indicateur_2_color = JSON.parse(x).catalog_pub_indicateur_2_color;
+
+ var catalog_pub_indicateur_2_gras = "400"
+ if (JSON.parse(x).catalog_pub_indicateur_2_gras)
+ catalog_pub_indicateur_2_gras = JSON.parse(x).catalog_pub_indicateur_2_gras;
+
+ var catalog_pub_indicateur_2_taille = "12"
+ if (JSON.parse(x).catalog_pub_indicateur_2_taille)
+ catalog_pub_indicateur_2_taille = JSON.parse(x).catalog_pub_indicateur_2_taille;
+
+ // Indicateur 3
+ var catalog_pub_indicateur_3_txt = ""
+ if (JSON.parse(x).catalog_pub_indicateur_3_txt)
+ catalog_pub_indicateur_3_txt = JSON.parse(x).catalog_pub_indicateur_3_txt;
+
+ var catalog_pub_indicateur_3_color = "#000000";
+ if (JSON.parse(x).catalog_pub_indicateur_3_color)
+ catalog_pub_indicateur_3_color = JSON.parse(x).catalog_pub_indicateur_3_color;
+
+ var catalog_pub_indicateur_3_gras = "400"
+ if (JSON.parse(x).catalog_pub_indicateur_3_gras)
+ catalog_pub_indicateur_3_gras = JSON.parse(x).catalog_pub_indicateur_3_gras;
+
+ var catalog_pub_indicateur_3_taille = "12"
+ if (JSON.parse(x).catalog_pub_indicateur_3_taille)
+ catalog_pub_indicateur_3_taille = JSON.parse(x).catalog_pub_indicateur_3_taille;
+
+
+ // Indicateur 4
+ var catalog_pub_indicateur_4_txt = ""
+ if (JSON.parse(x).catalog_pub_indicateur_4_txt)
+ catalog_pub_indicateur_4_txt = JSON.parse(x).catalog_pub_indicateur_4_txt;
+
+ var catalog_pub_indicateur_4_color = "#000000";
+ if (JSON.parse(x).catalog_pub_indicateur_4_color)
+ catalog_pub_indicateur_4_color = JSON.parse(x).catalog_pub_indicateur_4_color;
+
+ var catalog_pub_indicateur_4_gras = "400"
+ if (JSON.parse(x).catalog_pub_indicateur_4_gras)
+ catalog_pub_indicateur_4_gras = JSON.parse(x).catalog_pub_indicateur_4_gras;
+
+ var catalog_pub_indicateur_4_taille = "12"
+ if (JSON.parse(x).catalog_pub_indicateur_4_taille)
+ catalog_pub_indicateur_4_taille = JSON.parse(x).catalog_pub_indicateur_4_taille;
+
+
+ // Les contacts publics
+ var catalog_pub_contact_public_email = ""
+ if (JSON.parse(x).catalog_pub_contact_public_email)
+ catalog_pub_contact_public_email = JSON.parse(x).catalog_pub_contact_public_email;
+
+ var catalog_pub_contact_public_telephone = ""
+ if (JSON.parse(x).catalog_pub_contact_public_telephone)
+ catalog_pub_contact_public_telephone = JSON.parse(x).catalog_pub_contact_public_telephone;
+
+
+ var catalog_pub_theme_id = JSON.parse(x).catalog_pub_theme_id;
+
+ setmy_theme_code(theme_code);
+
+ console.log(" ### theme_code = ", theme_code);
+
+
+ //---
+ var node = {
+ "_id": _id,
+ "recid": recid,
+ "nom": nom,
+ "label": nom,
+
+ "catalog_pub_cgv_pdf": catalog_pub_cgv_pdf,
+ "catalog_pub_cgu_pdf": catalog_pub_cgu_pdf,
+ "catalog_pub_mention_legale_pdf": catalog_pub_mention_legale_pdf,
+
+ "catalog_pub_logo": catalog_pub_logo,
+ "catalog_pub_banniere_img": catalog_pub_banniere_img,
+ "catalog_pub_message_1_txt": catalog_pub_message_1_txt,
+ "catalog_pub_message_1_taille": catalog_pub_message_1_taille,
+ "catalog_pub_message_1_color": catalog_pub_message_1_color,
+ "catalog_pub_message_1_gras": catalog_pub_message_1_gras,
+
+
+ "catalog_pub_message_2_txt": catalog_pub_message_2_txt,
+ "catalog_pub_message_2_taille": catalog_pub_message_2_taille,
+ "catalog_pub_message_2_color": catalog_pub_message_2_color,
+ "catalog_pub_message_2_gras": catalog_pub_message_2_gras,
+
+
+ "catalog_pub_message_3_txt": catalog_pub_message_3_txt,
+ "catalog_pub_message_3_taille": catalog_pub_message_3_taille,
+ "catalog_pub_message_3_color": catalog_pub_message_3_color,
+ "catalog_pub_message_3_gras": catalog_pub_message_3_gras,
+
+ /// les indicateurs
+ "catalog_pub_indicateur_1_txt": catalog_pub_indicateur_1_txt,
+ "catalog_pub_indicateur_1_color": catalog_pub_indicateur_1_color,
+ "catalog_pub_indicateur_1_gras": catalog_pub_indicateur_1_gras,
+ "catalog_pub_indicateur_1_taille": catalog_pub_indicateur_1_taille,
+
+ "catalog_pub_indicateur_2_txt": catalog_pub_indicateur_2_txt,
+ "catalog_pub_indicateur_2_color": catalog_pub_indicateur_2_color,
+ "catalog_pub_indicateur_2_gras": catalog_pub_indicateur_2_gras,
+ "catalog_pub_indicateur_2_taille": catalog_pub_indicateur_2_taille,
+
+ "catalog_pub_indicateur_3_txt": catalog_pub_indicateur_3_txt,
+ "catalog_pub_indicateur_3_color": catalog_pub_indicateur_3_color,
+ "catalog_pub_indicateur_3_gras": catalog_pub_indicateur_3_gras,
+ "catalog_pub_indicateur_3_taille": catalog_pub_indicateur_3_taille,
+
+ "catalog_pub_indicateur_4_txt": catalog_pub_indicateur_4_txt,
+ "catalog_pub_indicateur_4_color": catalog_pub_indicateur_4_color,
+ "catalog_pub_indicateur_4_gras": catalog_pub_indicateur_4_gras,
+ "catalog_pub_indicateur_4_taille": catalog_pub_indicateur_4_taille,
+
+ // les contacts publics
+ "catalog_pub_contact_public_email": catalog_pub_contact_public_email,
+ "catalog_pub_contact_public_telephone": catalog_pub_contact_public_telephone,
+
+ "catalog_pub_theme_id": catalog_pub_theme_id,
+ "theme_code": theme_code,
+
+ };
+ // console.log(" --- node = ", node);
+ new_data2.push(node);
+ });
+
+ if (new_data2.length > 0)
+ setNew_Get_Subdomain_Partner_Data_result(new_data2);
+
+
+ if (res.data.message.length > 0) {
+ var mylocal_materiel = JSON.parse(res.data.message);
+
+
+ if (mylocal_materiel.recid)
+ setsubdomain_recid(mylocal_materiel.recid);
+ else
+ setsubdomain_recid("");
+
+ }
+
+
+ }
+ else {
+ setGet_Subdomain_Partner_Data_api("false");
+ setGet_Subdomain_Partner_Data_message(res.data.message);
+ alert(res.data.message);
+ }
+
+ }).catch((error) => {
+ console.warn('Not good man :( Get_Subdomain_Partner_Data = ', error);
+ setGet_Subdomain_Partner_Data_api("false");
+ alert(" Impossible de recuperer les données du sous domaine");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+ const [display_mode_grid_or_list, setdisplay_mode_grid_or_list] = useState("list");
+
+ function func_display_grid_view() {
+ setdisplay_mode_grid_or_list("grid");
+ }
+
+ function func_display_list_view() {
+ setdisplay_mode_grid_or_list("list");
+ }
+
+
+
+ return (
+
+
+
+
+
+ {/******* Gestion du THEME "MySy_Theme2" */}
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && String(my_theme_code) === "MySy_Theme2" &&
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_banniere_img &&
+
+
+
}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Indicateurs
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt}
+
}
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt}
+
}
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt}
+
}
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt}
+
}
+
+
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 &&
+
+ {New_Get_Subdomain_Partner_Data_result[0].nom}
+ {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_1_txt}
+ }
+
+
+ {New_Get_Subdomain_Partner_Data_result[0] && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_2_txt &&
+ {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_2_txt} }
+
+
+
+
+ Contact
+ Tel : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_telephone}
+ Email : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_email}
+
+
+
+
+
+
+
+
+
+
+
}
+ {/******* FIN Gestion du THEME "MySy_Theme2" */}
+
+
+
+ {/******* Gestion du THEME PAR DEFAULT " */}
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && String(my_theme_code) !== "MySy_Theme2" &&
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_banniere_img &&
+
+
+
}
+
+
+
+
+
+
+
+
+
+ Contact
+ Tel : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_telephone}
+ Email : {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_contact_public_email}
+
+
+
+
Indicateurs
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_1_txt}
+
}
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt}
+
}
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_3_txt}
+
}
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
+ && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt &&
+
{New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_4_txt}
+
}
+
+
+
+
+
+
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 &&
+
+ {New_Get_Subdomain_Partner_Data_result[0].nom}
+ {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_1_txt}
+ }
+
+
+ {New_Get_Subdomain_Partner_Data_result[0] && New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_2_txt &&
+ {New_Get_Subdomain_Partner_Data_result[0].catalog_pub_message_2_txt} }
+
+
+
+
+
+
+
+
+
+
+
}
+
+ {/******* FIN Gestion du THEME PAR DEFAULT " */}
+
+
+
+ {New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0 &&
+ }
+
+
+
+
+ );
+}
+
+
+export default Ent_Intranet;
\ No newline at end of file
diff --git a/src/components/GestionAdministrative.js b/src/components/GestionAdministrative.js
index 5be37a2..ec21fd1 100644
--- a/src/components/GestionAdministrative.js
+++ b/src/components/GestionAdministrative.js
@@ -6734,8 +6734,8 @@ Update du 22/10/2023 - Gestion des champs spécifiques ajoutés par le partenair
{rows_champs_specifics_session &&
rows_champs_specifics_session.map((champ_spec) => (
- {JSON.parse(champ_spec).field_label}
-
+
{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} }
{String(JSON.parse(champ_spec).field_type) === "float" &&
(
- {JSON.parse(champ_spec).field_label}
-
+
{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} }
(
- {JSON.parse(champ_spec).field_label}
-
+
{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} }
logout_user_confirmation()
+ },
+ /* {
+ label: 'Non',
+ onClick: () => retnull()
+
+ }*/
+ ]
+ });
+ }
+
+
+ const onSubmit = async (data) => {
+
+ //console.log(" CONNEXION DE = ",menucompte);
+ var partner_connexion = "";
+ var url_login = "";
+
+ url_login = process.env.REACT_APP_API_URL + "myclass/api/login/";
+ setmenucompte("user");
+ partner_connexion = "user";
+
+
+
+ // console.log( " ### full url_login = ", url_login)
+
+ // Gestion des Cookies
+ const stored_partner = cookie_part.tokenmysypart;
+ const stored_user = cookie.tokenmysych;
+
+ const formData = new FormData();
+ var mymail = document.getElementsByName("email")[0].value;
+ var mypwd = document.getElementsByName("pwd")[0].value;
+
+ formData.append("email", mymail);
+ formData.append("pwd", mypwd);
+
+ var re = /\S+@\S+\.\S+/;
+ if (re.test(mymail) === false) {
+ alert("l'adresse email est incorrecte");
+ return;
+ }
+
+ if (mypwd.length <= 0) {
+ alert("Vous n'avez pas saisi de mot de passe");
+ return;
+ }
+
+
+
+
+ // si c'est une connexion user qui est active
+ if (typeof (stored_user) != "undefined" && String(stored_user) !== String('')) {
+ //alert(" c'est une connexion USERR qui est active");
+ Logout_User();
+ }
+
+
+ fetch(
+ url_login,
+ {
+ method: 'POST',
+ body: formData,
+ }
+ ).then((response) => response.json())
+ .then((result) => {
+ //console.log('Success:', result['message'], "result['status'] = ", result['status']);
+
+ var val = result['status'];
+
+ if (String(val) === String("true")) {
+ setCookie("tokenmysych", result['message']);
+
+ // Verification vers quelle page les renvoyer
+ if (obj === "training" && String(objid).length > 0) {
+ // redirection vers l'affichage d'une formation
+ history.push("/Display-Detail-formation/" + objid);
+ }
+ else {
+ // Redirection par defaut vers la compte de l'apprenant - ENT
+ history.push({
+ pathname: "/mysy-student-account",
+ state: {
+ firstconnexion: String(result['firstconnexion'])
+ }
+ });
+ }
+ }
+
+ else {
+ setisconnected("false");
+ setmyApimyApiMessage(result['message']);
+ }
+ })
+ .catch((error) => {
+ console.error('Error:', error);
+ setisconnected("false");
+ setmyApimyApiMessage("Le service est momentanément indisponible, merci de ressayer plus tard. ");
+
+ });
+ }
+
+
+ const location = useLocation();
+
+ useEffect(() => {
+ setmenucompte("partner");
+
+ const listener = event => {
+ if (event.code === "Enter" || event.code === "NumpadEnter") {
+
+ event.preventDefault();
+
+ onSubmit();
+ }
+ };
+ document.addEventListener("keydown", listener);
+
+ if (String(menucompte) === String("user")) {
+ menu_user_account();
+ }
+ else {
+ menu_parter_account();
+ }
+
+ if (location && location.state && location.state.mysy_arg && String(location.state.mysy_arg) === "partner") {
+ menu_parter_account();
+ }
+
+
+ }, []);
+
+
+
+ function menu_parter_account() {
+ //alert(" menu_parter_account = "+String(menucompte));
+ setmenucompte("partner");
+
+ if (document.getElementsByName("partner_account") && document.getElementsByName("partner_account")[0])
+ document.getElementsByName("partner_account")[0].style.backgroundColor = "#81BC3A";
+
+ if (document.getElementsByName("user_account") && document.getElementsByName("user_account")[0])
+ document.getElementsByName("user_account")[0].style.backgroundColor = "#ffffff";
+
+
+ }
+
+ function menu_user_account() {
+
+ setmenucompte("user");
+
+ if (document.getElementsByName("user_account") && document.getElementsByName("user_account")[0])
+ document.getElementsByName("user_account")[0].style.backgroundColor = "#81BC3A";
+
+
+ }
+
+
+ function resetpasswd_ok(e) {
+
+ var total = " ?? ";
+ if (document.getElementsByName("sommerandom")[0].value) {
+ total = document.getElementsByName("sommerandom")[0].value;
+ }
+ var calcaul_total = parseInt(random1) + parseInt(random2);
+ if (parseInt(total) != parseInt(calcaul_total)) {
+ document.getElementsByName("pasrobot")[0].style.backgroundColor = "red";
+
+ alert(" Le total dans la zone 'je ne suis pas un robot' est incohérent. Recommencez svp :) !!!");
+ return;
+ }
+
+
+ // Controle du mail
+ var mymail = document.getElementsByName("resetemailvalue")[0].value;
+ //alert(" le mail de reset = "+mymail);
+ var re = /\S+@\S+\.\S+/;
+ if (re.test(mymail) === false) {
+ alert("l'adresse email est incorrecte");
+ return;
+ }
+
+ var form = new FormData();
+
+ form.append("email", mymail);
+
+
+ // Controle du type de compte
+ if (String(typecompte) !== "partner" && String(typecompte) !== "user") {
+ alert("Le type de compte est inconnu");
+ document.getElementsByName("is_user_or_pro")[0].style.backgroundColor = "orangered";
+ return;
+ }
+ form.append("account_type", typecompte);
+
+
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/InitUserPasswd/";
+
+ //alert("myurl = "+myurl);
+ axios.post(myurl, form).then(res => {
+ setclosepopup(1);
+ setinitpasswd("true");
+ if (String(res.data.status) != String("false")) {
+ //console.log(" In test res.data.status = " + res.data.status);
+ //console.log(" In test res.data.message = " + res.data.message);
+ setmyApiResponse("true");
+
+ setResult(res.data.message);
+
+ }
+ else {
+ //console.log(" In test res.data.status = " + res.data.status);
+ //console.log(" In test res.data.message = " + res.data.message);
+ setmyApiResponse("false");
+ setResult(res.data.message);
+ }
+
+
+ }).catch((error) => {
+ console.warn('Not good man :( mysearchtext = ');
+ setmyApiResponse("false");
+ setinitpasswd("false");
+ //setmyApimyApiMessage("")
+ })
+
+
+ }
+
+ function resetpasswd(e) {
+ confirmAlert({
+ title: 'Reinitialisation Mot de Passe?',
+ message: 'Confirmez la reinitialisation',
+ buttons: [
+ {
+ label: 'Oui',
+ onClick: () => resetpasswd_ok()
+ },
+ {
+ label: 'Non',
+ onClick: () => { return }
+
+ },
+
+ ],
+ closeOnEscape: false,
+ closeOnClickOutside: false,
+ keyCodeForClose: [8, 32],
+ willUnmount: () => { },
+ afterClose: () => { },
+ onClickOutside: () => { },
+ onKeypress: () => { },
+ onKeypressEscape: () => { },
+ });
+
+ }
+
+
+ function closepopupinitpwd() {
+ setclosepopup("1");
+ }
+
+ // Cette fonction permet de cacher le mot de passer et eviter les
+ // autocompletion
+ const [realpwdvalue, setrealpwdvalue] = useState("");
+ const [realpwdhidenvalue, setrealpwdhidenvalue] = useState("");
+ function realpwd(e) {
+ const val = e.target.value;
+ const last = val.charAt(val.length - 1);
+ var new_val = realpwdvalue;
+ var new_val_hiden = realpwdhidenvalue;
+
+ //alert(" new_val avant saisie= "+new_val);
+ new_val = new_val + last;
+ new_val_hiden = new_val_hiden + "*";
+
+ //alert(" - new_val apres sisie = "+new_val+" new_val_hiden = "+new_val_hiden);
+ setrealpwdhidenvalue(new_val_hiden);
+ setrealpwdvalue(new_val);
+
+ //setrealpwdvalue(val);
+ //document.getElementById("cle_secrete").value = new_val_hiden;
+
+ }
+
+ /* function displayvlaue(){
+ alert(" la valeur secrete = "+realpwdvalue);
+ }*/
+
+
+ const handleClickShowPassword = () => {
+ if (currentpawdvisible == false) {
+ document.getElementsByName("pwd")[0].type = "text";
+ setcurrentpawdvisible(true);
+ }
+ else if (currentpawdvisible == true) {
+ document.getElementsByName("pwd")[0].type = "password";
+ setcurrentpawdvisible(false);
+ }
+ };
+
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ Espace numérique de travail - ENT
+
+
+
+
+
+
+
+ Votre adresse email
+
+
+
+
+
+
+
+
+
+ Votre mot de passe
+
+
+ {currentpawdvisible ? : }
+
+
+
+
+
+
+
+ {String(initpasswd) === String("true") && closepopup === 1 &&
+ La demande reinitialisation a bien ete prise en compte.
+ Verifiez votre boite email.
+
}
+
+ {String(initpasswd) !== String("true") && String(closepopup) !== String("1")
+ &&
Mot de passe oublié}
+ position="center" className="signin popup-reset-pwd">
+
+
Modifier le mot de passe
+
+
+
Saisir votre email
+
+
+
+
+
+
+
+
+
+
+
+ Je ne suis pas un robot
+
+
+
+
{random1} + {random2} =
+
+ {errors.sommerandom && (
+ la sommes est incorrect
+ )}
+
+
+
+
+
Envoyer
+
Annuler
+
+
+
+ }
+
+
+
+
+
+
+
+ Connectez-Vous
+
+
+
+
+
+ {isconnected === "false" &&
+
+ {myApimyApiMessage}
+ }
+
+
+
+
+
+
+
+
+
+
+
+
+ {/*
+
+
*/}
+
+
+
+ );
+}
+
+export default Module_Connexion_Ent_Student;
diff --git a/src/components/Module_Connexion_Intranet_Client.js b/src/components/Module_Connexion_Intranet_Client.js
index b8cb7b8..58db3bb 100644
--- a/src/components/Module_Connexion_Intranet_Client.js
+++ b/src/components/Module_Connexion_Intranet_Client.js
@@ -2,9 +2,6 @@ import React, { useState, useEffect } from "react";
import { useForm } from "react-hook-form";
import { useHistory } from "react-router-dom";
import { Button, FormGroup, Label, Input } from "reactstrap";
-import { FacebookLoginButton, GoogleLoginButton } from "react-social-login-buttons";
-//import { getCookie, setCookie, removeCookie } from 'react-use-cookie';
-import { Helmet } from "react-helmet";
import { useCookies } from "react-cookie";
import { confirmAlert } from 'react-confirm-alert'; // Import
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
@@ -12,14 +9,12 @@ import Popup from 'reactjs-popup';
import 'reactjs-popup/dist/index.css';
import axios from "axios";
import { useParams } from 'react-router-dom'
-
-import Header from "./Header";
import { useLocation } from "react-router-dom";
import Visibility from '@mui/icons-material/Visibility';
import VisibilityOff from '@mui/icons-material/VisibilityOff';
import 'react-tooltip/dist/react-tooltip.css'
import { Tooltip } from 'react-tooltip'
-import Fotter_v3 from "./Fotter_v3";
+
function Module_Connexion_Intranet_Client() {
const [isconnected, setisconnected] = useState("");
@@ -385,7 +380,7 @@ function Module_Connexion_Intranet_Client() {
Intranet Utilisateur
+ style={{ "float": "left", "textAlign": "center", "height": "3rem" }}>Intranet Client
diff --git a/src/components/Mon_Intranet_Public.js b/src/components/Mon_Intranet_Public.js
index fad9213..4e27770 100644
--- a/src/components/Mon_Intranet_Public.js
+++ b/src/components/Mon_Intranet_Public.js
@@ -1,65 +1,18 @@
import React, { useRef, useState, useMemo, useEffect } from "react";
import { useForm } from "react-hook-form";
import axios from "axios";
-import Formation_Partner_Catalog from "./Formation_Partner_Catalog";
-import { FaSearch, FaRegArrowAltCircleDown, FaRegArrowAltCircleUp } from 'react-icons/fa';
-import { BsFillXCircleFill } from "react-icons/bs";
-import { IoAppsSharp, IoListSharp } from "react-icons/io5";
-import Formation_Grid_2Col from "./Formation_Grid_2Col";
-import Pagination from "./TestPagination";
-import data from "./data/mock-data.json";
import { useHistory } from "react-router-dom";
-import { getCookie, removeCookie } from 'react-use-cookie';
-import { Helmet } from "react-helmet";
-
-import AideRecherche from "./AideRecherche"
-import { useParams } from 'react-router-dom'
-import Fotter_Catalog_Pub from "./Fotter_Catalog_Pub";
-import Footer from "./Fotter";
-import LogoutOutlinedIcon from '@mui/icons-material/LogoutOutlined';
-import Button from '@mui/material/Button';
-import MenuItem from "@material-ui/core/MenuItem";
-import Menu from "@material-ui/core/Menu";
-import Header from "./Header";
-
-import connect_white from "../mysy_img/connect_white_v2.png";
-import connect_green from "../mysy_img/connect_green.png";
+import { getCookie, } from 'react-use-cookie';
+import { useParams } from 'react-router-dom';
import { confirmAlert } from 'react-confirm-alert'; // Import
import { useCookies } from "react-cookie";
-import InputRange from 'react-input-range';
import 'react-input-range/lib/css/index.css';
-import tick_ko from "../mysy_img/tick_KO.png";
-
-
-import { SelectChangeEvent } from '@mui/material/Select';
-import Chip from '@mui/material/Chip';
-import Select, { StylesConfig } from 'react-select';
-
import img_header from "../mysy_img2/img_header.png"
-import mysy_logo2 from "../mysy_img2/Logo_MySy.png"
-
-import { AiTwotoneFolder } from "react-icons/ai";
-import serv_img_market_digi from "../mysy_img/market_digi.jpg";
-import serv_img_gestion_admin from "../mysy_img/gestion_admin_2.jpg";
-import serv_img_publication from "../mysy_img/publication.jpg";
-
-import mysy_search from "../mysy_img2/mysy_search.jpg";
-import mysy_lms from "../mysy_img2/mysy_e_learning.jpg";
-import mysy_consulting from "../mysy_img2/mysy_consulting.jpg";
-import mysy_datacenter from "../mysy_img2/mysy_datacenter.png";
-import Dialog from '@mui/material/Dialog';
-import DialogActions from '@mui/material/DialogActions';
-import DialogContent from '@mui/material/DialogContent';
-import DialogContentText from '@mui/material/DialogContentText';
-import DialogTitle from '@mui/material/DialogTitle';
-
import Module_Connexion_Intranet_Client from "./Module_Connexion_Intranet_Client";
import Fotter_Intranet_Client_Pub from "./Fotter_Intranet_Client_Pub"
-import { CiCircleRemove, CiCircleMinus } from "react-icons/ci";
-import Fotter_v3 from "./Fotter_v3";
let PageSize = 10;
const Mon_Intranet_Public = (props) => {
@@ -119,8 +72,6 @@ const Mon_Intranet_Public = (props) => {
const inputEl = useRef(null);
-
-
const url = process.env.REACT_APP_API_URL + "myclass/api/add_user_account/";
const {
register,
@@ -3060,7 +3011,7 @@ const Mon_Intranet_Public = (props) => {
{New_Get_Subdomain_Partner_Data_result && New_Get_Subdomain_Partner_Data_result.length > 0
&& New_Get_Subdomain_Partner_Data_result[0].catalog_pub_indicateur_2_txt &&
{
setisclassimage(res.data.message.img);
var ch_img = "data:image/png;base64," + res.data.message.img;
setclass_img_stored_in_bdd(ch_img);
- // console.log(" getClassImage_no_token: setclass_img_stored_in_bdd = ", setclass_img_stored_in_bdd);
+ // console.log(" getClassImage_no_token: setclass_img_stored_in_bdd = ", setclass_img_stored_in_bdd);
}
else {
- // console.log(" In Erreur res.data.status = " + res.data.status);
+ // console.log(" In Erreur res.data.status = " + res.data.status);
//console.log(" In Erreur res.data.message = " + res.data.message);
setisclassimage("False");
setuserimgclassprofil();
@@ -140,7 +140,7 @@ const New_C_Formation_2025 = (props) => {
useEffect(() => {
setmyfilter(props.myfil);
- // console.log(" #### useEffect props.formation = ", props.formation);
+ // console.log(" #### useEffect props.formation = ", props.formation);
if (typeof (stored_user) === "undefined" || String(stored_user) === '') {
@@ -354,7 +354,7 @@ const New_C_Formation_2025 = (props) => {
{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) &&
(!props.formation.img_url || String(props.formation.img_url).length <= 10) &&
@@ -415,7 +415,7 @@ const New_C_Formation_2025 = (props) => {
}
{(!class_img_stored_in_bdd || String(class_img_stored_in_bdd).length < 50) && String(ismetiermanaged) === "1" &&
-
+
{/*props.formation.institut_formation &&
Dispensé par :
{String(props.formation.institut_formation)}
*/}
@@ -432,7 +432,19 @@ const New_C_Formation_2025 = (props) => {
{String(parse(String(props.formation.title).replace(/(<([^>]+)>)/ig, ''))).substring(0, 50)}
-
{props.formation.price} € HT
+ {props.formation.discounted_price && props.formation.business_prices &&
{props.formation.discounted_price} € HT 111
}
+
+ {props.formation.business_prices.length <= 0
+ &&
{props.formation.price} € HT 22
}
+
+ {props.formation.business_prices && props.formation.business_prices.length > 0 &&
+
+
+
{props.formation.business_prices[0].discounted_price}€ HT
+ {props.formation.price} € HT
+ ({props.formation.business_prices[0].discount} %)
+ }
+
{String(parse(String(props.formation.description).replace(/(<([^>]+)>)/ig, ''))).substring(0, 80)}...
@@ -619,7 +631,7 @@ const New_C_Formation_2025 = (props) => {
}
-
+
diff --git a/src/components/Pricing.js b/src/components/Pricing.js
index dc1a1b7..0e32ee4 100644
--- a/src/components/Pricing.js
+++ b/src/components/Pricing.js
@@ -1,38 +1,21 @@
import React, { useState, useEffect } from "react";
-import { useForm } from "react-hook-form";
import { useHistory } from "react-router-dom";
-import { Button, FormGroup, Label, Input } from "reactstrap";
-import { FacebookLoginButton, GoogleLoginButton } from "react-social-login-buttons";
-//import { getCookie, setCookie, removeCookie } from 'react-use-cookie';
-import { Helmet } from "react-helmet";
-import { useCookies } from "react-cookie";
-import { confirmAlert } from 'react-confirm-alert'; // Import
+import { Button, } from "reactstrap";
import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
-import bannerimg2 from "../mysy_img/MYSY-LOGO-BLUE.png";
import Popup from 'reactjs-popup';
import 'reactjs-popup/dist/index.css';
import axios from "axios";
-import { useParams } from 'react-router-dom'
-import logowhite from "../mysy_img/MYSY-LOGO-WHITE.png";
-import Footer from "./Fotter";
-import MenuItem from "@material-ui/core/MenuItem";
-import Button2 from "@material-ui/core/Button";
-import Menu from "@material-ui/core/Menu";
-import Header from "./Header";
-import { useLocation } from "react-router-dom";
import { AiOutlineEdit, AiOutlinePlusCircle, AiTwotoneDelete } from "react-icons/ai";
import { getCookie } from 'react-use-cookie';
import { DataGrid, GridToolbar, frFR } from '@mui/x-data-grid';
import Box from '@mui/material/Box';
-import InputLabel from '@mui/material/InputLabel';
import InputAdornment from '@mui/material/InputAdornment';
-import FormControl from '@mui/material/FormControl';
import TextField from '@mui/material/TextField';
import AccountCircle from '@mui/icons-material/AccountCircle';
import DatePicker from "react-datepicker";
import "react-datepicker/dist/react-datepicker.css";
import moment from "moment";
-import { set } from "date-fns";
+
function Pricing() {
@@ -50,7 +33,7 @@ function Pricing() {
{ field: 'price_line_id', headerName: '_id', hide: true },
{ field: 'client', headerName: 'Client', width: 150, flex: 1 },
{ field: 'client_recid', headerName: 'Client Id', width: 150, hide: true },
- { field: 'discount', headerName: 'Réduction (%)', width: 100, flex: 1 },
+ { field: 'discount', headerName: 'Réduction (%)', width: 100, flex: 1 },
{ field: 'date_debut', headerName: 'Date début', width: 150, flex: 1 },
{ field: 'date_fin', headerName: 'Date Fin', width: 150, flex: 1 },
@@ -328,14 +311,14 @@ function Pricing() {
if (document.getElementsByName("new_sessiondatedebut") && document.getElementsByName("new_sessiondatedebut")[0]) {
document.getElementsByName("new_sessiondatedebut")[0].disabled = true;
- document.getElementsByName("new_sessiondatedebut")[0].style.backgroundColor = "#ECEFF1";
+ document.getElementsByName("new_sessiondatedebut")[0].style.backgroundColor = "#ECEFF1";
}
if (document.getElementById("new_sessiondatefin")) {
document.getElementById("new_sessiondatefin").disabled = true;
document.getElementById("new_sessiondatefin").style.backgroundColor = "#ECEFF1";
-
+
}
}
@@ -395,6 +378,11 @@ function Pricing() {
GetClientPrices();
GetClientlinked();
GetClientClass();
+
+ window.scrollTo({
+ top: 0,
+ behavior: "smooth",
+ });
}, []);
let [sessionStatus, setsessionStatus] = useState(false);
@@ -828,8 +816,8 @@ function Pricing() {
{String(iseditclientprice) === "1" &&
Modification du prix
-
-
:not(style)': { m: 1 }, width: '100%', }} onChange={DataUpdated_exist_price}>
+
+ :not(style)': { m: 1 }, width: '100%', }} onChange={DataUpdated_exist_price}>
-
+
@@ -951,8 +939,8 @@ function Pricing() {
{String(isaddprice) === "1" &&
Creation d'un nouveau prix client
-
-
:not(style)': { m: 1 }, width: '100%', }} onChange={DataUpdated}>
+
+ :not(style)': { m: 1 }, width: '100%', }} onChange={DataUpdated}>
@@ -998,7 +986,7 @@ function Pricing() {
-
+
diff --git a/src/components/Student_Account.js b/src/components/Student_Account.js
new file mode 100644
index 0000000..971f934
--- /dev/null
+++ b/src/components/Student_Account.js
@@ -0,0 +1,552 @@
+import React, { useState, useEffect } from "react";
+import UpdateUserInfo from "../components/UpdateUserInfo";
+import bannerimg from "../mysy_img/MYSY_banner_compte.png";
+import profileimg from "../mysy_img/MYSY-profil-2.png";
+import Button from '@mui/material/Button';
+import { useHistory } from "react-router-dom";
+
+import UserHistoryRecherche from "../components/UserHistoryRecherche";
+import { confirmAlert } from 'react-confirm-alert'; // Import
+import 'react-confirm-alert/src/react-confirm-alert.css'; // Import css
+import { Helmet } from "react-helmet";
+import { useCookies } from "react-cookie";
+import axios from "axios";
+import { getCookie, } from 'react-use-cookie';
+
+import UpgradeToPro from "./UpgradeToPro"
+import Profil_Objectif from "./ProfilObjectif";
+import { useLocation } from "react-router-dom";
+import { FaHandPointRight } from "react-icons/fa";
+import Intranet_Factures_Client from "./Intranet_Factures_Client";
+import Intranet_Tous_Documents from "./Intranet_Tous_Documents";
+import Modules_Mes_Documents from "./Modules_Mes_Documents";
+import Intranet_Mes_Stagiaires from "./Intranet_Mes_Stagiaires";
+
+function Student_Account() {
+ const [menu, setmenu] = useState("mes_stagiaires");
+ const [cookie, setCookie, removeCookie] = useCookies(['tokenmysych']);
+ const [result, setResult] = useState("");
+ const [myApiResponse, setmyApiResponse] = useState("");
+ const stored_user = getCookie('tokenmysych');
+ const history = useHistory();
+ 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 [userimgprofil, setuserimgprofil] = useState();
+ const [userIp, setuserIp] = useState("");
+ const [username, setusername] = useState("");
+ const [migratedaccount, setmigratedaccount] = useState("0");
+
+ const apiUrl = process.env.REACT_APP_API_URL;
+ const formData = new FormData();
+
+ //alert("stored_user = "+stored_user);
+ const location = useLocation();
+ useEffect(() => {
+
+ var list_menu = ["affichage", "recherche", "upgradecompte", "profil_objectif", "mes_factures", "mes_documents"]
+
+ // getImage();
+
+ if (typeof (stored_user) === "undefined" || String(stored_user) === '') {
+ //alert(" début puch");
+ history.push("/Connexion");
+ }
+
+
+ async function fetchData() {
+ const result = await axios('https://geolocation-db.com/json/',);
+ //alert(result.data.IPv4);
+ 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);
+ }
+ GetUserNameFromToken();
+
+ fetchData();
+
+
+ if (location && location.state && location.state.menu) {
+ displayProfil_Objectif();
+ }
+
+ if (location && location.state && location.state.firstconnexion) {
+ setfirstConnexion(location.state.firstconnexion);
+ }
+
+
+
+
+ }, []);
+
+ const [myimage, setmyimage] = useState();
+ const [isimage, setisimage] = useState();
+
+ function getImage(e) {
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/getRecodedImage/";
+ var form = new FormData();
+ form.append("token", stored_user);
+ form.append("type", "user");
+
+ axios.post(myurl, form).then(res => {
+ if (res.data.status != "False") {
+ //console.log(" getImage : In test res.data.status = " + res.data.status);
+ //console.log(" getImage: res.data.message.img = " + res.data.message);
+ if (res.data.message.img.length > 0) {
+ setisimage("True");
+ }
+ else {
+ setisimage("False");
+ }
+ setmyimage(res.data.message.img);
+ var ch_img = "data:image/png;base64," + res.data.message.img;
+ setuserimgprofil(ch_img);
+ }
+ else {
+ //console.log(" In Erreur res.data.status = " + res.data.status);
+ //console.log(" In Erreur res.data.message = " + res.data.message);
+ setisimage("False");
+ setuserimgprofil(profileimg);
+ }
+ }).catch((error) => {
+ console.warn('Not good man :( mysearchtext = ');
+ setisimage("False");
+ setuserimgprofil(profileimg);
+ })
+
+ }
+
+ const [firstConnexion, setfirstConnexion] = useState("");
+
+
+ function logout_confirmation() {
+ /* si c'est une connexion partner qui est active */
+ if (typeof (stored_user) != "undefined") {
+ removeCookie('tokenmysych', { path: '/' });
+ history.push("/Connexion");
+ }
+ }
+
+ function logout() {
+ confirmAlert({
+ title: 'Deconnexion ?',
+ message: 'Confirmez la deconnexion',
+ buttons: [
+ {
+ label: 'Oui',
+ onClick: () => logout_confirmation()
+ },
+ {
+ label: 'Non',
+ onClick: () => { return }
+ }
+ ]
+ });
+ }
+
+
+ const displayHistory = () => {
+ setmenu("recherche");
+ };
+
+
+ const displayProfil_Objectif = () => {
+ setmenu("profil_objectif");
+ };
+
+
+ const displayProfil_Facture = () => {
+ setmenu("mes_factures");
+ };
+
+ const displayProfil_Devis = () => {
+ setmenu("mes_devis");
+ };
+
+ const displayProfil_Convention = () => {
+ setmenu("mes_conventions");
+ };
+
+ const displayProfil_Convocation = () => {
+ setmenu("mes_convocations");
+ };
+
+
+ const displayProfil_Attestation = () => {
+ setmenu("mes_attestations");
+ };
+
+
+ const displayProfil_Stagiaires = () => {
+ setmenu("mes_stagiaires");
+ };
+
+ const displayProfil_Tout_Documents = () => {
+ setmenu("tout_documents");
+ };
+
+ const displayProfil_Modules_Mes_Documents = () => {
+ setmenu("modules_mes_documents");
+ };
+
+ const upgradetopro = () => {
+ setmenu("upgradecompte");
+ };
+
+ const displayPersoInfo = () => {
+ setmenu("affichage");
+ };
+
+
+
+ const [connected_user_data, setconnected_user_data] = useState();
+
+ function GetUserNameFromToken(event) {
+
+ var form = new FormData();
+
+ form.append("token", stored_user);
+ var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_user_account/";
+
+ axios.post(myurl, form).then(res => {
+ // console.log(" In GetUserNameFromToken res.data.status = " + res.data.status);
+ // console.log(" In GetUserNameFromToken res.data.message = " + res.data.message);
+ if (String(res.data.status) === String("true")) {
+
+ setusername(JSON.parse(res.data.message).email);
+ if (JSON.parse(res.data.message).migrated &&
+ String(JSON.parse(res.data.message).migrated) === String("1")) {
+ setmigratedaccount(String(JSON.parse(res.data.message).migrated));
+ }
+
+
+ setconnected_user_data(JSON.parse(res.data.message));
+
+ }
+ else {
+ //console.log(" In GetUserNameFromToken res.data.status = " + res.data.status);
+ //console.log(" In GetUserNameFromToken res.data.message = " + res.data.message);
+ //setmyApiResponse("false");
+ //setmyApimyApiMessage("")
+ }
+
+
+ }).catch((error) => {
+ console.warn('In GetUserNameFromToken Not good man :( mysearchtext = ', error);
+ //setmyApiResponse("false");
+ //setmyApimyApiMessage("")
+ })
+ }
+
+
+
+ function finaldeleteuseraccount(e) {
+
+ var form = new FormData();
+ form.append("token", stored_user);
+ // 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 myurl = process.env.REACT_APP_API_URL + "myclass/api/send_mail_delete_user/";
+
+
+ axios.post(myurl, form).then(res => {
+ if (String(res.data.status) != String("false")) {
+ //console.log(" In test res.data.status = " + res.data.status);
+ //console.log(" In test res.data.message = " + res.data.message);
+ setmyApiResponse("true");
+ setResult(res.data.message)
+ alert(res.data.message);
+
+ }
+ else {
+ //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) => {
+ console.warn('Not good man :( mysearchtext = ');
+ setmyApiResponse("false");
+ //setmyApimyApiMessage("")
+ })
+
+
+ }
+
+
+ function deletemyaccount(e) {
+ confirmAlert({
+ title: 'Suppremier votre compte',
+ message: 'Cette action va supprimer toutes vos données, Confirmez-vous la suppression du compte ?',
+ buttons: [
+ {
+ label: 'Oui',
+ onClick: () => finaldeleteuseraccount()
+ },
+ {
+ label: 'Non',
+ onClick: () => { return }
+ }
+ ]
+ });
+ }
+
+ const [selectedFile, setSelectedFile] = useState();
+ const [isSelected, setIsSelected] = useState(false);
+ const [isnewimage, setisnewimage] = useState();
+
+
+ const changeHandler = (event) => {
+ let file_size = event.target.files[0].size;
+
+ //or if you like to have name and type
+ 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 > 100000) {
+ alert("L'image doit faire moins de 100 Kilo Octets");
+ return;
+ }
+ setSelectedFile(event.target.files[0]);
+ setIsSelected(true);
+ setuserimgprofil(URL.createObjectURL(event.target.files[0]));
+ };
+
+ function sendImage(e) {
+ formData.append('File', selectedFile);
+ formData.append("token", stored_user);
+ formData.append("type", "user");
+ fetch(
+ process.env.REACT_APP_API_URL + "myclass/api/recordImage/",
+ {
+ method: 'POST',
+ body: formData,
+ }
+ ).then((response) => response.json())
+ .then((result) => {
+ //console.log('Success:', result['message']);
+ setIsSelected(false);
+
+ })
+ .catch((error) => {
+ console.error('Error:');
+ setIsSelected(true);
+ });
+ };
+
+ return (
+
+
+ Création compte MySy Trainig Technology
+
+
+
+
+
+
+
Éditeur Français de logiciels pour organisme de formation. Avec solutions de E-Learning, gestion administrative et gestion relation client nous accompagnons les organismes de formation à réaliser l’audit QUALIOPI en toute sérénité. Nous sommes les moins cher du marché. Nous vous accompagnons automatiser vos process : inscription, évaluation, émargement (qr-code), Check-list QUALIOPI, Personnalisation et édition documents,
+ Gestion formateurs, Catalogue formations personnalisé
+
+
+
+
+
+
Intranet Apprenant - Connexion MySy Training Technology
+
+
+
+
+
+
+ {!isSelected &&
+
+ Changer image
+
}
+
+ {isSelected &&
+ Enregistrer
+
}
+
+
+
{username && {username} }
+ {!username && xxxx }
+
+
+ {/** Menu pour un utilisateur de type 'user'. Exemple, l'intranet du client d'un client */}
+
+
+
+
+ {/** Menu pour un utilisateur NON type 'user' exemple un apprenant */}
+ {connected_user_data && connected_user_data.type &&
+ String(connected_user_data.type) === "student" &&
+
+
+
+
INFORMATIONS PERSONNELLES
+
+
MES FORMATIONS
+
+
MON PLANNING
+
+
MES NOTES
+
+
MES DOCUMENTS
+
+
MODULE TOUS DOCUMENTS
+
+
+ {/*
SUPPRIMER MON COMPTE
+
*/}
+
}
+
+
+
+
+ {String(firstConnexion) === "1" &&
+
+
+ Cher Utilisateur, c'est votre première connexion,
+ Nous sommes ravis de vous accueillir. Nous vous invitons à modifier votre mot de passe à partir du menu "MES INFORMATIONS" ==> Pavé "SECURITE" puis "MODIFIER"
+ setfirstConnexion()} className="firstConnexion_bton"> Fermer
+ Merci.
+
+
+
}
+
+ {String(myApiResponse) === String("true") &&
+ {result}
+
+
}
+
+ {String(myApiResponse) !== String("true") &&
+ {result}
+
+
}
+
+ {connected_user_data && connected_user_data.type &&
ESPACE ENT - {connected_user_data.type} }
+
+
+ {String(menu) === String("affichage") &&
}
+
+ {String(menu) === String("recherche") &&
}
+
+ {String(menu) === String("upgradecompte") &&
}
+
+ {String(menu) === String("profil_objectif") &&
}
+
+ {String(menu) === String("mes_factures") && connected_user_data && connected_user_data.partner_owner_recid &&
+ connected_user_data.partner_client_id &&
+
}
+
+
+
+
+ {String(menu) === String("modules_mes_documents") && connected_user_data && connected_user_data.partner_owner_recid &&
+ connected_user_data.partner_client_id &&
+
}
+
+ {String(menu) === String("mes_devis") && connected_user_data && connected_user_data.partner_owner_recid &&
+ connected_user_data.partner_client_id &&
+
}
+
+ {String(menu) === String("mes_conventions") && connected_user_data && connected_user_data.partner_owner_recid &&
+ connected_user_data.partner_client_id &&
+
}
+
+
+ {String(menu) === String("mes_convocations") && connected_user_data && connected_user_data.partner_owner_recid &&
+ connected_user_data.partner_client_id &&
+
}
+
+ {String(menu) === String("mes_attestations") && connected_user_data && connected_user_data.partner_owner_recid &&
+ connected_user_data.partner_client_id &&
+
}
+
+
+ {String(menu) === String("mes_stagiaires") && connected_user_data && connected_user_data.partner_owner_recid &&
+ connected_user_data.partner_client_id &&
+
}
+
+
+
+
+ {String(menu) === String("mes_documents") &&
}
+
+
+
+
+
+
+
+
+ );
+}
+
+export default Student_Account;
+
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 7ea4471..7a2cd88 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
@@ -1459,10 +1459,12 @@ const New_C_Detail_Formation_2025 = (props) => {
{String(DetailTraining["price"]) && String(DetailTraining["price"]) !== String("0") && DetailTraining.business_prices && Object.keys(DetailTraining.business_prices).length > 0
&& DetailTraining["price"] &&
-
{String(DetailTraining.business_prices[0].discounted_price)} € HT
+
{String(DetailTraining.business_prices[0].discounted_price)} € HT
-
{String(DetailTraining["price"])} € HT
-
(- {String(DetailTraining.business_prices[0].discount)} % )
+ {DetailTraining.business_prices && DetailTraining.business_prices.length > 0 &&
+ {String(DetailTraining["price"])} € HT
+ (- {String(DetailTraining.business_prices[0].discount)} % )
+
}
}
@@ -1734,7 +1736,7 @@ const New_C_Detail_Formation_2025 = (props) => {
{(JSON.parse(formation).date_fin).substring(0, 10)}
A Distance
}
- {(JSON.parse(formation).mode_animation) === "1" &&
+ {(JSON.parse(formation).mode_animation) === "1" &&
(JSON.parse(formation).date_debut).substring(0, 10) === (JSON.parse(formation).date_fin).substring(0, 10) &&
Le
@@ -1742,7 +1744,7 @@ const New_C_Detail_Formation_2025 = (props) => {
}
- {(JSON.parse(formation).mode_animation) === "0" &&
+ {(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 -
@@ -2070,8 +2072,8 @@ const New_C_Detail_Formation_2025 = (props) => {