1
0
forked from ScoDoc/ScoDoc
This commit is contained in:
Emmanuel Viennet 2022-03-15 22:32:03 +01:00
parent 48d0d89ede
commit 6de3d32c25
2 changed files with 3 additions and 2 deletions

View File

@ -724,6 +724,7 @@ def CalAbs(etudid, sco_year=None):
anneescolaire = int(scu.AnneeScolaire(sco_year)) anneescolaire = int(scu.AnneeScolaire(sco_year))
datedebut = str(anneescolaire) + "-08-01" datedebut = str(anneescolaire) + "-08-01"
datefin = str(anneescolaire + 1) + "-07-31" datefin = str(anneescolaire + 1) + "-07-31"
annee_courante = scu.AnneeScolaire()
nbabs = sco_abs.count_abs(etudid=etudid, debut=datedebut, fin=datefin) nbabs = sco_abs.count_abs(etudid=etudid, debut=datedebut, fin=datefin)
nbabsjust = sco_abs.count_abs_just(etudid=etudid, debut=datedebut, fin=datefin) nbabsjust = sco_abs.count_abs_just(etudid=etudid, debut=datedebut, fin=datefin)
events = [] events = []
@ -776,7 +777,7 @@ def CalAbs(etudid, sco_year=None):
"""Année scolaire %s-%s""" % (anneescolaire, anneescolaire + 1), """Année scolaire %s-%s""" % (anneescolaire, anneescolaire + 1),
"""&nbsp;&nbsp;Changer année: <select name="sco_year" onchange="document.f.submit()">""", """&nbsp;&nbsp;Changer année: <select name="sco_year" onchange="document.f.submit()">""",
] ]
for y in range(anneescolaire, anneescolaire - 10, -1): for y in range(annee_courante, min(annee_courante - 6, anneescolaire - 6), -1):
H.append("""<option value="%s" """ % y) H.append("""<option value="%s" """ % y)
if y == anneescolaire: if y == anneescolaire:
H.append("selected") H.append("selected")

View File

@ -954,7 +954,7 @@ def query_portal(req, msg="Portail Apogee", timeout=3):
return r.text return r.text
def AnneeScolaire(sco_year=None): def AnneeScolaire(sco_year=None) -> int:
"annee de debut de l'annee scolaire courante" "annee de debut de l'annee scolaire courante"
if sco_year: if sco_year:
year = sco_year year = sco_year