diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 4c3748f41..3fb89f5f2 100755 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -61,6 +61,7 @@ from app.scodoc.sco_utils import ModuleType from app.scodoc import html_sco_header from app.scodoc import htmlutils from app.scodoc import sco_archives_formsemestre +from app.scodoc import sco_assiduites as scass from app.scodoc import sco_bulletins from app.scodoc import codes_cursus from app.scodoc import sco_compute_moy @@ -783,6 +784,10 @@ def _make_listes_sem(formsemestre: FormSemestre) -> str: ) # H.append('
') + + disable_abs: str | bool = scass.has_assiduites_disable_pref(formsemestre) + show_abs: str = "hidden" if disable_abs else "" + # Genere liste pour chaque partition (categorie de groupes) for partition in formsemestre.get_partitions_list(): groups = partition.groups.all() @@ -797,10 +802,11 @@ def _make_listes_sem(formsemestre: FormSemestre) -> str: ('aucun étudiant inscrit' if partition_is_empty else 'Tous les étudiants')}
{ - "Assiduité" if not partition_is_empty else "" + "Assiduité" if not partition_is_empty and not show_abs else "" }
""" ) + if groups: for group in groups: n_members = effectifs[group.id] @@ -821,8 +827,7 @@ def _make_listes_sem(formsemestre: FormSemestre) -> str: - {n_members} étudiants -
- +
""" ) if can_edit_abs: @@ -911,7 +916,7 @@ def _make_listes_sem(formsemestre: FormSemestre) -> str: ) # --- Formulaire importation Assiduité excel (si autorisé) - if current_user.has_permission(Permission.AbsChange): + if current_user.has_permission(Permission.AbsChange) and not disable_abs: H.append( f"""

") + + if disable_abs: + H.append(f""" +

+ """) + return "\n".join(H) diff --git a/app/scodoc/sco_groups_view.py b/app/scodoc/sco_groups_view.py index e7858f8fc..87ba50e63 100644 --- a/app/scodoc/sco_groups_view.py +++ b/app/scodoc/sco_groups_view.py @@ -42,6 +42,7 @@ from app import db from app.models import FormSemestre, Identite import app.scodoc.sco_utils as scu from app.scodoc import html_sco_header +from app.scodoc import sco_assiduites as scass from app.scodoc import sco_excel from app.scodoc import sco_formsemestre from app.scodoc import sco_groups @@ -894,25 +895,40 @@ def tab_absences_html(groups_infos, etat=None): group_ids: str = ",".join(map(str, groups_infos.group_ids)) formsemestre: FormSemestre = groups_infos.get_formsemestre() + disable_abs: str | bool = scass.has_assiduites_disable_pref(formsemestre) - H.extend( - [ - "

Assiduité

", - '
", + "", + ] + + if disable_abs: + liens_abs = [ + f""" +
+

La gestion des absences est désactivée dans ScoDoc pour ce semestre:

+

{disable_abs}

+
+ """ + ] + + H.extend( + [ + "

Assiduité

", + *liens_abs, "

Feuilles

", '