1
0
forked from ScoDoc/ScoDoc

Lien mail enseignants sur tableau bord semestre

This commit is contained in:
viennet 2020-12-24 01:29:50 +01:00
parent fcbbc877bc
commit de6d0233ac
2 changed files with 20 additions and 2 deletions

View File

@ -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,

View File

@ -907,6 +907,12 @@ def formsemestre_status(context, formsemestre_id=None, REQUEST=None):
<th class="resp">Responsable</th>
<th class="evals">Evaluations</th></tr>"""
)
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 += ['<div id="groupes">', context.make_listes_sem(sem, REQUEST), "</div>"]
# --- Lien mail enseignants:
adrlist = list(mails_enseignants - set([""]))
if adrlist:
H.append(
'<p><a class="stdlink" href="mailto:?cc=%s">Courrier aux %d enseignants du semestre</a></p>'
% (",".join(adrlist), len(adrlist))
)
return "".join(H) + context.sco_footer(REQUEST)