From 15a5f4c5275121dfb9ea0a015feaa7abda85f118 Mon Sep 17 00:00:00 2001 From: Cherif Date: Mon, 9 Jun 2025 19:37:48 +0200 Subject: [PATCH] sds --- src/components/Apprenant.js | 44 +++-- src/components/DisplayPartnerSession.js | 15 +- src/components/DisplayPartnerStagiaires.js | 26 +-- src/components/Module_Agenda.js | 2 +- src/components/Module_Ent_Mes_Formations.js | 18 +-- .../Module_Session_Planification.js | 153 +++++++++++------- src/components/Modules_Mes_Documents.js | 2 +- src/components/Notes_Evaluation.js | 3 +- src/components/Partner_Config_Formulaires.js | 2 +- src/components/Partner_Config_Technique.js | 19 --- src/components/Student_Account.js | 3 +- 11 files changed, 157 insertions(+), 130 deletions(-) diff --git a/src/components/Apprenant.js b/src/components/Apprenant.js index 7b5bac9..da8cbda 100644 --- a/src/components/Apprenant.js +++ b/src/components/Apprenant.js @@ -203,6 +203,19 @@ const Apprenant = (props) => { { field: 'employeur', headerName: 'Employeur', minWidth: 150, hide: true, editable: false }, { field: 'client_nom', headerName: 'Client', minWidth: 150, flex: 1, hide: false, editable: false }, + { + field: 'is_ent_compte', headerName: 'ENT compte', minWidth: 100, flex: 1, hide: false, editable: false, renderCell: (cellValues) => { + return ( +
+ {String(cellValues.row.is_ent_compte) === "1" && "Oui"}  + {String(cellValues.row.is_ent_compte) !== "1" && "Non"}  + +
+ + ); + }, + }, + { @@ -288,12 +301,12 @@ const Apprenant = (props) => { const columns_apprenant_inscriptions = [ - { field: 'id', headerName: 'id', hide: true }, - { field: '_id', headerName: '_id', hide: true }, - { field: 'session_id', headerName: 'session_id', hide: true, Width: 1 }, + { field: 'id', headerName: 'id', hide: true, disableExport: true, }, + { field: '_id', headerName: '_id', hide: true, disableExport: true, }, + { field: 'session_id', headerName: 'session_id', hide: true, Width: 1, disableExport: true, }, { field: 'session_code', headerName: 'Code Session', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, { field: 'class_title', headerName: 'Titre Formation', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, - { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, Width: 1 }, + { field: 'class_internal_url', headerName: 'class_internal_url', hide: true, Width: 1, disableExport: true, }, { field: 'status', headerName: 'Statut', hide: false, flex: 1, minWidth: 50, maxWidth: 70, valueFormatter: (params) => { @@ -310,13 +323,13 @@ const Apprenant = (props) => { } }, - { field: 'client_rattachement_id', headerName: 'client__id', hide: true, Width: 1 }, + { field: 'client_rattachement_id', headerName: 'client__id', hide: true, Width: 1, disableExport: true, }, { field: 'client_rattachement_nom', headerName: 'Client', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, { field: 'date_debut', headerName: 'Début', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, { field: 'date_fin', headerName: 'Fin', hide: false, minWidth: 200, flex: 1, renderCell: (params) => , }, - { field: 'presentiel', headerName: 'Présentiel', hide: false, flex: 1, minWidth: 50, maxWidth: 70 }, - { field: 'distanciel', headerName: 'Distantiel', hide: false, flex: 1, minWidth: 50, maxWidth: 70 }, + { field: 'presentiel', headerName: 'Présentiel', hide: false, flex: 1, minWidth: 50, maxWidth: 70, hide: true, Width: 1, disableExport: true, }, + { field: 'distanciel', headerName: 'Distantiel', hide: false, flex: 1, minWidth: 50, maxWidth: 70, hide: true, Width: 1, disableExport: true, }, { field: 'class_recyclage_delai', headerName: 'Recycl. Delai', hide: false, flex: 1, minWidth: 100, }, { field: 'class_recyclage_periodicite', headerName: 'Recycl. Perio', hide: false, flex: 1, minWidth: 100, }, @@ -642,6 +655,8 @@ const Apprenant = (props) => { const [p_detail_email, setp_detail_email] = useState(""); const [p_detail_naissance, setp_detail_naissance] = useState(new Date().toLocaleDateString('fr-FR')); + const [p_detail_is_ent_compte, setp_detail_is_ent_compte] = useState(""); + // ajout 04/06/2025 const [p_detail_is_handicap, setp_detail_is_handicap] = useState(false); const [p_detail_is_droit_image, setp_detail_is_droit_image] = useState(false); @@ -828,6 +843,12 @@ const Apprenant = (props) => { setp_detail_civilite(""); } + if (mylocaltraining.is_ent_compte) { + setp_detail_is_ent_compte(mylocaltraining.is_ent_compte); + } else { + setp_detail_is_ent_compte(""); + } + if (mylocaltraining.email) { setp_detail_email(mylocaltraining.email); } else { @@ -2437,7 +2458,7 @@ const Apprenant = (props) => { Disable_ENT_Account_Apprenant(liste_apprenant); } - if (String(actionmass_ftion_val) === String("enable_ent")) { + if (String(actionmass_ftion_val) === String("enable_ent")) { Enable_ENT_Account_Apprenant(liste_apprenant); } @@ -5323,7 +5344,7 @@ const Apprenant = (props) => { { "id": "0", "label": "Dupliquer", "value": "dupliquer" }, { "id": "1", "label": "Exporter", "value": "exporter" }, { "id": "3", "label": "(R)Inscrire", "value": "inscrire" }, - { "id": "4", "label": "ENT Créer acceès", "value": "create_ent" }, + { "id": "4", "label": "ENT Créer accès", "value": "create_ent" }, { "id": "5", "label": "ENT Désactiver", "value": "disable_ent" }, { "id": "2", "label": "Supprimer", "value": "supprimer" }, ] @@ -7231,6 +7252,9 @@ const Apprenant = (props) => { employeur: JSON.parse(item).employeur, client_nom: JSON.parse(item).client_rattachement_nom, + is_ent_compte: JSON.parse(item).is_ent_compte, + + } ))} @@ -8109,7 +8133,7 @@ const Apprenant = (props) => {
- {/* */} + {} {} - {String(promo_archive_status) === "1" &&
@@ -21470,6 +21473,7 @@ const DisplayPartnerSession = (props) => { } } } + readOnly={!edit_session_form} showTimeSelect={false} filterTime={filterPassedTime_end} dateFormat="dd/MM/yyyy" @@ -21517,6 +21521,8 @@ const DisplayPartnerSession = (props) => { } } + + readOnly={!edit_session_form} showTimeSelect={false} //filterTime={filterPassedTime_start} dateFormat="dd/MM/yyyy" @@ -21544,6 +21550,7 @@ const DisplayPartnerSession = (props) => { } } } + readOnly={!edit_session_form} showTimeSelect={false} //filterTime={filterPassedTime_end} dateFormat="dd/MM/yyyy" diff --git a/src/components/DisplayPartnerStagiaires.js b/src/components/DisplayPartnerStagiaires.js index bae5039..6392e51 100644 --- a/src/components/DisplayPartnerStagiaires.js +++ b/src/components/DisplayPartnerStagiaires.js @@ -10147,8 +10147,8 @@ const DisplayPartnerStagiaires = (props) => {

- {
-
+ {String(selected_id_status) !== "1" &&
  • L'image doit etre carrée.
  • @@ -10186,26 +10186,10 @@ const DisplayPartnerStagiaires = (props) => {
  • La taille de l'image ne doit pas dépasser 1 mega octet
  • -
    +
    } - - {/*
    -
    - -
    -
    - -
    */} +
    diff --git a/src/components/Module_Agenda.js b/src/components/Module_Agenda.js index 9d9f7a0..ed9e414 100644 --- a/src/components/Module_Agenda.js +++ b/src/components/Module_Agenda.js @@ -1194,7 +1194,7 @@ const Module_Agenda = (props) => { const New_Option_Type_Ressource = [ { "id": "0", "label": "Employe", "value": "ressource_humaine" }, - { "id": "1", "label": "Materiel", "value": "ressource_materielle" }, + { "id": "1", "label": "Materiel & Salle", "value": "ressource_materielle" }, ] diff --git a/src/components/Module_Ent_Mes_Formations.js b/src/components/Module_Ent_Mes_Formations.js index e246d90..2859663 100644 --- a/src/components/Module_Ent_Mes_Formations.js +++ b/src/components/Module_Ent_Mes_Formations.js @@ -2013,20 +2013,16 @@ const Module_Ent_Mes_Formations = (props) => {
    */}
    -
    diff --git a/src/components/Module_Session_Planification.js b/src/components/Module_Session_Planification.js index bd17ac8..c1e8ddc 100644 --- a/src/components/Module_Session_Planification.js +++ b/src/components/Module_Session_Planification.js @@ -589,6 +589,13 @@ const Module_Session_Planification = (props) => { alert(" Impossible de supprimer le modèle de planification"); }) } + + + const myRef_seq_calendrier_01 = useRef(null) + + const [position_h_myRef_seq_calendrier_01, setposition_h_myRef_seq_calendrier_01] = useState('1500'); + + const myRef_seq_ressource = useRef(null) const myRef_add_session = useRef(null) @@ -630,7 +637,7 @@ const Module_Session_Planification = (props) => { const renderEventContent = (eventInfo) => { - // console.log(" TOTOTOTOTO ", eventInfo.event); + // console.log(" TOTOTOTOTO ", eventInfo.event); return ( <> {eventInfo.timeText}
    @@ -805,8 +812,6 @@ const Module_Session_Planification = (props) => { setDelete_Sequence_Session_Data_Mass_api("true"); setDelete_Sequence_Session_Data_Mass_result(res.data.message); - Getall_Sequence_Of_Session(selected_session_id); - setDialog_seq_ressource_1_selected_type_ressource(""); setDialog_seq_ressource_1_selected_ressource_id(""); setDialog_seq_ressource_1_selected_ressource_poste(""); @@ -817,8 +822,9 @@ const Module_Session_Planification = (props) => { setAdd_One_Sequence_Session_mass(); settab_selected_sequence_id([]); setselectionModel_sequence([]); + setGetall_Sequence_Of_Session_result_planning_view([]); - + Getall_Sequence_Of_Session(selected_session_id); // alert(res.data.message); setdisplay_alert_mysy("1"); setalert_message(res.data.message); @@ -1036,11 +1042,16 @@ const Module_Session_Planification = (props) => { form.append("related_target_collection_id", new_ressource_id); if (String("new_ressource_type") === "ressource_humaine" && String(new_ressource_poste).trim() === "") { - alert(" Vous devez préciser le poste occupé pour cette ressource"); + // alert(" Vous devez préciser le poste occupé pour cette ressource"); + + setdisplay_alert_mysy("1"); + setalert_message(" Vous devez préciser le poste occupé pour cette ressource"); + setalert_type("error"); + return; } - console.log(" form uuu == ", form); + // console.log(" form uuu == ", form); var myurl = process.env.REACT_APP_API_URL + "myclass/api/Add_Sequence_Affectation_Ressource_Poste/"; @@ -2243,6 +2254,17 @@ const Module_Session_Planification = (props) => { const handleEventClick = (arg) => { + if (document.getElementById('myRef_seq_calendrier_01')) { + var divh = document.getElementById('myRef_seq_calendrier_01').offsetTop; + setposition_h_myRef_seq_calendrier_01(document.getElementById('myRef_seq_calendrier_01').offsetTop) + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + + console.log(" ### divh = ", divh) + } + setp_detail_sequence_title(arg.event.title) setsequence_startDate(arg.event.start) @@ -2253,7 +2275,7 @@ const Module_Session_Planification = (props) => { setGetall_List_Sequence_Ressource_result([]); setselectionModel_sequence([]); - // console.log(" ### arg.event.extendedProps = ", arg.event.extendedProps); + // console.log(" ### arg.event.extendedProps = ", arg.event.extendedProps); //console.log(" ### arg.event.extendedProps.local_type = ", arg.event.extendedProps.local_type); @@ -2311,7 +2333,7 @@ const Module_Session_Planification = (props) => { if (arg.event.extendedProps.local_grp_apprenant_id) { setp_detail_sequence_groupe_apprenant_id(arg.event.extendedProps.local_grp_apprenant_id); - //console.log(" ## arg.event.extendedProps.local_grp_apprenant_id = ", arg.event.extendedProps.local_grp_apprenant_id) + // console.log(" ## arg.event.extendedProps.local_grp_apprenant_id = ", arg.event.extendedProps.local_grp_apprenant_id) } else setp_detail_sequence_groupe_apprenant_id(""); @@ -2357,7 +2379,7 @@ const Module_Session_Planification = (props) => { const New_Option_Type_Ressource = [ { "id": "0", "label": "Employe", "value": "ressource_humaine" }, - { "id": "1", "label": "Materiel", "value": "ressource_materielle" }, + { "id": "1", "label": "Materiel & Salle", "value": "ressource_materielle" }, { "id": "", "label": "", "value": "" }, ] @@ -2825,6 +2847,8 @@ const Module_Session_Planification = (props) => { if (new_data2.length > 0) setNew_Getall_Partner_Groupe_Inscrit_result(new_data2); + //console.log(" ### New_Getall_Partner_Groupe_Inscrit_result new_data2 = ", new_data2) + } else { setGetall_Partner_Groupe_Inscrit_api("false"); @@ -3056,10 +3080,18 @@ const Module_Session_Planification = (props) => { if (document.getElementById('menu_import_participant')) { setdefault_h(document.getElementById('menu_import_participant').offsetTop) - - // console.log(" hh = ", document.getElementById('menu_import_participant').offsetTop); } + + if (document.getElementById('myRef_seq_calendrier_01')) { + var divh = document.getElementById('myRef_seq_calendrier_01').offsetTop; + setposition_h_myRef_seq_calendrier_01(document.getElementById('myRef_seq_calendrier_01').offsetTop) + window.scrollTo({ + top: divh, + behavior: "smooth", + }); + + } }, []) const [SessionendDate, setSessionendDate] = useState(props.SessionendDate); @@ -3093,23 +3125,21 @@ const Module_Session_Planification = (props) => { function Get_Ressource_Avabilities(local_related_collection_recid) { var form = new FormData(); - - var event_start = String(selected_sequence_startDate); var event_end = String(selected_sequence_endDate); - - - //var event_start = format(String(line[0].eval_date_heure_debut), 'dd/MM/yyyy HH:mm'); - //var event_end = format(String(line[0].eval_date_heure_fin), 'dd/MM/yyyy HH:mm'); - + var local_event_start = moment(sequence_startDate).format("DD/MM/YYYY HH:mm"); + var local_event_end = moment(sequence_endDate).format("DD/MM/YYYY HH:mm"); const stored_cookie = getCookie('tokenmysypart'); form.append("token", stored_cookie); form.append("related_collection", Dialog_seq_ressource_1_selected_type_ressource); form.append("related_collection_recid", local_related_collection_recid); - form.append("event_start", String(event_start)); - form.append("event_end", String(event_end)); + // form.append("event_start", String(event_start)); + // form.append("event_end", String(event_end)); + + form.append("event_start", String(local_event_start)); + form.append("event_end", String(local_event_end)); //console.log(" ### form = ", form) @@ -3166,10 +3196,15 @@ const Module_Session_Planification = (props) => { function submenu_sequence_ressource() { if (!selected_sequence_id || String(selected_sequence_id).length < 3) { - alert("Vous devez créer la séquence avant d'ajouter des ressources "); + // alert("Vous devez créer la séquence avant d'ajouter des ressources "); + setdisplay_alert_mysy("1"); + setalert_message("Vous devez créer la séquence avant d'ajouter des ressources "); + setalert_type("error"); return; } setsubmenu_seq_dialog("dialog_ressource"); + setDialog_seq_ressource_1_selected_ressource_id(""); + setDialog_seq_ressource_1_selected_type_ressource(""); } @@ -3423,6 +3458,11 @@ const Module_Session_Planification = (props) => { setdisplay_alert_mysy(""); } + const [coord, setCoord] = useState({ x: 0, y: 0 }); + const handleMouseMove = (e) => { + setCoord({ x: e.screenX, y: e.screenY }); + }; + return (
    @@ -3746,7 +3786,7 @@ const Module_Session_Planification = (props) => { style: { overflowY: 'unset', position: 'absolute', - top: '7rem', + top: position_h_myRef_seq_calendrier_01, // zzzz margin: "2px", }, }} @@ -3810,13 +3850,14 @@ const Module_Session_Planification = (props) => { options={New_Option_Type_Ressource} value={New_Option_Type_Ressource.filter((data) => (data).value === String(Dialog_seq_ressource_1_selected_type_ressource))[0].label} onChange={(event, value) => { + setDialog_seq_ressource_1_selected_ressource_id(""); if (value && value.value) { setDialog_seq_ressource_1_selected_type_ressource(value.value); } else { setDialog_seq_ressource_1_selected_type_ressource(""); setGet_Ressource_Avabilities_avability_check(""); - setDialog_seq_ressource_1_selected_ressource_id(""); + } setGet_Ressource_Avabilities_avability_check(""); @@ -3844,7 +3885,6 @@ const Module_Session_Planification = (props) => { onChange={(event, value) => { if (value && value._id) { setDialog_seq_ressource_1_selected_ressource_id(value._id); - //console.log(" ### check_ressource_avabilities = ", check_ressource_avabilities) if (check_ressource_avabilities === "1") { // On ne fait le controle de disponibilité que si on une sequence precise. pas quand c'est en masse. @@ -3897,10 +3937,10 @@ const Module_Session_Planification = (props) => { onChange={(event, value) => { if (value && value._id) { setDialog_seq_ressource_1_selected_ressource_id(value._id); - if (check_ressource_avabilities === "1") { - // On ne fait le controle de disponibilité que si on une sequence precise. pas quand c'est en masse. - Get_Ressource_Avabilities(value._id); - } + + // On ne fait le controle de disponibilité que si on une sequence precise. pas quand c'est en masse. + Get_Ressource_Avabilities(value._id); + } else { setGet_Ressource_Avabilities_avability_check(""); @@ -3912,16 +3952,16 @@ const Module_Session_Planification = (props) => { } /> - {check_ressource_avabilities === "1" && Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "0" && + {Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "0" && } - {check_ressource_avabilities === "1" && Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "1" && + {Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "1" &&
    @@ -4189,7 +4229,7 @@ const Module_Session_Planification = (props) => {
    Groupe apprenants - + p_detail_sequence_groupe_apprenant_id = {p_detail_sequence_groupe_apprenant_id}
    {New_Getall_Class_List_UE_result && New_Getall_Class_List_UE_result.length > 0 && { setp_detail_sequence_groupe_apprenant_id(""); } - }} renderInput={(params) => @@ -4458,6 +4497,8 @@ const Module_Session_Planification = (props) => { options={New_Option_Type_Ressource} onChange={(event, value) => { + + setDialog_seq_ressource_1_selected_ressource_id(""); if (value && value.value) { setDialog_seq_ressource_1_selected_type_ressource(value.value); @@ -4493,10 +4534,10 @@ const Module_Session_Planification = (props) => { setDialog_seq_ressource_1_selected_ressource_id(value._id); //console.log(" ### check_ressource_avabilities = ", check_ressource_avabilities) - if (check_ressource_avabilities === "1") { - // On ne fait le controle de disponibilité que si on une sequence precise. pas quand c'est en masse. - Get_Ressource_Avabilities(value._id); - } + + // On ne fait le controle de disponibilité que si on une sequence precise. pas quand c'est en masse. + Get_Ressource_Avabilities(value._id); + } else { setGet_Ressource_Avabilities_avability_check(""); setDialog_seq_ressource_1_selected_ressource_id(""); @@ -4506,16 +4547,16 @@ const Module_Session_Planification = (props) => { renderInput={(params) => } /> - {check_ressource_avabilities === "1" && Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "0" && + {Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "0" &&
    } - {check_ressource_avabilities === "1" && Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "1" && + {Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "1" &&
    @@ -4557,16 +4598,16 @@ const Module_Session_Planification = (props) => { } /> - {check_ressource_avabilities === "1" && Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "0" && + {Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "0" && } - {check_ressource_avabilities === "1" && Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "1" && + {Get_Ressource_Avabilities_avability_check && String(Get_Ressource_Avabilities_avability_check) === "1" &&
    @@ -4663,7 +4704,7 @@ const Module_Session_Planification = (props) => {
    - +