1
0
forked from ScoDoc/ScoDoc

Fix absences/cal

This commit is contained in:
Emmanuel Viennet 2021-08-16 22:41:09 +02:00
parent 3d176a945f
commit c40c806c63
3 changed files with 12 additions and 9 deletions

View File

@ -955,7 +955,7 @@ def MonthTableBody(
% (bgcolor, weekclass, attrs, d, day) % (bgcolor, weekclass, attrs, d, day)
) )
cc = [] cc = []
for morning in (1, 0): for morning in (True, False):
color = None color = None
legend = "" legend = ""
href = "" href = ""

View File

@ -74,7 +74,8 @@ def doSignaleAbsence(
""" """
etud = sco_etud.get_etud_info(filled=1, etudid=etudid, REQUEST=REQUEST)[0] etud = sco_etud.get_etud_info(filled=1, etudid=etudid, REQUEST=REQUEST)[0]
etudid = etud["etudid"] etudid = etud["etudid"]
if not moduleimpl_id:
moduleimpl_id = None
description_abs = description description_abs = description
dates = sco_abs.DateRangeISO(context, datedebut, datefin) dates = sco_abs.DateRangeISO(context, datedebut, datefin)
nbadded = 0 nbadded = 0
@ -186,7 +187,7 @@ def SignaleAbsenceEtud(context, REQUEST=None): # etudid implied
menu_module = """ menu_module = """
<script type="text/javascript"> <script type="text/javascript">
function form_enable_disable() { function form_enable_disable() {
if ( $("select#sel_moduleimpl_id").val() == "NULL" ) { if ( $("select#sel_moduleimpl_id").val() == "" ) {
$("#butsubmit").prop("disabled", true); $("#butsubmit").prop("disabled", true);
} else { } else {
$("#butsubmit").prop("disabled", false); $("#butsubmit").prop("disabled", false);
@ -203,7 +204,7 @@ def SignaleAbsenceEtud(context, REQUEST=None): # etudid implied
menu_module = ( menu_module = (
"""<p>Module: <select id="sel_moduleimpl_id" name="moduleimpl_id">""" """<p>Module: <select id="sel_moduleimpl_id" name="moduleimpl_id">"""
) )
menu_module += """<option value="NULL" selected>(Module)</option>""" menu_module += """<option value="" selected>(Module)</option>"""
for ue in ues: for ue in ues:
modimpls = nt.get_modimpls(ue_id=ue["ue_id"]) modimpls = nt.get_modimpls(ue_id=ue["ue_id"])
@ -725,10 +726,10 @@ def CalAbs(context, etudid, sco_year=None):
"""Calendrier des absences d'un etudiant""" """Calendrier des absences d'un etudiant"""
# crude portage from 1999 DTML # crude portage from 1999 DTML
REQUEST = None # XXX REQUEST = None # XXX
etud = sco_etud.get_etud_info(filled=1, REQUEST=REQUEST)[0] etud = sco_etud.get_etud_info(filled=1, etudid=etudid, REQUEST=REQUEST)[0]
etudid = etud["etudid"] etudid = etud["etudid"]
anneescolaire = int(scu.AnneeScolaire(sco_year)) anneescolaire = int(scu.AnneeScolaire(sco_year))
datedebut = str(anneescolaire) + "-08-31" datedebut = str(anneescolaire) + "-08-01"
datefin = str(anneescolaire + 1) + "-07-31" datefin = str(anneescolaire + 1) + "-07-31"
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)
@ -815,7 +816,7 @@ def ListeAbsEtud(
sco_year: année scolaire à utiliser. Si non spécifier, utilie l'année en cours. e.g. "2005" sco_year: année scolaire à utiliser. Si non spécifier, utilie l'année en cours. e.g. "2005"
""" """
absjust_only = int(absjust_only) # si vrai, table absjust seule (export xls ou pdf) absjust_only = int(absjust_only) # si vrai, table absjust seule (export xls ou pdf)
datedebut = "%s-08-31" % scu.AnneeScolaire(sco_year=sco_year) datedebut = "%s-08-01" % scu.AnneeScolaire(sco_year=sco_year)
etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0] etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
@ -915,7 +916,9 @@ def _TablesAbsEtud(
absjust_only=0, absjust_only=0,
REQUEST=None, REQUEST=None,
): ):
"""Tables des absences justifiees et non justifiees d'un étudiant sur l'année en cours""" """Tables des absences justifiees et non justifiees d'un étudiant
sur l'année en cours
"""
absjust = sco_abs.list_abs_just(etudid=etudid, datedebut=datedebut) absjust = sco_abs.list_abs_just(etudid=etudid, datedebut=datedebut)
absnonjust = sco_abs.list_abs_non_just(etudid=etudid, datedebut=datedebut) absnonjust = sco_abs.list_abs_non_just(etudid=etudid, datedebut=datedebut)
# examens ces jours là ? # examens ces jours là ?

View File

@ -467,7 +467,7 @@ def retreive_formsemestre_from_request():
group_ids = args.get("group_ids", []) group_ids = args.get("group_ids", [])
if "formsemestre_id" in args: if "formsemestre_id" in args:
formsemestre_id = args["formsemestre_id"] formsemestre_id = args["formsemestre_id"]
elif "moduleimpl_id" in args: elif "moduleimpl_id" in args and args["moduleimpl_id"]:
modimpl = sco_moduleimpl.do_moduleimpl_list( modimpl = sco_moduleimpl.do_moduleimpl_list(
context, moduleimpl_id=args["moduleimpl_id"] context, moduleimpl_id=args["moduleimpl_id"]
) )