Compare commits

..

No commits in common. "87f136d6b99f0b66fdf8aaf6b67f8504af6ac672" and "699b482c30510c07c30aa3daf2d3f580a91fa069" have entirely different histories.

2 changed files with 16 additions and 19 deletions

View File

@ -780,7 +780,7 @@ REQUEST.URL0=%s<br/>
# -------------------------- INFOS SUR ETUDIANTS -------------------------- # -------------------------- INFOS SUR ETUDIANTS --------------------------
security.declareProtected(ScoView, "getEtudInfo") security.declareProtected(ScoView, "getEtudInfo")
def getEtudInfo(self, etudid=False, code_nip=False, filled=False, REQUEST=None, format=None): def getEtudInfo(self, etudid=False, code_nip=False, filled=False, REQUEST=None):
"""infos sur un etudiant pour utilisation en Zope DTML """infos sur un etudiant pour utilisation en Zope DTML
On peut specifier etudid On peut specifier etudid
ou bien cherche dans REQUEST.form: etudid, code_nip, code_ine ou bien cherche dans REQUEST.form: etudid, code_nip, code_ine
@ -791,13 +791,9 @@ REQUEST.URL0=%s<br/>
cnx = self.GetDBConnexion() cnx = self.GetDBConnexion()
args = make_etud_args(etudid=etudid, code_nip=code_nip, REQUEST=REQUEST) args = make_etud_args(etudid=etudid, code_nip=code_nip, REQUEST=REQUEST)
etud = scolars.etudident_list(cnx, args=args) etud = scolars.etudident_list(cnx, args=args)
if filled: if filled:
self.fillEtudsInfo(etud) self.fillEtudsInfo(etud)
if format is None:
return etud return etud
else:
return scu.sendResult(REQUEST, etud, name="etud", format=format)
security.declareProtected(ScoView, "search_etud_in_dept") security.declareProtected(ScoView, "search_etud_in_dept")
search_etud_in_dept = sco_find_etud.search_etud_in_dept search_etud_in_dept = sco_find_etud.search_etud_in_dept

View File

@ -76,9 +76,8 @@ def doSignaleAbsence(
description_abs = description description_abs = description
dates = sco_abs.DateRangeISO(context, datedebut, datefin) dates = sco_abs.DateRangeISO(context, datedebut, datefin)
nbadded = 0 nbadded = 0
demijournee = int(demijournee)
for jour in dates: for jour in dates:
if demijournee == 2: if demijournee == "2":
context._AddAbsence( context._AddAbsence(
etudid, jour, False, estjust, REQUEST, description_abs, moduleimpl_id etudid, jour, False, estjust, REQUEST, description_abs, moduleimpl_id
) )
@ -87,8 +86,9 @@ def doSignaleAbsence(
) )
nbadded += 2 nbadded += 2
else: else:
matin = int(demijournee)
context._AddAbsence( context._AddAbsence(
etudid, jour, demijournee, estjust, REQUEST, description_abs, moduleimpl_id etudid, jour, matin, estjust, REQUEST, description_abs, moduleimpl_id
) )
nbadded += 1 nbadded += 1
# #
@ -281,9 +281,8 @@ def doJustifAbsence(
description_abs = description description_abs = description
dates = sco_abs.DateRangeISO(context, datedebut, datefin) dates = sco_abs.DateRangeISO(context, datedebut, datefin)
nbadded = 0 nbadded = 0
demijournee = int(demijournee)
for jour in dates: for jour in dates:
if demijournee == 2: if demijournee == "2":
context._AddJustif( context._AddJustif(
etudid=etudid, etudid=etudid,
jour=jour, jour=jour,
@ -300,10 +299,11 @@ def doJustifAbsence(
) )
nbadded += 2 nbadded += 2
else: else:
matin = int(demijournee)
context._AddJustif( context._AddJustif(
etudid=etudid, etudid=etudid,
jour=jour, jour=jour,
matin=demijournee, matin=matin,
REQUEST=REQUEST, REQUEST=REQUEST,
description=description_abs, description=description_abs,
) )
@ -404,14 +404,14 @@ def doAnnuleAbsence(
dates = sco_abs.DateRangeISO(context, datedebut, datefin) dates = sco_abs.DateRangeISO(context, datedebut, datefin)
nbadded = 0 nbadded = 0
demijournee = int(demijournee)
for jour in dates: for jour in dates:
if demijournee == 2: if demijournee == "2":
context._AnnuleAbsence(etudid, jour, False, REQUEST=REQUEST) context._AnnuleAbsence(etudid, jour, False, REQUEST=REQUEST)
context._AnnuleAbsence(etudid, jour, True, REQUEST=REQUEST) context._AnnuleAbsence(etudid, jour, True, REQUEST=REQUEST)
nbadded += 2 nbadded += 2
else: else:
context._AnnuleAbsence(etudid, jour, demijournee, REQUEST=REQUEST) matin = int(demijournee)
context._AnnuleAbsence(etudid, jour, matin, REQUEST=REQUEST)
nbadded += 1 nbadded += 1
# #
H = [ H = [
@ -539,15 +539,15 @@ def doAnnuleJustif(
etudid = etud["etudid"] etudid = etud["etudid"]
dates = sco_abs.DateRangeISO(context, datedebut0, datefin0) dates = sco_abs.DateRangeISO(context, datedebut0, datefin0)
nbadded = 0 nbadded = 0
demijournee = int(demijournee)
for jour in dates: for jour in dates:
# Attention: supprime matin et après-midi # Attention: supprime matin et après-midi
if demijournee == 2: if demijournee == "2":
context._AnnuleJustif(etudid, jour, False, REQUEST=REQUEST) context._AnnuleJustif(etudid, jour, False, REQUEST=REQUEST)
context._AnnuleJustif(etudid, jour, True, REQUEST=REQUEST) context._AnnuleJustif(etudid, jour, True, REQUEST=REQUEST)
nbadded += 2 nbadded += 2
else: else:
context._AnnuleJustif(etudid, jour, demijournee, REQUEST=REQUEST) matin = int(demijournee)
context._AnnuleJustif(etudid, jour, matin, REQUEST=REQUEST)
nbadded += 1 nbadded += 1
# #
H = [ H = [
@ -720,7 +720,7 @@ def ListeAbsEtud(
): ):
"""Liste des absences d'un étudiant sur l'année en cours """Liste des absences d'un étudiant sur l'année en cours
En format 'html': page avec deux tableaux (non justifiées et justifiées). En format 'html': page avec deux tableaux (non justifiées et justifiées).
En format json, xml, xls ou pdf: l'un ou l'autre des table, suivant absjust_only. En format xls ou pdf: l'un ou l'autre des table, suivant absjust_only.
En format 'text': texte avec liste d'absences (pour mails). En format 'text': texte avec liste d'absences (pour mails).
""" """
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)
@ -732,6 +732,7 @@ def ListeAbsEtud(
titles, columns_ids, absnonjust, absjust = context.Absences._TablesAbsEtud( titles, columns_ids, absnonjust, absjust = context.Absences._TablesAbsEtud(
etudid, datedebut, with_evals=with_evals, format=format etudid, datedebut, with_evals=with_evals, format=format
) )
if REQUEST: if REQUEST:
base_url_nj = "%s?etudid=%s&amp;absjust_only=0" % (REQUEST.URL0, etudid) base_url_nj = "%s?etudid=%s&amp;absjust_only=0" % (REQUEST.URL0, etudid)
base_url_j = "%s?etudid=%s&amp;absjust_only=1" % (REQUEST.URL0, etudid) base_url_j = "%s?etudid=%s&amp;absjust_only=1" % (REQUEST.URL0, etudid)