From f2e86622aeb89c48d47ff60af27191f69e9bcc99 Mon Sep 17 00:00:00 2001
From: Emmanuel Viennet Liste de tous les billets en attenteAucun étudiant !
"
- + context.sco_footer(REQUEST)
+ + html_sco_header.sco_footer(REQUEST)
)
base_url = "SignaleAbsenceGrHebdo?datelundi=%s&%s&destination=%s" % (
@@ -850,7 +850,7 @@ def SignaleAbsenceGrHebdo(
etuds, datessem, destination, moduleimpl_id, require_module
)
- H.append(context.sco_footer(REQUEST))
+ H.append(html_sco_header.sco_footer(REQUEST))
return "\n".join(H)
@@ -877,7 +877,7 @@ def SignaleAbsenceGrSemestre(
context, page_title="Saisie des absences", REQUEST=REQUEST
)
+ "Aucun étudiant !
"
- + context.sco_footer(REQUEST)
+ + html_sco_header.sco_footer(REQUEST)
)
formsemestre_id = groups_infos.formsemestre_id
require_module = sco_preferences.get_preference(
@@ -1043,7 +1043,7 @@ onchange="document.location='%(url)s&moduleimpl_id='+document.getElementById('mo
H += context._gen_form_saisie_groupe(
etuds, dates, destination, moduleimpl_id, require_module
)
- H.append(context.sco_footer(REQUEST))
+ H.append(html_sco_header.sco_footer(REQUEST))
return "\n".join(H)
@@ -1582,7 +1582,7 @@ def EtatAbsencesDate(
% REQUEST.HTTP_REFERER
)
- return "\n".join(H) + context.sco_footer(REQUEST)
+ return "\n".join(H) + html_sco_header.sco_footer(REQUEST)
# ----- Gestion des "billets d'absence": signalement par les etudiants eux mêmes (à travers le portail)
@@ -1673,7 +1673,7 @@ def AddBilletAbsenceForm(context, etudid, REQUEST=None):
),
)
if tf[0] == 0:
- return "\n".join(H) + tf[1] + context.sco_footer(REQUEST)
+ return "\n".join(H) + tf[1] + html_sco_header.sco_footer(REQUEST)
elif tf[0] == -1:
return REQUEST.RESPONSE.redirect(scu.ScoURL())
else:
@@ -1808,7 +1808,7 @@ def listeBillets(context, REQUEST=None):
submitbutton=False,
)
if tf[0] == 0:
- return "\n".join(H) + tf[1] + T + context.sco_footer(REQUEST)
+ return "\n".join(H) + tf[1] + T + html_sco_header.sco_footer(REQUEST)
else:
return REQUEST.RESPONSE.redirect(
"ProcessBilletAbsenceForm?billet_id=" + tf[2]["billet_id"]
@@ -1951,7 +1951,7 @@ def ProcessBilletAbsenceForm(context, billet_id, REQUEST=None):
)
F += '
" + tf[1] + F + context.sco_footer(REQUEST)
+ return "\n".join(H) + "
" + tf[1] + F + html_sco_header.sco_footer(REQUEST)
elif tf[0] == -1:
return REQUEST.RESPONSE.redirect(scu.ScoURL())
else:
@@ -1976,7 +1976,7 @@ def ProcessBilletAbsenceForm(context, billet_id, REQUEST=None):
billets = sco_abs.billet_absence_list(cnx, {"etudid": etud["etudid"]})
tab = context._tableBillets(billets, etud=etud)
H.append(tab.html())
- return "\n".join(H) + context.sco_footer(REQUEST)
+ return "\n".join(H) + html_sco_header.sco_footer(REQUEST)
@bp.route("/XMLgetAbsEtud")
@@ -2011,3 +2011,6 @@ def XMLgetAbsEtud(context, beg_date="", end_date="", REQUEST=None):
doc._pop()
log("XMLgetAbsEtud (%gs)" % (time.time() - t0))
return repr(doc)
+
+
+context.populate(globals())
diff --git a/app/views/entreprises.py b/app/views/entreprises.py
index c8b810b5..5e0f7703 100644
--- a/app/views/entreprises.py
+++ b/app/views/entreprises.py
@@ -537,7 +537,7 @@ def entreprise_contact_edit(context, entreprise_contact_id, REQUEST=None):
initvalues=c,
submitlabel="Modifier les valeurs",
readonly=not REQUEST.AUTHENTICATED_USER.has_permission(
- ScoEntrepriseChange
+ Permission.ScoEntrepriseChange
),
)
@@ -665,7 +665,7 @@ def entreprise_correspondant_edit(context, entreprise_corresp_id, REQUEST=None):
initvalues=c,
submitlabel="Modifier les valeurs",
readonly=not REQUEST.AUTHENTICATED_USER.has_permission(
- ScoEntrepriseChange
+ Permission.ScoEntrepriseChange
),
)
if tf[0] == 0:
@@ -776,7 +776,7 @@ def entreprise_contact_create(context, entreprise_id, REQUEST=None):
cancelbutton="Annuler",
submitlabel="Ajouter ce contact",
readonly=not REQUEST.AUTHENTICATED_USER.has_permission(
- ScoEntrepriseChange
+ Permission.ScoEntrepriseChange
),
)
if tf[0] == 0:
@@ -926,7 +926,7 @@ def entreprise_correspondant_create(context, entreprise_id, REQUEST=None):
cancelbutton="Annuler",
submitlabel="Ajouter ce correspondant",
readonly=not REQUEST.AUTHENTICATED_USER.has_permission(
- ScoEntrepriseChange
+ Permission.ScoEntrepriseChange
),
)
if tf[0] == 0:
@@ -960,7 +960,7 @@ def entreprise_correspondant_delete(context, entreprise_corresp_id, REQUEST=None
submitlabel="Confirmer la suppression",
cancelbutton="Annuler",
readonly=not REQUEST.AUTHENTICATED_USER.has_permission(
- ScoEntrepriseChange
+ Permission.ScoEntrepriseChange
),
)
if tf[0] == 0:
@@ -1020,7 +1020,7 @@ def entreprise_delete(context, entreprise_id, REQUEST=None):
submitlabel="Confirmer la suppression",
cancelbutton="Annuler",
readonly=not REQUEST.AUTHENTICATED_USER.has_permission(
- ScoEntrepriseChange
+ Permission.ScoEntrepriseChange
),
)
if tf[0] == 0:
@@ -1117,7 +1117,7 @@ def entreprise_create(context, REQUEST=None):
cancelbutton="Annuler",
submitlabel="Ajouter cette entreprise",
readonly=not REQUEST.AUTHENTICATED_USER.has_permission(
- ScoEntrepriseChange
+ Permission.ScoEntrepriseChange
),
)
if tf[0] == 0:
diff --git a/app/views/notes.py b/app/views/notes.py
index c621c763..2d8d50d4 100644
--- a/app/views/notes.py
+++ b/app/views/notes.py
@@ -128,7 +128,7 @@ from app.scodoc import sco_ue_external
from app.scodoc import sco_undo_notes
from app.scodoc import scolars
-context = ScoDoc7Context(globals())
+context = ScoDoc7Context("notes")
def sco_publish(route, function, permission):
@@ -389,7 +389,7 @@ def index_html(context, REQUEST=None):
"""
)
- H.append(context.sco_footer(REQUEST))
+ H.append(html_sco_header.sco_footer(context, REQUEST))
return "\n".join(H)
@@ -491,7 +491,7 @@ def formation_import_xml_form(context, REQUEST):
à partir un fichier XML (réservé aux utilisateurs avertis)
Aucune absence signalée
" - + context.sco_footer(REQUEST) + + html_sco_header.sco_footer(context, REQUEST) ) tab = GenTable( @@ -1538,7 +1540,7 @@ def view_module_abs(context, REQUEST, moduleimpl_id, format="html"): if format != "html": return tab.make_page(context, format=format, REQUEST=REQUEST) - return "\n".join(H) + tab.html() + context.sco_footer(REQUEST) + return "\n".join(H) + tab.html() + html_sco_header.sco_footer(context, REQUEST) @bp.route("/edit_ue_expr") @@ -1593,7 +1595,7 @@ def edit_ue_expr(context, REQUEST, formsemestre_id, ue_id): initvalues=initvalues, ) if tf[0] == 0: - return "\n".join(H) + tf[1] + context.sco_footer(REQUEST) + return "\n".join(H) + tf[1] + html_sco_header.sco_footer(context, REQUEST) elif tf[0] == -1: return REQUEST.RESPONSE.redirect( "formsemestre_status?formsemestre_id=" + formsemestre_id @@ -1899,7 +1901,7 @@ def formsemestre_desinscription( html_sco_header.sco_header(context, REQUEST) + 'Etudiant désinscrit !
retour à la fiche' % (scu.ScoURL(), etudid) - + context.sco_footer(REQUEST) + + html_sco_header.sco_footer(context, REQUEST) ) @@ -2283,7 +2285,7 @@ def evaluation_delete(context, REQUEST, evaluation_id): """
Suppression impossible (effacer les notes d'abord)
retour au tableau de bord du module
""" % E["moduleimpl_id"] ) - return "\n".join(H) + context.sco_footer(REQUEST) + return "\n".join(H) + html_sco_header.sco_footer(context, REQUEST) if warning: H.append("""""") @@ -2296,7 +2298,7 @@ def evaluation_delete(context, REQUEST, evaluation_id): cancelbutton="Annuler", ) if tf[0] == 0: - return "\n".join(H) + tf[1] + context.sco_footer(REQUEST) + return "\n".join(H) + tf[1] + html_sco_header.sco_footer(context, REQUEST) elif tf[0] == -1: return REQUEST.RESPONSE.redirect( scu.ScoURL() @@ -2314,7 +2316,7 @@ def evaluation_delete(context, REQUEST, evaluation_id): + "/Notes/moduleimpl_status?moduleimpl_id=" + E["moduleimpl_id"] ) - + context.sco_footer(REQUEST) + + html_sco_header.sco_footer(context, REQUEST) ) @@ -2438,7 +2440,7 @@ def evaluation_listenotes(context, REQUEST=None): javascripts=["js/etud_info.js"], init_qtip=True, ) - F = context.sco_footer(REQUEST) + F = html_sco_header.sco_footer(context, REQUEST) else: H, F = "", "" B = context.do_evaluation_listenotes(REQUEST) @@ -2702,7 +2704,7 @@ def formsemestre_bulletins_mailetuds( html_sco_header.sco_header(context, REQUEST) + '%d bulletins sur %d envoyés par mail !
' % (nb_send, len(etudids), formsemestre_id) - + context.sco_footer(REQUEST) + + html_sco_header.sco_footer(context, REQUEST) ) @@ -2766,7 +2768,7 @@ def appreciation_add_form( html_sco_header.sco_header(context, REQUEST) + "empty page: see logs and mails
" - + context.sco_footer(REQUEST) + + html_sco_header.sco_footer(context, REQUEST) ) @@ -3424,3 +3426,5 @@ sco_publish( sco_moduleimpl.do_moduleimpl_withmodule_list, Permission.ScoView, ) + +context.populate(globals()) diff --git a/app/views/scolar.py b/app/views/scolar.py index f04832f1..57ff3721 100644 --- a/app/views/scolar.py +++ b/app/views/scolar.py @@ -145,7 +145,7 @@ from app.scodoc import sco_dept from app.scodoc import sco_dump_db -context = ScoDoc7Context(globals()) +context = ScoDoc7Context("scolar") def sco_publish(route, function, permission): @@ -197,7 +197,7 @@ def about(context, REQUEST): html_sco_header.sco_header(context, REQUEST) + "\n".join(H) + d - + context.sco_footer(REQUEST) + + html_sco_header.sco_footer(REQUEST) ) @@ -615,7 +615,7 @@ def formChangeCoordonnees(context, etudid, REQUEST): ) dest_url = scu.ScoURL() + "/ficheEtud?etudid=" + etudid if tf[0] == 0: - return header + "\n".join(H) + tf[1] + context.sco_footer(REQUEST) + return header + "\n".join(H) + tf[1] + html_sco_header.sco_footer(REQUEST) elif tf[0] == -1: return REQUEST.RESPONSE.redirect(dest_url) else: @@ -688,7 +688,7 @@ def etud_photo_orig_page(context, etudid=None, REQUEST=None): '", - context.sco_footer(REQUEST), + html_sco_header.sco_footer(REQUEST), ] return "\n".join(H) @@ -736,7 +736,7 @@ def formChangePhoto(context, etudid=None, REQUEST=None): + tf[1] + '' % etudid - + context.sco_footer(REQUEST) + + html_sco_header.sco_footer(REQUEST) ) elif tf[0] == -1: return REQUEST.RESPONSE.redirect(dest_url) @@ -747,7 +747,7 @@ def formChangePhoto(context, etudid=None, REQUEST=None): return REQUEST.RESPONSE.redirect(dest_url) else: H.append('Erreur:' + diag + "
") - return "\n".join(H) + context.sco_footer(REQUEST) + return "\n".join(H) + html_sco_header.sco_footer(REQUEST) @bp.route("/formSuppressPhoto") @@ -847,7 +847,7 @@ def _formDem_of_Def( """ % etud ) - return header + "\n".join(H) + context.sco_footer(REQUEST) + return header + "\n".join(H) + html_sco_header.sco_footer(REQUEST) @bp.route("/doDemEtudiant") @@ -1046,7 +1046,7 @@ def etudident_edit_form(context, REQUEST=None): def _etudident_create_or_edit_form(context, REQUEST, edit): "Le formulaire HTML" H = [html_sco_header.sco_header(context, REQUEST, init_jquery_ui=True)] - F = context.sco_footer(REQUEST) + F = html_sco_header.sco_footer(REQUEST) etudid = REQUEST.form.get("etudid", None) cnx = ndb.GetDBConnexion() descr = [] @@ -1642,7 +1642,7 @@ def check_group_apogee( ) ) - return "\n".join(H) + context.sco_footer(REQUEST) + return "\n".join(H) + html_sco_header.sco_footer(REQUEST) @bp.route("/form_students_import_excel") @@ -1715,7 +1715,7 @@ def form_students_import_excel(context, REQUEST, formsemestre_id=None):Diagnostic: