diff --git a/app/api/justificatifs.py b/app/api/justificatifs.py index f753fc0e0f..a85685f7e5 100644 --- a/app/api/justificatifs.py +++ b/app/api/justificatifs.py @@ -457,7 +457,7 @@ def justif_edit(justif_id: int): "après": compute_assiduites_justified( justificatif_unique.etudid, [justificatif_unique], - False, + True, ), } } diff --git a/app/models/assiduites.py b/app/models/assiduites.py index 3fc6d87871..82b6d3dc3e 100644 --- a/app/models/assiduites.py +++ b/app/models/assiduites.py @@ -362,9 +362,17 @@ def compute_assiduites_justified( for assi in assiduites: if assi.etat == EtatAssiduite.PRESENT: continue + + assi_justificatifs = Justificatif.query.filter( + Justificatif.etudid == assi.etudid, + Justificatif.date_debut <= assi.date_debut, + Justificatif.date_fin >= assi.date_fin, + Justificatif.etat == EtatJustificatif.VALIDE, + ).all() + if any( assi.date_debut >= j.date_debut and assi.date_fin <= j.date_fin - for j in justificatifs + for j in justificatifs + assi_justificatifs ): assi.est_just = True assiduites_justifiees.append(assi.assiduite_id) diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 3048172384..1a0163b4ba 100755 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -502,13 +502,10 @@ def retreive_formsemestre_from_request() -> int: group = sco_groups.get_group(args["group_id"]) formsemestre_id = group["formsemestre_id"] elif group_ids: - if group_ids: - if isinstance(group_ids, str): - group_id = group_ids - else: - # prend le semestre du 1er groupe de la liste: - group_id = group_ids[0] - group = sco_groups.get_group(group_id) + if isinstance(group_ids, str): + group_ids = group_ids.split(",") + group_id = group_ids[0] + group = sco_groups.get_group(group_id) formsemestre_id = group["formsemestre_id"] elif "partition_id" in args: partition = sco_groups.get_partition(args["partition_id"]) diff --git a/app/templates/assiduites/pages/ajout_justificatif.j2 b/app/templates/assiduites/pages/ajout_justificatif.j2 index bef71862ff..28c4b6159a 100644 --- a/app/templates/assiduites/pages/ajout_justificatif.j2 +++ b/app/templates/assiduites/pages/ajout_justificatif.j2 @@ -138,8 +138,8 @@ const raison = field.querySelector('#justi_raison').value; return { - date_debut: deb, - date_fin: fin, + date_debut: moment.tz(deb, TIMEZONE).format(), + date_fin: moment.tz(fin, TIMEZONE).format(), etat: etat, raison: raison, } diff --git a/app/templates/assiduites/pages/bilan_dept.j2 b/app/templates/assiduites/pages/bilan_dept.j2 index 2db0dce9e7..5da0ae640d 100644 --- a/app/templates/assiduites/pages/bilan_dept.j2 +++ b/app/templates/assiduites/pages/bilan_dept.j2 @@ -39,7 +39,7 @@ function getDeptJustificatifsFromPeriod(action) { const formsemestre = formsemestre_id ? `&formsemestre_id=${formsemestre_id}` : "" const group = group_id ? `&group_id=${group_id}` : "" - const path = getUrl() + `/api/justificatifs/dept/${dept_id}/query?date_debut=${bornes.deb}&date_fin=${bornes.fin}&etat=attente,modifie${formsemestre}${group}` + const path = getUrl() + `/api/justificatifs/dept/${dept_id}/query?date_debut=${bornes.deb}&date_fin=${bornes.fin}${formsemestre}${group}` async_get( path, (data, status) => { diff --git a/app/templates/assiduites/pages/bilan_etud.j2 b/app/templates/assiduites/pages/bilan_etud.j2 index 3a9ee64b26..8bc9a90f9b 100644 --- a/app/templates/assiduites/pages/bilan_etud.j2 +++ b/app/templates/assiduites/pages/bilan_etud.j2 @@ -27,9 +27,17 @@

Absences et retards non justifiés

+ + + + {% include "assiduites/widgets/tableau_assi.j2" %}

Justificatifs en attente (ou modifiés)

+ + + + {% include "assiduites/widgets/tableau_justi.j2" %}
diff --git a/app/views/assiduites.py b/app/views/assiduites.py index 2af34bdb1b..d8dda71680 100644 --- a/app/views/assiduites.py +++ b/app/views/assiduites.py @@ -835,7 +835,6 @@ def visu_assiduites_group(): + [ # Voir fonctionnement JS "js/etud_info.js", - "js/abs_ajax.js", "js/groups_view.js", "js/assiduites.js", "libjs/moment.new.min.js",