forked from ScoDoc/ScoDoc
Merge branch 'master' into dyn_fields
This commit is contained in:
commit
cd06a780d5
@ -20,7 +20,9 @@
|
||||
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
||||
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.from flask import jsonify
|
||||
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
from flask import jsonify
|
||||
from werkzeug.http import HTTP_STATUS_CODES
|
||||
|
||||
|
||||
|
@ -379,6 +379,25 @@ def bonus_iutbethune(notes_sport, coefs, infos=None):
|
||||
return bonus
|
||||
|
||||
|
||||
def bonus_iutbeziers(notes_sport, coefs, infos=None):
|
||||
"""Calcul bonus modules optionels (sport, culture), regle IUT BEZIERS
|
||||
|
||||
Les étudiants de l'IUT peuvent suivre des enseignements optionnels
|
||||
sport , etc) non rattaches à une unité d'enseignement. Les points
|
||||
au-dessus de 10 sur 20 obtenus dans chacune des matières
|
||||
optionnelles sont cumulés et 3% de ces points cumulés s'ajoutent à
|
||||
la moyenne générale du semestre déjà obtenue par l'étudiant.
|
||||
"""
|
||||
sumc = sum(coefs) # assumes sum. coefs > 0
|
||||
# note_sport = sum(map(mul, notes_sport, coefs)) / sumc # moyenne pondérée
|
||||
bonus = sum([(x - 10) * 0.03 for x in notes_sport if x > 10])
|
||||
# le total du bonus ne doit pas dépasser 0.3 - Fred, 28/01/2020
|
||||
|
||||
if bonus > 0.3:
|
||||
bonus = 0.3
|
||||
return bonus
|
||||
|
||||
|
||||
def bonus_demo(notes_sport, coefs, infos=None):
|
||||
"""Fausse fonction "bonus" pour afficher les informations disponibles
|
||||
et aider les développeurs.
|
||||
|
@ -318,13 +318,7 @@ def sco_footer():
|
||||
|
||||
|
||||
def html_sem_header(
|
||||
REQUEST,
|
||||
title,
|
||||
sem=None,
|
||||
with_page_header=True,
|
||||
with_h2=True,
|
||||
page_title=None,
|
||||
**args
|
||||
title, sem=None, with_page_header=True, with_h2=True, page_title=None, **args
|
||||
):
|
||||
"Titre d'une page semestre avec lien vers tableau de bord"
|
||||
# sem now unused and thus optional...
|
||||
|
@ -626,7 +626,6 @@ def add_absence(
|
||||
jour,
|
||||
matin,
|
||||
estjust,
|
||||
REQUEST,
|
||||
description=None,
|
||||
moduleimpl_id=None,
|
||||
):
|
||||
@ -656,7 +655,7 @@ def add_absence(
|
||||
sco_abs_notification.abs_notify(etudid, jour)
|
||||
|
||||
|
||||
def add_justif(etudid, jour, matin, REQUEST, description=None):
|
||||
def add_justif(etudid, jour, matin, description=None):
|
||||
"Ajoute un justificatif dans la base"
|
||||
# unpublished
|
||||
if _isFarFutur(jour):
|
||||
@ -665,7 +664,9 @@ def add_justif(etudid, jour, matin, REQUEST, description=None):
|
||||
cnx = ndb.GetDBConnexion()
|
||||
cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor)
|
||||
cursor.execute(
|
||||
"insert into absences (etudid,jour,estabs,estjust,matin, description) values (%(etudid)s,%(jour)s, FALSE, TRUE, %(matin)s, %(description)s )",
|
||||
"""INSERT INTO absences (etudid, jour, estabs, estjust, matin, description)
|
||||
VALUES (%(etudid)s, %(jour)s, FALSE, TRUE, %(matin)s, %(description)s)
|
||||
""",
|
||||
vars(),
|
||||
)
|
||||
logdb(
|
||||
@ -678,7 +679,7 @@ def add_justif(etudid, jour, matin, REQUEST, description=None):
|
||||
invalidate_abs_etud_date(etudid, jour)
|
||||
|
||||
|
||||
def _add_abslist(abslist, REQUEST, moduleimpl_id=None):
|
||||
def add_abslist(abslist, moduleimpl_id=None):
|
||||
for a in abslist:
|
||||
etudid, jour, ampm = a.split(":")
|
||||
if ampm == "am":
|
||||
@ -689,7 +690,7 @@ def _add_abslist(abslist, REQUEST, moduleimpl_id=None):
|
||||
raise ValueError("invalid ampm !")
|
||||
# ajoute abs si pas deja absent
|
||||
if count_abs(etudid, jour, jour, matin, moduleimpl_id) == 0:
|
||||
add_absence(etudid, jour, matin, 0, REQUEST, "", moduleimpl_id)
|
||||
add_absence(etudid, jour, matin, 0, "", moduleimpl_id)
|
||||
|
||||
|
||||
def annule_absence(etudid, jour, matin, moduleimpl_id=None):
|
||||
@ -721,7 +722,7 @@ def annule_absence(etudid, jour, matin, moduleimpl_id=None):
|
||||
invalidate_abs_etud_date(etudid, jour)
|
||||
|
||||
|
||||
def annule_justif(etudid, jour, matin, REQUEST=None):
|
||||
def annule_justif(etudid, jour, matin):
|
||||
"Annule un justificatif"
|
||||
# unpublished
|
||||
matin = _toboolean(matin)
|
||||
|
@ -58,7 +58,6 @@ def doSignaleAbsence(
|
||||
estjust=False,
|
||||
description=None,
|
||||
etudid=False,
|
||||
REQUEST=None,
|
||||
): # etudid implied
|
||||
"""Signalement d'une absence.
|
||||
|
||||
@ -69,7 +68,8 @@ def doSignaleAbsence(
|
||||
demijournee: 2 si journée complète, 1 matin, 0 après-midi
|
||||
estjust: absence justifiée
|
||||
description: str
|
||||
etudid: etudiant concerné. Si non spécifié, cherche dans REQUEST.form
|
||||
etudid: etudiant concerné. Si non spécifié, cherche dans
|
||||
les paramètres de la requête courante.
|
||||
"""
|
||||
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
|
||||
etudid = etud["etudid"]
|
||||
@ -86,7 +86,6 @@ def doSignaleAbsence(
|
||||
jour,
|
||||
False,
|
||||
estjust,
|
||||
REQUEST,
|
||||
description_abs,
|
||||
moduleimpl_id,
|
||||
)
|
||||
@ -95,7 +94,6 @@ def doSignaleAbsence(
|
||||
jour,
|
||||
True,
|
||||
estjust,
|
||||
REQUEST,
|
||||
description_abs,
|
||||
moduleimpl_id,
|
||||
)
|
||||
@ -106,7 +104,6 @@ def doSignaleAbsence(
|
||||
jour,
|
||||
demijournee,
|
||||
estjust,
|
||||
REQUEST,
|
||||
description_abs,
|
||||
moduleimpl_id,
|
||||
)
|
||||
@ -156,7 +153,7 @@ def doSignaleAbsence(
|
||||
return "\n".join(H)
|
||||
|
||||
|
||||
def SignaleAbsenceEtud(REQUEST=None): # etudid implied
|
||||
def SignaleAbsenceEtud(): # etudid implied
|
||||
"""Formulaire individuel simple de signalement d'une absence"""
|
||||
# brute-force portage from very old dtml code ...
|
||||
etud = sco_etud.get_etud_info(filled=True)[0]
|
||||
@ -228,7 +225,6 @@ def SignaleAbsenceEtud(REQUEST=None): # etudid implied
|
||||
sco_photos.etud_photo_html(
|
||||
etudid=etudid,
|
||||
title="fiche de " + etud["nomprenom"],
|
||||
REQUEST=REQUEST,
|
||||
),
|
||||
"""</a></td></tr></table>""",
|
||||
"""
|
||||
@ -281,7 +277,6 @@ def doJustifAbsence(
|
||||
demijournee,
|
||||
description=None,
|
||||
etudid=False,
|
||||
REQUEST=None,
|
||||
): # etudid implied
|
||||
"""Justification d'une absence
|
||||
|
||||
@ -291,7 +286,8 @@ def doJustifAbsence(
|
||||
demijournee: 2 si journée complète, 1 matin, 0 après-midi
|
||||
estjust: absence justifiée
|
||||
description: str
|
||||
etudid: etudiant concerné. Si non spécifié, cherche dans REQUEST.form
|
||||
etudid: etudiant concerné. Si non spécifié, cherche dans les
|
||||
paramètres de la requête.
|
||||
"""
|
||||
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
|
||||
etudid = etud["etudid"]
|
||||
@ -305,14 +301,12 @@ def doJustifAbsence(
|
||||
etudid=etudid,
|
||||
jour=jour,
|
||||
matin=False,
|
||||
REQUEST=REQUEST,
|
||||
description=description_abs,
|
||||
)
|
||||
sco_abs.add_justif(
|
||||
etudid=etudid,
|
||||
jour=jour,
|
||||
matin=True,
|
||||
REQUEST=REQUEST,
|
||||
description=description_abs,
|
||||
)
|
||||
nbadded += 2
|
||||
@ -321,7 +315,6 @@ def doJustifAbsence(
|
||||
etudid=etudid,
|
||||
jour=jour,
|
||||
matin=demijournee,
|
||||
REQUEST=REQUEST,
|
||||
description=description_abs,
|
||||
)
|
||||
nbadded += 1
|
||||
@ -357,7 +350,7 @@ def doJustifAbsence(
|
||||
return "\n".join(H)
|
||||
|
||||
|
||||
def JustifAbsenceEtud(REQUEST=None): # etudid implied
|
||||
def JustifAbsenceEtud(): # etudid implied
|
||||
"""Formulaire individuel simple de justification d'une absence"""
|
||||
# brute-force portage from very old dtml code ...
|
||||
etud = sco_etud.get_etud_info(filled=True)[0]
|
||||
@ -376,7 +369,6 @@ def JustifAbsenceEtud(REQUEST=None): # etudid implied
|
||||
sco_photos.etud_photo_html(
|
||||
etudid=etudid,
|
||||
title="fiche de " + etud["nomprenom"],
|
||||
REQUEST=REQUEST,
|
||||
),
|
||||
"""</a></td></tr></table>""",
|
||||
"""
|
||||
@ -412,9 +404,7 @@ Raison: <input type="text" name="description" size="42"/> (optionnel)
|
||||
return "\n".join(H)
|
||||
|
||||
|
||||
def doAnnuleAbsence(
|
||||
datedebut, datefin, demijournee, etudid=False, REQUEST=None
|
||||
): # etudid implied
|
||||
def doAnnuleAbsence(datedebut, datefin, demijournee, etudid=False): # etudid implied
|
||||
"""Annulation des absences pour une demi journée"""
|
||||
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
|
||||
etudid = etud["etudid"]
|
||||
@ -462,7 +452,7 @@ autre absence pour <b>%(nomprenom)s</b></a></li>
|
||||
return "\n".join(H)
|
||||
|
||||
|
||||
def AnnuleAbsenceEtud(REQUEST=None): # etudid implied
|
||||
def AnnuleAbsenceEtud(): # etudid implied
|
||||
"""Formulaire individuel simple d'annulation d'une absence"""
|
||||
# brute-force portage from very old dtml code ...
|
||||
etud = sco_etud.get_etud_info(filled=True)[0]
|
||||
@ -482,7 +472,6 @@ def AnnuleAbsenceEtud(REQUEST=None): # etudid implied
|
||||
sco_photos.etud_photo_html(
|
||||
etudid=etudid,
|
||||
title="fiche de " + etud["nomprenom"],
|
||||
REQUEST=REQUEST,
|
||||
),
|
||||
"""</a></td></tr></table>""",
|
||||
"""<p>A n'utiliser que suite à une erreur de saisie ou lorsqu'il s'avère que l'étudiant était en fait présent. </p>
|
||||
@ -548,7 +537,7 @@ def AnnuleAbsenceEtud(REQUEST=None): # etudid implied
|
||||
return "\n".join(H)
|
||||
|
||||
|
||||
def doAnnuleJustif(datedebut0, datefin0, demijournee, REQUEST=None): # etudid implied
|
||||
def doAnnuleJustif(datedebut0, datefin0, demijournee): # etudid implied
|
||||
"""Annulation d'une justification"""
|
||||
etud = sco_etud.get_etud_info(filled=True)[0]
|
||||
etudid = etud["etudid"]
|
||||
@ -558,11 +547,11 @@ def doAnnuleJustif(datedebut0, datefin0, demijournee, REQUEST=None): # etudid i
|
||||
for jour in dates:
|
||||
# Attention: supprime matin et après-midi
|
||||
if demijournee == 2:
|
||||
sco_abs.annule_justif(etudid, jour, False, REQUEST=REQUEST)
|
||||
sco_abs.annule_justif(etudid, jour, True, REQUEST=REQUEST)
|
||||
sco_abs.annule_justif(etudid, jour, False)
|
||||
sco_abs.annule_justif(etudid, jour, True)
|
||||
nbadded += 2
|
||||
else:
|
||||
sco_abs.annule_justif(etudid, jour, demijournee, REQUEST=REQUEST)
|
||||
sco_abs.annule_justif(etudid, jour, demijournee)
|
||||
nbadded += 1
|
||||
#
|
||||
H = [
|
||||
@ -716,7 +705,6 @@ def formChoixSemestreGroupe(all=False):
|
||||
def CalAbs(etudid, sco_year=None):
|
||||
"""Calendrier des absences d'un etudiant"""
|
||||
# crude portage from 1999 DTML
|
||||
REQUEST = None # XXX
|
||||
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
|
||||
etudid = etud["etudid"]
|
||||
anneescolaire = int(scu.AnneeScolaire(sco_year))
|
||||
@ -766,7 +754,6 @@ def CalAbs(etudid, sco_year=None):
|
||||
sco_photos.etud_photo_html(
|
||||
etudid=etudid,
|
||||
title="fiche de " + etud["nomprenom"],
|
||||
REQUEST=REQUEST,
|
||||
),
|
||||
),
|
||||
CalHTML,
|
||||
@ -791,7 +778,6 @@ def ListeAbsEtud(
|
||||
format="html",
|
||||
absjust_only=0,
|
||||
sco_year=None,
|
||||
REQUEST=None,
|
||||
):
|
||||
"""Liste des absences d'un étudiant sur l'année en cours
|
||||
En format 'html': page avec deux tableaux (non justifiées et justifiées).
|
||||
@ -810,10 +796,10 @@ def ListeAbsEtud(
|
||||
etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
|
||||
|
||||
# Liste des absences et titres colonnes tables:
|
||||
titles, columns_ids, absnonjust, absjust = _TablesAbsEtud(
|
||||
titles, columns_ids, absnonjust, absjust = _tables_abs_etud(
|
||||
etudid, datedebut, with_evals=with_evals, format=format
|
||||
)
|
||||
if REQUEST:
|
||||
if request.base_url:
|
||||
base_url_nj = "%s?etudid=%s&absjust_only=0" % (request.base_url, etudid)
|
||||
base_url_j = "%s?etudid=%s&absjust_only=1" % (request.base_url, etudid)
|
||||
else:
|
||||
@ -896,13 +882,12 @@ def ListeAbsEtud(
|
||||
raise ValueError("Invalid format !")
|
||||
|
||||
|
||||
def _TablesAbsEtud(
|
||||
def _tables_abs_etud(
|
||||
etudid,
|
||||
datedebut,
|
||||
with_evals=True,
|
||||
format="html",
|
||||
absjust_only=0,
|
||||
REQUEST=None,
|
||||
):
|
||||
"""Tables des absences justifiees et non justifiees d'un étudiant
|
||||
sur l'année en cours
|
||||
|
@ -395,7 +395,6 @@ def formsemestre_archive(REQUEST, formsemestre_id, group_ids=[]):
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Archiver les PV et résultats du semestre",
|
||||
sem=sem,
|
||||
javascripts=sco_groups_view.JAVASCRIPTS,
|
||||
@ -517,7 +516,7 @@ def formsemestre_list_archives(REQUEST, formsemestre_id):
|
||||
}
|
||||
L.append(a)
|
||||
|
||||
H = [html_sco_header.html_sem_header(REQUEST, "Archive des PV et résultats ", sem)]
|
||||
H = [html_sco_header.html_sem_header("Archive des PV et résultats ", sem)]
|
||||
if not L:
|
||||
H.append("<p>aucune archive enregistrée</p>")
|
||||
else:
|
||||
|
@ -1217,9 +1217,7 @@ def _formsemestre_bulletinetud_header_html(
|
||||
"""
|
||||
% (
|
||||
url_for("scolar.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etudid),
|
||||
sco_photos.etud_photo_html(
|
||||
etud, title="fiche de " + etud["nom"], REQUEST=REQUEST
|
||||
),
|
||||
sco_photos.etud_photo_html(etud, title="fiche de " + etud["nom"]),
|
||||
)
|
||||
)
|
||||
H.append(
|
||||
|
@ -311,7 +311,7 @@ def invalidate_sems_in_formation(formation_id):
|
||||
) # > formation modif.
|
||||
|
||||
|
||||
def module_move(module_id, after=0, REQUEST=None, redirect=1):
|
||||
def module_move(module_id, after=0, redirect=1):
|
||||
"""Move before/after previous one (decrement/increment numero)"""
|
||||
module = sco_edit_module.do_module_list({"module_id": module_id})[0]
|
||||
redirect = int(redirect)
|
||||
|
@ -780,7 +780,6 @@ def formsemestre_evaluations_cal(formsemestre_id, REQUEST=None):
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Evaluations du semestre",
|
||||
sem,
|
||||
cssstyles=["css/calabs.css"],
|
||||
|
@ -93,9 +93,7 @@ def formation_has_locked_sems(formation_id):
|
||||
return sems
|
||||
|
||||
|
||||
def formation_export(
|
||||
formation_id, export_ids=False, export_tags=True, format=None, REQUEST=None
|
||||
):
|
||||
def formation_export(formation_id, export_ids=False, export_tags=True, format=None):
|
||||
"""Get a formation, with UE, matieres, modules
|
||||
in desired format
|
||||
"""
|
||||
@ -161,20 +159,18 @@ def formation_import_xml(doc: str, import_tags=True):
|
||||
D = sco_xml.xml_to_dicts(f)
|
||||
assert D[0] == "formation"
|
||||
F = D[1]
|
||||
F_quoted = F.copy()
|
||||
log("F=%s" % F)
|
||||
ndb.quote_dict(F_quoted)
|
||||
log("F_quoted=%s" % F_quoted)
|
||||
# F_quoted = F.copy()
|
||||
# ndb.quote_dict(F_quoted)
|
||||
F["dept_id"] = g.scodoc_dept_id
|
||||
# find new version number
|
||||
cnx = ndb.GetDBConnexion()
|
||||
cursor = cnx.cursor(cursor_factory=ndb.ScoDocCursor)
|
||||
log(
|
||||
"select max(version) from notes_formations where acronyme=%(acronyme)s and titre=%(titre)s"
|
||||
% F_quoted
|
||||
)
|
||||
cursor.execute(
|
||||
"select max(version) from notes_formations where acronyme=%(acronyme)s and titre=%(titre)s",
|
||||
F_quoted,
|
||||
"""SELECT max(version)
|
||||
FROM notes_formations
|
||||
WHERE acronyme=%(acronyme)s and titre=%(titre)s and dept_id=%(dept_id)s
|
||||
""",
|
||||
F,
|
||||
)
|
||||
res = cursor.fetchall()
|
||||
try:
|
||||
@ -195,7 +191,7 @@ def formation_import_xml(doc: str, import_tags=True):
|
||||
assert ue_info[0] == "ue"
|
||||
ue_info[1]["formation_id"] = formation_id
|
||||
if "ue_id" in ue_info[1]:
|
||||
xml_ue_id = ue_info[1]["ue_id"]
|
||||
xml_ue_id = int(ue_info[1]["ue_id"])
|
||||
del ue_info[1]["ue_id"]
|
||||
else:
|
||||
xml_ue_id = None
|
||||
@ -211,7 +207,7 @@ def formation_import_xml(doc: str, import_tags=True):
|
||||
for mod_info in mat_info[2]:
|
||||
assert mod_info[0] == "module"
|
||||
if "module_id" in mod_info[1]:
|
||||
xml_module_id = mod_info[1]["module_id"]
|
||||
xml_module_id = int(mod_info[1]["module_id"])
|
||||
del mod_info[1]["module_id"]
|
||||
else:
|
||||
xml_module_id = None
|
||||
@ -229,7 +225,7 @@ def formation_import_xml(doc: str, import_tags=True):
|
||||
return formation_id, modules_old2new, ues_old2new
|
||||
|
||||
|
||||
def formation_list_table(formation_id=None, args={}, REQUEST=None):
|
||||
def formation_list_table(formation_id=None, args={}):
|
||||
"""List formation, grouped by titre and sorted by versions
|
||||
and listing associated semestres
|
||||
returns a table
|
||||
@ -353,10 +349,11 @@ def formation_list_table(formation_id=None, args={}, REQUEST=None):
|
||||
)
|
||||
|
||||
|
||||
def formation_create_new_version(formation_id, redirect=True, REQUEST=None):
|
||||
def formation_create_new_version(formation_id, redirect=True):
|
||||
"duplicate formation, with new version number"
|
||||
xml = formation_export(formation_id, export_ids=True, format="xml")
|
||||
new_id, modules_old2new, ues_old2new = formation_import_xml(xml)
|
||||
resp = formation_export(formation_id, export_ids=True, format="xml")
|
||||
xml_data = resp.get_data(as_text=True)
|
||||
new_id, modules_old2new, ues_old2new = formation_import_xml(xml_data)
|
||||
# news
|
||||
F = formation_list(args={"formation_id": new_id})[0]
|
||||
sco_news.add(
|
||||
|
@ -96,6 +96,7 @@ _formsemestreEditor = ndb.EditableTable(
|
||||
def get_formsemestre(formsemestre_id):
|
||||
"list ONE formsemestre"
|
||||
if not isinstance(formsemestre_id, int):
|
||||
raise ValueError()
|
||||
raise ScoValueError(
|
||||
"""Semestre invalide, reprenez l'opération au départ ou si le problème persiste signalez l'erreur sur scodoc-devel@listes.univ-paris13.fr"""
|
||||
)
|
||||
@ -566,7 +567,7 @@ def list_formsemestre_by_etape(etape_apo=False, annee_scolaire=False):
|
||||
return sems
|
||||
|
||||
|
||||
def view_formsemestre_by_etape(etape_apo=None, format="html", REQUEST=None):
|
||||
def view_formsemestre_by_etape(etape_apo=None, format="html"):
|
||||
"""Affiche table des semestres correspondants à l'étape"""
|
||||
if etape_apo:
|
||||
html_title = (
|
||||
|
@ -84,9 +84,7 @@ def formsemestre_custommenu_edit(formsemestre_id, REQUEST=None):
|
||||
scu.NotesURL() + "/formsemestre_status?formsemestre_id=%s" % formsemestre_id
|
||||
)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST, "Modification du menu du semestre ", sem
|
||||
),
|
||||
html_sco_header.html_sem_header("Modification du menu du semestre ", sem),
|
||||
"""<p class="help">Ce menu, spécifique à chaque semestre, peut être utilisé pour placer des liens vers vos applications préférées.</p>
|
||||
<p class="help">Procédez en plusieurs fois si vous voulez ajouter plusieurs items.</p>""",
|
||||
]
|
||||
|
@ -91,7 +91,6 @@ def formsemestre_editwithmodules(REQUEST, formsemestre_id):
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Modification du semestre",
|
||||
sem,
|
||||
javascripts=["libjs/AutoSuggest.js"],
|
||||
@ -895,7 +894,6 @@ def formsemestre_clone(formsemestre_id, REQUEST=None):
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Copie du semestre",
|
||||
sem,
|
||||
javascripts=["libjs/AutoSuggest.js"],
|
||||
@ -1120,10 +1118,11 @@ def do_formsemestre_clone(
|
||||
def formsemestre_associate_new_version(
|
||||
formsemestre_id,
|
||||
other_formsemestre_ids=[],
|
||||
REQUEST=None,
|
||||
dialog_confirmed=False,
|
||||
):
|
||||
"""Formulaire changement formation d'un semestre"""
|
||||
formsemestre_id = int(formsemestre_id)
|
||||
other_formsemestre_ids = [int(x) for x in other_formsemestre_ids]
|
||||
if not dialog_confirmed:
|
||||
# dresse le liste des semestres de la meme formation et version
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
@ -1168,15 +1167,19 @@ def formsemestre_associate_new_version(
|
||||
)
|
||||
else:
|
||||
do_formsemestres_associate_new_version(
|
||||
[formsemestre_id] + other_formsemestre_ids, REQUEST=REQUEST
|
||||
[formsemestre_id] + other_formsemestre_ids
|
||||
)
|
||||
return flask.redirect(
|
||||
"formsemestre_status?formsemestre_id=%s&head_message=Formation%%20dupliquée"
|
||||
% formsemestre_id
|
||||
url_for(
|
||||
"notes.formsemestre_status",
|
||||
scodoc_dept=g.scodoc_dept,
|
||||
formsemestre_id=formsemestre_id,
|
||||
head_message="Formation dupliquée",
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
def do_formsemestres_associate_new_version(formsemestre_ids, REQUEST=None):
|
||||
def do_formsemestres_associate_new_version(formsemestre_ids):
|
||||
"""Cree une nouvelle version de la formation du semestre, et y rattache les semestres.
|
||||
Tous les moduleimpl sont ré-associés à la nouvelle formation, ainsi que les decisions de jury
|
||||
si elles existent (codes d'UE validées).
|
||||
@ -1186,9 +1189,11 @@ def do_formsemestres_associate_new_version(formsemestre_ids, REQUEST=None):
|
||||
if not formsemestre_ids:
|
||||
return
|
||||
# Check: tous de la même formation
|
||||
assert isinstance(formsemestre_ids[0], int)
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_ids[0])
|
||||
formation_id = sem["formation_id"]
|
||||
for formsemestre_id in formsemestre_ids[1:]:
|
||||
assert isinstance(formsemestre_id, int)
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
if formation_id != sem["formation_id"]:
|
||||
raise ScoValueError("les semestres ne sont pas tous de la même formation !")
|
||||
@ -1199,9 +1204,7 @@ def do_formsemestres_associate_new_version(formsemestre_ids, REQUEST=None):
|
||||
formation_id,
|
||||
modules_old2new,
|
||||
ues_old2new,
|
||||
) = sco_formations.formation_create_new_version(
|
||||
formation_id, redirect=False, REQUEST=REQUEST
|
||||
)
|
||||
) = sco_formations.formation_create_new_version(formation_id, redirect=False)
|
||||
|
||||
for formsemestre_id in formsemestre_ids:
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
@ -1242,7 +1245,7 @@ def formsemestre_delete(formsemestre_id, REQUEST=None):
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
F = sco_formations.formation_list(args={"formation_id": sem["formation_id"]})[0]
|
||||
H = [
|
||||
html_sco_header.html_sem_header(REQUEST, "Suppression du semestre", sem),
|
||||
html_sco_header.html_sem_header("Suppression du semestre", sem),
|
||||
"""<div class="ue_warning"><span>Attention !</span>
|
||||
<p class="help">A n'utiliser qu'en cas d'erreur lors de la saisie d'une formation. Normalement,
|
||||
<b>un semestre ne doit jamais être supprimé</b> (on perd la mémoire des notes et de tous les événements liés à ce semestre !).</p>
|
||||
@ -1545,9 +1548,7 @@ def formsemestre_edit_uecoefs(formsemestre_id, err_ue_id=None, REQUEST=None):
|
||||
</p>
|
||||
"""
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST, "Coefficients des UE du semestre", sem
|
||||
),
|
||||
html_sco_header.html_sem_header("Coefficients des UE du semestre", sem),
|
||||
help,
|
||||
]
|
||||
#
|
||||
@ -1659,9 +1660,7 @@ def formsemestre_edit_uecoefs(formsemestre_id, err_ue_id=None, REQUEST=None):
|
||||
formsemestre_id=formsemestre_id
|
||||
) # > modif coef UE cap (modifs notes de _certains_ etudiants)
|
||||
|
||||
header = html_sco_header.html_sem_header(
|
||||
REQUEST, "Coefficients des UE du semestre", sem
|
||||
)
|
||||
header = html_sco_header.html_sem_header("Coefficients des UE du semestre", sem)
|
||||
return (
|
||||
header
|
||||
+ "\n".join(z)
|
||||
|
@ -334,7 +334,6 @@ def formsemestre_inscription_with_modules(
|
||||
etud = sco_etud.get_etud_info(etudid=etudid, filled=True)[0]
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Inscription de %s dans ce semestre" % etud["nomprenom"],
|
||||
sem,
|
||||
)
|
||||
@ -763,7 +762,6 @@ def formsemestre_inscrits_ailleurs(formsemestre_id, REQUEST=None):
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Inscriptions multiples parmi les étudiants du semestre ",
|
||||
sem,
|
||||
)
|
||||
|
@ -701,7 +701,7 @@ def formsemestre_description_table(formsemestre_id, REQUEST=None, with_evals=Fal
|
||||
% (request.base_url, formsemestre_id, with_evals),
|
||||
page_title=title,
|
||||
html_title=html_sco_header.html_sem_header(
|
||||
REQUEST, "Description du semestre", sem, with_page_header=False
|
||||
"Description du semestre", sem, with_page_header=False
|
||||
),
|
||||
pdf_title=title,
|
||||
preferences=sco_preferences.SemPreferences(formsemestre_id),
|
||||
@ -912,7 +912,7 @@ def formsemestre_status_head(formsemestre_id=None, REQUEST=None, page_title=None
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST, page_title, sem, with_page_header=False, with_h2=False
|
||||
page_title, sem, with_page_header=False, with_h2=False
|
||||
),
|
||||
f"""<table>
|
||||
<tr><td class="fichetitre2">Formation: </td><td>
|
||||
|
@ -149,9 +149,7 @@ def formsemestre_validation_etud_form(
|
||||
'</td><td style="text-align: right;"><a href="%s">%s</a></td></tr></table>'
|
||||
% (
|
||||
url_for("scolar.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etudid),
|
||||
sco_photos.etud_photo_html(
|
||||
etud, title="fiche de %s" % etud["nom"], REQUEST=REQUEST
|
||||
),
|
||||
sco_photos.etud_photo_html(etud, title="fiche de %s" % etud["nom"]),
|
||||
)
|
||||
)
|
||||
|
||||
@ -824,7 +822,7 @@ def formsemestre_validation_auto(formsemestre_id, REQUEST):
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST, "Saisie automatique des décisions du semestre", sem
|
||||
"Saisie automatique des décisions du semestre", sem
|
||||
),
|
||||
"""
|
||||
<ul>
|
||||
@ -992,9 +990,7 @@ def formsemestre_validate_previous_ue(formsemestre_id, etudid, REQUEST=None):
|
||||
'</td><td style="text-align: right;"><a href="%s">%s</a></td></tr></table>'
|
||||
% (
|
||||
url_for("scolar.ficheEtud", scodoc_dept=g.scodoc_dept, etudid=etudid),
|
||||
sco_photos.etud_photo_html(
|
||||
etud, title="fiche de %s" % etud["nom"], REQUEST=REQUEST
|
||||
),
|
||||
sco_photos.etud_photo_html(etud, title="fiche de %s" % etud["nom"]),
|
||||
)
|
||||
),
|
||||
"""<p class="help">Utiliser cette page pour enregistrer une UE validée antérieurement,
|
||||
|
@ -56,7 +56,6 @@ from app.scodoc import sco_etud
|
||||
from app.scodoc.gen_tables import GenTable
|
||||
from app.scodoc.sco_exceptions import ScoValueError
|
||||
from app.scodoc.sco_permissions import Permission
|
||||
from six.moves import range
|
||||
|
||||
JAVASCRIPTS = html_sco_header.BOOTSTRAP_MULTISELECT_JS + [
|
||||
"js/etud_info.js",
|
||||
@ -65,11 +64,10 @@ JAVASCRIPTS = html_sco_header.BOOTSTRAP_MULTISELECT_JS + [
|
||||
|
||||
CSSSTYLES = html_sco_header.BOOTSTRAP_MULTISELECT_CSS
|
||||
|
||||
|
||||
# view:
|
||||
def groups_view(
|
||||
group_ids=[],
|
||||
group_ids=(),
|
||||
format="html",
|
||||
REQUEST=None,
|
||||
# Options pour listes:
|
||||
with_codes=0,
|
||||
etat=None,
|
||||
@ -94,7 +92,6 @@ def groups_view(
|
||||
return groups_table(
|
||||
groups_infos=groups_infos,
|
||||
format=format,
|
||||
REQUEST=REQUEST,
|
||||
with_codes=with_codes,
|
||||
etat=etat,
|
||||
with_paiement=with_paiement,
|
||||
@ -134,7 +131,6 @@ def groups_view(
|
||||
groups_table(
|
||||
groups_infos=groups_infos,
|
||||
format=format,
|
||||
REQUEST=REQUEST,
|
||||
with_codes=with_codes,
|
||||
etat=etat,
|
||||
with_paiement=with_paiement,
|
||||
@ -143,11 +139,11 @@ def groups_view(
|
||||
),
|
||||
"</div>",
|
||||
"""<div class="tab-pane" id="tab-photos">""",
|
||||
tab_photos_html(groups_infos, etat=etat, REQUEST=REQUEST),
|
||||
tab_photos_html(groups_infos, etat=etat),
|
||||
#'<p>hello</p>',
|
||||
"</div>",
|
||||
'<div class="tab-pane" id="tab-abs">',
|
||||
tab_absences_html(groups_infos, etat=etat, REQUEST=REQUEST),
|
||||
tab_absences_html(groups_infos, etat=etat),
|
||||
"</div>",
|
||||
)
|
||||
)
|
||||
@ -296,7 +292,7 @@ class DisplayedGroupsInfos(object):
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
group_ids=[], # groupes specifies dans l'URL, ou un seul int
|
||||
group_ids=(), # groupes specifies dans l'URL, ou un seul int
|
||||
formsemestre_id=None,
|
||||
etat=None,
|
||||
select_all_when_unspecified=False,
|
||||
@ -421,7 +417,6 @@ class DisplayedGroupsInfos(object):
|
||||
|
||||
# Ancien ZScolar.group_list renommé ici en group_table
|
||||
def groups_table(
|
||||
REQUEST=None,
|
||||
groups_infos=None, # instance of DisplayedGroupsInfos
|
||||
with_codes=0,
|
||||
etat=None,
|
||||
@ -529,7 +524,8 @@ def groups_table(
|
||||
# et groupes:
|
||||
for partition_id in etud["partitions"]:
|
||||
etud[partition_id] = etud["partitions"][partition_id]["group_name"]
|
||||
# Ajoute colonne pour moodle: semestre_groupe, de la forme RT-DUT-FI-S3-2021-PARTITION-GROUPE
|
||||
# Ajoute colonne pour moodle: semestre_groupe, de la forme
|
||||
# RT-DUT-FI-S3-2021-PARTITION-GROUPE
|
||||
moodle_groupename = []
|
||||
if groups_infos.selected_partitions:
|
||||
# il y a des groupes selectionnes, utilise leurs partitions
|
||||
@ -638,22 +634,21 @@ def groups_table(
|
||||
[
|
||||
"""<span style="margin-left: 2em;"><select name="group_list_options" id="group_list_options" class="multiselect" multiple="multiple">""",
|
||||
"\n".join(Of),
|
||||
"""
|
||||
</select></span>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#group_list_options').multiselect(
|
||||
{
|
||||
includeSelectAllOption: false,
|
||||
nonSelectedText:'Options...',
|
||||
onChange: function(element, checked){
|
||||
change_list_options();
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
""",
|
||||
"""</select></span>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$('#group_list_options').multiselect(
|
||||
{
|
||||
includeSelectAllOption: false,
|
||||
nonSelectedText:'Options...',
|
||||
onChange: function(element, checked){
|
||||
change_list_options();
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
</script>
|
||||
""",
|
||||
]
|
||||
)
|
||||
H.append("</h3></form>")
|
||||
@ -797,7 +792,7 @@ def groups_table(
|
||||
raise ValueError("unsupported format")
|
||||
|
||||
|
||||
def tab_absences_html(groups_infos, etat=None, REQUEST=None):
|
||||
def tab_absences_html(groups_infos, etat=None):
|
||||
"""contenu du tab "absences et feuilles diverses" """
|
||||
authuser = current_user
|
||||
H = ['<div class="tab-content">']
|
||||
@ -808,10 +803,10 @@ def tab_absences_html(groups_infos, etat=None, REQUEST=None):
|
||||
"<h3>Absences</h3>",
|
||||
'<ul class="ul_abs">',
|
||||
"<li>",
|
||||
form_choix_saisie_semaine(groups_infos, REQUEST=REQUEST), # Ajout Le Havre
|
||||
form_choix_saisie_semaine(groups_infos), # Ajout Le Havre
|
||||
"</li>",
|
||||
"<li>",
|
||||
form_choix_jour_saisie_hebdo(groups_infos, REQUEST=REQUEST),
|
||||
form_choix_jour_saisie_hebdo(groups_infos),
|
||||
"</li>",
|
||||
"""<li><a class="stdlink" href="Absences/EtatAbsencesGr?%s&debut=%s&fin=%s">État des absences du groupe</a></li>"""
|
||||
% (
|
||||
@ -856,17 +851,17 @@ def tab_absences_html(groups_infos, etat=None, REQUEST=None):
|
||||
return "".join(H)
|
||||
|
||||
|
||||
def tab_photos_html(groups_infos, etat=None, REQUEST=None):
|
||||
def tab_photos_html(groups_infos, etat=None):
|
||||
"""contenu du tab "photos" """
|
||||
from app.scodoc import sco_trombino
|
||||
|
||||
if not groups_infos.members:
|
||||
return '<div class="tab-content"><h3>Aucun étudiant !</h3></div>'
|
||||
|
||||
return sco_trombino.trombino_html(groups_infos, REQUEST=REQUEST)
|
||||
return sco_trombino.trombino_html(groups_infos)
|
||||
|
||||
|
||||
def form_choix_jour_saisie_hebdo(groups_infos, moduleimpl_id=None, REQUEST=None):
|
||||
def form_choix_jour_saisie_hebdo(groups_infos, moduleimpl_id=None):
|
||||
"""Formulaire choix jour semaine pour saisie."""
|
||||
authuser = current_user
|
||||
if not authuser.has_permission(Permission.ScoAbsChange):
|
||||
@ -908,7 +903,7 @@ def form_choix_jour_saisie_hebdo(groups_infos, moduleimpl_id=None, REQUEST=None)
|
||||
|
||||
# Ajout Le Havre
|
||||
# Formulaire saisie absences semaine
|
||||
def form_choix_saisie_semaine(groups_infos, REQUEST=None):
|
||||
def form_choix_saisie_semaine(groups_infos):
|
||||
authuser = current_user
|
||||
if not authuser.has_permission(Permission.ScoAbsChange):
|
||||
return ""
|
||||
|
@ -412,7 +412,7 @@ def build_page(
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST, "Passages dans le semestre", sem, with_page_header=False
|
||||
"Passages dans le semestre", sem, with_page_header=False
|
||||
),
|
||||
"""<form method="post" action="%s">""" % request.base_url,
|
||||
"""<input type="hidden" name="formsemestre_id" value="%(formsemestre_id)s"/>
|
||||
|
@ -778,9 +778,7 @@ def evaluation_check_absences_html(
|
||||
|
||||
if with_header:
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST, "Vérification absences à l'évaluation"
|
||||
),
|
||||
html_sco_header.html_sem_header("Vérification absences à l'évaluation"),
|
||||
sco_evaluations.evaluation_describe(evaluation_id=evaluation_id),
|
||||
"""<p class="help">Vérification de la cohérence entre les notes saisies et les absences signalées.</p>""",
|
||||
]
|
||||
@ -866,7 +864,6 @@ def formsemestre_check_absences_html(formsemestre_id, REQUEST=None):
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Vérification absences aux évaluations de ce semestre",
|
||||
sem,
|
||||
),
|
||||
|
@ -286,9 +286,7 @@ def moduleimpl_inscriptions_stats(formsemestre_id, REQUEST=None):
|
||||
mod["nb_inscrits"] = nb_inscrits
|
||||
options.append(mod)
|
||||
# Page HTML:
|
||||
H = [
|
||||
html_sco_header.html_sem_header(REQUEST, "Inscriptions aux modules du semestre")
|
||||
]
|
||||
H = [html_sco_header.html_sem_header("Inscriptions aux modules du semestre")]
|
||||
|
||||
H.append("<h3>Inscrits au semestre: %d étudiants</h3>" % len(inscrits))
|
||||
|
||||
|
@ -168,7 +168,7 @@ def ficheEtud(etudid=None, REQUEST=None):
|
||||
info["info_naissance"] += " à " + info["lieu_naissance"]
|
||||
if info["dept_naissance"]:
|
||||
info["info_naissance"] += " (%s)" % info["dept_naissance"]
|
||||
info["etudfoto"] = sco_photos.etud_photo_html(etud, REQUEST=REQUEST)
|
||||
info["etudfoto"] = sco_photos.etud_photo_html(etud)
|
||||
if (
|
||||
(not info["domicile"])
|
||||
and (not info["codepostaldomicile"])
|
||||
@ -540,9 +540,7 @@ def etud_info_html(etudid, with_photo="1", REQUEST=None, debug=False):
|
||||
formsemestre_id = sco_formsemestre_status.retreive_formsemestre_from_request()
|
||||
with_photo = int(with_photo)
|
||||
etud = sco_etud.get_etud_info(filled=True)[0]
|
||||
photo_html = sco_photos.etud_photo_html(
|
||||
etud, title="fiche de " + etud["nom"], REQUEST=REQUEST
|
||||
)
|
||||
photo_html = sco_photos.etud_photo_html(etud, title="fiche de " + etud["nom"])
|
||||
# experimental: may be too slow to be here
|
||||
etud["codeparcours"], etud["decisions_jury"] = sco_report.get_codeparcoursetud(
|
||||
etud, prefix="S", separator=", "
|
||||
|
@ -174,7 +174,7 @@ def etud_photo_is_local(etud, size="small"):
|
||||
return photo_pathname(etud, size=size)
|
||||
|
||||
|
||||
def etud_photo_html(etud=None, etudid=None, title=None, size="small", REQUEST=None):
|
||||
def etud_photo_html(etud=None, etudid=None, title=None, size="small"):
|
||||
"""HTML img tag for the photo, either in small size (h90)
|
||||
or original size (size=="orig")
|
||||
"""
|
||||
@ -211,9 +211,7 @@ def etud_photo_orig_html(etud=None, etudid=None, title=None, REQUEST=None):
|
||||
Full-size images are always stored locally in the filesystem.
|
||||
They are the original uploaded images, converted in jpeg.
|
||||
"""
|
||||
return etud_photo_html(
|
||||
etud=etud, etudid=etudid, title=title, size="orig", REQUEST=REQUEST
|
||||
)
|
||||
return etud_photo_html(etud=etud, etudid=etudid, title=title, size="orig")
|
||||
|
||||
|
||||
def photo_pathname(etud, size="orig"):
|
||||
|
@ -2154,7 +2154,7 @@ class SemPreferences(object):
|
||||
) # a bug !
|
||||
sem = sco_formsemestre.get_formsemestre(self.formsemestre_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(REQUEST, "Préférences du semestre", sem),
|
||||
html_sco_header.html_sem_header("Préférences du semestre", sem),
|
||||
"""
|
||||
<p class="help">Les paramètres définis ici ne s'appliqueront qu'à ce semestre.</p>
|
||||
<p class="msg">Attention: cliquez sur "Enregistrer les modifications" en bas de page pour appliquer vos changements !</p>
|
||||
|
@ -540,7 +540,6 @@ def formsemestre_pvjury(formsemestre_id, format="html", publish=True, REQUEST=No
|
||||
tab.base_url = "%s?formsemestre_id=%s" % (request.base_url, formsemestre_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Décisions du jury pour le semestre",
|
||||
sem,
|
||||
init_qtip=True,
|
||||
@ -627,7 +626,6 @@ def formsemestre_pvjury_pdf(formsemestre_id, group_ids=[], etudid=None, REQUEST=
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Edition du PV de jury %s" % etuddescr,
|
||||
sem=sem,
|
||||
javascripts=sco_groups_view.JAVASCRIPTS,
|
||||
@ -805,7 +803,6 @@ def formsemestre_lettres_individuelles(formsemestre_id, group_ids=[], REQUEST=No
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Édition des lettres individuelles",
|
||||
sem=sem,
|
||||
javascripts=sco_groups_view.JAVASCRIPTS,
|
||||
|
@ -104,7 +104,7 @@ def _trombino_html_header():
|
||||
return html_sco_header.sco_header(javascripts=["js/trombino.js"])
|
||||
|
||||
|
||||
def trombino_html(groups_infos, REQUEST=None):
|
||||
def trombino_html(groups_infos):
|
||||
"HTML snippet for trombino (with title and menu)"
|
||||
menuTrombi = [
|
||||
{
|
||||
@ -150,7 +150,7 @@ def trombino_html(groups_infos, REQUEST=None):
|
||||
% t["etudid"]
|
||||
)
|
||||
if sco_photos.etud_photo_is_local(t, size="small"):
|
||||
foto = sco_photos.etud_photo_html(t, title="", REQUEST=REQUEST)
|
||||
foto = sco_photos.etud_photo_html(t, title="")
|
||||
else: # la photo n'est pas immédiatement dispo
|
||||
foto = (
|
||||
'<span class="unloaded_img" id="%s"><img border="0" height="90" alt="en cours" src="/ScoDoc/static/icons/loading.jpg"/></span>'
|
||||
|
@ -222,7 +222,6 @@ def external_ue_create_form(formsemestre_id, etudid, REQUEST=None):
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Ajout d'une UE externe pour %(nomprenom)s" % etud,
|
||||
sem,
|
||||
javascripts=["js/sco_ue_external.js"],
|
||||
|
@ -82,7 +82,7 @@ def index_html(REQUEST, all_depts=False, with_inactives=False, format="html"):
|
||||
all_depts = int(all_depts)
|
||||
with_inactives = int(with_inactives)
|
||||
|
||||
H = [html_sco_header.html_sem_header(REQUEST, "Gestion des utilisateurs")]
|
||||
H = [html_sco_header.html_sem_header("Gestion des utilisateurs")]
|
||||
|
||||
if current_user.has_permission(Permission.ScoUsersAdmin, g.scodoc_dept):
|
||||
H.append(
|
||||
|
@ -579,21 +579,24 @@ def sendResult(data, name=None, format=None, force_outer_xml_tag=True):
|
||||
raise ValueError("invalid format: %s" % format)
|
||||
|
||||
|
||||
def send_file(data, filename, suffix="", mime=None, attached=None):
|
||||
def send_file(data, filename="", suffix="", mime=None, attached=None):
|
||||
"""Build Flask Response for file download of given type
|
||||
By default (attached is None), json and xml are inlined and otrher types are atteched.
|
||||
"""
|
||||
if attached is None:
|
||||
if mime == XML_MIMETYPE or mime == JSON_MIMETYPE:
|
||||
attached = True
|
||||
else:
|
||||
attached = False
|
||||
if suffix:
|
||||
filename += suffix
|
||||
filename = make_filename(filename)
|
||||
else:
|
||||
attached = True
|
||||
# if attached and not filename:
|
||||
# raise ValueError("send_file: missing attachement filename")
|
||||
if filename:
|
||||
if suffix:
|
||||
filename += suffix
|
||||
filename = make_filename(filename)
|
||||
response = make_response(data)
|
||||
response.headers["Content-Type"] = mime
|
||||
if attached:
|
||||
if attached and filename:
|
||||
response.headers["Content-Disposition"] = 'attachment; filename="%s"' % filename
|
||||
return response
|
||||
|
||||
|
@ -121,7 +121,7 @@ def sco_publish(route, function, permission, methods=["GET"]):
|
||||
@scodoc
|
||||
@permission_required(Permission.ScoView)
|
||||
@scodoc7func
|
||||
def index_html(REQUEST=None):
|
||||
def index_html():
|
||||
"""Gestionnaire absences, page principale"""
|
||||
# crude portage from 1999 DTML
|
||||
sems = sco_formsemestre.do_formsemestre_list()
|
||||
@ -268,7 +268,6 @@ def doSignaleAbsenceGrSemestre(
|
||||
dates="",
|
||||
etudids="",
|
||||
destination=None,
|
||||
REQUEST=None,
|
||||
):
|
||||
"""Enregistre absences aux dates indiquees (abslist et dates).
|
||||
dates est une liste de dates ISO (séparées par des ',').
|
||||
@ -293,10 +292,10 @@ def doSignaleAbsenceGrSemestre(
|
||||
|
||||
# 2- Ajoute les absences
|
||||
if abslist:
|
||||
sco_abs._add_abslist(abslist, REQUEST, moduleimpl_id)
|
||||
sco_abs.add_abslist(abslist, moduleimpl_id)
|
||||
return "Absences ajoutées"
|
||||
|
||||
return ""
|
||||
return ("", 204)
|
||||
|
||||
|
||||
# ------------ HTML Interfaces
|
||||
@ -471,7 +470,6 @@ def SignaleAbsenceGrSemestre(
|
||||
group_ids=[], # list of groups to display
|
||||
nbweeks=4, # ne montre que les nbweeks dernieres semaines
|
||||
moduleimpl_id=None,
|
||||
REQUEST=None,
|
||||
):
|
||||
"""Saisie des absences sur une journée sur un semestre (ou intervalle de dates) entier"""
|
||||
groups_infos = sco_groups_view.DisplayedGroupsInfos(group_ids)
|
||||
@ -841,7 +839,6 @@ def EtatAbsencesGr(
|
||||
fin="",
|
||||
with_boursier=True, # colonne boursier
|
||||
format="html",
|
||||
REQUEST=None,
|
||||
):
|
||||
"""Liste les absences de groupes"""
|
||||
datedebut = ndb.DateDMYtoISO(debut)
|
||||
@ -936,7 +933,7 @@ def EtatAbsencesGr(
|
||||
javascripts=["js/etud_info.js"],
|
||||
),
|
||||
html_title=html_sco_header.html_sem_header(
|
||||
REQUEST, "%s" % title, sem, with_page_header=False
|
||||
"%s" % title, sem, with_page_header=False
|
||||
)
|
||||
+ "<p>Période du %s au %s (nombre de <b>demi-journées</b>)<br/>" % (debut, fin),
|
||||
base_url="%s&formsemestre_id=%s&debut=%s&fin=%s"
|
||||
@ -1060,7 +1057,6 @@ def AddBilletAbsence(
|
||||
code_nip=None,
|
||||
code_ine=None,
|
||||
justified=True,
|
||||
REQUEST=None,
|
||||
xml_reply=True,
|
||||
):
|
||||
"""Memorise un "billet"
|
||||
@ -1096,9 +1092,6 @@ def AddBilletAbsence(
|
||||
)
|
||||
if xml_reply:
|
||||
# Renvoie le nouveau billet en XML
|
||||
if REQUEST:
|
||||
REQUEST.RESPONSE.setHeader("content-type", scu.XML_MIMETYPE)
|
||||
|
||||
billets = sco_abs.billet_absence_list(cnx, {"billet_id": billet_id})
|
||||
tab = _tableBillets(billets, etud=etud)
|
||||
log("AddBilletAbsence: new billet_id=%s (%gs)" % (billet_id, time.time() - t0))
|
||||
@ -1282,11 +1275,11 @@ def listeBillets(REQUEST=None):
|
||||
)
|
||||
|
||||
|
||||
@bp.route("/deleteBilletAbsence")
|
||||
@bp.route("/deleteBilletAbsence", methods=["POST", "GET"])
|
||||
@scodoc
|
||||
@permission_required(Permission.ScoAbsChange)
|
||||
@scodoc7func
|
||||
def deleteBilletAbsence(billet_id, REQUEST=None, dialog_confirmed=False):
|
||||
def deleteBilletAbsence(billet_id, dialog_confirmed=False):
|
||||
"""Supprime un billet."""
|
||||
cnx = ndb.GetDBConnexion()
|
||||
billets = sco_abs.billet_absence_list(cnx, {"billet_id": billet_id})
|
||||
@ -1308,7 +1301,7 @@ def deleteBilletAbsence(billet_id, REQUEST=None, dialog_confirmed=False):
|
||||
return flask.redirect("listeBillets?head_message=Billet%20supprimé")
|
||||
|
||||
|
||||
def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
|
||||
def _ProcessBilletAbsence(billet, estjust, description):
|
||||
"""Traite un billet: ajoute absence(s) et éventuellement justificatifs,
|
||||
et change l'état du billet à 1.
|
||||
NB: actuellement, les heures ne sont utilisées que pour déterminer si matin et/ou après-midi.
|
||||
@ -1330,7 +1323,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
|
||||
dates[0],
|
||||
0,
|
||||
estjust,
|
||||
REQUEST,
|
||||
description=description,
|
||||
)
|
||||
n += 1
|
||||
@ -1342,7 +1334,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
|
||||
dates[-1],
|
||||
1,
|
||||
estjust,
|
||||
REQUEST,
|
||||
description=description,
|
||||
)
|
||||
n += 1
|
||||
@ -1354,7 +1345,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
|
||||
jour,
|
||||
0,
|
||||
estjust,
|
||||
REQUEST,
|
||||
description=description,
|
||||
)
|
||||
sco_abs.add_absence(
|
||||
@ -1362,7 +1352,6 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
|
||||
jour,
|
||||
1,
|
||||
estjust,
|
||||
REQUEST,
|
||||
description=description,
|
||||
)
|
||||
n += 2
|
||||
@ -1373,7 +1362,7 @@ def _ProcessBilletAbsence(billet, estjust, description, REQUEST):
|
||||
return n
|
||||
|
||||
|
||||
@bp.route("/ProcessBilletAbsenceForm")
|
||||
@bp.route("/ProcessBilletAbsenceForm", methods=["POST", "GET"])
|
||||
@scodoc
|
||||
@permission_required(Permission.ScoAbsChange)
|
||||
@scodoc7func
|
||||
@ -1440,9 +1429,7 @@ def ProcessBilletAbsenceForm(billet_id, REQUEST=None):
|
||||
elif tf[0] == -1:
|
||||
return flask.redirect(scu.ScoURL())
|
||||
else:
|
||||
n = _ProcessBilletAbsence(
|
||||
billet, tf[2]["estjust"], tf[2]["description"], REQUEST
|
||||
)
|
||||
n = _ProcessBilletAbsence(billet, tf[2]["estjust"], tf[2]["description"])
|
||||
if tf[2]["estjust"]:
|
||||
j = "justifiées"
|
||||
else:
|
||||
@ -1478,7 +1465,7 @@ def ProcessBilletAbsenceForm(billet_id, REQUEST=None):
|
||||
@scodoc
|
||||
@permission_required_compat_scodoc7(Permission.ScoView)
|
||||
@scodoc7func
|
||||
def XMLgetAbsEtud(beg_date="", end_date="", REQUEST=None):
|
||||
def XMLgetAbsEtud(beg_date="", end_date=""):
|
||||
"""returns list of absences in date interval"""
|
||||
t0 = time.time()
|
||||
etuds = sco_etud.get_etud_info(filled=False)
|
||||
@ -1494,7 +1481,6 @@ def XMLgetAbsEtud(beg_date="", end_date="", REQUEST=None):
|
||||
|
||||
abs_list = sco_abs.list_abs_date(etud["etudid"], beg_date, end_date)
|
||||
|
||||
REQUEST.RESPONSE.setHeader("content-type", scu.XML_MIMETYPE)
|
||||
doc = ElementTree.Element(
|
||||
"absences", etudid=str(etud["etudid"]), beg_date=beg_date, end_date=end_date
|
||||
)
|
||||
@ -1510,4 +1496,5 @@ def XMLgetAbsEtud(beg_date="", end_date="", REQUEST=None):
|
||||
)
|
||||
)
|
||||
log("XMLgetAbsEtud (%gs)" % (time.time() - t0))
|
||||
return sco_xml.XML_HEADER + ElementTree.tostring(doc).decode(scu.SCO_ENCODING)
|
||||
data = sco_xml.XML_HEADER + ElementTree.tostring(doc).decode(scu.SCO_ENCODING)
|
||||
scu.send_file(data, mime=scu.XML_MIMETYPE, attached=False)
|
||||
|
@ -421,7 +421,7 @@ def index_html(REQUEST=None):
|
||||
"""<h2>Programmes pédagogiques</h2>
|
||||
""",
|
||||
]
|
||||
T = sco_formations.formation_list_table(REQUEST=REQUEST)
|
||||
T = sco_formations.formation_list_table()
|
||||
|
||||
H.append(T.html())
|
||||
|
||||
@ -464,7 +464,7 @@ sco_publish(
|
||||
@scodoc
|
||||
@permission_required(Permission.ScoView)
|
||||
@scodoc7func
|
||||
def formation_list(format=None, REQUEST=None, formation_id=None, args={}):
|
||||
def formation_list(format=None, formation_id=None, args={}):
|
||||
"""List formation(s) with given id, or matching args
|
||||
(when args is given, formation_id is ignored).
|
||||
"""
|
||||
@ -476,10 +476,10 @@ def formation_list(format=None, REQUEST=None, formation_id=None, args={}):
|
||||
@scodoc
|
||||
@permission_required(Permission.ScoView)
|
||||
@scodoc7func
|
||||
def formation_export(formation_id, export_ids=False, format=None, REQUEST=None):
|
||||
def formation_export(formation_id, export_ids=False, format=None):
|
||||
"Export de la formation au format indiqué (xml ou json)"
|
||||
return sco_formations.formation_export(
|
||||
formation_id, export_ids=export_ids, format=format, REQUEST=REQUEST
|
||||
formation_id, export_ids=export_ids, format=format
|
||||
)
|
||||
|
||||
|
||||
@ -715,7 +715,6 @@ def edit_enseignants_form(REQUEST, moduleimpl_id):
|
||||
M, sem = sco_moduleimpl.can_change_ens(moduleimpl_id)
|
||||
# --
|
||||
header = html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
'Enseignants du <a href="moduleimpl_status?moduleimpl_id=%s">module %s</a>'
|
||||
% (moduleimpl_id, M["module"]["titre"]),
|
||||
page_title="Enseignants du module %s" % M["module"]["titre"],
|
||||
@ -837,7 +836,6 @@ def edit_moduleimpl_resp(REQUEST, moduleimpl_id):
|
||||
M, sem = sco_moduleimpl.can_change_module_resp(REQUEST, moduleimpl_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
'Modification du responsable du <a href="moduleimpl_status?moduleimpl_id=%s">module %s</a>'
|
||||
% (moduleimpl_id, M["module"]["titre"]),
|
||||
sem,
|
||||
@ -959,7 +957,6 @@ def edit_moduleimpl_expr(REQUEST, moduleimpl_id):
|
||||
M, sem = sco_moduleimpl.can_change_ens(moduleimpl_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
'Modification règle de calcul du <a href="moduleimpl_status?moduleimpl_id=%s">module %s</a>'
|
||||
% (moduleimpl_id, M["module"]["titre"]),
|
||||
sem,
|
||||
@ -1066,7 +1063,6 @@ def view_module_abs(REQUEST, moduleimpl_id, format="html"):
|
||||
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
'Absences du <a href="moduleimpl_status?moduleimpl_id=%s">module %s</a>'
|
||||
% (moduleimpl_id, M["module"]["titre"]),
|
||||
page_title="Absences du module %s" % (M["module"]["titre"]),
|
||||
@ -1117,7 +1113,6 @@ def edit_ue_expr(REQUEST, formsemestre_id, ue_id):
|
||||
ue = sco_edit_ue.do_ue_list({"ue_id": ue_id})[0]
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Modification règle de calcul de l'UE %s (%s)"
|
||||
% (ue["acronyme"], ue["titre"]),
|
||||
sem,
|
||||
@ -1258,7 +1253,7 @@ def formsemestre_enseignants_list(REQUEST, formsemestre_id, format="html"):
|
||||
html_class="table_leftalign",
|
||||
filename=scu.make_filename("Enseignants-" + sem["titreannee"]),
|
||||
html_title=html_sco_header.html_sem_header(
|
||||
REQUEST, "Enseignants du semestre", sem, with_page_header=False
|
||||
"Enseignants du semestre", sem, with_page_header=False
|
||||
),
|
||||
base_url="%s?formsemestre_id=%s" % (request.base_url, formsemestre_id),
|
||||
caption="Tous les enseignants (responsables ou associés aux modules de ce semestre) apparaissent. Le nombre de saisies d'absences est le nombre d'opérations d'ajout effectuées sur ce semestre, sans tenir compte des annulations ou double saisies.",
|
||||
@ -1513,7 +1508,7 @@ def evaluation_delete(REQUEST, evaluation_id):
|
||||
tit = "Suppression de l'évaluation %(description)s (%(jour)s)" % E
|
||||
etat = sco_evaluations.do_evaluation_etat(evaluation_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(REQUEST, tit, with_h2=False),
|
||||
html_sco_header.html_sem_header(tit, with_h2=False),
|
||||
"""<h2 class="formsemestre">Module <tt>%(code)s</tt> %(titre)s</h2>""" % Mod,
|
||||
"""<h3>%s</h3>""" % tit,
|
||||
"""<p class="help">Opération <span class="redboldtext">irréversible</span>. Si vous supprimez l'évaluation, vous ne pourrez pas retrouver les notes associées.</p>""",
|
||||
@ -1778,7 +1773,7 @@ def formsemestre_bulletins_choice(
|
||||
"""Choix d'une version de bulletin"""
|
||||
sem = sco_formsemestre.get_formsemestre(formsemestre_id)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(REQUEST, title, sem),
|
||||
html_sco_header.html_sem_header(title, sem),
|
||||
"""
|
||||
<form name="f" method="GET" action="%s">
|
||||
<input type="hidden" name="formsemestre_id" value="%s"></input>
|
||||
|
@ -810,7 +810,7 @@ def formChangePhoto(etudid=None, REQUEST=None):
|
||||
<p>Photo actuelle (%(photoloc)s):
|
||||
"""
|
||||
% etud,
|
||||
sco_photos.etud_photo_html(etud, title="photo actuelle", REQUEST=REQUEST),
|
||||
sco_photos.etud_photo_html(etud, title="photo actuelle"),
|
||||
"""</p><p>Le fichier ne doit pas dépasser 500Ko (recadrer l'image, format "portrait" de préférence).</p>
|
||||
<p>L'image sera automagiquement réduite pour obtenir une hauteur de 90 pixels.</p>
|
||||
""",
|
||||
@ -851,7 +851,7 @@ def formChangePhoto(etudid=None, REQUEST=None):
|
||||
return "\n".join(H) + html_sco_header.sco_footer()
|
||||
|
||||
|
||||
@bp.route("/formSuppressPhoto")
|
||||
@bp.route("/formSuppressPhoto", methods=["POST", "GET"])
|
||||
@scodoc
|
||||
@permission_required(Permission.ScoEtudChangeAdr)
|
||||
@scodoc7func
|
||||
@ -1640,7 +1640,6 @@ def check_group_apogee(group_id, REQUEST=None, etat=None, fix=False, fixmail=Fal
|
||||
cnx = ndb.GetDBConnexion()
|
||||
H = [
|
||||
html_sco_header.html_sem_header(
|
||||
REQUEST,
|
||||
"Etudiants du %s" % (group["group_name"] or "semestre"),
|
||||
sem,
|
||||
),
|
||||
@ -2081,7 +2080,7 @@ def formsemestre_import_etud_admission(
|
||||
formsemestre_id, import_identite=True, import_email=import_email
|
||||
)
|
||||
H = [
|
||||
html_sco_header.html_sem_header(REQUEST, "Reimport données admission"),
|
||||
html_sco_header.html_sem_header("Reimport données admission"),
|
||||
"<h3>Opération effectuée</h3>",
|
||||
]
|
||||
if no_nip:
|
||||
|
@ -1,7 +1,7 @@
|
||||
# -*- mode: python -*-
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
SCOVERSION = "9.0.35"
|
||||
SCOVERSION = "9.0.36"
|
||||
|
||||
SCONAME = "ScoDoc"
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user