forked from ScoDoc/ScoDoc
parent
cf74708f83
commit
483c86d904
@ -833,7 +833,7 @@ def tab_absences_html(groups_infos, etat=None):
|
|||||||
"<li>",
|
"<li>",
|
||||||
form_choix_jour_saisie_hebdo(groups_infos),
|
form_choix_jour_saisie_hebdo(groups_infos),
|
||||||
"</li>",
|
"</li>",
|
||||||
f"""<li><a href="{
|
f"""<li><a class="stdlink" href="{
|
||||||
url_for("assiduites.visu_assi_group", scodoc_dept=g.scodoc_dept, group_ids=group_ids, date_debut=formsemestre.date_debut.isoformat(), date_fin=formsemestre.date_fin.isoformat())
|
url_for("assiduites.visu_assi_group", scodoc_dept=g.scodoc_dept, group_ids=group_ids, date_debut=formsemestre.date_debut.isoformat(), date_fin=formsemestre.date_fin.isoformat())
|
||||||
}">État des assiduités du groupe</a></li>""",
|
}">État des assiduités du groupe</a></li>""",
|
||||||
"</ul>",
|
"</ul>",
|
||||||
@ -890,76 +890,38 @@ def form_choix_jour_saisie_hebdo(groups_infos, moduleimpl_id=None):
|
|||||||
authuser = current_user
|
authuser = current_user
|
||||||
if not authuser.has_permission(Permission.ScoAbsChange):
|
if not authuser.has_permission(Permission.ScoAbsChange):
|
||||||
return ""
|
return ""
|
||||||
sem = groups_infos.formsemestre
|
return f"""
|
||||||
first_monday = sco_cal.ddmmyyyy(sem["date_debut"]).prev_monday()
|
<button onclick="window.location='{
|
||||||
today_idx = datetime.date.today().weekday()
|
url_for(
|
||||||
|
"assiduites.signal_assiduites_group",
|
||||||
FA = [] # formulaire avec menu saisi absences
|
scodoc_dept=g.scodoc_dept,
|
||||||
FA.append(
|
group_ids=",".join(map(str,groups_infos.group_ids)),
|
||||||
# TODO-ASSIDUITE et utiliser url_for... (was Absences/SignaleAbsenceGrSemestre)
|
jour=datetime.date.today().isoformat(),
|
||||||
'<form id="form_choix_jour_saisie_hebdo" action="XXX" method="get">'
|
formsemestre_id=groups_infos.formsemestre_id,
|
||||||
|
moduleimpl_id="" if moduleimpl_id is None else moduleimpl_id
|
||||||
)
|
)
|
||||||
FA.append('<input type="hidden" name="datefin" value="%(date_fin)s"/>' % sem)
|
}';">Saisie du jour</button>
|
||||||
FA.append(groups_infos.get_form_elem())
|
"""
|
||||||
if moduleimpl_id:
|
|
||||||
FA.append(
|
|
||||||
'<input type="hidden" name="moduleimpl_id" value="%s"/>' % moduleimpl_id
|
|
||||||
)
|
|
||||||
FA.append('<input type="hidden" name="destination" value=""/>')
|
|
||||||
|
|
||||||
FA.append(
|
|
||||||
"""<input type="button" onclick="$('#form_choix_jour_saisie_hebdo')[0].destination.value=get_current_url(); $('#form_choix_jour_saisie_hebdo').submit();" value="Saisir absences du (NON DISPONIBLE) "/>"""
|
|
||||||
)
|
|
||||||
FA.append("""<select name="datedebut">""")
|
|
||||||
date = first_monday
|
|
||||||
i = 0
|
|
||||||
for jour in sco_cal.day_names():
|
|
||||||
if i == today_idx:
|
|
||||||
sel = "selected"
|
|
||||||
else:
|
|
||||||
sel = ""
|
|
||||||
i += 1
|
|
||||||
FA.append('<option value="%s" %s>%s</option>' % (date, sel, jour))
|
|
||||||
date = date.next_day()
|
|
||||||
FA.append("</select>")
|
|
||||||
FA.append("</form>")
|
|
||||||
return "\n".join(FA)
|
|
||||||
|
|
||||||
|
|
||||||
# Ajout Le Havre
|
# Saisie de l'assiduité par semaine
|
||||||
# Formulaire saisie absences semaine
|
|
||||||
def form_choix_saisie_semaine(groups_infos):
|
def form_choix_saisie_semaine(groups_infos):
|
||||||
authuser = current_user
|
authuser = current_user
|
||||||
if not authuser.has_permission(Permission.ScoAbsChange):
|
if not authuser.has_permission(Permission.ScoAbsChange):
|
||||||
return ""
|
return ""
|
||||||
# construit l'URL "destination"
|
|
||||||
# (a laquelle on revient apres saisie absences)
|
|
||||||
query_args = parse_qs(request.query_string)
|
query_args = parse_qs(request.query_string)
|
||||||
moduleimpl_id = query_args.get("moduleimpl_id", [""])[0]
|
moduleimpl_id = query_args.get("moduleimpl_id", [None])[0]
|
||||||
if "head_message" in query_args:
|
semaine = datetime.date.today().isocalendar().week
|
||||||
del query_args["head_message"]
|
return f"""
|
||||||
destination = "%s?%s" % (
|
<button onclick="window.location='{url_for(
|
||||||
request.base_url,
|
"assiduites.signal_assiduites_diff",
|
||||||
urllib.parse.urlencode(query_args, True),
|
group_ids=",".join(map(str,groups_infos.group_ids)),
|
||||||
)
|
semaine=semaine,
|
||||||
destination = destination.replace(
|
scodoc_dept=g.scodoc_dept,
|
||||||
"%", "%%"
|
formsemestre_id=groups_infos.formsemestre_id,
|
||||||
) # car ici utilisee dans un format string !
|
moduleimpl_id=moduleimpl_id
|
||||||
|
)}';">Saisie à la semaine</button>
|
||||||
DateJour = time.strftime("%d/%m/%Y")
|
"""
|
||||||
datelundi = sco_cal.ddmmyyyy(DateJour).prev_monday()
|
|
||||||
FA = [] # formulaire avec menu saisie hebdo des absences
|
|
||||||
# XXX TODO-ASSIDUITE et utiliser un POST
|
|
||||||
FA.append('<form action="Absences/SignaleAbsenceGrHebdo" method="get">')
|
|
||||||
FA.append('<input type="hidden" name="datelundi" value="%s"/>' % datelundi)
|
|
||||||
FA.append('<input type="hidden" name="moduleimpl_id" value="%s"/>' % moduleimpl_id)
|
|
||||||
FA.append('<input type="hidden" name="destination" value="%s"/>' % destination)
|
|
||||||
FA.append(groups_infos.get_form_elem())
|
|
||||||
FA.append(
|
|
||||||
'<input type="submit" class="button" value="Saisie à la semaine (NON DISPONIBLE)" />'
|
|
||||||
) # XXX
|
|
||||||
FA.append("</form>")
|
|
||||||
return "\n".join(FA)
|
|
||||||
|
|
||||||
|
|
||||||
def export_groups_as_moodle_csv(formsemestre_id=None):
|
def export_groups_as_moodle_csv(formsemestre_id=None):
|
||||||
|
@ -331,6 +331,21 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
|
|||||||
}&formsemestre_id={formsemestre.id}
|
}&formsemestre_id={formsemestre.id}
|
||||||
&moduleimpl_id={moduleimpl_id}
|
&moduleimpl_id={moduleimpl_id}
|
||||||
"
|
"
|
||||||
|
>Saisie Absences journée</a></span>
|
||||||
|
"""
|
||||||
|
)
|
||||||
|
|
||||||
|
H.append(
|
||||||
|
f"""
|
||||||
|
<span class="moduleimpl_abs_link"><a class="stdlink" href="{
|
||||||
|
url_for(
|
||||||
|
"assiduites.signal_assiduites_group",
|
||||||
|
scodoc_dept=g.scodoc_dept,
|
||||||
|
group_ids=group_id,
|
||||||
|
jour=datetime.date.today().isoformat(),
|
||||||
|
formsemestre_id=formsemestre.id,
|
||||||
|
moduleimpl_id="" if moduleimpl_id is None else moduleimpl_id
|
||||||
|
)}"
|
||||||
>Saisie Absences hebdo</a></span>
|
>Saisie Absences hebdo</a></span>
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
@ -1002,7 +1002,9 @@ def signal_assiduites_diff():
|
|||||||
"assiduites/pages/signal_assiduites_diff.j2",
|
"assiduites/pages/signal_assiduites_diff.j2",
|
||||||
diff=_differee(
|
diff=_differee(
|
||||||
etudiants=etudiants,
|
etudiants=etudiants,
|
||||||
moduleimpl_select=_module_selector(formsemestre),
|
moduleimpl_select=_module_selector(
|
||||||
|
formsemestre, request.args.get("moduleimpl_id", None)
|
||||||
|
),
|
||||||
date=date,
|
date=date,
|
||||||
periode={
|
periode={
|
||||||
"deb": formsemestre.date_debut.isoformat(),
|
"deb": formsemestre.date_debut.isoformat(),
|
||||||
@ -1162,6 +1164,11 @@ def _module_selector(
|
|||||||
)
|
)
|
||||||
modules.append({"moduleimpl_id": modimpl["moduleimpl_id"], "name": modname})
|
modules.append({"moduleimpl_id": modimpl["moduleimpl_id"], "name": modname})
|
||||||
|
|
||||||
|
try:
|
||||||
|
moduleimpl_id = int(moduleimpl_id)
|
||||||
|
except (ValueError, TypeError):
|
||||||
|
moduleimpl_id = None
|
||||||
|
|
||||||
return render_template(
|
return render_template(
|
||||||
"assiduites/widgets/moduleimpl_selector.j2",
|
"assiduites/widgets/moduleimpl_selector.j2",
|
||||||
selected=selected,
|
selected=selected,
|
||||||
|
Loading…
Reference in New Issue
Block a user