From 6d8af957fd176b3e3feca0e71a75f35a23368538 Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Fri, 12 May 2023 18:05:27 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=A9f=C3=A9rences:=20section=20sp=C3=A9ar?= =?UTF-8?q?=C3=A9e=20pour=20exports=20Apog=C3=A9e.=20Option=20pour=20suppr?= =?UTF-8?q?imer=20la=20section=20APO=5FTYP=5FRES.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/scodoc/sco_apogee_reader.py | 8 ++++++-- app/scodoc/sco_preferences.py | 25 +++++++++++++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/app/scodoc/sco_apogee_reader.py b/app/scodoc/sco_apogee_reader.py index abe8e2bf..1e798433 100644 --- a/app/scodoc/sco_apogee_reader.py +++ b/app/scodoc/sco_apogee_reader.py @@ -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) diff --git a/app/scodoc/sco_preferences.py b/app/scodoc/sco_preferences.py index b4acf3bd..8c9bf554 100644 --- a/app/scodoc/sco_preferences.py +++ b/app/scodoc/sco_preferences.py @@ -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, }, ),