forked from ScoDoc/ScoDoc
Jury BUT: contenu archive PV
This commit is contained in:
parent
98c94bbcac
commit
4658de8c2f
@ -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
|
||||||
"""
|
"""
|
||||||
|
@ -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,7 +392,10 @@ 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):
|
|
||||||
|
# PV de jury (PDF): disponible seulement en classique
|
||||||
|
# en BUT, le PV est sous forme excel (Decisions_Jury.xlsx ci-dessus)
|
||||||
|
if not formsemestre.formation.is_apc():
|
||||||
dpv = sco_pvjury.dict_pvjury(formsemestre_id, etudids=etudids, with_prev=True)
|
dpv = sco_pvjury.dict_pvjury(formsemestre_id, etudids=etudids, with_prev=True)
|
||||||
data = sco_pvpdf.pvjury_pdf(
|
data = sco_pvpdf.pvjury_pdf(
|
||||||
dpv,
|
dpv,
|
||||||
|
@ -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"]
|
||||||
|
|
||||||
|
if not dpv["is_apc"]:
|
||||||
|
# Décision de jury sur le semestre, sauf en BUT
|
||||||
columns_ids += ["decision"]
|
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(
|
||||||
|
Loading…
Reference in New Issue
Block a user