08/05/2025 - 19

recette2
cherif 2025-05-08 19:01:50 +02:00
parent a920814520
commit ebbcc401d2
6 changed files with 421 additions and 48 deletions

View File

@ -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} />
</div>}

View File

@ -10718,8 +10718,6 @@ const Employes = (props) => {
</div>}
{String(submenu) === "droit_acces" && <div className="div_row">
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Droits accès </nav>
<nav style={{ "border": "None", "fontSize": "22px", "fontWeight": "600" }}> Droits d'accès système </nav>

View File

@ -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}
/>
</div>}

View File

@ -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 (
<nav>
{value && <div style={{
paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all", color: '#0000FF',
"textAlign": "center"
}}>
{expanded ? value : value.slice(0, 50)}&nbsp;
{value.length > 50 && (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
<Link
type="button"
component="button"
sx={{ fontSize: 'inherit' }}
onClick={() => setExpanded(!expanded)}
>
{expanded ? <nav> <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
</Link>
)}
</div>}
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all", color: '#0000FF' }}>
&nbsp;
</div>
}
</nav>
);
}
function ExpandableCell_50_bg_hiligt_red_color({ value }) {
const [expanded, setExpanded] = React.useState(false);
return (
<nav>
{value && <div style={{
paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all", color: 'red',
"textAlign": "center"
}}>
{expanded ? value : value.slice(0, 50)}&nbsp;
{value.length > 50 && (
// eslint-disable-next-line jsx-a11y/anchor-is-valid
<Link
type="button"
component="button"
sx={{ fontSize: 'inherit' }}
onClick={() => setExpanded(!expanded)}
>
{expanded ? <nav> <PiDotsThree />Réduire</nav> : <nav> <PiDotsThree />Voir</nav>}
</Link>
)}
</div>}
{value && <div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all", color: 'red' }}>
&nbsp;
</div>
}
</nav>
);
}
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) => <ExpandableCell_50 {...params} />, },
{ field: 'prenom', headerName: 'Prenom', minwidth: 200, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rang', headerName: 'Rang', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'note_finale', headerName: 'Noete finale', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{
field: 'note_finale', headerName: 'Noete finale', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />,
},
{ field: 'credit_acquis', headerName: 'Credit acquis', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rang_calculation_date', headerName: 'Date Calcul', minwidth: 100, flex: 1, hide: false, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'rang_calculation_date', headerName: 'Date Calcul', minwidth: 100, flex: 1, hide: true, editable: false, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'jury_note', headerName: 'Note Jury', width: 200, editable: jury_cell_editable, renderCell: (params) => <ExpandableCell_50_bg_hiligt_red_color {...params} />, align: "center", },
{ field: 'jury_comment', headerName: 'Comment Jury', width: 200, editable: jury_cell_editable, renderCell: (params) => <ExpandableCell_50_bg_hiligt_red_color {...params} />, align: "center", },
{
field: 'jury_validation', headerName: 'Validation Jury', width: 150, hide: false, editable: jury_cell_editable,
renderCell: (cellValues) => {
return (
<nav>
{New_Option_Valisation_Jury && New_Option_Valisation_Jury.length > 0 && jury_cell_editable === true && <Autocomplete
disablePortal
name="filtre1"
id="filtre1"
value={New_Option_Valisation_Jury.filter((data) => (data).value === String(cellValues.row.jury_validation))[0].label}
options={New_Option_Valisation_Jury}
onChange={(event, value) => {
if (value && value.value) {
mysy_onchange_list(cellValues.row.id, "jury_validation_champ_technique", value.value);
}
}}
renderInput={(params) => <TextField {...params} label="" placeholder=""
inputProps={{ ...params.inputProps, style: { fontSize: 10, height: "1rem" } }}
/>
}
/>}
{jury_cell_editable !== true &&
<div style={{ paddingLeft: "5px", paddingRight: "15px", "display": "block", wordBreak: "break-all" }}>
{cellValues.row.jury_validation_champ_technique && String(cellValues.row.jury_validation_champ_technique) === "1" && "Oui"}
{cellValues.row.jury_validation_champ_technique && String(cellValues.row.jury_validation_champ_technique) === "0" && "Non"}
</div>
}
</nav>
);
}
},
{
field: 'jury_validation_champ_technique', headerName: 'Validation Jury_tech', width: 200, renderCell: (params) => <ExpandableCell_50_bg_hiligt_red_color {...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 (
<div className="module_session_note_classement">
@ -1050,11 +1428,14 @@ const Module_Session_Notes_Classement = (props) => {
&nbsp;
<div style={{ width: '100%', float: 'left' }}>
<nav style={{ textAlign: 'center', width: '70%', float: 'left' }}> Notes & Rang Final (session)</nav>
<nav style={{ textAlign: 'right', width: '30%', float: 'left' }}>
<nav style={{ textAlign: 'center', width: '50%', float: 'left' }}> Notes & Rang Final (session)</nav>
<nav style={{ textAlign: 'right', width: '50%', float: 'left' }}>
<Button variant="outlined" onClick={Calcul_Note_Classement_Session} className="detail_class_submenu" id='calcul_moyenne' name='calcul_moyenne'> Calcul Moyenne </Button>
<Button variant="outlined" onClick={Jury_Update_Final_Session} className="detail_class_submenu" id='calcul_moyenne' name='calcul_moyenne'> Mettre à jour </Button>
</nav>
@ -1065,32 +1446,13 @@ const Module_Session_Notes_Classement = (props) => {
width: '100%',
paddingRight: '1px',
// Gestion des cellule a distance ou presentiel
'& .cell--distantiel': {
// Gestion des cellules reservée au jury
'& .cell--jury': {
backgroundColor: '#AFE1AF',
color: 'black',
},
'& .cell--presentiel': {
backgroundColor: '#AFE1AF',
color: 'black',
border: "1px solid rgb(224, 224, 224)",
},
// gestion couleur des lignes avec le statut d'inscription
'& .line--statut--annule': {
backgroundColor: '#D8D8D8',
color: 'white',
},
'& .line--statut--inscrit': {
backgroundColor: '#CEF6D8',
color: 'black',
},
'& .line--statut--preinscrit': {
backgroundColor: '#F7F2E0',
color: 'black',
},
/*"& .MuiDataGrid-virtualScrollerRenderZone": {
@ -1130,6 +1492,9 @@ const Module_Session_Notes_Classement = (props) => {
}}
>
<DataGrid
onCellEditCommit={OnchangeCellDataGrid}
checkboxSelection
onSelectionModelChange={(newSelectionModel) => {
setselectionModel_note_Session_classement(newSelectionModel);
@ -1144,22 +1509,25 @@ const Module_Session_Notes_Classement = (props) => {
selectionModel={selectionModel_note_Session_classement}
localeText={frFR.components.MuiDataGrid.defaultProps.localeText}
rows={Getall_Session_Final_Note_Classement_result.map((item, index) => (
rows={New_Getall_Session_Final_Note_Classement_result.map((item, index) => (
{
id: index,
_id: JSON.parse(item)._id,
inscription_id: JSON.parse(item).inscription_id,
session_id: JSON.parse(item).session_id,
class_id: JSON.parse(item).class_id,
nom: JSON.parse(item).nom,
prenom: JSON.parse(item).prenom,
rang: JSON.parse(item).rang,
note_finale: JSON.parse(item).note_finale,
rang_calculation_date: JSON.parse(item).rang_calculation_date.substring(0, 10),
credit_acquis: JSON.parse(item).credit_acquis,
_id: (item)._id,
inscription_id: (item).inscription_id,
session_id: (item).session_id,
class_id: (item).class_id,
nom: (item).nom,
prenom: (item).prenom,
rang: (item).rang,
note_finale: (item).note_finale,
rang_calculation_date: (item).rang_calculation_date.substring(0, 10),
credit_acquis: (item).credit_acquis,
jury_note: (item).jury_note,
jury_comment: (item).jury_comment,
jury_validation: (item).jury_validation,
jury_validation_champ_technique: (item).jury_validation_champ_technique,
}
))}
@ -1178,9 +1546,14 @@ const Module_Session_Notes_Classement = (props) => {
Toolbar: GridToolbar,
}}
//sx={datagridSx}
getCellClassName={(params) => {
// Traitement des cellules du jury (note, commentaire, validation)
if (String(params.field).startsWith("jury")) {
return 'cell--jury';
}
}}
getRowClassName={(params) => {

View File

@ -509,8 +509,8 @@ const Notes_Evaluation = (props) => {
{ field: 'groupe', headerName: 'groupe', flex: 1, hide: false, minWidth: 180, renderCell: (params) => <ExpandableCell_50 {...params} />, },
{ field: 'note', headerName: 'Note', width: 200, editable: true, renderCell: (params) => <ExpandableCell_50_bg_hiligt {...params} />, align: "center", },
{ field: 'convocation_send_date', headerName: 'Conv. Envoyé', width: 200, editable: true, renderCell: (params) => <ExpandableCell_50_bg_hiligt {...params} />, align: "center", },
{ field: 'convocation_send_type', headerName: 'Conv. Par', width: 200, editable: true, renderCell: (params) => <ExpandableCell_50_bg_hiligt {...params} />, align: "center", },
{ field: 'convocation_send_date', headerName: 'Conv. Envoyé', width: 200, editable: false, renderCell: (params) => <ExpandableCell_50_bg_hiligt {...params} />, align: "center", },
{ field: 'convocation_send_type', headerName: 'Conv. Par', width: 200, editable: false, renderCell: (params) => <ExpandableCell_50_bg_hiligt {...params} />, align: "center", },
{