Préférences: section spéarée pour exports Apogée. Option pour supprimer la section APO_TYP_RES.

This commit is contained in:
Emmanuel Viennet 2023-05-12 18:05:27 +02:00
parent f2a9e3fd5c
commit 6d8af957fd
2 changed files with 25 additions and 8 deletions

View File

@ -78,6 +78,7 @@ from chardet import detect as chardet_detect
from app import log
from app.scodoc.sco_exceptions import ScoFormatError
from app.scodoc import sco_preferences
APO_PORTAL_ENCODING = (
"utf8" # encodage du fichier CSV Apogée (était 'ISO-8859-1' avant jul. 2016)
@ -384,9 +385,12 @@ col_ids={pprint.pformat(self.col_ids)}
"""write apo CSV header on f
(beginning of CSV until columns titles just after XX-APO_VALEURS-XX line)
"""
remove_typ_res = sco_preferences.get_preference("export_res_remove_typ_res")
for section, data in self.sections_str.items():
if section != "XX-APO_VALEURS-XX":
# XXX TODO ici on va filtrer XX-APO_TYP_RES-XX
# ne recopie pas la section résultats, et en option supprime APO_TYP_RES
if (section != "XX-APO_VALEURS-XX") and (
section != "XX-APO_TYP_RES-XX" or not remove_typ_res
):
f.write(data)
f.write("XX-APO_VALEURS-XX" + APO_NEWLINE)

View File

@ -205,6 +205,7 @@ PREF_CATEGORIES = (
("apc", {"title": "BUT et Approches par Compétences"}),
("abs", {"title": "Suivi des absences", "related": ("bul",)}),
("portal", {"title": "Liaison avec portail (Apogée, etc)"}),
("apogee", {"title": "Exports Apogée"}),
(
"pdf",
{
@ -743,7 +744,7 @@ class BasePreferences(object):
"explanation": "remplissage maquettes export Apogée",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -755,7 +756,7 @@ class BasePreferences(object):
"explanation": "remplissage maquettes export Apogée",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -767,7 +768,7 @@ class BasePreferences(object):
"explanation": "remplissage maquettes export Apogée",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -779,7 +780,7 @@ class BasePreferences(object):
"explanation": "remplissage maquettes export Apogée",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -791,7 +792,7 @@ class BasePreferences(object):
"explanation": "si coché, exporte exporte étudiants même si pas décision de jury saisie (sinon laisse vide)",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -803,7 +804,19 @@ class BasePreferences(object):
"explanation": "si coché, exporte exporte étudiants en attente de ratrapage comme ATT (sinon laisse vide)",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
(
"export_res_remove_typ_res",
{
"initvalue": 0,
"title": "Ne pas recopier la section APO_TYP_RES",
"explanation": "si coché, ne réécrit pas la section APO_TYP_RES (rarement utile, utiliser avec précaution)",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "apogee",
"only_global": True,
},
),