Export table comptes croisés: fix #934

This commit is contained in:
Emmanuel Viennet 2024-06-19 16:34:45 +02:00
parent e877e04cc6
commit 6224f37e4a
3 changed files with 15 additions and 10 deletions

View File

@ -313,9 +313,12 @@ class GenTable:
T.append(l + [self.bottom_titles.get(cid, "") for cid in self.columns_ids]) T.append(l + [self.bottom_titles.get(cid, "") for cid in self.columns_ids])
return T return T
def get_titles_list(self): def get_titles_list(self, with_lines_titles=True):
"list of titles" "list of titles"
return [self.titles.get(cid, "") for cid in self.columns_ids] titles = [self.titles.get(cid, "") for cid in self.columns_ids]
if with_lines_titles:
titles.insert(0, "")
return titles
def gen(self, fmt="html", columns_ids=None): def gen(self, fmt="html", columns_ids=None):
"""Build representation of the table in the specified format. """Build representation of the table in the specified format.

View File

@ -248,8 +248,6 @@ def formsemestre_report(
result="codedecision", result="codedecision",
category_name="", category_name="",
result_name="", result_name="",
title="Statistiques",
only_primo=None,
): ):
""" """
Tableau sur résultats (result) par type de category bac Tableau sur résultats (result) par type de category bac
@ -277,9 +275,6 @@ def formsemestre_report(
f"Répartition des résultats par {category_name}, semestre {sem['titreannee']}" f"Répartition des résultats par {category_name}, semestre {sem['titreannee']}"
) )
tab.html_caption = f"Répartition des résultats par {category_name}." tab.html_caption = f"Répartition des résultats par {category_name}."
tab.base_url = "%s?formsemestre_id=%s" % (request.base_url, formsemestre_id)
if only_primo:
tab.base_url += "&only_primo=on"
return tab return tab
@ -326,8 +321,15 @@ def formsemestre_report_counts(
category=category, category=category,
result=result, result=result,
category_name=category_name, category_name=category_name,
title=title, )
only_primo=only_primo, tab.base_url = url_for(
"notes.formsemestre_report_counts",
scodoc_dept=g.scodoc_dept,
formsemestre_id=formsemestre_id,
category=category,
only_primo=int(bool(only_primo)),
result=result,
group_ids=group_ids,
) )
if len(formsemestre.inscriptions) == 0: if len(formsemestre.inscriptions) == 0:
F = ["""<p><em>Aucun étudiant</em></p>"""] F = ["""<p><em>Aucun étudiant</em></p>"""]

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.6.977" SCOVERSION = "9.6.978"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"