Retire certaines vues obsoletes (API ScoDoc 7).

This commit is contained in:
Emmanuel Viennet 2022-10-24 10:49:34 +02:00
parent dac46b8366
commit fa84f9ed89
4 changed files with 15 additions and 102 deletions

View File

@ -693,64 +693,12 @@ sco_publish(
) )
# --- UE # --- UE
sco_publish(
"/do_ue_create",
sco_edit_ue.do_ue_create,
Permission.ScoChangeFormation,
methods=["GET", "POST"],
)
sco_publish( sco_publish(
"/ue_list", "/ue_list",
sco_edit_ue.ue_list, sco_edit_ue.ue_list,
Permission.ScoView, 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( sco_publish(
"/module_move", sco_edit_formation.module_move, Permission.ScoChangeFormation "/module_move", sco_edit_formation.module_move, Permission.ScoChangeFormation
) )
@ -776,62 +724,21 @@ def formsemestre_list(
kw can specify some conditions: examples: kw can specify some conditions: examples:
formsemestre_list( format='json', formation_id='F777') formsemestre_list( format='json', formation_id='F777')
""" """
log("Warning: calling deprecated view formsemestre_list")
try: try:
formsemestre_id = int(formsemestre_id) if formsemestre_id is not None else None 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 formation_id = int(formation_id) if formation_id is not None else None
except ValueError: except ValueError:
return scu.json_error(404, "invalid id") return scu.json_error(404, "invalid id")
# XAPI: new json api
args = {} args = {}
L = locals() L = locals()
for argname in ("formsemestre_id", "formation_id", "etape_apo"): for argname in ("formsemestre_id", "formation_id", "etape_apo"):
if L[argname] is not None: if L[argname] is not None:
args[argname] = L[argname] args[argname] = L[argname]
sems = sco_formsemestre.do_formsemestre_list(args=args) 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) 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( sco_publish(
"/formsemestre_edit_options", "/formsemestre_edit_options",
sco_formsemestre_edit.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"]) @bp.route("/evaluation_edit", methods=["GET", "POST"])
@scodoc @scodoc
@permission_required(Permission.ScoEnsView) @permission_required(Permission.ScoEnsView)

View File

@ -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.

View File

@ -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 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/

View File

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