diff --git a/app/scodoc/sco_abs.py b/app/scodoc/sco_abs.py index d4d01673..74043f9b 100644 --- a/app/scodoc/sco_abs.py +++ b/app/scodoc/sco_abs.py @@ -145,7 +145,7 @@ class ddmmyyyy: "iso8601 representation of the date" return "%04d-%02d-%02d" % (self.year, self.month, self.day) - def next(self, days=1): + def next_day(self, days=1): "date for the next day (nota: may be a non workable day)" day = self.day + days month = self.month @@ -179,7 +179,7 @@ class ddmmyyyy: def next_monday(self): "date of next monday" - return self.next((7 - self.weekday) % 7) + return self.next_day((7 - self.weekday) % 7) def prev_monday(self): "date of last monday, but on sunday, pick next monday" @@ -213,7 +213,7 @@ def DateRangeISO(context, date_beg, date_end, workable=1): while cur <= end: if (not workable) or cur.iswork(): r.append(cur) - cur = cur.next() + cur = cur.next_day() return map(lambda x: x.ISO(), r) @@ -231,7 +231,7 @@ def day_names(context): def next_iso_day(context, date): "return date after date" d = ddmmyyyy(date, fmt="iso", work_saturday=is_work_saturday(context)) - return d.next().ISO() + return d.next_day().ISO() def YearTable( @@ -860,7 +860,7 @@ def MonthTableBody( cc.append("") cell = string.join(cc, "") if day == "D": - monday = monday.next(7) + monday = monday.next_day(7) if ( weeknum == current_weeknum and current_year == year @@ -894,7 +894,7 @@ def MonthTableBody( weeknum += " currentweek" if day == "D": - monday = monday.next(7) + monday = monday.next_day(7) T.append( '
Aucun semestre défini (ou aucun groupe d'étudiant)
""" - ) - else: - H.append( - """Pour signaler, annuler ou justifier une absence, choisissez d'abord l'étudiant concerné:
""" - ) - H.append(sco_find_etud.form_search_etud(context, REQUEST)) - if authuser.has_permission(Permission.ScoAbsChange): - H.extend( - ( - """Vous n'avez pas l'autorisation d'ajouter, justifier ou supprimer des absences.
""" - ) - - H.append(html_sco_header.sco_footer(context, REQUEST)) - return "\n".join(H) - - -def cal_select_week(context, year=None, REQUEST=None): - "display calendar allowing week selection" - if not year: - year = scu.AnneeScolaire(REQUEST) - sems = sco_formsemestre.do_formsemestre_list(context) - if not sems: - js = "" - else: - js = 'onmouseover="highlightweek(this);" onmouseout="deselectweeks();" onclick="wclick(this);"' - C = sco_abs.YearTable(context, int(year), dayattributes=js) - return C diff --git a/app/scodoc/sco_formsemestre_status.py b/app/scodoc/sco_formsemestre_status.py index 19ef67df..af90c0da 100644 --- a/app/scodoc/sco_formsemestre_status.py +++ b/app/scodoc/sco_formsemestre_status.py @@ -31,8 +31,9 @@ import urllib import cgi -# Rewritten from ancient DTML code from flask import current_app +from flask import g +from flask import url_for from app.scodoc.notes_log import log import app.scodoc.sco_utils as scu @@ -805,7 +806,11 @@ def _make_listes_sem(context, sem, REQUEST=None, with_absences=True): first_monday = sco_abs.ddmmyyyy(sem["date_debut"]).prev_monday() FA = [] # formulaire avec menu saisi absences FA.append( - '