diff --git a/src/components/AddClassManual.js b/src/components/AddClassManual.js index 0e9742e..15523cc 100644 --- a/src/components/AddClassManual.js +++ b/src/components/AddClassManual.js @@ -6571,12 +6571,12 @@ const AddClassManual = (props) => { } if (mylocaltraining.ATTESTATION_FORMATION_PDF) { - console.log(" ### eeee = ", mylocaltraining.ATTESTATION_FORMATION_PDF) + // console.log(" ### eeee = ", mylocaltraining.ATTESTATION_FORMATION_PDF) setselected_default_attestation_PDF(mylocaltraining.ATTESTATION_FORMATION_PDF); } if (mylocaltraining.ATTESTATION_FORMATION_MAIL) { - console.log(" ### iii = ", mylocaltraining.ATTESTATION_FORMATION_MAIL) + // console.log(" ### iii = ", mylocaltraining.ATTESTATION_FORMATION_MAIL) setselected_default_attestation_Email(mylocaltraining.ATTESTATION_FORMATION_MAIL); } @@ -7972,7 +7972,7 @@ const AddClassManual = (props) => { {p_detail_archive && String(p_detail_archive) === "1" &&
Document Archivé
} - +
diff --git a/src/components/Apprenant.js b/src/components/Apprenant.js index b1ee977..56e9413 100644 --- a/src/components/Apprenant.js +++ b/src/components/Apprenant.js @@ -2694,9 +2694,6 @@ const Apprenant = (props) => { setDialog_add_inscription_open(true); } - const Dialog_add_inscription_handleClose = () => { - - }; const Dialog_add_inscription_handleClose_buton = () => { setDialog_add_inscription_open(false); diff --git a/src/components/DisplayPartnerTrainingsPagination.js b/src/components/DisplayPartnerTrainingsPagination.js index 21940d5..8ae6f21 100644 --- a/src/components/DisplayPartnerTrainingsPagination.js +++ b/src/components/DisplayPartnerTrainingsPagination.js @@ -97,6 +97,8 @@ const DistplayPartnerTraningsPage = (props) => { const stored_cookie_catalog_data_row_grouped_by = getCookie('mysy_catalog_data_row_grouped_by'); + + const history = useHistory(); const [myApiResponse, setmyApiResponse] = useState("false"); const filters = [ @@ -374,6 +376,7 @@ const DistplayPartnerTraningsPage = (props) => { //form.append("token","K3cw63eKokKSbV4spjQ48SUNnfy80yrXfA"); const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); + form.append("is_ftion_initiale", props.class_is_ftion_initiale); var myurl = process.env.REACT_APP_API_URL + "myclass/api/get_partner_class/"; @@ -442,6 +445,8 @@ const DistplayPartnerTraningsPage = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); + form.append("is_ftion_initiale", props.class_is_ftion_initiale); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/find_partner_class_like/"; fetch(myurl, @@ -493,6 +498,8 @@ const DistplayPartnerTraningsPage = (props) => { const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); + form.append("is_ftion_initiale", props.class_is_ftion_initiale); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/find_partner_class_like/"; fetch(myurl, { @@ -2219,7 +2226,7 @@ const DistplayPartnerTraningsPage = (props) => { setGetall_Parter_bloc_competence_api("true"); setGetall_Parter_bloc_competence_result(res.data.message); - //setRows(res.data.message); + var new_data2 = []; const new_data = res.data.message.map((x) => { @@ -2929,7 +2936,7 @@ const DistplayPartnerTraningsPage = (props) => {
- {} + {}
@@ -3072,7 +3079,11 @@ const DistplayPartnerTraningsPage = (props) => { } -

Mes formations

+

Mes formations   + {props.class_is_ftion_initiale && props.class_is_ftion_initiale === "1" && Initiales} + {props.class_is_ftion_initiale && props.class_is_ftion_initiale !== "1" && Continues} + +

Utilisez les filtres !
@@ -3563,7 +3574,7 @@ const DistplayPartnerTraningsPage = (props) => { presentiel: JSON.parse(item).presentiel.presentiel, distanciel: JSON.parse(item).presentiel.distantiel, cible: JSON.parse(item).pourqui, - currency: JSON.parse(item).currecny, + currency: JSON.parse(item).currency, archive: JSON.parse(item).archive, version: JSON.parse(item).version, @@ -3772,7 +3783,7 @@ const DistplayPartnerTraningsPage = (props) => { presentiel: JSON.parse(item).presentiel.presentiel, distanciel: JSON.parse(item).presentiel.distantiel, cible: JSON.parse(item).pourqui, - currency: JSON.parse(item).currecny, + currency: JSON.parse(item).currency, version: JSON.parse(item).version, diff --git a/src/components/Employes.js b/src/components/Employes.js index 41b9d78..86cef27 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -1249,6 +1249,8 @@ const Employes = (props) => { form.append("tab_scope_session", tab_scope_session_id); + form.append("user_menu", p_detail_user_menu); + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Update_User_Access_Scope/"; setLoading(true); @@ -1528,6 +1530,8 @@ const Employes = (props) => { setp_detail_lms_virtualhost_url(''); setp_detail_mysy_lms_user_id(''); setp_detail_lms_account_disable(''); + setp_detail_formation_initale(""); + setp_detail_user_menu("") } @@ -1593,6 +1597,10 @@ const Employes = (props) => { const [p_detail_lms_account_disable, setp_detail_lms_account_disable] = useState(""); + const [p_detail_formation_initale, setp_detail_formation_initale] = useState(""); + + const [p_detail_user_menu, setp_detail_user_menu] = useState(""); + const [p_detail_user_pass, setp_detail_user_pass] = useState(""); @@ -1786,6 +1794,21 @@ const Employes = (props) => { } + if (mylocal_employe.formation_initiale) { + setp_detail_formation_initale(mylocal_employe.formation_initiale); + } else { + setp_detail_formation_initale(""); + } + + + + if (mylocal_employe.user_menu) { + setp_detail_user_menu(mylocal_employe.user_menu); + } else { + setp_detail_user_menu(""); + } + + if (mylocal_employe.user_login) { setp_detail_user_login(mylocal_employe.user_login); @@ -4690,7 +4713,7 @@ const Employes = (props) => { }; - + const [p_new_login, setp_new_login] = React.useState(""); const [p_new_pwd, setp_new_pwd] = React.useState(""); const [p_conf_new_login, setp_conf_new_login] = React.useState(""); @@ -7106,7 +7129,6 @@ const Employes = (props) => { )); }; - const [scope_changed, setscope_changed] = React.useState(""); const [Dialog_signature_digitale_message, setDialog_signature_digitale_message] = React.useState(false); @@ -7355,7 +7377,7 @@ const Employes = (props) => { { "id": "4", "label": "ENT Créer accès", "value": "create_ent" }, { "id": "5", "label": "ENT Désactiver", "value": "disable_ent" }, { "id": "6", "label": "ENT Réactiver", "value": "enable_ent" }, - + ] const [actionmass_ftion_val, setactionmass_ftion_val] = useState(); @@ -7571,7 +7593,13 @@ const Employes = (props) => { }) } - + const New_Option_Menu = [ + { "id": "0", "label": "Menu Formation Continue", "value": "0" }, + { "id": "1", "label": "Menu Formation Initiale", "value": "1" }, + { "id": "2", "label": "Ftion Continue & Ftion Initiale", "value": "2" }, + { "id": "", "label": "", "value": "" }, + ] + return (
@@ -9739,7 +9767,7 @@ const Employes = (props) => { options={New_Option} onChange={(event, value) => { if (value && value.value) { - if ( String(value.value) === "create_ent" + if (String(value.value) === "create_ent" || String(value.value) === "disable_ent" || String(value.value) === "enable_ent" @@ -9764,7 +9792,7 @@ const Employes = (props) => { {String(props.check_user_acces_right("employe", "write")) === "1" && selectionModel && selectionModel.length >= 1 && - actionmass_ftion_val && String(actionmass_ftion_val).length > 2 && [ 'create_ent', 'disable_ent', 'enable_ent'].includes(actionmass_ftion_val) && + actionmass_ftion_val && String(actionmass_ftion_val).length > 2 && ['create_ent', 'disable_ent', 'enable_ent'].includes(actionmass_ftion_val) &&
diff --git a/src/components/Module_Absence.js b/src/components/Module_Absence.js index 2415c16..3a60786 100644 --- a/src/components/Module_Absence.js +++ b/src/components/Module_Absence.js @@ -15,7 +15,7 @@ import fr from 'date-fns/locale/fr'; import { registerLocale } from 'react-datepicker'; import DatePicker from "react-datepicker"; import "react-datepicker/dist/react-datepicker.css"; - +import Autocomplete from '@mui/material/Autocomplete'; import moment from "moment"; import Box from '@mui/material/Box'; @@ -98,6 +98,7 @@ const Module_Absence = (props) => { const columns = [ { field: '_id', headerName: '_id', hide: true }, { field: 'id', headerName: 'id', hide: true }, + { field: 'session_id', headerName: 'session_id', hide: true }, { field: 'event_type', headerName: 'Type', flex: 1, hide: false, editable: false }, { field: 'event_title', headerName: 'Titre', flex: 1, hide: false, editable: false, }, { @@ -121,6 +122,7 @@ const Module_Absence = (props) => { return "" }, }, + { field: 'code_session', headerName: 'Session/promo', flex: 1, hide: false, editable: false, }, { field: 'event_comment', headerName: 'Comment', flex: 1, hide: true, editable: false, }, @@ -198,9 +200,11 @@ const Module_Absence = (props) => { 'start': String(JSON.parse(obj).event_start), 'end': String(JSON.parse(obj).event_end), 'id': String(JSON.parse(obj)._id), - 'type': String(JSON.parse(obj).event_type), 'justified': String(JSON.parse(obj).justified), + 'session_id': String(JSON.parse(obj).session_id), + 'code_session': String(JSON.parse(obj).code_session), + } } else { local_val = { @@ -211,6 +215,8 @@ const Module_Absence = (props) => { 'comment': "", 'type': String(JSON.parse(obj).event_type), 'justified': String(JSON.parse(obj).justified), + 'session_id': String(JSON.parse(obj).session_id), + 'code_session': String(JSON.parse(obj).code_session), } } @@ -283,6 +289,8 @@ const Module_Absence = (props) => { 'comment': String(JSON.parse(obj).comment), 'type': String(JSON.parse(obj).event_type), 'justified': String(JSON.parse(obj).justified), + 'session_id': String(JSON.parse(obj).session_id), + 'code_session': String(JSON.parse(obj).code_session), } } else { local_val = { @@ -293,6 +301,8 @@ const Module_Absence = (props) => { 'comment': "", 'type': String(JSON.parse(obj).event_type), 'justified': String(JSON.parse(obj).justified), + 'session_id': String(JSON.parse(obj).session_id), + 'code_session': String(JSON.parse(obj).code_session), } } @@ -366,6 +376,8 @@ const Module_Absence = (props) => { 'comment': String(JSON.parse(obj).comment), 'type': String(JSON.parse(obj).event_type), 'justified': String(JSON.parse(obj).justified), + 'session_id': String(JSON.parse(obj).session_id), + 'code_session': String(JSON.parse(obj).code_session), } } else { local_val = { @@ -376,6 +388,8 @@ const Module_Absence = (props) => { 'comment': "", 'type': String(JSON.parse(obj).event_type), 'justified': String(JSON.parse(obj).justified), + 'session_id': String(JSON.parse(obj).session_id), + 'code_session': String(JSON.parse(obj).code_session), } } @@ -495,9 +509,10 @@ const Module_Absence = (props) => { setp_detail_end(info.end) setp_detail_comment(""); setp_detail_event_id(""); + setp_detail_session_id("") setp_detail_justified(false); setp_detail_event_type("absence"); - + setStartDate(info.start); setendDate(info.end); @@ -525,6 +540,8 @@ const Module_Absence = (props) => { const handleSelect_list = (info) => { + setp_detail_data_changed(""); + if (String(selected_attendee_email).length < 2) { // alert(res.data.message); @@ -542,6 +559,7 @@ const Module_Absence = (props) => { setp_detail_end(new_start_date) setp_detail_comment(""); setp_detail_event_id(""); + setp_detail_session_id("") setp_detail_justified(false); setp_detail_event_type("absence"); @@ -557,13 +575,14 @@ const Module_Absence = (props) => { //console.log(eventInfo); return ( <> - {eventInfo.timeText}
- {eventInfo.event.title} + {eventInfo.timeText}
+ {eventInfo.event.extendedProps.code_session && {eventInfo.event.extendedProps.code_session}} ) }; const handleEventClick = (arg) => { + setp_detail_data_changed(""); if (String(props.check_user_acces_right("stagiaire", "write")) === "1") { if (String(selected_attendee_email).length < 2) { @@ -585,6 +604,12 @@ const Module_Absence = (props) => { else setp_detail_comment(""); + if (arg.event.extendedProps.session_id) { + setp_detail_session_id(arg.event.extendedProps.session_id); + } + else + setp_detail_session_id(""); + if (arg.event.extendedProps.justified) { if (String(arg.event.extendedProps.justified) === "true") @@ -617,11 +642,10 @@ const Module_Absence = (props) => { const handleEventClick_from_list = (selected_row_id) => { - + setp_detail_data_changed(""); var line = JSON.parse(mysy_list_event_for_map[selected_row_id]); - if (String(selected_attendee_email).length < 2) { // alert(" Vous devez choisir un stagiaire"); // alert(res.data.message); @@ -636,6 +660,7 @@ const Module_Absence = (props) => { setp_detail_start(line.event_start) setp_detail_end(line.event_end) setp_detail_event_id(line._id); + setp_detail_session_id(line.session_id) if (line.comment) { setp_detail_comment(line.comment); @@ -685,9 +710,11 @@ const Module_Absence = (props) => { setp_detail_end() setp_detail_comment(""); setp_detail_event_id(""); + setp_detail_session_id(""); setp_detail_justified(false); setp_detail_event_type("absence"); setDialog_1_open(false); + setp_detail_data_changed(""); } @@ -747,20 +774,114 @@ const Module_Absence = (props) => { //setmyApimyApiMessage("") }) } + const [New_Getall_Partner_Session_Reduice_Fields_result, setNew_Getall_Partner_Session_Reduice_Fields_result] = useState([]); + + const [Getall_Partner_Session_Reduice_Fields_api, setGetall_Partner_Session_Reduice_Fields_api] = useState(); + const [Getall_Partner_Session_Reduice_Fields_message, setGetall_Partner_Session_Reduice_Fields_message] = useState(); + const [Getall_Partner_Session_Reduice_Fields_result, setGetall_Partner_Session_Reduice_Fields_result] = useState(); + function Getall_Partner_Session_Reduice_Fields(event) { + + var form = new FormData(); + const stored_cookie = getCookie('tokenmysypart'); + form.append("token", stored_cookie); + form.append("type_session", "1"); + + var myurl = process.env.REACT_APP_API_URL + "myclass/api/Get_Partner_Session_Ftion_Reduice_Fields/"; + + axios.post(myurl, form).then(res => { + + if (String(res.data.status) === String("true")) { + //console.log(" In Getall_Partner_Session_Reduice_Fields res.data.status = " + res.data.status); + //console.log(" In Getall_Partner_Session_Reduice_Fields res.data.message r_class = " + res.data.message); + setGetall_Partner_Session_Reduice_Fields_api("true"); + setGetall_Partner_Session_Reduice_Fields_result(res.data.message); + setRows(res.data.message); + + var new_data2 = []; + const new_data = res.data.message.map((x) => { + + //--- + var localid = JSON.parse(x).id; + var local_id = JSON.parse(x)._id; + var local_code_session = JSON.parse(x).code_session; + var local_titre = JSON.parse(x).titre; + var local_class_internal_url = JSON.parse(x).class_internal_url; + var local_date_debut = JSON.parse(x).date_debut; + var local_date_fin = JSON.parse(x).date_fin; + + + + //--- + var node = { + "_id": local_id, + "id": localid, + "label": local_code_session, + "code_session": local_code_session, + "titre": local_titre, + "class_internal_url": local_class_internal_url, + "date_debut": local_date_debut, + "date_fin": local_date_fin, + }; + new_data2.push(node); + }); + + + //--- + var node = { + "_id": "", + "id": "", + "label": "", + "code_session": "", + "titre": "", + "class_internal_url": "", + "date_debut": "", + "date_fin": "", + }; + new_data2.push(node); + + + if (new_data2.length > 0) + setNew_Getall_Partner_Session_Reduice_Fields_result(new_data2); + + } + else { + setGetall_Partner_Session_Reduice_Fields_api("false"); + setGetall_Partner_Session_Reduice_Fields_message(res.data.message); + // alert(res.data.message) + setdisplay_alert_mysy("1"); + setalert_message(res.data.message); + setalert_type("error"); + } + + }).catch((error) => { + console.warn('Not good man :( Getall_Partner_Session_Reduice_Fields = ', error); + setGetall_Partner_Session_Reduice_Fields_api("false"); + // alert(" Impossible de recuperer la liste des sessions de formation (classe)"); + setdisplay_alert_mysy("1"); + setalert_message(" Impossible de recuperer la liste des promotions de formation (classe)"); + setalert_type("error"); + //setmyApimyApiMessage("") + }) + } useEffect(() => { Get_Connected_User_List_Agenda_Events(); Get_Partner_Debut_Fin_Journee(); + Getall_Partner_Session_Reduice_Fields(); //Getall_Training_Employee_No_Filter(); //Getall_Training_Materiel_No_Filter(); }, [attendee_email]) + const [p_detail_data_changed, setp_detail_data_changed] = useState(""); const [p_detail_event_id, setp_detail_event_id] = useState(); const [p_detail_title, setp_detail_title] = useState(); + + const [p_detail_session_id, setp_detail_session_id] = useState(""); + const [p_detail_start, setp_detail_start] = useState(); const [p_detail_end, setp_detail_end] = useState(); const [p_detail_comment, setp_detail_comment] = useState(); @@ -824,6 +945,7 @@ const Module_Absence = (props) => { form.append("event_type", p_detail_event_type); form.append("justified", p_detail_justified); + form.append("session_id", p_detail_session_id); @@ -844,8 +966,9 @@ const Module_Absence = (props) => { Get_List_Agenda_Events_For_Given_User(selected_attendee_email); setp_detail_event_id(); - setp_detail_title(); - setp_detail_start(); + setp_detail_title(""); + setp_detail_start(""); + setp_detail_session_id("") setp_detail_end(); setp_detail_comment(); setp_detail_justified(false); @@ -915,6 +1038,7 @@ const Module_Absence = (props) => { setp_detail_event_id(); setp_detail_title(); + setp_detail_session_id("") setp_detail_start(); setp_detail_end(); setp_detail_comment(); @@ -1015,7 +1139,7 @@ const Module_Absence = (props) => { style: { overflowY: 'unset', position: 'absolute', - top: '35rem', + //top: '35rem', margin: "2px", maxWidth: 'unset', }, @@ -1037,7 +1161,7 @@ const Module_Absence = (props) => { MySy Information - {Dialog_1_message} + {Dialog_1_message}
-
+
-
Titre + +
Titre
{ value={p_detail_title} onChange={(e) => { - if (String(props.write_access) === "1") + + if (String(props.write_access) === "1") { setp_detail_title(e.target.value); + setp_detail_data_changed("1"); + } } } @@ -1117,15 +1248,52 @@ const Module_Absence = (props) => {
+
Promotion
+ {New_Getall_Partner_Session_Reduice_Fields_result && New_Getall_Partner_Session_Reduice_Fields_result.length > 0 && + + (data)._id === String(p_detail_session_id))[0].label} + onChange={(event, value) => { + + setp_detail_data_changed("1"); + if (value && value._id) { + setp_detail_session_id(value._id); + } else { + setp_detail_session_id(""); + } + }} + + renderInput={(params) => + } + /> + + } + +
+ +