2020-09-26 16:19:37 +02:00
|
|
|
# -*- mode: python -*-
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
#
|
|
|
|
# Gestion scolarite IUT
|
|
|
|
#
|
2021-01-01 17:51:08 +01:00
|
|
|
# Copyright (c) 1999 - 2021 Emmanuel Viennet. All rights reserved.
|
2020-09-26 16:19:37 +02:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software
|
|
|
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
#
|
|
|
|
# Emmanuel Viennet emmanuel.viennet@viennet.net
|
|
|
|
#
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
"""Pages HTML gestion absences
|
|
|
|
(la plupart portées du DTML)
|
|
|
|
"""
|
2021-01-17 09:37:11 +01:00
|
|
|
import datetime
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
from stripogram import html2text, html2safehtml
|
2021-01-17 09:37:11 +01:00
|
|
|
|
2020-09-26 16:19:37 +02:00
|
|
|
from gen_tables import GenTable
|
|
|
|
|
2021-01-17 09:37:11 +01:00
|
|
|
from notesdb import DateISOtoDMY
|
|
|
|
import sco_utils as scu
|
|
|
|
from sco_exceptions import ScoValueError
|
|
|
|
from sco_permissions import ScoAbsChange
|
2020-09-26 16:19:37 +02:00
|
|
|
from notes_log import log
|
|
|
|
import sco_groups
|
|
|
|
import sco_find_etud
|
|
|
|
import sco_formsemestre
|
2021-01-17 22:31:28 +01:00
|
|
|
import sco_moduleimpl
|
2020-09-26 16:19:37 +02:00
|
|
|
import sco_photos
|
|
|
|
|
2021-01-10 18:54:39 +01:00
|
|
|
import sco_abs
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
def doSignaleAbsence(
|
|
|
|
context,
|
|
|
|
datedebut,
|
|
|
|
datefin,
|
|
|
|
moduleimpl_id=None,
|
|
|
|
demijournee=2,
|
|
|
|
estjust=False,
|
|
|
|
description=None,
|
2021-02-04 23:16:18 +01:00
|
|
|
etudid=False,
|
2020-09-26 16:19:37 +02:00
|
|
|
REQUEST=None,
|
|
|
|
): # etudid implied
|
2021-02-04 23:16:18 +01:00
|
|
|
"""Signalement d'une absence.
|
|
|
|
|
|
|
|
Args:
|
|
|
|
datedebut: dd/mm/yyyy
|
|
|
|
datefin: dd/mm/yyyy (non incluse)
|
|
|
|
moduleimpl_id: module auquel imputer les absences
|
|
|
|
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
|
|
|
|
"""
|
|
|
|
etud = context.getEtudInfo(filled=1, etudid=etudid, REQUEST=REQUEST)[0]
|
2020-09-26 16:19:37 +02:00
|
|
|
etudid = etud["etudid"]
|
|
|
|
|
|
|
|
description_abs = description
|
2021-01-17 09:37:11 +01:00
|
|
|
dates = sco_abs.DateRangeISO(context, datedebut, datefin)
|
2020-09-26 16:19:37 +02:00
|
|
|
nbadded = 0
|
2021-05-03 11:56:41 +02:00
|
|
|
demijournee = int(demijournee)
|
2020-09-26 16:19:37 +02:00
|
|
|
for jour in dates:
|
2021-05-03 11:56:41 +02:00
|
|
|
if demijournee == 2:
|
2020-09-26 16:19:37 +02:00
|
|
|
context._AddAbsence(
|
|
|
|
etudid, jour, False, estjust, REQUEST, description_abs, moduleimpl_id
|
|
|
|
)
|
|
|
|
context._AddAbsence(
|
|
|
|
etudid, jour, True, estjust, REQUEST, description_abs, moduleimpl_id
|
|
|
|
)
|
|
|
|
nbadded += 2
|
|
|
|
else:
|
|
|
|
context._AddAbsence(
|
2021-05-03 11:56:41 +02:00
|
|
|
etudid, jour, demijournee, estjust, REQUEST, description_abs, moduleimpl_id
|
2020-09-26 16:19:37 +02:00
|
|
|
)
|
|
|
|
nbadded += 1
|
|
|
|
#
|
|
|
|
if estjust:
|
|
|
|
J = ""
|
|
|
|
else:
|
|
|
|
J = "NON "
|
|
|
|
M = ""
|
|
|
|
if moduleimpl_id and moduleimpl_id != "NULL":
|
2021-01-17 22:31:28 +01:00
|
|
|
mod = sco_moduleimpl.do_moduleimpl_list(context, moduleimpl_id=moduleimpl_id)[0]
|
2020-09-26 16:19:37 +02:00
|
|
|
formsemestre_id = mod["formsemestre_id"]
|
|
|
|
nt = context.Notes._getNotesCache().get_NotesTable(
|
|
|
|
context.Notes, formsemestre_id
|
|
|
|
)
|
|
|
|
ues = nt.get_ues(etudid=etudid)
|
|
|
|
for ue in ues:
|
|
|
|
modimpls = nt.get_modimpls(ue_id=ue["ue_id"])
|
|
|
|
for modimpl in modimpls:
|
|
|
|
if modimpl["moduleimpl_id"] == moduleimpl_id:
|
|
|
|
M = "dans le module %s" % modimpl["module"]["code"]
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST, page_title="Signalement d'une absence pour %(nomprenom)s" % etud
|
|
|
|
),
|
|
|
|
"""<h2>Signalement d'absences</h2>""",
|
|
|
|
]
|
|
|
|
if dates:
|
|
|
|
H.append(
|
|
|
|
"""<p>Ajout de %d absences <b>%sjustifiées</b> du %s au %s %s</p>"""
|
|
|
|
% (nbadded, J, datedebut, datefin, M)
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
H.append(
|
|
|
|
"""<p class="warning">Aucune date ouvrable entre le %s et le %s !</p>"""
|
|
|
|
% (datedebut, datefin)
|
|
|
|
)
|
|
|
|
|
|
|
|
H.append(
|
|
|
|
"""<ul><li><a href="SignaleAbsenceEtud?etudid=%(etudid)s">Autre absence pour <b>%(nomprenom)s</b></a></li>
|
|
|
|
<li><a href="CalAbs?etudid=%(etudid)s">Calendrier de ses absences</a></li>
|
|
|
|
</ul>
|
|
|
|
<hr>"""
|
|
|
|
% etud
|
|
|
|
)
|
|
|
|
H.append(sco_find_etud.form_search_etud(context, REQUEST))
|
|
|
|
H.append(context.sco_footer(REQUEST))
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def SignaleAbsenceEtud(context, REQUEST=None): # etudid implied
|
2020-12-28 22:59:59 +01:00
|
|
|
"""Formulaire individuel simple de signalement d'une absence"""
|
2020-09-26 16:19:37 +02:00
|
|
|
# brute-force portage from very old dtml code ...
|
|
|
|
etud = context.getEtudInfo(filled=1, REQUEST=REQUEST)[0]
|
|
|
|
etudid = etud["etudid"]
|
2020-12-30 19:21:03 +01:00
|
|
|
disabled = False
|
2020-09-26 16:19:37 +02:00
|
|
|
if not etud["cursem"]:
|
2020-12-30 19:21:03 +01:00
|
|
|
require_module = context.get_preference(
|
|
|
|
"abs_require_module"
|
|
|
|
) # on utilise la pref globale car pas de sem courant
|
|
|
|
if require_module:
|
|
|
|
menu_module = """<div class="ue_warning">Pas inscrit dans un semestre courant,
|
|
|
|
et l'indication du module est requise. Donc pas de saisie d'absence possible !</div>"""
|
|
|
|
disabled = True
|
|
|
|
else:
|
|
|
|
menu_module = ""
|
2020-09-26 16:19:37 +02:00
|
|
|
else:
|
|
|
|
formsemestre_id = etud["cursem"]["formsemestre_id"]
|
2020-12-30 19:21:03 +01:00
|
|
|
require_module = context.get_preference("abs_require_module", formsemestre_id)
|
2020-09-26 16:19:37 +02:00
|
|
|
nt = context.Notes._getNotesCache().get_NotesTable(
|
|
|
|
context.Notes, formsemestre_id
|
|
|
|
)
|
|
|
|
ues = nt.get_ues(etudid=etudid)
|
2020-12-30 19:21:03 +01:00
|
|
|
if require_module:
|
|
|
|
menu_module = """
|
|
|
|
<script type="text/javascript">
|
|
|
|
function form_enable_disable() {
|
|
|
|
if ( $("select#sel_moduleimpl_id").val() == "NULL" ) {
|
|
|
|
$("#butsubmit").prop("disabled", true);
|
|
|
|
} else {
|
|
|
|
$("#butsubmit").prop("disabled", false);
|
|
|
|
};
|
|
|
|
}
|
|
|
|
$(document).ready(function() {
|
|
|
|
form_enable_disable();
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
<p>Module:
|
|
|
|
<select id="sel_moduleimpl_id" name="moduleimpl_id"
|
|
|
|
onChange="form_enable_disable();">"""
|
|
|
|
else:
|
|
|
|
menu_module = (
|
|
|
|
"""<p>Module: <select id="sel_moduleimpl_id" name="moduleimpl_id">"""
|
|
|
|
)
|
|
|
|
menu_module += """<option value="NULL" selected>(Module)</option>"""
|
|
|
|
|
2020-09-26 16:19:37 +02:00
|
|
|
for ue in ues:
|
|
|
|
modimpls = nt.get_modimpls(ue_id=ue["ue_id"])
|
|
|
|
for modimpl in modimpls:
|
|
|
|
menu_module += (
|
|
|
|
"""<option value="%(modimpl_id)s">%(modname)s</option>\n"""
|
|
|
|
% {
|
|
|
|
"modimpl_id": modimpl["moduleimpl_id"],
|
|
|
|
"modname": modimpl["module"]["code"],
|
|
|
|
}
|
|
|
|
)
|
|
|
|
menu_module += """</select></p>"""
|
|
|
|
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST, page_title="Signalement d'une absence pour %(nomprenom)s" % etud
|
|
|
|
),
|
|
|
|
"""<table><tr><td>
|
|
|
|
<h2>Signalement d'une absence pour %(nomprenom)s</h2>
|
|
|
|
</td><td>
|
|
|
|
"""
|
|
|
|
% etud,
|
|
|
|
"""<a href="%s/ficheEtud?etudid=%s">""" % (context.ScoURL(), etud["etudid"]),
|
|
|
|
sco_photos.etud_photo_html(
|
2020-12-28 22:59:59 +01:00
|
|
|
context,
|
|
|
|
etudid=etudid,
|
|
|
|
title="fiche de " + etud["nomprenom"],
|
|
|
|
REQUEST=REQUEST,
|
2020-09-26 16:19:37 +02:00
|
|
|
),
|
|
|
|
"""</a></td></tr></table>""",
|
|
|
|
"""
|
|
|
|
<form action="doSignaleAbsence" method="get">
|
|
|
|
<input type="hidden" name="etudid" value="%(etudid)s">
|
|
|
|
<p>
|
|
|
|
<table><tr>
|
2020-12-30 19:21:03 +01:00
|
|
|
<td>Date début : </td>
|
2020-09-26 16:19:37 +02:00
|
|
|
<td><input type="text" name="datedebut" size="10" class="datepicker"/> <em>j/m/a</em></td>
|
2020-12-30 19:21:03 +01:00
|
|
|
<td> Date fin (optionnelle):</td>
|
2020-09-26 16:19:37 +02:00
|
|
|
<td><input type="text" name="datefin" size="10" class="datepicker"/> <em>j/m/a</em></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br/>
|
2020-12-30 19:21:03 +01:00
|
|
|
<input type="radio" name="demijournee" value="2" checked>Journée(s)
|
2020-09-26 16:19:37 +02:00
|
|
|
<input type="radio" name="demijournee" value="1">Matin(s)
|
2020-12-30 19:21:03 +01:00
|
|
|
<input type="radio" name="demijournee" value="0">Après-midi
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
%(menu_module)s
|
|
|
|
|
|
|
|
<p>
|
2020-12-30 19:21:03 +01:00
|
|
|
<input type="checkbox" name="estjust"/>Absence justifiée.
|
2020-09-26 16:19:37 +02:00
|
|
|
<br/>
|
|
|
|
Raison: <input type="text" name="description" size="42"/> (optionnel)
|
|
|
|
</p>
|
|
|
|
|
|
|
|
<p>
|
2020-12-30 19:21:03 +01:00
|
|
|
<input id="butsubmit" type="submit" value="Envoyer" disable="%(disabled)s"/>
|
2020-09-26 16:19:37 +02:00
|
|
|
<em>
|
2020-12-30 19:21:03 +01:00
|
|
|
<p>Seuls les modules du semestre en cours apparaissent.</p>
|
|
|
|
<p>Évitez de saisir une absence pour un module qui n'est pas en place à cette date.</p>
|
|
|
|
<p>Toutes les dates sont au format jour/mois/annee.</p>
|
2020-09-26 16:19:37 +02:00
|
|
|
</em>
|
|
|
|
|
|
|
|
</form>
|
|
|
|
"""
|
2020-12-30 19:21:03 +01:00
|
|
|
% {
|
|
|
|
"etudid": etud["etudid"],
|
|
|
|
"menu_module": menu_module,
|
|
|
|
"disabled": "disabled" if disabled else "",
|
|
|
|
},
|
2020-09-26 16:19:37 +02:00
|
|
|
context.sco_footer(REQUEST),
|
|
|
|
]
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def doJustifAbsence(
|
2021-02-04 23:16:18 +01:00
|
|
|
context,
|
|
|
|
datedebut,
|
|
|
|
datefin,
|
|
|
|
demijournee,
|
|
|
|
description=None,
|
|
|
|
etudid=False,
|
|
|
|
REQUEST=None,
|
2020-09-26 16:19:37 +02:00
|
|
|
): # etudid implied
|
2021-02-04 23:16:18 +01:00
|
|
|
"""Justification d'une absence
|
|
|
|
|
|
|
|
Args:
|
|
|
|
datedebut: dd/mm/yyyy
|
|
|
|
datefin: dd/mm/yyyy (non incluse)
|
|
|
|
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
|
|
|
|
"""
|
|
|
|
etud = context.getEtudInfo(filled=1, etudid=etudid, REQUEST=REQUEST)[0]
|
2020-09-26 16:19:37 +02:00
|
|
|
etudid = etud["etudid"]
|
|
|
|
description_abs = description
|
2021-01-17 09:37:11 +01:00
|
|
|
dates = sco_abs.DateRangeISO(context, datedebut, datefin)
|
2020-09-26 16:19:37 +02:00
|
|
|
nbadded = 0
|
2021-05-03 11:56:41 +02:00
|
|
|
demijournee = int(demijournee)
|
2020-09-26 16:19:37 +02:00
|
|
|
for jour in dates:
|
2021-05-03 11:56:41 +02:00
|
|
|
if demijournee == 2:
|
2020-09-26 16:19:37 +02:00
|
|
|
context._AddJustif(
|
|
|
|
etudid=etudid,
|
|
|
|
jour=jour,
|
|
|
|
matin=False,
|
|
|
|
REQUEST=REQUEST,
|
|
|
|
description=description_abs,
|
|
|
|
)
|
|
|
|
context._AddJustif(
|
|
|
|
etudid=etudid,
|
|
|
|
jour=jour,
|
|
|
|
matin=True,
|
|
|
|
REQUEST=REQUEST,
|
|
|
|
description=description_abs,
|
|
|
|
)
|
|
|
|
nbadded += 2
|
|
|
|
else:
|
|
|
|
context._AddJustif(
|
|
|
|
etudid=etudid,
|
|
|
|
jour=jour,
|
2021-05-03 11:56:41 +02:00
|
|
|
matin=demijournee,
|
2020-09-26 16:19:37 +02:00
|
|
|
REQUEST=REQUEST,
|
|
|
|
description=description_abs,
|
|
|
|
)
|
|
|
|
nbadded += 1
|
|
|
|
#
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST, page_title="Justification d'une absence pour %(nomprenom)s" % etud
|
|
|
|
),
|
|
|
|
"""<h2>Justification d'absences</h2>""",
|
|
|
|
]
|
|
|
|
if dates:
|
|
|
|
H.append(
|
|
|
|
"""<p>Ajout de %d <b>justifications</b> du %s au %s</p>"""
|
|
|
|
% (nbadded, datedebut, datefin)
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
H.append(
|
|
|
|
"""<p class="warning">Aucune date ouvrable entre le %s et le %s !</p>"""
|
|
|
|
% (datedebut, datefin)
|
|
|
|
)
|
|
|
|
|
|
|
|
H.append(
|
|
|
|
"""<ul><li><a href="JustifAbsenceEtud?etudid=%(etudid)s">Autre justification pour <b>%(nomprenom)s</b></a></li>
|
|
|
|
<li><a href="SignaleAbsenceEtud?etudid=%(etudid)s">Signaler une absence</a></li>
|
|
|
|
<li><a href="CalAbs?etudid=%(etudid)s">Calendrier de ses absences</a></li>
|
|
|
|
<li><a href="ListeAbsEtud?etudid=%(etudid)s">Liste de ses absences</a></li>
|
|
|
|
</ul>
|
|
|
|
<hr>"""
|
|
|
|
% etud
|
|
|
|
)
|
|
|
|
H.append(sco_find_etud.form_search_etud(context, REQUEST))
|
|
|
|
H.append(context.sco_footer(REQUEST))
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def JustifAbsenceEtud(context, REQUEST=None): # etudid implied
|
2020-12-28 22:59:59 +01:00
|
|
|
"""Formulaire individuel simple de justification d'une absence"""
|
2020-09-26 16:19:37 +02:00
|
|
|
# brute-force portage from very old dtml code ...
|
|
|
|
etud = context.getEtudInfo(filled=1, REQUEST=REQUEST)[0]
|
|
|
|
etudid = etud["etudid"]
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST, page_title="Justification d'une absence pour %(nomprenom)s" % etud
|
|
|
|
),
|
|
|
|
"""<table><tr><td>
|
|
|
|
<h2>Justification d'une absence pour %(nomprenom)s</h2>
|
|
|
|
</td><td>
|
|
|
|
"""
|
|
|
|
% etud,
|
|
|
|
"""<a href="%s/ficheEtud?etudid=%s">""" % (context.ScoURL(), etud["etudid"]),
|
|
|
|
sco_photos.etud_photo_html(
|
2020-12-28 22:59:59 +01:00
|
|
|
context,
|
|
|
|
etudid=etudid,
|
|
|
|
title="fiche de " + etud["nomprenom"],
|
|
|
|
REQUEST=REQUEST,
|
2020-09-26 16:19:37 +02:00
|
|
|
),
|
|
|
|
"""</a></td></tr></table>""",
|
|
|
|
"""
|
|
|
|
<form action="doJustifAbsence" method="get">
|
|
|
|
<input type="hidden" name="etudid" value="%(etudid)s">
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<table><tr>
|
|
|
|
<td>Date début : </td>
|
|
|
|
<td>
|
|
|
|
<input type="text" name="datedebut" size="10" class="datepicker"/>
|
|
|
|
</td>
|
|
|
|
<td> Date Fin (optionnel):</td>
|
|
|
|
<td><input type="text" name="datefin" size="10" class="datepicker"/></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<br/>
|
|
|
|
|
2020-12-30 19:21:03 +01:00
|
|
|
<input type="radio" name="demijournee" value="2" checked>Journée(s)
|
2020-09-26 16:19:37 +02:00
|
|
|
<input type="radio" name="demijournee" value="1">Matin(s)
|
|
|
|
<input type="radio" name="demijournee" value="0">Après midi
|
|
|
|
|
|
|
|
<br/><br/>
|
|
|
|
Raison: <input type="text" name="description" size="42"/> (optionnel)
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<input type="submit" value="Envoyer">
|
|
|
|
|
|
|
|
</form> """
|
|
|
|
% etud,
|
|
|
|
context.sco_footer(REQUEST),
|
|
|
|
]
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def doAnnuleAbsence(
|
2021-02-04 23:16:18 +01:00
|
|
|
context, datedebut, datefin, demijournee, etudid=False, REQUEST=None
|
2020-09-26 16:19:37 +02:00
|
|
|
): # etudid implied
|
2020-12-28 22:59:59 +01:00
|
|
|
"""Annulation des absences pour une demi journée"""
|
2021-02-04 23:16:18 +01:00
|
|
|
etud = context.getEtudInfo(filled=1, etudid=etudid, REQUEST=REQUEST)[0]
|
2020-09-26 16:19:37 +02:00
|
|
|
etudid = etud["etudid"]
|
|
|
|
|
2021-01-17 09:37:11 +01:00
|
|
|
dates = sco_abs.DateRangeISO(context, datedebut, datefin)
|
2020-09-26 16:19:37 +02:00
|
|
|
nbadded = 0
|
2021-05-03 11:56:41 +02:00
|
|
|
demijournee = int(demijournee)
|
2020-09-26 16:19:37 +02:00
|
|
|
for jour in dates:
|
2021-05-03 11:56:41 +02:00
|
|
|
if demijournee == 2:
|
2020-09-26 16:19:37 +02:00
|
|
|
context._AnnuleAbsence(etudid, jour, False, REQUEST=REQUEST)
|
|
|
|
context._AnnuleAbsence(etudid, jour, True, REQUEST=REQUEST)
|
|
|
|
nbadded += 2
|
|
|
|
else:
|
2021-05-03 11:56:41 +02:00
|
|
|
context._AnnuleAbsence(etudid, jour, demijournee, REQUEST=REQUEST)
|
2020-09-26 16:19:37 +02:00
|
|
|
nbadded += 1
|
|
|
|
#
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST, page_title="Annulation d'une absence pour %(nomprenom)s" % etud
|
|
|
|
),
|
|
|
|
"""<h2>Annulation d'absences pour %(nomprenom)s</h2>""" % etud,
|
|
|
|
]
|
|
|
|
if dates:
|
|
|
|
H.append(
|
|
|
|
"<p>Annulation sur %d demi-journées du %s au %s"
|
|
|
|
% (nbadded, datedebut, datefin)
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
H.append(
|
|
|
|
"""<p class="warning">Aucune date ouvrable entre le %s et le %s !</p>"""
|
|
|
|
% (datedebut, datefin)
|
|
|
|
)
|
|
|
|
|
|
|
|
H.append(
|
|
|
|
"""<ul><li><a href="AnnuleAbsenceEtud?etudid=%(etudid)s">Annulation d'une
|
|
|
|
autre absence pour <b>%(nomprenom)s</b></a></li>
|
|
|
|
<li><a href="SignaleAbsenceEtud?etudid=%(etudid)s">Ajout d'une absence</a></li>
|
|
|
|
<li><a href="CalAbs?etudid=%(etudid)s">Calendrier de ses absences</a></li>
|
|
|
|
</ul>
|
|
|
|
<hr>"""
|
|
|
|
% etud
|
|
|
|
)
|
|
|
|
H.append(sco_find_etud.form_search_etud(context, REQUEST))
|
|
|
|
H.append(context.sco_footer(REQUEST))
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def AnnuleAbsenceEtud(context, REQUEST=None): # etudid implied
|
2020-12-28 22:59:59 +01:00
|
|
|
"""Formulaire individuel simple d'annulation d'une absence"""
|
2020-09-26 16:19:37 +02:00
|
|
|
# brute-force portage from very old dtml code ...
|
|
|
|
etud = context.getEtudInfo(filled=1, REQUEST=REQUEST)[0]
|
|
|
|
etudid = etud["etudid"]
|
|
|
|
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST, page_title="Annulation d'une absence pour %(nomprenom)s" % etud
|
|
|
|
),
|
|
|
|
"""<table><tr><td>
|
|
|
|
<h2><font color="#FF0000">Annulation</font> d'une absence pour %(nomprenom)s</h2>
|
|
|
|
</td><td>
|
|
|
|
"""
|
|
|
|
% etud, # "
|
|
|
|
"""<a href="%s/ficheEtud?etudid=%s">""" % (context.ScoURL(), etud["etudid"]),
|
|
|
|
sco_photos.etud_photo_html(
|
2020-12-28 22:59:59 +01:00
|
|
|
context,
|
|
|
|
etudid=etudid,
|
|
|
|
title="fiche de " + etud["nomprenom"],
|
|
|
|
REQUEST=REQUEST,
|
2020-09-26 16:19:37 +02:00
|
|
|
),
|
|
|
|
"""</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>
|
|
|
|
<p><font color="#FF0000">Si plusieurs modules sont affectés, les absences seront toutes effacées. </font></p>
|
|
|
|
"""
|
|
|
|
% etud,
|
|
|
|
"""<table frame="border" border="1"><tr><td>
|
|
|
|
<form action="doAnnuleAbsence" method="get">
|
|
|
|
<input type="hidden" name="etudid" value="%(etudid)s">
|
|
|
|
<p>
|
|
|
|
<table><tr>
|
|
|
|
<td>Date début : </td>
|
|
|
|
<td>
|
|
|
|
<input type="text" name="datedebut" size="10" class="datepicker"/> <em>j/m/a</em>
|
|
|
|
</td>
|
|
|
|
<td> Date Fin (optionnel):</td>
|
|
|
|
<td>
|
|
|
|
<input type="text" name="datefin" size="10" class="datepicker"/> <em>j/m/a</em>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<input type="radio" name="demijournee" value="2" checked>journée(s)
|
|
|
|
<input type="radio" name="demijournee" value="1">Matin(s)
|
|
|
|
<input type="radio" name="demijournee" value="0">Après midi
|
|
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<input type="submit" value="Supprimer les absences">
|
|
|
|
</form>
|
|
|
|
</td></tr>
|
|
|
|
|
|
|
|
<tr><td>
|
|
|
|
<form action="doAnnuleJustif" method="get">
|
|
|
|
<input type="hidden" name="etudid" value="%(etudid)s">
|
|
|
|
<p>
|
|
|
|
<table><tr>
|
|
|
|
<td>Date début : </td>
|
|
|
|
<td>
|
|
|
|
<input type="text" name="datedebut0" size="10" class="datepicker"/> <em>j/m/a</em>
|
|
|
|
</td>
|
|
|
|
<td> Date Fin (optionnel):</td>
|
|
|
|
<td>
|
|
|
|
<input type="text" name="datefin0" size="10" class="datepicker"/> <em>j/m/a</em>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
<p>
|
|
|
|
|
|
|
|
<input type="radio" name="demijournee" value="2" checked>journée(s)
|
|
|
|
<input type="radio" name="demijournee" value="1">Matin(s)
|
|
|
|
<input type="radio" name="demijournee" value="0">Après midi
|
|
|
|
|
|
|
|
|
|
|
|
<p>
|
|
|
|
<input type="submit" value="Supprimer les justificatifs">
|
|
|
|
<i>(utiliser ceci en cas de justificatif erroné saisi indépendemment d'une absence)</i>
|
|
|
|
</form>
|
|
|
|
</td></tr></table>"""
|
|
|
|
% etud,
|
|
|
|
context.sco_footer(REQUEST),
|
|
|
|
]
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def doAnnuleJustif(
|
|
|
|
context, datedebut0, datefin0, demijournee, REQUEST=None
|
|
|
|
): # etudid implied
|
2020-12-28 22:59:59 +01:00
|
|
|
"""Annulation d'une justification"""
|
2020-09-26 16:19:37 +02:00
|
|
|
etud = context.getEtudInfo(filled=1, REQUEST=REQUEST)[0]
|
|
|
|
etudid = etud["etudid"]
|
2021-01-17 09:37:11 +01:00
|
|
|
dates = sco_abs.DateRangeISO(context, datedebut0, datefin0)
|
2020-09-26 16:19:37 +02:00
|
|
|
nbadded = 0
|
2021-05-03 11:56:41 +02:00
|
|
|
demijournee = int(demijournee)
|
2020-09-26 16:19:37 +02:00
|
|
|
for jour in dates:
|
2020-12-30 19:21:03 +01:00
|
|
|
# Attention: supprime matin et après-midi
|
2021-05-03 11:56:41 +02:00
|
|
|
if demijournee == 2:
|
2020-09-26 16:19:37 +02:00
|
|
|
context._AnnuleJustif(etudid, jour, False, REQUEST=REQUEST)
|
|
|
|
context._AnnuleJustif(etudid, jour, True, REQUEST=REQUEST)
|
|
|
|
nbadded += 2
|
|
|
|
else:
|
2021-05-03 11:56:41 +02:00
|
|
|
context._AnnuleJustif(etudid, jour, demijournee, REQUEST=REQUEST)
|
2020-09-26 16:19:37 +02:00
|
|
|
nbadded += 1
|
|
|
|
#
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST,
|
|
|
|
page_title="Annulation d'une justification pour %(nomprenom)s" % etud,
|
|
|
|
),
|
|
|
|
"""<h2>Annulation de justifications pour %(nomprenom)s</h2>""" % etud,
|
|
|
|
]
|
|
|
|
|
|
|
|
if dates:
|
|
|
|
H.append(
|
|
|
|
"<p>Annulation sur %d demi-journées du %s au %s"
|
|
|
|
% (nbadded, datedebut0, datefin0)
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
H.append(
|
|
|
|
"""<p class="warning">Aucune date ouvrable entre le %s et le %s !</p>"""
|
|
|
|
% (datedebut0, datefin0)
|
|
|
|
)
|
|
|
|
H.append(
|
|
|
|
"""<ul><li><a href="AnnuleAbsenceEtud?etudid=%(etudid)s">Annulation d'une
|
|
|
|
autre absence pour <b>%(nomprenom)s</b></a></li>
|
|
|
|
<li><a href="SignaleAbsenceEtud?etudid=%(etudid)s">Ajout d'une absence</a></li>
|
|
|
|
<li><a href="CalAbs?etudid=%(etudid)s">Calendrier de ses absences</a></li>
|
|
|
|
</ul>
|
|
|
|
<hr>"""
|
|
|
|
% etud
|
|
|
|
)
|
|
|
|
H.append(sco_find_etud.form_search_etud(context, REQUEST))
|
|
|
|
H.append(context.sco_footer(REQUEST))
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def EtatAbsences(context, REQUEST=None):
|
|
|
|
"""Etat des absences: choix du groupe"""
|
|
|
|
# crude portage from 1999 DTML
|
|
|
|
H = [
|
|
|
|
context.sco_header(REQUEST, page_title="Etat des absences"),
|
|
|
|
"""<h2>Etat des absences pour un groupe</h2>
|
|
|
|
<form action="EtatAbsencesGr" method="GET">""",
|
|
|
|
formChoixSemestreGroupe(context),
|
|
|
|
"""<input type="submit" name="" value=" OK " width=100>
|
|
|
|
|
|
|
|
<table><tr><td>Date de début (j/m/a) : </td><td>
|
|
|
|
|
|
|
|
<input type="text" name="debut" size="10" value="01/09/%s" class="datepicker"/>
|
|
|
|
|
|
|
|
</td></tr><tr><td>Date de fin : </td><td>
|
|
|
|
|
|
|
|
<input type="text" name="fin" size="10" value="%s" class="datepicker"/>
|
|
|
|
|
|
|
|
</td></tr></table>
|
|
|
|
</form>"""
|
2021-01-17 09:37:11 +01:00
|
|
|
% (scu.AnneeScolaire(REQUEST), datetime.datetime.now().strftime("%d/%m/%Y")),
|
2020-09-26 16:19:37 +02:00
|
|
|
context.sco_footer(REQUEST),
|
|
|
|
]
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def formChoixSemestreGroupe(context, all=False):
|
|
|
|
"""partie de formulaire pour le choix d'un semestre et d'un groupe.
|
|
|
|
Si all, donne tous les semestres (même ceux verrouillés).
|
|
|
|
"""
|
|
|
|
# XXX assez primitif, à ameliorer TOTALEMENT OBSOLETE !
|
|
|
|
if all:
|
|
|
|
sems = sco_formsemestre.do_formsemestre_list(context)
|
|
|
|
else:
|
|
|
|
sems = sco_formsemestre.do_formsemestre_list(context, args={"etat": "1"})
|
|
|
|
if not sems:
|
|
|
|
raise ScoValueError("aucun semestre !")
|
|
|
|
H = ['<select name="group_ids">']
|
|
|
|
for sem in sems:
|
|
|
|
for p in sco_groups.get_partitions_list(context, sem["formsemestre_id"]):
|
|
|
|
for group in sco_groups.get_partition_groups(context, p):
|
|
|
|
if group["group_name"]:
|
|
|
|
group_tit = "%s %s" % (p["partition_name"], group["group_name"])
|
|
|
|
else:
|
|
|
|
group_tit = "tous"
|
|
|
|
H.append(
|
|
|
|
'<option value="%s">%s: %s</option>'
|
|
|
|
% (group["group_id"], sem["titremois"], group_tit)
|
|
|
|
)
|
|
|
|
|
|
|
|
H.append("</select>")
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def CalAbs(context, REQUEST=None): # etud implied
|
2020-12-28 22:59:59 +01:00
|
|
|
"""Calendrier des absences d un etudiant"""
|
2020-09-26 16:19:37 +02:00
|
|
|
# crude portage from 1999 DTML
|
|
|
|
etud = context.getEtudInfo(filled=1, REQUEST=REQUEST)[0]
|
|
|
|
etudid = etud["etudid"]
|
2021-01-17 09:37:11 +01:00
|
|
|
anneescolaire = int(scu.AnneeScolaire(REQUEST))
|
2020-09-26 16:19:37 +02:00
|
|
|
datedebut = str(anneescolaire) + "-08-31"
|
|
|
|
datefin = str(anneescolaire + 1) + "-07-31"
|
|
|
|
nbabs = context.CountAbs(etudid=etudid, debut=datedebut, fin=datefin)
|
|
|
|
nbabsjust = context.CountAbsJust(etudid=etudid, debut=datedebut, fin=datefin)
|
|
|
|
events = []
|
|
|
|
for a in context.ListeAbsJust(etudid=etudid, datedebut=datedebut):
|
|
|
|
events.append(
|
|
|
|
(str(a["jour"]), "a", "#F8B7B0", "", a["matin"], a["description"])
|
|
|
|
)
|
|
|
|
for a in context.ListeAbsNonJust(etudid=etudid, datedebut=datedebut):
|
|
|
|
events.append(
|
|
|
|
(str(a["jour"]), "A", "#EE0000", "", a["matin"], a["description"])
|
|
|
|
)
|
|
|
|
justifs_noabs = context.ListeJustifs(
|
|
|
|
etudid=etudid, datedebut=datedebut, only_no_abs=True
|
|
|
|
)
|
|
|
|
for a in justifs_noabs:
|
|
|
|
events.append(
|
|
|
|
(str(a["jour"]), "X", "#8EA2C6", "", a["matin"], a["description"])
|
|
|
|
)
|
2021-01-10 18:54:39 +01:00
|
|
|
CalHTML = sco_abs.YearTable(context, anneescolaire, events=events, halfday=1)
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
#
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST,
|
|
|
|
page_title="Calendrier des absences de %(nomprenom)s" % etud,
|
|
|
|
cssstyles=["css/calabs.css"],
|
|
|
|
),
|
|
|
|
"""<table><tr><td><h2>Absences de %(nomprenom)s (%(inscription)s)</h2><p>"""
|
|
|
|
% etud,
|
|
|
|
"""<b><font color="#EE0000">A : absence NON justifiée</font><br/>
|
|
|
|
<font color="#F8B7B0">a : absence justifiée</font><br/>
|
|
|
|
<font color="#8EA2C6">X : justification sans absence</font><br/>
|
|
|
|
%d absences sur l'année, dont %d justifiées (soit %d non justifiées)</b> <em>(%d justificatifs inutilisés)</em>
|
|
|
|
</p>
|
|
|
|
"""
|
|
|
|
% (nbabs, nbabsjust, nbabs - nbabsjust, len(justifs_noabs)),
|
|
|
|
"""</td>
|
|
|
|
<td><a href="%s/ficheEtud?etudid=%s">%s</a></td>
|
|
|
|
</tr>
|
|
|
|
</table>"""
|
|
|
|
% (
|
|
|
|
context.ScoURL(),
|
|
|
|
etudid,
|
|
|
|
sco_photos.etud_photo_html(
|
2020-12-28 22:59:59 +01:00
|
|
|
context,
|
|
|
|
etudid=etudid,
|
|
|
|
title="fiche de " + etud["nomprenom"],
|
|
|
|
REQUEST=REQUEST,
|
2020-09-26 16:19:37 +02:00
|
|
|
),
|
|
|
|
),
|
|
|
|
CalHTML,
|
|
|
|
"""<form method="GET" action="CalAbs" name="f">""",
|
|
|
|
"""<input type="hidden" name="etudid" value="%s"/>""" % etudid,
|
|
|
|
"""Année scolaire %s-%s""" % (anneescolaire, anneescolaire + 1),
|
|
|
|
""" Changer année: <select name="sco_year" onchange="document.f.submit()">""",
|
|
|
|
]
|
|
|
|
for y in range(anneescolaire, anneescolaire - 10, -1):
|
|
|
|
H.append("""<option value="%s" """ % y)
|
|
|
|
if y == anneescolaire:
|
|
|
|
H.append("selected")
|
|
|
|
H.append(""">%s</option>""" % y)
|
|
|
|
H.append("""</select></form>""")
|
|
|
|
H.append(context.sco_footer(REQUEST))
|
|
|
|
return "\n".join(H)
|
|
|
|
|
|
|
|
|
|
|
|
def ListeAbsEtud(
|
|
|
|
context,
|
|
|
|
etudid,
|
|
|
|
with_evals=True, # indique les evaluations aux dates d'absences
|
|
|
|
format="html",
|
|
|
|
absjust_only=0, # si vrai, renvoie table absences justifiées
|
|
|
|
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).
|
2021-05-03 11:56:41 +02:00
|
|
|
En format json, xml, xls ou pdf: l'un ou l'autre des table, suivant absjust_only.
|
2020-09-26 16:19:37 +02:00
|
|
|
En format 'text': texte avec liste d'absences (pour mails).
|
|
|
|
"""
|
|
|
|
absjust_only = int(absjust_only) # si vrai, table absjust seule (export xls ou pdf)
|
2021-01-17 09:37:11 +01:00
|
|
|
datedebut = "%s-08-31" % scu.AnneeScolaire(REQUEST)
|
2020-09-26 16:19:37 +02:00
|
|
|
|
|
|
|
etud = context.getEtudInfo(etudid=etudid, filled=True)[0]
|
|
|
|
|
|
|
|
# Liste des absences et titres colonnes tables:
|
|
|
|
titles, columns_ids, absnonjust, absjust = context.Absences._TablesAbsEtud(
|
|
|
|
etudid, datedebut, with_evals=with_evals, format=format
|
|
|
|
)
|
|
|
|
if REQUEST:
|
|
|
|
base_url_nj = "%s?etudid=%s&absjust_only=0" % (REQUEST.URL0, etudid)
|
|
|
|
base_url_j = "%s?etudid=%s&absjust_only=1" % (REQUEST.URL0, etudid)
|
|
|
|
else:
|
|
|
|
base_url_nj = base_url_j = ""
|
|
|
|
tab_absnonjust = GenTable(
|
|
|
|
titles=titles,
|
|
|
|
columns_ids=columns_ids,
|
|
|
|
rows=absnonjust,
|
|
|
|
html_class="table_leftalign",
|
|
|
|
table_id="tab_absnonjust",
|
|
|
|
base_url=base_url_nj,
|
2021-01-17 09:37:11 +01:00
|
|
|
filename="abs_" + scu.make_filename(etud["nomprenom"]),
|
2020-09-26 16:19:37 +02:00
|
|
|
caption="Absences non justifiées de %(nomprenom)s" % etud,
|
|
|
|
preferences=context.get_preferences(),
|
|
|
|
)
|
|
|
|
tab_absjust = GenTable(
|
|
|
|
titles=titles,
|
|
|
|
columns_ids=columns_ids,
|
|
|
|
rows=absjust,
|
|
|
|
html_class="table_leftalign",
|
|
|
|
table_id="tab_absjust",
|
|
|
|
base_url=base_url_j,
|
2021-01-17 09:37:11 +01:00
|
|
|
filename="absjust_" + scu.make_filename(etud["nomprenom"]),
|
2020-09-26 16:19:37 +02:00
|
|
|
caption="Absences justifiées de %(nomprenom)s" % etud,
|
|
|
|
preferences=context.get_preferences(),
|
|
|
|
)
|
|
|
|
|
|
|
|
# Formats non HTML et demande d'une seule table:
|
|
|
|
if format != "html" and format != "text":
|
|
|
|
if absjust_only == 1:
|
|
|
|
return tab_absjust.make_page(context, format=format, REQUEST=REQUEST)
|
|
|
|
else:
|
|
|
|
return tab_absnonjust.make_page(context, format=format, REQUEST=REQUEST)
|
|
|
|
|
|
|
|
if format == "html":
|
|
|
|
# Mise en forme HTML:
|
|
|
|
H = []
|
|
|
|
H.append(
|
|
|
|
context.sco_header(REQUEST, page_title="Absences de %s" % etud["nomprenom"])
|
|
|
|
)
|
|
|
|
H.append(
|
|
|
|
"""<h2>Absences de %s (à partir du %s)</h2>"""
|
|
|
|
% (etud["nomprenom"], DateISOtoDMY(datedebut))
|
|
|
|
)
|
|
|
|
|
|
|
|
if len(absnonjust):
|
|
|
|
H.append("<h3>%d absences non justifiées:</h3>" % len(absnonjust))
|
|
|
|
H.append(tab_absnonjust.html())
|
|
|
|
else:
|
|
|
|
H.append("""<h3>Pas d'absences non justifiées</h3>""")
|
|
|
|
|
|
|
|
if len(absjust):
|
|
|
|
H.append("""<h3>%d absences justifiées:</h3>""" % len(absjust))
|
|
|
|
H.append(tab_absjust.html())
|
|
|
|
else:
|
|
|
|
H.append("""<h3>Pas d'absences justifiées</h3>""")
|
|
|
|
return "\n".join(H) + context.sco_footer(REQUEST)
|
|
|
|
|
|
|
|
elif format == "text":
|
|
|
|
T = []
|
|
|
|
if not len(absnonjust) and not len(absjust):
|
|
|
|
T.append(
|
|
|
|
"""--- Pas d'absences enregistrées depuis le %s"""
|
|
|
|
% DateISOtoDMY(datedebut)
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
T.append(
|
|
|
|
"""--- Absences enregistrées à partir du %s:"""
|
|
|
|
% DateISOtoDMY(datedebut)
|
|
|
|
)
|
|
|
|
T.append("\n")
|
|
|
|
if len(absnonjust):
|
|
|
|
T.append("* %d absences non justifiées:" % len(absnonjust))
|
|
|
|
T.append(tab_absnonjust.text())
|
|
|
|
if len(absjust):
|
|
|
|
T.append("* %d absences justifiées:" % len(absjust))
|
|
|
|
T.append(tab_absjust.text())
|
|
|
|
return "\n".join(T)
|
|
|
|
else:
|
|
|
|
raise ValueError("Invalid format !")
|
|
|
|
|
|
|
|
|
|
|
|
def absences_index_html(context, REQUEST=None):
|
|
|
|
"""Gestionnaire absences, page principale"""
|
|
|
|
# crude portage from 1999 DTML
|
|
|
|
sems = sco_formsemestre.do_formsemestre_list(context)
|
|
|
|
authuser = REQUEST.AUTHENTICATED_USER
|
|
|
|
|
|
|
|
H = [
|
|
|
|
context.sco_header(
|
|
|
|
REQUEST,
|
|
|
|
page_title="Gestion des absences",
|
|
|
|
cssstyles=["css/calabs.css"],
|
|
|
|
javascripts=["js/calabs.js"],
|
|
|
|
),
|
|
|
|
"""<h2>Gestion des Absences</h2>""",
|
|
|
|
]
|
|
|
|
if not sems:
|
|
|
|
H.append(
|
|
|
|
"""<p class="warning">Aucun semestre défini (ou aucun groupe d'étudiant)</p>"""
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
H.append(
|
|
|
|
"""<ul><li><a href="EtatAbsences">Afficher l'état des absences (pour tout un groupe)</a></li>"""
|
|
|
|
)
|
|
|
|
if context.get_preference("handle_billets_abs"):
|
|
|
|
H.append(
|
|
|
|
"""<li><a href="listeBillets">Traitement des billets d'absence en attente</a></li>"""
|
|
|
|
)
|
|
|
|
H.append(
|
|
|
|
"""<p>Pour signaler, annuler ou justifier une absence, choisissez d'abord l'étudiant concerné:</p>"""
|
|
|
|
)
|
|
|
|
H.append(sco_find_etud.form_search_etud(context, REQUEST))
|
|
|
|
if authuser.has_permission(ScoAbsChange, context):
|
|
|
|
H.extend(
|
|
|
|
(
|
|
|
|
"""<hr/>
|
|
|
|
<form action="SignaleAbsenceGrHebdo" id="formw">
|
|
|
|
<input type="hidden" name="destination" value="%s"/>
|
|
|
|
<p>
|
|
|
|
<span style="font-weight: bold; font-size:120%%;">
|
|
|
|
Saisie par semaine </span> - Choix du groupe:
|
|
|
|
<input name="datelundi" type="hidden" value="x"/>
|
|
|
|
"""
|
|
|
|
% REQUEST.URL0,
|
|
|
|
formChoixSemestreGroupe(context),
|
|
|
|
"</p>",
|
2021-01-17 09:37:11 +01:00
|
|
|
cal_select_week(context, REQUEST=REQUEST),
|
2020-09-26 16:19:37 +02:00
|
|
|
"""<p class="help">Sélectionner le groupe d'étudiants, puis cliquez sur une semaine pour
|
|
|
|
saisir les absences de toute cette semaine.</p>
|
|
|
|
</form>""",
|
|
|
|
)
|
|
|
|
)
|
|
|
|
else:
|
|
|
|
H.append(
|
|
|
|
"""<p class="scoinfo">Vous n'avez pas l'autorisation d'ajouter, justifier ou supprimer des absences.</p>"""
|
|
|
|
)
|
|
|
|
|
|
|
|
H.append(context.sco_footer(REQUEST))
|
|
|
|
return "\n".join(H)
|
2021-01-17 09:37:11 +01:00
|
|
|
|
|
|
|
|
|
|
|
def cal_select_week(context, year=None, REQUEST=None):
|
|
|
|
"display calendar allowing week selection"
|
|
|
|
if not year:
|
|
|
|
year = scu.AnneeScolaire(REQUEST)
|
|
|
|
sems = sco_formsemestre.do_formsemestre_list(context)
|
|
|
|
if not sems:
|
|
|
|
js = ""
|
|
|
|
else:
|
|
|
|
js = 'onmouseover="highlightweek(this);" onmouseout="deselectweeks();" onclick="wclick(this);"'
|
|
|
|
C = sco_abs.YearTable(context, int(year), dayattributes=js)
|
|
|
|
return C
|