From ebbcc401d25f791bbfdad3f2adc154fe390bdb5c Mon Sep 17 00:00:00 2001 From: cherif Date: Thu, 8 May 2025 19:01:50 +0200 Subject: [PATCH] 08/05/2025 - 19 --- src/components/DisplayPartnerSession.js | 3 +- src/components/Employes.js | 4 +- src/components/Jurys.js | 1 + .../Module_Session_Notes_Classement.js | 455 ++++++++++++++++-- src/components/Notes_Evaluation.js | 4 +- src/components/UpdateAttendeeList.js | 2 +- 6 files changed, 421 insertions(+), 48 deletions(-) diff --git a/src/components/DisplayPartnerSession.js b/src/components/DisplayPartnerSession.js index 35eab0e..09af28b 100644 --- a/src/components/DisplayPartnerSession.js +++ b/src/components/DisplayPartnerSession.js @@ -26080,7 +26080,8 @@ const DisplayPartnerSession = (props) => { related_collection_recid={selected_session_id} SessionstartDate={new Date(moment(SessionstartDate, "DD/MM/YYYY"))} SessionendDate={new Date(moment(SessionendDate, "DD/MM/YYYY"))} session_formateur_id={p_formateur_id} session_class_id={session_selected_class_id} - selected_session_invoiced_statut={selected_session_invoiced_statut} /> + selected_session_invoiced_statut={selected_session_invoiced_statut} + jury_cell_editable={false} /> } diff --git a/src/components/Employes.js b/src/components/Employes.js index 36c2846..ebdee3c 100644 --- a/src/components/Employes.js +++ b/src/components/Employes.js @@ -10718,9 +10718,7 @@ const Employes = (props) => { } {String(submenu) === "droit_acces" &&
- - - +
diff --git a/src/components/Jurys.js b/src/components/Jurys.js index 15d5e22..513d516 100644 --- a/src/components/Jurys.js +++ b/src/components/Jurys.js @@ -4464,6 +4464,7 @@ const Jury = (props) => { related_collection={"session_formation"} related_collection_recid={p_detail_linked_collection_recid} session_class_id={JSON.parse(GetCurrentSession_result).class_id} + jury_cell_editable={true} />
} diff --git a/src/components/Module_Session_Notes_Classement.js b/src/components/Module_Session_Notes_Classement.js index 5b80468..d373a0c 100644 --- a/src/components/Module_Session_Notes_Classement.js +++ b/src/components/Module_Session_Notes_Classement.js @@ -28,6 +28,8 @@ import InputAdornment from '@mui/material/InputAdornment'; import { AiFillCloseCircle } from "react-icons/ai"; import { MdAddCircleOutline, MdRemoveCircleOutline } from "react-icons/md"; import Module_Alert_Confirmation from "./Module_Alert_Confirmation"; +import Checkbox from '@mui/material/Checkbox'; + function PaperComponent(props) { return ( @@ -65,7 +67,10 @@ const useStyles = makeStyles((theme) => ({ const Module_Session_Notes_Classement = (props) => { const classes = useStyles(); const history = useHistory(); - const [submenu, setsubmenu] = useState(""); + + + const [jury_cell_editable, setjury_cell_editable] = useState(props.jury_cell_editable); + const [rowss, setRows] = useState([]); const [isLoading, setLoading] = useState(); @@ -99,6 +104,70 @@ const Module_Session_Notes_Classement = (props) => { ); } + function ExpandableCell_50_bg_hiligt({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + + function ExpandableCell_50_bg_hiligt_red_color({ value }) { + const [expanded, setExpanded] = React.useState(false); + + return ( + + ); + } + function Display_Colunm_text({ value }) { @@ -110,6 +179,8 @@ const Module_Session_Notes_Classement = (props) => { ); } + + const columns_list_session_note_classement_final = [ { field: 'id', headerName: 'id', hide: true }, { field: '_id', headerName: '_id', hide: true }, @@ -117,14 +188,68 @@ const Module_Session_Notes_Classement = (props) => { { field: 'session_id', headerName: 'session_id', hide: true }, { field: 'class_id', headerName: 'class_id', hide: true }, + + { field: 'nom', headerName: 'Nom', minwidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { field: 'prenom', headerName: 'Prenom', minwidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => , }, { field: 'rang', headerName: 'Rang', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => , }, - { field: 'note_finale', headerName: 'Noete finale', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { + field: 'note_finale', headerName: 'Noete finale', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => , + + }, + { field: 'credit_acquis', headerName: 'Credit acquis', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => , }, - { field: 'rang_calculation_date', headerName: 'Date Calcul', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => , }, + { field: 'rang_calculation_date', headerName: 'Date Calcul', minwidth: 100, flex: 1, hide: true, editable: false, renderCell: (params) => , }, + { field: 'jury_note', headerName: 'Note Jury', width: 200, editable: jury_cell_editable, renderCell: (params) => , align: "center", }, + { field: 'jury_comment', headerName: 'Comment Jury', width: 200, editable: jury_cell_editable, renderCell: (params) => , align: "center", }, + + + + { + field: 'jury_validation', headerName: 'Validation Jury', width: 150, hide: false, editable: jury_cell_editable, + renderCell: (cellValues) => { + return ( + + + + ); + } + }, + { + field: 'jury_validation_champ_technique', headerName: 'Validation Jury_tech', width: 200, renderCell: (params) => , align: "center", + }, ] @@ -629,6 +754,11 @@ const Module_Session_Notes_Classement = (props) => { var rang_calculation_date = JSON.parse(x).rang_calculation_date; var credit_acquis = JSON.parse(x).credit_acquis; + var jury_note = JSON.parse(x).jury_note; + var jury_comment = JSON.parse(x).jury_comment; + var jury_validation = JSON.parse(x).jury_validation; + + //--- var node = { "_id": local_id, @@ -645,6 +775,10 @@ const Module_Session_Notes_Classement = (props) => { "rang_calculation_date": rang_calculation_date, "credit_acquis": credit_acquis, + "jury_note": jury_note, + "jury_comment": jury_comment, + "jury_validation": jury_validation, + }; new_data2.push(node); }); @@ -664,6 +798,10 @@ const Module_Session_Notes_Classement = (props) => { "rang_calculation_date": "", "credit_acquis": "", + "jury_note": "", + "jury_comment": "", + "jury_validation": "", + }; new_data2.push(node); @@ -693,6 +831,14 @@ const Module_Session_Notes_Classement = (props) => { useEffect(() => { + /* + if (props.jury_cell_editable) { + setjury_cell_editable(props.jury_cell_editable) + } else { + setjury_cell_editable(false); + } + */ + Getall_Session_Detail_Final_Note_Classement(); Getall_Session_UE_Final_Note_Classement(); Getall_Session_Final_Note_Classement(); @@ -989,6 +1135,14 @@ const Module_Session_Notes_Classement = (props) => { } + const New_Option_Valisation_Jury = [ + { "id": "1", "label": "Oui", "value": "1" }, + { "id": "0", "label": "Non ", "value": "0" }, + { "id": "", "label": "", "value": "" }, + + ] + + const New_Option_Filter = [ { "id": "ue_id", "label": "Code UE", "value": "ue_id" }, { "id": "inscrit_id", "label": "Apprenant ", "value": "inscrit_id" }, @@ -1018,6 +1172,230 @@ const Module_Session_Notes_Classement = (props) => { } + function Jury_Update_Final_Session() { + const new_note_session_with_jury_JSON = JSON.stringify(New_Getall_Session_Final_Note_Classement_result); + + console.log(" new_note_session_with_jury_JSON = ", new_note_session_with_jury_JSON); + console.log(" New_Getall_Session_Final_Note_Classement_result = ", New_Getall_Session_Final_Note_Classement_result); + } + + + function OnchangeCellDataGrid(params) { + + + // params = la nouvelle lignes + + + var num_line = params.id; // ==> Id de la ligne changé + var colomn = params.field; // ==> colonne de la ligne changé + var new_value = params.value; // ==> la nouvelle valeur + + + + const updatedData = New_Getall_Session_Final_Note_Classement_result.map((x) => { + + var localid = (x).id; + + + if (String(num_line) === String(localid) && colomn === "jury_note") { + var tmp = {}; + tmp['id'] = (x).id; + tmp['_id'] = (x)._id; + tmp['inscription_id'] = (x).inscription_id; + tmp['session_id'] = (x).session_id; + tmp['class_id'] = (x).class_id; + tmp['nom'] = (x).nom; + tmp['prenom'] = (x).prenom; + + + tmp['rang'] = (x).rang; + tmp['note_finale'] = (x).note_finale; + tmp['credit_acquis'] = (x).credit_acquis; + tmp['rang_calculation_date'] = (x).rang_calculation_date; + + + tmp['jury_note'] = new_value; + tmp['jury_comment'] = (x).jury_comment; + tmp['jury_validation'] = (x).jury_validation; + tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique; + + return tmp; + + + } + + if (String(num_line) === String(localid) && colomn === "jury_comment") { + var tmp = {}; + tmp['id'] = (x).id; + tmp['_id'] = (x)._id; + tmp['inscription_id'] = (x).inscription_id; + tmp['session_id'] = (x).session_id; + tmp['class_id'] = (x).class_id; + tmp['nom'] = (x).nom; + tmp['prenom'] = (x).prenom; + + + tmp['rang'] = (x).rang; + tmp['note_finale'] = (x).note_finale; + tmp['credit_acquis'] = (x).credit_acquis; + tmp['rang_calculation_date'] = (x).rang_calculation_date; + + + tmp['jury_note'] = (x).jury_note; + tmp['jury_comment'] = new_value; + tmp['jury_validation'] = (x).jury_validation; + tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique; + + return tmp; + } + + if (String(num_line) === String(localid) && colomn === "jury_validation") { + var tmp = {}; + tmp['id'] = (x).id; + tmp['_id'] = (x)._id; + tmp['inscription_id'] = (x).inscription_id; + tmp['session_id'] = (x).session_id; + tmp['class_id'] = (x).class_id; + tmp['nom'] = (x).nom; + tmp['prenom'] = (x).prenom; + + + tmp['rang'] = (x).rang; + tmp['note_finale'] = (x).note_finale; + tmp['credit_acquis'] = (x).credit_acquis; + tmp['rang_calculation_date'] = (x).rang_calculation_date; + + + tmp['jury_note'] = (x).jury_note; + tmp['jury_comment'] = (x).jury_comment; + tmp['jury_validation'] = new_value; + tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique; + + + return tmp; + } + + + var tmp = {}; + tmp['id'] = (x).id; + tmp['_id'] = (x)._id; + tmp['inscription_id'] = (x).inscription_id; + tmp['session_id'] = (x).session_id; + tmp['class_id'] = (x).class_id; + tmp['nom'] = (x).nom; + tmp['prenom'] = (x).prenom; + + + tmp['rang'] = (x).rang; + tmp['note_finale'] = (x).note_finale; + tmp['credit_acquis'] = (x).credit_acquis; + tmp['rang_calculation_date'] = (x).rang_calculation_date; + + + tmp['jury_note'] = (x).jury_note; + tmp['jury_comment'] = (x).jury_comment; + tmp['jury_validation'] = (x).jury_validation; + tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique; + + return tmp; + + + }); + + // console.log(" ### updatedData = ", updatedData); + + setNew_Getall_Session_Final_Note_Classement_result([]); + + setNew_Getall_Session_Final_Note_Classement_result(updatedData); + + } + + + function mysy_onchange_list(num_line, colomn, new_value) { + + + // params = la nouvelle lignes + /* + + var num_line = params.id; // ==> Id de la ligne changé + var colomn = params.field; // ==> colonne de la ligne changé + var new_value = params.value; // ==> la nouvelle valeur + + + + console.log("## colomn = ", colomn, " ### new_value = ", new_value); + */ + + + const updatedData = New_Getall_Session_Final_Note_Classement_result.map((x) => { + + var localid = (x).id; + + + if (String(num_line) === String(localid) && colomn === "jury_validation_champ_technique") { + + + var tmp = {}; + tmp['id'] = (x).id; + tmp['_id'] = (x)._id; + tmp['inscription_id'] = (x).inscription_id; + tmp['session_id'] = (x).session_id; + tmp['class_id'] = (x).class_id; + tmp['nom'] = (x).nom; + tmp['prenom'] = (x).prenom; + + + tmp['rang'] = (x).rang; + tmp['note_finale'] = (x).note_finale; + tmp['credit_acquis'] = (x).credit_acquis; + tmp['rang_calculation_date'] = (x).rang_calculation_date; + + + tmp['jury_note'] = (x).jury_note; + tmp['jury_comment'] = (x).jury_comment; + tmp['jury_validation'] = String(new_value); + tmp['jury_validation_champ_technique'] = String(new_value); + + return tmp; + } + + + + var tmp = {}; + tmp['id'] = (x).id; + tmp['_id'] = (x)._id; + tmp['inscription_id'] = (x).inscription_id; + tmp['session_id'] = (x).session_id; + tmp['class_id'] = (x).class_id; + tmp['nom'] = (x).nom; + tmp['prenom'] = (x).prenom; + + + tmp['rang'] = (x).rang; + tmp['note_finale'] = (x).note_finale; + tmp['credit_acquis'] = (x).credit_acquis; + tmp['rang_calculation_date'] = (x).rang_calculation_date; + + + tmp['jury_note'] = (x).jury_note; + tmp['jury_comment'] = (x).jury_comment; + tmp['jury_validation'] = (x).jury_validation; + tmp['jury_validation_champ_technique'] = (x).jury_validation_champ_technique; + + return tmp; + + + }); + + //console.log(" ### updatedData = ", updatedData); + + setNew_Getall_Session_Final_Note_Classement_result([]); + + setNew_Getall_Session_Final_Note_Classement_result(updatedData); + + } + + return (
@@ -1050,11 +1428,14 @@ const Module_Session_Notes_Classement = (props) => {  
- - -