From de6d0233acfa3a872c559a33b43061ea072b2b62 Mon Sep 17 00:00:00 2001 From: viennet Date: Thu, 24 Dec 2020 01:29:50 +0100 Subject: [PATCH] Lien mail enseignants sur tableau bord semestre --- misc/createtables.sql | 2 +- sco_formsemestre_status.py | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/misc/createtables.sql b/misc/createtables.sql index 9196fb3e..bb809dfe 100644 --- a/misc/createtables.sql +++ b/misc/createtables.sql @@ -394,7 +394,7 @@ CREATE TABLE notes_formsemestre ( elt_annee_apo text -- code element annee Apogee, eg VRT1A ou V2INLA,V2INCA ) WITH OIDS; --- id des utilsateurs responsables (aka directeurs des etudes) du semestre: +-- id des utilisateurs responsables (aka directeurs des etudes) du semestre: CREATE TABLE notes_formsemestre_responsables ( formsemestre_id text REFERENCES notes_formsemestre(formsemestre_id) ON DELETE CASCADE, responsable_id text NOT NULL, diff --git a/sco_formsemestre_status.py b/sco_formsemestre_status.py index fe070742..8b9116b6 100644 --- a/sco_formsemestre_status.py +++ b/sco_formsemestre_status.py @@ -907,6 +907,12 @@ def formsemestre_status(context, formsemestre_id=None, REQUEST=None): Responsable Evaluations""" ) + mails_enseignants = set( + [ + context.Users.user_info(ens_id, REQUEST)["email"] + for ens_id in sem["responsables"] + ] + ) # adr. mail des enseignants for M in Mlist: Mod = M["module"] ModDescr = ( @@ -923,6 +929,12 @@ def formsemestre_status(context, formsemestre_id=None, REQUEST=None): ModInscrits = context.do_moduleimpl_inscription_list( moduleimpl_id=M["moduleimpl_id"] ) + mails_enseignants.add( + context.Users.user_info(M["responsable_id"], REQUEST)["email"] + ) + mails_enseignants |= set( + [context.Users.user_info(m["ens_id"], REQUEST)["email"] for m in M["ens"]] + ) ue = M["ue"] if prev_ue_id != ue["ue_id"]: prev_ue_id = ue["ue_id"] @@ -1047,5 +1059,11 @@ def formsemestre_status(context, formsemestre_id=None, REQUEST=None): ) # --- LISTE DES ETUDIANTS H += ['
', context.make_listes_sem(sem, REQUEST), "
"] - + # --- Lien mail enseignants: + adrlist = list(mails_enseignants - set([""])) + if adrlist: + H.append( + '

Courrier aux %d enseignants du semestre

' + % (",".join(adrlist), len(adrlist)) + ) return "".join(H) + context.sco_footer(REQUEST)