forked from ScoDoc/ScoDoc
Update opolka/ScoDoc from ScoDoc/ScoDoc #2
@ -71,12 +71,10 @@ def report_debouche_date(start_year=None, fmt="html"):
|
||||
etudids = get_etudids_with_debouche(start_year)
|
||||
tab = table_debouche_etudids(etudids, keep_numeric=keep_numeric)
|
||||
|
||||
tab.filename = scu.make_filename("debouche_scodoc_%s" % start_year)
|
||||
tab.origin = (
|
||||
"Généré par %s le " % sco_version.SCONAME + scu.timedate_human_repr() + ""
|
||||
)
|
||||
tab.caption = "Récapitulatif débouchés à partir du 1/1/%s." % start_year
|
||||
tab.base_url = "%s?start_year=%s" % (request.base_url, start_year)
|
||||
tab.filename = scu.make_filename(f"debouche_scodoc_{start_year}")
|
||||
tab.origin = f"Généré par {sco_version.SCONAME} le {scu.timedate_human_repr()}"
|
||||
tab.caption = f"Récapitulatif débouchés à partir du 1/1/{start_year}."
|
||||
tab.base_url = f"{request.base_url}?start_year={start_year}"
|
||||
return tab.make_page(
|
||||
title="""<h2 class="formsemestre">Débouchés étudiants </h2>""",
|
||||
init_qtip=True,
|
||||
@ -118,7 +116,16 @@ def get_etudids_with_debouche(start_year):
|
||||
|
||||
def table_debouche_etudids(etudids, keep_numeric=True):
|
||||
"""Rapport pour ces étudiants"""
|
||||
L = []
|
||||
rows = []
|
||||
# Recherche les débouchés:
|
||||
itemsuivi_etuds = {etudid: itemsuivi_list_etud(etudid) for etudid in etudids}
|
||||
all_tags = set()
|
||||
for debouche in itemsuivi_etuds.values():
|
||||
if debouche:
|
||||
for it in debouche:
|
||||
all_tags.update(tag.strip() for tag in it["tags"].split(","))
|
||||
all_tags = tuple(sorted(all_tags))
|
||||
|
||||
for etudid in etudids:
|
||||
etud = sco_etud.get_etud_info(filled=True, etudid=etudid)[0]
|
||||
# retrouve le "dernier" semestre (au sens de la date de fin)
|
||||
@ -152,25 +159,33 @@ def table_debouche_etudids(etudids, keep_numeric=True):
|
||||
"sem_ident": "%s %s"
|
||||
% (last_sem["date_debut_iso"], last_sem["titre"]), # utile pour tris
|
||||
}
|
||||
|
||||
# recherche des débouchés
|
||||
debouche = itemsuivi_list_etud(etudid) # liste de plusieurs items
|
||||
debouche = itemsuivi_etuds[etudid] # liste de plusieurs items
|
||||
if debouche:
|
||||
row["debouche"] = "<br>".join(
|
||||
[
|
||||
str(it["item_date"])
|
||||
+ " : "
|
||||
+ it["situation"]
|
||||
+ " <i>"
|
||||
+ it["tags"]
|
||||
+ "</i>"
|
||||
for it in debouche
|
||||
]
|
||||
) #
|
||||
if keep_numeric: # pour excel:
|
||||
row["debouche"] = "\n".join(
|
||||
f"""{it["item_date"]}: {it["situation"]}""" for it in debouche
|
||||
)
|
||||
else:
|
||||
row["debouche"] = "<br>".join(
|
||||
[
|
||||
str(it["item_date"])
|
||||
+ " : "
|
||||
+ it["situation"]
|
||||
+ " <i>"
|
||||
+ it["tags"]
|
||||
+ "</i>"
|
||||
for it in debouche
|
||||
]
|
||||
)
|
||||
for it in debouche:
|
||||
for tag in it["tags"].split(","):
|
||||
tag = tag.strip()
|
||||
row[f"tag_{tag}"] = tag
|
||||
else:
|
||||
row["debouche"] = "non renseigné"
|
||||
L.append(row)
|
||||
L.sort(key=lambda x: x["sem_ident"])
|
||||
rows.append(row)
|
||||
rows.sort(key=lambda x: x["sem_ident"])
|
||||
|
||||
titles = {
|
||||
"civilite": "",
|
||||
@ -184,21 +199,25 @@ def table_debouche_etudids(etudids, keep_numeric=True):
|
||||
"effectif": "Eff.",
|
||||
"debouche": "Débouché",
|
||||
}
|
||||
columns_ids = [
|
||||
"semestre",
|
||||
"semestre_id",
|
||||
"periode",
|
||||
"civilite",
|
||||
"nom",
|
||||
"prenom",
|
||||
"moy",
|
||||
"rang",
|
||||
"effectif",
|
||||
"debouche",
|
||||
]
|
||||
for tag in all_tags:
|
||||
titles[f"tag_{tag}"] = tag
|
||||
columns_ids.append(f"tag_{tag}")
|
||||
tab = GenTable(
|
||||
columns_ids=(
|
||||
"semestre",
|
||||
"semestre_id",
|
||||
"periode",
|
||||
"civilite",
|
||||
"nom",
|
||||
"prenom",
|
||||
"moy",
|
||||
"rang",
|
||||
"effectif",
|
||||
"debouche",
|
||||
),
|
||||
columns_ids=columns_ids,
|
||||
titles=titles,
|
||||
rows=L,
|
||||
rows=rows,
|
||||
# html_col_width='4em',
|
||||
html_sortable=True,
|
||||
html_class="table_leftalign table_listegroupe",
|
||||
|
@ -1495,7 +1495,12 @@ def formsemestre_note_etuds_sans_notes(
|
||||
</div>
|
||||
{message}
|
||||
|
||||
<form method="post">
|
||||
<style>
|
||||
.sco-std-form select, .sco-std-form input[type="submit"] {{
|
||||
height: 24px;
|
||||
}}
|
||||
</style>
|
||||
<form class="sco-std-form" method="post">
|
||||
<input type="hidden" name="formsemestre_id" value="{formsemestre.id}">
|
||||
<input type="hidden" name="etudid" value="{etudid or ""}">
|
||||
|
||||
@ -1506,7 +1511,7 @@ def formsemestre_note_etuds_sans_notes(
|
||||
<option value="ATT" selected>ATT (en attente)</option>
|
||||
<option value="EXC">EXC (neutralisée)</option>
|
||||
</select>
|
||||
<input type="submit" name="enregistrer">
|
||||
<input type="submit" value="Enregistrer">
|
||||
</form>
|
||||
{html_sco_header.sco_footer()}
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user