1
0
forked from ScoDoc/ScoDoc

premiers essais pdf bulletin etud sem

This commit is contained in:
leonard_montalbano 2022-05-20 16:28:41 +02:00
parent 76bb83c55a
commit 62e57d9ca0
2 changed files with 9 additions and 9 deletions

View File

@ -18,7 +18,7 @@ from app.api.tools import get_last_instance_etud_from_etudid_or_nip_or_ine
from app.models import Departement, FormSemestreInscription, FormSemestre, Identite
from app.scodoc import sco_bulletins
from app.scodoc import sco_groups
from app.scodoc.sco_bulletins_pdf import get_etud_bulletins_pdf, get_bulletin_etud_formsemestre
from app.scodoc.sco_bulletins_pdf import get_bulletin_etud_formsemestre_pdf
from app.scodoc.sco_permissions import Permission
@ -464,7 +464,7 @@ def etudiant_bulletin_semestre( # XXX TODO Ajouter la possibilité de retourner
app.set_sco_dept(dept.acronym)
if pdf:
return get_bulletin_etud_formsemestre(etudid, formsemestre_id, version)
return get_bulletin_etud_formsemestre_pdf(etudid, formsemestre_id, version)
return sco_bulletins.get_formsemestre_bulletin_etud_json(

View File

@ -75,7 +75,7 @@ import sco_version
def assemble_bulletins_pdf(
formsemestre_id: int,
story: list,
story,
bul_title: str,
infos,
pagesbookmarks=None,
@ -107,7 +107,7 @@ def assemble_bulletins_pdf(
preferences=sco_preferences.SemPreferences(formsemestre_id),
)
)
document.multiBuild(story)
document.build(story)
data = report.getvalue()
return data
@ -281,19 +281,19 @@ def get_bulletin_etud_formsemestre_pdf(etudid: int, formsemestre_id: int, versio
from app.scodoc import sco_bulletins
etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
fragments = []
# fragments = []
bookmarks = {}
filigrannes = {}
formsemestre = FormSemestre.query.get(formsemestre_id)
frag, filigranne = sco_bulletins.do_formsemestre_bulletinetud(
fragments, filigranne = sco_bulletins.do_formsemestre_bulletinetud(
formsemestre,
etudid,
format="pdfpart",
version=version,
)
# fragments += frag
# filigrannes[i] = filigranne
# fragments.append(frag)
filigrannes[0] = filigranne
# bookmarks[i] = sem["session_id"] # eg RT-DUT-FI-S1-2015
infos = {"DeptName": sco_preferences.get_preference("DeptName")}
@ -304,7 +304,7 @@ def get_bulletin_etud_formsemestre_pdf(etudid: int, formsemestre_id: int, versio
try:
sco_pdf.PDFLOCK.acquire()
pdfdoc = assemble_bulletins_pdf(
None,
formsemestre_id,
fragments,
etud["nomprenom"],
infos,