Update opolka/ScoDoc from ScoDoc/ScoDoc #2

Merged
opolka merged 1272 commits from ScoDoc/ScoDoc:master into master 2024-05-27 09:11:04 +02:00
7 changed files with 25 additions and 13 deletions
Showing only changes of commit 4656d9547e - Show all commits

View File

@ -457,7 +457,7 @@ def justif_edit(justif_id: int):
"après": compute_assiduites_justified(
justificatif_unique.etudid,
[justificatif_unique],
False,
True,
),
}
}

View File

@ -362,9 +362,17 @@ def compute_assiduites_justified(
for assi in assiduites:
if assi.etat == EtatAssiduite.PRESENT:
continue
assi_justificatifs = Justificatif.query.filter(
Justificatif.etudid == assi.etudid,
Justificatif.date_debut <= assi.date_debut,
Justificatif.date_fin >= assi.date_fin,
Justificatif.etat == EtatJustificatif.VALIDE,
).all()
if any(
assi.date_debut >= j.date_debut and assi.date_fin <= j.date_fin
for j in justificatifs
for j in justificatifs + assi_justificatifs
):
assi.est_just = True
assiduites_justifiees.append(assi.assiduite_id)

View File

@ -502,13 +502,10 @@ def retreive_formsemestre_from_request() -> int:
group = sco_groups.get_group(args["group_id"])
formsemestre_id = group["formsemestre_id"]
elif group_ids:
if group_ids:
if isinstance(group_ids, str):
group_id = group_ids
else:
# prend le semestre du 1er groupe de la liste:
group_id = group_ids[0]
group = sco_groups.get_group(group_id)
if isinstance(group_ids, str):
group_ids = group_ids.split(",")
group_id = group_ids[0]
group = sco_groups.get_group(group_id)
formsemestre_id = group["formsemestre_id"]
elif "partition_id" in args:
partition = sco_groups.get_partition(args["partition_id"])

View File

@ -138,8 +138,8 @@
const raison = field.querySelector('#justi_raison').value;
return {
date_debut: deb,
date_fin: fin,
date_debut: moment.tz(deb, TIMEZONE).format(),
date_fin: moment.tz(fin, TIMEZONE).format(),
etat: etat,
raison: raison,
}

View File

@ -39,7 +39,7 @@
function getDeptJustificatifsFromPeriod(action) {
const formsemestre = formsemestre_id ? `&formsemestre_id=${formsemestre_id}` : ""
const group = group_id ? `&group_id=${group_id}` : ""
const path = getUrl() + `/api/justificatifs/dept/${dept_id}/query?date_debut=${bornes.deb}&date_fin=${bornes.fin}&etat=attente,modifie${formsemestre}${group}`
const path = getUrl() + `/api/justificatifs/dept/${dept_id}/query?date_debut=${bornes.deb}&date_fin=${bornes.fin}${formsemestre}${group}`
async_get(
path,
(data, status) => {

View File

@ -27,9 +27,17 @@
<section class="nonvalide">
<!-- Tableaux des assiduités (retard/abs) non justifiées -->
<h4>Absences et retards non justifiés</h4>
<span class="iconline">
<a class="icon filter" onclick="filterAssi()"></a>
<a class="icon download" onclick="downloadAssi()"></a>
</span>
{% include "assiduites/widgets/tableau_assi.j2" %}
<!-- Tableaux des justificatifs à valider (attente / modifié ) -->
<h4>Justificatifs en attente (ou modifiés)</h4>
<span class="iconline">
<a class="icon filter" onclick="filterJusti()"></a>
<a class="icon download" onclick="downloadJusti()"></a>
</span>
{% include "assiduites/widgets/tableau_justi.j2" %}
</section>

View File

@ -835,7 +835,6 @@ def visu_assiduites_group():
+ [
# Voir fonctionnement JS
"js/etud_info.js",
"js/abs_ajax.js",
"js/groups_view.js",
"js/assiduites.js",
"libjs/moment.new.min.js",