Assiduité : liens saisie hebdo

This commit is contained in:
Iziram 2024-05-29 16:29:34 +02:00
parent f4f6c13d79
commit f275286b71
3 changed files with 47 additions and 10 deletions

View File

@ -838,6 +838,27 @@ def _make_listes_sem(formsemestre: FormSemestre) -> str:
)}"> )}">
Saisir l'assiduité</a> Saisir l'assiduité</a>
</div> </div>
"""
)
# YYYY-Www (ISO 8601) :
current_week: str = datetime.datetime.now().strftime("%G-W%V")
H.append(
f"""
<div>
<a class="stdlink" href="{
url_for("assiduites.signal_assiduites_hebdo",
scodoc_dept=g.scodoc_dept,
formsemestre_id=formsemestre.id,
group_ids=group.id,
week=current_week,
)}">
Saisir l'assiduité (Hebdo)</a>
</div>
"""
)
if can_edit_abs:
H.append(
f"""
<div> <div>
<a class="stdlink" href="{ <a class="stdlink" href="{
url_for("assiduites.bilan_dept", url_for("assiduites.bilan_dept",

View File

@ -585,8 +585,8 @@ def groups_table(
etud_info["_nom_disp_order"] = etud_sort_key(etud_info) etud_info["_nom_disp_order"] = etud_sort_key(etud_info)
etud_info["_prenom_target"] = fiche_url etud_info["_prenom_target"] = fiche_url
etud_info["_nom_disp_td_attrs"] = 'id="%s" class="etudinfo"' % ( etud_info["_nom_disp_td_attrs"] = (
etud_info["etudid"] 'id="%s" class="etudinfo"' % (etud_info["etudid"])
) )
etud_info["bourse_str"] = "oui" if etud_info["boursier"] else "non" etud_info["bourse_str"] = "oui" if etud_info["boursier"] else "non"
if etud_info["etat"] == "D": if etud_info["etat"] == "D":
@ -998,12 +998,12 @@ def form_choix_saisie_semaine(groups_infos):
return "" return ""
query_args = parse_qs(request.query_string) query_args = parse_qs(request.query_string)
moduleimpl_id = query_args.get("moduleimpl_id", [None])[0] moduleimpl_id = query_args.get("moduleimpl_id", [None])[0]
semaine = datetime.date.today().isocalendar().week semaine = datetime.datetime.now().strftime("%G-W%V")
return f""" return f"""
<button onclick="window.location='{url_for( <button onclick="window.location='{url_for(
"assiduites.signal_assiduites_diff", "assiduites.signal_assiduites_hebdo",
group_ids=",".join(map(str,groups_infos.group_ids)), group_ids=",".join(map(str,groups_infos.group_ids)),
semaine=semaine, week=semaine,
scodoc_dept=g.scodoc_dept, scodoc_dept=g.scodoc_dept,
formsemestre_id=groups_infos.formsemestre_id, formsemestre_id=groups_infos.formsemestre_id,
moduleimpl_id=moduleimpl_id moduleimpl_id=moduleimpl_id

View File

@ -323,7 +323,23 @@ 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> >Saisie Absences</a></span>
"""
)
current_week: str = datetime.datetime.now().strftime("%G-W%V")
H.append(
f"""
<span class="moduleimpl_abs_link"><a class="stdlink" href="{
url_for("assiduites.signal_assiduites_hebdo",
scodoc_dept=g.scodoc_dept,
formsemestre_id=formsemestre.id,
group_ids=group_id,
week=current_week,
moduleimpl_id=moduleimpl_id
)
}
"
>Saisie Absences (Hebdo)</a></span>
""" """
) )
H.append( H.append(
@ -335,8 +351,8 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
group_ids=group_id, group_ids=group_id,
formsemestre_id=formsemestre.id, formsemestre_id=formsemestre.id,
moduleimpl_id="" if moduleimpl_id is None else moduleimpl_id moduleimpl_id="" if moduleimpl_id is None else moduleimpl_id
)}" )}" title="Page en cours de fusion et sera prochainement supprimée. Veuillez utiliser la page `Saisie Absences`"
>Saisie Absences Différée</a></span> >(Saisie Absences Différée)</a></span>
""" """
) )