From fa84f9ed891014b4574356f727fbe75d28c022ef Mon Sep 17 00:00:00 2001 From: Emmanuel Viennet Date: Mon, 24 Oct 2022 10:49:34 +0200 Subject: [PATCH] Retire certaines vues obsoletes (API ScoDoc 7). --- app/views/notes.py | 102 +----------------- .../PublicationBulletins/ExemplePHP/README.md | 7 ++ .../Portail-LeHavre/README.txt | 6 ++ sco_version.py | 2 +- 4 files changed, 15 insertions(+), 102 deletions(-) create mode 100644 misc/PublicationBulletins/ExemplePHP/README.md diff --git a/app/views/notes.py b/app/views/notes.py index b59150e6c2..b73adf4164 100644 --- a/app/views/notes.py +++ b/app/views/notes.py @@ -693,64 +693,12 @@ sco_publish( ) # --- UE -sco_publish( - "/do_ue_create", - sco_edit_ue.do_ue_create, - Permission.ScoChangeFormation, - methods=["GET", "POST"], -) - sco_publish( "/ue_list", sco_edit_ue.ue_list, Permission.ScoView, ) - -# --- Matieres -sco_publish( - "/do_matiere_create", - sco_edit_matiere.do_matiere_create, - Permission.ScoChangeFormation, - methods=["GET", "POST"], -) -sco_publish( - "/do_matiere_delete", - sco_edit_matiere.do_matiere_delete, - Permission.ScoChangeFormation, -) - - -# --- Modules -sco_publish( - "/do_module_delete", - sco_edit_module.do_module_delete, - Permission.ScoChangeFormation, -) - - -@bp.route("/formation_count_sems") -@scodoc -@permission_required(Permission.ScoView) -@scodoc7func -def formation_count_sems(formation_id): - "Number of formsemestre in this formation (locked or not)" - sems = sco_formsemestre.do_formsemestre_list(args={"formation_id": formation_id}) - return len(sems) - - -sco_publish( - "/module_count_moduleimpls", - sco_edit_module.module_count_moduleimpls, - Permission.ScoView, -) - -sco_publish("/module_is_locked", sco_edit_module.module_is_locked, Permission.ScoView) - -sco_publish( - "/matiere_is_locked", sco_edit_matiere.matiere_is_locked, Permission.ScoView -) - sco_publish( "/module_move", sco_edit_formation.module_move, Permission.ScoChangeFormation ) @@ -776,62 +724,21 @@ def formsemestre_list( kw can specify some conditions: examples: formsemestre_list( format='json', formation_id='F777') """ + log("Warning: calling deprecated view formsemestre_list") try: formsemestre_id = int(formsemestre_id) if formsemestre_id is not None else None formation_id = int(formation_id) if formation_id is not None else None except ValueError: return scu.json_error(404, "invalid id") - # XAPI: new json api args = {} L = locals() for argname in ("formsemestre_id", "formation_id", "etape_apo"): if L[argname] is not None: args[argname] = L[argname] sems = sco_formsemestre.do_formsemestre_list(args=args) - # log('formsemestre_list: format="%s", %s semestres found' % (format,len(sems))) return scu.sendResult(sems, name="formsemestre", format=format) -@bp.route( - "/XMLgetFormsemestres", methods=["GET", "POST"] -) # pour compat anciens clients PHP -@scodoc -@permission_required_compat_scodoc7(Permission.ScoView) -@scodoc7func -def XMLgetFormsemestres(etape_apo=None, formsemestre_id=None): - """List all formsemestres matching etape, XML format - DEPRECATED: use formsemestre_list() - """ - current_app.logger.debug("Warning: calling deprecated XMLgetFormsemestres") - if not formsemestre_id: - return flask.abort(404, "argument manquant: formsemestre_id") - if not isinstance(formsemestre_id, int): - return flask.abort( - 404, "XMLgetFormsemestres: formsemestre_id must be an integer !" - ) - args = {} - if etape_apo: - args["etape_apo"] = etape_apo - if formsemestre_id: - args["formsemestre_id"] = formsemestre_id - - doc = ElementTree.Element("formsemestrelist") - for sem in sco_formsemestre.do_formsemestre_list(args=args): - for k in sem: - if isinstance(sem[k], int): - sem[k] = str(sem[k]) - sem_elt = ElementTree.Element("formsemestre", **sem) - doc.append(sem_elt) - - data = sco_xml.XML_HEADER + ElementTree.tostring(doc).decode(scu.SCO_ENCODING) - return scu.send_file(data, mime=scu.XML_MIMETYPE) - - -sco_publish( - "/do_formsemestre_edit", - sco_formsemestre.do_formsemestre_edit, - Permission.ScoImplement, -) sco_publish( "/formsemestre_edit_options", sco_formsemestre_edit.formsemestre_edit_options, @@ -1736,13 +1643,6 @@ def evaluation_delete(evaluation_id): ) -sco_publish( - "/do_evaluation_list", - sco_evaluation_db.do_evaluation_list, - Permission.ScoView, -) - - @bp.route("/evaluation_edit", methods=["GET", "POST"]) @scodoc @permission_required(Permission.ScoEnsView) diff --git a/misc/PublicationBulletins/ExemplePHP/README.md b/misc/PublicationBulletins/ExemplePHP/README.md new file mode 100644 index 0000000000..4115fcda46 --- /dev/null +++ b/misc/PublicationBulletins/ExemplePHP/README.md @@ -0,0 +1,7 @@ + +# Un ancien exemple de client PHP pour ScoDoc 7 + +Intérêt historique uniquement: + utilise l'ancienne API, qui n'est plus disponible à partir de ScoDoc 9.3. + + diff --git a/misc/PublicationBulletins/Portail-LeHavre/README.txt b/misc/PublicationBulletins/Portail-LeHavre/README.txt index 7a757dcd36..9b97fd7f8b 100644 --- a/misc/PublicationBulletins/Portail-LeHavre/README.txt +++ b/misc/PublicationBulletins/Portail-LeHavre/README.txt @@ -4,3 +4,9 @@ Auteurs: Code contribué par Yann Leboulanger (Université Paris 10), Juin 2013 Modifié par D. SOUDIERE avec le concours de Catherine Hatinguais +OBSOLETE, laissé à titre historique: utilise l'API ScoDoc 7 +qui n'est plus disponible depuis ScoDoc 9.3. + +utiliser la "passerelle" ScoDoc_Notes ou adapter pour utiliser la nouvelle API +https://scodoc.org/ScoDoc9API/ + diff --git a/sco_version.py b/sco_version.py index 59711dafe7..3a7f541934 100644 --- a/sco_version.py +++ b/sco_version.py @@ -1,7 +1,7 @@ # -*- mode: python -*- # -*- coding: utf-8 -*- -SCOVERSION = "9.3.57" +SCOVERSION = "9.3.58" SCONAME = "ScoDoc"