This commit is contained in:
IDK 2021-02-24 09:18:53 +01:00
parent 4b858591f4
commit fca2740518
9 changed files with 36 additions and 29 deletions

View File

@ -394,6 +394,10 @@ REQUEST.URL0=%s<br/>
"""
return self.ScoURL() + "/Entreprises"
def AbsencesURL(self):
"""URL of Absences"""
return self.ScoURL() + "/Absences"
def UsersURL(self):
"""URL of Users
e.g. https://scodoc.xxx.fr/ScoDoc/DEPT/Scolarite/Users

View File

@ -42,7 +42,13 @@ Génération de la "sidebar" (marge gauche des pages HTML)
def sidebar_common(context, REQUEST=None):
"partie commune a toutes les sidebar"
authuser = REQUEST.AUTHENTICATED_USER
params = {"ScoURL": context.ScoURL(), "authuser": str(authuser)}
params = {
"ScoURL": context.ScoURL(),
"UsersURL": context.UsersURL(),
"NotesURL": context.NotesURL(),
"AbsencesURL": context.AbsencesURL(),
"authuser": str(authuser),
}
H = [
'<a class="scodoc_title" href="about">ScoDoc</a>',
'<div id="authuser"><a id="authuserlink" href="%(ScoURL)s/Users/userinfo">%(authuser)s</a><br/><a id="deconnectlink" href="%(ScoURL)s/acl_users/logout">déconnexion</a></div>'
@ -50,8 +56,8 @@ def sidebar_common(context, REQUEST=None):
context.sidebar_dept(REQUEST),
"""<h2 class="insidebar">Scolarit&eacute;</h2>
<a href="%(ScoURL)s" class="sidebar">Semestres</a> <br/>
<a href="%(ScoURL)s/Notes" class="sidebar">Programmes</a> <br/>
<a href="%(ScoURL)s/Absences" class="sidebar">Absences</a> <br/>
<a href="%(NotesURL)s" class="sidebar">Programmes</a> <br/>
<a href="%(AbsencesURL)s" class="sidebar">Absences</a> <br/>
"""
% params,
]
@ -60,14 +66,7 @@ def sidebar_common(context, REQUEST=None):
ScoUsersView, context
):
H.append(
"""<a href="%(ScoURL)s/Users" class="sidebar">Utilisateurs</a> <br/>"""
% params
)
if 0: # XXX experimental
H.append(
"""<a href="%(ScoURL)s/Notes/Services" class="sidebar">Services</a> <br/>"""
% params
"""<a href="%(UsersURL)s" class="sidebar">Utilisateurs</a> <br/>""" % params
)
if authuser.has_permission(ScoChangePreferences, context):

View File

@ -129,11 +129,12 @@ def index_html(context, REQUEST=None, showcodes=0, showsemtable=0):
)
H.append(
"""<p><form action="Notes/view_formsemestre_by_etape">
"""<p><form action="%s/view_formsemestre_by_etape">
Chercher étape courante: <input name="etape_apo" type="text" size="8" spellcheck="false"></input>
</form
</p>
"""
% context.NotesURL()
)
#
authuser = REQUEST.AUTHENTICATED_USER
@ -155,9 +156,10 @@ Chercher étape courante: <input name="etape_apo" type="text" size="8" spellchec
"""<hr>
<h3>Exports Apogée</h3>
<ul>
<li><a class="stdlink" href="Notes/semset_page">Années scolaires / exports Apogée</a></li>
<li><a class="stdlink" href="%s/semset_page">Années scolaires / exports Apogée</a></li>
</ul>
"""
% context.NotesURL()
)
#
H.append(
@ -175,9 +177,9 @@ Chercher étape courante: <input name="etape_apo" type="text" size="8" spellchec
def _sem_table(context, sems):
"""Affiche liste des semestres, utilisée pour semestres en cours"""
tmpl = """<tr class="%(trclass)s">%(tmpcode)s
<td class="semicon">%(lockimg)s <a href="Notes/formsemestre_status?formsemestre_id=%(formsemestre_id)s#groupes">%(groupicon)s</a></td>
<td class="semicon">%(lockimg)s <a href="%(notes_url)s/formsemestre_status?formsemestre_id=%(formsemestre_id)s#groupes">%(groupicon)s</a></td>
<td class="datesem">%(mois_debut)s</td><td class="datesem"><a title="%(session_id)s">-</a> %(mois_fin)s</td>
<td><a class="stdlink" href="Notes/formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(titre_num)s</a>
<td><a class="stdlink" href="%(notes_url)s/formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(titre_num)s</a>
<span class="respsem">(%(responsable_name)s)</span>
</td>
</tr>
@ -199,6 +201,7 @@ def _sem_table(context, sems):
cur_idx = sem["semestre_id"]
else:
sem["trclass"] = ""
sem["notes_url"] = context.NotesURL()
H.append(tmpl % sem)
H.append("</table>")
return "\n".join(H)
@ -245,14 +248,16 @@ def _sem_table_gt(context, sems, showcodes=False):
def _style_sems(context, sems):
"""ajoute quelques attributs de présentation pour la table"""
for sem in sems:
sem["notes_url"] = context.NotesURL()
sem["_groupicon_target"] = (
"Notes/formsemestre_status?formsemestre_id=%(formsemestre_id)s" % sem
"%(notes_url)s/formsemestre_status?formsemestre_id=%(formsemestre_id)s"
% sem
)
sem["_formsemestre_id_class"] = "blacktt"
sem["dash_mois_fin"] = '<a title="%(session_id)s"></a> %(anneescolaire)s' % sem
sem["_dash_mois_fin_class"] = "datesem"
sem["titre_resp"] = (
"""<a class="stdlink" href="Notes/formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(titre_num)s</a>
"""<a class="stdlink" href="%(notes_url)s/formsemestre_status?formsemestre_id=%(formsemestre_id)s">%(titre_num)s</a>
<span class="respsem">(%(responsable_name)s)</span>"""
% sem
)

View File

@ -108,7 +108,9 @@ def do_evaluation_delete(context, REQUEST, evaluation_id):
# news
mod = context.do_module_list(args={"module_id": M["module_id"]})[0]
mod["moduleimpl_id"] = M["moduleimpl_id"]
mod["url"] = "Notes/moduleimpl_status?moduleimpl_id=%(moduleimpl_id)s" % mod
mod["url"] = (
context.NotesURL() + "/moduleimpl_status?moduleimpl_id=%(moduleimpl_id)s" % mod
)
sco_news.add(
context,
REQUEST,

View File

@ -81,7 +81,7 @@ def formsemestre_custommenu_edit(context, formsemestre_id, REQUEST=None):
"""Dialog to edit the custom menu"""
sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
dest_url = (
context.NotesURL() + "formsemestre_status?formsemestre_id=%s" % formsemestre_id
context.NotesURL() + "/formsemestre_status?formsemestre_id=%s" % formsemestre_id
)
H = [
context.html_sem_header(REQUEST, "Modification du menu du semestre ", sem),

View File

@ -1265,7 +1265,7 @@ def formsemestre_delete(context, formsemestre_id, REQUEST=None):
elif tf[0] == -1: # cancel
return REQUEST.RESPONSE.redirect(
context.NotesURL()
+ "formsemestre_status?formsemestre_id="
+ "/formsemestre_status?formsemestre_id="
+ formsemestre_id
)
else:

View File

@ -505,10 +505,7 @@ def formsemestre_page_title(context, REQUEST):
def fill_formsemestre(context, sem, REQUEST=None):
"""Add some useful fields to help display formsemestres"""
# Notes URL
notes_url = context.absolute_url()
if "/Notes" not in notes_url:
notes_url += "/Notes"
notes_url = context.NotesURL()
sem["notes_url"] = notes_url
formsemestre_id = sem["formsemestre_id"]
if sem["etat"] != "1":

View File

@ -1163,8 +1163,8 @@ def formsemestre_validate_previous_ue(context, formsemestre_id, etudid, REQUEST=
return "\n".join(H) + tf[1] + X + warn + context.sco_footer(REQUEST)
elif tf[0] == -1:
return REQUEST.RESPONSE.redirect(
context.ScoURL()
+ "/Notes/formsemestre_status?formsemestre_id="
context.NotesURL()
+ "/formsemestre_status?formsemestre_id="
+ formsemestre_id
)
else:
@ -1310,8 +1310,8 @@ def etud_ue_suppress_validation(context, etudid, formsemestre_id, ue_id, REQUEST
_invalidate_etud_formation_caches(context, etudid, sem["formation_id"])
return REQUEST.RESPONSE.redirect(
context.ScoURL()
+ "/Notes/formsemestre_validate_previous_ue?etudid=%s&amp;formsemestre_id=%s"
context.NotesURL()
+ "/formsemestre_validate_previous_ue?etudid=%s&amp;formsemestre_id=%s"
% (etudid, formsemestre_id)
)

View File

@ -2047,7 +2047,7 @@ function set_global_pref(el, pref_name) {
)
dest_url = (
self.context.NotesURL()
+ "formsemestre_status?formsemestre_id=%s" % self.formsemestre_id
+ "/formsemestre_status?formsemestre_id=%s" % self.formsemestre_id
)
if tf[0] == 0:
return "\n".join(H) + tf[1] + self.context.sco_footer(REQUEST)