Jury BUT: contenu archive PV

This commit is contained in:
Emmanuel Viennet 2022-07-17 15:15:24 +02:00
parent 98c94bbcac
commit 4658de8c2f
3 changed files with 37 additions and 21 deletions

View File

@ -38,7 +38,7 @@ def _descr_cursus_but(etud: Identite) -> str:
return ", ".join(f"S{indice}" for indice in indices) return ", ".join(f"S{indice}" for indice in indices)
def pvjury_table_but(formsemestre_id: int, format="html") -> list[dict]: def pvjury_table_but(formsemestre_id: int, format="html"):
"""Page récapitulant les décisions de jury BUT """Page récapitulant les décisions de jury BUT
formsemestre peut être pair ou impair formsemestre peut être pair ou impair
""" """

View File

@ -65,6 +65,7 @@ from flask_login import current_user
import app.scodoc.sco_utils as scu import app.scodoc.sco_utils as scu
from config import Config from config import Config
from app import log from app import log
from app.but import jury_but_pv
from app.comp import res_sem from app.comp import res_sem
from app.comp.res_compat import NotesTableCompat from app.comp.res_compat import NotesTableCompat
from app.models import Departement, FormSemestre from app.models import Departement, FormSemestre
@ -361,8 +362,14 @@ def do_formsemestre_archive(
data_js = json.dumps(data, indent=1, cls=scu.ScoDocJSONEncoder) data_js = json.dumps(data, indent=1, cls=scu.ScoDocJSONEncoder)
if data: if data:
PVArchive.store(archive_id, "Bulletins.json", data_js) PVArchive.store(archive_id, "Bulletins.json", data_js)
# Decisions de jury, en XLS # Décisions de jury, en XLS
data = sco_pvjury.formsemestre_pvjury(formsemestre_id, format="xls", publish=False) if formsemestre.formation.is_apc():
response = jury_but_pv.pvjury_table_but(formsemestre_id, format="xls")
data = response.get_data()
else: # formations classiques
data = sco_pvjury.formsemestre_pvjury(
formsemestre_id, format="xls", publish=False
)
if data: if data:
PVArchive.store( PVArchive.store(
archive_id, archive_id,
@ -385,21 +392,24 @@ def do_formsemestre_archive(
) )
if data: if data:
PVArchive.store(archive_id, "CourriersDecisions%s.pdf" % groups_filename, data) PVArchive.store(archive_id, "CourriersDecisions%s.pdf" % groups_filename, data)
# PV de jury (PDF):
dpv = sco_pvjury.dict_pvjury(formsemestre_id, etudids=etudids, with_prev=True) # PV de jury (PDF): disponible seulement en classique
data = sco_pvpdf.pvjury_pdf( # en BUT, le PV est sous forme excel (Decisions_Jury.xlsx ci-dessus)
dpv, if not formsemestre.formation.is_apc():
date_commission=date_commission, dpv = sco_pvjury.dict_pvjury(formsemestre_id, etudids=etudids, with_prev=True)
date_jury=date_jury, data = sco_pvpdf.pvjury_pdf(
numeroArrete=numeroArrete, dpv,
VDICode=VDICode, date_commission=date_commission,
showTitle=showTitle, date_jury=date_jury,
pv_title=pv_title, numeroArrete=numeroArrete,
with_paragraph_nom=with_paragraph_nom, VDICode=VDICode,
anonymous=anonymous, showTitle=showTitle,
) pv_title=pv_title,
if data: with_paragraph_nom=with_paragraph_nom,
PVArchive.store(archive_id, "PV_Jury%s.pdf" % groups_filename, data) anonymous=anonymous,
)
if data:
PVArchive.store(archive_id, "PV_Jury%s.pdf" % groups_filename, data)
def formsemestre_archive(formsemestre_id, group_ids=[]): def formsemestre_archive(formsemestre_id, group_ids=[]):

View File

@ -206,6 +206,7 @@ def dict_pvjury(
{ {
'date' : date de la decision la plus recente, 'date' : date de la decision la plus recente,
'formsemestre' : sem, 'formsemestre' : sem,
'is_apc' : bool,
'formation' : { 'acronyme' :, 'titre': ... } 'formation' : { 'acronyme' :, 'titre': ... }
'decisions' : { [ { 'identite' : {'nom' :, 'prenom':, ...,}, 'decisions' : { [ { 'identite' : {'nom' :, 'prenom':, ...,},
'etat' : I ou D ou DEF 'etat' : I ou D ou DEF
@ -359,6 +360,7 @@ def dict_pvjury(
return { return {
"date": ndb.DateISOtoDMY(max_date), "date": ndb.DateISOtoDMY(max_date),
"formsemestre": sem, "formsemestre": sem,
"is_apc": nt.is_apc,
"has_prev": has_prev, "has_prev": has_prev,
"semestre_non_terminal": semestre_non_terminal, "semestre_non_terminal": semestre_non_terminal,
"formation": sco_formations.formation_list( "formation": sco_formations.formation_list(
@ -418,7 +420,10 @@ def pvjury_table(
titles["prev_decision"] = "Décision S%s" % id_prev titles["prev_decision"] = "Décision S%s" % id_prev
columns_ids += ["prev_decision"] columns_ids += ["prev_decision"]
columns_ids += ["decision"] if not dpv["is_apc"]:
# Décision de jury sur le semestre, sauf en BUT
columns_ids += ["decision"]
if sco_preferences.get_preference("bul_show_mention", formsemestre_id): if sco_preferences.get_preference("bul_show_mention", formsemestre_id):
columns_ids += ["mention"] columns_ids += ["mention"]
columns_ids += ["ue_cap"] columns_ids += ["ue_cap"]
@ -444,7 +449,7 @@ def pvjury_table(
scodoc_dept=g.scodoc_dept, scodoc_dept=g.scodoc_dept,
etudid=e["identite"]["etudid"], etudid=e["identite"]["etudid"],
), ),
"_nomprenom_td_attrs": 'id="%s" class="etudinfo"' % e["identite"]["etudid"], "_nomprenom_td_attrs": f"""id="{e['identite']['etudid']}" class="etudinfo" """,
"parcours": e["parcours"], "parcours": e["parcours"],
"decision": _descr_decision_sem_abbrev(e["etat"], e["decision_sem"]), "decision": _descr_decision_sem_abbrev(e["etat"], e["decision_sem"]),
"ue_cap": e["decisions_ue_descr"], "ue_cap": e["decisions_ue_descr"],
@ -508,7 +513,8 @@ def formsemestre_pvjury(formsemestre_id, format="html", publish=True):
# Bretelle provisoire pour BUT 9.3.0 # Bretelle provisoire pour BUT 9.3.0
# XXX TODO # XXX TODO
formsemestre = FormSemestre.query.get_or_404(formsemestre_id) formsemestre = FormSemestre.query.get_or_404(formsemestre_id)
if formsemestre.formation.is_apc() and formsemestre.semestre_id % 2 == 0: is_apc = formsemestre.formation.is_apc()
if format == "html" and is_apc and formsemestre.semestre_id % 2 == 0:
from app.but import jury_but_recap from app.but import jury_but_recap
return jury_but_recap.formsemestre_saisie_jury_but( return jury_but_recap.formsemestre_saisie_jury_but(