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.models import Departement, FormSemestreInscription, FormSemestre, Identite
from app.scodoc import sco_bulletins from app.scodoc import sco_bulletins
from app.scodoc import sco_groups 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 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) app.set_sco_dept(dept.acronym)
if pdf: 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( return sco_bulletins.get_formsemestre_bulletin_etud_json(

View File

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