diff --git a/app/but/jury_but_pv.py b/app/but/jury_but_pv.py index 40db4f0ed..56e45d412 100644 --- a/app/but/jury_but_pv.py +++ b/app/but/jury_but_pv.py @@ -56,7 +56,17 @@ def pvjury_page_but(formsemestre_id: int, fmt="html"): line_sep = "\n" rows, titles = pvjury_table_but(formsemestre, line_sep=line_sep) if fmt.startswith("xls"): - titles["ects_but"] = "Total ECTS BUT" + titles.update( + { + "etudid": "etudid", + "code_nip": "nip", + "code_ine": "ine", + "ects_but": "Total ECTS BUT", + "civilite": "Civ.", + "nom": "Nom", + "prenom": "Prénom", + } + ) # Style excel... passages à la ligne sur \n xls_style_base = sco_excel.excel_make_style() xls_style_base["alignment"] = Alignment(wrapText=True, vertical="top") @@ -116,7 +126,7 @@ def pvjury_table_but( "pas de référentiel de compétences associé à la formation de ce semestre !" ) titles = { - "nom": "Code" if anonymous else "Nom", + "nom_pv": "Code" if anonymous else "Nom", "cursus": "Cursus", "ects": "ECTS", "ues": "UE validées", @@ -146,17 +156,17 @@ def pvjury_table_but( ects_but_valides = but_ects_valides(etud, referentiel_competence_id) row = { - "nom": ( + "nom_pv": ( etud.code_ine or etud.code_nip or etud.id if anonymous # Mode anonyme: affiche INE ou sinon NIP, ou id else etud.etat_civil_pv( line_sep=line_sep, with_paragraph=with_paragraph_nom ) ), - "_nom_order": etud.sort_key, - "_nom_target_attrs": f'class="etudinfo" id="{etud.id}"', - "_nom_td_attrs": f'id="{etud.id}" class="etudinfo"', - "_nom_target": url_for( + "_nom_pv_order": etud.sort_key, + "_nom_pv_target_attrs": f'class="etudinfo" id="{etud.id}"', + "_nom_pv_td_attrs": f'id="{etud.id}" class="etudinfo"', + "_nom_pv_target": url_for( "scolar.fiche_etud", scodoc_dept=g.scodoc_dept, etudid=etud.id, @@ -175,9 +185,16 @@ def pvjury_table_but( if deca else "" ), + # pour exports excel seulement: + "civilite": etud.civilite_etat_civil_str, + "nom": etud.nom, + "prenom": etud.prenom_etat_civil or etud.prenom or "", + "etudid": etud.id, + "code_nip": etud.code_nip, + "code_ine": etud.code_ine, } if deca.valide_diplome() or not only_diplome: rows.append(row) - rows.sort(key=lambda x: x["_nom_order"]) + rows.sort(key=lambda x: x["_nom_pv_order"]) return rows, titles