This commit is contained in:
Arthur ZHU 2022-03-03 09:47:19 +01:00
parent 94eedcc6e8
commit 5c11e4d928
3 changed files with 0 additions and 27 deletions

View File

@ -60,7 +60,6 @@ from app.scodoc import sco_cache
from app.scodoc import sco_etud from app.scodoc import sco_etud
from app.scodoc import sco_permissions_check from app.scodoc import sco_permissions_check
from app.scodoc import sco_xml from app.scodoc import sco_xml
from app.scodoc import sco_excel
from app.scodoc.sco_exceptions import ScoException, AccessDenied, ScoValueError from app.scodoc.sco_exceptions import ScoException, AccessDenied, ScoValueError
from app.scodoc.sco_permissions import Permission from app.scodoc.sco_permissions import Permission
from app.scodoc.TrivialFormulator import TrivialFormulator from app.scodoc.TrivialFormulator import TrivialFormulator
@ -1610,27 +1609,6 @@ def make_query_groups(group_ids):
return "" return ""
def exportAnnotation(group_ids):
cnx = ndb.GetDBConnexion()
cursor = cnx.cursor()
cursor.execute(
"""SELECT i.nom, i.prenom, ea.date, ea.comment
FROM group_membership gm, identite i, etud_annotations ea
WHERE gm.group_id=%(group_ids)s
AND gm.etudid=i.id
AND i.id=ea.etudid
""",
{"group_ids": group_ids},
)
titles = ["nom", "prenom", "date", "annotation"]
title = "annotations"
xlsx = sco_excel.excel_simple_table(
titles=titles, lines=cursor.fetchall(), sheet_name=title
)
filename = title
return scu.send_file(xlsx, filename, scu.XLSX_SUFFIX, scu.XLSX_MIMETYPE)
class GroupIdInferer(object): class GroupIdInferer(object):
"""Sert à retrouver l'id d'un groupe dans un semestre donné """Sert à retrouver l'id d'un groupe dans un semestre donné
à partir de son nom. à partir de son nom.

View File

@ -826,8 +826,6 @@ def tab_absences_html(groups_infos, etat=None):
% groups_infos.groups_query_args, % groups_infos.groups_query_args,
"""<li><a class="stdlink" href="trombino?%s&format=pdflist">Liste d'appel avec photos</a></li>""" """<li><a class="stdlink" href="trombino?%s&format=pdflist">Liste d'appel avec photos</a></li>"""
% groups_infos.groups_query_args, % groups_infos.groups_query_args,
"""<li><a class="stdlink" href="exportAnnotations?%s">Feuille annotations</a></li>"""
% groups_infos.groups_query_args,
"</ul>", "</ul>",
] ]
) )

View File

@ -2193,6 +2193,3 @@ def stat_bac(formsemestre_id):
sco_publish( sco_publish(
"/sco_dump_and_send_db", sco_dump_db.sco_dump_and_send_db, Permission.ScoView "/sco_dump_and_send_db", sco_dump_db.sco_dump_and_send_db, Permission.ScoView
) )
# --- Export annotations
sco_publish("/exportAnnotations", sco_groups.exportAnnotation, Permission.ScoView)