Compare commits
83 Commits
Author | SHA1 | Date |
---|---|---|
Emmanuel Viennet | 18b1f00586 | |
Iziram | 6b985620e9 | |
Iziram | 4d234ba353 | |
Iziram | 5d45fcf656 | |
Iziram | 0a5919b788 | |
Iziram | 09f4525e66 | |
Emmanuel Viennet | 0bc57807de | |
Emmanuel Viennet | 87aaf12d27 | |
Emmanuel Viennet | c8ab9b9b6c | |
Emmanuel Viennet | ad7b48e110 | |
Emmanuel Viennet | f2ce16f161 | |
Emmanuel Viennet | 1ddf9b6ab8 | |
Emmanuel Viennet | 0a2e39cae1 | |
Emmanuel Viennet | a194b4b6e0 | |
Emmanuel Viennet | cbe85dfb7d | |
Emmanuel Viennet | beba69bfe4 | |
Emmanuel Viennet | 41fec29452 | |
Emmanuel Viennet | 9bd05ea241 | |
Emmanuel Viennet | 58b831513d | |
Emmanuel Viennet | b861aba6a3 | |
Emmanuel Viennet | c2443c361f | |
Emmanuel Viennet | ab4731bd43 | |
Emmanuel Viennet | c17bc8b61b | |
Emmanuel Viennet | e44a5ee55d | |
Emmanuel Viennet | a747ed22e2 | |
Emmanuel Viennet | 5d0a932634 | |
Emmanuel Viennet | 2b150cf521 | |
Emmanuel Viennet | 5a5ddcacd7 | |
Emmanuel Viennet | 3f6e65b9da | |
Emmanuel Viennet | 5eba6170a5 | |
Emmanuel Viennet | bd9bf87112 | |
Emmanuel Viennet | a0e2af481f | |
Emmanuel Viennet | 42e8f97441 | |
Emmanuel Viennet | 8ec0171ca0 | |
Emmanuel Viennet | 6dfab2d843 | |
Emmanuel Viennet | 523ec59833 | |
Emmanuel Viennet | bde6325391 | |
Emmanuel Viennet | 0577347622 | |
Emmanuel Viennet | 28d46e413d | |
Emmanuel Viennet | 126ea0741a | |
Emmanuel Viennet | a5b5f49f76 | |
Iziram | b7ab10bf4e | |
Emmanuel Viennet | 3e0b19c4a8 | |
Emmanuel Viennet | 1dd5187fae | |
Iziram | 9a3a7d33b2 | |
Iziram | a7569fe4f5 | |
Iziram | 79e973f06d | |
Emmanuel Viennet | b6940e4882 | |
Emmanuel Viennet | 1f24095c57 | |
Emmanuel Viennet | 0ed2455028 | |
Emmanuel Viennet | b841b2f708 | |
Iziram | 0fa1478138 | |
Iziram | 85ad7b5f29 | |
Emmanuel Viennet | 6bfd461bf2 | |
Emmanuel Viennet | e1f1a95a14 | |
Emmanuel Viennet | 70e3006981 | |
Emmanuel Viennet | bae46c2794 | |
Iziram | b1055a4ebe | |
Iziram | b2ef6a4c53 | |
Iziram | a7c7bd655d | |
Iziram | 1309043a98 | |
Iziram | a75b41ca5f | |
Emmanuel Viennet | 8df25ca02f | |
Emmanuel Viennet | 61f9dddeb6 | |
Emmanuel Viennet | a1f5340935 | |
Emmanuel Viennet | 68128c27d5 | |
Emmanuel Viennet | 8ecaa2bed0 | |
Emmanuel Viennet | 7c61dd8d63 | |
Emmanuel Viennet | f493ba344f | |
Emmanuel Viennet | f5079d9aef | |
Emmanuel Viennet | 55add2ffb3 | |
Emmanuel Viennet | 5865b67652 | |
Emmanuel Viennet | 3c8b088d5e | |
Emmanuel Viennet | 2da359ae41 | |
Emmanuel Viennet | 09ec53f573 | |
Emmanuel Viennet | 3787e0145a | |
Emmanuel Viennet | edf989ee04 | |
Emmanuel Viennet | 203f3a5342 | |
Emmanuel Viennet | 161f8476ca | |
Emmanuel Viennet | d419d75515 | |
Emmanuel Viennet | f23630d7fd | |
Emmanuel Viennet | fa0417f0b1 | |
Emmanuel Viennet | 12256dc3d4 |
|
@ -315,12 +315,6 @@ def create_app(config_class=DevConfig):
|
|||
app.register_error_handler(503, postgresql_server_error)
|
||||
app.register_error_handler(APIInvalidParams, handle_invalid_usage)
|
||||
|
||||
# Add some globals
|
||||
# previously in Flask-Bootstrap:
|
||||
app.jinja_env.globals["bootstrap_is_hidden_field"] = lambda field: isinstance(
|
||||
field, HiddenField
|
||||
)
|
||||
|
||||
from app.auth import bp as auth_bp
|
||||
|
||||
app.register_blueprint(auth_bp, url_prefix="/auth")
|
||||
|
@ -338,8 +332,15 @@ def create_app(config_class=DevConfig):
|
|||
from app.api import api_bp
|
||||
from app.api import api_web_bp
|
||||
|
||||
# Jinja2 configuration
|
||||
# Enable autoescaping of all templates, including .j2
|
||||
app.jinja_env.autoescape = select_autoescape(default_for_string=True, default=True)
|
||||
app.jinja_env.trim_blocks = True
|
||||
app.jinja_env.lstrip_blocks = True
|
||||
# previously in Flask-Bootstrap:
|
||||
app.jinja_env.globals["bootstrap_is_hidden_field"] = lambda field: isinstance(
|
||||
field, HiddenField
|
||||
)
|
||||
|
||||
# https://scodoc.fr/ScoDoc
|
||||
app.register_blueprint(scodoc_bp)
|
||||
|
|
|
@ -3,14 +3,15 @@
|
|||
# Copyright (c) 1999 - 2024 Emmanuel Viennet. All rights reserved.
|
||||
# See LICENSE
|
||||
##############################################################################
|
||||
"""ScoDoc 9 API : Assiduités
|
||||
"""
|
||||
"""ScoDoc 9 API : Assiduités"""
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
from flask import g, request
|
||||
from flask_json import as_json
|
||||
from flask_login import current_user, login_required
|
||||
from flask_sqlalchemy.query import Query
|
||||
from sqlalchemy.orm.exc import ObjectDeletedError
|
||||
|
||||
from app import db, log, set_sco_dept
|
||||
import app.scodoc.sco_assiduites as scass
|
||||
|
@ -858,7 +859,10 @@ def assiduite_edit(assiduite_id: int):
|
|||
msg=f"assiduite: modif {assiduite_unique}",
|
||||
)
|
||||
db.session.commit()
|
||||
scass.simple_invalidate_cache(assiduite_unique.to_dict())
|
||||
try:
|
||||
scass.simple_invalidate_cache(assiduite_unique.to_dict())
|
||||
except ObjectDeletedError:
|
||||
return json_error(404, "Assiduité supprimée / inexistante")
|
||||
|
||||
return {"OK": True}
|
||||
|
||||
|
|
|
@ -329,6 +329,8 @@ def desassoc_ue_niveau(ue_id: int):
|
|||
ue.niveau_competence = None
|
||||
db.session.add(ue)
|
||||
db.session.commit()
|
||||
# Invalidation du cache
|
||||
ue.formation.invalidate_cached_sems()
|
||||
log(f"desassoc_ue_niveau: {ue}")
|
||||
if g.scodoc_dept:
|
||||
# "usage web"
|
||||
|
|
|
@ -38,7 +38,7 @@ from app.scodoc import sco_groups
|
|||
from app.scodoc.sco_permissions import Permission
|
||||
from app.scodoc.sco_utils import ModuleType
|
||||
import app.scodoc.sco_utils as scu
|
||||
from app.tables.recap import TableRecap
|
||||
from app.tables.recap import TableRecap, RowRecap
|
||||
|
||||
|
||||
@bp.route("/formsemestre/<int:formsemestre_id>")
|
||||
|
@ -543,16 +543,30 @@ def formsemestre_resultat(formsemestre_id: int):
|
|||
formsemestre: FormSemestre = query.first_or_404(formsemestre_id)
|
||||
app.set_sco_dept(formsemestre.departement.acronym)
|
||||
res: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
|
||||
table = TableRecap(
|
||||
res, convert_values=convert_values, include_evaluations=False, mode_jury=False
|
||||
)
|
||||
# Supprime les champs inutiles (mise en forme)
|
||||
rows = table.to_list()
|
||||
# Ajoute le groupe de chaque partition:
|
||||
# Ajoute le groupe de chaque partition,
|
||||
etud_groups = sco_groups.get_formsemestre_etuds_groups(formsemestre_id)
|
||||
for row in rows:
|
||||
row["partitions"] = etud_groups.get(row["etudid"], {})
|
||||
|
||||
class RowRecapAPI(RowRecap):
|
||||
"""Pour table avec partitions et sort_key"""
|
||||
|
||||
def add_etud_cols(self):
|
||||
"""Ajoute colonnes étudiant: codes, noms"""
|
||||
super().add_etud_cols()
|
||||
self.add_cell("partitions", "partitions", etud_groups.get(self.etud.id, {}))
|
||||
self.add_cell("sort_key", "sort_key", self.etud.sort_key)
|
||||
|
||||
table = TableRecap(
|
||||
res,
|
||||
convert_values=convert_values,
|
||||
include_evaluations=False,
|
||||
mode_jury=False,
|
||||
row_class=RowRecapAPI,
|
||||
)
|
||||
|
||||
rows = table.to_list()
|
||||
|
||||
# for row in rows:
|
||||
# row["partitions"] = etud_groups.get(row["etudid"], {})
|
||||
return rows
|
||||
|
||||
|
||||
|
|
|
@ -603,8 +603,19 @@ class Role(db.Model):
|
|||
"""Create default roles if missing, then, if reset_permissions,
|
||||
reset their permissions to default values.
|
||||
"""
|
||||
Role.reset_roles_permissions(
|
||||
SCO_ROLES_DEFAULTS, reset_permissions=reset_permissions
|
||||
)
|
||||
|
||||
@staticmethod
|
||||
def reset_roles_permissions(roles_perms: dict[str, tuple], reset_permissions=True):
|
||||
"""Ajoute les permissions aux roles
|
||||
roles_perms : { "role_name" : (permission, ...) }
|
||||
reset_permissions : si vrai efface permissions déja existantes
|
||||
Si le role n'existe pas, il est (re) créé.
|
||||
"""
|
||||
default_role = "Observateur"
|
||||
for role_name, permissions in SCO_ROLES_DEFAULTS.items():
|
||||
for role_name, permissions in roles_perms.items():
|
||||
role = Role.query.filter_by(name=role_name).first()
|
||||
if role is None:
|
||||
role = Role(name=role_name)
|
||||
|
|
|
@ -21,7 +21,7 @@ def form_ue_choix_parcours(ue: UniteEns) -> str:
|
|||
return ""
|
||||
ref_comp = ue.formation.referentiel_competence
|
||||
if ref_comp is None:
|
||||
return f"""<div class="ue_advanced">
|
||||
return f"""<div class="scobox ue_advanced">
|
||||
<div class="warning">Pas de référentiel de compétence associé à cette formation !</div>
|
||||
<div><a class="stdlink" href="{ url_for('notes.refcomp_assoc_formation',
|
||||
scodoc_dept=g.scodoc_dept, formation_id=ue.formation.id)
|
||||
|
@ -31,19 +31,28 @@ def form_ue_choix_parcours(ue: UniteEns) -> str:
|
|||
|
||||
H = [
|
||||
"""
|
||||
<div class="ue_advanced">
|
||||
<h3>Parcours du BUT</h3>
|
||||
<div class="scobox ue_advanced">
|
||||
<div class="scobox-title">Parcours du BUT</div>
|
||||
"""
|
||||
]
|
||||
# Choix des parcours
|
||||
ue_pids = [p.id for p in ue.parcours]
|
||||
H.append("""<form id="choix_parcours">""")
|
||||
H.append(
|
||||
"""
|
||||
<div class="help">
|
||||
Cocher tous les parcours dans lesquels cette UE est utilisée,
|
||||
même si vous n'offrez pas ce parcours dans votre département.
|
||||
Sans quoi, les UEs de Tronc Commun ne seront pas reconnues.
|
||||
Ne cocher aucun parcours est équivalent à tous les cocher.
|
||||
</div>
|
||||
<form id="choix_parcours" style="margin-top: 12px;">
|
||||
"""
|
||||
)
|
||||
|
||||
ects_differents = {
|
||||
ue.get_ects(parcour, only_parcours=True) for parcour in ref_comp.parcours
|
||||
} != {None}
|
||||
for parcour in ref_comp.parcours:
|
||||
ects_parcour = ue.get_ects(parcour)
|
||||
ects_parcour_txt = (
|
||||
f" ({ue.get_ects(parcour):.3g} ects)" if ects_differents else ""
|
||||
)
|
||||
|
|
|
@ -9,12 +9,14 @@
|
|||
|
||||
import collections
|
||||
import datetime
|
||||
import pandas as pd
|
||||
import numpy as np
|
||||
from flask import g, has_request_context, url_for
|
||||
|
||||
from app import db
|
||||
from app.comp.moy_mod import ModuleImplResults
|
||||
from app.comp.res_but import ResultatsSemestreBUT
|
||||
from app.models import Evaluation, FormSemestre, Identite
|
||||
from app.models import Evaluation, FormSemestre, Identite, ModuleImpl
|
||||
from app.models.groups import GroupDescr
|
||||
from app.models.ues import UniteEns
|
||||
from app.scodoc import sco_bulletins, sco_utils as scu
|
||||
|
@ -229,7 +231,7 @@ class BulletinBUT:
|
|||
if res.modimpl_inscr_df[modimpl.id][etud.id]: # si inscrit
|
||||
d[modimpl.module.code] = {
|
||||
"id": modimpl.id,
|
||||
"titre": modimpl.module.titre,
|
||||
"titre": modimpl.module.titre_str(),
|
||||
"code_apogee": modimpl.module.code_apogee,
|
||||
"url": (
|
||||
url_for(
|
||||
|
@ -249,59 +251,88 @@ class BulletinBUT:
|
|||
# "moy": fmt_note(moyennes_etuds.mean()),
|
||||
},
|
||||
"evaluations": (
|
||||
[
|
||||
self.etud_eval_results(etud, e)
|
||||
for e in modimpl.evaluations
|
||||
if (e.visibulletin or version == "long")
|
||||
and (e.id in modimpl_results.evaluations_etat)
|
||||
and (
|
||||
modimpl_results.evaluations_etat[e.id].is_complete
|
||||
or self.prefs["bul_show_all_evals"]
|
||||
)
|
||||
]
|
||||
self.etud_list_modimpl_evaluations(
|
||||
etud, modimpl, modimpl_results, version
|
||||
)
|
||||
if version != "short"
|
||||
else []
|
||||
),
|
||||
}
|
||||
return d
|
||||
|
||||
def etud_eval_results(self, etud, e: Evaluation) -> dict:
|
||||
def etud_list_modimpl_evaluations(
|
||||
self,
|
||||
etud: Identite,
|
||||
modimpl: ModuleImpl,
|
||||
modimpl_results: ModuleImplResults,
|
||||
version: str,
|
||||
) -> list[dict]:
|
||||
"""Liste des résultats aux évaluations de ce modimpl à montrer pour cet étudiant"""
|
||||
evaluation: Evaluation
|
||||
eval_results = []
|
||||
for evaluation in modimpl.evaluations:
|
||||
if (
|
||||
(evaluation.visibulletin or version == "long")
|
||||
and (evaluation.id in modimpl_results.evaluations_etat)
|
||||
and (
|
||||
modimpl_results.evaluations_etat[evaluation.id].is_complete
|
||||
or self.prefs["bul_show_all_evals"]
|
||||
)
|
||||
):
|
||||
eval_notes = self.res.modimpls_results[modimpl.id].evals_notes[
|
||||
evaluation.id
|
||||
]
|
||||
|
||||
if (evaluation.evaluation_type == Evaluation.EVALUATION_NORMALE) or (
|
||||
not np.isnan(eval_notes[etud.id])
|
||||
):
|
||||
eval_results.append(
|
||||
self.etud_eval_results(etud, evaluation, eval_notes)
|
||||
)
|
||||
return eval_results
|
||||
|
||||
def etud_eval_results(
|
||||
self, etud: Identite, evaluation: Evaluation, eval_notes: pd.DataFrame
|
||||
) -> dict:
|
||||
"dict resultats d'un étudiant à une évaluation"
|
||||
# eval_notes est une pd.Series avec toutes les notes des étudiants inscrits
|
||||
eval_notes = self.res.modimpls_results[e.moduleimpl_id].evals_notes[e.id]
|
||||
notes_ok = eval_notes.where(eval_notes > scu.NOTES_ABSENCE).dropna()
|
||||
modimpls_evals_poids = self.res.modimpls_evals_poids[e.moduleimpl_id]
|
||||
modimpls_evals_poids = self.res.modimpls_evals_poids[evaluation.moduleimpl_id]
|
||||
try:
|
||||
etud_ues_ids = self.res.etud_ues_ids(etud.id)
|
||||
poids = {
|
||||
ue.acronyme: modimpls_evals_poids[ue.id][e.id]
|
||||
ue.acronyme: modimpls_evals_poids[ue.id][evaluation.id]
|
||||
for ue in self.res.ues
|
||||
if (ue.type != UE_SPORT) and (ue.id in etud_ues_ids)
|
||||
}
|
||||
except KeyError:
|
||||
poids = collections.defaultdict(lambda: 0.0)
|
||||
d = {
|
||||
"id": e.id,
|
||||
"id": evaluation.id,
|
||||
"coef": (
|
||||
fmt_note(e.coefficient)
|
||||
if e.evaluation_type == Evaluation.EVALUATION_NORMALE
|
||||
fmt_note(evaluation.coefficient)
|
||||
if evaluation.evaluation_type == Evaluation.EVALUATION_NORMALE
|
||||
else None
|
||||
),
|
||||
"date_debut": e.date_debut.isoformat() if e.date_debut else None,
|
||||
"date_fin": e.date_fin.isoformat() if e.date_fin else None,
|
||||
"description": e.description,
|
||||
"evaluation_type": e.evaluation_type,
|
||||
"date_debut": (
|
||||
evaluation.date_debut.isoformat() if evaluation.date_debut else None
|
||||
),
|
||||
"date_fin": (
|
||||
evaluation.date_fin.isoformat() if evaluation.date_fin else None
|
||||
),
|
||||
"description": evaluation.description,
|
||||
"evaluation_type": evaluation.evaluation_type,
|
||||
"note": (
|
||||
{
|
||||
"value": fmt_note(
|
||||
eval_notes[etud.id],
|
||||
note_max=e.note_max,
|
||||
note_max=evaluation.note_max,
|
||||
),
|
||||
"min": fmt_note(notes_ok.min(), note_max=e.note_max),
|
||||
"max": fmt_note(notes_ok.max(), note_max=e.note_max),
|
||||
"moy": fmt_note(notes_ok.mean(), note_max=e.note_max),
|
||||
"min": fmt_note(notes_ok.min(), note_max=evaluation.note_max),
|
||||
"max": fmt_note(notes_ok.max(), note_max=evaluation.note_max),
|
||||
"moy": fmt_note(notes_ok.mean(), note_max=evaluation.note_max),
|
||||
}
|
||||
if not e.is_blocked()
|
||||
if not evaluation.is_blocked()
|
||||
else {}
|
||||
),
|
||||
"poids": poids,
|
||||
|
@ -309,17 +340,25 @@ class BulletinBUT:
|
|||
url_for(
|
||||
"notes.evaluation_listenotes",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
evaluation_id=e.id,
|
||||
evaluation_id=evaluation.id,
|
||||
)
|
||||
if has_request_context()
|
||||
else "na"
|
||||
),
|
||||
# deprecated (supprimer avant #sco9.7)
|
||||
"date": e.date_debut.isoformat() if e.date_debut else None,
|
||||
"heure_debut": (
|
||||
e.date_debut.time().isoformat("minutes") if e.date_debut else None
|
||||
"date": (
|
||||
evaluation.date_debut.isoformat() if evaluation.date_debut else None
|
||||
),
|
||||
"heure_debut": (
|
||||
evaluation.date_debut.time().isoformat("minutes")
|
||||
if evaluation.date_debut
|
||||
else None
|
||||
),
|
||||
"heure_fin": (
|
||||
evaluation.date_fin.time().isoformat("minutes")
|
||||
if evaluation.date_fin
|
||||
else None
|
||||
),
|
||||
"heure_fin": e.date_fin.time().isoformat("minutes") if e.date_fin else None,
|
||||
}
|
||||
return d
|
||||
|
||||
|
@ -540,9 +579,9 @@ class BulletinBUT:
|
|||
|
||||
d.update(infos)
|
||||
# --- Rangs
|
||||
d[
|
||||
"rang_nt"
|
||||
] = f"{d['semestre']['rang']['value']} / {d['semestre']['rang']['total']}"
|
||||
d["rang_nt"] = (
|
||||
f"{d['semestre']['rang']['value']} / {d['semestre']['rang']['total']}"
|
||||
)
|
||||
d["rang_txt"] = "Rang " + d["rang_nt"]
|
||||
|
||||
d.update(sco_bulletins.make_context_dict(self.res.formsemestre, d["etud"]))
|
||||
|
|
|
@ -31,6 +31,7 @@ from app.scodoc.sco_bulletins_standard import BulletinGeneratorStandard
|
|||
from app.scodoc.sco_logos import Logo
|
||||
from app.scodoc.sco_pdf import PDFLOCK, SU
|
||||
from app.scodoc.sco_preferences import SemPreferences
|
||||
from app.scodoc import sco_utils as scu
|
||||
|
||||
|
||||
def make_bulletin_but_court_pdf(
|
||||
|
@ -343,9 +344,11 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
|
|||
for mod in self.bul[mod_type]:
|
||||
row = [mod, bul[mod_type][mod]["titre"]]
|
||||
row += [
|
||||
bul["ues"][ue][mod_type][mod]["moyenne"]
|
||||
if mod in bul["ues"][ue][mod_type]
|
||||
else ""
|
||||
(
|
||||
bul["ues"][ue][mod_type][mod]["moyenne"]
|
||||
if mod in bul["ues"][ue][mod_type]
|
||||
else ""
|
||||
)
|
||||
for ue in self.ues_acronyms
|
||||
]
|
||||
rows.append(row)
|
||||
|
@ -523,7 +526,7 @@ class BulletinGeneratorBUTCourt(BulletinGeneratorStandard):
|
|||
if self.bul["semestre"].get("decision_annee", None):
|
||||
txt += f"""
|
||||
Décision saisie le {
|
||||
datetime.datetime.fromisoformat(self.bul["semestre"]["decision_annee"]["date"]).strftime("%d/%m/%Y")
|
||||
datetime.datetime.fromisoformat(self.bul["semestre"]["decision_annee"]["date"]).strftime(scu.DATE_FMT)
|
||||
}, année BUT{self.bul["semestre"]["decision_annee"]["ordre"]}
|
||||
<b>{self.bul["semestre"]["decision_annee"]["code"]}</b>.
|
||||
<br/>
|
||||
|
|
|
@ -269,7 +269,7 @@ class BulletinGeneratorStandardBUT(BulletinGeneratorStandard):
|
|||
date_capitalisation = ue.get("date_capitalisation")
|
||||
if date_capitalisation:
|
||||
fields_bmr.append(
|
||||
f"""Capitalisée le {date_capitalisation.strftime("%d/%m/%Y")}"""
|
||||
f"""Capitalisée le {date_capitalisation.strftime(scu.DATE_FMT)}"""
|
||||
)
|
||||
t = {
|
||||
"titre": " - ".join(fields_bmr),
|
||||
|
|
|
@ -0,0 +1,92 @@
|
|||
##############################################################################
|
||||
# ScoDoc
|
||||
# Copyright (c) 1999 - 2024 Emmanuel Viennet. All rights reserved.
|
||||
# See LICENSE
|
||||
##############################################################################
|
||||
|
||||
"""Code expérimental: si deux référentiel sont presques identiques
|
||||
(mêmes compétences, niveaux, parcours)
|
||||
essaie de changer une formation de référentiel.
|
||||
"""
|
||||
|
||||
from app import clear_scodoc_cache, db
|
||||
|
||||
from app.models import (
|
||||
ApcParcours,
|
||||
ApcReferentielCompetences,
|
||||
ApcValidationRCUE,
|
||||
Formation,
|
||||
FormSemestreInscription,
|
||||
UniteEns,
|
||||
)
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
|
||||
|
||||
def formation_change_referentiel(
|
||||
formation: Formation, new_ref: ApcReferentielCompetences
|
||||
):
|
||||
"""Try to change ref."""
|
||||
if not formation.referentiel_competence:
|
||||
raise ScoValueError("formation non associée à un référentiel")
|
||||
if not isinstance(new_ref, ApcReferentielCompetences):
|
||||
raise ScoValueError("nouveau référentiel invalide")
|
||||
|
||||
r = formation.referentiel_competence.map_to_other_referentiel(new_ref)
|
||||
if isinstance(r, str):
|
||||
raise ScoValueError(f"référentiels incompatibles: {r}")
|
||||
parcours_map, competences_map, niveaux_map = r
|
||||
|
||||
formation.referentiel_competence = new_ref
|
||||
db.session.add(formation)
|
||||
# UEs - Niveaux et UEs - parcours
|
||||
for ue in formation.ues:
|
||||
if ue.niveau_competence:
|
||||
ue.niveau_competence_id = niveaux_map[ue.niveau_competence_id]
|
||||
db.session.add(ue)
|
||||
if ue.parcours:
|
||||
new_list = [ApcParcours.query.get(parcours_map[p.id]) for p in ue.parcours]
|
||||
ue.parcours.clear()
|
||||
ue.parcours.extend(new_list)
|
||||
db.session.add(ue)
|
||||
# Modules / parcours et app_critiques
|
||||
for module in formation.modules:
|
||||
if module.parcours:
|
||||
new_list = [
|
||||
ApcParcours.query.get(parcours_map[p.id]) for p in module.parcours
|
||||
]
|
||||
module.parcours.clear()
|
||||
module.parcours.extend(new_list)
|
||||
db.session.add(module)
|
||||
if module.app_critiques: # efface les apprentissages critiques
|
||||
module.app_critiques.clear()
|
||||
db.session.add(module)
|
||||
# ApcValidationRCUE
|
||||
for valid_rcue in ApcValidationRCUE.query.join(
|
||||
UniteEns, UniteEns.id == ApcValidationRCUE.ue1_id
|
||||
).filter_by(formation_id=formation.id):
|
||||
if valid_rcue.parcour:
|
||||
valid_rcue.parcour_id = parcours_map[valid_rcue.parcour.id]
|
||||
db.session.add(valid_rcue)
|
||||
for valid_rcue in ApcValidationRCUE.query.join(
|
||||
UniteEns, UniteEns.id == ApcValidationRCUE.ue2_id
|
||||
).filter_by(formation_id=formation.id):
|
||||
if valid_rcue.parcour:
|
||||
valid_rcue.parcour_id = parcours_map[valid_rcue.parcour.id]
|
||||
db.session.add(valid_rcue)
|
||||
# FormSemestre / parcours_formsemestre
|
||||
for formsemestre in formation.formsemestres:
|
||||
new_list = [
|
||||
ApcParcours.query.get(parcours_map[p.id]) for p in formsemestre.parcours
|
||||
]
|
||||
formsemestre.parcours.clear()
|
||||
formsemestre.parcours.extend(new_list)
|
||||
db.session.add(formsemestre)
|
||||
# FormSemestreInscription.parcour_id
|
||||
for inscr in FormSemestreInscription.query.filter_by(
|
||||
formsemestre_id=formsemestre.id
|
||||
).filter(FormSemestreInscription.parcour_id != None):
|
||||
if inscr.parcour_id is not None:
|
||||
inscr.parcour_id = parcours_map[inscr.parcour_id]
|
||||
#
|
||||
db.session.commit()
|
||||
clear_scodoc_cache()
|
|
@ -542,9 +542,9 @@ def formation_semestre_niveaux_warning(formation: Formation, semestre_idx: int)
|
|||
for parcour_code, niveaux in niveaux_sans_ue_by_parcour.items():
|
||||
H.append(
|
||||
f"""<li>Parcours {parcour_code} : {
|
||||
len(niveaux)} niveaux sans UEs
|
||||
<span>
|
||||
{ ', '.join( f'{niveau.competence.titre} {niveau.ordre}'
|
||||
len(niveaux)} niveaux sans UEs :
|
||||
<span class="niveau-nom"><span>
|
||||
{ '</span>, <span>'.join( f'{niveau.competence.titre} {niveau.ordre}'
|
||||
for niveau in niveaux
|
||||
)
|
||||
}
|
||||
|
|
|
@ -10,9 +10,11 @@
|
|||
from flask_wtf import FlaskForm
|
||||
from flask_wtf.file import FileField, FileAllowed
|
||||
from wtforms import SelectField, SubmitField
|
||||
from wtforms.validators import DataRequired
|
||||
|
||||
|
||||
class FormationRefCompForm(FlaskForm):
|
||||
"Choix d'un référentiel"
|
||||
referentiel_competence = SelectField(
|
||||
"Choisir parmi les référentiels déjà chargés :"
|
||||
)
|
||||
|
@ -21,6 +23,7 @@ class FormationRefCompForm(FlaskForm):
|
|||
|
||||
|
||||
class RefCompLoadForm(FlaskForm):
|
||||
"Upload d'un référentiel"
|
||||
referentiel_standard = SelectField(
|
||||
"Choisir un référentiel de compétences officiel BUT"
|
||||
)
|
||||
|
@ -47,3 +50,12 @@ class RefCompLoadForm(FlaskForm):
|
|||
)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
class FormationChangeRefCompForm(FlaskForm):
|
||||
"choix d'un nouveau ref. comp. pour une formation"
|
||||
object_select = SelectField(
|
||||
"Choisir le nouveau référentiel", validators=[DataRequired()]
|
||||
)
|
||||
submit = SubmitField("Changer le référentiel de la formation")
|
||||
cancel = SubmitField("Annuler")
|
||||
|
|
|
@ -77,7 +77,7 @@ from app.models.but_refcomp import (
|
|||
ApcNiveau,
|
||||
ApcParcours,
|
||||
)
|
||||
from app.models import Evaluation, Scolog, ScolarAutorisationInscription
|
||||
from app.models import Evaluation, ModuleImpl, Scolog, ScolarAutorisationInscription
|
||||
from app.models.but_validations import (
|
||||
ApcValidationAnnee,
|
||||
ApcValidationRCUE,
|
||||
|
@ -413,12 +413,12 @@ class DecisionsProposeesAnnee(DecisionsProposees):
|
|||
# Si validée par niveau supérieur:
|
||||
if self.code_valide == sco_codes.ADSUP:
|
||||
self.codes.insert(0, sco_codes.ADSUP)
|
||||
self.explanation = f"<div>{explanation}</div>"
|
||||
self.explanation = f'<div class="deca-expl">{explanation}</div>'
|
||||
messages = self.descr_pb_coherence()
|
||||
if messages:
|
||||
self.explanation += (
|
||||
'<div class="warning">'
|
||||
+ '</div><div class="warning">'.join(messages)
|
||||
'<div class="warning warning-info">'
|
||||
+ '</div><div class="warning warning-info">'.join(messages)
|
||||
+ "</div>"
|
||||
)
|
||||
self.codes = [self.codes[0]] + sorted((c or "") for c in self.codes[1:])
|
||||
|
@ -796,16 +796,33 @@ class DecisionsProposeesAnnee(DecisionsProposees):
|
|||
if self.formsemestre_pair is not None:
|
||||
sco_cache.invalidate_formsemestre(formsemestre_id=self.formsemestre_pair.id)
|
||||
|
||||
def has_notes_en_attente(self) -> bool:
|
||||
"Vrai si l'étudiant a au moins une note en attente dans le semestre origine de ce deca"
|
||||
res = (
|
||||
def _get_current_res(self) -> ResultatsSemestreBUT:
|
||||
"Les res. du semestre d'origine du deca"
|
||||
return (
|
||||
self.res_pair
|
||||
if self.formsemestre_pair
|
||||
and (self.formsemestre.id == self.formsemestre_pair.id)
|
||||
else self.res_impair
|
||||
)
|
||||
|
||||
def has_notes_en_attente(self) -> bool:
|
||||
"Vrai si l'étudiant a au moins une note en attente dans le semestre origine de ce deca"
|
||||
res = self._get_current_res()
|
||||
return res and self.etud.id in res.get_etudids_attente()
|
||||
|
||||
def get_modimpls_attente(self) -> list[ModuleImpl]:
|
||||
"Liste des ModuleImpl dans lesquels l'étudiant à au moins une note en ATTente"
|
||||
res = self._get_current_res()
|
||||
modimpls_results = [
|
||||
modimpl_result
|
||||
for modimpl_result in res.modimpls_results.values()
|
||||
if self.etud.id in modimpl_result.etudids_attente
|
||||
]
|
||||
modimpls = [
|
||||
db.session.get(ModuleImpl, mr.moduleimpl_id) for mr in modimpls_results
|
||||
]
|
||||
return sorted(modimpls, key=lambda mi: (mi.module.numero, mi.module.code))
|
||||
|
||||
def record_all(self, only_validantes: bool = False) -> bool:
|
||||
"""Enregistre les codes qui n'ont pas été spécifiés par le formulaire,
|
||||
et sont donc en mode "automatique".
|
||||
|
@ -997,19 +1014,23 @@ class DecisionsProposeesAnnee(DecisionsProposees):
|
|||
if dec_ue.code_valide not in CODES_UE_VALIDES:
|
||||
if (
|
||||
dec_ue.ue_status
|
||||
and dec_ue.ue_status["was_capitalized"]
|
||||
and dec_ue.ue_status["is_capitalized"]
|
||||
):
|
||||
messages.append(
|
||||
f"Information: l'UE {ue.acronyme} capitalisée est utilisée pour un RCUE cette année"
|
||||
)
|
||||
else:
|
||||
messages.append(
|
||||
f"L'UE {ue.acronyme} n'est pas validée mais son RCUE l'est !"
|
||||
f"L'UE {ue.acronyme} n'est pas validée mais son RCUE l'est (probablement une validation antérieure)"
|
||||
)
|
||||
else:
|
||||
messages.append(
|
||||
f"L'UE {ue.acronyme} n'a pas décision (???)"
|
||||
)
|
||||
# Voyons si on est dispensé de cette ue ?
|
||||
res = self.res_impair if ue.semestre_idx % 2 else self.res_pair
|
||||
if res and (self.etud.id, ue.id) in res.dispense_ues:
|
||||
messages.append(f"Pas (ré)inscrit à l'UE {ue.acronyme}")
|
||||
return messages
|
||||
|
||||
def valide_diplome(self) -> bool:
|
||||
|
@ -1514,7 +1535,7 @@ class DecisionsProposeesUE(DecisionsProposees):
|
|||
|
||||
def __repr__(self) -> str:
|
||||
return f"""<{self.__class__.__name__} ue={self.ue.acronyme} valid={self.code_valide
|
||||
} codes={self.codes} explanation={self.explanation}>"""
|
||||
} codes={self.codes} explanation="{self.explanation}">"""
|
||||
|
||||
def compute_codes(self):
|
||||
"""Calcul des .codes attribuables et de l'explanation associée"""
|
||||
|
|
|
@ -55,11 +55,21 @@ def pvjury_page_but(formsemestre_id: int, fmt="html"):
|
|||
else:
|
||||
line_sep = "\n"
|
||||
rows, titles = pvjury_table_but(formsemestre, line_sep=line_sep)
|
||||
|
||||
if fmt.startswith("xls"):
|
||||
titles.update(
|
||||
{
|
||||
"etudid": "etudid",
|
||||
"code_nip": "nip",
|
||||
"code_ine": "ine",
|
||||
"ects_but": "Total ECTS BUT",
|
||||
"civilite": "Civ.",
|
||||
"nom": "Nom",
|
||||
"prenom": "Prénom",
|
||||
}
|
||||
)
|
||||
# Style excel... passages à la ligne sur \n
|
||||
xls_style_base = sco_excel.excel_make_style()
|
||||
xls_style_base["alignment"] = Alignment(wrapText=True, vertical="top")
|
||||
|
||||
tab = GenTable(
|
||||
base_url=f"{request.base_url}?formsemestre_id={formsemestre_id}",
|
||||
caption=title,
|
||||
|
@ -116,7 +126,7 @@ def pvjury_table_but(
|
|||
"pas de référentiel de compétences associé à la formation de ce semestre !"
|
||||
)
|
||||
titles = {
|
||||
"nom": "Code" if anonymous else "Nom",
|
||||
"nom_pv": "Code" if anonymous else "Nom",
|
||||
"cursus": "Cursus",
|
||||
"ects": "ECTS",
|
||||
"ues": "UE validées",
|
||||
|
@ -144,33 +154,47 @@ def pvjury_table_but(
|
|||
except ScoValueError:
|
||||
deca = None
|
||||
|
||||
ects_but_valides = but_ects_valides(etud, referentiel_competence_id)
|
||||
row = {
|
||||
"nom": etud.code_ine or etud.code_nip or etud.id
|
||||
if anonymous # Mode anonyme: affiche INE ou sinon NIP, ou id
|
||||
else etud.etat_civil_pv(
|
||||
line_sep=line_sep, with_paragraph=with_paragraph_nom
|
||||
"nom_pv": (
|
||||
etud.code_ine or etud.code_nip or etud.id
|
||||
if anonymous # Mode anonyme: affiche INE ou sinon NIP, ou id
|
||||
else etud.etat_civil_pv(
|
||||
line_sep=line_sep, with_paragraph=with_paragraph_nom
|
||||
)
|
||||
),
|
||||
"_nom_order": etud.sort_key,
|
||||
"_nom_target_attrs": f'class="etudinfo" id="{etud.id}"',
|
||||
"_nom_td_attrs": f'id="{etud.id}" class="etudinfo"',
|
||||
"_nom_target": url_for(
|
||||
"_nom_pv_order": etud.sort_key,
|
||||
"_nom_pv_target_attrs": f'class="etudinfo" id="{etud.id}"',
|
||||
"_nom_pv_td_attrs": f'id="{etud.id}" class="etudinfo"',
|
||||
"_nom_pv_target": url_for(
|
||||
"scolar.fiche_etud",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
etudid=etud.id,
|
||||
),
|
||||
"cursus": _descr_cursus_but(etud),
|
||||
"ects": f"""{deca.ects_annee():g}<br><br>Tot. {but_ects_valides(etud, referentiel_competence_id ):g}""",
|
||||
"ects": f"""{deca.ects_annee():g}<br><br>Tot. {ects_but_valides:g}""",
|
||||
"_ects_xls": deca.ects_annee(),
|
||||
"ects_but": ects_but_valides,
|
||||
"ues": deca.descr_ues_validation(line_sep=line_sep) if deca else "-",
|
||||
"niveaux": deca.descr_niveaux_validation(line_sep=line_sep)
|
||||
if deca
|
||||
else "-",
|
||||
"niveaux": (
|
||||
deca.descr_niveaux_validation(line_sep=line_sep) if deca else "-"
|
||||
),
|
||||
"decision_but": deca.code_valide if deca else "",
|
||||
"devenir": ", ".join([f"S{i}" for i in deca.get_autorisations_passage()])
|
||||
if deca
|
||||
else "",
|
||||
"devenir": (
|
||||
", ".join([f"S{i}" for i in deca.get_autorisations_passage()])
|
||||
if deca
|
||||
else ""
|
||||
),
|
||||
# pour exports excel seulement:
|
||||
"civilite": etud.civilite_etat_civil_str,
|
||||
"nom": etud.nom,
|
||||
"prenom": etud.prenom_etat_civil or etud.prenom or "",
|
||||
"etudid": etud.id,
|
||||
"code_nip": etud.code_nip,
|
||||
"code_ine": etud.code_ine,
|
||||
}
|
||||
if deca.valide_diplome() or not only_diplome:
|
||||
rows.append(row)
|
||||
|
||||
rows.sort(key=lambda x: x["_nom_order"])
|
||||
rows.sort(key=lambda x: x["_nom_pv_order"])
|
||||
return rows, titles
|
||||
|
|
|
@ -21,8 +21,6 @@ from app.but.jury_but import (
|
|||
DecisionsProposeesRCUE,
|
||||
DecisionsProposeesUE,
|
||||
)
|
||||
from app.comp import res_sem
|
||||
from app.comp.res_but import ResultatsSemestreBUT
|
||||
from app.models import (
|
||||
ApcNiveau,
|
||||
FormSemestre,
|
||||
|
@ -33,11 +31,8 @@ from app.models import (
|
|||
ScolarFormSemestreValidation,
|
||||
ScolarNews,
|
||||
)
|
||||
from app.models.config import ScoDocSiteConfig
|
||||
from app.scodoc import html_sco_header
|
||||
from app.scodoc import codes_cursus as sco_codes
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
from app.scodoc import sco_preferences
|
||||
from app.scodoc import sco_utils as scu
|
||||
|
||||
|
||||
|
@ -109,23 +104,32 @@ def show_etud(deca: DecisionsProposeesAnnee, read_only: bool = True) -> str:
|
|||
</div>"""
|
||||
)
|
||||
ue_impair, ue_pair = rcue.ue_1, rcue.ue_2
|
||||
# Les UEs à afficher,
|
||||
# qui
|
||||
ues_ro = [
|
||||
# Les UEs à afficher : on regarde si read only et si dispense (non ré-inscription à l'UE)
|
||||
# tuples (UniteEns, read_only, dispense)
|
||||
ues_ro_dispense = [
|
||||
(
|
||||
ue_impair,
|
||||
rcue.ue_cur_impair is None,
|
||||
deca.res_impair
|
||||
and ue_impair
|
||||
and (deca.etud.id, ue_impair.id) in deca.res_impair.dispense_ues,
|
||||
),
|
||||
(
|
||||
ue_pair,
|
||||
rcue.ue_cur_pair is None,
|
||||
deca.res_pair
|
||||
and ue_pair
|
||||
and (deca.etud.id, ue_pair.id) in deca.res_pair.dispense_ues,
|
||||
),
|
||||
]
|
||||
# Ordonne selon les dates des 2 semestres considérés:
|
||||
if reverse_semestre:
|
||||
ues_ro[0], ues_ro[1] = ues_ro[1], ues_ro[0]
|
||||
ues_ro_dispense[0], ues_ro_dispense[1] = (
|
||||
ues_ro_dispense[1],
|
||||
ues_ro_dispense[0],
|
||||
)
|
||||
# Colonnes d'UE:
|
||||
for ue, ue_read_only in ues_ro:
|
||||
for ue, ue_read_only, ue_dispense in ues_ro_dispense:
|
||||
if ue:
|
||||
H.append(
|
||||
_gen_but_niveau_ue(
|
||||
|
@ -134,6 +138,7 @@ def show_etud(deca: DecisionsProposeesAnnee, read_only: bool = True) -> str:
|
|||
disabled=read_only or ue_read_only,
|
||||
annee_prec=ue_read_only,
|
||||
niveau_id=ue.niveau_competence.id,
|
||||
ue_dispense=ue_dispense,
|
||||
)
|
||||
)
|
||||
else:
|
||||
|
@ -188,21 +193,30 @@ def _gen_but_niveau_ue(
|
|||
disabled: bool = False,
|
||||
annee_prec: bool = False,
|
||||
niveau_id: int = None,
|
||||
ue_dispense: bool = False,
|
||||
) -> str:
|
||||
if dec_ue.ue_status and dec_ue.ue_status["is_capitalized"]:
|
||||
moy_ue_str = f"""<span class="ue_cap">{
|
||||
scu.fmt_note(dec_ue.moy_ue_with_cap)}</span>"""
|
||||
scoplement = f"""<div class="scoplement">
|
||||
<div>
|
||||
<b>UE {ue.acronyme} capitalisée </b>
|
||||
<span>le {dec_ue.ue_status["event_date"].strftime("%d/%m/%Y")}
|
||||
</span>
|
||||
</div>
|
||||
<div>UE en cours
|
||||
|
||||
if ue_dispense:
|
||||
etat_en_cours = """Non (ré)inscrit à cette UE"""
|
||||
else:
|
||||
etat_en_cours = f"""UE en cours
|
||||
{ "sans notes" if np.isnan(dec_ue.moy_ue)
|
||||
else
|
||||
("avec moyenne <b>" + scu.fmt_note(dec_ue.moy_ue) + "</b>")
|
||||
}
|
||||
"""
|
||||
|
||||
scoplement = f"""<div class="scoplement">
|
||||
<div>
|
||||
<b>UE {ue.acronyme} capitalisée </b>
|
||||
<span>le {dec_ue.ue_status["event_date"].strftime(scu.DATE_FMT)}
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
{ etat_en_cours }
|
||||
</div>
|
||||
</div>
|
||||
"""
|
||||
|
@ -214,7 +228,7 @@ def _gen_but_niveau_ue(
|
|||
<div>
|
||||
<b>UE {ue.acronyme} antérieure </b>
|
||||
<span>validée {dec_ue.validation.code}
|
||||
le {dec_ue.validation.event_date.strftime("%d/%m/%Y")}
|
||||
le {dec_ue.validation.event_date.strftime(scu.DATE_FMT)}
|
||||
</span>
|
||||
</div>
|
||||
<div>Non reprise dans l'année en cours</div>
|
||||
|
@ -232,9 +246,7 @@ def _gen_but_niveau_ue(
|
|||
moy_ue_str = f"""<span>{scu.fmt_note(dec_ue.moy_ue)}</span>"""
|
||||
if dec_ue.code_valide:
|
||||
date_str = (
|
||||
f"""enregistré le {dec_ue.validation.event_date.strftime("%d/%m/%Y")}
|
||||
à {dec_ue.validation.event_date.strftime("%Hh%M")}
|
||||
"""
|
||||
f"""enregistré le {dec_ue.validation.event_date.strftime(scu.DATEATIME_FMT)}"""
|
||||
if dec_ue.validation and dec_ue.validation.event_date
|
||||
else ""
|
||||
)
|
||||
|
@ -244,7 +256,13 @@ def _gen_but_niveau_ue(
|
|||
</div>
|
||||
"""
|
||||
else:
|
||||
scoplement = ""
|
||||
if dec_ue.ue_status and dec_ue.ue_status["was_capitalized"]:
|
||||
scoplement = """<div class="scoplement">
|
||||
UE déjà capitalisée avec résultat moins favorable.
|
||||
</div>
|
||||
"""
|
||||
else:
|
||||
scoplement = ""
|
||||
|
||||
ue_class = "" # 'recorded' if dec_ue.code_valide is not None else ''
|
||||
if dec_ue.code_valide is not None and dec_ue.codes:
|
||||
|
|
|
@ -75,7 +75,7 @@ class RegroupementCoherentUE:
|
|||
else None
|
||||
)
|
||||
|
||||
# Autres validations pour l'UE paire
|
||||
# Autres validations pour les UEs paire/impaire
|
||||
self.validation_ue_best_pair = best_autre_ue_validation(
|
||||
etud.id,
|
||||
niveau.id,
|
||||
|
@ -101,14 +101,24 @@ class RegroupementCoherentUE:
|
|||
"résultats formsemestre de l'UE si elle est courante, None sinon"
|
||||
self.ue_status_impair = None
|
||||
if self.ue_cur_impair:
|
||||
# UE courante
|
||||
ue_status = res_impair.get_etud_ue_status(etud.id, self.ue_cur_impair.id)
|
||||
self.moy_ue_1 = ue_status["moy"] if ue_status else None # avec capitalisée
|
||||
self.ue_1 = self.ue_cur_impair
|
||||
self.res_impair = res_impair
|
||||
self.ue_status_impair = ue_status
|
||||
elif self.validation_ue_best_impair:
|
||||
# UE capitalisée
|
||||
self.moy_ue_1 = self.validation_ue_best_impair.moy_ue
|
||||
self.ue_1 = self.validation_ue_best_impair.ue
|
||||
if (
|
||||
res_impair
|
||||
and self.validation_ue_best_impair
|
||||
and self.validation_ue_best_impair.ue
|
||||
):
|
||||
self.ue_status_impair = res_impair.get_etud_ue_status(
|
||||
etud.id, self.validation_ue_best_impair.ue.id
|
||||
)
|
||||
else:
|
||||
self.moy_ue_1, self.ue_1 = None, None
|
||||
self.moy_ue_1_val = self.moy_ue_1 if self.moy_ue_1 is not None else 0.0
|
||||
|
|
|
@ -23,6 +23,7 @@ from app.models import (
|
|||
)
|
||||
from app.scodoc import sco_cache
|
||||
from app.scodoc import codes_cursus
|
||||
from app.scodoc import sco_utils as scu
|
||||
|
||||
|
||||
class ValidationsSemestre(ResultatsCache):
|
||||
|
@ -84,7 +85,7 @@ class ValidationsSemestre(ResultatsCache):
|
|||
"code": decision.code,
|
||||
"assidu": decision.assidu,
|
||||
"compense_formsemestre_id": decision.compense_formsemestre_id,
|
||||
"event_date": decision.event_date.strftime("%d/%m/%Y"),
|
||||
"event_date": decision.event_date.strftime(scu.DATE_FMT),
|
||||
}
|
||||
self.decisions_jury = decisions_jury
|
||||
|
||||
|
@ -107,7 +108,7 @@ class ValidationsSemestre(ResultatsCache):
|
|||
decisions_jury_ues[decision.etudid][decision.ue.id] = {
|
||||
"code": decision.code,
|
||||
"ects": ects, # 0. si UE non validée
|
||||
"event_date": decision.event_date.strftime("%d/%m/%Y"),
|
||||
"event_date": decision.event_date.strftime(scu.DATE_FMT),
|
||||
}
|
||||
|
||||
self.decisions_jury_ues = decisions_jury_ues
|
||||
|
|
|
@ -438,7 +438,7 @@ class ResultatsSemestre(ResultatsCache):
|
|||
|
||||
def get_etud_ue_status(self, etudid: int, ue_id: int) -> dict | None:
|
||||
"""L'état de l'UE pour cet étudiant.
|
||||
Result: dict, ou None si l'UE n'est pas dans ce semestre.
|
||||
Result: dict, ou None si l'UE n'existe pas ou n'est pas dans ce semestre.
|
||||
{
|
||||
"is_capitalized": # vrai si la version capitalisée est celle prise en compte (meilleure)
|
||||
"was_capitalized":# si elle a été capitalisée (meilleure ou pas)
|
||||
|
@ -456,6 +456,8 @@ class ResultatsSemestre(ResultatsCache):
|
|||
}
|
||||
"""
|
||||
ue: UniteEns = db.session.get(UniteEns, ue_id)
|
||||
if not ue:
|
||||
return None
|
||||
ue_dict = ue.to_dict()
|
||||
|
||||
if ue.type == UE_SPORT:
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
# See LICENSE
|
||||
##############################################################################
|
||||
|
||||
import datetime
|
||||
from threading import Thread
|
||||
|
||||
from flask import current_app, g
|
||||
|
@ -83,9 +84,12 @@ Adresses d'origine:
|
|||
\n\n"""
|
||||
+ msg.body
|
||||
)
|
||||
|
||||
now = datetime.datetime.now()
|
||||
formatted_time = now.strftime("%Y-%m-%d %H:%M:%S") + ".{:03d}".format(
|
||||
now.microsecond // 1000
|
||||
)
|
||||
current_app.logger.info(
|
||||
f"""email sent to{
|
||||
f"""[{formatted_time}] email sent to{
|
||||
' (mode test)' if email_test_mode_address else ''
|
||||
}: {msg.recipients}
|
||||
from sender {msg.sender}
|
||||
|
|
|
@ -59,3 +59,4 @@ def check_taxe_now(taxes):
|
|||
|
||||
|
||||
from app.entreprises import routes
|
||||
from app.entreprises.activate import activate_module
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
##############################################################################
|
||||
# ScoDoc
|
||||
# Copyright (c) 1999 - 2024 Emmanuel Viennet. All rights reserved.
|
||||
# See LICENSE
|
||||
##############################################################################
|
||||
|
||||
"""Activation du module entreprises
|
||||
|
||||
L'affichage du module est contrôlé par la config ScoDocConfig.enable_entreprises
|
||||
|
||||
Au moment de l'activation, il est en général utile de proposer de configurer les
|
||||
permissions de rôles standards: AdminEntreprise UtilisateurEntreprise ObservateurEntreprise
|
||||
|
||||
Voir associations dans sco_roles_default
|
||||
|
||||
"""
|
||||
from app.auth.models import Role
|
||||
from app.models import ScoDocSiteConfig
|
||||
from app.scodoc.sco_roles_default import SCO_ROLES_ENTREPRISES_DEFAULT
|
||||
|
||||
|
||||
def activate_module(
|
||||
enable: bool = True, set_default_roles_permission: bool = False
|
||||
) -> bool:
|
||||
"""Active le module et en option donne les permissions aux rôles standards.
|
||||
True si l'état d'activation a changé.
|
||||
"""
|
||||
change = ScoDocSiteConfig.enable_entreprises(enable)
|
||||
if enable and set_default_roles_permission:
|
||||
Role.reset_roles_permissions(SCO_ROLES_ENTREPRISES_DEFAULT)
|
||||
return change
|
|
@ -0,0 +1,17 @@
|
|||
"""
|
||||
Formulaire activation module entreprises
|
||||
"""
|
||||
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms.fields.simple import BooleanField, SubmitField
|
||||
|
||||
from app.models import ScoDocSiteConfig
|
||||
|
||||
|
||||
class ActivateEntreprisesForm(FlaskForm):
|
||||
"Formulaire activation module entreprises"
|
||||
set_default_roles_permission = BooleanField(
|
||||
"(re)mettre les rôles 'Entreprise' à leurs valeurs par défaut"
|
||||
)
|
||||
submit = SubmitField("Valider")
|
||||
cancel = SubmitField("Annuler", render_kw={"formnovalidate": True})
|
|
@ -48,13 +48,15 @@ class BonusConfigurationForm(FlaskForm):
|
|||
for (name, displayed_name) in ScoDocSiteConfig.get_bonus_sport_class_list()
|
||||
],
|
||||
)
|
||||
submit_bonus = SubmitField("Valider")
|
||||
submit_bonus = SubmitField("Enregistrer ce bonus")
|
||||
cancel_bonus = SubmitField("Annuler", render_kw={"formnovalidate": True})
|
||||
|
||||
|
||||
class ScoDocConfigurationForm(FlaskForm):
|
||||
"Panneau de configuration avancée"
|
||||
enable_entreprises = BooleanField("activer le module <em>entreprises</em>")
|
||||
disable_passerelle = BooleanField( # disable car par défaut activée
|
||||
"""cacher les fonctions liées à une passerelle de publication des résultats vers les étudiants ("œil"). N'affecte pas l'API, juste la présentation."""
|
||||
)
|
||||
month_debut_annee_scolaire = SelectField(
|
||||
label="Mois de début des années scolaires",
|
||||
description="""Date pivot. En France métropolitaine, août.
|
||||
|
@ -83,7 +85,7 @@ class ScoDocConfigurationForm(FlaskForm):
|
|||
disable_bul_pdf = BooleanField(
|
||||
"interdire les exports des bulletins en PDF (déconseillé)"
|
||||
)
|
||||
submit_scodoc = SubmitField("Valider")
|
||||
submit_scodoc = SubmitField("Enregistrer ces paramètres")
|
||||
cancel_scodoc = SubmitField("Annuler", render_kw={"formnovalidate": True})
|
||||
|
||||
|
||||
|
@ -98,6 +100,7 @@ def configuration():
|
|||
form_scodoc = ScoDocConfigurationForm(
|
||||
data={
|
||||
"enable_entreprises": ScoDocSiteConfig.is_entreprises_enabled(),
|
||||
"disable_passerelle": ScoDocSiteConfig.is_passerelle_disabled(),
|
||||
"month_debut_annee_scolaire": ScoDocSiteConfig.get_month_debut_annee_scolaire(),
|
||||
"month_debut_periode2": ScoDocSiteConfig.get_month_debut_periode2(),
|
||||
"email_from_addr": ScoDocSiteConfig.get("email_from_addr"),
|
||||
|
@ -123,12 +126,12 @@ def configuration():
|
|||
flash("Fonction bonus inchangée.")
|
||||
return redirect(url_for("scodoc.index"))
|
||||
elif form_scodoc.submit_scodoc.data and form_scodoc.validate():
|
||||
if ScoDocSiteConfig.enable_entreprises(
|
||||
enabled=form_scodoc.data["enable_entreprises"]
|
||||
if ScoDocSiteConfig.disable_passerelle(
|
||||
disabled=form_scodoc.data["disable_passerelle"]
|
||||
):
|
||||
flash(
|
||||
"Module entreprise "
|
||||
+ ("activé" if form_scodoc.data["enable_entreprises"] else "désactivé")
|
||||
"Fonction passerelle "
|
||||
+ ("cachées" if form_scodoc.data["disable_passerelle"] else "montrées")
|
||||
)
|
||||
if ScoDocSiteConfig.set_month_debut_annee_scolaire(
|
||||
int(form_scodoc.data["month_debut_annee_scolaire"])
|
||||
|
@ -171,6 +174,7 @@ def configuration():
|
|||
|
||||
return render_template(
|
||||
"configuration.j2",
|
||||
is_entreprises_enabled=ScoDocSiteConfig.is_entreprises_enabled(),
|
||||
form_bonus=form_bonus,
|
||||
form_scodoc=form_scodoc,
|
||||
scu=scu,
|
||||
|
|
|
@ -21,6 +21,7 @@ from app.scodoc import sco_abs_notification
|
|||
from app.scodoc.sco_archives_justificatifs import JustificatifArchiver
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
from app.scodoc.sco_permissions import Permission
|
||||
from app.scodoc import sco_utils as scu
|
||||
from app.scodoc.sco_utils import (
|
||||
EtatAssiduite,
|
||||
EtatJustificatif,
|
||||
|
@ -113,9 +114,9 @@ class Assiduite(ScoDocModel):
|
|||
"entry_date": self.entry_date,
|
||||
"user_id": None if user is None else user.id, # l'uid
|
||||
"user_name": None if user is None else user.user_name, # le login
|
||||
"user_nom_complet": None
|
||||
if user is None
|
||||
else user.get_nomcomplet(), # "Marie Dupont"
|
||||
"user_nom_complet": (
|
||||
None if user is None else user.get_nomcomplet()
|
||||
), # "Marie Dupont"
|
||||
"est_just": self.est_just,
|
||||
"external_data": self.external_data,
|
||||
}
|
||||
|
@ -364,7 +365,7 @@ class Assiduite(ScoDocModel):
|
|||
retourne le texte "saisie le <date> par <User>"
|
||||
"""
|
||||
|
||||
date: str = self.entry_date.strftime("%d/%m/%Y à %H:%M")
|
||||
date: str = self.entry_date.strftime(scu.DATEATIME_FMT)
|
||||
utilisateur: str = ""
|
||||
if self.user is not None:
|
||||
self.user: User
|
||||
|
|
|
@ -8,16 +8,19 @@
|
|||
from datetime import datetime
|
||||
import functools
|
||||
from operator import attrgetter
|
||||
import yaml
|
||||
|
||||
from flask import g
|
||||
from flask_sqlalchemy.query import Query
|
||||
from sqlalchemy.orm import class_mapper
|
||||
import sqlalchemy
|
||||
|
||||
from app import db
|
||||
from app import db, log
|
||||
|
||||
from app.scodoc.sco_utils import ModuleType
|
||||
from app.scodoc.sco_exceptions import ScoNoReferentielCompetences
|
||||
from app.scodoc.sco_exceptions import ScoNoReferentielCompetences, ScoValueError
|
||||
|
||||
REFCOMP_EQUIVALENCE_FILENAME = "ressources/referentiels/equivalences.yaml"
|
||||
|
||||
|
||||
# from https://stackoverflow.com/questions/2537471/method-of-iterating-over-sqlalchemy-models-defined-columns
|
||||
|
@ -104,6 +107,11 @@ class ApcReferentielCompetences(db.Model, XMLModel):
|
|||
def __repr__(self):
|
||||
return f"<ApcReferentielCompetences {self.id} {self.specialite!r} {self.departement!r}>"
|
||||
|
||||
def get_title(self) -> str:
|
||||
"Titre affichable"
|
||||
# utilise type_titre (B.U.T.), spécialité, version
|
||||
return f"{self.type_titre} {self.specialite} {self.get_version()}"
|
||||
|
||||
def get_version(self) -> str:
|
||||
"La version, normalement sous forme de date iso yyy-mm-dd"
|
||||
if not self.version_orebut:
|
||||
|
@ -124,9 +132,11 @@ class ApcReferentielCompetences(db.Model, XMLModel):
|
|||
"type_departement": self.type_departement,
|
||||
"type_titre": self.type_titre,
|
||||
"version_orebut": self.version_orebut,
|
||||
"scodoc_date_loaded": self.scodoc_date_loaded.isoformat() + "Z"
|
||||
if self.scodoc_date_loaded
|
||||
else "",
|
||||
"scodoc_date_loaded": (
|
||||
self.scodoc_date_loaded.isoformat() + "Z"
|
||||
if self.scodoc_date_loaded
|
||||
else ""
|
||||
),
|
||||
"scodoc_orig_filename": self.scodoc_orig_filename,
|
||||
"competences": {
|
||||
x.titre: x.to_dict(with_app_critiques=with_app_critiques)
|
||||
|
@ -234,6 +244,92 @@ class ApcReferentielCompetences(db.Model, XMLModel):
|
|||
|
||||
return parcours_info
|
||||
|
||||
def equivalents(self) -> set["ApcReferentielCompetences"]:
|
||||
"""Ensemble des référentiels du même département
|
||||
qui peuvent être considérés comme "équivalents", au sens
|
||||
une formation de ce référentiel pourrait changer vers un équivalent,
|
||||
en ignorant les apprentissages critiques.
|
||||
Pour cela, il faut avoir le même type, etc et les mêmes compétences,
|
||||
niveaux et parcours (voir map_to_other_referentiel).
|
||||
"""
|
||||
candidats = ApcReferentielCompetences.query.filter_by(
|
||||
dept_id=self.dept_id
|
||||
).filter(ApcReferentielCompetences.id != self.id)
|
||||
return {
|
||||
referentiel
|
||||
for referentiel in candidats
|
||||
if not isinstance(self.map_to_other_referentiel(referentiel), str)
|
||||
}
|
||||
|
||||
def map_to_other_referentiel(
|
||||
self, other: "ApcReferentielCompetences"
|
||||
) -> str | tuple[dict[int, int], dict[int, int], dict[int, int]]:
|
||||
"""Build mapping between this referentiel and ref2.
|
||||
If successful, returns 3 dicts mapping self ids to other ids.
|
||||
Else return a string, error message.
|
||||
"""
|
||||
if self.type_structure != other.type_structure:
|
||||
return "type_structure mismatch"
|
||||
if self.type_departement != other.type_departement:
|
||||
return "type_departement mismatch"
|
||||
# Table d'équivalences entre refs:
|
||||
equiv = self._load_config_equivalences()
|
||||
# mêmes parcours ?
|
||||
eq_parcours = equiv.get("parcours", {})
|
||||
parcours_by_code_1 = {eq_parcours.get(p.code, p.code): p for p in self.parcours}
|
||||
parcours_by_code_2 = {
|
||||
eq_parcours.get(p.code, p.code): p for p in other.parcours
|
||||
}
|
||||
if parcours_by_code_1.keys() != parcours_by_code_2.keys():
|
||||
return "parcours mismatch"
|
||||
parcours_map = {
|
||||
parcours_by_code_1[eq_parcours.get(code, code)]
|
||||
.id: parcours_by_code_2[eq_parcours.get(code, code)]
|
||||
.id
|
||||
for code in parcours_by_code_1
|
||||
}
|
||||
# mêmes compétences ?
|
||||
competence_by_code_1 = {c.titre: c for c in self.competences}
|
||||
competence_by_code_2 = {c.titre: c for c in other.competences}
|
||||
if competence_by_code_1.keys() != competence_by_code_2.keys():
|
||||
return "competences mismatch"
|
||||
competences_map = {
|
||||
competence_by_code_1[titre].id: competence_by_code_2[titre].id
|
||||
for titre in competence_by_code_1
|
||||
}
|
||||
# mêmes niveaux (dans chaque compétence) ?
|
||||
niveaux_map = {}
|
||||
for titre in competence_by_code_1:
|
||||
c1 = competence_by_code_1[titre]
|
||||
c2 = competence_by_code_2[titre]
|
||||
niveau_by_attr_1 = {(n.annee, n.ordre, n.libelle): n for n in c1.niveaux}
|
||||
niveau_by_attr_2 = {(n.annee, n.ordre, n.libelle): n for n in c2.niveaux}
|
||||
if niveau_by_attr_1.keys() != niveau_by_attr_2.keys():
|
||||
return f"niveaux mismatch in comp. '{titre}'"
|
||||
niveaux_map.update(
|
||||
{
|
||||
niveau_by_attr_1[a].id: niveau_by_attr_2[a].id
|
||||
for a in niveau_by_attr_1
|
||||
}
|
||||
)
|
||||
return parcours_map, competences_map, niveaux_map
|
||||
|
||||
def _load_config_equivalences(self) -> dict:
|
||||
"""Load config file ressources/referentiels/equivalences.yaml
|
||||
used to define equivalences between distinct referentiels
|
||||
"""
|
||||
try:
|
||||
with open(REFCOMP_EQUIVALENCE_FILENAME, encoding="utf-8") as f:
|
||||
doc = yaml.safe_load(f.read())
|
||||
except FileNotFoundError:
|
||||
log(f"_load_config_equivalences: {REFCOMP_EQUIVALENCE_FILENAME} not found")
|
||||
return {}
|
||||
except yaml.parser.ParserError as exc:
|
||||
raise ScoValueError(
|
||||
f"erreur dans le fichier {REFCOMP_EQUIVALENCE_FILENAME}"
|
||||
) from exc
|
||||
return doc.get(self.specialite, {})
|
||||
|
||||
|
||||
class ApcCompetence(db.Model, XMLModel):
|
||||
"Compétence"
|
||||
|
@ -374,9 +470,11 @@ class ApcNiveau(db.Model, XMLModel):
|
|||
"libelle": self.libelle,
|
||||
"annee": self.annee,
|
||||
"ordre": self.ordre,
|
||||
"app_critiques": {x.code: x.to_dict() for x in self.app_critiques}
|
||||
if with_app_critiques
|
||||
else {},
|
||||
"app_critiques": (
|
||||
{x.code: x.to_dict() for x in self.app_critiques}
|
||||
if with_app_critiques
|
||||
else {}
|
||||
),
|
||||
}
|
||||
|
||||
def to_dict_bul(self):
|
||||
|
@ -464,9 +562,9 @@ class ApcNiveau(db.Model, XMLModel):
|
|||
return []
|
||||
|
||||
if competence is None:
|
||||
parcour_niveaux: list[
|
||||
ApcParcoursNiveauCompetence
|
||||
] = annee_parcour.niveaux_competences
|
||||
parcour_niveaux: list[ApcParcoursNiveauCompetence] = (
|
||||
annee_parcour.niveaux_competences
|
||||
)
|
||||
niveaux: list[ApcNiveau] = [
|
||||
pn.competence.niveaux.filter_by(ordre=pn.niveau).first()
|
||||
for pn in parcour_niveaux
|
||||
|
|
|
@ -10,6 +10,7 @@ from app.models.etudiants import Identite
|
|||
from app.models.formsemestre import FormSemestre
|
||||
from app.models.ues import UniteEns
|
||||
from app.scodoc import sco_preferences
|
||||
from app.scodoc import sco_utils as scu
|
||||
|
||||
|
||||
class ApcValidationRCUE(db.Model):
|
||||
|
@ -63,14 +64,13 @@ class ApcValidationRCUE(db.Model):
|
|||
|
||||
def __str__(self):
|
||||
return f"""Décision sur RCUE {self.ue1.acronyme}/{self.ue2.acronyme}: {
|
||||
self.code} enregistrée le {self.date.strftime("%d/%m/%Y")}"""
|
||||
self.code} enregistrée le {self.date.strftime(scu.DATE_FMT)}"""
|
||||
|
||||
def html(self) -> str:
|
||||
"description en HTML"
|
||||
return f"""Décision sur RCUE {self.ue1.acronyme}/{self.ue2.acronyme}:
|
||||
<b>{self.code}</b>
|
||||
<em>enregistrée le {self.date.strftime("%d/%m/%Y")}
|
||||
à {self.date.strftime("%Hh%M")}</em>"""
|
||||
<em>enregistrée le {self.date.strftime(scu.DATEATIME_FMT)}</em>"""
|
||||
|
||||
def annee(self) -> str:
|
||||
"""l'année BUT concernée: "BUT1", "BUT2" ou "BUT3" """
|
||||
|
@ -164,7 +164,7 @@ class ApcValidationAnnee(db.Model):
|
|||
def html(self) -> str:
|
||||
"Affichage html"
|
||||
date_str = (
|
||||
f"""le {self.date.strftime("%d/%m/%Y")} à {self.date.strftime("%Hh%M")}"""
|
||||
f"""le {self.date.strftime(scu.DATEATIME_FMT)}"""
|
||||
if self.date
|
||||
else "(sans date)"
|
||||
)
|
||||
|
|
|
@ -92,6 +92,7 @@ class ScoDocSiteConfig(db.Model):
|
|||
"INSTITUTION_CITY": str,
|
||||
"DEFAULT_PDF_FOOTER_TEMPLATE": str,
|
||||
"enable_entreprises": bool,
|
||||
"disable_passerelle": bool, # remplace pref. bul_display_publication
|
||||
"month_debut_annee_scolaire": int,
|
||||
"month_debut_periode2": int,
|
||||
"disable_bul_pdf": bool,
|
||||
|
@ -244,6 +245,12 @@ class ScoDocSiteConfig(db.Model):
|
|||
cfg = ScoDocSiteConfig.query.filter_by(name="enable_entreprises").first()
|
||||
return cfg is not None and cfg.value
|
||||
|
||||
@classmethod
|
||||
def is_passerelle_disabled(cls):
|
||||
"""True si on doit cacher les fonctions passerelle ("oeil")."""
|
||||
cfg = ScoDocSiteConfig.query.filter_by(name="disable_passerelle").first()
|
||||
return cfg is not None and cfg.value
|
||||
|
||||
@classmethod
|
||||
def is_user_require_email_institutionnel_enabled(cls) -> bool:
|
||||
"""True si impose saisie email_institutionnel"""
|
||||
|
@ -263,6 +270,11 @@ class ScoDocSiteConfig(db.Model):
|
|||
"""Active (ou déactive) le module entreprises. True si changement."""
|
||||
return cls.set("enable_entreprises", "on" if enabled else "")
|
||||
|
||||
@classmethod
|
||||
def disable_passerelle(cls, disabled: bool = True) -> bool:
|
||||
"""Désactive (ou active) les fonctions liées à la présence d'une passerelle. True si changement."""
|
||||
return cls.set("disable_passerelle", "on" if disabled else "")
|
||||
|
||||
@classmethod
|
||||
def disable_bul_pdf(cls, enabled=True) -> bool:
|
||||
"""Interdit (ou autorise) les exports PDF. True si changement."""
|
||||
|
|
|
@ -297,7 +297,7 @@ class Identite(models.ScoDocModel):
|
|||
else:
|
||||
return self.nom
|
||||
|
||||
@cached_property
|
||||
@property
|
||||
def nomprenom(self, reverse=False) -> str:
|
||||
"""Civilité/nom/prenom pour affichages: "M. Pierre Dupont"
|
||||
Si reverse, "Dupont Pierre", sans civilité.
|
||||
|
@ -334,16 +334,14 @@ class Identite(models.ScoDocModel):
|
|||
return f"{(self.nom_usuel or self.nom or '?').upper()} {(self.prenom or '')[:2].capitalize()}."
|
||||
|
||||
@cached_property
|
||||
def sort_key(self) -> tuple:
|
||||
def sort_key(self) -> str:
|
||||
"clé pour tris par ordre alphabétique"
|
||||
# Note: scodoc7 utilisait sco_etud.etud_sort_key, à mettre à jour
|
||||
# si on modifie cette méthode.
|
||||
return (
|
||||
scu.sanitize_string(
|
||||
self.nom_usuel or self.nom or "", remove_spaces=False
|
||||
).lower(),
|
||||
scu.sanitize_string(self.prenom or "", remove_spaces=False).lower(),
|
||||
)
|
||||
return scu.sanitize_string(
|
||||
(self.nom_usuel or self.nom or "") + ";" + (self.prenom or ""),
|
||||
remove_spaces=False,
|
||||
).lower()
|
||||
|
||||
def get_first_email(self, field="email") -> str:
|
||||
"Le mail associé à la première adresse de l'étudiant, ou None"
|
||||
|
@ -483,7 +481,9 @@ class Identite(models.ScoDocModel):
|
|||
"code_ine": self.code_ine or "",
|
||||
"code_nip": self.code_nip or "",
|
||||
"date_naissance": (
|
||||
self.date_naissance.strftime("%d/%m/%Y") if self.date_naissance else ""
|
||||
self.date_naissance.strftime(scu.DATE_FMT)
|
||||
if self.date_naissance
|
||||
else ""
|
||||
),
|
||||
"dept_acronym": self.departement.acronym,
|
||||
"dept_id": self.dept_id,
|
||||
|
@ -735,7 +735,7 @@ class Identite(models.ScoDocModel):
|
|||
"""
|
||||
if with_paragraph:
|
||||
return f"""{self.etat_civil}{line_sep}n°{self.code_nip or ""}{line_sep}né{self.e} le {
|
||||
self.date_naissance.strftime("%d/%m/%Y") if self.date_naissance else ""}{
|
||||
self.date_naissance.strftime(scu.DATE_FMT) if self.date_naissance else ""}{
|
||||
line_sep}à {self.lieu_naissance or ""}"""
|
||||
return self.etat_civil
|
||||
|
||||
|
|
|
@ -207,7 +207,9 @@ class Evaluation(models.ScoDocModel):
|
|||
e_dict["poids"] = self.get_ue_poids_dict() # { ue_id : poids }
|
||||
|
||||
# Deprecated
|
||||
e_dict["jour"] = self.date_debut.strftime("%d/%m/%Y") if self.date_debut else ""
|
||||
e_dict["jour"] = (
|
||||
self.date_debut.strftime(scu.DATE_FMT) if self.date_debut else ""
|
||||
)
|
||||
|
||||
return evaluation_enrich_dict(self, e_dict)
|
||||
|
||||
|
@ -315,10 +317,10 @@ class Evaluation(models.ScoDocModel):
|
|||
def descr_heure(self) -> str:
|
||||
"Description de la plage horaire pour affichages ('de 13h00 à 14h00')"
|
||||
if self.date_debut and (not self.date_fin or self.date_fin == self.date_debut):
|
||||
return f"""à {self.date_debut.strftime("%Hh%M")}"""
|
||||
return f"""à {self.date_debut.strftime(scu.TIME_FMT)}"""
|
||||
elif self.date_debut and self.date_fin:
|
||||
return f"""de {self.date_debut.strftime("%Hh%M")
|
||||
} à {self.date_fin.strftime("%Hh%M")}"""
|
||||
return f"""de {self.date_debut.strftime(scu.TIME_FMT)
|
||||
} à {self.date_fin.strftime(scu.TIME_FMT)}"""
|
||||
else:
|
||||
return ""
|
||||
|
||||
|
@ -345,7 +347,7 @@ class Evaluation(models.ScoDocModel):
|
|||
|
||||
def _h(dt: datetime.datetime) -> str:
|
||||
if dt.minute:
|
||||
return dt.strftime("%Hh%M")
|
||||
return dt.strftime(scu.TIME_FMT)
|
||||
return f"{dt.hour}h"
|
||||
|
||||
if self.date_fin is None:
|
||||
|
@ -539,8 +541,8 @@ class EvaluationUEPoids(db.Model):
|
|||
def evaluation_enrich_dict(e: Evaluation, e_dict: dict):
|
||||
"""add or convert some fields in an evaluation dict"""
|
||||
# For ScoDoc7 compat
|
||||
e_dict["heure_debut"] = e.date_debut.strftime("%Hh%M") if e.date_debut else ""
|
||||
e_dict["heure_fin"] = e.date_fin.strftime("%Hh%M") if e.date_fin else ""
|
||||
e_dict["heure_debut"] = e.date_debut.strftime(scu.TIME_FMT) if e.date_debut else ""
|
||||
e_dict["heure_fin"] = e.date_fin.strftime(scu.TIME_FMT) if e.date_fin else ""
|
||||
e_dict["jour_iso"] = e.date_debut.isoformat() if e.date_debut else ""
|
||||
# Calcule durée en minutes
|
||||
e_dict["descrheure"] = e.descr_heure()
|
||||
|
@ -614,7 +616,7 @@ def check_and_convert_evaluation_args(data: dict, moduleimpl: "ModuleImpl"):
|
|||
):
|
||||
raise ScoValueError(
|
||||
f"""La date de début de l'évaluation ({
|
||||
data["date_debut"].strftime("%d/%m/%Y")
|
||||
data["date_debut"].strftime(scu.DATE_FMT)
|
||||
}) n'est pas dans le semestre !""",
|
||||
dest_url="javascript:history.back();",
|
||||
)
|
||||
|
@ -629,7 +631,7 @@ def check_and_convert_evaluation_args(data: dict, moduleimpl: "ModuleImpl"):
|
|||
):
|
||||
raise ScoValueError(
|
||||
f"""La date de fin de l'évaluation ({
|
||||
data["date_fin"].strftime("%d/%m/%Y")
|
||||
data["date_fin"].strftime(scu.DATE_FMT)
|
||||
}) n'est pas dans le semestre !""",
|
||||
dest_url="javascript:history.back();",
|
||||
)
|
||||
|
|
|
@ -232,7 +232,9 @@ class ScolarNews(db.Model):
|
|||
)
|
||||
|
||||
# Transforme les URL en URL absolues
|
||||
base = scu.ScoURL()
|
||||
base = url_for("scolar.index_html", scodoc_dept=g.scodoc_dept)[
|
||||
: -len("/index_html")
|
||||
]
|
||||
txt = re.sub('href=/.*?"', 'href="' + base + "/", txt)
|
||||
|
||||
# Transforme les liens HTML en texte brut: '<a href="url">texte</a>' devient 'texte: url'
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"""ScoDoc 9 models : Formations
|
||||
"""
|
||||
|
||||
from flask import abort, g
|
||||
from flask_sqlalchemy.query import Query
|
||||
|
||||
import app
|
||||
|
@ -64,6 +66,21 @@ class Formation(db.Model):
|
|||
"titre complet pour affichage"
|
||||
return f"""Formation {self.titre} ({self.acronyme}) [version {self.version}] code {self.formation_code}"""
|
||||
|
||||
@classmethod
|
||||
def get_formation(cls, formation_id: int | str, dept_id: int = None) -> "Formation":
|
||||
"""Formation ou 404, cherche uniquement dans le département spécifié
|
||||
ou le courant (g.scodoc_dept)"""
|
||||
if not isinstance(formation_id, int):
|
||||
try:
|
||||
formation_id = int(formation_id)
|
||||
except (TypeError, ValueError):
|
||||
abort(404, "formation_id invalide")
|
||||
if g.scodoc_dept:
|
||||
dept_id = dept_id if dept_id is not None else g.scodoc_dept_id
|
||||
if dept_id is not None:
|
||||
return cls.query.filter_by(id=formation_id, dept_id=dept_id).first_or_404()
|
||||
return cls.query.filter_by(id=formation_id).first_or_404()
|
||||
|
||||
def to_dict(self, with_refcomp_attrs=False, with_departement=True):
|
||||
"""As a dict.
|
||||
Si with_refcomp_attrs, ajoute attributs permettant de retrouver le ref. de comp.
|
||||
|
|
|
@ -208,7 +208,7 @@ class FormSemestre(models.ScoDocModel):
|
|||
return cls.query.filter_by(id=formsemestre_id).first_or_404()
|
||||
|
||||
def sort_key(self) -> tuple:
|
||||
"""clé pour tris par ordre alphabétique
|
||||
"""clé pour tris par ordre de date_debut, le plus ancien en tête
|
||||
(pour avoir le plus récent d'abord, sort avec reverse=True)"""
|
||||
return (self.date_debut, self.semestre_id)
|
||||
|
||||
|
@ -224,12 +224,12 @@ class FormSemestre(models.ScoDocModel):
|
|||
d["formsemestre_id"] = self.id
|
||||
d["titre_num"] = self.titre_num()
|
||||
if self.date_debut:
|
||||
d["date_debut"] = self.date_debut.strftime("%d/%m/%Y")
|
||||
d["date_debut"] = self.date_debut.strftime(scu.DATE_FMT)
|
||||
d["date_debut_iso"] = self.date_debut.isoformat()
|
||||
else:
|
||||
d["date_debut"] = d["date_debut_iso"] = ""
|
||||
if self.date_fin:
|
||||
d["date_fin"] = self.date_fin.strftime("%d/%m/%Y")
|
||||
d["date_fin"] = self.date_fin.strftime(scu.DATE_FMT)
|
||||
d["date_fin_iso"] = self.date_fin.isoformat()
|
||||
else:
|
||||
d["date_fin"] = d["date_fin_iso"] = ""
|
||||
|
@ -255,12 +255,12 @@ class FormSemestre(models.ScoDocModel):
|
|||
d["annee_scolaire"] = self.annee_scolaire()
|
||||
d["bul_hide_xml"] = self.bul_hide_xml
|
||||
if self.date_debut:
|
||||
d["date_debut"] = self.date_debut.strftime("%d/%m/%Y")
|
||||
d["date_debut"] = self.date_debut.strftime(scu.DATE_FMT)
|
||||
d["date_debut_iso"] = self.date_debut.isoformat()
|
||||
else:
|
||||
d["date_debut"] = d["date_debut_iso"] = ""
|
||||
if self.date_fin:
|
||||
d["date_fin"] = self.date_fin.strftime("%d/%m/%Y")
|
||||
d["date_fin"] = self.date_fin.strftime(scu.DATE_FMT)
|
||||
d["date_fin_iso"] = self.date_fin.isoformat()
|
||||
else:
|
||||
d["date_fin"] = d["date_fin_iso"] = ""
|
||||
|
@ -945,7 +945,7 @@ class FormSemestre(models.ScoDocModel):
|
|||
ins.etudid for ins in self.inscriptions if ins.etat == scu.INSCRIT
|
||||
}
|
||||
|
||||
@cached_property
|
||||
@property
|
||||
def etuds_inscriptions(self) -> dict:
|
||||
"""Map { etudid : inscription } (incluant DEM et DEF)"""
|
||||
return {ins.etud.id: ins for ins in self.inscriptions}
|
||||
|
|
|
@ -409,6 +409,14 @@ class UniteEns(models.ScoDocModel):
|
|||
Renvoie (True, "") si ok, sinon (False, error_message)
|
||||
"""
|
||||
msg = ""
|
||||
# Safety check
|
||||
if self.formation.referentiel_competence is None:
|
||||
return False, "pas de référentiel de compétence"
|
||||
# Si tous les parcours, aucun (tronc commun)
|
||||
if {p.id for p in parcours} == {
|
||||
p.id for p in self.formation.referentiel_competence.parcours
|
||||
}:
|
||||
parcours = []
|
||||
# Le niveau est-il dans tous ces parcours ? Sinon, l'enlève
|
||||
prev_niveau = self.niveau_competence
|
||||
if (
|
||||
|
@ -424,6 +432,7 @@ class UniteEns(models.ScoDocModel):
|
|||
self.niveau_competence, parcours
|
||||
)
|
||||
if not ok:
|
||||
self.formation.invalidate_cached_sems()
|
||||
self.niveau_competence = prev_niveau # restore
|
||||
return False, error_message
|
||||
|
||||
|
|
|
@ -72,7 +72,7 @@ class ScolarFormSemestreValidation(db.Model):
|
|||
return f"""décision sur UE {self.ue.acronyme if self.ue else self.ue_id
|
||||
} ({self.ue_id}): {self.code}"""
|
||||
return f"""décision sur semestre {self.formsemestre.titre_mois()} du {
|
||||
self.event_date.strftime("%d/%m/%Y")}"""
|
||||
self.event_date.strftime(scu.DATE_FMT)}"""
|
||||
|
||||
def delete(self):
|
||||
"Efface cette validation"
|
||||
|
@ -113,14 +113,14 @@ class ScolarFormSemestreValidation(db.Model):
|
|||
if self.ue.parcours else ""}
|
||||
{("émise par " + link)}
|
||||
: <b>{self.code}</b>{moyenne}
|
||||
le {self.event_date.strftime("%d/%m/%Y")} à {self.event_date.strftime("%Hh%M")}
|
||||
"""
|
||||
le {self.event_date.strftime(scu.DATEATIME_FMT)}
|
||||
"""
|
||||
else:
|
||||
return f"""Validation du semestre S{
|
||||
self.formsemestre.semestre_id if self.formsemestre else "?"}
|
||||
{self.formsemestre.html_link_status() if self.formsemestre else ""}
|
||||
: <b>{self.code}</b>
|
||||
le {self.event_date.strftime("%d/%m/%Y")} à {self.event_date.strftime("%Hh%M")}
|
||||
le {self.event_date.strftime(scu.DATEATIME_FMT)}
|
||||
"""
|
||||
|
||||
def ects(self) -> float:
|
||||
|
@ -175,8 +175,8 @@ class ScolarAutorisationInscription(db.Model):
|
|||
)
|
||||
return f"""Autorisation de passage vers <b>S{self.semestre_id}</b> émise par
|
||||
{link}
|
||||
le {self.date.strftime("%d/%m/%Y")} à {self.date.strftime("%Hh%M")}
|
||||
"""
|
||||
le {self.date.strftime(scu.DATEATIME_FMT)}
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
def autorise_etud(
|
||||
|
|
|
@ -48,6 +48,7 @@ from typing import Any
|
|||
from urllib.parse import urlparse, urlencode, parse_qs, urlunparse
|
||||
|
||||
from openpyxl.utils import get_column_letter
|
||||
import reportlab
|
||||
from reportlab.platypus import Paragraph, Spacer
|
||||
from reportlab.platypus import Table, KeepInFrame
|
||||
from reportlab.lib.colors import Color
|
||||
|
@ -263,16 +264,16 @@ class GenTable:
|
|||
colspan_count -= 1
|
||||
# if colspan_count > 0:
|
||||
# continue # skip cells after a span
|
||||
if pdf_mode:
|
||||
content = row.get(f"_{cid}_pdf", False) or row.get(cid, "")
|
||||
elif xls_mode:
|
||||
content = row.get(f"_{cid}_xls", False) or row.get(cid, "")
|
||||
if pdf_mode and f"_{cid}_pdf" in row:
|
||||
content = row[f"_{cid}_pdf"]
|
||||
elif xls_mode and f"_{cid}_xls" in row:
|
||||
content = row[f"_{cid}_xls"]
|
||||
else:
|
||||
content = row.get(cid, "")
|
||||
# Convert None to empty string ""
|
||||
content = "" if content is None else content
|
||||
|
||||
colspan = row.get("_%s_colspan" % cid, 0)
|
||||
colspan = row.get(f"_{cid}_colspan", 0)
|
||||
if colspan > 1:
|
||||
pdf_style_list.append(
|
||||
(
|
||||
|
@ -676,6 +677,7 @@ class GenTable:
|
|||
fmt="html",
|
||||
page_title="",
|
||||
filename=None,
|
||||
cssstyles=[],
|
||||
javascripts=[],
|
||||
with_html_headers=True,
|
||||
publish=True,
|
||||
|
@ -696,6 +698,7 @@ class GenTable:
|
|||
H.append(
|
||||
self.html_header
|
||||
or html_sco_header.sco_header(
|
||||
cssstyles=cssstyles,
|
||||
page_title=page_title,
|
||||
javascripts=javascripts,
|
||||
init_qtip=init_qtip,
|
||||
|
@ -721,7 +724,7 @@ class GenTable:
|
|||
)
|
||||
else:
|
||||
return pdf_doc
|
||||
elif fmt == "xls" or fmt == "xlsx": # dans les 2 cas retourne du xlsx
|
||||
elif fmt in ("xls", "xlsx"): # dans les 2 cas retourne du xlsx
|
||||
xls = self.excel()
|
||||
if publish:
|
||||
return scu.send_file(
|
||||
|
@ -730,8 +733,7 @@ class GenTable:
|
|||
suffix=scu.XLSX_SUFFIX,
|
||||
mime=scu.XLSX_MIMETYPE,
|
||||
)
|
||||
else:
|
||||
return xls
|
||||
return xls
|
||||
elif fmt == "text":
|
||||
return self.text()
|
||||
elif fmt == "csv":
|
||||
|
@ -811,7 +813,10 @@ if __name__ == "__main__":
|
|||
document,
|
||||
)
|
||||
)
|
||||
document.build(objects)
|
||||
try:
|
||||
document.build(objects)
|
||||
except (ValueError, KeyError, reportlab.platypus.doctemplate.LayoutError) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
data = doc.getvalue()
|
||||
with open("/tmp/gen_table.pdf", "wb") as f:
|
||||
f.write(data)
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
|
||||
import html
|
||||
|
||||
from flask import g, render_template
|
||||
from flask import g, render_template, url_for
|
||||
from flask import request
|
||||
from flask_login import current_user
|
||||
|
||||
|
@ -163,7 +163,7 @@ def sco_header(
|
|||
params = {
|
||||
"page_title": page_title or sco_version.SCONAME,
|
||||
"no_side_bar": no_side_bar,
|
||||
"ScoURL": scu.ScoURL(),
|
||||
"ScoURL": url_for("scolar.index_html", scodoc_dept=g.scodoc_dept),
|
||||
"encoding": scu.SCO_ENCODING,
|
||||
"titrebandeau_mkup": "<td>" + titrebandeau + "</td>",
|
||||
"authuser": current_user.user_name,
|
||||
|
@ -179,6 +179,7 @@ def sco_header(
|
|||
|
||||
H = [
|
||||
"""<!DOCTYPE html><html lang="fr">
|
||||
<!-- ScoDoc legacy -->
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<title>%(page_title)s</title>
|
||||
|
@ -219,7 +220,7 @@ def sco_header(
|
|||
<script>
|
||||
window.onload=function(){{enableTooltips("gtrcontent")}};
|
||||
|
||||
const SCO_URL="{scu.ScoURL()}";
|
||||
const SCO_URL="{url_for("scolar.index_html", scodoc_dept=g.scodoc_dept)}";
|
||||
const SCO_TIMEZONE="{scu.TIME_ZONE}";
|
||||
</script>"""
|
||||
)
|
||||
|
|
|
@ -102,25 +102,33 @@ def sidebar_common():
|
|||
<a href="{home_link}" class="sidebar">Accueil</a> <br>
|
||||
<div id="authuser"><a id="authuserlink" href="{
|
||||
url_for("users.user_info_page",
|
||||
scodoc_dept=g.scodoc_dept, user_name=current_user.user_name)
|
||||
scodoc_dept=g.scodoc_dept, user_name=current_user.user_name)
|
||||
}">{current_user.user_name}</a>
|
||||
<br><a id="deconnectlink" href="{url_for("auth.logout")}">déconnexion</a>
|
||||
</div>
|
||||
{sidebar_dept()}
|
||||
<h2 class="insidebar">Scolarité</h2>
|
||||
<a href="{scu.ScoURL()}" class="sidebar">Semestres</a> <br>
|
||||
<a href="{scu.NotesURL()}" class="sidebar">Formations</a> <br>
|
||||
<a href="{
|
||||
url_for("scolar.index_html", scodoc_dept=g.scodoc_dept)
|
||||
}" class="sidebar">Semestres</a> <br>
|
||||
<a href="{
|
||||
url_for("notes.index_html", scodoc_dept=g.scodoc_dept)
|
||||
}" class="sidebar">Formations</a> <br>
|
||||
"""
|
||||
]
|
||||
if current_user.has_permission(Permission.AbsChange):
|
||||
H.append(
|
||||
f""" <a href="{scu.AssiduitesURL()}" class="sidebar">Assiduité</a> <br> """
|
||||
f""" <a href="{
|
||||
url_for("assiduites.bilan_dept", scodoc_dept=g.scodoc_dept)
|
||||
}" class="sidebar">Assiduité</a> <br> """
|
||||
)
|
||||
if current_user.has_permission(
|
||||
Permission.UsersAdmin
|
||||
) or current_user.has_permission(Permission.UsersView):
|
||||
H.append(
|
||||
f"""<a href="{scu.UsersURL()}" class="sidebar">Utilisateurs</a> <br>"""
|
||||
f"""<a href="{
|
||||
url_for("users.index_html", scodoc_dept=g.scodoc_dept)
|
||||
}" class="sidebar">Utilisateurs</a> <br>"""
|
||||
)
|
||||
|
||||
if current_user.has_permission(Permission.EditPreferences):
|
||||
|
@ -141,7 +149,9 @@ def sidebar(etudid: int = None):
|
|||
params = {}
|
||||
|
||||
H = [
|
||||
f"""<div class="sidebar">
|
||||
f"""
|
||||
<!-- sidebar py -->
|
||||
<div class="sidebar">
|
||||
{ sidebar_common() }
|
||||
<div class="box-chercheetud">Chercher étudiant:<br>
|
||||
<form method="get" id="form-chercheetud"
|
||||
|
@ -180,9 +190,9 @@ def sidebar(etudid: int = None):
|
|||
)
|
||||
H.append(
|
||||
f"""<span title="absences du {
|
||||
formsemestre.date_debut.strftime("%d/%m/%Y")
|
||||
formsemestre.date_debut.strftime(scu.DATE_FMT)
|
||||
} au {
|
||||
formsemestre.date_fin.strftime("%d/%m/%Y")
|
||||
formsemestre.date_fin.strftime(scu.DATE_FMT)
|
||||
}">({
|
||||
sco_preferences.get_preference("assi_metrique", None)})
|
||||
<br>{nbabsjust:1g} J., {nbabsnj:1g} N.J.</span>"""
|
||||
|
|
|
@ -12,6 +12,7 @@ import psycopg2.extras
|
|||
|
||||
from app import log
|
||||
from app.scodoc.sco_exceptions import ScoException, ScoValueError, NoteProcessError
|
||||
from app.scodoc import sco_utils as scu
|
||||
|
||||
quote_html = html.escape
|
||||
|
||||
|
@ -460,7 +461,8 @@ def dictfilter(d, fields, filter_nulls=True):
|
|||
# --- Misc Tools
|
||||
|
||||
|
||||
def DateDMYtoISO(dmy: str, null_is_empty=False) -> str | None: # XXX deprecated
|
||||
# XXX deprecated, voir convert_fr_date
|
||||
def DateDMYtoISO(dmy: str, null_is_empty=False) -> str | None:
|
||||
"""Convert date string from french format (or ISO) to ISO.
|
||||
If null_is_empty (default false), returns "" if no input.
|
||||
"""
|
||||
|
@ -474,7 +476,7 @@ def DateDMYtoISO(dmy: str, null_is_empty=False) -> str | None: # XXX deprecated
|
|||
if not isinstance(dmy, str):
|
||||
raise ScoValueError(f'Date (j/m/a) invalide: "{dmy}"')
|
||||
try:
|
||||
dt = datetime.datetime.strptime(dmy, "%d/%m/%Y")
|
||||
dt = datetime.datetime.strptime(dmy, scu.DATE_FMT)
|
||||
except ValueError:
|
||||
try:
|
||||
dt = datetime.datetime.fromisoformat(dmy)
|
||||
|
|
|
@ -34,6 +34,7 @@ from app.models.absences import BilletAbsence
|
|||
from app.models.etudiants import Identite
|
||||
from app.scodoc.gen_tables import GenTable
|
||||
from app.scodoc import sco_preferences
|
||||
from app.scodoc import sco_utils as scu
|
||||
|
||||
|
||||
def query_billets_etud(etudid: int = None, etat: bool = None) -> Query:
|
||||
|
@ -89,12 +90,12 @@ def table_billets(
|
|||
m = " matin"
|
||||
else:
|
||||
m = " après-midi"
|
||||
billet_dict["abs_begin_str"] = billet.abs_begin.strftime("%d/%m/%Y") + m
|
||||
billet_dict["abs_begin_str"] = billet.abs_begin.strftime(scu.DATE_FMT) + m
|
||||
if billet.abs_end.hour < 12:
|
||||
m = " matin"
|
||||
else:
|
||||
m = " après-midi"
|
||||
billet_dict["abs_end_str"] = billet.abs_end.strftime("%d/%m/%Y") + m
|
||||
billet_dict["abs_end_str"] = billet.abs_end.strftime(scu.DATE_FMT) + m
|
||||
if billet.etat == 0:
|
||||
if billet.justified:
|
||||
billet_dict["etat_str"] = "à traiter"
|
||||
|
|
|
@ -515,11 +515,13 @@ class ApoEtud(dict):
|
|||
# ne trouve pas de semestre impair
|
||||
self.validation_annee_but = None
|
||||
return
|
||||
self.validation_annee_but: ApcValidationAnnee = ApcValidationAnnee.query.filter_by(
|
||||
formsemestre_id=formsemestre.id,
|
||||
etudid=self.etud["etudid"],
|
||||
referentiel_competence_id=self.cur_res.formsemestre.formation.referentiel_competence_id,
|
||||
).first()
|
||||
self.validation_annee_but: ApcValidationAnnee = (
|
||||
ApcValidationAnnee.query.filter_by(
|
||||
formsemestre_id=formsemestre.id,
|
||||
etudid=self.etud["etudid"],
|
||||
referentiel_competence_id=self.cur_res.formsemestre.formation.referentiel_competence_id,
|
||||
).first()
|
||||
)
|
||||
self.is_nar = (
|
||||
self.validation_annee_but and self.validation_annee_but.code == NAR
|
||||
)
|
||||
|
@ -1003,7 +1005,7 @@ def comp_apo_sems(etape_apogee, annee_scolaire: int) -> list[dict]:
|
|||
def nar_etuds_table(apo_data, nar_etuds):
|
||||
"""Liste les NAR -> excel table"""
|
||||
code_etape = apo_data.etape_apogee
|
||||
today = datetime.datetime.today().strftime("%d/%m/%y")
|
||||
today = datetime.datetime.today().strftime(scu.DATE_FMT)
|
||||
rows = []
|
||||
nar_etuds.sort(key=lambda k: k["nom"])
|
||||
for e in nar_etuds:
|
||||
|
|
|
@ -49,11 +49,13 @@
|
|||
"""
|
||||
import datetime
|
||||
import glob
|
||||
import gzip
|
||||
import mimetypes
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import time
|
||||
import zlib
|
||||
|
||||
import chardet
|
||||
|
||||
|
@ -62,7 +64,7 @@ from flask import g
|
|||
import app.scodoc.sco_utils as scu
|
||||
from config import Config
|
||||
from app import log
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
from app.scodoc.sco_exceptions import ScoException, ScoValueError
|
||||
|
||||
|
||||
class BaseArchiver:
|
||||
|
@ -241,11 +243,13 @@ class BaseArchiver:
|
|||
filename: str,
|
||||
data: str | bytes,
|
||||
dept_id: int = None,
|
||||
compress=False,
|
||||
):
|
||||
"""Store data in archive, under given filename.
|
||||
Filename may be modified (sanitized): return used filename
|
||||
The file is created or replaced.
|
||||
data may be str or bytes
|
||||
If compress, data is gziped and filename suffix ".gz" added.
|
||||
"""
|
||||
if isinstance(data, str):
|
||||
data = data.encode(scu.SCO_ENCODING)
|
||||
|
@ -255,8 +259,14 @@ class BaseArchiver:
|
|||
try:
|
||||
scu.GSL.acquire()
|
||||
fname = os.path.join(archive_id, filename)
|
||||
with open(fname, "wb") as f:
|
||||
f.write(data)
|
||||
if compress:
|
||||
if not fname.endswith(".gz"):
|
||||
fname += ".gz"
|
||||
with gzip.open(fname, "wb") as f:
|
||||
f.write(data)
|
||||
else:
|
||||
with open(fname, "wb") as f:
|
||||
f.write(data)
|
||||
except FileNotFoundError as exc:
|
||||
raise ScoValueError(
|
||||
f"Erreur stockage archive (dossier inexistant, chemin {fname})"
|
||||
|
@ -274,8 +284,17 @@ class BaseArchiver:
|
|||
fname = os.path.join(archive_id, filename)
|
||||
log(f"reading archive file {fname}")
|
||||
try:
|
||||
with open(fname, "rb") as f:
|
||||
data = f.read()
|
||||
if fname.endswith(".gz"):
|
||||
try:
|
||||
with gzip.open(fname) as f:
|
||||
data = f.read()
|
||||
except (OSError, EOFError, zlib.error) as exc:
|
||||
raise ScoValueError(
|
||||
f"Erreur lecture archive ({fname} invalide)"
|
||||
) from exc
|
||||
else:
|
||||
with open(fname, "rb") as f:
|
||||
data = f.read()
|
||||
except FileNotFoundError as exc:
|
||||
raise ScoValueError(
|
||||
f"Erreur lecture archive (inexistant, chemin {fname})"
|
||||
|
@ -288,6 +307,8 @@ class BaseArchiver:
|
|||
"""
|
||||
archive_id = self.get_id_from_name(oid, archive_name, dept_id=dept_id)
|
||||
data = self.get(archive_id, filename)
|
||||
if filename.endswith(".gz"):
|
||||
filename = filename[:-3]
|
||||
mime = mimetypes.guess_type(filename)[0]
|
||||
if mime is None:
|
||||
mime = "application/octet-stream"
|
||||
|
|
|
@ -68,7 +68,7 @@ PV_ARCHIVER = SemsArchiver()
|
|||
|
||||
|
||||
def do_formsemestre_archive(
|
||||
formsemestre_id,
|
||||
formsemestre: FormSemestre,
|
||||
group_ids: list[int] = None, # si indiqué, ne prend que ces groupes
|
||||
description="",
|
||||
date_jury="",
|
||||
|
@ -92,19 +92,18 @@ def do_formsemestre_archive(
|
|||
raise ScoValueError(
|
||||
"do_formsemestre_archive: version de bulletin demandée invalide"
|
||||
)
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
res: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
|
||||
sem_archive_id = formsemestre_id
|
||||
sem_archive_id = formsemestre.id
|
||||
archive_id = PV_ARCHIVER.create_obj_archive(
|
||||
sem_archive_id, description, formsemestre.dept_id
|
||||
)
|
||||
date = PV_ARCHIVER.get_archive_date(archive_id).strftime("%d/%m/%Y à %H:%M")
|
||||
date = PV_ARCHIVER.get_archive_date(archive_id).strftime(scu.DATEATIME_FMT)
|
||||
|
||||
if not group_ids:
|
||||
# tous les inscrits du semestre
|
||||
group_ids = [sco_groups.get_default_group(formsemestre_id)]
|
||||
group_ids = [sco_groups.get_default_group(formsemestre.id)]
|
||||
groups_infos = sco_groups_view.DisplayedGroupsInfos(
|
||||
group_ids, formsemestre_id=formsemestre_id
|
||||
group_ids, formsemestre_id=formsemestre.id
|
||||
)
|
||||
groups_filename = "-" + groups_infos.groups_filename
|
||||
etudids = [m["etudid"] for m in groups_infos.members]
|
||||
|
@ -142,19 +141,23 @@ def do_formsemestre_archive(
|
|||
)
|
||||
|
||||
# Bulletins en JSON
|
||||
data = gen_formsemestre_recapcomplet_json(formsemestre_id, xml_with_decisions=True)
|
||||
data = gen_formsemestre_recapcomplet_json(formsemestre.id, xml_with_decisions=True)
|
||||
data_js = json.dumps(data, indent=1, cls=ScoDocJSONEncoder)
|
||||
if data:
|
||||
PV_ARCHIVER.store(
|
||||
archive_id, "Bulletins.json", data_js, dept_id=formsemestre.dept_id
|
||||
archive_id,
|
||||
"Bulletins.json",
|
||||
data_js,
|
||||
dept_id=formsemestre.dept_id,
|
||||
compress=True,
|
||||
)
|
||||
# Décisions de jury, en XLS
|
||||
if formsemestre.formation.is_apc():
|
||||
response = jury_but_pv.pvjury_page_but(formsemestre_id, fmt="xls")
|
||||
response = jury_but_pv.pvjury_page_but(formsemestre.id, fmt="xls")
|
||||
data = response.get_data()
|
||||
else: # formations classiques
|
||||
data = sco_pv_forms.formsemestre_pvjury(
|
||||
formsemestre_id, fmt="xls", publish=False
|
||||
formsemestre.id, fmt="xls", publish=False
|
||||
)
|
||||
if data:
|
||||
PV_ARCHIVER.store(
|
||||
|
@ -165,7 +168,7 @@ def do_formsemestre_archive(
|
|||
)
|
||||
# Classeur bulletins (PDF)
|
||||
data, _ = sco_bulletins_pdf.get_formsemestre_bulletins_pdf(
|
||||
formsemestre_id, version=bul_version
|
||||
formsemestre.id, version=bul_version
|
||||
)
|
||||
if data:
|
||||
PV_ARCHIVER.store(
|
||||
|
@ -173,10 +176,11 @@ def do_formsemestre_archive(
|
|||
"Bulletins.pdf",
|
||||
data,
|
||||
dept_id=formsemestre.dept_id,
|
||||
compress=True,
|
||||
)
|
||||
# Lettres individuelles (PDF):
|
||||
data = sco_pv_lettres_inviduelles.pdf_lettres_individuelles(
|
||||
formsemestre_id,
|
||||
formsemestre.id,
|
||||
etudids=etudids,
|
||||
date_jury=date_jury,
|
||||
date_commission=date_commission,
|
||||
|
@ -217,7 +221,7 @@ def formsemestre_archive(formsemestre_id, group_ids: list[int] = None):
|
|||
"""Make and store new archive for this formsemestre.
|
||||
(all students or only selected groups)
|
||||
"""
|
||||
formsemestre: FormSemestre = FormSemestre.query.get_or_404(formsemestre_id)
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
if not formsemestre.can_edit_pv():
|
||||
raise ScoPermissionDenied(
|
||||
dest_url=url_for(
|
||||
|
@ -320,7 +324,7 @@ enregistrés et non modifiables, on peut les retrouver ultérieurement.
|
|||
else:
|
||||
tf[2]["anonymous"] = False
|
||||
do_formsemestre_archive(
|
||||
formsemestre_id,
|
||||
formsemestre,
|
||||
group_ids=group_ids,
|
||||
description=tf[2]["description"],
|
||||
date_jury=tf[2]["date_jury"],
|
||||
|
@ -352,7 +356,7 @@ def formsemestre_list_archives(formsemestre_id):
|
|||
"""Page listing archives"""
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
sem_archive_id = formsemestre_id
|
||||
L = []
|
||||
archives_descr = []
|
||||
for archive_id in PV_ARCHIVER.list_obj_archives(
|
||||
sem_archive_id, dept_id=formsemestre.dept_id
|
||||
):
|
||||
|
@ -366,28 +370,30 @@ def formsemestre_list_archives(formsemestre_id):
|
|||
archive_id, dept_id=formsemestre.dept_id
|
||||
),
|
||||
}
|
||||
L.append(a)
|
||||
archives_descr.append(a)
|
||||
|
||||
H = [html_sco_header.html_sem_header("Archive des PV et résultats ")]
|
||||
if not L:
|
||||
if not archives_descr:
|
||||
H.append("<p>aucune archive enregistrée</p>")
|
||||
else:
|
||||
H.append("<ul>")
|
||||
for a in L:
|
||||
for a in archives_descr:
|
||||
archive_name = PV_ARCHIVER.get_archive_name(a["archive_id"])
|
||||
H.append(
|
||||
'<li>%s : <em>%s</em> (<a href="formsemestre_delete_archive?formsemestre_id=%s&archive_name=%s">supprimer</a>)<ul>'
|
||||
% (
|
||||
a["date"].strftime("%d/%m/%Y %H:%M"),
|
||||
a["description"],
|
||||
formsemestre_id,
|
||||
archive_name,
|
||||
)
|
||||
f"""<li>{a["date"].strftime("%d/%m/%Y %H:%M")} : <em>{a["description"]}</em>
|
||||
(<a href="{ url_for( "notes.formsemestre_delete_archive", scodoc_dept=g.scodoc_dept,
|
||||
formsemestre_id=formsemestre_id, archive_name=archive_name
|
||||
)}">supprimer</a>)
|
||||
<ul>"""
|
||||
)
|
||||
for filename in a["content"]:
|
||||
H.append(
|
||||
'<li><a href="formsemestre_get_archived_file?formsemestre_id=%s&archive_name=%s&filename=%s">%s</a></li>'
|
||||
% (formsemestre_id, archive_name, filename, filename)
|
||||
f"""<li><a href="{
|
||||
url_for( "notes.formsemestre_get_archived_file", scodoc_dept=g.scodoc_dept,
|
||||
formsemestre_id=formsemestre_id,
|
||||
archive_name=archive_name,
|
||||
filename=filename
|
||||
)}">{filename[:-3] if filename.endswith(".gz") else filename}</a></li>"""
|
||||
)
|
||||
if not a["content"]:
|
||||
H.append("<li><em>aucun fichier !</em></li>")
|
||||
|
@ -399,7 +405,7 @@ def formsemestre_list_archives(formsemestre_id):
|
|||
|
||||
def formsemestre_get_archived_file(formsemestre_id, archive_name, filename):
|
||||
"""Send file to client."""
|
||||
formsemestre: FormSemestre = FormSemestre.query.get_or_404(formsemestre_id)
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
sem_archive_id = formsemestre.id
|
||||
return PV_ARCHIVER.get_archived_file(
|
||||
sem_archive_id, archive_name, filename, dept_id=formsemestre.dept_id
|
||||
|
|
|
@ -372,12 +372,38 @@ def str_to_time(time_str: str) -> time:
|
|||
def get_assiduites_stats(
|
||||
assiduites: Query, metric: str = "all", filtered: dict[str, object] = None
|
||||
) -> dict[str, int | float]:
|
||||
"""Compte les assiduités en fonction des filtres"""
|
||||
# XXX TODO-assiduite : documenter !!!
|
||||
# Que sont les filtres ? Quelles valeurs ?
|
||||
# documenter permet de faire moins de bug: qualité du code non satisfaisante.
|
||||
#
|
||||
# + on se perd entre les clés en majuscules et en minuscules. Pourquoi
|
||||
"""
|
||||
Calcule les statistiques sur les assiduités
|
||||
(nombre de jours, demi-journées et heures passées,
|
||||
non justifiées, justifiées et total)
|
||||
|
||||
Les filtres :
|
||||
- etat : filtre les assiduités par leur état
|
||||
valeur : (absent, present, retard)
|
||||
- date_debut/date_fin : prend les assiduités qui se trouvent entre les dates
|
||||
valeur : datetime.datetime
|
||||
- moduleimpl_id : filtre les assiduités en fonction du moduleimpl_id
|
||||
valeur : int | None
|
||||
- formsemestre : prend les assiduités du formsemestre donné
|
||||
valeur : FormSemestre
|
||||
- formsemestre_modimpls : prend les assiduités avec un moduleimpl du formsemestre
|
||||
valeur : FormSemestre
|
||||
- est_just : filtre les assiduités en fonction de si elles sont justifiées ou non
|
||||
valeur : bool
|
||||
- user_id : filtre les assiduités en fonction de l'utilisateur qui les a créées
|
||||
valeur : int
|
||||
- split : effectue un comptage par état d'assiduité
|
||||
valeur : str (du moment que la clé est présente dans filtered)
|
||||
|
||||
Les métriques :
|
||||
- journee : comptage en nombre de journée
|
||||
- demi : comptage en nombre de demi journée
|
||||
- heure : comptage en heure
|
||||
- compte : nombre d'objets
|
||||
- all : renvoi toute les métriques
|
||||
|
||||
|
||||
"""
|
||||
|
||||
if filtered is not None:
|
||||
deb, fin = None, None
|
||||
|
@ -414,34 +440,71 @@ def get_assiduites_stats(
|
|||
calculator: CountCalculator = CountCalculator()
|
||||
calculator.compute_assiduites(assiduites)
|
||||
|
||||
# S'il n'y a pas de filtre ou que le filtre split n'est pas dans les filtres
|
||||
if filtered is None or "split" not in filtered:
|
||||
# On récupère le comptage total
|
||||
# only_total permet de ne récupérer que le total
|
||||
count: dict = calculator.to_dict(only_total=True)
|
||||
|
||||
# On ne garde que les métriques demandées
|
||||
for key, val in count.items():
|
||||
if key in metrics:
|
||||
output[key] = val
|
||||
# On renvoie le total si on a rien demandé (ou que metrics == ["all"])
|
||||
return output if output else count
|
||||
|
||||
# Récupération des états
|
||||
etats: list[str] = (
|
||||
filtered["etat"].split(",") if "etat" in filtered else scu.EtatAssiduite.all()
|
||||
)
|
||||
|
||||
# être sur que les états sont corrects
|
||||
etats = [etat for etat in etats if etat.upper() in scu.EtatAssiduite.all()]
|
||||
|
||||
# Préparation du dictionnaire de retour avec les valeurs du calcul
|
||||
count: dict = calculator.to_dict(only_total=False)
|
||||
|
||||
# Récupération des états depuis la saisie utilisateur
|
||||
etats: list[str] = (
|
||||
filtered["etat"].split(",") if "etat" in filtered else scu.EtatAssiduite.all()
|
||||
)
|
||||
for etat in etats:
|
||||
# TODO-assiduite: on se perd entre les lower et upper.
|
||||
# Pourquoi EtatAssiduite est en majuscules si tout le reste est en minuscules ?
|
||||
etat = etat.lower()
|
||||
# On vérifie que l'état est bien un état d'assiduité
|
||||
# sinon on passe à l'état suivant
|
||||
if not scu.EtatAssiduite.contains(etat):
|
||||
continue
|
||||
|
||||
# On récupère le comptage pour chaque état
|
||||
if etat != "present":
|
||||
output[etat] = count[etat]
|
||||
output[etat]["justifie"] = count[etat + "_just"]
|
||||
output[etat]["non_justifie"] = count[etat + "_non_just"]
|
||||
else:
|
||||
output[etat] = count[etat]
|
||||
|
||||
output["total"] = count["total"]
|
||||
|
||||
# le dictionnaire devrait ressembler à :
|
||||
# {
|
||||
# "absent": {
|
||||
# "journee": 1,
|
||||
# "demi": 2,
|
||||
# "heure": 3,
|
||||
# "compte": 4,
|
||||
# "justifie": {
|
||||
# "journee": 1,
|
||||
# "demi": 2,
|
||||
# "heure": 3,
|
||||
# "compte": 4
|
||||
# },
|
||||
# "non_justifie": {
|
||||
# "journee": 1,
|
||||
# "demi": 2,
|
||||
# "heure": 3,
|
||||
# "compte": 4
|
||||
# }
|
||||
# },
|
||||
# ...
|
||||
# "total": {
|
||||
# "journee": 1,
|
||||
# "demi": 2,
|
||||
# "heure": 3,
|
||||
# "compte": 4
|
||||
# }
|
||||
# }
|
||||
|
||||
return output
|
||||
|
||||
|
||||
|
|
|
@ -126,7 +126,7 @@ def make_context_dict(formsemestre: FormSemestre, etud: dict) -> dict:
|
|||
|
||||
# ajoute date courante
|
||||
t = time.localtime()
|
||||
C["date_dmy"] = time.strftime("%d/%m/%Y", t)
|
||||
C["date_dmy"] = time.strftime(scu.DATE_FMT, t)
|
||||
C["date_iso"] = time.strftime("%Y-%m-%d", t)
|
||||
|
||||
return C
|
||||
|
@ -446,7 +446,8 @@ def _ue_mod_bulletin(
|
|||
):
|
||||
"""Infos sur les modules (et évaluations) dans une UE
|
||||
(ajoute les informations aux modimpls)
|
||||
Result: liste de modules de l'UE avec les infos dans chacun (seulement ceux où l'étudiant est inscrit).
|
||||
Result: liste de modules de l'UE avec les infos dans chacun (seulement
|
||||
ceux où l'étudiant est inscrit).
|
||||
"""
|
||||
bul_show_mod_rangs = sco_preferences.get_preference(
|
||||
"bul_show_mod_rangs", formsemestre_id
|
||||
|
|
|
@ -61,7 +61,7 @@ from flask_login import current_user
|
|||
|
||||
from app.models import FormSemestre, Identite, ScoDocSiteConfig
|
||||
from app.scodoc import sco_utils as scu
|
||||
from app.scodoc.sco_exceptions import NoteProcessError
|
||||
from app.scodoc.sco_exceptions import NoteProcessError, ScoPDFFormatError
|
||||
from app import log
|
||||
from app.scodoc import sco_formsemestre
|
||||
from app.scodoc import sco_pdf
|
||||
|
@ -228,7 +228,15 @@ class BulletinGenerator:
|
|||
preferences=sco_preferences.SemPreferences(formsemestre_id),
|
||||
)
|
||||
)
|
||||
document.build(story)
|
||||
try:
|
||||
document.build(story)
|
||||
except (
|
||||
ValueError,
|
||||
KeyError,
|
||||
reportlab.platypus.doctemplate.LayoutError,
|
||||
) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
|
||||
data = report.getvalue()
|
||||
return data
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ def formsemestre_bulletinetud_published_dict(
|
|||
version="long",
|
||||
) -> dict:
|
||||
"""Dictionnaire representant les informations _publiees_ du bulletin de notes
|
||||
Utilisé pour JSON, devrait l'être aussi pour XML. (todo)
|
||||
Utilisé pour JSON des formations classiques (mais pas pour le XML, qui est deprecated).
|
||||
|
||||
version:
|
||||
short (sans les évaluations)
|
||||
|
@ -169,6 +169,21 @@ def formsemestre_bulletinetud_published_dict(
|
|||
pid = partition["partition_id"]
|
||||
partitions_etud_groups[pid] = sco_groups.get_etud_groups_in_partition(pid)
|
||||
|
||||
# Il serait préférable de factoriser et d'avoir la même section
|
||||
# "semestre" que celle des bulletins BUT.
|
||||
etud_groups = sco_groups.get_etud_formsemestre_groups(
|
||||
etud, formsemestre, only_to_show=True
|
||||
)
|
||||
d["semestre"] = {
|
||||
"etapes": [str(x.etape_apo) for x in formsemestre.etapes if x.etape_apo],
|
||||
"date_debut": formsemestre.date_debut.isoformat(),
|
||||
"date_fin": formsemestre.date_fin.isoformat(),
|
||||
"annee_universitaire": formsemestre.annee_scolaire_str(),
|
||||
"numero": formsemestre.semestre_id,
|
||||
"inscription": "", # inutilisé mais nécessaire pour le js de Seb.
|
||||
"groupes": [group.to_dict() for group in etud_groups],
|
||||
}
|
||||
|
||||
ues_stat = nt.get_ues_stat_dict()
|
||||
modimpls = nt.get_modimpls_dict()
|
||||
nbetuds = len(nt.etud_moy_gen_ranks)
|
||||
|
|
|
@ -352,7 +352,7 @@ class BulletinGeneratorLegacy(sco_bulletins_generator.BulletinGenerator):
|
|||
H.append(
|
||||
f"""<p>
|
||||
<span class="bull_appreciations_date">{
|
||||
appreciation.date.strftime("%d/%m/%y") if appreciation.date else ""
|
||||
appreciation.date.strftime(scu.DATE_FMT) if appreciation.date else ""
|
||||
}</span>
|
||||
{appreciation.comment_safe()}
|
||||
<span class="bull_appreciations_link">{mlink}</span>
|
||||
|
|
|
@ -182,7 +182,7 @@ class BulletinGeneratorStandard(sco_bulletins_generator.BulletinGenerator):
|
|||
H.append(
|
||||
f"""<p>
|
||||
<span class="bull_appreciations_date">{
|
||||
appreciation.date.strftime("%d/%m/%Y")
|
||||
appreciation.date.strftime(scu.DATE_FMT)
|
||||
if appreciation.date else ""}</span>
|
||||
{appreciation.comment_safe()}
|
||||
<span class="bull_appreciations_link">{mlink}</span>
|
||||
|
|
|
@ -55,7 +55,6 @@ from flask import g
|
|||
|
||||
import app
|
||||
from app import db, log
|
||||
from app.scodoc import notesdb as ndb
|
||||
from app.scodoc import sco_utils as scu
|
||||
from app.scodoc.sco_exceptions import ScoException
|
||||
|
||||
|
@ -174,17 +173,15 @@ class EvaluationCache(ScoDocCache):
|
|||
@classmethod
|
||||
def invalidate_all_sems(cls):
|
||||
"delete all evaluations in current dept from cache"
|
||||
from app.models.evaluations import Evaluation
|
||||
from app.models.formsemestre import FormSemestre
|
||||
from app.models.moduleimpls import ModuleImpl
|
||||
|
||||
evaluation_ids = [
|
||||
x[0]
|
||||
for x in ndb.SimpleQuery(
|
||||
"""SELECT e.id
|
||||
FROM notes_evaluation e, notes_moduleimpl mi, notes_formsemestre s
|
||||
WHERE s.dept_id=%(dept_id)s
|
||||
AND s.id = mi.formsemestre_id
|
||||
AND mi.id = e.moduleimpl_id;
|
||||
""",
|
||||
{"dept_id": g.scodoc_dept_id},
|
||||
)
|
||||
e.id
|
||||
for e in Evaluation.query.join(ModuleImpl)
|
||||
.join(FormSemestre)
|
||||
.filter_by(dept_id=g.scodoc_dept_id)
|
||||
]
|
||||
cls.delete_many(evaluation_ids)
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
"""
|
||||
|
||||
import calendar
|
||||
import datetime
|
||||
import html
|
||||
import time
|
||||
|
||||
|
@ -231,41 +230,41 @@ def next_iso_day(date):
|
|||
|
||||
def YearTable(
|
||||
year,
|
||||
events=[],
|
||||
events_by_day: dict[str, list[dict]],
|
||||
firstmonth=9,
|
||||
lastmonth=7,
|
||||
halfday=0,
|
||||
dayattributes="",
|
||||
pad_width=8,
|
||||
):
|
||||
# Code simplifié en 2024: utilisé seulement pour calendrier évaluations
|
||||
"""Generate a calendar table
|
||||
events = list of tuples (date, text, color, href [,halfday])
|
||||
where date is a string in ISO format (yyyy-mm-dd)
|
||||
halfday is boolean (true: morning, false: afternoon)
|
||||
text = text to put in calendar (must be short, 1-5 cars) (optional)
|
||||
if halfday, generate 2 cells per day (morning, afternoon)
|
||||
"""
|
||||
T = [
|
||||
'<table id="maincalendar" class="maincalendar" border="3" cellpadding="1" cellspacing="1" frame="box">'
|
||||
"""<table id="maincalendar" class="maincalendar"
|
||||
border="3" cellpadding="1" cellspacing="1" frame="box">"""
|
||||
]
|
||||
T.append("<tr>")
|
||||
month = firstmonth
|
||||
while 1:
|
||||
while True:
|
||||
T.append('<td valign="top">')
|
||||
T.append(MonthTableHead(month))
|
||||
T.append(_month_table_head(month))
|
||||
T.append(
|
||||
MonthTableBody(
|
||||
_month_table_body(
|
||||
month,
|
||||
year,
|
||||
events,
|
||||
halfday,
|
||||
events_by_day,
|
||||
dayattributes,
|
||||
is_work_saturday(),
|
||||
pad_width=pad_width,
|
||||
)
|
||||
)
|
||||
T.append(MonthTableTail())
|
||||
T.append("</td>")
|
||||
T.append(
|
||||
"""
|
||||
</table>
|
||||
</td>"""
|
||||
)
|
||||
if month == lastmonth:
|
||||
break
|
||||
month = month + 1
|
||||
|
@ -323,29 +322,32 @@ WEEKDAYCOLOR = GRAY1
|
|||
WEEKENDCOLOR = GREEN3
|
||||
|
||||
|
||||
def MonthTableHead(month):
|
||||
def _month_table_head(month):
|
||||
color = WHITE
|
||||
return """<table class="monthcalendar" border="0" cellpadding="0" cellspacing="0" frame="box">
|
||||
<tr bgcolor="%s"><td class="calcol" colspan="2" align="center">%s</td></tr>\n""" % (
|
||||
color,
|
||||
MONTHNAMES_ABREV[month - 1],
|
||||
)
|
||||
return f"""<table class="monthcalendar" border="0" cellpadding="0" cellspacing="0" frame="box">
|
||||
<tr bgcolor="{color}">
|
||||
<td class="calcol" colspan="2" align="center">{MONTHNAMES_ABREV[month - 1]}</td>
|
||||
</tr>\n"""
|
||||
|
||||
|
||||
def MonthTableTail():
|
||||
return "</table>\n"
|
||||
|
||||
|
||||
def MonthTableBody(
|
||||
month, year, events=[], halfday=0, trattributes="", work_saturday=False, pad_width=8
|
||||
):
|
||||
def _month_table_body(
|
||||
month,
|
||||
year,
|
||||
events_by_day: dict[str, list[dict]],
|
||||
trattributes="",
|
||||
work_saturday=False,
|
||||
) -> str:
|
||||
"""
|
||||
events : [event]
|
||||
event = [ yyyy-mm-dd, legend, href, color, descr ] XXX
|
||||
"""
|
||||
firstday, nbdays = calendar.monthrange(year, month)
|
||||
localtime = time.localtime()
|
||||
current_weeknum = time.strftime("%U", localtime)
|
||||
current_year = localtime[0]
|
||||
T = []
|
||||
rows = []
|
||||
# cherche date du lundi de la 1ere semaine de ce mois
|
||||
monday = ddmmyyyy("1/%d/%d" % (month, year))
|
||||
monday = ddmmyyyy(f"1/{month}/{year}")
|
||||
while monday.weekday != 0:
|
||||
monday = monday.prev()
|
||||
|
||||
|
@ -354,158 +356,51 @@ def MonthTableBody(
|
|||
else:
|
||||
weekend = ("S", "D")
|
||||
|
||||
if not halfday:
|
||||
for d in range(1, nbdays + 1):
|
||||
weeknum = time.strftime(
|
||||
"%U", time.strptime("%d/%d/%d" % (d, month, year), "%d/%m/%Y")
|
||||
)
|
||||
day = DAYNAMES_ABREV[(firstday + d - 1) % 7]
|
||||
if day in weekend:
|
||||
bgcolor = WEEKENDCOLOR
|
||||
weekclass = "wkend"
|
||||
attrs = ""
|
||||
else:
|
||||
bgcolor = WEEKDAYCOLOR
|
||||
weekclass = "wk" + str(monday).replace("/", "_")
|
||||
attrs = trattributes
|
||||
color = None
|
||||
legend = ""
|
||||
href = ""
|
||||
descr = ""
|
||||
# event this day ?
|
||||
# each event is a tuple (date, text, color, href)
|
||||
# where date is a string in ISO format (yyyy-mm-dd)
|
||||
for ev in events:
|
||||
ev_year = int(ev[0][:4])
|
||||
ev_month = int(ev[0][5:7])
|
||||
ev_day = int(ev[0][8:10])
|
||||
if year == ev_year and month == ev_month and ev_day == d:
|
||||
if ev[1]:
|
||||
legend = ev[1]
|
||||
if ev[2]:
|
||||
color = ev[2]
|
||||
if ev[3]:
|
||||
href = ev[3]
|
||||
if len(ev) > 4 and ev[4]:
|
||||
descr = ev[4]
|
||||
#
|
||||
cc = []
|
||||
if color is not None:
|
||||
cc.append('<td bgcolor="%s" class="calcell">' % color)
|
||||
else:
|
||||
cc.append('<td class="calcell">')
|
||||
|
||||
for d in range(1, nbdays + 1):
|
||||
weeknum = time.strftime(
|
||||
"%U", time.strptime("%d/%d/%d" % (d, month, year), scu.DATE_FMT)
|
||||
)
|
||||
day = DAYNAMES_ABREV[(firstday + d - 1) % 7]
|
||||
if day in weekend:
|
||||
bgcolor = WEEKENDCOLOR
|
||||
weekclass = "wkend"
|
||||
attrs = ""
|
||||
else:
|
||||
bgcolor = WEEKDAYCOLOR
|
||||
weekclass = "wk" + str(monday).replace("/", "_")
|
||||
attrs = trattributes
|
||||
# events this day ?
|
||||
events = events_by_day.get(f"{year}-{month:02}-{d:02}", [])
|
||||
color = None
|
||||
ev_txts = []
|
||||
for ev in events:
|
||||
color = ev.get("color")
|
||||
href = ev.get("href", "")
|
||||
description = ev.get("description", "")
|
||||
if href:
|
||||
href = 'href="%s"' % href
|
||||
if descr:
|
||||
descr = 'title="%s"' % html.escape(descr, quote=True)
|
||||
if href or descr:
|
||||
cc.append("<a %s %s>" % (href, descr))
|
||||
|
||||
if legend or d == 1:
|
||||
if pad_width is not None:
|
||||
n = pad_width - len(legend) # pad to 8 cars
|
||||
if n > 0:
|
||||
legend = (
|
||||
" " * (n // 2) + legend + " " * ((n + 1) // 2)
|
||||
)
|
||||
href = f'href="{href}"'
|
||||
if description:
|
||||
description = f"""title="{html.escape(description, quote=True)}" """
|
||||
if href or description:
|
||||
ev_txts.append(f"""<a {href} {description}>{ev.get("title", "")}</a>""")
|
||||
else:
|
||||
legend = " " # empty cell
|
||||
cc.append(legend)
|
||||
if href or descr:
|
||||
cc.append("</a>")
|
||||
cc.append("</td>")
|
||||
cell = "".join(cc)
|
||||
if day == "D":
|
||||
monday = monday.next_day(7)
|
||||
if (
|
||||
weeknum == current_weeknum
|
||||
and current_year == year
|
||||
and weekclass != "wkend"
|
||||
):
|
||||
weekclass += " currentweek"
|
||||
T.append(
|
||||
'<tr bgcolor="%s" class="%s" %s><td class="calday">%d%s</td>%s</tr>'
|
||||
% (bgcolor, weekclass, attrs, d, day, cell)
|
||||
)
|
||||
else:
|
||||
# Calendar with 2 cells / day
|
||||
for d in range(1, nbdays + 1):
|
||||
weeknum = time.strftime(
|
||||
"%U", time.strptime("%d/%d/%d" % (d, month, year), "%d/%m/%Y")
|
||||
)
|
||||
day = DAYNAMES_ABREV[(firstday + d - 1) % 7]
|
||||
if day in weekend:
|
||||
bgcolor = WEEKENDCOLOR
|
||||
weekclass = "wkend"
|
||||
attrs = ""
|
||||
else:
|
||||
bgcolor = WEEKDAYCOLOR
|
||||
weekclass = "wk" + str(monday).replace("/", "_")
|
||||
attrs = trattributes
|
||||
if (
|
||||
weeknum == current_weeknum
|
||||
and current_year == year
|
||||
and weekclass != "wkend"
|
||||
):
|
||||
weeknum += " currentweek"
|
||||
ev_txts.append(ev.get("title", " "))
|
||||
#
|
||||
cc = []
|
||||
if color is not None:
|
||||
cc.append(f'<td bgcolor="{color}" class="calcell">')
|
||||
else:
|
||||
cc.append('<td class="calcell">')
|
||||
|
||||
if day == "D":
|
||||
monday = monday.next_day(7)
|
||||
T.append(
|
||||
'<tr bgcolor="%s" class="wk%s" %s><td class="calday">%d%s</td>'
|
||||
% (bgcolor, weekclass, attrs, d, day)
|
||||
)
|
||||
cc = []
|
||||
for morning in (True, False):
|
||||
color = None
|
||||
legend = ""
|
||||
href = ""
|
||||
descr = ""
|
||||
for ev in events:
|
||||
ev_year = int(ev[0][:4])
|
||||
ev_month = int(ev[0][5:7])
|
||||
ev_day = int(ev[0][8:10])
|
||||
if ev[4] is not None:
|
||||
ev_half = int(ev[4])
|
||||
else:
|
||||
ev_half = 0
|
||||
if (
|
||||
year == ev_year
|
||||
and month == ev_month
|
||||
and ev_day == d
|
||||
and morning == ev_half
|
||||
):
|
||||
if ev[1]:
|
||||
legend = ev[1]
|
||||
if ev[2]:
|
||||
color = ev[2]
|
||||
if ev[3]:
|
||||
href = ev[3]
|
||||
if len(ev) > 5 and ev[5]:
|
||||
descr = ev[5]
|
||||
#
|
||||
if color is not None:
|
||||
cc.append('<td bgcolor="%s" class="calcell">' % (color))
|
||||
else:
|
||||
cc.append('<td class="calcell">')
|
||||
if href:
|
||||
href = 'href="%s"' % href
|
||||
if descr:
|
||||
descr = 'title="%s"' % html.escape(descr, quote=True)
|
||||
if href or descr:
|
||||
cc.append("<a %s %s>" % (href, descr))
|
||||
if legend or d == 1:
|
||||
n = 3 - len(legend) # pad to 3 cars
|
||||
if n > 0:
|
||||
legend = (
|
||||
" " * (n // 2) + legend + " " * ((n + 1) // 2)
|
||||
)
|
||||
else:
|
||||
legend = " " # empty cell
|
||||
cc.append(legend)
|
||||
if href or descr:
|
||||
cc.append("</a>")
|
||||
cc.append("</td>\n")
|
||||
T.append("".join(cc) + "</tr>")
|
||||
return "\n".join(T)
|
||||
cc.append(f"{', '.join(ev_txts)}</td>")
|
||||
cells = "".join(cc)
|
||||
if day == "D":
|
||||
monday = monday.next_day(7)
|
||||
if weeknum == current_weeknum and current_year == year and weekclass != "wkend":
|
||||
weekclass += " currentweek"
|
||||
rows.append(
|
||||
f"""<tr bgcolor="{bgcolor}" class="{weekclass}" {attrs}>
|
||||
<td class="calday">{d}{day}</td>{cells}</tr>"""
|
||||
)
|
||||
|
||||
return "\n".join(rows)
|
||||
|
|
|
@ -71,12 +71,10 @@ def report_debouche_date(start_year=None, fmt="html"):
|
|||
etudids = get_etudids_with_debouche(start_year)
|
||||
tab = table_debouche_etudids(etudids, keep_numeric=keep_numeric)
|
||||
|
||||
tab.filename = scu.make_filename("debouche_scodoc_%s" % start_year)
|
||||
tab.origin = (
|
||||
"Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr() + ""
|
||||
)
|
||||
tab.caption = "Récapitulatif débouchés à partir du 1/1/%s." % start_year
|
||||
tab.base_url = "%s?start_year=%s" % (request.base_url, start_year)
|
||||
tab.filename = scu.make_filename(f"debouche_scodoc_{start_year}")
|
||||
tab.origin = f"Généré par {sco_version.SCONAME} le {scu.timedate_human_repr()}"
|
||||
tab.caption = f"Récapitulatif débouchés à partir du 1/1/{start_year}."
|
||||
tab.base_url = f"{request.base_url}?start_year={start_year}"
|
||||
return tab.make_page(
|
||||
title="""<h2 class="formsemestre">Débouchés étudiants </h2>""",
|
||||
init_qtip=True,
|
||||
|
@ -118,7 +116,16 @@ def get_etudids_with_debouche(start_year):
|
|||
|
||||
def table_debouche_etudids(etudids, keep_numeric=True):
|
||||
"""Rapport pour ces étudiants"""
|
||||
L = []
|
||||
rows = []
|
||||
# Recherche les débouchés:
|
||||
itemsuivi_etuds = {etudid: itemsuivi_list_etud(etudid) for etudid in etudids}
|
||||
all_tags = set()
|
||||
for debouche in itemsuivi_etuds.values():
|
||||
if debouche:
|
||||
for it in debouche:
|
||||
all_tags.update(tag.strip() for tag in it["tags"].split(","))
|
||||
all_tags = tuple(sorted(all_tags))
|
||||
|
||||
for etudid in etudids:
|
||||
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
|
||||
# retrouve le "dernier" semestre (au sens de la date de fin)
|
||||
|
@ -152,25 +159,33 @@ def table_debouche_etudids(etudids, keep_numeric=True):
|
|||
"sem_ident": "%s %s"
|
||||
% (last_sem["date_debut_iso"], last_sem["titre"]), # utile pour tris
|
||||
}
|
||||
|
||||
# recherche des débouchés
|
||||
debouche = itemsuivi_list_etud(etudid) # liste de plusieurs items
|
||||
debouche = itemsuivi_etuds[etudid] # liste de plusieurs items
|
||||
if debouche:
|
||||
row["debouche"] = "<br>".join(
|
||||
[
|
||||
str(it["item_date"])
|
||||
+ " : "
|
||||
+ it["situation"]
|
||||
+ " <i>"
|
||||
+ it["tags"]
|
||||
+ "</i>"
|
||||
for it in debouche
|
||||
]
|
||||
) #
|
||||
if keep_numeric: # pour excel:
|
||||
row["debouche"] = "\n".join(
|
||||
f"""{it["item_date"]}: {it["situation"]}""" for it in debouche
|
||||
)
|
||||
else:
|
||||
row["debouche"] = "<br>".join(
|
||||
[
|
||||
str(it["item_date"])
|
||||
+ " : "
|
||||
+ it["situation"]
|
||||
+ " <i>"
|
||||
+ it["tags"]
|
||||
+ "</i>"
|
||||
for it in debouche
|
||||
]
|
||||
)
|
||||
for it in debouche:
|
||||
for tag in it["tags"].split(","):
|
||||
tag = tag.strip()
|
||||
row[f"tag_{tag}"] = tag
|
||||
else:
|
||||
row["debouche"] = "non renseigné"
|
||||
L.append(row)
|
||||
L.sort(key=lambda x: x["sem_ident"])
|
||||
rows.append(row)
|
||||
rows.sort(key=lambda x: x["sem_ident"])
|
||||
|
||||
titles = {
|
||||
"civilite": "",
|
||||
|
@ -184,21 +199,25 @@ def table_debouche_etudids(etudids, keep_numeric=True):
|
|||
"effectif": "Eff.",
|
||||
"debouche": "Débouché",
|
||||
}
|
||||
columns_ids = [
|
||||
"semestre",
|
||||
"semestre_id",
|
||||
"periode",
|
||||
"civilite",
|
||||
"nom",
|
||||
"prenom",
|
||||
"moy",
|
||||
"rang",
|
||||
"effectif",
|
||||
"debouche",
|
||||
]
|
||||
for tag in all_tags:
|
||||
titles[f"tag_{tag}"] = tag
|
||||
columns_ids.append(f"tag_{tag}")
|
||||
tab = GenTable(
|
||||
columns_ids=(
|
||||
"semestre",
|
||||
"semestre_id",
|
||||
"periode",
|
||||
"civilite",
|
||||
"nom",
|
||||
"prenom",
|
||||
"moy",
|
||||
"rang",
|
||||
"effectif",
|
||||
"debouche",
|
||||
),
|
||||
columns_ids=columns_ids,
|
||||
titles=titles,
|
||||
rows=L,
|
||||
rows=rows,
|
||||
# html_col_width='4em',
|
||||
html_sortable=True,
|
||||
html_class="table_leftalign table_listegroupe",
|
||||
|
|
|
@ -35,7 +35,7 @@ from flask_sqlalchemy.query import Query
|
|||
|
||||
import app
|
||||
from app import log
|
||||
from app.models import FormSemestre, ScolarNews
|
||||
from app.models import FormSemestre, ScolarNews, ScoDocSiteConfig
|
||||
import app.scodoc.sco_utils as scu
|
||||
from app.scodoc.gen_tables import GenTable
|
||||
from app.scodoc.sco_permissions import Permission
|
||||
|
@ -79,21 +79,32 @@ def index_html(showcodes=0, showsemtable=0, export_table_formsemestres=False):
|
|||
else:
|
||||
html_table_formsemestres = None
|
||||
|
||||
current_formsemestres_by_modalite, modalites = (
|
||||
sco_modalites.group_formsemestres_by_modalite(current_formsemestres)
|
||||
)
|
||||
passerelle_disabled = ScoDocSiteConfig.is_passerelle_disabled()
|
||||
return render_template(
|
||||
"scolar/index.j2",
|
||||
current_user=current_user,
|
||||
current_formsemestres=current_formsemestres,
|
||||
current_formsemestres_by_modalite=current_formsemestres_by_modalite,
|
||||
dept_name=sco_preferences.get_preference("DeptName"),
|
||||
formsemestres=formsemestres,
|
||||
html_current_formsemestres=_show_current_formsemestres(
|
||||
current_formsemestres, showcodes
|
||||
emptygroupicon=scu.icontag(
|
||||
"emptygroupicon_img", title="Pas d'inscrits", border="0"
|
||||
),
|
||||
formsemestres=formsemestres,
|
||||
groupicon=scu.icontag("groupicon_img", title="Inscrits", border="0"),
|
||||
html_table_formsemestres=html_table_formsemestres,
|
||||
icon_hidden="" if passerelle_disabled else scu.ICON_HIDDEN,
|
||||
icon_published="" if passerelle_disabled else scu.ICON_PUBLISHED,
|
||||
locked_formsemestres=locked_formsemestres,
|
||||
modalites=modalites,
|
||||
nb_locked=locked_formsemestres.count(),
|
||||
nb_user_accounts=sco_users.get_users_count(dept=g.scodoc_dept),
|
||||
page_title=f"ScoDoc {g.scodoc_dept}",
|
||||
Permission=Permission,
|
||||
scolar_news_summary=ScolarNews.scolar_news_summary_html(),
|
||||
showcodes=showcodes,
|
||||
showsemtable=showsemtable,
|
||||
sco=ScoData(),
|
||||
)
|
||||
|
@ -116,6 +127,7 @@ def _convert_formsemestres_to_dicts(
|
|||
lockicon = "X"
|
||||
# génère liste de dict
|
||||
sems = []
|
||||
formsemestre: FormSemestre
|
||||
for formsemestre in formsemestres:
|
||||
nb_inscrits = len(formsemestre.inscriptions)
|
||||
formation = formsemestre.formation
|
||||
|
@ -136,7 +148,7 @@ def _convert_formsemestres_to_dicts(
|
|||
),
|
||||
"formsemestre_id": formsemestre.id,
|
||||
"groupicon": groupicon if nb_inscrits > 0 else emptygroupicon,
|
||||
"lockimg": lockicon,
|
||||
"lockimg": "" if formsemestre.etat else lockicon,
|
||||
"modalite": formsemestre.modalite,
|
||||
"mois_debut": formsemestre.mois_debut(),
|
||||
"mois_fin": formsemestre.mois_fin(),
|
||||
|
@ -151,61 +163,6 @@ def _convert_formsemestres_to_dicts(
|
|||
return sems
|
||||
|
||||
|
||||
def _show_current_formsemestres(formsemestres: Query, showcodes: bool) -> str:
|
||||
"""html div avec les formsemestres courants de la page d'accueil"""
|
||||
|
||||
H = []
|
||||
if formsemestres.count():
|
||||
H.append("""<div class="scobox-title">Sessions en cours</div>""")
|
||||
H.append(_sem_table(_convert_formsemestres_to_dicts(formsemestres, showcodes)))
|
||||
else:
|
||||
# aucun semestre courant: affiche aide
|
||||
H.append(
|
||||
"""
|
||||
<div class="scobox-title">Aucune session en cours !</div>
|
||||
<p>Pour ajouter une session, aller dans <a href="Notes" id="link-programmes">Formations</a>,
|
||||
choisissez une formation, puis suivez le lien "<em>UE, modules, semestres</em>".
|
||||
</p>
|
||||
<p>Là, en bas de page, suivez le lien
|
||||
"<em>Mettre en place un nouveau semestre de formation...</em>"
|
||||
</p>"""
|
||||
)
|
||||
return "\n".join(H)
|
||||
|
||||
|
||||
def _sem_table(sems: list[dict]) -> str:
|
||||
"""Affiche liste des semestres, utilisée pour semestres en cours"""
|
||||
tmpl = f"""<tr class="%(trclass)s">%(tmpcode)s
|
||||
<td class="semicon">%(lockimg)s <a href="{
|
||||
url_for("notes.formsemestre_status", scodoc_dept=g.scodoc_dept)}?formsemestre_id=%(formsemestre_id)s#groupes">%(groupicon)s</a></td>
|
||||
<td class="datesem">%(mois_debut)s <a title="%(session_id)s">-</a> %(mois_fin)s</td>
|
||||
<td class="titresem"><a class="stdlink" href="{url_for("notes.formsemestre_status", scodoc_dept=g.scodoc_dept)}?formsemestre_id=%(formsemestre_id)s">%(titre_num)s</a>
|
||||
<span class="respsem">(%(responsable_name)s)</span>
|
||||
</td>
|
||||
</tr>
|
||||
"""
|
||||
|
||||
# Liste des semestres, groupés par modalités
|
||||
sems_by_mod, modalites = sco_modalites.group_sems_by_modalite(sems)
|
||||
|
||||
H = ['<table class="listesems">']
|
||||
for modalite in modalites:
|
||||
if len(modalites) > 1:
|
||||
H.append('<tr><th colspan="3">%s</th></tr>' % modalite["titre"])
|
||||
|
||||
if sems_by_mod[modalite["modalite"]]:
|
||||
cur_idx = sems_by_mod[modalite["modalite"]][0]["semestre_id"]
|
||||
for sem in sems_by_mod[modalite["modalite"]]:
|
||||
if cur_idx != sem["semestre_id"]:
|
||||
sem["trclass"] = "firstsem" # separe les groupes de semestres
|
||||
cur_idx = sem["semestre_id"]
|
||||
else:
|
||||
sem["trclass"] = ""
|
||||
H.append(tmpl % sem)
|
||||
H.append("</table>")
|
||||
return "\n".join(H)
|
||||
|
||||
|
||||
def _sem_table_gt(formsemestres: Query, showcodes=False, fmt="html") -> GenTable:
|
||||
"""Table des semestres
|
||||
Utilise une datatables.
|
||||
|
@ -220,21 +177,22 @@ def _sem_table_gt(formsemestres: Query, showcodes=False, fmt="html") -> GenTable
|
|||
s["modalite"],
|
||||
)
|
||||
)
|
||||
columns_ids = (
|
||||
"lockimg",
|
||||
"published",
|
||||
columns_ids = ["lockimg"]
|
||||
if not ScoDocSiteConfig.is_passerelle_disabled():
|
||||
columns_ids.append("published")
|
||||
columns_ids += [
|
||||
"dash_mois_fin",
|
||||
"semestre_id_n",
|
||||
"modalite",
|
||||
"dash_mois_fin",
|
||||
"titre_resp",
|
||||
"nb_inscrits",
|
||||
"formation",
|
||||
"etapes_apo_str",
|
||||
"elt_annee_apo",
|
||||
"elt_sem_apo",
|
||||
)
|
||||
]
|
||||
if showcodes:
|
||||
columns_ids = ("formsemestre_id",) + columns_ids
|
||||
columns_ids.insert(0, "formsemestre_id") # prepend
|
||||
|
||||
html_class = "stripe cell-border compact hover order-column table_leftalign semlist"
|
||||
if current_user.has_permission(Permission.EditApogee):
|
||||
|
@ -275,16 +233,8 @@ def _style_sems(sems: list[dict], fmt="html") -> list[dict]:
|
|||
"""ajoute quelques attributs de présentation pour la table"""
|
||||
is_h = fmt == "html"
|
||||
if is_h:
|
||||
icon_published = scu.icontag(
|
||||
"eye_img",
|
||||
border="0",
|
||||
title="Bulletins publiés sur la passerelle étudiants",
|
||||
)
|
||||
icon_hidden = scu.icontag(
|
||||
"hide_img",
|
||||
border="0",
|
||||
title="Bulletins NON publiés sur la passerelle étudiants",
|
||||
)
|
||||
icon_published = scu.ICON_PUBLISHED
|
||||
icon_hidden = scu.ICON_HIDDEN
|
||||
else:
|
||||
icon_published = "publié"
|
||||
icon_hidden = "non publié"
|
||||
|
|
|
@ -58,21 +58,20 @@ def formation_delete(formation_id=None, dialog_confirmed=False):
|
|||
html_sco_header.sco_header(page_title="Suppression d'une formation"),
|
||||
f"""<h2>Suppression de la formation {formation.titre} ({formation.acronyme})</h2>""",
|
||||
]
|
||||
|
||||
sems = sco_formsemestre.do_formsemestre_list({"formation_id": formation_id})
|
||||
if sems:
|
||||
formsemestres = formation.formsemestres.all()
|
||||
if formsemestres:
|
||||
H.append(
|
||||
"""<p class="warning">Impossible de supprimer cette formation,
|
||||
car les sessions suivantes l'utilisent:</p>
|
||||
<ul>"""
|
||||
)
|
||||
for sem in sems:
|
||||
H.append(
|
||||
'<li><a class="stdlink" href="formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(titremois)s</a></li>'
|
||||
% sem
|
||||
)
|
||||
for formsemestre in formsemestres:
|
||||
H.append(f"""<li>{formsemestre.html_link_status()}</li>""")
|
||||
H.append(
|
||||
'</ul><p><a class="stdlink" href="%s">Revenir</a></p>' % scu.NotesURL()
|
||||
f"""</ul>
|
||||
<p><a class="stdlink" href="{
|
||||
url_for("notes.index_html", scodoc_dept=g.scodoc_dept)
|
||||
}">Revenir</a></p>"""
|
||||
)
|
||||
else:
|
||||
if not dialog_confirmed:
|
||||
|
@ -85,14 +84,16 @@ def formation_delete(formation_id=None, dialog_confirmed=False):
|
|||
</p>
|
||||
""",
|
||||
OK="Supprimer cette formation",
|
||||
cancel_url=scu.NotesURL(),
|
||||
cancel_url=url_for("notes.index_html", scodoc_dept=g.scodoc_dept),
|
||||
parameters={"formation_id": formation_id},
|
||||
)
|
||||
else:
|
||||
do_formation_delete(formation_id)
|
||||
H.append(
|
||||
f"""<p>OK, formation supprimée.</p>
|
||||
<p><a class="stdlink" href="{scu.NotesURL()}">continuer</a></p>"""
|
||||
<p><a class="stdlink" href="{
|
||||
url_for("notes.index_html", scodoc_dept=g.scodoc_dept)
|
||||
}">continuer</a></p>"""
|
||||
)
|
||||
|
||||
H.append(html_sco_header.sco_footer())
|
||||
|
@ -252,7 +253,7 @@ def formation_edit(formation_id=None, create=False):
|
|||
if tf[0] == 0:
|
||||
return "\n".join(H) + tf[1] + html_sco_header.sco_footer()
|
||||
elif tf[0] == -1:
|
||||
return flask.redirect(scu.NotesURL())
|
||||
return flask.redirect(url_for("notes.index_html", scodoc_dept=g.scodoc_dept))
|
||||
else:
|
||||
# check unicity : constraint UNIQUE(acronyme,titre,version)
|
||||
if create:
|
||||
|
|
|
@ -448,7 +448,7 @@ def module_edit(
|
|||
(
|
||||
"titre",
|
||||
{
|
||||
"size": 30,
|
||||
"size": 64,
|
||||
"explanation": """nom du module. Exemple:
|
||||
<em>Introduction à la démarche ergonomique</em>""",
|
||||
},
|
||||
|
@ -456,8 +456,8 @@ def module_edit(
|
|||
(
|
||||
"abbrev",
|
||||
{
|
||||
"size": 20,
|
||||
"explanation": """nom abrégé (pour bulletins).
|
||||
"size": 32,
|
||||
"explanation": """(optionnel) nom abrégé pour bulletins.
|
||||
Exemple: <em>Intro. à l'ergonomie</em>""",
|
||||
},
|
||||
),
|
||||
|
|
|
@ -298,27 +298,6 @@ def ue_edit(ue_id=None, create=False, formation_id=None, default_semestre_idx=No
|
|||
cursus = formation.get_cursus()
|
||||
is_apc = cursus.APC_SAE
|
||||
semestres_indices = list(range(1, cursus.NB_SEM + 1))
|
||||
H = [
|
||||
html_sco_header.sco_header(page_title=title, javascripts=["js/edit_ue.js"]),
|
||||
"<h2>" + title,
|
||||
f" (formation {formation.acronyme}, version {formation.version})</h2>",
|
||||
"""
|
||||
<p class="help">Les UE sont des groupes de modules dans une formation donnée,
|
||||
utilisés pour la validation (on calcule des moyennes par UE et applique des
|
||||
seuils ("barres")).
|
||||
</p>
|
||||
|
||||
<p class="help">Note: sauf exception, l'UE n'a pas de coefficient associé.
|
||||
Seuls les <em>modules</em> ont des coefficients.
|
||||
</p>""",
|
||||
(
|
||||
f"""
|
||||
<h4>UE du semestre S{ue.semestre_idx}</h4>
|
||||
"""
|
||||
if is_apc and ue
|
||||
else ""
|
||||
),
|
||||
]
|
||||
|
||||
ue_types = cursus.ALLOWED_UE_TYPES
|
||||
ue_types.sort()
|
||||
|
@ -489,7 +468,7 @@ def ue_edit(ue_id=None, create=False, formation_id=None, default_semestre_idx=No
|
|||
if ue and is_apc:
|
||||
ue_parcours_div = apc_edit_ue.form_ue_choix_parcours(ue)
|
||||
if ue and ue.modules.count() and ue.semestre_idx is not None:
|
||||
modules_div = f"""<div id="ue_list_modules">
|
||||
modules_div = f"""<div class="scobox" id="ue_list_modules">
|
||||
<div><b>{ue.modules.count()} modules sont rattachés
|
||||
à cette UE</b> du semestre S{ue.semestre_idx},
|
||||
elle ne peut donc pas être changée de semestre.</div>
|
||||
|
@ -511,18 +490,34 @@ def ue_edit(ue_id=None, create=False, formation_id=None, default_semestre_idx=No
|
|||
"""
|
||||
else:
|
||||
clone_form = ""
|
||||
bonus_div = """<div id="bonus_description"></div>"""
|
||||
ue_div = """<div id="ue_list_code" class="sco_box sco_green_bg"></div>"""
|
||||
return (
|
||||
"\n".join(H)
|
||||
+ tf[1]
|
||||
+ clone_form
|
||||
+ ue_parcours_div
|
||||
+ modules_div
|
||||
+ bonus_div
|
||||
+ ue_div
|
||||
+ html_sco_header.sco_footer()
|
||||
)
|
||||
|
||||
return f"""
|
||||
{html_sco_header.sco_header(page_title=title, javascripts=["js/edit_ue.js"])}
|
||||
<h2>{title}, (formation {formation.acronyme}, version {formation.version})</h2>
|
||||
<p class="help">Les UEs sont des groupes de modules dans une formation donnée,
|
||||
utilisés pour la validation (on calcule des moyennes par UE et applique des
|
||||
seuils ("barres")).
|
||||
</p>
|
||||
|
||||
<p class="help">Note: sauf exception, l'UE n'a pas de coefficient associé.
|
||||
Seuls les <em>modules</em> ont des coefficients.
|
||||
</p>
|
||||
|
||||
<div class="scobox">
|
||||
<div class="scobox-title">
|
||||
Édition de l'UE {('du semestre S'+str(ue.semestre_idx)) if is_apc and ue else ''}
|
||||
</div>
|
||||
{tf[1]}
|
||||
</div>
|
||||
{clone_form}
|
||||
{ue_parcours_div}
|
||||
{modules_div}
|
||||
|
||||
<div id="bonus_description"></div>
|
||||
<div id="ue_list_code" class="sco_box sco_green_bg"></div>
|
||||
|
||||
{html_sco_header.sco_footer()}
|
||||
"""
|
||||
elif tf[0] == 1:
|
||||
if create:
|
||||
if not tf[2]["ue_code"]:
|
||||
|
@ -756,7 +751,7 @@ def ue_table(formation_id=None, semestre_idx=1, msg=""): # was ue_list
|
|||
H = [
|
||||
html_sco_header.sco_header(
|
||||
cssstyles=html_sco_header.BOOTSTRAP_MULTISELECT_CSS
|
||||
+ ["libjs/jQuery-tagEditor/jquery.tag-editor.css"],
|
||||
+ ["libjs/jQuery-tagEditor/jquery.tag-editor.css", "css/ue_table.css"],
|
||||
javascripts=html_sco_header.BOOTSTRAP_MULTISELECT_JS
|
||||
+ [
|
||||
"libjs/jinplace-1.2.1.min.js",
|
||||
|
@ -842,8 +837,7 @@ du programme" (menu "Semestre") si vous avez un semestre en cours);
|
|||
<a href="{url_for('notes.refcomp_show',
|
||||
scodoc_dept=g.scodoc_dept, refcomp_id=formation.referentiel_competence.id)}"
|
||||
class="stdlink">
|
||||
{formation.referentiel_competence.type_titre}
|
||||
{formation.referentiel_competence.specialite_long}
|
||||
{formation.referentiel_competence.get_title()}
|
||||
</a> """
|
||||
msg_refcomp = "changer"
|
||||
H.append(f"""<ul><li>{descr_refcomp}""")
|
||||
|
@ -1170,14 +1164,17 @@ def _ue_table_ues(
|
|||
if has_perm_change:
|
||||
H.append(
|
||||
f"""<a class="stdlink" href="{
|
||||
url_for("notes.ue_set_internal", scodoc_dept=g.scodoc_dept, ue_id=ue["ue_id"])
|
||||
url_for("notes.ue_set_internal",
|
||||
scodoc_dept=g.scodoc_dept, ue_id=ue["ue_id"])
|
||||
}">transformer en UE ordinaire</a> """
|
||||
)
|
||||
H.append("</span>")
|
||||
ue_editable = editable and not ue_is_locked(ue["ue_id"])
|
||||
if ue_editable:
|
||||
H.append(
|
||||
'<a class="stdlink" href="ue_edit?ue_id=%(ue_id)s">modifier</a>' % ue
|
||||
f"""<a class="stdlink" href="{
|
||||
url_for("notes.ue_edit", scodoc_dept=g.scodoc_dept, ue_id=ue["ue_id"])
|
||||
}">modifier</a>"""
|
||||
)
|
||||
else:
|
||||
H.append('<span class="locked">[verrouillé]</span>')
|
||||
|
|
|
@ -478,11 +478,11 @@ def convert_ics(
|
|||
"heure_deb": event.decoded("dtstart")
|
||||
.replace(tzinfo=timezone.utc)
|
||||
.astimezone(tz=None)
|
||||
.strftime("%H:%M"),
|
||||
.strftime(scu.TIME_FMT),
|
||||
"heure_fin": event.decoded("dtend")
|
||||
.replace(tzinfo=timezone.utc)
|
||||
.astimezone(tz=None)
|
||||
.strftime("%H:%M"),
|
||||
.strftime(scu.TIME_FMT),
|
||||
"jour": event.decoded("dtstart").date().isoformat(),
|
||||
"start": event.decoded("dtstart").isoformat(),
|
||||
"end": event.decoded("dtend").isoformat(),
|
||||
|
|
|
@ -452,7 +452,7 @@ def table_apo_csv_list(semset):
|
|||
apo_data = sco_apogee_csv.ApoData(csv_data, periode=semset["sem_id"])
|
||||
t["filename"] = apo_data.apo_csv.titles["apoC_Fichier_Exp"]
|
||||
t["nb_etuds"] = len(apo_data.etuds)
|
||||
t["date_str"] = t["date"].strftime("%d/%m/%Y à %H:%M")
|
||||
t["date_str"] = t["date"].strftime(scu.DATEATIME_FMT)
|
||||
view_link = url_for(
|
||||
"notes.view_apo_csv",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
|
|
|
@ -122,16 +122,14 @@ def format_pays(s):
|
|||
return ""
|
||||
|
||||
|
||||
def etud_sort_key(etud: dict) -> tuple:
|
||||
def etud_sort_key(etud: dict) -> str:
|
||||
"""Clé de tri pour les étudiants représentés par des dict (anciens codes).
|
||||
Equivalent moderne: identite.sort_key
|
||||
"""
|
||||
return (
|
||||
scu.sanitize_string(
|
||||
etud.get("nom_usuel") or etud["nom"] or "", remove_spaces=False
|
||||
).lower(),
|
||||
scu.sanitize_string(etud["prenom"] or "", remove_spaces=False).lower(),
|
||||
)
|
||||
return scu.sanitize_string(
|
||||
(etud.get("nom_usuel") or etud["nom"] or "") + ";" + (etud["prenom"] or ""),
|
||||
remove_spaces=False,
|
||||
).lower()
|
||||
|
||||
|
||||
_identiteEditor = ndb.EditableTable(
|
||||
|
|
|
@ -135,7 +135,7 @@ def evaluation_check_absences_html(
|
|||
f"""<h2 class="eval_check_absences">{
|
||||
evaluation.description or "évaluation"
|
||||
} du {
|
||||
evaluation.date_debut.strftime("%d/%m/%Y") if evaluation.date_debut else ""
|
||||
evaluation.date_debut.strftime(scu.DATE_FMT) if evaluation.date_debut else ""
|
||||
} """
|
||||
]
|
||||
if (
|
||||
|
|
|
@ -90,7 +90,7 @@ def evaluation_create_form(
|
|||
raise ValueError("missing moduleimpl_id parameter")
|
||||
numeros = [(e.numero or 0) for e in modimpl.evaluations]
|
||||
initvalues = {
|
||||
"jour": time.strftime("%d/%m/%Y", time.localtime()),
|
||||
"jour": time.strftime(scu.DATE_FMT, time.localtime()),
|
||||
"note_max": 20,
|
||||
"numero": (max(numeros) + 1) if numeros else 0,
|
||||
"publish_incomplete": is_malus,
|
||||
|
@ -144,7 +144,7 @@ def evaluation_create_form(
|
|||
if edit:
|
||||
initvalues["blocked"] = evaluation.is_blocked()
|
||||
initvalues["blocked_until"] = (
|
||||
evaluation.blocked_until.strftime("%d/%m/%Y")
|
||||
evaluation.blocked_until.strftime(scu.DATE_FMT)
|
||||
if evaluation.blocked_until
|
||||
and evaluation.blocked_until < Evaluation.BLOCKED_FOREVER
|
||||
else ""
|
||||
|
@ -231,7 +231,13 @@ def evaluation_create_form(
|
|||
{
|
||||
"input_type": "boolcheckbox",
|
||||
"title": "Prise en compte immédiate",
|
||||
"explanation": "notes utilisées même si incomplètes",
|
||||
"explanation": """notes utilisées même si incomplètes (dangereux,
|
||||
à n'utiliser que dans des cas particuliers
|
||||
<a target="_blank" rel="noopener noreferrer"
|
||||
href="https://scodoc.org/Evaluation/#pourquoi-eviter-dutiliser-prise-en-compte-immediate"
|
||||
>voir la documentation</a>
|
||||
)
|
||||
""",
|
||||
},
|
||||
),
|
||||
(
|
||||
|
@ -374,13 +380,7 @@ def evaluation_create_form(
|
|||
args = tf[2]
|
||||
# modifie le codage des dates
|
||||
# (nb: ce formulaire ne permet de créer que des évaluation sur la même journée)
|
||||
if args.get("jour"):
|
||||
try:
|
||||
date_debut = datetime.datetime.strptime(args["jour"], "%d/%m/%Y")
|
||||
except ValueError as exc:
|
||||
raise ScoValueError("Date (j/m/a) invalide") from exc
|
||||
else:
|
||||
date_debut = None
|
||||
date_debut = scu.convert_fr_date(args["jour"]) if args.get("jour") else None
|
||||
args["date_debut"] = date_debut
|
||||
args["date_fin"] = date_debut # même jour
|
||||
args.pop("jour", None)
|
||||
|
@ -405,7 +405,7 @@ def evaluation_create_form(
|
|||
if args.get("blocked_until"):
|
||||
try:
|
||||
args["blocked_until"] = datetime.datetime.strptime(
|
||||
args["blocked_until"], "%d/%m/%Y"
|
||||
args["blocked_until"], scu.DATE_FMT
|
||||
)
|
||||
except ValueError as exc:
|
||||
raise ScoValueError("Date déblocage (j/m/a) invalide") from exc
|
||||
|
|
|
@ -126,13 +126,15 @@ def evaluations_recap_table(formsemestre: FormSemestre) -> list[dict]:
|
|||
evaluation_id=evaluation_id,
|
||||
),
|
||||
"_titre_target_attrs": 'class="discretelink"',
|
||||
"date": e.date_debut.strftime("%d/%m/%Y") if e.date_debut else "",
|
||||
"date": e.date_debut.strftime(scu.DATE_FMT) if e.date_debut else "",
|
||||
"_date_order": e.date_debut.isoformat() if e.date_debut else "",
|
||||
"complete": "oui" if eval_etat.is_complete else "non",
|
||||
"_complete_target": "#",
|
||||
"_complete_target_attrs": 'class="bull_link" title="prise en compte dans les moyennes"'
|
||||
if eval_etat.is_complete
|
||||
else 'class="bull_link incomplete" title="il manque des notes"',
|
||||
"_complete_target_attrs": (
|
||||
'class="bull_link" title="prise en compte dans les moyennes"'
|
||||
if eval_etat.is_complete
|
||||
else 'class="bull_link incomplete" title="il manque des notes"'
|
||||
),
|
||||
"manquantes": len(modimpl_results.evals_etudids_sans_note[e.id]),
|
||||
"inscrits": modimpl_results.nb_inscrits_module,
|
||||
"nb_abs": sum(modimpl_results.evals_notes[e.id] == scu.NOTES_ABSENCE),
|
||||
|
|
|
@ -360,6 +360,7 @@ def do_evaluation_etat_in_mod(nt, modimpl: ModuleImpl):
|
|||
return etat
|
||||
|
||||
|
||||
# View
|
||||
def formsemestre_evaluations_cal(formsemestre_id):
|
||||
"""Page avec calendrier de toutes les evaluations de ce semestre"""
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
|
@ -373,20 +374,17 @@ def formsemestre_evaluations_cal(formsemestre_id):
|
|||
color_futur = "#70E0FF"
|
||||
|
||||
year = formsemestre.annee_scolaire()
|
||||
events = {} # (day, halfday) : event
|
||||
events_by_day = collections.defaultdict(list) # date_iso : event
|
||||
for e in evaluations:
|
||||
if e.date_debut is None:
|
||||
continue # éval. sans date
|
||||
txt = e.moduleimpl.module.code or e.moduleimpl.module.abbrev or "éval."
|
||||
if e.date_debut == e.date_fin:
|
||||
heure_debut_txt, heure_fin_txt = "?", "?"
|
||||
heure_debut_txt, heure_fin_txt = "", ""
|
||||
else:
|
||||
heure_debut_txt = e.date_debut.strftime("%Hh%M") if e.date_debut else "?"
|
||||
heure_fin_txt = e.date_fin.strftime("%Hh%M") if e.date_fin else "?"
|
||||
|
||||
description = f"""{
|
||||
e.moduleimpl.module.titre
|
||||
}, de {heure_debut_txt} à {heure_fin_txt}"""
|
||||
heure_debut_txt = (
|
||||
e.date_debut.strftime(scu.TIME_FMT) if e.date_debut else ""
|
||||
)
|
||||
heure_fin_txt = e.date_fin.strftime(scu.TIME_FMT) if e.date_fin else ""
|
||||
|
||||
# Etat (notes completes) de l'évaluation:
|
||||
modimpl_result = nt.modimpls_results[e.moduleimpl.id]
|
||||
|
@ -396,28 +394,27 @@ def formsemestre_evaluations_cal(formsemestre_id):
|
|||
color = color_incomplete
|
||||
if e.date_debut > datetime.datetime.now(scu.TIME_ZONE):
|
||||
color = color_futur
|
||||
href = url_for(
|
||||
"notes.moduleimpl_status",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
moduleimpl_id=e.moduleimpl_id,
|
||||
)
|
||||
day = e.date_debut.date().isoformat() # yyyy-mm-dd
|
||||
event = events.get(day)
|
||||
if not event:
|
||||
events[day] = [day, txt, color, href, description, e.moduleimpl]
|
||||
else:
|
||||
if event[-1].id != e.moduleimpl.id:
|
||||
# plusieurs evals de modules differents a la meme date
|
||||
event[1] += ", " + txt
|
||||
event[4] += ", " + description
|
||||
if color == color_incomplete:
|
||||
event[2] = color_incomplete
|
||||
if color == color_futur:
|
||||
event[2] = color_futur
|
||||
event = {
|
||||
"color": color,
|
||||
"date_iso": day,
|
||||
"title": e.moduleimpl.module.code or e.moduleimpl.module.abbrev or "éval.",
|
||||
"description": f"""{e.description or e.moduleimpl.module.titre_str()}"""
|
||||
+ (
|
||||
f""" de {heure_debut_txt} à {heure_fin_txt}"""
|
||||
if heure_debut_txt
|
||||
else ""
|
||||
),
|
||||
"href": url_for(
|
||||
"notes.moduleimpl_status",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
moduleimpl_id=e.moduleimpl_id,
|
||||
),
|
||||
"modimpl": e.moduleimpl,
|
||||
}
|
||||
events_by_day[day].append(event)
|
||||
|
||||
cal_html = sco_cal.YearTable(
|
||||
year, events=list(events.values()), halfday=False, pad_width=None
|
||||
)
|
||||
cal_html = sco_cal.YearTable(year, events_by_day=events_by_day)
|
||||
|
||||
return f"""
|
||||
{
|
||||
|
@ -526,7 +523,7 @@ def formsemestre_evaluations_delai_correction(formsemestre_id, fmt="html"):
|
|||
"date_first_complete": date_first_complete,
|
||||
"delai_correction": delai_correction,
|
||||
"jour": (
|
||||
e.date_debut.strftime("%d/%m/%Y") if e.date_debut else "sans date"
|
||||
e.date_debut.strftime(scu.DATE_FMT) if e.date_debut else "sans date"
|
||||
),
|
||||
"_jour_target": url_for(
|
||||
"notes.evaluation_listenotes",
|
||||
|
@ -539,7 +536,9 @@ def formsemestre_evaluations_delai_correction(formsemestre_id, fmt="html"):
|
|||
scodoc_dept=g.scodoc_dept,
|
||||
moduleimpl_id=e.moduleimpl.id,
|
||||
),
|
||||
"module_titre": e.moduleimpl.module.abbrev or e.moduleimpl.module.titre,
|
||||
"module_titre": e.moduleimpl.module.abbrev
|
||||
or e.moduleimpl.module.titre
|
||||
or "",
|
||||
"responsable_id": e.moduleimpl.responsable_id,
|
||||
"responsable_nomplogin": sco_users.user_info(
|
||||
e.moduleimpl.responsable_id
|
||||
|
|
|
@ -72,7 +72,7 @@ def xldate_as_datetime(xldate, datemode=0):
|
|||
Peut lever une ValueError
|
||||
"""
|
||||
try:
|
||||
return datetime.datetime.strptime(xldate, "%d/%m/%Y")
|
||||
return datetime.datetime.strptime(xldate, scu.DATE_FMT)
|
||||
except:
|
||||
return openpyxl.utils.datetime.from_ISO8601(xldate)
|
||||
|
||||
|
|
|
@ -103,7 +103,7 @@ class ScoPDFFormatError(ScoValueError):
|
|||
super().__init__(
|
||||
f"""Erreur dans un format pdf:
|
||||
<p>{msg}</p>
|
||||
<p>Vérifiez les paramètres (polices de caractères, balisage)
|
||||
<p>Vérifiez les paramètres (polices de caractères, balisage, réglages bulletins...)
|
||||
dans les paramètres ou préférences.
|
||||
</p>
|
||||
""",
|
||||
|
|
|
@ -489,9 +489,10 @@ def formation_import_xml(doc: str, import_tags=True, use_local_refcomp=False):
|
|||
return formation.id, modules_old2new, ues_old2new
|
||||
|
||||
|
||||
def formation_list_table() -> GenTable:
|
||||
def formation_list_table(detail: bool) -> GenTable:
|
||||
"""List formation, grouped by titre and sorted by versions
|
||||
and listing associated semestres
|
||||
and listing associated semestres.
|
||||
If detail, add column with more details.
|
||||
returns a table
|
||||
"""
|
||||
formations: list[Formation] = Formation.query.filter_by(dept_id=g.scodoc_dept_id)
|
||||
|
@ -507,6 +508,7 @@ def formation_list_table() -> GenTable:
|
|||
)
|
||||
|
||||
editable = current_user.has_permission(Permission.EditFormation)
|
||||
can_implement = current_user.has_permission(Permission.EditFormSemestre)
|
||||
|
||||
# Traduit/ajoute des champs à afficher:
|
||||
rows = []
|
||||
|
@ -533,6 +535,15 @@ def formation_list_table() -> GenTable:
|
|||
if formation.referentiel_competence
|
||||
else ""
|
||||
),
|
||||
"_referentiel_target": (
|
||||
url_for(
|
||||
"notes.refcomp_show",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
refcomp_id=formation.referentiel_competence.id,
|
||||
)
|
||||
if formation.referentiel_competence
|
||||
else ""
|
||||
),
|
||||
}
|
||||
# Ajoute les semestres associés à chaque formation:
|
||||
row["formsemestres"] = formation.formsemestres.order_by(
|
||||
|
@ -547,20 +558,28 @@ def formation_list_table() -> GenTable:
|
|||
)}">{s.session_id()}</a>"""
|
||||
for s in row["formsemestres"]
|
||||
]
|
||||
+ [
|
||||
f"""<a class="stdlink" id="add-semestre-{
|
||||
formation.acronyme.lower().replace(" ", "-")}"
|
||||
+ (
|
||||
[
|
||||
f"""<a class="stdlink"
|
||||
href="{ url_for("notes.formsemestre_createwithmodules",
|
||||
scodoc_dept=g.scodoc_dept, formation_id=formation.id, semestre_id=1
|
||||
)
|
||||
}">ajouter</a>
|
||||
"""
|
||||
]
|
||||
)
|
||||
if row["formsemestres"]:
|
||||
row["date_fin_dernier_sem"] = (
|
||||
row["formsemestres"][-1].date_fin.isoformat(),
|
||||
]
|
||||
if can_implement
|
||||
else []
|
||||
)
|
||||
)
|
||||
# Répartition des UEs dans les semestres
|
||||
# utilise pour voir si la formation couvre tous les semestres
|
||||
row["semestres_ues"] = ", ".join(
|
||||
"S" + str(x if (x is not None and x > 0) else "-")
|
||||
for x in sorted({(ue.semestre_idx or 0) for ue in formation.ues})
|
||||
)
|
||||
# Date surtout utilisées pour le tri:
|
||||
if row["formsemestres"]:
|
||||
row["date_fin_dernier_sem"] = row["formsemestres"][-1].date_fin.isoformat()
|
||||
row["annee_dernier_sem"] = row["formsemestres"][-1].date_fin.year
|
||||
else:
|
||||
row["date_fin_dernier_sem"] = ""
|
||||
|
@ -613,6 +632,8 @@ def formation_list_table() -> GenTable:
|
|||
"commentaire",
|
||||
"sems_list_txt",
|
||||
)
|
||||
if detail:
|
||||
columns_ids += ("annee_dernier_sem", "semestres_ues")
|
||||
titles = {
|
||||
"buttons": "",
|
||||
"commentaire": "Commentaire",
|
||||
|
@ -623,6 +644,9 @@ def formation_list_table() -> GenTable:
|
|||
"formation_code": "Code",
|
||||
"sems_list_txt": "Semestres",
|
||||
"referentiel": "Réf.",
|
||||
"date_fin_dernier_sem": "Fin dernier sem.",
|
||||
"annee_dernier_sem": "Année dernier sem.",
|
||||
"semestres_ues": "Semestres avec UEs",
|
||||
}
|
||||
return GenTable(
|
||||
columns_ids=columns_ids,
|
||||
|
@ -635,7 +659,7 @@ def formation_list_table() -> GenTable:
|
|||
html_class="formation_list_table table_leftalign",
|
||||
html_with_td_classes=True,
|
||||
html_sortable=True,
|
||||
base_url=f"{request.base_url}",
|
||||
base_url=f"{request.base_url}" + ("?detail=on" if detail else ""),
|
||||
page_title=title,
|
||||
pdf_title=title,
|
||||
preferences=sco_preferences.SemPreferences(),
|
||||
|
|
|
@ -812,14 +812,18 @@ def do_formsemestre_createwithmodules(edit=False, formsemestre: FormSemestre = N
|
|||
)
|
||||
msg = ""
|
||||
if tf[0] == 1:
|
||||
# check dates
|
||||
if ndb.DateDMYtoISO(tf[2]["date_debut"]) > ndb.DateDMYtoISO(tf[2]["date_fin"]):
|
||||
msg = '<ul class="tf-msg"><li class="tf-msg">Dates de début et fin incompatibles !</li></ul>'
|
||||
# convert and check dates
|
||||
tf[2]["date_debut"] = scu.convert_fr_date(tf[2]["date_debut"])
|
||||
tf[2]["date_fin"] = scu.convert_fr_date(tf[2]["date_fin"])
|
||||
if tf[2]["date_debut"] > tf[2]["date_fin"]:
|
||||
msg = """<ul class="tf-msg">
|
||||
<li class="tf-msg">Dates de début et fin incompatibles !</li>
|
||||
</ul>"""
|
||||
|
||||
if (
|
||||
sco_preferences.get_preference("always_require_apo_sem_codes")
|
||||
and not any(
|
||||
[tf[2]["etape_apo" + str(n)] for n in range(0, scu.EDIT_NB_ETAPES + 1)]
|
||||
tf[2]["etape_apo" + str(n)] for n in range(0, scu.EDIT_NB_ETAPES + 1)
|
||||
)
|
||||
# n'impose pas d'Apo pour les sem. extérieurs
|
||||
and ((formsemestre is None) or formsemestre.modalite != "EXT")
|
||||
|
@ -1427,18 +1431,25 @@ Ceci n'est possible que si :
|
|||
|
||||
def formsemestre_delete2(formsemestre_id, dialog_confirmed=False):
|
||||
"""Delete a formsemestre (confirmation)"""
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
# Confirmation dialog
|
||||
if not dialog_confirmed:
|
||||
return scu.confirm_dialog(
|
||||
"""<h2>Vous voulez vraiment supprimer ce semestre ???</h2><p>(opération irréversible)</p>""",
|
||||
"""<h2>Vous voulez vraiment supprimer ce semestre ???</h2>
|
||||
<p>(opération irréversible)</p>
|
||||
""",
|
||||
dest_url="",
|
||||
cancel_url="formsemestre_status?formsemestre_id=%s" % formsemestre_id,
|
||||
parameters={"formsemestre_id": formsemestre_id},
|
||||
cancel_url=url_for(
|
||||
"notes.formsemestre_status",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
formsemestre_id=formsemestre.id,
|
||||
),
|
||||
parameters={"formsemestre_id": formsemestre.id},
|
||||
)
|
||||
# Bon, s'il le faut...
|
||||
do_formsemestre_delete(formsemestre_id)
|
||||
do_formsemestre_delete(formsemestre.id)
|
||||
flash("Semestre supprimé !")
|
||||
return flask.redirect(scu.ScoURL())
|
||||
return flask.redirect(url_for("scolar.index_html", scodoc_dept=g.scodoc_dept))
|
||||
|
||||
|
||||
def formsemestre_has_decisions_or_compensations(
|
||||
|
|
|
@ -521,7 +521,7 @@ def _record_ue_validations_and_coefs(
|
|||
coef = _convert_field_to_float(coef)
|
||||
if coef == "" or coef is False:
|
||||
coef = None
|
||||
now_dmy = time.strftime("%d/%m/%Y")
|
||||
now_dmy = time.strftime(scu.DATE_FMT)
|
||||
log(
|
||||
f"_record_ue_validations_and_coefs: {formsemestre.id} etudid={etud.id} ue_id={ue.id} moy_ue={note} ue_coef={coef}"
|
||||
)
|
||||
|
|
|
@ -106,7 +106,7 @@ def do_formsemestre_inscription_create(args, method=None):
|
|||
cnx,
|
||||
args={
|
||||
"etudid": args["etudid"],
|
||||
"event_date": time.strftime("%d/%m/%Y"),
|
||||
"event_date": time.strftime(scu.DATE_FMT),
|
||||
"formsemestre_id": args["formsemestre_id"],
|
||||
"event_type": "INSCRIPTION",
|
||||
},
|
||||
|
|
|
@ -64,14 +64,11 @@ from app.scodoc import sco_archives_formsemestre
|
|||
from app.scodoc import sco_bulletins
|
||||
from app.scodoc import codes_cursus
|
||||
from app.scodoc import sco_compute_moy
|
||||
from app.scodoc import sco_edit_ue
|
||||
from app.scodoc import sco_evaluations
|
||||
from app.scodoc import sco_evaluation_db
|
||||
from app.scodoc import sco_formations
|
||||
from app.scodoc import sco_formsemestre
|
||||
from app.scodoc import sco_formsemestre_inscriptions
|
||||
from app.scodoc import sco_groups
|
||||
from app.scodoc import sco_moduleimpl
|
||||
from app.scodoc import sco_preferences
|
||||
from app.scodoc import sco_users
|
||||
from app.scodoc.gen_tables import GenTable
|
||||
|
@ -146,8 +143,10 @@ def _build_menu_stats(formsemestre: FormSemestre):
|
|||
]
|
||||
|
||||
|
||||
def formsemestre_status_menubar(formsemestre: FormSemestre) -> str:
|
||||
def formsemestre_status_menubar(formsemestre: FormSemestre | None) -> str:
|
||||
"""HTML to render menubar"""
|
||||
if formsemestre is None:
|
||||
return ""
|
||||
formsemestre_id = formsemestre.id
|
||||
if formsemestre.etat:
|
||||
change_lock_msg = "Verrouiller"
|
||||
|
@ -635,7 +634,7 @@ def formsemestre_description_table(
|
|||
"UE": modimpl.module.ue.acronyme,
|
||||
"_UE_td_attrs": ue_info.get("_UE_td_attrs", ""),
|
||||
"Code": modimpl.module.code or "",
|
||||
"Module": modimpl.module.abbrev or modimpl.module.titre,
|
||||
"Module": modimpl.module.abbrev or modimpl.module.titre or "",
|
||||
"_Module_class": "scotext",
|
||||
"Inscrits": mod_nb_inscrits,
|
||||
"Responsable": sco_users.user_info(modimpl.responsable_id)["nomprenom"],
|
||||
|
@ -692,7 +691,7 @@ def formsemestre_description_table(
|
|||
)
|
||||
e["_date_evaluation_order"] = e["jour"].isoformat()
|
||||
e["date_evaluation"] = (
|
||||
e["jour"].strftime("%d/%m/%Y") if e["jour"] else ""
|
||||
e["jour"].strftime(scu.DATE_FMT) if e["jour"] else ""
|
||||
)
|
||||
e["UE"] = row["UE"]
|
||||
e["_UE_td_attrs"] = row["_UE_td_attrs"]
|
||||
|
@ -1495,7 +1494,12 @@ def formsemestre_note_etuds_sans_notes(
|
|||
</div>
|
||||
{message}
|
||||
|
||||
<form method="post">
|
||||
<style>
|
||||
.sco-std-form select, .sco-std-form input[type="submit"] {{
|
||||
height: 24px;
|
||||
}}
|
||||
</style>
|
||||
<form class="sco-std-form" method="post">
|
||||
<input type="hidden" name="formsemestre_id" value="{formsemestre.id}">
|
||||
<input type="hidden" name="etudid" value="{etudid or ""}">
|
||||
|
||||
|
@ -1506,7 +1510,7 @@ def formsemestre_note_etuds_sans_notes(
|
|||
<option value="ATT" selected>ATT (en attente)</option>
|
||||
<option value="EXC">EXC (neutralisée)</option>
|
||||
</select>
|
||||
<input type="submit" name="enregistrer">
|
||||
<input type="submit" value="Enregistrer">
|
||||
</form>
|
||||
{html_sco_header.sco_footer()}
|
||||
"""
|
||||
|
|
|
@ -1160,7 +1160,7 @@ def formsemestre_validate_previous_ue(formsemestre: FormSemestre, etud: Identite
|
|||
"input_type": "date",
|
||||
"size": 9,
|
||||
"explanation": "j/m/a",
|
||||
"default": time.strftime("%d/%m/%Y"),
|
||||
"default": time.strftime(scu.DATE_FMT),
|
||||
},
|
||||
),
|
||||
(
|
||||
|
|
|
@ -453,6 +453,10 @@ class DisplayedGroupsInfos:
|
|||
for i in to_remove:
|
||||
del T[i]
|
||||
|
||||
def get_etudids(self) -> set[int]:
|
||||
"Les etudids des groupes choisis"
|
||||
return {member["etudid"] for member in self.members}
|
||||
|
||||
def get_form_elem(self):
|
||||
"""html hidden input with groups"""
|
||||
H = []
|
||||
|
|
|
@ -513,7 +513,7 @@ def _build_page(
|
|||
|
||||
<div>{scu.EMO_WARNING}
|
||||
<em>Seuls les semestres dont la date de fin est proche de la date de début
|
||||
de ce semestre ({formsemestre.date_debut.strftime("%d/%m/%Y")}) sont pris en
|
||||
de ce semestre ({formsemestre.date_debut.strftime(scu.DATE_FMT)}) sont pris en
|
||||
compte.</em>
|
||||
</div>
|
||||
{etuds_select_boxes(auth_etuds_by_sem, inscrits_ailleurs)}
|
||||
|
@ -704,7 +704,7 @@ def etuds_select_boxes(
|
|||
elink += (
|
||||
'<span class="finalisationinscription">'
|
||||
+ " : inscription finalisée le "
|
||||
+ etud["datefinalisationinscription"].strftime("%d/%m/%Y")
|
||||
+ etud["datefinalisationinscription"].strftime(scu.DATE_FMT)
|
||||
+ "</span>"
|
||||
)
|
||||
|
||||
|
|
|
@ -827,7 +827,7 @@ def _add_eval_columns(
|
|||
nb_notes,
|
||||
evaluation.description,
|
||||
(
|
||||
evaluation.date_debut.strftime("%d/%m/%Y")
|
||||
evaluation.date_debut.strftime(scu.DATE_FMT)
|
||||
if evaluation.date_debut
|
||||
else ""
|
||||
),
|
||||
|
|
|
@ -34,22 +34,28 @@ from operator import itemgetter
|
|||
from flask import url_for, g, request
|
||||
|
||||
import app
|
||||
import app.scodoc.sco_utils as scu
|
||||
from app.scodoc import html_sco_header
|
||||
from app.scodoc import sco_formsemestre
|
||||
from app.scodoc import sco_preferences
|
||||
from app.scodoc import sco_report
|
||||
from app.scodoc import sco_etud
|
||||
import sco_version
|
||||
from app.scodoc import (
|
||||
html_sco_header,
|
||||
sco_formsemestre,
|
||||
sco_groups_view,
|
||||
sco_preferences,
|
||||
sco_report,
|
||||
sco_etud,
|
||||
)
|
||||
from app.models import FormSemestre
|
||||
from app.scodoc.gen_tables import GenTable
|
||||
import app.scodoc.sco_utils as scu
|
||||
import sco_version
|
||||
|
||||
|
||||
def formsemestre_table_etuds_lycees(
|
||||
formsemestre_id, group_lycees=True, only_primo=False
|
||||
formsemestre: FormSemestre, groups_infos, group_lycees=True, only_primo=False
|
||||
):
|
||||
"""Récupère liste d'etudiants avec etat et decision."""
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
etuds = sco_report.tsp_etud_list(formsemestre_id, only_primo=only_primo)[0]
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre.id)
|
||||
etuds = sco_report.tsp_etud_list(
|
||||
formsemestre.id, groups_infos=groups_infos, only_primo=only_primo
|
||||
)[0]
|
||||
if only_primo:
|
||||
primostr = "primo-entrants du "
|
||||
else:
|
||||
|
@ -59,7 +65,7 @@ def formsemestre_table_etuds_lycees(
|
|||
etuds,
|
||||
group_lycees,
|
||||
title,
|
||||
sco_preferences.SemPreferences(formsemestre_id),
|
||||
sco_preferences.SemPreferences(formsemestre.id),
|
||||
)
|
||||
|
||||
|
||||
|
@ -180,13 +186,20 @@ def _table_etuds_lycees(etuds, group_lycees, title, preferences, no_links=False)
|
|||
|
||||
def formsemestre_etuds_lycees(
|
||||
formsemestre_id,
|
||||
group_ids: list[int] = None, # si indiqué, ne prend que ces groupes
|
||||
fmt="html",
|
||||
only_primo=False,
|
||||
no_grouping=False,
|
||||
):
|
||||
"""Table des lycées d'origine"""
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
groups_infos = sco_groups_view.DisplayedGroupsInfos(
|
||||
group_ids,
|
||||
formsemestre_id=formsemestre.id,
|
||||
select_all_when_unspecified=True,
|
||||
)
|
||||
tab, etuds_by_lycee = formsemestre_table_etuds_lycees(
|
||||
formsemestre_id, only_primo=only_primo, group_lycees=not no_grouping
|
||||
formsemestre, groups_infos, only_primo=only_primo, group_lycees=not no_grouping
|
||||
)
|
||||
tab.base_url = "%s?formsemestre_id=%s" % (request.base_url, formsemestre_id)
|
||||
if only_primo:
|
||||
|
@ -196,13 +209,19 @@ def formsemestre_etuds_lycees(
|
|||
t = tab.make_page(fmt=fmt, with_html_headers=False)
|
||||
if fmt != "html":
|
||||
return t
|
||||
F = [sco_report.tsp_form_primo_group(only_primo, no_grouping, formsemestre_id, fmt)]
|
||||
F = [
|
||||
sco_report.tsp_form_primo_group(
|
||||
only_primo, no_grouping, formsemestre_id, fmt, groups_infos=groups_infos
|
||||
)
|
||||
]
|
||||
H = [
|
||||
html_sco_header.sco_header(
|
||||
page_title=tab.page_title,
|
||||
init_google_maps=True,
|
||||
init_qtip=True,
|
||||
javascripts=["js/etud_info.js", "js/map_lycees.js"],
|
||||
cssstyles=sco_groups_view.CSSSTYLES,
|
||||
javascripts=sco_groups_view.JAVASCRIPTS
|
||||
+ ["js/etud_info.js", "js/map_lycees.js"],
|
||||
),
|
||||
"""<h2 class="formsemestre">Lycées d'origine des étudiants</h2>""",
|
||||
"\n".join(F),
|
||||
|
|
|
@ -36,37 +36,45 @@ Elle n'est pas utilisée pour les parcours, ni pour rien d'autre
|
|||
import collections
|
||||
import app.scodoc.notesdb as ndb
|
||||
from app import log
|
||||
from app.models import FormSemestre
|
||||
|
||||
|
||||
def list_formsemestres_modalites(sems):
|
||||
def list_formsemestres_modalites(formsemestres: list[FormSemestre]) -> list[dict]:
|
||||
"""Liste ordonnée des modalités présentes dans ces formsemestres"""
|
||||
modalites = {}
|
||||
for sem in sems:
|
||||
if sem["modalite"] not in modalites:
|
||||
m = do_modalite_list(args={"modalite": sem["modalite"]})[0]
|
||||
for formsemestre in formsemestres:
|
||||
if formsemestre.modalite not in modalites:
|
||||
m = do_modalite_list(args={"modalite": formsemestre.modalite})[0]
|
||||
modalites[m["modalite"]] = m
|
||||
modalites = list(modalites.values())
|
||||
modalites.sort(key=lambda x: x["numero"])
|
||||
return modalites
|
||||
|
||||
|
||||
def group_sems_by_modalite(sems: list[dict]):
|
||||
def group_formsemestres_by_modalite(
|
||||
formsemestres: list[FormSemestre],
|
||||
) -> dict[str, list[FormSemestre]]:
|
||||
"""Given the list of formsemestre, group them by modalite,
|
||||
sorted in each one by semestre id and date
|
||||
"""
|
||||
sems_by_mod = collections.defaultdict(list)
|
||||
modalites = list_formsemestres_modalites(sems)
|
||||
for modalite in modalites:
|
||||
for sem in sems:
|
||||
if sem["semestre_id"] < 0: # formations en un semestre
|
||||
sem["sortkey"] = (-100 * sem["semestre_id"], sem["dateord"])
|
||||
else:
|
||||
sem["sortkey"] = (sem["semestre_id"], sem["dateord"])
|
||||
if sem["modalite"] == modalite["modalite"]:
|
||||
sems_by_mod[modalite["modalite"]].append(sem)
|
||||
modalites = list_formsemestres_modalites(formsemestres)
|
||||
sems_by_mod = {
|
||||
modalite["modalite"]: [
|
||||
formsemestre
|
||||
for formsemestre in formsemestres
|
||||
if formsemestre.modalite == modalite["modalite"]
|
||||
]
|
||||
for modalite in modalites
|
||||
}
|
||||
# tri dans chaque modalité par indice de semestre et date debut
|
||||
for modalite in modalites:
|
||||
sems_by_mod[modalite["modalite"]].sort(key=lambda x: x["sortkey"])
|
||||
sems_by_mod[modalite["modalite"]].sort(
|
||||
key=lambda x: (
|
||||
x.semestre_id if x.semestre_id > 0 else -1000 * x.semestre_id,
|
||||
x.date_debut,
|
||||
)
|
||||
)
|
||||
|
||||
return sems_by_mod, modalites
|
||||
|
||||
|
|
|
@ -50,8 +50,6 @@ from app.scodoc import html_sco_header
|
|||
from app.scodoc import htmlutils
|
||||
from app.scodoc import sco_cache
|
||||
from app.scodoc import codes_cursus
|
||||
from app.scodoc import sco_edit_module
|
||||
from app.scodoc import sco_edit_ue
|
||||
from app.scodoc import sco_etud
|
||||
from app.scodoc import sco_formsemestre_inscriptions
|
||||
from app.scodoc import sco_groups
|
||||
|
@ -431,7 +429,7 @@ def moduleimpl_inscriptions_stats(formsemestre_id):
|
|||
)
|
||||
if info["ue_status"]["event_date"]:
|
||||
H.append(
|
||||
f"""(cap. le {info["ue_status"]["event_date"].strftime("%d/%m/%Y")})"""
|
||||
f"""(cap. le {info["ue_status"]["event_date"].strftime(scu.DATE_FMT)})"""
|
||||
)
|
||||
if is_apc:
|
||||
is_inscrit_ue = (etud.id, ue.id) not in res.dispense_ues
|
||||
|
@ -584,7 +582,7 @@ def _list_but_ue_inscriptions(res: NotesTableCompat, read_only: bool = True) ->
|
|||
validation = validations_ue[-1] if validations_ue else None
|
||||
expl_validation = (
|
||||
f"""Validée ({validation.code}) le {
|
||||
validation.event_date.strftime("%d/%m/%Y")}"""
|
||||
validation.event_date.strftime(scu.DATE_FMT)}"""
|
||||
if validation
|
||||
else ""
|
||||
)
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
"""Tableau de bord module"""
|
||||
|
||||
import math
|
||||
import time
|
||||
import datetime
|
||||
|
||||
from flask import g, url_for
|
||||
|
@ -48,13 +47,10 @@ from app.scodoc.sco_permissions import Permission
|
|||
|
||||
from app.scodoc import html_sco_header
|
||||
from app.scodoc import htmlutils
|
||||
from app.scodoc import sco_cal
|
||||
from app.scodoc import sco_compute_moy
|
||||
from app.scodoc import sco_evaluations
|
||||
from app.scodoc import sco_formsemestre_status
|
||||
from app.scodoc import sco_groups
|
||||
from app.scodoc import sco_moduleimpl
|
||||
from app.scodoc import sco_permissions_check
|
||||
from app.tables import list_etuds
|
||||
|
||||
|
||||
|
@ -262,7 +258,7 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
|
|||
# 2ieme ligne: Semestre, Coef
|
||||
H.append("""<tr><td class="fichetitre2">""")
|
||||
if formsemestre.semestre_id >= 0:
|
||||
H.append("""Semestre: </td><td>%s""" % formsemestre.semestre_id)
|
||||
H.append(f"""Semestre: </td><td>{formsemestre.semestre_id}""")
|
||||
else:
|
||||
H.append("""</td><td>""")
|
||||
if sem_locked:
|
||||
|
@ -290,7 +286,8 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
|
|||
)
|
||||
if current_user.has_permission(Permission.EtudInscrit):
|
||||
H.append(
|
||||
f"""<a class="stdlink" style="margin-left:2em;" href="moduleimpl_inscriptions_edit?moduleimpl_id={modimpl.id}">modifier</a>"""
|
||||
f"""<a class="stdlink" style="margin-left:2em;"
|
||||
href="moduleimpl_inscriptions_edit?moduleimpl_id={modimpl.id}">modifier</a>"""
|
||||
)
|
||||
H.append("</td></tr>")
|
||||
# Ligne: règle de calcul
|
||||
|
@ -614,7 +611,7 @@ def _ligne_evaluation(
|
|||
|
||||
if evaluation.is_blocked():
|
||||
etat_txt = f"""évaluation bloquée {
|
||||
"jusqu'au " + evaluation.blocked_until.strftime("%d/%m/%Y")
|
||||
"jusqu'au " + evaluation.blocked_until.strftime(scu.DATE_FMT)
|
||||
if evaluation.blocked_until < Evaluation.BLOCKED_FOREVER
|
||||
else "" }
|
||||
"""
|
||||
|
@ -657,7 +654,8 @@ def _ligne_evaluation(
|
|||
<th class="moduleimpl_evaluations">Notes</th>
|
||||
<th class="moduleimpl_evaluations">Abs</th>
|
||||
<th class="moduleimpl_evaluations">N</th>
|
||||
<th class="moduleimpl_evaluations moduleimpl_evaluation_moy" colspan="2"><span>{etat_txt}</span></th>
|
||||
<th class="moduleimpl_evaluations moduleimpl_evaluation_moy"
|
||||
colspan="2"><span>{etat_txt}</span></th>
|
||||
</tr>
|
||||
<tr class="{tr_class} mievr_in">
|
||||
<td class="mievr">"""
|
||||
|
|
|
@ -180,7 +180,7 @@ def fiche_etud(etudid=None):
|
|||
)
|
||||
else:
|
||||
info["etat_civil"] = ""
|
||||
info["ScoURL"] = scu.ScoURL()
|
||||
info["ScoURL"] = url_for("scolar.index_html", scodoc_dept=g.scodoc_dept)
|
||||
info["authuser"] = current_user
|
||||
if restrict_etud_data:
|
||||
info["info_naissance"] = ""
|
||||
|
@ -730,7 +730,7 @@ def get_html_annotations_list(etud: Identite) -> list[str]:
|
|||
author = User.query.filter_by(user_name=annot.author).first()
|
||||
html_annotations_list.append(
|
||||
f"""<tr><td><span class="annodate">Le {
|
||||
annot.date.strftime("%d/%m/%Y") if annot.date else "?"}
|
||||
annot.date.strftime(scu.DATE_FMT) if annot.date else "?"}
|
||||
par {author.get_prenomnom() if author else "?"} :
|
||||
</span><span class="annoc">{annot.comment or ""}</span></td>{del_link}</tr>
|
||||
"""
|
||||
|
|
|
@ -458,7 +458,12 @@ def pdf_basic_page(
|
|||
if title:
|
||||
head = Paragraph(SU(title), StyleSheet["Heading3"])
|
||||
objects = [head] + objects
|
||||
document.build(objects)
|
||||
|
||||
try:
|
||||
document.build(objects)
|
||||
except (ValueError, KeyError, reportlab.platypus.doctemplate.LayoutError) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
|
||||
data = report.getvalue()
|
||||
return data
|
||||
|
||||
|
|
|
@ -335,7 +335,7 @@ class PlacementRunner:
|
|||
|
||||
def _production_pdf(self):
|
||||
pdf_title = "<br>".join(self.desceval)
|
||||
pdf_title += f"""\nDate : {self.evaluation.date_debut.strftime("%d/%m/%Y")
|
||||
pdf_title += f"""\nDate : {self.evaluation.date_debut.strftime(scu.DATE_FMT)
|
||||
if self.evaluation.date_debut else '-'
|
||||
} - Horaire : {self.evaluation.heure_debut()} à {self.evaluation.heure_fin()
|
||||
}"""
|
||||
|
@ -485,7 +485,7 @@ class PlacementRunner:
|
|||
worksheet.append_blank_row()
|
||||
worksheet.append_single_cell_row(desceval, self.styles["titres"])
|
||||
worksheet.append_single_cell_row(
|
||||
f"""Date : {self.evaluation.date_debut.strftime("%d/%m/%Y")
|
||||
f"""Date : {self.evaluation.date_debut.strftime(scu.DATE_FMT)
|
||||
if self.evaluation.date_debut else '-'
|
||||
} - Horaire : {self.evaluation.heure_debut()} à {self.evaluation.heure_fin()
|
||||
}""",
|
||||
|
|
|
@ -517,7 +517,7 @@ def _normalize_apo_fields(infolist):
|
|||
)
|
||||
infos["datefinalisationinscription_str"] = infos[
|
||||
"datefinalisationinscription"
|
||||
].strftime("%d/%m/%Y")
|
||||
].strftime(scu.DATE_FMT)
|
||||
else:
|
||||
infos["datefinalisationinscription"] = None
|
||||
infos["datefinalisationinscription_str"] = ""
|
||||
|
|
|
@ -600,17 +600,6 @@ class BasePreferences:
|
|||
},
|
||||
),
|
||||
# Assiduité
|
||||
(
|
||||
"assi_limit_annee",
|
||||
{
|
||||
"initvalue": 1,
|
||||
"title": "Ne lister que l'assiduité de l'année",
|
||||
"explanation": "Limite l'affichage des listes d'assiduité et de justificatifs à l'année en cours",
|
||||
"input_type": "boolcheckbox",
|
||||
"labels": ["non", "oui"],
|
||||
"category": "assi",
|
||||
},
|
||||
),
|
||||
(
|
||||
"forcer_module",
|
||||
{
|
||||
|
@ -622,16 +611,17 @@ class BasePreferences:
|
|||
"explanation": "toute saisie d'absence doit indiquer le module concerné",
|
||||
},
|
||||
),
|
||||
# (
|
||||
# "forcer_present",
|
||||
# {
|
||||
# "initvalue": 0,
|
||||
# "title": "Forcer l'appel des présents",
|
||||
# "input_type": "boolcheckbox",
|
||||
# "labels": ["non", "oui"],
|
||||
# "category": "assi",
|
||||
# },
|
||||
# ),
|
||||
(
|
||||
"non_present",
|
||||
{
|
||||
"initvalue": 0,
|
||||
"title": "Désactiver la saisie des présences",
|
||||
"input_type": "boolcheckbox",
|
||||
"labels": ["non", "oui"],
|
||||
"category": "assi",
|
||||
"explanation": "Désactive la saisie et l'affichage des présences",
|
||||
},
|
||||
),
|
||||
(
|
||||
"periode_defaut",
|
||||
{
|
||||
|
@ -655,18 +645,18 @@ class BasePreferences:
|
|||
"category": "assi",
|
||||
},
|
||||
),
|
||||
(
|
||||
"assi_etat_defaut",
|
||||
{
|
||||
"explanation": "⚠ non fonctionnel, travaux en cours !",
|
||||
"initvalue": "aucun",
|
||||
"input_type": "menu",
|
||||
"labels": ["aucun", "present", "retard", "absent"],
|
||||
"allowed_values": ["aucun", "present", "retard", "absent"],
|
||||
"title": "Définir l'état par défaut",
|
||||
"category": "assi",
|
||||
},
|
||||
),
|
||||
# (
|
||||
# "assi_etat_defaut",
|
||||
# {
|
||||
# "explanation": "⚠ non fonctionnel, travaux en cours !",
|
||||
# "initvalue": "aucun",
|
||||
# "input_type": "menu",
|
||||
# "labels": ["aucun", "present", "retard", "absent"],
|
||||
# "allowed_values": ["aucun", "present", "retard", "absent"],
|
||||
# "title": "Définir l'état par défaut",
|
||||
# "category": "assi",
|
||||
# },
|
||||
# ),
|
||||
(
|
||||
"non_travail",
|
||||
{
|
||||
|
@ -1601,18 +1591,6 @@ class BasePreferences:
|
|||
"labels": ["non", "oui"],
|
||||
},
|
||||
),
|
||||
(
|
||||
"bul_display_publication",
|
||||
{
|
||||
"initvalue": 1,
|
||||
"title": "Afficher icône indiquant si les bulletins sont publiés",
|
||||
"explanation": "décocher si vous n'avez pas de passerelle ou portail étudiant publiant les bulletins",
|
||||
"input_type": "boolcheckbox",
|
||||
"labels": ["non", "oui"],
|
||||
"category": "bul",
|
||||
"only_global": False,
|
||||
},
|
||||
),
|
||||
# champs des bulletins PDF:
|
||||
(
|
||||
"bul_pdf_title",
|
||||
|
@ -2283,16 +2261,17 @@ class BasePreferences:
|
|||
before_table="<details><summary>{title}</summary>",
|
||||
after_table="</details>",
|
||||
)
|
||||
dest_url = url_for("scolar.index_html", scodoc_dept=g.scodoc_dept)
|
||||
if tf[0] == 0:
|
||||
return "\n".join(H) + tf[1] + html_sco_header.sco_footer()
|
||||
elif tf[0] == -1:
|
||||
return flask.redirect(scu.ScoURL()) # cancel
|
||||
else:
|
||||
for pref in self.prefs_definition:
|
||||
self.prefs[None][pref[0]] = tf[2][pref[0]]
|
||||
self.save()
|
||||
flash("Préférences modifiées")
|
||||
return flask.redirect(scu.ScoURL())
|
||||
if tf[0] == -1:
|
||||
return flask.redirect(dest_url) # cancel
|
||||
#
|
||||
for pref in self.prefs_definition:
|
||||
self.prefs[None][pref[0]] = tf[2][pref[0]]
|
||||
self.save()
|
||||
flash("Préférences modifiées")
|
||||
return flask.redirect(dest_url)
|
||||
|
||||
def build_tf_form(self, categories: list[str] = None, formsemestre_id: int = None):
|
||||
"""Build list of elements for TrivialFormulator.
|
||||
|
@ -2456,10 +2435,12 @@ function set_global_pref(el, pref_name) {
|
|||
before_table="<details><summary>{title}</summary>",
|
||||
after_table="</details>",
|
||||
)
|
||||
dest_url = (
|
||||
scu.NotesURL()
|
||||
+ "/formsemestre_status?formsemestre_id=%s" % self.formsemestre_id
|
||||
dest_url = url_for(
|
||||
"notes.formsemestre_status",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
formsemestre_id=self.formsemestre_id,
|
||||
)
|
||||
|
||||
if tf[0] == 0:
|
||||
return "\n".join(H) + tf[1] + html_sco_header.sco_footer()
|
||||
elif tf[0] == -1:
|
||||
|
@ -2505,7 +2486,9 @@ function set_global_pref(el, pref_name) {
|
|||
request.base_url + "?formsemestre_id=" + str(self.formsemestre_id)
|
||||
)
|
||||
elif destination == "global":
|
||||
return flask.redirect(scu.ScoURL() + "/edit_preferences")
|
||||
return flask.redirect(
|
||||
url_for("scolar.edit_preferences", scodoc_dept=g.scodoc_dept)
|
||||
)
|
||||
|
||||
|
||||
#
|
||||
|
|
|
@ -327,7 +327,7 @@ def feuille_preparation_jury(formsemestre_id):
|
|||
"Préparé par %s le %s sur %s pour %s"
|
||||
% (
|
||||
sco_version.SCONAME,
|
||||
time.strftime("%d/%m/%Y"),
|
||||
time.strftime(scu.DATE_FMT),
|
||||
request.url_root,
|
||||
current_user,
|
||||
)
|
||||
|
|
|
@ -50,7 +50,7 @@ from app.scodoc import sco_bulletins_pdf
|
|||
from app.scodoc import sco_pv_dict
|
||||
from app.scodoc import sco_pdf
|
||||
from app.scodoc import sco_preferences
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
from app.scodoc.sco_exceptions import ScoPDFFormatError, ScoValueError
|
||||
from app.scodoc.sco_cursus_dut import SituationEtudCursus
|
||||
from app.scodoc.sco_pv_templates import CourrierIndividuelTemplate, jury_titres
|
||||
import sco_version
|
||||
|
@ -132,7 +132,11 @@ def pdf_lettres_individuelles(
|
|||
)
|
||||
)
|
||||
|
||||
document.build(objects)
|
||||
try:
|
||||
document.build(objects)
|
||||
except (ValueError, KeyError, reportlab.platypus.doctemplate.LayoutError) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
|
||||
data = report.getvalue()
|
||||
return data
|
||||
|
||||
|
@ -241,13 +245,14 @@ def pdf_lettre_individuelle(sem, decision, etud: Identite, params, signature=Non
|
|||
titre_jury_court = "s"
|
||||
else:
|
||||
titre_jury_court = ""
|
||||
params[
|
||||
"autorisations_txt"
|
||||
] = """Vous êtes autorisé%s à continuer dans le%s semestre%s : <b>%s</b>""" % (
|
||||
etud.e,
|
||||
titre_jury_court,
|
||||
titre_jury_court,
|
||||
decision["autorisations_descr"],
|
||||
params["autorisations_txt"] = (
|
||||
"""Vous êtes autorisé%s à continuer dans le%s semestre%s : <b>%s</b>"""
|
||||
% (
|
||||
etud.e,
|
||||
titre_jury_court,
|
||||
titre_jury_court,
|
||||
decision["autorisations_descr"],
|
||||
)
|
||||
)
|
||||
else:
|
||||
params["autorisations_txt"] = ""
|
||||
|
|
|
@ -126,7 +126,11 @@ def pvjury_pdf(
|
|||
)
|
||||
)
|
||||
|
||||
document.build(objects)
|
||||
try:
|
||||
document.build(objects)
|
||||
except (ValueError, KeyError, reportlab.platypus.doctemplate.LayoutError) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
|
||||
data = report.getvalue()
|
||||
return data
|
||||
|
||||
|
|
|
@ -40,6 +40,7 @@ from operator import itemgetter
|
|||
from flask import url_for, g, request
|
||||
import pydot
|
||||
|
||||
from app import log
|
||||
from app.but import jury_but
|
||||
from app.comp import res_sem
|
||||
from app.comp.res_compat import NotesTableCompat
|
||||
|
@ -47,18 +48,21 @@ from app.models import FormSemestre, ScolarAutorisationInscription
|
|||
from app.models import FormationModalite
|
||||
from app.models.etudiants import Identite
|
||||
|
||||
import app.scodoc.sco_utils as scu
|
||||
from app.scodoc import notesdb as ndb
|
||||
from app.scodoc import html_sco_header
|
||||
from app.scodoc import codes_cursus
|
||||
from app.scodoc import sco_etud
|
||||
from app.scodoc import sco_formsemestre
|
||||
from app.scodoc import sco_formsemestre_inscriptions
|
||||
from app.scodoc import sco_preferences
|
||||
import sco_version
|
||||
from app.scodoc import (
|
||||
codes_cursus,
|
||||
html_sco_header,
|
||||
sco_etud,
|
||||
sco_formsemestre,
|
||||
sco_formsemestre_inscriptions,
|
||||
sco_groups_view,
|
||||
sco_preferences,
|
||||
)
|
||||
from app.scodoc.gen_tables import GenTable
|
||||
from app import log
|
||||
from app.scodoc.codes_cursus import code_semestre_validant
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
from app.scodoc import notesdb as ndb
|
||||
import app.scodoc.sco_utils as scu
|
||||
import sco_version
|
||||
|
||||
MAX_ETUD_IN_DESCR = 20
|
||||
|
||||
|
@ -68,21 +72,25 @@ LEGENDES_CODES_BUT = {
|
|||
}
|
||||
|
||||
|
||||
def formsemestre_etuds_stats(sem: dict, only_primo=False):
|
||||
def formsemestre_etuds_stats(
|
||||
formsemestre: FormSemestre,
|
||||
only_primo=False,
|
||||
groups_infos: sco_groups_view.DisplayedGroupsInfos | None = None,
|
||||
):
|
||||
"""Récupère liste d'etudiants avec etat et decision."""
|
||||
formsemestre: FormSemestre = FormSemestre.query.get_or_404(sem["formsemestre_id"])
|
||||
nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
|
||||
|
||||
T = nt.get_table_moyennes_triees()
|
||||
|
||||
etudids = groups_infos.get_etudids() if groups_infos else set()
|
||||
rows = nt.get_table_moyennes_triees()
|
||||
# Décisions de jury BUT pour les semestres pairs seulement
|
||||
jury_but_mode = (
|
||||
formsemestre.formation.is_apc() and formsemestre.semestre_id % 2 == 0
|
||||
)
|
||||
# Construit liste d'étudiants du semestre avec leur decision
|
||||
etuds = []
|
||||
for t in T:
|
||||
for t in rows:
|
||||
etudid = t[-1]
|
||||
if etudids and etudid not in etudids:
|
||||
continue
|
||||
etudiant = Identite.get_etud(etudid)
|
||||
etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
|
||||
etud["annee_admission"] = etud["annee"] # plus explicite
|
||||
|
@ -96,7 +104,7 @@ def formsemestre_etuds_stats(sem: dict, only_primo=False):
|
|||
etud["codedecision"] = "(nd)" # pas de decision jury
|
||||
# Ajout devenir (autorisations inscriptions), utile pour stats passage
|
||||
aut_list = ScolarAutorisationInscription.query.filter_by(
|
||||
etudid=etudid, origin_formsemestre_id=sem["formsemestre_id"]
|
||||
etudid=etudid, origin_formsemestre_id=formsemestre.id
|
||||
).all()
|
||||
autorisations = [f"S{a.semestre_id}" for a in aut_list]
|
||||
autorisations.sort()
|
||||
|
@ -115,27 +123,27 @@ def formsemestre_etuds_stats(sem: dict, only_primo=False):
|
|||
bs.append(etud["specialite"])
|
||||
etud["bac-specialite"] = " ".join(bs)
|
||||
#
|
||||
if (not only_primo) or is_primo_etud(etud, sem):
|
||||
if (not only_primo) or is_primo_etud(etud, formsemestre):
|
||||
etuds.append(etud)
|
||||
return etuds
|
||||
|
||||
|
||||
def is_primo_etud(etud: dict, sem: dict):
|
||||
def is_primo_etud(etud: dict, formsemestre: FormSemestre):
|
||||
"""Determine si un (filled) etud a été inscrit avant ce semestre.
|
||||
Regarde la liste des semestres dans lesquels l'étudiant est inscrit.
|
||||
Si semestre pair, considère comme primo-entrants ceux qui étaient
|
||||
primo dans le précédent (S_{2n-1}).
|
||||
"""
|
||||
debut_cur = sem["date_debut_iso"]
|
||||
debut_cur_iso = formsemestre.date_debut.isoformat()
|
||||
# si semestre impair et sem. précédent contigu, recule date debut
|
||||
if (
|
||||
(len(etud["sems"]) > 1)
|
||||
and (sem["semestre_id"] % 2 == 0)
|
||||
and (etud["sems"][1]["semestre_id"] == (sem["semestre_id"] - 1))
|
||||
and (formsemestre.semestre_id % 2 == 0)
|
||||
and (etud["sems"][1]["semestre_id"] == (formsemestre.semestre_id - 1))
|
||||
):
|
||||
debut_cur = etud["sems"][1]["date_debut_iso"]
|
||||
debut_cur_iso = etud["sems"][1]["date_debut_iso"]
|
||||
for s in etud["sems"]: # le + recent d'abord
|
||||
if s["date_debut_iso"] < debut_cur:
|
||||
if s["date_debut_iso"] < debut_cur_iso:
|
||||
return False
|
||||
return True
|
||||
|
||||
|
@ -274,22 +282,6 @@ def formsemestre_report(
|
|||
return tab
|
||||
|
||||
|
||||
# def formsemestre_report_bacs(formsemestre_id, fmt='html'):
|
||||
# """
|
||||
# Tableau sur résultats par type de bac
|
||||
# """
|
||||
# sem = sco_formsemestre.get_formsemestre( formsemestre_id)
|
||||
# title = 'Statistiques bacs ' + sem['titreannee']
|
||||
# etuds = formsemestre_etuds_stats(sem)
|
||||
# tab = formsemestre_report(formsemestre_id, etuds,
|
||||
# category='bac', result='codedecision',
|
||||
# category_name='Bac',
|
||||
# title=title)
|
||||
# return tab.make_page(
|
||||
# title = """<h2>Résultats de <a href="formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(titreannee)s</a></h2>""" % sem,
|
||||
# fmt=fmt, page_title = title)
|
||||
|
||||
|
||||
def formsemestre_report_counts(
|
||||
formsemestre_id: int,
|
||||
fmt="html",
|
||||
|
@ -297,6 +289,7 @@ def formsemestre_report_counts(
|
|||
result: str = None,
|
||||
allkeys: bool = False,
|
||||
only_primo: bool = False,
|
||||
group_ids: list[int] = None, # si indiqué, ne prend que ces groupes
|
||||
):
|
||||
"""
|
||||
Tableau comptage avec choix des categories
|
||||
|
@ -307,8 +300,12 @@ def formsemestre_report_counts(
|
|||
si vrai, toutes les valeurs présentes dans les données
|
||||
sinon liste prédéfinie (voir ci-dessous)
|
||||
"""
|
||||
formsemestre: FormSemestre = FormSemestre.query.get_or_404(formsemestre_id)
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
groups_infos = sco_groups_view.DisplayedGroupsInfos(
|
||||
group_ids,
|
||||
formsemestre_id=formsemestre.id,
|
||||
select_all_when_unspecified=True,
|
||||
)
|
||||
# Décisions de jury BUT pour les semestres pairs seulement
|
||||
jury_but_mode = (
|
||||
formsemestre.formation.is_apc() and formsemestre.semestre_id % 2 == 0
|
||||
|
@ -319,7 +316,9 @@ def formsemestre_report_counts(
|
|||
|
||||
category_name = category.capitalize()
|
||||
title = "Comptages " + category_name
|
||||
etuds = formsemestre_etuds_stats(sem, only_primo=only_primo)
|
||||
etuds = formsemestre_etuds_stats(
|
||||
formsemestre, groups_infos=groups_infos, only_primo=only_primo
|
||||
)
|
||||
tab = formsemestre_report(
|
||||
formsemestre_id,
|
||||
etuds,
|
||||
|
@ -329,7 +328,7 @@ def formsemestre_report_counts(
|
|||
title=title,
|
||||
only_primo=only_primo,
|
||||
)
|
||||
if not etuds:
|
||||
if len(formsemestre.inscriptions) == 0:
|
||||
F = ["""<p><em>Aucun étudiant</em></p>"""]
|
||||
else:
|
||||
if allkeys:
|
||||
|
@ -357,9 +356,10 @@ def formsemestre_report_counts(
|
|||
keys += ["nb_rcue_valides", "decision_annee"]
|
||||
keys.sort(key=scu.heterogeneous_sorting_key)
|
||||
F = [
|
||||
"""<form name="f" method="get" action="%s"><p>
|
||||
Colonnes: <select name="result" onchange="document.f.submit()">"""
|
||||
% request.base_url
|
||||
f"""<form id="group_selector" name="f" method="get" action="{request.base_url}">
|
||||
Colonnes:
|
||||
<select name="result" onchange="document.f.submit()">
|
||||
"""
|
||||
]
|
||||
for k in keys:
|
||||
if k == result:
|
||||
|
@ -381,30 +381,38 @@ def formsemestre_report_counts(
|
|||
'<option value="%s" %s>%s</option>'
|
||||
% (k, selected, LEGENDES_CODES_BUT.get(k, k))
|
||||
)
|
||||
F.append("</select>")
|
||||
if only_primo:
|
||||
checked = 'checked="1"'
|
||||
else:
|
||||
checked = ""
|
||||
F.append(
|
||||
'<br><input type="checkbox" name="only_primo" onchange="document.f.submit()" %s>Restreindre aux primo-entrants</input>'
|
||||
% checked
|
||||
f"""
|
||||
</select>
|
||||
<div style="margin-top:12px;">
|
||||
<input type="checkbox" name="only_primo" onchange="document.f.submit()"
|
||||
{'checked' if only_primo else ''}>
|
||||
Restreindre aux primo-entrants</input>
|
||||
<span style="margin: 12px;">
|
||||
Restreindre au(x) groupe(s) :
|
||||
{sco_groups_view.menu_groups_choice(groups_infos, submit_on_change=True)
|
||||
if groups_infos else ''}
|
||||
</span>
|
||||
<input type="hidden" name="formsemestre_id" value="{formsemestre_id}"/>
|
||||
</div>
|
||||
</form>
|
||||
"""
|
||||
)
|
||||
F.append(
|
||||
'<input type="hidden" name="formsemestre_id" value="%s"/>' % formsemestre_id
|
||||
)
|
||||
F.append("</p></form>")
|
||||
|
||||
t = tab.make_page(
|
||||
title="""<h2 class="formsemestre">Comptes croisés</h2>""",
|
||||
tableau = tab.make_page(
|
||||
fmt=fmt,
|
||||
title="""<h2 class="formsemestre">Comptes croisés</h2>""",
|
||||
with_html_headers=False,
|
||||
)
|
||||
if fmt != "html":
|
||||
return t
|
||||
return tableau
|
||||
H = [
|
||||
html_sco_header.sco_header(page_title=title),
|
||||
t,
|
||||
html_sco_header.sco_header(
|
||||
cssstyles=sco_groups_view.CSSSTYLES,
|
||||
javascripts=sco_groups_view.JAVASCRIPTS,
|
||||
page_title=title,
|
||||
),
|
||||
tableau,
|
||||
"\n".join(F),
|
||||
"""<p class="help">Le tableau affiche le nombre d'étudiants de ce semestre dans chacun
|
||||
des cas choisis: à l'aide des deux menus, vous pouvez choisir les catégories utilisées
|
||||
|
@ -418,7 +426,8 @@ def formsemestre_report_counts(
|
|||
|
||||
# --------------------------------------------------------------------------
|
||||
def table_suivi_cohorte(
|
||||
formsemestre_id,
|
||||
formsemestre: FormSemestre,
|
||||
groups_infos,
|
||||
percent=False,
|
||||
bac="", # selection sur type de bac
|
||||
bacspecialite="",
|
||||
|
@ -441,9 +450,8 @@ def table_suivi_cohorte(
|
|||
Determination des dates: on regroupe les semestres commençant à des dates proches
|
||||
|
||||
"""
|
||||
sem = sco_formsemestre.get_formsemestre(
|
||||
formsemestre_id
|
||||
) # sem est le semestre origine
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre.id)
|
||||
# sem est le semestre origine
|
||||
t0 = time.time()
|
||||
|
||||
def logt(op):
|
||||
|
@ -452,12 +460,12 @@ def table_suivi_cohorte(
|
|||
|
||||
logt("table_suivi_cohorte: start")
|
||||
# 1-- Liste des semestres posterieurs dans lesquels ont été les etudiants de sem
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
|
||||
etudids = nt.get_etudids()
|
||||
|
||||
etudids_inscrits = {ins.etudid for ins in formsemestre.inscriptions}
|
||||
etudids_groups = groups_infos.get_etudids()
|
||||
etudids = etudids_inscrits.intersection(etudids_groups)
|
||||
logt("A: orig etuds set")
|
||||
S = {formsemestre_id: sem} # ensemble de formsemestre_id
|
||||
S = {formsemestre.id: sem} # ensemble de formsemestre_id
|
||||
orig_set = set() # ensemble d'etudid du semestre d'origine
|
||||
bacs = set()
|
||||
bacspecialites = set()
|
||||
|
@ -479,7 +487,7 @@ def table_suivi_cohorte(
|
|||
)
|
||||
and (not civilite or (civilite == etud["civilite"]))
|
||||
and (not statut or (statut == etud["statut"]))
|
||||
and (not only_primo or is_primo_etud(etud, sem))
|
||||
and (not only_primo or is_primo_etud(etud, formsemestre))
|
||||
):
|
||||
orig_set.add(etudid)
|
||||
# semestres suivants:
|
||||
|
@ -524,17 +532,15 @@ def table_suivi_cohorte(
|
|||
s["nb_dipl"] = nb_dipl
|
||||
|
||||
# 3-- Regroupe les semestres par date de debut
|
||||
P = [] # liste de periodsem
|
||||
|
||||
class PeriodSem:
|
||||
pass
|
||||
def __init__(self, datedebut: datetime.datetime, sems: list[dict]):
|
||||
self.datedebut = datedebut
|
||||
self.sems = sems
|
||||
|
||||
# semestre de depart:
|
||||
porigin = PeriodSem()
|
||||
d, m, y = [int(x) for x in sem["date_debut"].split("/")]
|
||||
porigin.datedebut = datetime.datetime(y, m, d)
|
||||
porigin.sems = [sem]
|
||||
|
||||
porigin = PeriodSem(datetime.datetime(y, m, d), [sem])
|
||||
P = [] # liste de periodsem
|
||||
#
|
||||
tolerance = datetime.timedelta(days=45)
|
||||
for s in sems:
|
||||
|
@ -545,9 +551,7 @@ def table_suivi_cohorte(
|
|||
merged = True
|
||||
break
|
||||
if not merged:
|
||||
p = PeriodSem()
|
||||
p.datedebut = s["date_debut_dt"]
|
||||
p.sems = [s]
|
||||
p = PeriodSem(s["date_debut_dt"], [s])
|
||||
P.append(p)
|
||||
|
||||
# 4-- regroupe par indice de semestre S_i
|
||||
|
@ -602,7 +606,7 @@ def table_suivi_cohorte(
|
|||
L.append(d)
|
||||
# Compte nb de démissions et de ré-orientation par période
|
||||
logt("D: cout dems reos")
|
||||
sem["dems"], sem["reos"] = _count_dem_reo(formsemestre_id, sem["members"])
|
||||
sem["dems"], sem["reos"] = _count_dem_reo(formsemestre.id, sem["members"])
|
||||
for p in P:
|
||||
p.dems = set()
|
||||
p.reos = set()
|
||||
|
@ -666,8 +670,8 @@ def table_suivi_cohorte(
|
|||
L.append(l)
|
||||
|
||||
columns_ids = [p.datedebut for p in P]
|
||||
titles = dict([(p.datedebut, p.datedebut.strftime("%d/%m/%y")) for p in P])
|
||||
titles[porigin.datedebut] = porigin.datedebut.strftime("%d/%m/%y")
|
||||
titles = dict([(p.datedebut, p.datedebut.strftime(scu.DATE_FMT)) for p in P])
|
||||
titles[porigin.datedebut] = porigin.datedebut.strftime(scu.DATE_FMT)
|
||||
if percent:
|
||||
pp = "(en % de la population initiale) "
|
||||
titles["row_title"] = "%"
|
||||
|
@ -703,7 +707,7 @@ def table_suivi_cohorte(
|
|||
caption="Suivi cohorte " + pp + sem["titreannee"] + dbac,
|
||||
page_title="Suivi cohorte " + sem["titreannee"],
|
||||
html_class="table_cohorte",
|
||||
preferences=sco_preferences.SemPreferences(formsemestre_id),
|
||||
preferences=sco_preferences.SemPreferences(formsemestre.id),
|
||||
)
|
||||
# Explication: liste des semestres associés à chaque date
|
||||
if not P:
|
||||
|
@ -713,13 +717,10 @@ def table_suivi_cohorte(
|
|||
else:
|
||||
expl = ["<h3>Semestres associés à chaque date:</h3><ul>"]
|
||||
for p in P:
|
||||
expl.append("<li><b>%s</b>:" % p.datedebut.strftime("%d/%m/%y"))
|
||||
expl.append(f"""<li><b>{p.datedebut.strftime(scu.DATE_FMT)}</b>:""")
|
||||
ls = []
|
||||
for s in p.sems:
|
||||
ls.append(
|
||||
'<a href="formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(titreannee)s</a>'
|
||||
% s
|
||||
)
|
||||
ls.append(formsemestre.html_link_status())
|
||||
expl.append(", ".join(ls) + "</li>")
|
||||
expl.append("</ul>")
|
||||
return (
|
||||
|
@ -737,6 +738,7 @@ def table_suivi_cohorte(
|
|||
def formsemestre_suivi_cohorte(
|
||||
formsemestre_id,
|
||||
fmt="html",
|
||||
group_ids: list[int] = None, # si indiqué, ne prend que ces groupes
|
||||
percent=1,
|
||||
bac="",
|
||||
bacspecialite="",
|
||||
|
@ -747,9 +749,19 @@ def formsemestre_suivi_cohorte(
|
|||
only_primo=False,
|
||||
) -> str:
|
||||
"""Affiche suivi cohortes par numero de semestre"""
|
||||
annee_bac = str(annee_bac or "")
|
||||
annee_admission = str(annee_admission or "")
|
||||
percent = int(percent)
|
||||
try:
|
||||
annee_bac = str(annee_bac or "")
|
||||
annee_admission = str(annee_admission or "")
|
||||
percent = int(percent)
|
||||
except ValueError as exc:
|
||||
raise ScoValueError("formsemestre_suivi_cohorte: argument invalide") from exc
|
||||
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
groups_infos = sco_groups_view.DisplayedGroupsInfos(
|
||||
group_ids,
|
||||
formsemestre_id=formsemestre.id,
|
||||
select_all_when_unspecified=True,
|
||||
)
|
||||
(
|
||||
tab,
|
||||
expl,
|
||||
|
@ -760,7 +772,8 @@ def formsemestre_suivi_cohorte(
|
|||
civilites,
|
||||
statuts,
|
||||
) = table_suivi_cohorte(
|
||||
formsemestre_id,
|
||||
formsemestre,
|
||||
groups_infos=groups_infos,
|
||||
percent=percent,
|
||||
bac=bac,
|
||||
bacspecialite=bacspecialite,
|
||||
|
@ -772,7 +785,7 @@ def formsemestre_suivi_cohorte(
|
|||
)
|
||||
tab.base_url = (
|
||||
"%s?formsemestre_id=%s&percent=%s&bac=%s&bacspecialite=%s&civilite=%s"
|
||||
% (request.base_url, formsemestre_id, percent, bac, bacspecialite, civilite)
|
||||
% (request.base_url, formsemestre.id, percent, bac, bacspecialite, civilite)
|
||||
)
|
||||
if only_primo:
|
||||
tab.base_url += "&only_primo=on"
|
||||
|
@ -783,25 +796,29 @@ def formsemestre_suivi_cohorte(
|
|||
base_url = request.base_url
|
||||
burl = "%s?formsemestre_id=%s&bac=%s&bacspecialite=%s&civilite=%s&statut=%s" % (
|
||||
base_url,
|
||||
formsemestre_id,
|
||||
formsemestre.id,
|
||||
bac,
|
||||
bacspecialite,
|
||||
civilite,
|
||||
statut,
|
||||
)
|
||||
if percent:
|
||||
pplink = '<p><a href="%s&percent=0">Afficher les résultats bruts</a></p>' % burl
|
||||
pplink = f"""<p><a class="stdlink"
|
||||
href="{burl}&percent=0">Afficher les résultats bruts</a></p>"""
|
||||
else:
|
||||
pplink = (
|
||||
'<p><a href="%s&percent=1">Afficher les résultats en pourcentages</a></p>'
|
||||
% burl
|
||||
)
|
||||
pplink = f"""<p><a class="stdlink"
|
||||
href="{burl}&percent=1">Afficher les résultats en pourcentages</a></p>"""
|
||||
|
||||
H = [
|
||||
html_sco_header.sco_header(page_title=tab.page_title),
|
||||
html_sco_header.sco_header(
|
||||
cssstyles=sco_groups_view.CSSSTYLES,
|
||||
javascripts=sco_groups_view.JAVASCRIPTS,
|
||||
page_title=tab.page_title,
|
||||
),
|
||||
"""<h2 class="formsemestre">Suivi cohorte: devenir des étudiants de ce semestre</h2>""",
|
||||
_gen_form_selectetuds(
|
||||
formsemestre_id,
|
||||
formsemestre.id,
|
||||
groups_infos=groups_infos,
|
||||
only_primo=only_primo,
|
||||
bac=bac,
|
||||
bacspecialite=bacspecialite,
|
||||
|
@ -854,6 +871,7 @@ def _gen_form_selectetuds(
|
|||
annee_admissions=None,
|
||||
civilites=None,
|
||||
statuts=None,
|
||||
groups_infos: sco_groups_view.DisplayedGroupsInfos = None,
|
||||
):
|
||||
"""HTML form pour choix criteres selection etudiants"""
|
||||
annee_bacs = annee_bacs or []
|
||||
|
@ -877,9 +895,10 @@ def _gen_form_selectetuds(
|
|||
else:
|
||||
selected = 'selected="selected"'
|
||||
F = [
|
||||
f"""<form id="f" method="get" action="{request.base_url}">
|
||||
<p>Bac: <select name="bac" onchange="javascript: submit(this);">
|
||||
<option value="" {selected}>tous</option>
|
||||
f"""<form id="group_selector" name="f" method="get" action="{request.base_url}">
|
||||
<div>Bac:
|
||||
<select name="bac" onchange="javascript: submit(this);">
|
||||
<option value="" {selected}>tous</option>
|
||||
"""
|
||||
]
|
||||
for b in bacs:
|
||||
|
@ -894,7 +913,8 @@ def _gen_form_selectetuds(
|
|||
else:
|
||||
selected = 'selected="selected"'
|
||||
F.append(
|
||||
f""" Bac/Specialité: <select name="bacspecialite" onchange="javascript: submit(this);">
|
||||
f""" Bac/Specialité:
|
||||
<select name="bacspecialite" onchange="javascript: submit(this);">
|
||||
<option value="" {selected}>tous</option>
|
||||
"""
|
||||
)
|
||||
|
@ -938,17 +958,24 @@ def _gen_form_selectetuds(
|
|||
else:
|
||||
selected = ""
|
||||
F.append(f'<option value="{b}" {selected}>{b}</option>')
|
||||
F.append("</select>")
|
||||
|
||||
F.append(
|
||||
f"""<br>
|
||||
<input type="checkbox" name="only_primo"
|
||||
onchange="javascript: submit(this);"
|
||||
{'checked="1"' if only_primo else ""}/>Restreindre aux primo-entrants
|
||||
<input type="hidden" name="formsemestre_id" value="{formsemestre_id}"/>
|
||||
<input type="hidden" name="percent" value="{percent}"/>
|
||||
f"""
|
||||
</select>
|
||||
<div style="margin-top:12px;">
|
||||
<input type="checkbox" name="only_primo"
|
||||
onchange="javascript: submit(this);"
|
||||
{'checked="1"' if only_primo else ""}/>Restreindre aux primo-entrants
|
||||
|
||||
</p>
|
||||
<span style="margin: 12px;">
|
||||
Restreindre au(x) groupe(s) :
|
||||
{sco_groups_view.menu_groups_choice(groups_infos, submit_on_change=True)
|
||||
if groups_infos else ''}
|
||||
</span>
|
||||
<input type="hidden" name="formsemestre_id" value="{formsemestre_id}"/>
|
||||
<input type="hidden" name="percent" value="{percent}"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
"""
|
||||
)
|
||||
|
@ -1002,17 +1029,6 @@ def _count_dem_reo(formsemestre_id, etudids):
|
|||
return dems, reos
|
||||
|
||||
|
||||
"""OLDGEA:
|
||||
27s pour S1 F.I. classique Semestre 1 2006-2007
|
||||
B 2.3s
|
||||
C 5.6s
|
||||
D 5.9s
|
||||
Z 27s => cache des semestres pour nt
|
||||
|
||||
à chaud: 3s
|
||||
B: etuds sets: 2.4s => lent: N x getEtudInfo (non caché)
|
||||
"""
|
||||
|
||||
EXP_LIC = re.compile(r"licence", re.I)
|
||||
EXP_LPRO = re.compile(r"professionnelle", re.I)
|
||||
|
||||
|
@ -1125,6 +1141,7 @@ def get_code_cursus_etud(
|
|||
|
||||
def tsp_etud_list(
|
||||
formsemestre_id,
|
||||
groups_infos: sco_groups_view.DisplayedGroupsInfos | None = None,
|
||||
only_primo=False,
|
||||
bac="", # selection sur type de bac
|
||||
bacspecialite="",
|
||||
|
@ -1136,11 +1153,13 @@ def tsp_etud_list(
|
|||
"""Liste des etuds a considerer dans table suivi cursus
|
||||
ramene aussi ensembles des bacs, genres, statuts de (tous) les etudiants
|
||||
"""
|
||||
# log('tsp_etud_list(%s, bac="%s")' % (formsemestre_id,bac))
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
nt: NotesTableCompat = res_sem.load_formsemestre_results(formsemestre)
|
||||
etudids = nt.get_etudids()
|
||||
etudids_inscrits = {ins.etudid for ins in formsemestre.inscriptions}
|
||||
if groups_infos:
|
||||
etudids_groups = groups_infos.get_etudids()
|
||||
etudids = etudids_inscrits.intersection(etudids_groups)
|
||||
else:
|
||||
etudids = etudids_inscrits
|
||||
etuds = []
|
||||
bacs = set()
|
||||
bacspecialites = set()
|
||||
|
@ -1162,7 +1181,7 @@ def tsp_etud_list(
|
|||
)
|
||||
and (not civilite or (civilite == etud["civilite"]))
|
||||
and (not statut or (statut == etud["statut"]))
|
||||
and (not only_primo or is_primo_etud(etud, sem))
|
||||
and (not only_primo or is_primo_etud(etud, formsemestre))
|
||||
):
|
||||
etuds.append(etud)
|
||||
|
||||
|
@ -1173,7 +1192,6 @@ def tsp_etud_list(
|
|||
civilites.add(etud["civilite"])
|
||||
if etud["statut"]: # ne montre pas les statuts non renseignés
|
||||
statuts.add(etud["statut"])
|
||||
# log('tsp_etud_list: %s etuds' % len(etuds))
|
||||
return etuds, bacs, bacspecialites, annee_bacs, annee_admissions, civilites, statuts
|
||||
|
||||
|
||||
|
@ -1290,31 +1308,30 @@ def table_suivi_cursus(formsemestre_id, only_primo=False, grouped_parcours=True)
|
|||
return tab
|
||||
|
||||
|
||||
def tsp_form_primo_group(only_primo, no_grouping, formsemestre_id, fmt):
|
||||
"""Element de formulaire pour choisir si restriction aux primos entrants et groupement par lycees"""
|
||||
F = ["""<form name="f" method="get" action="%s">""" % request.base_url]
|
||||
if only_primo:
|
||||
checked = 'checked="1"'
|
||||
else:
|
||||
checked = ""
|
||||
F.append(
|
||||
'<input type="checkbox" name="only_primo" onchange="document.f.submit()" %s>Restreindre aux primo-entrants</input>'
|
||||
% checked
|
||||
)
|
||||
if no_grouping:
|
||||
checked = 'checked="1"'
|
||||
else:
|
||||
checked = ""
|
||||
F.append(
|
||||
'<input type="checkbox" name="no_grouping" onchange="document.f.submit()" %s>Lister chaque étudiant</input>'
|
||||
% checked
|
||||
)
|
||||
F.append(
|
||||
'<input type="hidden" name="formsemestre_id" value="%s"/>' % formsemestre_id
|
||||
)
|
||||
F.append('<input type="hidden" name="fmt" value="%s"/>' % fmt)
|
||||
F.append("""</form>""")
|
||||
return "\n".join(F)
|
||||
def tsp_form_primo_group(
|
||||
only_primo, no_grouping, formsemestre_id, fmt, groups_infos=None
|
||||
) -> str:
|
||||
"""Element de formulaire pour choisir si restriction aux primos entrants,
|
||||
groupement par lycees et groupes
|
||||
"""
|
||||
primo_checked = 'checked="1"' if only_primo else ""
|
||||
no_grouping_checked = 'checked="1"' if no_grouping else ""
|
||||
return f"""
|
||||
<form id="group_selector" name="f" method="get" action="{request.base_url}">
|
||||
<input type="checkbox" name="only_primo"
|
||||
onchange="document.f.submit()" {primo_checked}>Restreindre aux primo-entrants</input>
|
||||
<input type="checkbox" name="no_grouping" onchange="document.f.submit()"
|
||||
{no_grouping_checked}>Lister chaque étudiant</input>
|
||||
|
||||
<span style="margin: 12px;">
|
||||
Restreindre au(x) groupe(s) :
|
||||
{sco_groups_view.menu_groups_choice(groups_infos, submit_on_change=True)
|
||||
if groups_infos else ''}
|
||||
</span>
|
||||
<input type="hidden" name="formsemestre_id" value="{formsemestre_id}"/>
|
||||
<input type="hidden" name="fmt" value="{fmt}"/>
|
||||
</form>
|
||||
"""
|
||||
|
||||
|
||||
def formsemestre_suivi_cursus(
|
||||
|
@ -1337,7 +1354,11 @@ def formsemestre_suivi_cursus(
|
|||
t = tab.make_page(fmt=fmt, with_html_headers=False)
|
||||
if fmt != "html":
|
||||
return t
|
||||
F = [tsp_form_primo_group(only_primo, no_grouping, formsemestre_id, fmt)]
|
||||
F = [
|
||||
tsp_form_primo_group(
|
||||
only_primo, no_grouping, formsemestre_id, fmt, groups_infos=None
|
||||
)
|
||||
]
|
||||
|
||||
H = [
|
||||
html_sco_header.sco_header(
|
||||
|
@ -1356,6 +1377,7 @@ def formsemestre_suivi_cursus(
|
|||
# -------------
|
||||
def graph_cursus(
|
||||
formsemestre_id,
|
||||
groups_infos: sco_groups_view.DisplayedGroupsInfos | None = None,
|
||||
fmt="svg",
|
||||
only_primo=False,
|
||||
bac="", # selection sur type de bac
|
||||
|
@ -1376,6 +1398,7 @@ def graph_cursus(
|
|||
statuts,
|
||||
) = tsp_etud_list(
|
||||
formsemestre_id,
|
||||
groups_infos=groups_infos,
|
||||
only_primo=only_primo,
|
||||
bac=bac,
|
||||
bacspecialite=bacspecialite,
|
||||
|
@ -1512,6 +1535,9 @@ def graph_cursus(
|
|||
# semestre de depart en vert
|
||||
n = g.get_node("SEM" + str(formsemestre_id))[0]
|
||||
n.set_color("green")
|
||||
n.set_style("filled")
|
||||
n.set_fillcolor("lightgreen")
|
||||
n.set_penwidth(2.0)
|
||||
# demissions en rouge, octagonal
|
||||
for nid in dem_nodes.values():
|
||||
n = g.get_node(nid)[0]
|
||||
|
@ -1606,6 +1632,7 @@ def graph_cursus(
|
|||
|
||||
def formsemestre_graph_cursus(
|
||||
formsemestre_id,
|
||||
group_ids: list[int] = None, # si indiqué, ne prend que ces groupes
|
||||
fmt="html",
|
||||
only_primo=False,
|
||||
bac="", # selection sur type de bac
|
||||
|
@ -1619,7 +1646,12 @@ def formsemestre_graph_cursus(
|
|||
"""Graphe suivi cohortes"""
|
||||
annee_bac = str(annee_bac or "")
|
||||
annee_admission = str(annee_admission or "")
|
||||
# log("formsemestre_graph_cursus")
|
||||
formsemestre = FormSemestre.get_formsemestre(formsemestre_id)
|
||||
groups_infos = sco_groups_view.DisplayedGroupsInfos(
|
||||
group_ids,
|
||||
formsemestre_id=formsemestre.id,
|
||||
select_all_when_unspecified=True,
|
||||
)
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
if fmt == "pdf":
|
||||
(
|
||||
|
@ -1633,6 +1665,7 @@ def formsemestre_graph_cursus(
|
|||
statuts,
|
||||
) = graph_cursus(
|
||||
formsemestre_id,
|
||||
groups_infos=groups_infos,
|
||||
fmt="pdf",
|
||||
only_primo=only_primo,
|
||||
bac=bac,
|
||||
|
@ -1657,6 +1690,7 @@ def formsemestre_graph_cursus(
|
|||
statuts,
|
||||
) = graph_cursus(
|
||||
formsemestre_id,
|
||||
groups_infos=groups_infos,
|
||||
fmt="png",
|
||||
only_primo=only_primo,
|
||||
bac=bac,
|
||||
|
@ -1695,6 +1729,7 @@ def formsemestre_graph_cursus(
|
|||
statuts,
|
||||
) = graph_cursus(
|
||||
formsemestre_id,
|
||||
groups_infos=groups_infos,
|
||||
only_primo=only_primo,
|
||||
bac=bac,
|
||||
bacspecialite=bacspecialite,
|
||||
|
@ -1706,14 +1741,17 @@ def formsemestre_graph_cursus(
|
|||
|
||||
H = [
|
||||
html_sco_header.sco_header(
|
||||
cssstyles=sco_groups_view.CSSSTYLES,
|
||||
javascripts=sco_groups_view.JAVASCRIPTS,
|
||||
page_title="Graphe cursus de %(titreannee)s" % sem,
|
||||
no_side_bar=True,
|
||||
),
|
||||
"""<h2 class="formsemestre">Cursus des étudiants de ce semestre</h2>""",
|
||||
doc,
|
||||
"<p>%d étudiants sélectionnés</p>" % len(etuds),
|
||||
f"<p>{len(etuds)} étudiants sélectionnés</p>",
|
||||
_gen_form_selectetuds(
|
||||
formsemestre_id,
|
||||
groups_infos=groups_infos,
|
||||
only_primo=only_primo,
|
||||
bac=bac,
|
||||
bacspecialite=bacspecialite,
|
||||
|
@ -1743,6 +1781,10 @@ def formsemestre_graph_cursus(
|
|||
passant d'un semestre à l'autre (s'il y en a moins de {MAX_ETUD_IN_DESCR}, vous
|
||||
pouvez visualiser leurs noms en passant le curseur sur le chiffre).
|
||||
</p>
|
||||
<p class="help">
|
||||
Le menu <em>Restreindre au(x) groupe(s)</em> permet de restreindre l'étude aux
|
||||
étudiants appartenant aux groupes indiqués <em>dans le semestre d'origine</em>.
|
||||
</p>
|
||||
""",
|
||||
html_sco_header.sco_footer(),
|
||||
]
|
||||
|
|
|
@ -51,7 +51,24 @@ SCO_ROLES_DEFAULTS = {
|
|||
p.UsersView,
|
||||
p.ViewEtudData,
|
||||
),
|
||||
# Rôles pour l'application relations entreprises
|
||||
# LecteurAPI peut utiliser l'API en lecture
|
||||
"LecteurAPI": (p.ScoView,),
|
||||
"Observateur": (p.Observateur,),
|
||||
# RespPE est le responsable poursuites d'études
|
||||
# il peut ajouter des tags sur les formations:
|
||||
# (doit avoir un rôle Ens en plus !)
|
||||
"RespPe": (p.EditFormationTags,),
|
||||
# Super Admin est un root: création/suppression de départements
|
||||
# _tous_ les droits
|
||||
# Afin d'avoir tous les droits, il ne doit pas être asscoié à un département
|
||||
"SuperAdmin": p.ALL_PERMISSIONS,
|
||||
}
|
||||
|
||||
# Rôles pour l'application relations entreprises
|
||||
# séparés pour pouvoir les réinitialiser lors de l'activation du module Entreprises
|
||||
# Note: Admin (chef de dept n'a par défaut aucun rôle lié à ce module)
|
||||
|
||||
SCO_ROLES_ENTREPRISES_DEFAULT = {
|
||||
# ObservateurEntreprise est un observateur de l'application entreprise
|
||||
"ObservateurEntreprise": (p.RelationsEntrepView,),
|
||||
# UtilisateurEntreprise est un utilisateur de l'application entreprise (droit de modification)
|
||||
|
@ -70,19 +87,10 @@ SCO_ROLES_DEFAULTS = {
|
|||
p.RelationsEntrepValidate,
|
||||
p.RelationsEntrepViewCorrs,
|
||||
),
|
||||
# LecteurAPI peut utiliser l'API en lecture
|
||||
"LecteurAPI": (p.ScoView,),
|
||||
"Observateur": (p.Observateur,),
|
||||
# RespPE est le responsable poursuites d'études
|
||||
# il peut ajouter des tags sur les formations:
|
||||
# (doit avoir un rôle Ens en plus !)
|
||||
"RespPe": (p.EditFormationTags,),
|
||||
# Super Admin est un root: création/suppression de départements
|
||||
# _tous_ les droits
|
||||
# Afin d'avoir tous les droits, il ne doit pas être asscoié à un département
|
||||
"SuperAdmin": p.ALL_PERMISSIONS,
|
||||
}
|
||||
|
||||
SCO_ROLES_DEFAULTS.update(SCO_ROLES_ENTREPRISES_DEFAULT)
|
||||
|
||||
# Les rôles accessibles via la page d'admin utilisateurs
|
||||
# - associés à un département:
|
||||
ROLES_ATTRIBUABLES_DEPT = ("Ens", "Secr", "Admin", "RespPe")
|
||||
|
|
|
@ -892,7 +892,7 @@ def feuille_saisie_notes(evaluation_id, group_ids=[]):
|
|||
eval_name = f"{evaluation.moduleimpl.module.code}-{indication_date}"
|
||||
|
||||
date_str = (
|
||||
f"""du {evaluation.date_debut.strftime("%d/%m/%Y")}"""
|
||||
f"""du {evaluation.date_debut.strftime(scu.DATE_FMT)}"""
|
||||
if evaluation.date_debut
|
||||
else "(sans date)"
|
||||
)
|
||||
|
|
|
@ -47,12 +47,11 @@ from app import db, log
|
|||
from app.models import Identite
|
||||
import app.scodoc.sco_utils as scu
|
||||
from app.scodoc.TrivialFormulator import TrivialFormulator
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
from app.scodoc.sco_exceptions import ScoPDFFormatError, ScoValueError
|
||||
from app.scodoc.sco_pdf import SU
|
||||
from app.scodoc import html_sco_header
|
||||
from app.scodoc import htmlutils
|
||||
from app.scodoc import sco_import_etuds
|
||||
from app.scodoc import sco_etud
|
||||
from app.scodoc import sco_excel
|
||||
from app.scodoc import sco_groups_view
|
||||
from app.scodoc import sco_pdf
|
||||
|
@ -246,8 +245,9 @@ def _trombino_zip(groups_infos):
|
|||
|
||||
|
||||
# Copy photos from portal to ScoDoc
|
||||
def trombino_copy_photos(group_ids=[], dialog_confirmed=False):
|
||||
def trombino_copy_photos(group_ids=None, dialog_confirmed=False):
|
||||
"Copy photos from portal to ScoDoc (overwriting local copy)"
|
||||
group_ids = [] if group_ids is None else group_ids
|
||||
groups_infos = sco_groups_view.DisplayedGroupsInfos(group_ids)
|
||||
back_url = "groups_view?%s&curtab=tab-photos" % groups_infos.groups_query_args
|
||||
|
||||
|
@ -387,7 +387,10 @@ def _trombino_pdf(groups_infos):
|
|||
preferences=sco_preferences.SemPreferences(sem["formsemestre_id"]),
|
||||
)
|
||||
)
|
||||
document.build(objects)
|
||||
try:
|
||||
document.build(objects)
|
||||
except (ValueError, KeyError, reportlab.platypus.doctemplate.LayoutError) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
report.seek(0)
|
||||
return send_file(
|
||||
report,
|
||||
|
@ -464,7 +467,10 @@ def _listeappel_photos_pdf(groups_infos):
|
|||
preferences=sco_preferences.SemPreferences(sem["formsemestre_id"]),
|
||||
)
|
||||
)
|
||||
document.build(objects)
|
||||
try:
|
||||
document.build(objects)
|
||||
except (ValueError, KeyError, reportlab.platypus.doctemplate.LayoutError) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
data = report.getvalue()
|
||||
|
||||
return scu.sendPDFFile(data, filename)
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
"""
|
||||
|
||||
import io
|
||||
|
||||
import reportlab
|
||||
from reportlab.lib import colors
|
||||
from reportlab.lib.colors import black
|
||||
from reportlab.lib.pagesizes import A4, A3
|
||||
|
@ -277,10 +277,12 @@ def pdf_trombino_tours(
|
|||
preferences=sco_preferences.SemPreferences(),
|
||||
)
|
||||
)
|
||||
|
||||
try:
|
||||
document.build(objects)
|
||||
except (ValueError, KeyError) as exc:
|
||||
except (ValueError, KeyError, reportlab.platypus.doctemplate.LayoutError) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
|
||||
data = report.getvalue()
|
||||
|
||||
return scu.sendPDFFile(data, filename)
|
||||
|
@ -470,7 +472,10 @@ def pdf_feuille_releve_absences(
|
|||
preferences=sco_preferences.SemPreferences(),
|
||||
)
|
||||
)
|
||||
document.build(objects)
|
||||
try:
|
||||
document.build(objects)
|
||||
except (ValueError, KeyError, reportlab.platypus.doctemplate.LayoutError) as exc:
|
||||
raise ScoPDFFormatError(str(exc)) from exc
|
||||
data = report.getvalue()
|
||||
|
||||
return scu.sendPDFFile(data, filename)
|
||||
|
|
|
@ -109,6 +109,38 @@ ETATS_INSCRIPTION = {
|
|||
}
|
||||
|
||||
|
||||
def convert_fr_date(date_str: str, allow_iso=True) -> datetime.datetime:
|
||||
"""Converti une date saisie par un humain français avant 2070
|
||||
en un objet datetime.
|
||||
12/2/1972 => 1972-02-12, 12/2/72 => 1972-02-12, mais 12/2/24 => 2024-02-12
|
||||
Le pivot est 70.
|
||||
ScoValueError si date invalide.
|
||||
"""
|
||||
try:
|
||||
return datetime.datetime.strptime(date_str, DATE_FMT)
|
||||
except ValueError:
|
||||
# Try to add century ?
|
||||
m = re.match(r"^(\d{1,2})/(\d{1,2})/(\d\d)$", date_str)
|
||||
if m:
|
||||
year = int(m.group(3))
|
||||
if year < 70:
|
||||
year += 2000
|
||||
else:
|
||||
year += 1900
|
||||
try:
|
||||
return datetime.datetime.strptime(
|
||||
f"{m.group(1)}/{m.group(2)}/{year}", DATE_FMT
|
||||
)
|
||||
except ValueError:
|
||||
pass
|
||||
if allow_iso:
|
||||
try:
|
||||
return datetime.datetime.fromisoformat(date_str)
|
||||
except ValueError as exc:
|
||||
raise ScoValueError("Date (j/m/a or ISO) invalide") from exc
|
||||
raise ScoValueError("Date (j/m/a) invalide")
|
||||
|
||||
|
||||
def print_progress_bar(
|
||||
iteration,
|
||||
total,
|
||||
|
@ -170,6 +202,7 @@ class BiDirectionalEnum(Enum):
|
|||
"""Permet la recherche inverse d'un enum
|
||||
Condition : les clés et les valeurs doivent être uniques
|
||||
les clés doivent être en MAJUSCULES
|
||||
=> (respect de la convention des constantes)
|
||||
"""
|
||||
|
||||
@classmethod
|
||||
|
@ -181,10 +214,17 @@ class BiDirectionalEnum(Enum):
|
|||
return attr.upper() in cls._member_names_
|
||||
|
||||
@classmethod
|
||||
def all(cls, keys=True):
|
||||
"""Retourne toutes les clés de l'enum"""
|
||||
# pylint: disable-next=no-member
|
||||
return cls._member_names_ if keys else list(cls._value2member_map_.keys())
|
||||
def all(cls, keys=True) -> tuple[str | object]:
|
||||
"""Retourne toutes les clés de l'enum (en minuscules) ou les valeurs"""
|
||||
return (
|
||||
tuple(
|
||||
k.lower()
|
||||
# pylint: disable-next=no-member
|
||||
for k in cls._member_names_
|
||||
) # renvoie les clés en minuscules
|
||||
if keys
|
||||
else tuple(cls._value2member_map_.keys()) # renvoie les valeurs
|
||||
)
|
||||
|
||||
@classmethod
|
||||
def get(cls, attr: str, default: any = None):
|
||||
|
@ -510,6 +550,11 @@ MONTH_NAMES = (
|
|||
)
|
||||
DAY_NAMES = ("lundi", "mardi", "mercredi", "jeudi", "vendredi", "samedi", "dimanche")
|
||||
|
||||
TIME_FMT = "%H:%M" # affichage des heures
|
||||
DATE_FMT = "%d/%m/%Y" # affichage des dates
|
||||
DATEATIME_FMT = DATE_FMT + " à " + TIME_FMT
|
||||
DATETIME_FMT = DATE_FMT + " " + TIME_FMT
|
||||
|
||||
|
||||
def fmt_note(val, note_max=None, keep_numeric=False):
|
||||
"""conversion note en str pour affichage dans tables HTML ou PDF.
|
||||
|
@ -740,51 +785,6 @@ BULLETINS_VERSIONS_BUT = BULLETINS_VERSIONS | {
|
|||
"butcourt": "Version courte spéciale BUT"
|
||||
}
|
||||
|
||||
# ----- Support for ScoDoc7 compatibility
|
||||
|
||||
|
||||
def ScoURL():
|
||||
"""base URL for this sco instance.
|
||||
e.g. https://scodoc.xxx.fr/ScoDoc/DEPT/Scolarite
|
||||
= page accueil département
|
||||
"""
|
||||
return url_for("scolar.index_html", scodoc_dept=g.scodoc_dept)[
|
||||
: -len("/index_html")
|
||||
]
|
||||
|
||||
|
||||
def NotesURL():
|
||||
"""URL of Notes
|
||||
e.g. https://scodoc.xxx.fr/ScoDoc/DEPT/Scolarite/Notes
|
||||
= url de base des méthodes de notes
|
||||
(page accueil programmes).
|
||||
"""
|
||||
return url_for("notes.index_html", scodoc_dept=g.scodoc_dept)[: -len("/index_html")]
|
||||
|
||||
|
||||
def AbsencesURL():
|
||||
"""URL of Absences"""
|
||||
return url_for("absences.index_html", scodoc_dept=g.scodoc_dept)[
|
||||
: -len("/index_html")
|
||||
]
|
||||
|
||||
|
||||
def AssiduitesURL():
|
||||
"""URL of Assiduités"""
|
||||
return url_for("assiduites.bilan_dept", scodoc_dept=g.scodoc_dept)[
|
||||
: -len("/BilanDept")
|
||||
]
|
||||
|
||||
|
||||
def UsersURL():
|
||||
"""URL of Users
|
||||
e.g. https://scodoc.xxx.fr/ScoDoc/DEPT/Scolarite/Users
|
||||
= url de base des requêtes ZScoUsers
|
||||
et page accueil users
|
||||
"""
|
||||
return url_for("users.index_html", scodoc_dept=g.scodoc_dept)[: -len("/index_html")]
|
||||
|
||||
|
||||
# ---- Simple python utilities
|
||||
|
||||
|
||||
|
@ -1027,9 +1027,9 @@ def bul_filename(formsemestre, etud, prefix="bul"):
|
|||
|
||||
def flash_errors(form):
|
||||
"""Flashes form errors (version sommaire)"""
|
||||
for field, errors in form.errors.items():
|
||||
for field, _ in form.errors.items():
|
||||
flash(
|
||||
"Erreur: voir le champ %s" % (getattr(form, field).label.text,),
|
||||
f"Erreur: voir le champ {getattr(form, field).label.text}",
|
||||
"warning",
|
||||
)
|
||||
# see https://getbootstrap.com/docs/4.0/components/alerts/
|
||||
|
@ -1444,6 +1444,15 @@ def icontag(name, file_format="png", no_size=False, **attrs):
|
|||
ICON_PDF = icontag("pdficon16x20_img", title="Version PDF")
|
||||
ICON_XLS = icontag("xlsicon_img", title="Export tableur (xlsx)")
|
||||
|
||||
ICON_PUBLISHED = """<img src="/ScoDoc/static/icons/eye_visible_green.svg"
|
||||
width="24" height="19" border="0"
|
||||
title="Bulletins publiés sur la passerelle étudiants"
|
||||
alt="Bulletins publiés sur la passerelle étudiants" />"""
|
||||
ICON_HIDDEN = """<img src="/ScoDoc/static/icons/eye_hidden.svg"
|
||||
width="24" height="19" border="0"
|
||||
title="Bulletins NON publiés sur la passerelle étudiants"
|
||||
alt="Bulletins NON publiés sur la passerelle étudiants" />"""
|
||||
|
||||
# HTML emojis
|
||||
EMO_WARNING = "⚠️" # warning /!\
|
||||
EMO_RED_TRIANGLE_DOWN = "🔻" # red triangle pointed down
|
||||
|
@ -1627,6 +1636,12 @@ def is_entreprises_enabled():
|
|||
return ScoDocSiteConfig.is_entreprises_enabled()
|
||||
|
||||
|
||||
def is_passerelle_disabled():
|
||||
from app.models import ScoDocSiteConfig
|
||||
|
||||
return ScoDocSiteConfig.is_passerelle_disabled()
|
||||
|
||||
|
||||
def is_assiduites_module_forced(
|
||||
formsemestre_id: int = None, dept_id: int = None
|
||||
) -> bool:
|
||||
|
|
|
@ -449,7 +449,7 @@
|
|||
transform: translateX(-50%);
|
||||
}
|
||||
|
||||
.assiduite-infos {
|
||||
.assiduite-actions {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
margin: 5px;
|
||||
|
@ -485,6 +485,10 @@
|
|||
cursor: pointer;
|
||||
}
|
||||
|
||||
.mass-selection em {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
.fieldsplit {
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
|
@ -726,31 +730,11 @@ tr.row-justificatif.non_valide td.assi-type {
|
|||
background-color: var(--color-defaut) !important;
|
||||
}
|
||||
|
||||
.color.est_just.sans_etat::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 25%;
|
||||
height: 100%;
|
||||
background-color: var(--color-justi) !important;
|
||||
right: 0;
|
||||
}
|
||||
|
||||
.color.invalide::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 25%;
|
||||
height: 100%;
|
||||
right: 0;
|
||||
.color.invalide {
|
||||
background-color: var(--color-justi-invalide) !important;
|
||||
}
|
||||
|
||||
.color.attente::before,
|
||||
.color.modifie::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
width: 25%;
|
||||
height: 100%;
|
||||
right: 0;
|
||||
.color.attente {
|
||||
background: repeating-linear-gradient(to bottom,
|
||||
var(--color-justi-attente-stripe) 0px,
|
||||
var(--color-justi-attente-stripe) 4px,
|
||||
|
@ -758,6 +742,10 @@ tr.row-justificatif.non_valide td.assi-type {
|
|||
var(--color-justi-attente) 7px) !important;
|
||||
}
|
||||
|
||||
.color.est_just {
|
||||
background-color: var(--color-justi) !important;
|
||||
}
|
||||
|
||||
#gtrcontent .pdp {
|
||||
display: none;
|
||||
}
|
||||
|
|
|
@ -141,111 +141,111 @@ table.dataTable.with-highlight tr:hover td {
|
|||
background-color: rgba(255, 255, 0, 0.415);
|
||||
}
|
||||
|
||||
table.dataTable.order-column tbody tr > .sorting_1,
|
||||
table.dataTable.order-column tbody tr > .sorting_2,
|
||||
table.dataTable.order-column tbody tr > .sorting_3,
|
||||
table.dataTable.display tbody tr > .sorting_1,
|
||||
table.dataTable.display tbody tr > .sorting_2,
|
||||
table.dataTable.display tbody tr > .sorting_3 {
|
||||
table.dataTable.order-column tbody tr>.sorting_1,
|
||||
table.dataTable.order-column tbody tr>.sorting_2,
|
||||
table.dataTable.order-column tbody tr>.sorting_3,
|
||||
table.dataTable.display tbody tr>.sorting_1,
|
||||
table.dataTable.display tbody tr>.sorting_2,
|
||||
table.dataTable.display tbody tr>.sorting_3 {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
table.dataTable.order-column tbody tr.selected > .sorting_1,
|
||||
table.dataTable.order-column tbody tr.selected > .sorting_2,
|
||||
table.dataTable.order-column tbody tr.selected > .sorting_3,
|
||||
table.dataTable.display tbody tr.selected > .sorting_1,
|
||||
table.dataTable.display tbody tr.selected > .sorting_2,
|
||||
table.dataTable.display tbody tr.selected > .sorting_3 {
|
||||
table.dataTable.order-column tbody tr.selected>.sorting_1,
|
||||
table.dataTable.order-column tbody tr.selected>.sorting_2,
|
||||
table.dataTable.order-column tbody tr.selected>.sorting_3,
|
||||
table.dataTable.display tbody tr.selected>.sorting_1,
|
||||
table.dataTable.display tbody tr.selected>.sorting_2,
|
||||
table.dataTable.display tbody tr.selected>.sorting_3 {
|
||||
background-color: #acbad4;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.odd > .sorting_1,
|
||||
table.dataTable.order-column.stripe tbody tr.odd > .sorting_1 {
|
||||
table.dataTable.display tbody tr.odd>.sorting_1,
|
||||
table.dataTable.order-column.stripe tbody tr.odd>.sorting_1 {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.odd > .sorting_2,
|
||||
table.dataTable.order-column.stripe tbody tr.odd > .sorting_2 {
|
||||
table.dataTable.display tbody tr.odd>.sorting_2,
|
||||
table.dataTable.order-column.stripe tbody tr.odd>.sorting_2 {
|
||||
background-color: #f3f3f3;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.odd > .sorting_3,
|
||||
table.dataTable.order-column.stripe tbody tr.odd > .sorting_3 {
|
||||
table.dataTable.display tbody tr.odd>.sorting_3,
|
||||
table.dataTable.order-column.stripe tbody tr.odd>.sorting_3 {
|
||||
background-color: whitesmoke;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.odd.selected > .sorting_1,
|
||||
table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_1 {
|
||||
table.dataTable.display tbody tr.odd.selected>.sorting_1,
|
||||
table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_1 {
|
||||
background-color: #a6b3cd;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.odd.selected > .sorting_2,
|
||||
table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_2 {
|
||||
table.dataTable.display tbody tr.odd.selected>.sorting_2,
|
||||
table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_2 {
|
||||
background-color: #a7b5ce;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.odd.selected > .sorting_3,
|
||||
table.dataTable.order-column.stripe tbody tr.odd.selected > .sorting_3 {
|
||||
table.dataTable.display tbody tr.odd.selected>.sorting_3,
|
||||
table.dataTable.order-column.stripe tbody tr.odd.selected>.sorting_3 {
|
||||
background-color: #a9b6d0;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.even > .sorting_1,
|
||||
table.dataTable.order-column.stripe tbody tr.even > .sorting_1 {
|
||||
table.dataTable.display tbody tr.even>.sorting_1,
|
||||
table.dataTable.order-column.stripe tbody tr.even>.sorting_1 {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.even > .sorting_2,
|
||||
table.dataTable.order-column.stripe tbody tr.even > .sorting_2 {
|
||||
table.dataTable.display tbody tr.even>.sorting_2,
|
||||
table.dataTable.order-column.stripe tbody tr.even>.sorting_2 {
|
||||
background-color: #fbfbfb;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.even > .sorting_3,
|
||||
table.dataTable.order-column.stripe tbody tr.even > .sorting_3 {
|
||||
table.dataTable.display tbody tr.even>.sorting_3,
|
||||
table.dataTable.order-column.stripe tbody tr.even>.sorting_3 {
|
||||
background-color: #fdfdfd;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.even.selected > .sorting_1,
|
||||
table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_1 {
|
||||
table.dataTable.display tbody tr.even.selected>.sorting_1,
|
||||
table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_1 {
|
||||
background-color: #acbad4;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.even.selected > .sorting_2,
|
||||
table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_2 {
|
||||
table.dataTable.display tbody tr.even.selected>.sorting_2,
|
||||
table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_2 {
|
||||
background-color: #adbbd6;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr.even.selected > .sorting_3,
|
||||
table.dataTable.order-column.stripe tbody tr.even.selected > .sorting_3 {
|
||||
table.dataTable.display tbody tr.even.selected>.sorting_3,
|
||||
table.dataTable.order-column.stripe tbody tr.even.selected>.sorting_3 {
|
||||
background-color: #afbdd8;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr:hover > .sorting_1,
|
||||
table.dataTable.order-column.hover tbody tr:hover > .sorting_1 {
|
||||
table.dataTable.display tbody tr:hover>.sorting_1,
|
||||
table.dataTable.order-column.hover tbody tr:hover>.sorting_1 {
|
||||
background-color: #eaeaea;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr:hover > .sorting_2,
|
||||
table.dataTable.order-column.hover tbody tr:hover > .sorting_2 {
|
||||
table.dataTable.display tbody tr:hover>.sorting_2,
|
||||
table.dataTable.order-column.hover tbody tr:hover>.sorting_2 {
|
||||
background-color: #ebebeb;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr:hover > .sorting_3,
|
||||
table.dataTable.order-column.hover tbody tr:hover > .sorting_3 {
|
||||
table.dataTable.display tbody tr:hover>.sorting_3,
|
||||
table.dataTable.order-column.hover tbody tr:hover>.sorting_3 {
|
||||
background-color: #eeeeee;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr:hover.selected > .sorting_1,
|
||||
table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_1 {
|
||||
table.dataTable.display tbody tr:hover.selected>.sorting_1,
|
||||
table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_1 {
|
||||
background-color: #a1aec7;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr:hover.selected > .sorting_2,
|
||||
table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_2 {
|
||||
table.dataTable.display tbody tr:hover.selected>.sorting_2,
|
||||
table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_2 {
|
||||
background-color: #a2afc8;
|
||||
}
|
||||
|
||||
table.dataTable.display tbody tr:hover.selected > .sorting_3,
|
||||
table.dataTable.order-column.hover tbody tr:hover.selected > .sorting_3 {
|
||||
table.dataTable.display tbody tr:hover.selected>.sorting_3,
|
||||
table.dataTable.order-column.hover tbody tr:hover.selected>.sorting_3 {
|
||||
background-color: #a4b2cb;
|
||||
}
|
||||
|
||||
|
@ -420,13 +420,11 @@ table.dataTable td {
|
|||
color: #333333 !important;
|
||||
border: 1px solid #979797;
|
||||
background-color: white;
|
||||
background: -webkit-gradient(
|
||||
linear,
|
||||
left top,
|
||||
left bottom,
|
||||
color-stop(0%, white),
|
||||
color-stop(100%, gainsboro)
|
||||
);
|
||||
background: -webkit-gradient(linear,
|
||||
left top,
|
||||
left bottom,
|
||||
color-stop(0%, white),
|
||||
color-stop(100%, gainsboro));
|
||||
/* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, white 0%, gainsboro 100%);
|
||||
/* Chrome10+,Safari5.1+ */
|
||||
|
@ -454,13 +452,11 @@ table.dataTable td {
|
|||
color: white !important;
|
||||
border: 1px solid #111111;
|
||||
background-color: #585858;
|
||||
background: -webkit-gradient(
|
||||
linear,
|
||||
left top,
|
||||
left bottom,
|
||||
color-stop(0%, #585858),
|
||||
color-stop(100%, #111111)
|
||||
);
|
||||
background: -webkit-gradient(linear,
|
||||
left top,
|
||||
left bottom,
|
||||
color-stop(0%, #585858),
|
||||
color-stop(100%, #111111));
|
||||
/* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, #585858 0%, #111111 100%);
|
||||
/* Chrome10+,Safari5.1+ */
|
||||
|
@ -477,13 +473,11 @@ table.dataTable td {
|
|||
.dataTables_wrapper .dataTables_paginate .paginate_button:active {
|
||||
outline: none;
|
||||
background-color: #2b2b2b;
|
||||
background: -webkit-gradient(
|
||||
linear,
|
||||
left top,
|
||||
left bottom,
|
||||
color-stop(0%, #2b2b2b),
|
||||
color-stop(100%, #0c0c0c)
|
||||
);
|
||||
background: -webkit-gradient(linear,
|
||||
left top,
|
||||
left bottom,
|
||||
color-stop(0%, #2b2b2b),
|
||||
color-stop(100%, #0c0c0c));
|
||||
/* Chrome,Safari4+ */
|
||||
background: -webkit-linear-gradient(top, #2b2b2b 0%, #0c0c0c 100%);
|
||||
/* Chrome10+,Safari5.1+ */
|
||||
|
@ -514,50 +508,38 @@ table.dataTable td {
|
|||
text-align: center;
|
||||
font-size: 1.2em;
|
||||
background-color: white;
|
||||
background: -webkit-gradient(
|
||||
linear,
|
||||
left top,
|
||||
right top,
|
||||
color-stop(0%, rgba(255, 255, 255, 0)),
|
||||
color-stop(25%, rgba(255, 255, 255, 0.9)),
|
||||
color-stop(75%, rgba(255, 255, 255, 0.9)),
|
||||
color-stop(100%, rgba(255, 255, 255, 0))
|
||||
);
|
||||
background: -webkit-linear-gradient(
|
||||
left,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
background: -moz-linear-gradient(
|
||||
left,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
background: -ms-linear-gradient(
|
||||
left,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
background: -o-linear-gradient(
|
||||
left,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
background: linear-gradient(
|
||||
to right,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%
|
||||
);
|
||||
background: -webkit-gradient(linear,
|
||||
left top,
|
||||
right top,
|
||||
color-stop(0%, rgba(255, 255, 255, 0)),
|
||||
color-stop(25%, rgba(255, 255, 255, 0.9)),
|
||||
color-stop(75%, rgba(255, 255, 255, 0.9)),
|
||||
color-stop(100%, rgba(255, 255, 255, 0)));
|
||||
background: -webkit-linear-gradient(left,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%);
|
||||
background: -moz-linear-gradient(left,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%);
|
||||
background: -ms-linear-gradient(left,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%);
|
||||
background: -o-linear-gradient(left,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%);
|
||||
background: linear-gradient(to right,
|
||||
rgba(255, 255, 255, 0) 0%,
|
||||
rgba(255, 255, 255, 0.9) 25%,
|
||||
rgba(255, 255, 255, 0.9) 75%,
|
||||
rgba(255, 255, 255, 0) 100%);
|
||||
}
|
||||
|
||||
.dataTables_wrapper .dataTables_length,
|
||||
|
@ -577,69 +559,17 @@ table.dataTable td {
|
|||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
.dataTables_wrapper
|
||||
.dataTables_scroll
|
||||
div.dataTables_scrollBody
|
||||
> table
|
||||
> thead
|
||||
> tr
|
||||
> th,
|
||||
.dataTables_wrapper
|
||||
.dataTables_scroll
|
||||
div.dataTables_scrollBody
|
||||
> table
|
||||
> thead
|
||||
> tr
|
||||
> td,
|
||||
.dataTables_wrapper
|
||||
.dataTables_scroll
|
||||
div.dataTables_scrollBody
|
||||
> table
|
||||
> tbody
|
||||
> tr
|
||||
> th,
|
||||
.dataTables_wrapper
|
||||
.dataTables_scroll
|
||||
div.dataTables_scrollBody
|
||||
> table
|
||||
> tbody
|
||||
> tr
|
||||
> td {
|
||||
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th,
|
||||
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td,
|
||||
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th,
|
||||
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td {
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.dataTables_wrapper
|
||||
.dataTables_scroll
|
||||
div.dataTables_scrollBody
|
||||
> table
|
||||
> thead
|
||||
> tr
|
||||
> th
|
||||
> div.dataTables_sizing,
|
||||
.dataTables_wrapper
|
||||
.dataTables_scroll
|
||||
div.dataTables_scrollBody
|
||||
> table
|
||||
> thead
|
||||
> tr
|
||||
> td
|
||||
> div.dataTables_sizing,
|
||||
.dataTables_wrapper
|
||||
.dataTables_scroll
|
||||
div.dataTables_scrollBody
|
||||
> table
|
||||
> tbody
|
||||
> tr
|
||||
> th
|
||||
> div.dataTables_sizing,
|
||||
.dataTables_wrapper
|
||||
.dataTables_scroll
|
||||
div.dataTables_scrollBody
|
||||
> table
|
||||
> tbody
|
||||
> tr
|
||||
> td
|
||||
> div.dataTables_sizing {
|
||||
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>th>div.dataTables_sizing,
|
||||
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>thead>tr>td>div.dataTables_sizing,
|
||||
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>th>div.dataTables_sizing,
|
||||
.dataTables_wrapper .dataTables_scroll div.dataTables_scrollBody>table>tbody>tr>td>div.dataTables_sizing {
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
margin: 0 !important;
|
||||
|
@ -650,8 +580,8 @@ table.dataTable td {
|
|||
border-bottom: 1px solid #111111;
|
||||
}
|
||||
|
||||
.dataTables_wrapper.no-footer div.dataTables_scrollHead > table,
|
||||
.dataTables_wrapper.no-footer div.dataTables_scrollBody > table {
|
||||
.dataTables_wrapper.no-footer div.dataTables_scrollHead>table,
|
||||
.dataTables_wrapper.no-footer div.dataTables_scrollBody>table {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
|
@ -664,6 +594,7 @@ table.dataTable td {
|
|||
}
|
||||
|
||||
@media screen and (max-width: 767px) {
|
||||
|
||||
.dataTables_wrapper .dataTables_info,
|
||||
.dataTables_wrapper .dataTables_paginate {
|
||||
float: none;
|
||||
|
@ -676,6 +607,7 @@ table.dataTable td {
|
|||
}
|
||||
|
||||
@media screen and (max-width: 640px) {
|
||||
|
||||
.dataTables_wrapper .dataTables_length,
|
||||
.dataTables_wrapper .dataTables_filter {
|
||||
float: none;
|
||||
|
@ -703,6 +635,10 @@ table.table_leftalign tr td {
|
|||
text-align: left;
|
||||
}
|
||||
|
||||
p.gt_caption {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
/* Ligne(s) de titre */
|
||||
table.dataTable thead tr th {
|
||||
background-color: rgb(90%, 90%, 90%);
|
||||
|
@ -757,7 +693,8 @@ table.dataTable.gt_table {
|
|||
table.dataTable.gt_table.gt_left {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
table.dataTable.gt_table.gt_left td,
|
||||
table.dataTable.gt_table.gt_left th {
|
||||
text-align: left;
|
||||
}
|
||||
}
|
|
@ -19,6 +19,13 @@
|
|||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.modimpls_att {
|
||||
margin-top: 8px;
|
||||
margin-left: 32px;
|
||||
padding-top: 0;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.jury_but h3 {
|
||||
margin-top: 0px;
|
||||
}
|
||||
|
@ -272,4 +279,10 @@ div.but_doc table tr td.amue {
|
|||
.but_autorisations_passage.but_explanation {
|
||||
font-weight: normal;
|
||||
color: var(--color-explanation);
|
||||
}
|
||||
|
||||
.deca-expl {
|
||||
font-size: 110%;
|
||||
margin-bottom: 8px;
|
||||
margin-left: 16px;
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,217 @@
|
|||
div.formation_descr {
|
||||
background-color: rgb(250, 250, 240);
|
||||
border: 1px solid rgb(128, 128, 128);
|
||||
padding-left: 5px;
|
||||
padding-bottom: 5px;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
div.formation_descr span.fd_t {
|
||||
font-weight: bold;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
div.formation_descr span.fd_n {
|
||||
font-weight: bold;
|
||||
font-style: italic;
|
||||
color: green;
|
||||
margin-left: 6em;
|
||||
}
|
||||
|
||||
|
||||
div.formation_ue_list {
|
||||
border: 1px solid black;
|
||||
background-color: rgb(232, 249, 255);
|
||||
margin-top: 5px;
|
||||
margin-right: 12px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
div.formation_list_ues_titre {
|
||||
padding-top: 6px;
|
||||
padding-bottom: 6px;
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
font-size: 120%;
|
||||
font-weight: bold;
|
||||
border-top-right-radius: 18px;
|
||||
border-top-left-radius: 18px;
|
||||
background-color: #0051a9;
|
||||
color: #eee;
|
||||
}
|
||||
|
||||
div.formation_list_modules,
|
||||
div.formation_list_ues {
|
||||
border-radius: 18px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
padding-bottom: 1px;
|
||||
}
|
||||
|
||||
div.formation_list_ues {
|
||||
background-color: #b7d2fa;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
div.formation_list_ues_content {
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
div.formation_list_modules {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
div.formation_list_modules_RESSOURCE {
|
||||
background-color: var(--sco-color-ressources);
|
||||
}
|
||||
|
||||
div.formation_list_modules_SAE {
|
||||
background-color: var(--sco-color-saes);
|
||||
}
|
||||
|
||||
div.formation_list_modules_STANDARD {
|
||||
background-color: var(--sco-color-mod-std);
|
||||
}
|
||||
|
||||
div.formation_list_modules_titre {
|
||||
padding-left: 24px;
|
||||
padding-right: 24px;
|
||||
font-weight: bold;
|
||||
font-size: 120%;
|
||||
}
|
||||
|
||||
div.formation_list_ues ul.notes_module_list {
|
||||
margin-top: 0px;
|
||||
margin-bottom: -1px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
div.formation_list_modules ul.notes_module_list {
|
||||
margin-top: 0px;
|
||||
margin-bottom: -1px;
|
||||
padding-top: 5px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
span.missing_ue_ects {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
span.niveau-nom {
|
||||
color: black;
|
||||
}
|
||||
|
||||
span.niveau-nom>span {
|
||||
text-decoration: dashed underline;
|
||||
}
|
||||
|
||||
.formation_apc_infos ul li:not(:last-child) {
|
||||
margin-bottom: 6px;
|
||||
}
|
||||
|
||||
div.formation_parcs {
|
||||
display: inline-flex;
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
column-gap: 8px;
|
||||
}
|
||||
|
||||
div.formation_parcs>div {
|
||||
font-size: 100%;
|
||||
color: white;
|
||||
background-color: #09c;
|
||||
opacity: 0.7;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
padding: 2px 6px;
|
||||
margin-top: 8px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
|
||||
div.formation_parcs>div.ue_tc {
|
||||
color: black;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
div.formation_parcs>div.focus {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
div.formation_parcs>div>a:hover {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
div.formation_parcs>div>a,
|
||||
div.formation_parcs>div>a:visited {
|
||||
color: white;
|
||||
}
|
||||
|
||||
div.ue_choix_niveau>div.formation_parcs>div {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
|
||||
div.ue_list_tit {
|
||||
font-weight: bold;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
div.ue_list_tit form {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
div.ue_list_tit span.lock_info {
|
||||
color: red;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
ul.apc_ue_list {
|
||||
background-color: rgba(180, 189, 191, 0.14);
|
||||
margin-left: 8px;
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
ul.notes_ue_list {
|
||||
margin-top: 4px;
|
||||
margin-right: 1em;
|
||||
margin-left: 1em;
|
||||
/* padding-top: 1em; */
|
||||
padding-bottom: 1em;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.formation_classic_infos ul.notes_ue_list {
|
||||
padding-top: 0px;
|
||||
}
|
||||
|
||||
.formation_classic_infos li.notes_ue_list {
|
||||
margin-top: 9px;
|
||||
list-style-type: none;
|
||||
border: 1px solid maroon;
|
||||
border-radius: 10px;
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
|
||||
li.module_malus span.formation_module_tit {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
span.invalid-module-type {
|
||||
color: red;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
span.formation_module_ue {
|
||||
color: #6e7d92;
|
||||
font-size: 75%;
|
||||
}
|
||||
|
||||
span.notes_module_list_buts {
|
||||
margin-right: 5px;
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="Capa_1"
|
||||
enable-background="new 0 0 511.985 511.985"
|
||||
height="349.46161"
|
||||
viewBox="0 0 511.985 349.45137"
|
||||
width="512"
|
||||
version="1.1"
|
||||
sodipodi:docname="eye_hidden.svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs4" />
|
||||
<g
|
||||
id="g4"
|
||||
transform="translate(5e-4,-81.266625)">
|
||||
<g
|
||||
id="g3">
|
||||
<g
|
||||
id="Layer_2_00000011005494452173574160000003459929325544675728_">
|
||||
<g
|
||||
id="hide_00000049195420225258176850000009593604245528296082_">
|
||||
<path
|
||||
d="m 255.992,406.518 c -110.53,0 -208.51,-87.52 -245.5,-125.15 -13.99,-14.024 -13.99,-36.726 0,-50.75 37,-37.63 135,-125.16 245.5,-125.16 110.5,0 208.51,87.53 245.5,125.16 13.99,14.024 13.99,36.726 0,50.75 -37,37.63 -134.98,125.15 -245.5,125.15 z m 0,-271.06 c -99.18,0 -189.76,81.26 -224.11,116.19 -2.397,2.352 -2.434,6.201 -0.082,8.598 0.027,0.028 0.054,0.055 0.082,0.082 34.34,34.94 124.92,116.19 224.11,116.19 99.19,0 189.75,-81.25 224.1,-116.19 2.397,-2.352 2.434,-6.201 0.082,-8.598 -0.027,-0.028 -0.054,-0.055 -0.082,-0.082 -34.35,-34.93 -124.93,-116.19 -224.1,-116.19 z"
|
||||
style="fill:red;"
|
||||
id="path1" />
|
||||
<path
|
||||
d="m 255.992,346.268 c -49.871,0.006 -90.304,-40.419 -90.31,-90.29 -0.006,-49.871 40.419,-90.304 90.29,-90.31 49.871,-0.006 90.304,40.419 90.31,90.29 v 0.01 c -0.055,49.845 -40.445,90.239 -90.29,90.3 z m 0,-150.59 c -33.303,-0.006 -60.304,26.987 -60.31,60.29 -0.006,33.303 26.987,60.304 60.29,60.31 33.303,0.006 60.304,-26.987 60.31,-60.29 0,-0.007 0,-0.013 0,-0.02 -0.05,-33.273 -27.017,-60.231 -60.29,-60.27 z"
|
||||
style="fill:red;"
|
||||
id="path2" />
|
||||
<path
|
||||
d="m 96.262,430.718 c -8.284,0.004 -15.003,-6.709 -15.007,-14.993 -0.002,-3.982 1.58,-7.802 4.397,-10.617 l 319.45,-319.45 c 5.86,-5.857 15.358,-5.855 21.215,0.005 5.857,5.86 5.855,15.358 -0.005,21.215 l -319.45,319.44 c -2.806,2.819 -6.621,4.403 -10.6,4.4 z"
|
||||
style="fill:red;"
|
||||
id="path3" />
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 673 B |
|
@ -0,0 +1,19 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="Layer_1"
|
||||
enable-background="new 0 0 512 512"
|
||||
height="318.62299"
|
||||
viewBox="0 0 474.22501 318.62299"
|
||||
width="474.22501"
|
||||
version="1.1"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1" />
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 441.578,168.115 c -41.315,74.193 -119.667,120.282 -204.438,120.282 -84.826,0 -163.177,-46.089 -204.493,-120.282 -3.182,-5.761 -3.182,-11.851 0,-17.607 C 73.963,76.316 152.314,30.232 237.14,30.232 c 84.771,0 163.122,46.084 204.438,120.276 3.238,5.756 3.238,11.846 0,17.607 z M 467.97,135.798 C 421.332,52.031 332.885,0 237.14,0 141.34,0 52.893,52.031 6.255,135.798 c -8.34,14.946 -8.34,32.081 0,47.016 46.638,83.767 135.085,135.809 230.885,135.809 95.745,0 184.192,-52.042 230.83,-135.809 8.34,-14.934 8.34,-32.07 0,-47.016 z m -230.83,85.528 c 34.183,0 62.001,-27.818 62.001,-62.017 0,-34.199 -27.818,-62.017 -62.001,-62.017 -34.238,0 -62.056,27.818 -62.056,62.017 0,34.199 27.819,62.017 62.056,62.017 z m 0,-154.266 c -50.918,0 -92.288,41.387 -92.288,92.25 0,50.874 41.371,92.244 92.288,92.244 50.863,0 92.233,-41.371 92.233,-92.244 0,-50.863 -41.37,-92.25 -92.233,-92.25 z"
|
||||
fill-rule="evenodd"
|
||||
id="path1" />
|
||||
</svg>
|
After Width: | Height: | Size: 1.3 KiB |
|
@ -0,0 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
id="Layer_1"
|
||||
enable-background="new 0 0 512 512"
|
||||
height="318.62299"
|
||||
viewBox="0 0 474.22501 318.62299"
|
||||
width="474.22501"
|
||||
version="1.1"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:svg="http://www.w3.org/2000/svg">
|
||||
<defs
|
||||
id="defs1" />
|
||||
<path
|
||||
clip-rule="evenodd"
|
||||
d="m 441.578,168.115 c -41.315,74.193 -119.667,120.282 -204.438,120.282 -84.826,0 -163.177,-46.089 -204.493,-120.282 -3.182,-5.761 -3.182,-11.851 0,-17.607 C 73.963,76.316 152.314,30.232 237.14,30.232 c 84.771,0 163.122,46.084 204.438,120.276 3.238,5.756 3.238,11.846 0,17.607 z M 467.97,135.798 C 421.332,52.031 332.885,0 237.14,0 141.34,0 52.893,52.031 6.255,135.798 c -8.34,14.946 -8.34,32.081 0,47.016 46.638,83.767 135.085,135.809 230.885,135.809 95.745,0 184.192,-52.042 230.83,-135.809 8.34,-14.934 8.34,-32.07 0,-47.016 z m -230.83,85.528 c 34.183,0 62.001,-27.818 62.001,-62.017 0,-34.199 -27.818,-62.017 -62.001,-62.017 -34.238,0 -62.056,27.818 -62.056,62.017 0,34.199 27.819,62.017 62.056,62.017 z m 0,-154.266 c -50.918,0 -92.288,41.387 -92.288,92.25 0,50.874 41.371,92.244 92.288,92.244 50.863,0 92.233,-41.371 92.233,-92.244 0,-50.863 -41.37,-92.25 -92.233,-92.25 z"
|
||||
fill-rule="evenodd"
|
||||
style="fill: rgb(29, 124, 39);"
|
||||
id="path1" />
|
||||
</svg>
|
After Width: | Height: | Size: 1.4 KiB |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue