forked from ScoDoc/ScoDoc
Fix: URL
This commit is contained in:
parent
4b858591f4
commit
fca2740518
@ -394,6 +394,10 @@ REQUEST.URL0=%s<br/>
|
|||||||
"""
|
"""
|
||||||
return self.ScoURL() + "/Entreprises"
|
return self.ScoURL() + "/Entreprises"
|
||||||
|
|
||||||
|
def AbsencesURL(self):
|
||||||
|
"""URL of Absences"""
|
||||||
|
return self.ScoURL() + "/Absences"
|
||||||
|
|
||||||
def UsersURL(self):
|
def UsersURL(self):
|
||||||
"""URL of Users
|
"""URL of Users
|
||||||
e.g. https://scodoc.xxx.fr/ScoDoc/DEPT/Scolarite/Users
|
e.g. https://scodoc.xxx.fr/ScoDoc/DEPT/Scolarite/Users
|
||||||
|
@ -42,7 +42,13 @@ Génération de la "sidebar" (marge gauche des pages HTML)
|
|||||||
def sidebar_common(context, REQUEST=None):
|
def sidebar_common(context, REQUEST=None):
|
||||||
"partie commune a toutes les sidebar"
|
"partie commune a toutes les sidebar"
|
||||||
authuser = REQUEST.AUTHENTICATED_USER
|
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 = [
|
H = [
|
||||||
'<a class="scodoc_title" href="about">ScoDoc</a>',
|
'<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>'
|
'<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),
|
context.sidebar_dept(REQUEST),
|
||||||
"""<h2 class="insidebar">Scolarité</h2>
|
"""<h2 class="insidebar">Scolarité</h2>
|
||||||
<a href="%(ScoURL)s" class="sidebar">Semestres</a> <br/>
|
<a href="%(ScoURL)s" class="sidebar">Semestres</a> <br/>
|
||||||
<a href="%(ScoURL)s/Notes" class="sidebar">Programmes</a> <br/>
|
<a href="%(NotesURL)s" class="sidebar">Programmes</a> <br/>
|
||||||
<a href="%(ScoURL)s/Absences" class="sidebar">Absences</a> <br/>
|
<a href="%(AbsencesURL)s" class="sidebar">Absences</a> <br/>
|
||||||
"""
|
"""
|
||||||
% params,
|
% params,
|
||||||
]
|
]
|
||||||
@ -60,14 +66,7 @@ def sidebar_common(context, REQUEST=None):
|
|||||||
ScoUsersView, context
|
ScoUsersView, context
|
||||||
):
|
):
|
||||||
H.append(
|
H.append(
|
||||||
"""<a href="%(ScoURL)s/Users" class="sidebar">Utilisateurs</a> <br/>"""
|
"""<a href="%(UsersURL)s" class="sidebar">Utilisateurs</a> <br/>""" % params
|
||||||
% params
|
|
||||||
)
|
|
||||||
|
|
||||||
if 0: # XXX experimental
|
|
||||||
H.append(
|
|
||||||
"""<a href="%(ScoURL)s/Notes/Services" class="sidebar">Services</a> <br/>"""
|
|
||||||
% params
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if authuser.has_permission(ScoChangePreferences, context):
|
if authuser.has_permission(ScoChangePreferences, context):
|
||||||
|
17
sco_dept.py
17
sco_dept.py
@ -129,11 +129,12 @@ def index_html(context, REQUEST=None, showcodes=0, showsemtable=0):
|
|||||||
)
|
)
|
||||||
|
|
||||||
H.append(
|
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>
|
Chercher étape courante: <input name="etape_apo" type="text" size="8" spellcheck="false"></input>
|
||||||
</form
|
</form
|
||||||
</p>
|
</p>
|
||||||
"""
|
"""
|
||||||
|
% context.NotesURL()
|
||||||
)
|
)
|
||||||
#
|
#
|
||||||
authuser = REQUEST.AUTHENTICATED_USER
|
authuser = REQUEST.AUTHENTICATED_USER
|
||||||
@ -155,9 +156,10 @@ Chercher étape courante: <input name="etape_apo" type="text" size="8" spellchec
|
|||||||
"""<hr>
|
"""<hr>
|
||||||
<h3>Exports Apogée</h3>
|
<h3>Exports Apogée</h3>
|
||||||
<ul>
|
<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>
|
</ul>
|
||||||
"""
|
"""
|
||||||
|
% context.NotesURL()
|
||||||
)
|
)
|
||||||
#
|
#
|
||||||
H.append(
|
H.append(
|
||||||
@ -175,9 +177,9 @@ Chercher étape courante: <input name="etape_apo" type="text" size="8" spellchec
|
|||||||
def _sem_table(context, sems):
|
def _sem_table(context, sems):
|
||||||
"""Affiche liste des semestres, utilisée pour semestres en cours"""
|
"""Affiche liste des semestres, utilisée pour semestres en cours"""
|
||||||
tmpl = """<tr class="%(trclass)s">%(tmpcode)s
|
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 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>
|
<span class="respsem">(%(responsable_name)s)</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -199,6 +201,7 @@ def _sem_table(context, sems):
|
|||||||
cur_idx = sem["semestre_id"]
|
cur_idx = sem["semestre_id"]
|
||||||
else:
|
else:
|
||||||
sem["trclass"] = ""
|
sem["trclass"] = ""
|
||||||
|
sem["notes_url"] = context.NotesURL()
|
||||||
H.append(tmpl % sem)
|
H.append(tmpl % sem)
|
||||||
H.append("</table>")
|
H.append("</table>")
|
||||||
return "\n".join(H)
|
return "\n".join(H)
|
||||||
@ -245,14 +248,16 @@ def _sem_table_gt(context, sems, showcodes=False):
|
|||||||
def _style_sems(context, sems):
|
def _style_sems(context, sems):
|
||||||
"""ajoute quelques attributs de présentation pour la table"""
|
"""ajoute quelques attributs de présentation pour la table"""
|
||||||
for sem in sems:
|
for sem in sems:
|
||||||
|
sem["notes_url"] = context.NotesURL()
|
||||||
sem["_groupicon_target"] = (
|
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["_formsemestre_id_class"] = "blacktt"
|
||||||
sem["dash_mois_fin"] = '<a title="%(session_id)s"></a> %(anneescolaire)s' % sem
|
sem["dash_mois_fin"] = '<a title="%(session_id)s"></a> %(anneescolaire)s' % sem
|
||||||
sem["_dash_mois_fin_class"] = "datesem"
|
sem["_dash_mois_fin_class"] = "datesem"
|
||||||
sem["titre_resp"] = (
|
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>"""
|
<span class="respsem">(%(responsable_name)s)</span>"""
|
||||||
% sem
|
% sem
|
||||||
)
|
)
|
||||||
|
@ -108,7 +108,9 @@ def do_evaluation_delete(context, REQUEST, evaluation_id):
|
|||||||
# news
|
# news
|
||||||
mod = context.do_module_list(args={"module_id": M["module_id"]})[0]
|
mod = context.do_module_list(args={"module_id": M["module_id"]})[0]
|
||||||
mod["moduleimpl_id"] = M["moduleimpl_id"]
|
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(
|
sco_news.add(
|
||||||
context,
|
context,
|
||||||
REQUEST,
|
REQUEST,
|
||||||
|
@ -81,7 +81,7 @@ def formsemestre_custommenu_edit(context, formsemestre_id, REQUEST=None):
|
|||||||
"""Dialog to edit the custom menu"""
|
"""Dialog to edit the custom menu"""
|
||||||
sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
|
sem = sco_formsemestre.get_formsemestre(context, formsemestre_id)
|
||||||
dest_url = (
|
dest_url = (
|
||||||
context.NotesURL() + "formsemestre_status?formsemestre_id=%s" % formsemestre_id
|
context.NotesURL() + "/formsemestre_status?formsemestre_id=%s" % formsemestre_id
|
||||||
)
|
)
|
||||||
H = [
|
H = [
|
||||||
context.html_sem_header(REQUEST, "Modification du menu du semestre ", sem),
|
context.html_sem_header(REQUEST, "Modification du menu du semestre ", sem),
|
||||||
|
@ -1265,7 +1265,7 @@ def formsemestre_delete(context, formsemestre_id, REQUEST=None):
|
|||||||
elif tf[0] == -1: # cancel
|
elif tf[0] == -1: # cancel
|
||||||
return REQUEST.RESPONSE.redirect(
|
return REQUEST.RESPONSE.redirect(
|
||||||
context.NotesURL()
|
context.NotesURL()
|
||||||
+ "formsemestre_status?formsemestre_id="
|
+ "/formsemestre_status?formsemestre_id="
|
||||||
+ formsemestre_id
|
+ formsemestre_id
|
||||||
)
|
)
|
||||||
else:
|
else:
|
||||||
|
@ -505,10 +505,7 @@ def formsemestre_page_title(context, REQUEST):
|
|||||||
|
|
||||||
def fill_formsemestre(context, sem, REQUEST=None):
|
def fill_formsemestre(context, sem, REQUEST=None):
|
||||||
"""Add some useful fields to help display formsemestres"""
|
"""Add some useful fields to help display formsemestres"""
|
||||||
# Notes URL
|
notes_url = context.NotesURL()
|
||||||
notes_url = context.absolute_url()
|
|
||||||
if "/Notes" not in notes_url:
|
|
||||||
notes_url += "/Notes"
|
|
||||||
sem["notes_url"] = notes_url
|
sem["notes_url"] = notes_url
|
||||||
formsemestre_id = sem["formsemestre_id"]
|
formsemestre_id = sem["formsemestre_id"]
|
||||||
if sem["etat"] != "1":
|
if sem["etat"] != "1":
|
||||||
|
@ -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)
|
return "\n".join(H) + tf[1] + X + warn + context.sco_footer(REQUEST)
|
||||||
elif tf[0] == -1:
|
elif tf[0] == -1:
|
||||||
return REQUEST.RESPONSE.redirect(
|
return REQUEST.RESPONSE.redirect(
|
||||||
context.ScoURL()
|
context.NotesURL()
|
||||||
+ "/Notes/formsemestre_status?formsemestre_id="
|
+ "/formsemestre_status?formsemestre_id="
|
||||||
+ formsemestre_id
|
+ formsemestre_id
|
||||||
)
|
)
|
||||||
else:
|
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"])
|
_invalidate_etud_formation_caches(context, etudid, sem["formation_id"])
|
||||||
|
|
||||||
return REQUEST.RESPONSE.redirect(
|
return REQUEST.RESPONSE.redirect(
|
||||||
context.ScoURL()
|
context.NotesURL()
|
||||||
+ "/Notes/formsemestre_validate_previous_ue?etudid=%s&formsemestre_id=%s"
|
+ "/formsemestre_validate_previous_ue?etudid=%s&formsemestre_id=%s"
|
||||||
% (etudid, formsemestre_id)
|
% (etudid, formsemestre_id)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -2047,7 +2047,7 @@ function set_global_pref(el, pref_name) {
|
|||||||
)
|
)
|
||||||
dest_url = (
|
dest_url = (
|
||||||
self.context.NotesURL()
|
self.context.NotesURL()
|
||||||
+ "formsemestre_status?formsemestre_id=%s" % self.formsemestre_id
|
+ "/formsemestre_status?formsemestre_id=%s" % self.formsemestre_id
|
||||||
)
|
)
|
||||||
if tf[0] == 0:
|
if tf[0] == 0:
|
||||||
return "\n".join(H) + tf[1] + self.context.sco_footer(REQUEST)
|
return "\n".join(H) + tf[1] + self.context.sco_footer(REQUEST)
|
||||||
|
Loading…
Reference in New Issue
Block a user