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 committed by iziram
parent 53118e2446
commit 9ba44f5285
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

@ -206,6 +206,7 @@ PREF_CATEGORIES = (
("abs", {"title": "Suivi des absences", "related": ("bul",)}),
("assi", {"title": "Gestion de l'assiduité"}),
("portal", {"title": "Liaison avec portail (Apogée, etc)"}),
("apogee", {"title": "Exports Apogée"}),
(
"pdf",
{
@ -787,7 +788,7 @@ class BasePreferences(object):
"explanation": "remplissage maquettes export Apogée",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -799,7 +800,7 @@ class BasePreferences(object):
"explanation": "remplissage maquettes export Apogée",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -811,7 +812,7 @@ class BasePreferences(object):
"explanation": "remplissage maquettes export Apogée",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -823,7 +824,7 @@ class BasePreferences(object):
"explanation": "remplissage maquettes export Apogée",
"input_type": "boolcheckbox",
"labels": ["non", "oui"],
"category": "portal",
"category": "apogee",
"only_global": True,
},
),
@ -835,7 +836,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,
},
),
@ -847,7 +848,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,
},
),