diff --git a/app/but/bulletin_but_court.py b/app/but/bulletin_but_court.py
index 684b168232a19fe683bd0666f90c9b787fa4f8a5..3997d091afd1fafc19391474fcd84551b6698ccd 100644
--- a/app/but/bulletin_but_court.py
+++ b/app/but/bulletin_but_court.py
@@ -36,7 +36,7 @@ from app.decorators import (
)
from app.models import FormSemestre, FormSemestreInscription, Identite
from app.scodoc.codes_cursus import UE_STANDARD
-from app.scodoc.sco_exceptions import ScoNoReferentielCompetences
+from app.scodoc.sco_exceptions import ScoNoReferentielCompetences, ScoValueError
from app.scodoc.sco_logos import find_logo
from app.scodoc.sco_permissions import Permission
import app.scodoc.sco_utils as scu
@@ -63,12 +63,18 @@ def bulletin_but(formsemestre_id: int, etudid: int = None, fmt="html"):
.filter_by(etudid=etudid)
.first_or_404()
)
+ if not formsemestre.formation.is_apc():
+ raise ScoValueError("formation non BUT")
bulletins_sem = BulletinBUT(formsemestre)
if fmt == "pdf":
bul: dict = bulletins_sem.bulletin_etud_complet(etud)
else: # la même chose avec un peu moins d'infos
bul: dict = bulletins_sem.bulletin_etud(etud)
- decision_ues = {x["acronyme"]: x for x in bul["semestre"]["decision_ue"]}
+ decision_ues = (
+ {x["acronyme"]: x for x in bul["semestre"]["decision_ue"]}
+ if "semestre" in bul
+ else {}
+ )
cursus = cursus_but.EtudCursusBUT(etud, formsemestre.formation)
refcomp = formsemestre.formation.referentiel_competence
if refcomp is None:
@@ -80,6 +86,7 @@ def bulletin_but(formsemestre_id: int, etudid: int = None, fmt="html"):
logo = find_logo(logoname="header", dept_id=g.scodoc_dept_id)
+ ue_acronyms = bul["ues"].keys()
args = {
"bul": bul,
"cursus": cursus,
@@ -91,13 +98,15 @@ def bulletin_but(formsemestre_id: int, etudid: int = None, fmt="html"):
"title": f"Bul. {etud.nom_disp()} BUT (court)",
"ue_validation_by_niveau": ue_validation_by_niveau,
"ues_acronyms": [
- ue.acronyme for ue in bulletins_sem.res.ues if ue.type == UE_STANDARD
+ ue.acronyme
+ for ue in bulletins_sem.res.ues
+ if ue.type == UE_STANDARD and ue.acronyme in ue_acronyms
],
}
if fmt == "pdf":
filename = scu.bul_filename(formsemestre, etud, prefix="bul-but")
bul_pdf = bulletin_but_court_pdf.make_bulletin_but_court_pdf(**args)
- return scu.sendPDFFile(bul_pdf, filename)
+ return scu.sendPDFFile(bul_pdf, filename + ".pdf")
return render_template(
"but/bulletin_court_page.j2",
diff --git a/app/but/bulletin_but_court_pdf.py b/app/but/bulletin_but_court_pdf.py
index 40914b09cba53b29f50913828da9948bf7b165cb..1887efd2483a25e21fc77d9f05e724f8adc698dd 100644
--- a/app/but/bulletin_but_court_pdf.py
+++ b/app/but/bulletin_but_court_pdf.py
@@ -16,7 +16,7 @@ from flask_login import current_user
from reportlab.lib import styles
from reportlab.lib.colors import black, white, Color
from reportlab.lib.enums import TA_CENTER
-from reportlab.lib.units import cm, mm
+from reportlab.lib.units import mm
from reportlab.platypus import Paragraph, Spacer, Table
from app.but import cursus_but
@@ -102,13 +102,15 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
self.style_base = styles.ParagraphStyle("style_base")
self.style_base.fontName = "Helvetica"
self.style_base.fontSize = 9
+ self.style_base.firstLineIndent = 0
+ # écrase style defaut des bulletins
+ self.style_field = self.style_base
+ # Le nom/prénom de l'étudiant:
self.style_nom = styles.ParagraphStyle("style_nom", self.style_base)
self.style_nom.fontSize = 11
self.style_nom.fontName = "Helvetica-Bold"
- self.style_field = self.style_base # écrase style defaut buleltins
-
self.style_cell = styles.ParagraphStyle("style_cell", self.style_base)
self.style_cell.fontSize = 7
self.style_cell.leading = 7
@@ -124,7 +126,7 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
self.style_niveaux.firstLineIndent = 0
self.style_niveaux.leftIndent = 1
self.style_niveaux.rightIndent = 1
- self.style_niveaux.borderWidth = 1
+ self.style_niveaux.borderWidth = 0.5
self.style_niveaux.borderPadding = 2
self.style_niveaux.borderRadius = 2
self.style_niveaux_top = styles.ParagraphStyle(
@@ -162,6 +164,7 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
) # espace les lignes
self.style_assiduite = self.style_cell
+ self.style_signature = self.style_appreciations
# Géométrie page
self.width_page_avail = 185 * mm # largeur utilisable
@@ -189,10 +192,16 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
appreciations = BulAppreciations.get_appreciations_list(
self.formsemestre.id, self.etud.id
)
- return [
- Spacer(1, 3 * mm),
- self.bul_appreciations_pdf(appreciations, style=self.style_appreciations),
- ]
+ return (
+ [
+ Spacer(1, 3 * mm),
+ self.bul_appreciations_pdf(
+ appreciations, style=self.style_appreciations
+ ),
+ ]
+ if appreciations
+ else []
+ )
def bul_table(self, fmt=None) -> list:
"""Génère la table centrale du bulletin de notes
diff --git a/app/scodoc/sco_bulletins_generator.py b/app/scodoc/sco_bulletins_generator.py
index f0c66db67ed3c49320d5e64bd4884ecede45aa0c..bf6660d8fd07f03588b98dae798a9c5e528b560a 100644
--- a/app/scodoc/sco_bulletins_generator.py
+++ b/app/scodoc/sco_bulletins_generator.py
@@ -117,6 +117,8 @@ class BulletinGenerator:
self.style_field.fontName = self.preferences["SCOLAR_FONT_BUL_FIELDS"]
self.style_field.fontSize = self.preferences["SCOLAR_FONT_SIZE"]
self.style_field.firstLineIndent = 0
+ # Champ signatures
+ self.style_signature = self.style_field
# - Pour les cellules de table:
self.CellStyle = reportlab.lib.styles.ParagraphStyle({})
self.CellStyle.fontSize = self.preferences["SCOLAR_FONT_SIZE"]
diff --git a/app/scodoc/sco_bulletins_standard.py b/app/scodoc/sco_bulletins_standard.py
index 8bff41a4c46b290ef4acaf8b76406c62eddfe820..c84f1a1713fac9d5640eaab27b8e23270ff71af5 100644
--- a/app/scodoc/sco_bulletins_standard.py
+++ b/app/scodoc/sco_bulletins_standard.py
@@ -263,7 +263,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator):
sco_bulletins_pdf.process_field(
self.preferences["bul_pdf_sig_left"],
self.infos,
- self.style_field,
+ self.style_signature,
field_name="bul_pdf_sig_left",
)
]
@@ -275,7 +275,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator):
sco_bulletins_pdf.process_field(
self.preferences["bul_pdf_sig_right"],
self.infos,
- self.style_field,
+ self.style_signature,
field_name="bul_pdf_sig_right",
)
)
diff --git a/app/scodoc/sco_moduleimpl_status.py b/app/scodoc/sco_moduleimpl_status.py
index 93ce5237ffb5546c53634f8f55576809bf81971c..43b66230b389a98f6e236ea4480d04a6a9302b29 100644
--- a/app/scodoc/sco_moduleimpl_status.py
+++ b/app/scodoc/sco_moduleimpl_status.py
@@ -127,8 +127,12 @@ def moduleimpl_evaluation_menu(evaluation: Evaluation, nbnotes: int = 0) -> str:
"args": {
"group_ids": group_id,
"desc": evaluation.description or "",
- "date_debut": evaluation.date_debut.isoformat(),
- "date_fin": evaluation.date_fin.isoformat(),
+ "date_debut": evaluation.date_debut.isoformat()
+ if evaluation.date_debut
+ else "",
+ "date_fin": evaluation.date_fin.isoformat()
+ if evaluation.date_fin
+ else "",
},
"enabled": evaluation.date_debut is not None,
},
diff --git a/app/templates/bul_head.j2 b/app/templates/bul_head.j2
index 9a59ccd52b29d22f2ca54405e59e54b832334202..89fa76899890a012b5b48d70c2a477b4cd78614f 100644
--- a/app/templates/bul_head.j2
+++ b/app/templates/bul_head.j2
@@ -42,20 +42,22 @@
format='pdf',
version=version,
)}}">{{scu.ICON_PDF|safe}}</a>
- <a style="margin-left: 20px;"
- href="{{url_for(
- 'notes.bulletin_but_html',
- scodoc_dept=g.scodoc_dept,
- formsemestre_id=formsemestre.id,
- etudid=etud.id
- )}}">version courte spéciale BUT</a>
+ {% if formsemestre.formation.is_apc() %}
+ <a style="margin-left: 20px;" class="stdlink"
+ href="{{url_for(
+ 'notes.bulletin_but_html',
+ scodoc_dept=g.scodoc_dept,
+ formsemestre_id=formsemestre.id,
+ etudid=etud.id
+ )}}">version courte spéciale BUT</a>
+ {% endif %}
</span>
</div>
</form>
</div>
{% if not is_apc %}
<div class="bull_photo"><a href="{{
- url_for("scolar.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etud.id)
+ url_for('scolar.ficheEtud', scodoc_dept=g.scodoc_dept, etudid=etud.id)
}}">{{etud.photo_html(title="fiche de " + etud["nom"])|safe}}</a>
</div>
{% endif %}
diff --git a/app/templates/but/bulletin_court_page.j2 b/app/templates/but/bulletin_court_page.j2
index f7249c1655841c0ce0b5d391db664608bac62d08..f1962d02c7cdcd8a978203bb024cac5c0c42492d 100644
--- a/app/templates/but/bulletin_court_page.j2
+++ b/app/templates/but/bulletin_court_page.j2
@@ -39,10 +39,17 @@
{%- endmacro %}
{% block app_content %}
-<p><a href="{{url_for(
+<p>
+<a href="{{url_for(
'notes.bulletin_but_pdf', scodoc_dept=g.scodoc_dept, etudid=etud.id,
formsemestre_id=formsemestre.id
)}}" class="stdlink">version pdf {{scu.ICON_PDF|safe}}</a>
+<a style="margin-left: 32px;"
+ href="{{url_for(
+ 'notes.formsemestre_bulletinetud',
+ scodoc_dept=g.scodoc_dept, etudid=etud.id,
+ formsemestre_id=formsemestre.id
+)}}" class="stdlink">version complète</a>
</p>
<div class="but_bul_court">
@@ -57,9 +64,9 @@
</div>
<div id="logo">
- {% if logo %}
- {{logo.html()|safe}}
- {% endif %}
+ <a href="{{
+ url_for('scolar.ficheEtud', scodoc_dept=g.scodoc_dept, etudid=etud.id)
+ }}">{{etud.photo_html()|safe}}</a>
</div>
{% if bul.options.show_abs %}
diff --git a/sco_version.py b/sco_version.py
index 5cc41fa0f73146f93865088cc9128bbda5235c31..dc28f1bd7af9ef7f556435715874316231e935f0 100644
--- a/sco_version.py
+++ b/sco_version.py
@@ -1,7 +1,7 @@
# -*- mode: python -*-
# -*- coding: utf-8 -*-
-SCOVERSION = "9.6.16"
+SCOVERSION = "9.6.17"
SCONAME = "ScoDoc"