Compare commits

...

10 Commits

44 changed files with 1407 additions and 1221 deletions

View File

@ -1014,7 +1014,7 @@ def _edit_one(assiduite_unique: Assiduite, data: dict) -> tuple[int, str]:
else assiduite_unique.external_data else assiduite_unique.external_data
) )
if force and not external_data.get("module", False): if force and not (external_data is not None and external_data.get("module", False) != ""):
errors.append( errors.append(
"param 'moduleimpl_id' : le moduleimpl_id ne peut pas être nul" "param 'moduleimpl_id' : le moduleimpl_id ne peut pas être nul"
) )

26
app/but/jury_export.py Normal file
View File

@ -0,0 +1,26 @@
##############################################################################
# ScoDoc
# Copyright (c) 1999 - 2023 Emmanuel Viennet. All rights reserved.
# See LICENSE
##############################################################################
"""Feuille d'export Jury BUT
"""
import datetime
from flask import render_template
from app.models import FormSemestre, FormSemestreInscription
from app.views import ScoData
def feuille_preparation_jury_but(formsemestre_id: int):
formsemestre: FormSemestre = FormSemestre.query.filter_by(
id=formsemestre_id
).first_or_404()
return render_template(
"but/jury_export.j2",
datetime=datetime,
formsemestre=formsemestre,
sco=ScoData(formsemestre=formsemestre),
)

View File

@ -300,7 +300,7 @@ def _load_and_convert_ics(formsemestre: FormSemestre) -> list[dict]:
.replace(tzinfo=timezone.utc) .replace(tzinfo=timezone.utc)
.astimezone(tz=None) .astimezone(tz=None)
.strftime("%H:%M"), .strftime("%H:%M"),
"jour": event.decoded("dtstart").isoformat(), "jour": event.decoded("dtstart").date().isoformat(),
"start": event.decoded("dtstart").isoformat(), "start": event.decoded("dtstart").isoformat(),
"end": event.decoded("dtend").isoformat(), "end": event.decoded("dtend").isoformat(),
} }

View File

@ -444,6 +444,12 @@ def formsemestre_status_menubar(formsemestre: FormSemestre) -> str:
"args": {"formsemestre_id": formsemestre_id}, "args": {"formsemestre_id": formsemestre_id},
"enabled": not formsemestre.formation.is_apc(), "enabled": not formsemestre.formation.is_apc(),
}, },
{
"title": "Générer feuille préparation Jury (BUT)",
"endpoint": "notes.feuille_preparation_jury_but",
"args": {"formsemestre_id": formsemestre_id},
"enabled": formsemestre.formation.is_apc(),
},
{ {
"title": "Éditer les PV et archiver les résultats", "title": "Éditer les PV et archiver les résultats",
"endpoint": "notes.formsemestre_archive", "endpoint": "notes.formsemestre_archive",

View File

@ -67,18 +67,24 @@ CSSSTYLES = html_sco_header.BOOTSTRAP_MULTISELECT_CSS
def groups_view( def groups_view(
group_ids=(), group_ids=(),
fmt="html", fmt="html",
# Options pour listes:
with_codes=0, with_codes=0,
etat=None, etat=None,
with_paiement=0, # si vrai, ajoute colonnes infos paiement droits et finalisation inscription (lent car interrogation portail) with_paiement=0,
with_archives=0, # ajoute colonne avec noms fichiers archivés with_archives=0,
with_annotations=0, with_annotations=0,
with_bourse=0, with_bourse=0,
formsemestre_id=None, # utilise si aucun groupe selectionné formsemestre_id=None,
): ):
"""Affichage des étudiants des groupes indiqués """Affichage des étudiants des groupes indiqués
group_ids: liste de group_id group_ids: liste de group_id
fmt: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf fmt: csv, json, xml, xls, allxls, xlsappel, moodlecsv, pdf
Options pour listes:
with_paiement: si vrai, ajoute colonnes infos paiement droits
et finalisation inscription (lent car interrogation portail)
with_archives: ajoute colonne avec noms fichiers archivés
formsemestre_id est utilisé si aucun groupe selectionné pour construire la liste des groupes.
""" """
# Informations sur les groupes à afficher: # Informations sur les groupes à afficher:
groups_infos = DisplayedGroupsInfos( groups_infos = DisplayedGroupsInfos(
@ -100,25 +106,22 @@ def groups_view(
with_bourse=with_bourse, with_bourse=with_bourse,
) )
H = [
html_sco_header.sco_header(
javascripts=JAVASCRIPTS,
cssstyles=CSSSTYLES,
init_qtip=True,
)
]
# Menu choix groupe
H.append("""<div id="group-tabs">""")
H.append(form_groups_choice(groups_infos, submit_on_change=True))
# Note: le formulaire est soumis a chaque modif des groupes # Note: le formulaire est soumis a chaque modif des groupes
# on pourrait faire comme pour le form de saisie des notes. Il faudrait pour cela: # on pourrait faire comme pour le form de saisie des notes. Il faudrait pour cela:
# - charger tous les etudiants au debut, quels que soient les groupes selectionnés # - charger tous les etudiants au debut, quels que soient les groupes selectionnés
# - ajouter du JS pour modifier les liens (arguments group_ids) quand le menu change # - ajouter du JS pour modifier les liens (arguments group_ids) quand le menu change
# Tabs return f"""
H.extend( { html_sco_header.sco_header(
( javascripts=JAVASCRIPTS,
"""<ul class="nav nav-tabs"> cssstyles=CSSSTYLES,
init_qtip=True,
)
}
<div id="group-tabs">
<!-- Menu choix groupe -->
{form_groups_choice(groups_infos, submit_on_change=True)}
<ul class="nav nav-tabs">
<li class="active"><a href="#tab-listes" data-toggle="tab">Listes</a></li> <li class="active"><a href="#tab-listes" data-toggle="tab">Listes</a></li>
<li><a href="#tab-photos" data-toggle="tab">Photos</a></li> <li><a href="#tab-photos" data-toggle="tab">Photos</a></li>
<li><a href="#tab-abs" data-toggle="tab">Absences et feuilles...</a></li> <li><a href="#tab-abs" data-toggle="tab">Absences et feuilles...</a></li>
@ -127,7 +130,7 @@ def groups_view(
<!-- Tab panes --> <!-- Tab panes -->
<div class="tab-content"> <div class="tab-content">
<div class="tab-pane active" id="tab-listes"> <div class="tab-pane active" id="tab-listes">
""", {
groups_table( groups_table(
groups_infos=groups_infos, groups_infos=groups_infos,
fmt=fmt, fmt=fmt,
@ -137,20 +140,18 @@ def groups_view(
with_archives=with_archives, with_archives=with_archives,
with_annotations=with_annotations, with_annotations=with_annotations,
with_bourse=with_bourse, with_bourse=with_bourse,
),
"</div>",
"""<div class="tab-pane" id="tab-photos">""",
tab_photos_html(groups_infos, etat=etat),
#'<p>hello</p>',
"</div>",
'<div class="tab-pane" id="tab-abs">',
tab_absences_html(groups_infos, etat=etat),
"</div>",
) )
) }
</div>
H.append(html_sco_header.sco_footer()) <div class="tab-pane" id="tab-photos">
return "\n".join(H) { tab_photos_html(groups_infos, etat=etat) }
</div>
<div class="tab-pane" id="tab-abs">
{ tab_absences_html(groups_infos, etat=etat) }
</div>
</div>
{ html_sco_header.sco_footer() }
"""
def form_groups_choice( def form_groups_choice(
@ -745,7 +746,7 @@ def groups_table(
H.append("</ul>") H.append("</ul>")
return "".join(H) + "</div>" return "".join(H)
elif ( elif (
fmt == "pdf" fmt == "pdf"

View File

@ -331,15 +331,16 @@ def moduleimpl_status(moduleimpl_id=None, partition_id=None):
>Saisie Absences journée</a></span> >Saisie Absences journée</a></span>
""" """
) )
year, week, day = datetime.date.today().isocalendar()
semaine: str = f"{year}-W{week}"
H.append( H.append(
f""" f"""
<span class="moduleimpl_abs_link"><a class="stdlink" href="{ <span class="moduleimpl_abs_link"><a class="stdlink" href="{
url_for( url_for(
"assiduites.signal_assiduites_group", "assiduites.signal_assiduites_diff",
scodoc_dept=g.scodoc_dept, scodoc_dept=g.scodoc_dept,
group_ids=group_id, group_ids=group_id,
jour=datetime.date.today().isoformat(), semaine=semaine,
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
)}" )}"

View File

@ -1,4 +1,3 @@
$(function () { $(function () {
$("div#export_help").accordion({ $("div#export_help").accordion({
heightStyle: "content", heightStyle: "content",
@ -14,36 +13,36 @@ $(function () {
// -> surligne le cas sélectionné // -> surligne le cas sélectionné
function display(r, c, row, col) { function display(r, c, row, col) {
if ((row != r) && (row != '*')) return 'none'; if (row != r && row != "*") return "none";
if ((col != c) && (col != '*')) return 'none'; if (col != c && col != "*") return "none";
return ''; return "";
} }
function show_tag(all_rows, all_cols, tag) { function show_tag(all_rows, all_cols, tag) {
// Filtrer tous les étudiants // Filtrer tous les étudiants
all_rows.split(',').forEach(function (r) { all_rows.split(",").forEach(function (r) {
all_cols.split(',').forEach(function (c) { all_cols.split(",").forEach(function (c) {
etudiants = r + c.substring(1); etudiants = r + c.substring(1);
$(etudiants).css("display", "none"); $(etudiants).css("display", "none");
}) });
}) });
// sauf le tag // sauf le tag
$('.' + tag).css('display', ''); $("." + tag).css("display", "");
} }
function show_filtres(effectifs, filtre_row, filtre_col) { function show_filtres(effectifs, filtre_row, filtre_col) {
$("#compte").html(effectifs); $("#compte").html(effectifs);
if ((filtre_row == '') && (filtre_col == '')) { if (filtre_row == "" && filtre_col == "") {
$("#sans_filtre").css("display", ""); $("#sans_filtre").css("display", "");
$("#filtre_row").css("display", "none"); $("#filtre_row").css("display", "none");
$("#filtre_col").css("display", "none"); $("#filtre_col").css("display", "none");
} else { } else {
$("#sans_filtre").css("display", "none"); $("#sans_filtre").css("display", "none");
if (filtre_row == '') { if (filtre_row == "") {
$("#filtre_row").css("display", "none"); $("#filtre_row").css("display", "none");
$("#filtre_col").css("display", ""); $("#filtre_col").css("display", "");
$("#filtre_col").html("Filtre sur code étape: " + filtre_col); $("#filtre_col").html("Filtre sur code étape: " + filtre_col);
} else if (filtre_col == '') { } else if (filtre_col == "") {
$("#filtre_row").css("display", ""); $("#filtre_row").css("display", "");
$("#filtre_col").css("display", "none"); $("#filtre_col").css("display", "none");
$("#filtre_row").html("Filtre sur semestre: " + filtre_row); $("#filtre_row").html("Filtre sur semestre: " + filtre_row);
@ -56,26 +55,38 @@ function show_filtres(effectifs, filtre_row, filtre_col) {
} }
} }
function doFiltrage(all_rows, all_cols, row, col, effectifs, filtre_row, filtre_col) { function doFiltrage(
show_filtres(effectifs, filtre_row, filtre_col) all_rows,
all_rows.split(',').forEach(function (r) { all_cols,
all_cols.split(',').forEach(function (c) { row,
col,
effectifs,
filtre_row,
filtre_col
) {
show_filtres(effectifs, filtre_row, filtre_col);
all_rows.split(",").forEach(function (r) {
all_cols.split(",").forEach(function (c) {
etudiants = r + c.substring(1); etudiants = r + c.substring(1);
$(etudiants).css("display", display(r, c, row, col)); $(etudiants).css("display", display(r, c, row, col));
}); });
}); });
$('.repartition td').css("background-color", ""); $(".repartition td").css("background-color", "");
$('.repartition th').css("background-color", ""); $(".repartition th").css("background-color", "");
if (row == '*' && col == '*') { // Aucun filtre if (row == "*" && col == "*") {
} else if (row == '*') { // filtrage sur 1 colonne // Aucun filtre
} else if (row == "*") {
// filtrage sur 1 colonne
$(col).css("background-color", "lightblue"); $(col).css("background-color", "lightblue");
} else if (col == '*') { // Filtrage sur 1 ligne } else if (col == "*") {
$(row + '>td').css("background-color", "lightblue"); // Filtrage sur 1 ligne
$(row + '>th').css("background-color", "lightblue"); $(row + ">td").css("background-color", "lightblue");
} else { // filtrage sur 1 case $(row + ">th").css("background-color", "lightblue");
$(row + '>td' + col).css("background-color", "lightblue"); } else {
// filtrage sur 1 case
$(row + ">td" + col).css("background-color", "lightblue");
} }
// Modifie le titre de la section pour indiquer la sélection: // Modifie le titre de la section pour indiquer la sélection:

View File

@ -1,6 +1,5 @@
// <=== CONSTANTS and GLOBALS ===> // <=== CONSTANTS and GLOBALS ===>
const TIMEZONE = "Europe/Paris";
let url; let url;
function getUrl() { function getUrl() {
@ -192,8 +191,9 @@ function sync_get(path, success, errors) {
*/ */
async function async_get(path, success, errors) { async function async_get(path, success, errors) {
console.log("async_get " + path); console.log("async_get " + path);
let response;
try { try {
const response = await fetch(path); response = await fetch(path);
if (response.ok) { if (response.ok) {
const data = await response.json(); const data = await response.json();
success(data); success(data);
@ -204,6 +204,8 @@ async function async_get(path, success, errors) {
console.error(error); console.error(error);
if (errors) errors(error); if (errors) errors(error);
} }
return response;
} }
/** /**
@ -234,8 +236,9 @@ function sync_post(path, data, success, errors) {
*/ */
async function async_post(path, data, success, errors) { async function async_post(path, data, success, errors) {
console.log("async_post " + path); console.log("async_post " + path);
let response;
try { try {
const response = await fetch(path, { response = await fetch(path, {
method: "POST", method: "POST",
headers: { headers: {
"Content-Type": "application/json", "Content-Type": "application/json",
@ -253,6 +256,8 @@ async function async_post(path, data, success, errors) {
console.error(error); console.error(error);
if (errors) errors(error); if (errors) errors(error);
} }
return response;
} }
// <<== Gestion des actions de masse ==>> // <<== Gestion des actions de masse ==>>
@ -611,7 +616,7 @@ function updateDate() {
} }
let dateStr = ""; let dateStr = "";
if (!verifyNonWorkDays(date.getDay(), nonWorkDays)) { if (!isNonWorkDay(date.getDay(), nonWorkDays)) {
dateStr = formatDate(date).capitalize(); dateStr = formatDate(date).capitalize();
} else { } else {
// On se rend au dernier jour travaillé disponible // On se rend au dernier jour travaillé disponible
@ -630,13 +635,17 @@ function updateDate() {
) )
); );
openAlertModal("Attention", div, "", "#eec660"); openAlertModal("Attention", div, "", "#eec660");
$(dateInput).datepicker( const date_fra = Date.toFRA(lastWorkDay.toIsoUtcString().split("T")[0]);
"setDate",
Date.toFRA(lastWorkDay.toIsoUtcString().split("T")[0]) $(dateInput).datepicker("setDate", date_fra);
); dateInput.value = date_fra;
date = lastWorkDay;
dateStr = formatDate(lastWorkDay).capitalize(); dateStr = formatDate(lastWorkDay).capitalize();
} }
console.warn(dateStr, date, date.toIsoUtcString());
document.querySelector("#datestr").textContent = dateStr; document.querySelector("#datestr").textContent = dateStr;
return true; return true;
} }
@ -645,7 +654,7 @@ function getNearestWorkDay(date) {
const aDay = 86400000; // 24 * 3600 * 1000 | H * s * ms const aDay = 86400000; // 24 * 3600 * 1000 | H * s * ms
let day = date; let day = date;
let count = 0; let count = 0;
while (verifyNonWorkDays(day.getDay(), nonWorkDays) && count++ < 7) { while (isNonWorkDay(day.getDay(), nonWorkDays) && count++ < 7) {
day = new Date(day - aDay); day = new Date(day - aDay);
} }
return day; return day;
@ -702,7 +711,7 @@ function formatDateModal(str, separator = " ") {
* Vérifie si la date sélectionnée n'est pas un jour non travaillé * Vérifie si la date sélectionnée n'est pas un jour non travaillé
* Renvoie Vrai si le jour est non travaillé * Renvoie Vrai si le jour est non travaillé
*/ */
function verifyNonWorkDays(day, nonWorkdays) { function isNonWorkDay(day, nonWorkdays) {
let d = ""; let d = "";
switch (day) { switch (day) {
case 0: case 0:

View File

@ -1,7 +1,6 @@
// Affichage anciens (non BUT) bulletin de notes // Affichage anciens (non BUT) bulletin de notes
// (uses jQuery) // (uses jQuery)
// Change visibility of UE details (les <tr> de classe "notes_bulletin_row_mod" suivant) // Change visibility of UE details (les <tr> de classe "notes_bulletin_row_mod" suivant)
// La table a la structure suivante: // La table a la structure suivante:
// <tr class="notes_bulletin_row_ue"><td><span class="toggle_ue">+/-</span>...</td>...</tr> // <tr class="notes_bulletin_row_ue"><td><span class="toggle_ue">+/-</span>...</td>...</tr>
@ -15,7 +14,7 @@ function toggle_vis_ue(e, new_state) {
var tr = e.parentNode.parentNode; var tr = e.parentNode.parentNode;
if (new_state == undefined) { if (new_state == undefined) {
// current state: use alt attribute of current image // current state: use alt attribute of current image
if (e.childNodes[0].alt == '+') { if (e.childNodes[0].alt == "+") {
new_state = false; new_state = false;
} else { } else {
new_state = true; new_state = true;
@ -25,26 +24,30 @@ function toggle_vis_ue(e, new_state) {
var tr = tr.nextSibling; var tr = tr.nextSibling;
//while ((tr != null) && sibl.tagName == 'TR') { //while ((tr != null) && sibl.tagName == 'TR') {
var current = true; var current = true;
while ((tr != null) && current) { while (tr != null && current) {
if ((tr.nodeType == 1) && (tr.tagName == 'TR')) { if (tr.nodeType == 1 && tr.tagName == "TR") {
for (var i = 0; i < tr.classList.length; i++) { for (var i = 0; i < tr.classList.length; i++) {
if ((tr.classList[i] == 'notes_bulletin_row_ue') || (tr.classList[i] == 'notes_bulletin_row_sum_ects')) if (
tr.classList[i] == "notes_bulletin_row_ue" ||
tr.classList[i] == "notes_bulletin_row_sum_ects"
)
current = false; current = false;
} }
if (current) { if (current) {
if (new_state) { if (new_state) {
tr.style.display = 'none'; tr.style.display = "none";
} else { } else {
tr.style.display = 'table-row'; tr.style.display = "table-row";
} }
} }
} }
tr = tr.nextSibling; tr = tr.nextSibling;
} }
if (new_state) { if (new_state) {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus_img.png"/>'; e.innerHTML =
'<img width="13" height="13" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus_img.png"/>';
} else { } else {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus_img.png"/>'; e.innerHTML =
'<img width="13" height="13" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus_img.png"/>';
} }
} }

View File

@ -13,12 +13,11 @@ var CURRENTWEEKCOLOR = "yellow";
// get all tr elements from this class // get all tr elements from this class
// (no getElementBuClassName) // (no getElementBuClassName)
function getTRweek(week) { function getTRweek(week) {
var tablecal = document.getElementById('maincalendar'); var tablecal = document.getElementById("maincalendar");
var all = tablecal.getElementsByTagName('tr'); var all = tablecal.getElementsByTagName("tr");
var res = []; var res = [];
for (var i = 0; i < all.length; i++) { for (var i = 0; i < all.length; i++) {
if (all[i].className == week) if (all[i].className == week) res[res.length] = all[i];
res[res.length] = all[i];
} }
return res; return res;
} }
@ -26,11 +25,10 @@ function getTRweek( week ) {
var HIGHLIGHTEDCELLS = []; var HIGHLIGHTEDCELLS = [];
function deselectweeks() { function deselectweeks() {
for (var i = 0; i < HIGHLIGHTEDCELLS.length; i++) { for (var i = 0; i < HIGHLIGHTEDCELLS.length; i++) {
var row = rows[i]; var row = rows[i];
if (row) { if (row) {
if (row.className.match('currentweek')) { if (row.className.match("currentweek")) {
row.style.backgroundColor = CURRENTWEEKCOLOR; row.style.backgroundColor = CURRENTWEEKCOLOR;
} else { } else {
row.style.backgroundColor = WEEKDAYCOLOR; row.style.backgroundColor = WEEKDAYCOLOR;
@ -44,7 +42,7 @@ function deselectweeks() {
function highlightweek(el) { function highlightweek(el) {
deselectweeks(); deselectweeks();
var week = el.className; var week = el.className;
if ((week == 'wkend') || (week.substring(0,2) != 'wk')) { if (week == "wkend" || week.substring(0, 2) != "wk") {
return; /* does not hightlight weekends */ return; /* does not hightlight weekends */
} }
rows = getTRweek(week); rows = getTRweek(week);
@ -58,7 +56,7 @@ function highlightweek(el) {
// click on a day // click on a day
function wclick(el) { function wclick(el) {
monday = el.className; monday = el.className;
form = document.getElementById('formw'); form = document.getElementById("formw");
form.datelundi.value = monday.substr(2).replace(/_/g,'/').split(' ')[0]; form.datelundi.value = monday.substr(2).replace(/_/g, "/").split(" ")[0];
form.submit(); form.submit();
} }

View File

@ -2,5 +2,4 @@ function submit_form() {
$("#config_logos_form").submit(); $("#config_logos_form").submit();
} }
$(function () { $(function () {});
})

View File

@ -13,7 +13,7 @@ les balises (fermées par défaut sauf si attribut open déjà activé dans le c
*/ */
const ID_ATTRIBUTE = "ds_id" const ID_ATTRIBUTE = "ds_id";
function genere_id(detail, idnum) { function genere_id(detail, idnum) {
let id = "ds_" + idnum; let id = "ds_" + idnum;
@ -47,7 +47,7 @@ function restore_detail(detail, id) {
} }
function add_listener(detail) { function add_listener(detail) {
detail.addEventListener('toggle', (e) => { detail.addEventListener("toggle", (e) => {
let id = e.target.getAttribute(ID_ATTRIBUTE); let id = e.target.getAttribute(ID_ATTRIBUTE);
let ante = e.target.getAttribute("open"); let ante = e.target.getAttribute("open");
if (ante == null) { if (ante == null) {
@ -56,16 +56,16 @@ function add_listener(detail) {
localStorage.setItem(id, true); localStorage.setItem(id, true);
} }
e.stopPropagation(); e.stopPropagation();
}) });
} }
function reset_ds() { function reset_ds() {
let idnum = 0; let idnum = 0;
keepDetails = true; keepDetails = true;
details = document.querySelectorAll("details") details = document.querySelectorAll("details");
details.forEach(function (detail) { details.forEach(function (detail) {
let id = genere_id(detail, idnum); let id = genere_id(detail, idnum);
console.log("Processing " + id) console.log("Processing " + id);
if (keepDetails) { if (keepDetails) {
restore_detail(detail, id); restore_detail(detail, id);
} else { } else {
@ -76,7 +76,7 @@ function reset_ds() {
}); });
} }
window.addEventListener('load', function() { window.addEventListener("load", function () {
console.log("details/summary persistence ON"); console.log("details/summary persistence ON");
reset_ds(); reset_ds();
}) });

View File

@ -1,38 +1,32 @@
function _partition_set_attr(partition_id, attr_name, attr_value) { function _partition_set_attr(partition_id, attr_name, attr_value) {
$.post(SCO_URL + '/partition_set_attr', $.post(
SCO_URL + "/partition_set_attr",
{ {
'partition_id': partition_id, partition_id: partition_id,
'attr': attr_name, attr: attr_name,
'value': attr_value value: attr_value,
}, },
function (result) { function (result) {
sco_message(result); sco_message(result);
}); }
);
return; return;
} }
// Met à jour bul_show_rank lorsque checkbox modifiees: // Met à jour bul_show_rank lorsque checkbox modifiees:
function update_rk(e) { function update_rk(e) {
var partition_id = $(e).attr('data-partition_id'); var partition_id = $(e).attr("data-partition_id");
var v; var v;
if (e.checked) if (e.checked) v = "1";
v = '1'; else v = "0";
else _partition_set_attr(partition_id, "bul_show_rank", v);
v = '0';
_partition_set_attr(partition_id, 'bul_show_rank', v);
} }
function update_show_in_list(e) { function update_show_in_list(e) {
var partition_id = $(e).attr('data-partition_id'); var partition_id = $(e).attr("data-partition_id");
var v; var v;
if (e.checked) if (e.checked) v = "1";
v = '1'; else v = "0";
else
v = '0';
_partition_set_attr(partition_id, 'show_in_lists', v); _partition_set_attr(partition_id, "show_in_lists", v);
} }

View File

@ -15,10 +15,11 @@ $().ready(function () {
function update_bonus_description() { function update_bonus_description() {
var ue_type = $("#tf_type")[0].value; var ue_type = $("#tf_type")[0].value;
if (ue_type == "1") { /* UE SPORT */ if (ue_type == "1") {
/* UE SPORT */
$("#bonus_description").show(); $("#bonus_description").show();
var query = "/ScoDoc/get_bonus_description/default"; var query = "/ScoDoc/get_bonus_description/default";
$.get(query, '', function (data) { $.get(query, "", function (data) {
$("#bonus_description").html(data); $("#bonus_description").html(data);
}); });
} else { } else {
@ -30,29 +31,38 @@ function update_bonus_description() {
function update_ue_list() { function update_ue_list() {
let ue_id = $("#tf_ue_id")[0].value; let ue_id = $("#tf_ue_id")[0].value;
let ue_code = $("#tf_ue_code")[0].value; let ue_code = $("#tf_ue_code")[0].value;
let query = SCO_URL + "/Notes/ue_sharing_code?ue_code=" + ue_code + "&hide_ue_id=" + ue_id + "&ue_id=" + ue_id; let query =
$.get(query, '', function (data) { SCO_URL +
"/Notes/ue_sharing_code?ue_code=" +
ue_code +
"&hide_ue_id=" +
ue_id +
"&ue_id=" +
ue_id;
$.get(query, "", function (data) {
$("#ue_list_code").html(data); $("#ue_list_code").html(data);
}); });
} }
function set_ue_parcour(checkbox) { function set_ue_parcour(checkbox) {
let url = checkbox.dataset.setter; let url = checkbox.dataset.setter;
const checkboxes = document.querySelectorAll('#choix_parcours input[type="checkbox"]:checked'); const checkboxes = document.querySelectorAll(
'#choix_parcours input[type="checkbox"]:checked'
);
const parcours_ids = []; const parcours_ids = [];
checkboxes.forEach(function (checkbox) { checkboxes.forEach(function (checkbox) {
parcours_ids.push(checkbox.value); parcours_ids.push(checkbox.value);
}); });
fetch(url, { fetch(url, {
method: 'POST', method: "POST",
headers: { headers: {
'Content-Type': 'application/json' "Content-Type": "application/json",
}, },
body: JSON.stringify(parcours_ids) body: JSON.stringify(parcours_ids),
}) })
.then(response => response.json()) .then((response) => response.json())
.then(data => { .then((data) => {
if (data.status == 404) { if (data.status == 404) {
sco_error_message(data.message); sco_error_message(data.message);
} else { } else {
@ -60,4 +70,3 @@ function set_ue_parcour(checkbox) {
} }
}); });
} }

View File

@ -1,4 +1,3 @@
// Mécanisme d'auto-complétion (choix) d'un étudiant // Mécanisme d'auto-complétion (choix) d'un étudiant
// Il faut un champs #etudiant (text input) et à coté un champ hidden etudid qui sera rempli. // Il faut un champs #etudiant (text input) et à coté un champ hidden etudid qui sera rempli.
// utilise autoComplete.js, source https://tarekraafat.github.io/autoComplete.js // utilise autoComplete.js, source https://tarekraafat.github.io/autoComplete.js
@ -22,19 +21,21 @@ function etud_autocomplete_config(with_dept = false) {
} }
}, },
// Data source 'Object' key to be searched // Data source 'Object' key to be searched
keys: ["nom"] keys: ["nom"],
}, },
events: { events: {
input: { input: {
selection: (event) => { selection: (event) => {
const prenom = sco_capitalize(event.detail.selection.value.prenom); const prenom = sco_capitalize(event.detail.selection.value.prenom);
const selection = with_dept ? `${event.detail.selection.value.nom} ${prenom} (${event.detail.selection.value.dept_acronym})` : `${event.detail.selection.value.nom} ${prenom}`; const selection = with_dept
? `${event.detail.selection.value.nom} ${prenom} (${event.detail.selection.value.dept_acronym})`
: `${event.detail.selection.value.nom} ${prenom}`;
// store etudid // store etudid
const etudidField = document.getElementById('etudid'); const etudidField = document.getElementById("etudid");
etudidField.value = event.detail.selection.value.id; etudidField.value = event.detail.selection.value.id;
autoCompleteJS.input.value = selection; autoCompleteJS.input.value = selection;
} },
} },
}, },
resultsList: { resultsList: {
element: (list, data) => { element: (list, data) => {
@ -48,7 +49,7 @@ function etud_autocomplete_config(with_dept = false) {
// Append message element to the results list // Append message element to the results list
list.prepend(message); list.prepend(message);
// Efface l'etudid // Efface l'etudid
const etudidField = document.getElementById('etudid'); const etudidField = document.getElementById("etudid");
etudidField.value = ""; etudidField.value = "";
} }
}, },
@ -58,8 +59,10 @@ function etud_autocomplete_config(with_dept = false) {
highlight: true, highlight: true,
element: (item, data) => { element: (item, data) => {
const prenom = sco_capitalize(data.value.prenom); const prenom = sco_capitalize(data.value.prenom);
item.innerHTML += with_dept ? ` ${prenom} (${data.value.dept_acronym})` : ` ${prenom}`; item.innerHTML += with_dept
? ` ${prenom} (${data.value.dept_acronym})`
: ` ${prenom}`;
}, },
}, },
} };
} }

View File

@ -1,38 +1,37 @@
// Tableau recap evaluations du semestre // Tableau recap evaluations du semestre
$(function () { $(function () {
$('table.evaluations_recap').DataTable( $("table.evaluations_recap").DataTable({
{
paging: false, paging: false,
searching: true, searching: true,
info: false, info: false,
autoWidth: false, autoWidth: false,
fixedHeader: { fixedHeader: {
header: true, header: true,
footer: false footer: false,
}, },
orderCellsTop: true, // cellules ligne 1 pour tri orderCellsTop: true, // cellules ligne 1 pour tri
aaSorting: [], // Prevent initial sorting aaSorting: [], // Prevent initial sorting
colReorder: true, colReorder: true,
"columnDefs": [ columnDefs: [
{ {
// colonne date, triable (XXX ne fonctionne pas) // colonne date, triable (XXX ne fonctionne pas)
targets: ["date"], targets: ["date"],
"type": "string", type: "string",
}, },
], ],
dom: 'Bfrtip', dom: "Bfrtip",
buttons: [ buttons: [
{ {
extend: 'copyHtml5', extend: "copyHtml5",
text: 'Copier', text: "Copier",
exportOptions: { orthogonal: 'export' } exportOptions: { orthogonal: "export" },
}, },
{ {
extend: 'excelHtml5', extend: "excelHtml5",
exportOptions: { orthogonal: 'export' }, exportOptions: { orthogonal: "export" },
title: document.querySelector('table.evaluations_recap').dataset.filename title: document.querySelector("table.evaluations_recap").dataset
.filename,
}, },
], ],
});
})
}); });

View File

@ -2,13 +2,10 @@
// Menu choix parcours: // Menu choix parcours:
$(function () { $(function () {
$('#parcours_sel').multiselect( $("#parcours_sel").multiselect({
{
includeSelectAllOption: true, includeSelectAllOption: true,
nonSelectedText:'Choisir le(s) parcours...', nonSelectedText: "Choisir le(s) parcours...",
selectAllValue: '', selectAllValue: "",
numberDisplayed: 3, numberDisplayed: 3,
}
);
}); });
});

View File

@ -4,25 +4,37 @@ var apo_mod_editor = null;
$(document).ready(function () { $(document).ready(function () {
var table_options = { var table_options = {
"paging": false, paging: false,
"searching": false, searching: false,
"info": false, info: false,
/* "autoWidth" : false, */ /* "autoWidth" : false, */
"fixedHeader": { fixedHeader: {
"header": true, header: true,
"footer": true footer: true,
}, },
"orderCellsTop": true, // cellules ligne 1 pour tri orderCellsTop: true, // cellules ligne 1 pour tri
"aaSorting": [], // Prevent initial sorting aaSorting: [], // Prevent initial sorting
}; };
$('table#formation_table_recap').DataTable(table_options); $("table#formation_table_recap").DataTable(table_options);
let table_editable = document.querySelector("table#formation_table_recap.apo_editable"); let table_editable = document.querySelector(
"table#formation_table_recap.apo_editable"
);
if (table_editable) { if (table_editable) {
let apo_ue_save_url = document.querySelector("table#formation_table_recap.apo_editable").dataset.apo_ue_save_url; let apo_ue_save_url = document.querySelector(
apo_ue_editor = new ScoFieldEditor("table#formation_table_recap tr.ue td.apo", apo_ue_save_url, false); "table#formation_table_recap.apo_editable"
let apo_mod_save_url = document.querySelector("table#formation_table_recap.apo_editable").dataset.apo_mod_save_url; ).dataset.apo_ue_save_url;
apo_mod_editor = new ScoFieldEditor("table#formation_table_recap tr.mod td.apo", apo_mod_save_url, false); apo_ue_editor = new ScoFieldEditor(
"table#formation_table_recap tr.ue td.apo",
apo_ue_save_url,
false
);
let apo_mod_save_url = document.querySelector(
"table#formation_table_recap.apo_editable"
).dataset.apo_mod_save_url;
apo_mod_editor = new ScoFieldEditor(
"table#formation_table_recap tr.mod td.apo",
apo_mod_save_url,
false
);
} }
}); });

View File

@ -8,7 +8,6 @@ function change_semestre_id() {
$(".sem" + semestre_id).show(); $(".sem" + semestre_id).show();
} }
$(window).on("load", function () {
$(window).on('load', function () {
change_semestre_id(); change_semestre_id();
}); });

View File

@ -1,21 +1,22 @@
function compute_moyenne() { function compute_moyenne() {
var notes = $(".tf_field_note input").map( var notes = $(".tf_field_note input")
function () { return parseFloat($(this).val()); } .map(function () {
).get(); return parseFloat($(this).val());
})
.get();
// les coefs sont donnes (ECTS en BUT) // les coefs sont donnes (ECTS en BUT)
let coefs = $("form.tf_ext_edit_ue_validations").data("ue_coefs"); let coefs = $("form.tf_ext_edit_ue_validations").data("ue_coefs");
// ou saisis (formations classiques) // ou saisis (formations classiques)
if (coefs == 'undefined') { if (coefs == "undefined") {
coefs = $(".tf_field_coef input").map( coefs = $(".tf_field_coef input")
function () { return parseFloat($(this).val()); } .map(function () {
).get(); return parseFloat($(this).val());
})
.get();
} }
var N = notes.length; var N = notes.length;
var dp = 0.; var dp = 0;
var sum_coefs = 0.; var sum_coefs = 0;
for (var i = 0; i < N; i++) { for (var i = 0; i < N; i++) {
if (!(isNaN(notes[i]) || isNaN(coefs[i]))) { if (!(isNaN(notes[i]) || isNaN(coefs[i]))) {
dp += notes[i] * coefs[i]; dp += notes[i] * coefs[i];
@ -38,7 +39,10 @@ function enable_disable_fields_cb() {
} }
function enable_disable_fields(select_elt) { function enable_disable_fields(select_elt) {
// input fields controled by this menu // input fields controled by this menu
var input_fields = $(select_elt).parent().parent().find('input:not(.ext_coef_disabled)'); var input_fields = $(select_elt)
.parent()
.parent()
.find("input:not(.ext_coef_disabled)");
var disabled = false; var disabled = false;
if ($(select_elt).val() === "None") { if ($(select_elt).val() === "None") {
disabled = true; disabled = true;
@ -46,26 +50,24 @@ function enable_disable_fields(select_elt) {
input_fields.each(function () { input_fields.each(function () {
if (disabled) { if (disabled) {
let cur_value = $(this).val(); let cur_value = $(this).val();
$(this).data('saved-value', cur_value); $(this).data("saved-value", cur_value);
$(this).val(""); $(this).val("");
} else { } else {
let saved_value = $(this).data('saved-value'); let saved_value = $(this).data("saved-value");
if (typeof saved_value == 'undefined') { if (typeof saved_value == "undefined") {
saved_value = ''; saved_value = "";
} }
if (saved_value) { if (saved_value) {
$(this).val(saved_value); $(this).val(saved_value);
} }
} }
}); });
input_fields.prop('disabled', disabled); input_fields.prop("disabled", disabled);
} }
function setup_text_fields() { function setup_text_fields() {
$(".ueext_valid_select").each( $(".ueext_valid_select").each(function () {
function () {
enable_disable_fields(this); enable_disable_fields(this);
} });
);
} }
$().ready(function () { $().ready(function () {

View File

@ -61,7 +61,7 @@ function submit_group_selector() {
} }
function show_current_tab() { function show_current_tab() {
if (document.getElementsByClassName("nav-tabs").length < 0) { if (document.getElementsByClassName("nav-tabs").length > 0) {
$('.nav-tabs [href="#' + CURRENT_TAB_HASH + '"]').tab("show"); $('.nav-tabs [href="#' + CURRENT_TAB_HASH + '"]').tab("show");
} }
} }
@ -150,35 +150,23 @@ $().ready(function () {
if (element.hasClass("default_group")) { if (element.hasClass("default_group")) {
// click sur groupe "tous" // click sur groupe "tous"
// deselectionne les autres // deselectionne les autres
$("#group_ids_sel option:selected").each(function ( $("#group_ids_sel option:selected").each(function (index, opt) {
index,
opt
) {
if (opt.value != default_group_id) { if (opt.value != default_group_id) {
$("#group_ids_sel").multiselect( $("#group_ids_sel").multiselect("deselect", opt.value);
"deselect",
opt.value
);
} }
}); });
} else { } else {
// click sur un autre item // click sur un autre item
// si le groupe "tous" est selectionne et que l'on coche un autre, le deselectionner // si le groupe "tous" est selectionne et que l'on coche un autre, le deselectionner
var default_is_selected = false; var default_is_selected = false;
$("#group_ids_sel option:selected").each(function ( $("#group_ids_sel option:selected").each(function (index, opt) {
index,
opt
) {
if (opt.value == default_group_id) { if (opt.value == default_group_id) {
default_is_selected = true; default_is_selected = true;
return false; return false;
} }
}); });
if (default_is_selected) { if (default_is_selected) {
$("#group_ids_sel").multiselect( $("#group_ids_sel").multiselect("deselect", default_group_id);
"deselect",
default_group_id
);
} }
} }
} }

View File

@ -1,5 +1,3 @@
// active les menus des codes "manuels" (année, RCUEs) // active les menus des codes "manuels" (année, RCUEs)
function enable_manual_codes(elt) { function enable_manual_codes(elt) {
$(".jury_but select.manual").prop("disabled", !elt.checked); $(".jury_but select.manual").prop("disabled", !elt.checked);
@ -19,13 +17,17 @@ function change_menu_code(elt) {
elt.parentElement.parentElement.classList.remove("recorded"); elt.parentElement.parentElement.classList.remove("recorded");
} }
// Si RCUE passant en ADJ, change les menus des UEs associées ADJR // Si RCUE passant en ADJ, change les menus des UEs associées ADJR
if (elt.classList.contains("code_rcue") if (
&& elt.dataset.niveau_id elt.classList.contains("code_rcue") &&
&& elt.value == "ADJ" elt.dataset.niveau_id &&
&& elt.value != elt.dataset.orig_recorded) { elt.value == "ADJ" &&
let ue_selects = elt.parentElement.parentElement.parentElement.querySelectorAll( elt.value != elt.dataset.orig_recorded
"select.ue_rcue_" + elt.dataset.niveau_id); ) {
ue_selects.forEach(select => { let ue_selects =
elt.parentElement.parentElement.parentElement.querySelectorAll(
"select.ue_rcue_" + elt.dataset.niveau_id
);
ue_selects.forEach((select) => {
if (select.value != "ADM") { if (select.value != "ADM") {
select.value = "ADJR"; select.value = "ADJR";
change_menu_code(select); // pour changer les styles change_menu_code(select); // pour changer les styles
@ -51,7 +53,7 @@ $(function () {
const noms = JSON.parse(noms_str); const noms = JSON.parse(noms_str);
const cur_idx = etudids.indexOf(etudid); const cur_idx = etudids.indexOf(etudid);
let prev_idx = -1; let prev_idx = -1;
let next_idx = -1 let next_idx = -1;
if (cur_idx != -1) { if (cur_idx != -1) {
if (cur_idx > 0) { if (cur_idx > 0) {
prev_idx = cur_idx - 1; prev_idx = cur_idx - 1;
@ -93,13 +95,15 @@ let IS_SUBMITTING = false;
function get_form_state() { function get_form_state() {
let codes = []; let codes = [];
// il n'y a que des <select> // il n'y a que des <select>
document.querySelectorAll("select").forEach(sel => codes.push(sel.value)); document.querySelectorAll("select").forEach((sel) => codes.push(sel.value));
return codes.join(); return codes.join();
} }
$('document').ready(function () { $("document").ready(function () {
FORM_STATE = get_form_state(); FORM_STATE = get_form_state();
document.querySelector("form#jury_but").addEventListener('submit', jury_form_submit); document
.querySelector("form#jury_but")
.addEventListener("submit", jury_form_submit);
}); });
function is_modified() { function is_modified() {
@ -111,8 +115,8 @@ function jury_form_submit(event) {
} }
window.addEventListener("beforeunload", function (e) { window.addEventListener("beforeunload", function (e) {
if ((!IS_SUBMITTING) && is_modified()) { if (!IS_SUBMITTING && is_modified()) {
var confirmationMessage = 'Changements non enregistrés !'; var confirmationMessage = "Changements non enregistrés !";
(e || window.event).returnValue = confirmationMessage; (e || window.event).returnValue = confirmationMessage;
return confirmationMessage; return confirmationMessage;
} }

View File

@ -3,32 +3,41 @@
var ScoMarkerIcons = {}; var ScoMarkerIcons = {};
$().ready(function () { $().ready(function () {
$('#lyc_map_canvas').gmap( $("#lyc_map_canvas")
{ 'center': '48.955741,2.34141', .gmap({
'zoom' : 8, center: "48.955741,2.34141",
'mapTypeId': google.maps.MapTypeId.ROADMAP zoom: 8,
}).bind('init', function(event, map) { mapTypeId: google.maps.MapTypeId.ROADMAP,
})
.bind("init", function (event, map) {
for (var i = 0; i < lycees_coords.length; i++) { for (var i = 0; i < lycees_coords.length; i++) {
var lycee = lycees_coords[i]; var lycee = lycees_coords[i];
var nb = lycee['number']; var nb = lycee["number"];
var icon; var icon;
if (nb in ScoMarkerIcons) { if (nb in ScoMarkerIcons) {
icon = ScoMarkerIcons[nb]; icon = ScoMarkerIcons[nb];
} else { } else {
icon = new google.maps.MarkerImage( 'https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=' + nb + '|FF0000|000000' ); icon = new google.maps.MarkerImage(
"https://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=" +
nb +
"|FF0000|000000"
);
ScoMarkerIcons[nb] = icon; // cache ScoMarkerIcons[nb] = icon; // cache
} }
$('#lyc_map_canvas').gmap( $("#lyc_map_canvas")
'addMarker', .gmap("addMarker", {
{'position': lycee['position'], 'bounds': true, 'nomlycee' : lycee['name'], 'icon' : icon } position: lycee["position"],
).click( bounds: true,
function() { nomlycee: lycee["name"],
$('#lyc_map_canvas').gmap('openInfoWindow', {'content': this.nomlycee}, this); icon: icon,
} })
.click(function () {
$("#lyc_map_canvas").gmap(
"openInfoWindow",
{ content: this.nomlycee },
this
); );
});
} }
}); });
}); });

View File

@ -1,8 +1,3 @@
/* Page édition module */ /* Page édition module */
$(document).ready(function () {});
$(document).ready(function () {
});

View File

@ -1,35 +1,31 @@
// Edition tags sur modules // Edition tags sur modules
$(function () { $(function () {
$('.module_tag_editor').tagEditor({ $(".module_tag_editor").tagEditor({
initialTags: '', initialTags: "",
placeholder: 'Tags du module ...', placeholder: "Tags du module ...",
forceLowercase: false, forceLowercase: false,
onChange: function (field, editor, tags) { onChange: function (field, editor, tags) {
$.post('module_tag_set', $.post("module_tag_set", {
{
module_id: field.data("module_id"), module_id: field.data("module_id"),
taglist: tags.join() taglist: tags.join(),
}); });
}, },
autocomplete: { autocomplete: {
delay: 200, // ms before suggest delay: 200, // ms before suggest
position: { collision: 'flip' }, // automatic menu position up/down position: { collision: "flip" }, // automatic menu position up/down
source: "module_tag_search" source: "module_tag_search",
}, },
}); });
// version readonly // version readonly
readOnlyTags($('.module_tag_editor_ro')); readOnlyTags($(".module_tag_editor_ro"));
$(".sco_tag_checkbox").click(function () {
$('.sco_tag_checkbox').click(function() { if ($(this).is(":checked")) {
if( $(this).is(':checked')) {
$(".sco_tag_edit").show(); $(".sco_tag_edit").show();
} else { } else {
$(".sco_tag_edit").hide(); $(".sco_tag_edit").hide();
} }
}); });
}); });

View File

@ -8,30 +8,25 @@ function change_ue_inscr(elt) {
} else { } else {
url = elt.dataset.url_desinscr; url = elt.dataset.url_desinscr;
} }
$.post(url, $.post(url, {}, function (result) {
{},
function (result) {
sco_message("changement inscription UE enregistré"); sco_message("changement inscription UE enregistré");
} });
);
} }
$(function () { $(function () {
$("table#but_ue_inscriptions").DataTable( $("table#but_ue_inscriptions").DataTable({
{
paging: false, paging: false,
searching: true, searching: true,
info: false, info: false,
autoWidth: false, autoWidth: false,
fixedHeader: { fixedHeader: {
header: true, header: true,
footer: false footer: false,
}, },
orderCellsTop: true, // cellules ligne 1 pour tri orderCellsTop: true, // cellules ligne 1 pour tri
aaSorting: [], // Prevent initial sorting aaSorting: [], // Prevent initial sorting
"oLanguage": { oLanguage: {
"sSearch": "Chercher :" sSearch: "Chercher :",
} },
} });
);
}); });

View File

@ -1,42 +1,48 @@
// Affichage parcours etudiant // Affichage parcours etudiant
// (uses jQuery) // (uses jQuery)
function toggle_vis(e, new_state) { // change visibility of tr (UE in tr and next tr) function toggle_vis(e, new_state) {
// change visibility of tr (UE in tr and next tr)
// e is the span containg the clicked +/- icon // e is the span containg the clicked +/- icon
var formsemestre_class = e.classList[1]; var formsemestre_class = e.classList[1];
var tr = e.parentNode.parentNode; var tr = e.parentNode.parentNode;
if (new_state == undefined) { if (new_state == undefined) {
// current state: use alt attribute of current image // current state: use alt attribute of current image
if (e.childNodes[0].alt == '+') { if (e.childNodes[0].alt == "+") {
new_state = false; new_state = false;
} else { } else {
new_state = true; new_state = true;
} }
} }
if (new_state) { if (new_state) {
new_tr_display = 'none'; new_tr_display = "none";
} else { } else {
new_tr_display = 'table-row'; new_tr_display = "table-row";
} }
$("tr."+formsemestre_class+":not(.rcp_l1)").css('display', new_tr_display) $("tr." + formsemestre_class + ":not(.rcp_l1)").css(
"display",
new_tr_display
);
// find next tr in siblings (xxx legacy code, could be optimized) // find next tr in siblings (xxx legacy code, could be optimized)
var sibl = tr.nextSibling; var sibl = tr.nextSibling;
while ((sibl != null) && sibl.nodeType != 1 && sibl.tagName != 'TR') { while (sibl != null && sibl.nodeType != 1 && sibl.tagName != "TR") {
sibl = sibl.nextSibling; sibl = sibl.nextSibling;
} }
if (sibl) { if (sibl) {
var td_disp = 'none'; var td_disp = "none";
if (new_state) { if (new_state) {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus_img.png"/>'; e.innerHTML =
'<img width="13" height="13" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus_img.png"/>';
} else { } else {
e.innerHTML = '<img width="13" height="13" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus_img.png"/>'; e.innerHTML =
td_disp = 'inline'; '<img width="13" height="13" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus_img.png"/>';
td_disp = "inline";
} }
// acronymes d'UE // acronymes d'UE
sibl = e.parentNode.nextSibling; sibl = e.parentNode.nextSibling;
while (sibl != null) { while (sibl != null) {
if (sibl.nodeType == 1 && sibl.className == 'ue_acro') if (sibl.nodeType == 1 && sibl.className == "ue_acro")
sibl.childNodes[0].style.display = td_disp; sibl.childNodes[0].style.display = td_disp;
sibl = sibl.nextSibling; sibl = sibl.nextSibling;
} }
@ -52,8 +58,10 @@ function toggle_all_sems(e) {
} }
sems_state = !sems_state; sems_state = !sems_state;
if (sems_state) { if (sems_state) {
e.innerHTML = '<img width="18" height="18" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus18_img.png"/>'; e.innerHTML =
'<img width="18" height="18" border="0" title="" alt="-" src="/ScoDoc/static/icons/minus18_img.png"/>';
} else { } else {
e.innerHTML = '<img width="18" height="18" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus18_img.png"/>'; e.innerHTML =
'<img width="18" height="18" border="0" title="" alt="+" src="/ScoDoc/static/icons/plus18_img.png"/>';
} }
} }

View File

@ -1,8 +1,7 @@
class ref_competences extends HTMLElement { class ref_competences extends HTMLElement {
constructor() { constructor() {
super(); super();
this.shadow = this.attachShadow({ mode: 'open' }); this.shadow = this.attachShadow({ mode: "open" });
/* Template de base */ /* Template de base */
this.shadow.innerHTML = ` this.shadow.innerHTML = `
@ -13,9 +12,13 @@ class ref_competences extends HTMLElement {
`; `;
/* Style du module */ /* Style du module */
const styles = document.createElement('link'); const styles = document.createElement("link");
styles.setAttribute('rel', 'stylesheet'); styles.setAttribute("rel", "stylesheet");
styles.setAttribute('href', removeLastTwoComponents(getCurrentScriptPath()) + '/css/ref-competences.css'); styles.setAttribute(
"href",
removeLastTwoComponents(getCurrentScriptPath()) +
"/css/ref-competences.css"
);
this.shadow.appendChild(styles); this.shadow.appendChild(styles);
} }
@ -30,18 +33,20 @@ class ref_competences extends HTMLElement {
Object.entries(this.data.parcours).forEach(([cle, parcours]) => { Object.entries(this.data.parcours).forEach(([cle, parcours]) => {
let div = document.createElement("div"); let div = document.createElement("div");
div.innerHTML = `<a title="${parcours.libelle}">${parcours.code}</a>`; div.innerHTML = `<a title="${parcours.libelle}">${parcours.code}</a>`;
div.addEventListener("click", (event) => { this.competences(event, cle) }) div.addEventListener("click", (event) => {
this.competences(event, cle);
});
parcoursDIV.appendChild(div); parcoursDIV.appendChild(div);
}) });
this.initCompetences(); this.initCompetences();
} }
initCompetences() { initCompetences() {
this.competencesNumber = {}; this.competencesNumber = {};
let i = 0; let i = 0;
Object.keys(this.data.competences).forEach(competence => { Object.keys(this.data.competences).forEach((competence) => {
this.competencesNumber[competence] = 1 + i++ % 6; this.competencesNumber[competence] = 1 + (i++ % 6);
}) });
} }
competences(event, cle) { competences(event, cle) {
@ -53,54 +58,74 @@ class ref_competences extends HTMLElement {
/* Création des compétences */ /* Création des compétences */
let competencesBucket = []; let competencesBucket = [];
Object.entries(this.data.parcours[cle].annees).forEach(([annee, dataAnnee]) => { Object.entries(this.data.parcours[cle].annees).forEach(
Object.entries(dataAnnee.competences).forEach(([competence, niveauCle]) => { ([annee, dataAnnee]) => {
Object.entries(dataAnnee.competences).forEach(
([competence, niveauCle]) => {
let numComp = this.competencesNumber[competence]; let numComp = this.competencesNumber[competence];
let divCompetence = document.createElement("div"); let divCompetence = document.createElement("div");
divCompetence.innerText = `${competence} ${niveauCle.niveau}`; divCompetence.innerText = `${competence} ${niveauCle.niveau}`;
divCompetence.style.gridRowStart = annee; divCompetence.style.gridRowStart = annee;
divCompetence.style.gridColumnStart = competence.replaceAll(" ", "_"); divCompetence.style.gridColumnStart = competence.replaceAll(
" ",
"_"
);
divCompetence.className = "comp" + numComp; divCompetence.className = "comp" + numComp;
divCompetence.dataset.competence = `${competence} ${niveauCle.niveau}`; divCompetence.dataset.competence = `${competence} ${niveauCle.niveau}`;
divCompetence.addEventListener("click", (event) => { this.AC(event, competence, niveauCle.niveau, annee, numComp) }) divCompetence.addEventListener("click", (event) => {
this.AC(event, competence, niveauCle.niveau, annee, numComp);
});
divCompetences.appendChild(divCompetence); divCompetences.appendChild(divCompetence);
competencesBucket.push(competence); competencesBucket.push(competence);
}) }
}) );
}
);
/* Affectation de la taille des éléments */ /* Affectation de la taille des éléments */
//divCompetences.style.setProperty("--competence-size", `calc(${100 / competencesBucket.length}% )`); //divCompetences.style.setProperty("--competence-size", `calc(${100 / competencesBucket.length}% )`);
let gridTemplate = ""; let gridTemplate = "";
Object.keys(this.data.competences).forEach(competence => { Object.keys(this.data.competences).forEach((competence) => {
if (competencesBucket.indexOf(competence) == -1) { if (competencesBucket.indexOf(competence) == -1) {
gridTemplate += `[${competence.replaceAll(" ", "_")}] 0`; gridTemplate += `[${competence.replaceAll(" ", "_")}] 0`;
} else { } else {
gridTemplate += `[${competence.replaceAll(" ", "_")}] 1fr`; gridTemplate += `[${competence.replaceAll(" ", "_")}] 1fr`;
} }
}) });
this.shadow.querySelector(".competences").style.gridTemplateColumns = gridTemplate; this.shadow.querySelector(".competences").style.gridTemplateColumns =
gridTemplate;
/* Réaffectation des focus */ /* Réaffectation des focus */
this.shadow.querySelectorAll(".AC").forEach(ac => { this.shadow.querySelectorAll(".AC").forEach((ac) => {
this.shadow.querySelector(`[data-competence="${ac.dataset.competence}"]`).classList.add("focus"); this.shadow
.querySelector(`[data-competence="${ac.dataset.competence}"]`)
.classList.add("focus");
}); });
} }
AC(event, competence, niveau, annee, numComp) { AC(event, competence, niveau, annee, numComp) {
event.currentTarget.classList.toggle("focus"); event.currentTarget.classList.toggle("focus");
if (this.shadow.querySelector(`.ACs [data-competence="${competence} ${niveau}"]`)) { if (
this.shadow.querySelector(`.ACs [data-competence="${competence} ${niveau}"]`).remove(); this.shadow.querySelector(
`.ACs [data-competence="${competence} ${niveau}"]`
)
) {
this.shadow
.querySelector(`.ACs [data-competence="${competence} ${niveau}"]`)
.remove();
} else { } else {
let output = ` let output = `
<ul class=AC data-competence="${competence} ${niveau}"> <ul class=AC data-competence="${competence} ${niveau}">
<h2 class=comp${numComp}>${competence} ${niveau}</h2> <h2 class=comp${numComp}>${competence} ${niveau}</h2>
`; `;
Object.entries(this.data.competences[competence].niveaux["BUT" + annee].app_critiques).forEach(([num, contenu]) => { Object.entries(
this.data.competences[competence].niveaux["BUT" + annee].app_critiques
).forEach(([num, contenu]) => {
output += `<li><div class=comp${numComp}>${num}</div><div>${contenu.libelle}</div></li>`; output += `<li><div class=comp${numComp}>${num}</div><div>${contenu.libelle}</div></li>`;
}) });
this.shadow.querySelector(".ACs").innerHTML += output + "</ul>"; this.shadow.querySelector(".ACs").innerHTML += output + "</ul>";
} }
} }
} }
customElements.define('ref-competences', ref_competences); customElements.define("ref-competences", ref_competences);

View File

@ -380,7 +380,9 @@ class releveBUT extends HTMLElement {
if (dataUE.malus >= 0) { if (dataUE.malus >= 0) {
output += `Malus&nbsp;:&nbsp;${dataUE.malus || 0}`; output += `Malus&nbsp;:&nbsp;${dataUE.malus || 0}`;
} else { } else {
output += `Bonus&nbsp;complémentaire&nbsp;:&nbsp;${-dataUE.malus || 0}`; output += `Bonus&nbsp;complémentaire&nbsp;:&nbsp;${
-dataUE.malus || 0
}`;
} }
} else { } else {
output += ` le ${this.ISOToDate( output += ` le ${this.ISOToDate(

View File

@ -4,30 +4,25 @@ function toggle_new_ue_form(state) {
// active/desactive le formulaire "nouvelle UE" // active/desactive le formulaire "nouvelle UE"
var text_color; var text_color;
if (state) { if (state) {
text_color = 'rgb(180,160,160)'; text_color = "rgb(180,160,160)";
} else { } else {
text_color = 'rgb(0,0,0)'; text_color = "rgb(0,0,0)";
} }
$("#tf_extue_titre td:eq(1) input").prop("disabled", state); $("#tf_extue_titre td:eq(1) input").prop("disabled", state);
$("#tf_extue_titre").css('color', text_color) $("#tf_extue_titre").css("color", text_color);
$("#tf_extue_acronyme td:eq(1) input").prop("disabled", state); $("#tf_extue_acronyme td:eq(1) input").prop("disabled", state);
$("#tf_extue_acronyme").css('color', text_color) $("#tf_extue_acronyme").css("color", text_color);
$("#tf_extue_type td:eq(1) select").prop("disabled", state); $("#tf_extue_type td:eq(1) select").prop("disabled", state);
$("#tf_extue_type").css('color', text_color) $("#tf_extue_type").css("color", text_color);
$("#tf_extue_ects td:eq(1) input").prop("disabled", state); $("#tf_extue_ects td:eq(1) input").prop("disabled", state);
$("#tf_extue_ects").css('color', text_color) $("#tf_extue_ects").css("color", text_color);
} }
function update_external_ue_form() { function update_external_ue_form() {
var state = (tf.existing_ue.value != ""); var state = tf.existing_ue.value != "";
toggle_new_ue_form(state); toggle_new_ue_form(state);
} }

View File

@ -5,29 +5,34 @@ var elt_sem_apo_editor = null;
$(document).ready(function () { $(document).ready(function () {
var table_options = { var table_options = {
"paging": false, paging: false,
"searching": false, searching: false,
"info": false, info: false,
/* "autoWidth" : false, */ /* "autoWidth" : false, */
"fixedHeader": { fixedHeader: {
"header": true, header: true,
"footer": true footer: true,
}, },
"orderCellsTop": true, // cellules ligne 1 pour tri orderCellsTop: true, // cellules ligne 1 pour tri
"aaSorting": [], // Prevent initial sorting aaSorting: [], // Prevent initial sorting
}; };
$('table.semlist').DataTable(table_options); $("table.semlist").DataTable(table_options);
let table_editable = document.querySelector("table#semlist.apo_editable"); let table_editable = document.querySelector("table#semlist.apo_editable");
if (table_editable) { if (table_editable) {
let save_url = document.querySelector("table#semlist.apo_editable").dataset.apo_save_url; let save_url = document.querySelector("table#semlist.apo_editable").dataset
.apo_save_url;
apo_editor = new ScoFieldEditor(".etapes_apo_str", save_url, false); apo_editor = new ScoFieldEditor(".etapes_apo_str", save_url, false);
save_url = document.querySelector("table#semlist.apo_editable").dataset.elt_annee_apo_save_url; save_url = document.querySelector("table#semlist.apo_editable").dataset
elt_annee_apo_editor = new ScoFieldEditor(".elt_annee_apo", save_url, false); .elt_annee_apo_save_url;
elt_annee_apo_editor = new ScoFieldEditor(
".elt_annee_apo",
save_url,
false
);
save_url = document.querySelector("table#semlist.apo_editable").dataset.elt_sem_apo_save_url; save_url = document.querySelector("table#semlist.apo_editable").dataset
.elt_sem_apo_save_url;
elt_sem_apo_editor = new ScoFieldEditor(".elt_sem_apo", save_url, false); elt_sem_apo_editor = new ScoFieldEditor(".elt_sem_apo", save_url, false);
} }
}); });

View File

@ -43,7 +43,7 @@ function build_table(data) {
sumsRessources[cellule.y] = (sumsRessources[cellule.y] ?? 0) + value; sumsRessources[cellule.y] = (sumsRessources[cellule.y] ?? 0) + value;
sumsUE[cellule.x] = (sumsUE[cellule.x] ?? 0) + value; sumsUE[cellule.x] = (sumsUE[cellule.x] ?? 0) + value;
} }
}) });
output += showSums(sumsRessources, sumsUE); output += showSums(sumsRessources, sumsUE);
document.querySelector(".tableau").innerHTML = output; document.querySelector(".tableau").innerHTML = output;
@ -71,7 +71,7 @@ function showSums(sumsRessources, sumsUE) {
"> ">
${value / 100} ${value / 100}
</div>`; </div>`;
}) });
Object.entries(sumsRessources).forEach(([num, value]) => { Object.entries(sumsRessources).forEach(([num, value]) => {
output += ` output += `
@ -88,7 +88,7 @@ function showSums(sumsRessources, sumsUE) {
"> ">
${value / 100} ${value / 100}
</div>`; </div>`;
}) });
return output; return output;
} }
@ -102,9 +102,13 @@ function installListeners() {
return; return;
} }
document.body.addEventListener("keydown", key); document.body.addEventListener("keydown", key);
document.querySelectorAll("[data-editable=true]").forEach(cellule => { document.querySelectorAll("[data-editable=true]").forEach((cellule) => {
cellule.addEventListener("click", function () { selectCell(this) }); cellule.addEventListener("click", function () {
cellule.addEventListener("dblclick", function () { modifCell(this) }); selectCell(this);
});
cellule.addEventListener("dblclick", function () {
modifCell(this);
});
cellule.addEventListener("blur", function () { cellule.addEventListener("blur", function () {
let currentModif = document.querySelector(".modifying"); let currentModif = document.querySelector(".modifying");
if (currentModif) { if (currentModif) {
@ -117,7 +121,6 @@ function installListeners() {
}); });
} }
/*********************************/ /*********************************/
/* Interaction avec les cellules */ /* Interaction avec les cellules */
/*********************************/ /*********************************/
@ -132,11 +135,11 @@ function selectCell(obj) {
} }
} }
document.querySelectorAll(".selected, .modifying").forEach(cellule => { document.querySelectorAll(".selected, .modifying").forEach((cellule) => {
cellule.classList.remove("selected", "modifying"); cellule.classList.remove("selected", "modifying");
cellule.removeAttribute("contentEditable"); cellule.removeAttribute("contentEditable");
cellule.removeEventListener("keydown", keyCell); cellule.removeEventListener("keydown", keyCell);
}) });
obj.classList.add("selected"); obj.classList.add("selected");
} }
@ -151,21 +154,39 @@ function modifCell(obj) {
function key(event) { function key(event) {
switch (event.key) { switch (event.key) {
case "Enter": modifCell(document.querySelector(".selected")); event.preventDefault(); break; case "Enter":
case "ArrowRight": ArrowMove(1, 0); break; modifCell(document.querySelector(".selected"));
case "ArrowLeft": ArrowMove(-1, 0); break; event.preventDefault();
case "ArrowUp": ArrowMove(0, -1); break; break;
case "ArrowDown": ArrowMove(0, 1); break; case "ArrowRight":
ArrowMove(1, 0);
break;
case "ArrowLeft":
ArrowMove(-1, 0);
break;
case "ArrowUp":
ArrowMove(0, -1);
break;
case "ArrowDown":
ArrowMove(0, 1);
break;
} }
} }
function ArrowMove(x, y) { function ArrowMove(x, y) {
if (document.querySelector(".modifying") || !document.querySelector(".selected")) { if (
document.querySelector(".modifying") ||
!document.querySelector(".selected")
) {
return; // S'il n'y a aucune cellule selectionnée ou si une cellule est encours de modification, on ne change pas return; // S'il n'y a aucune cellule selectionnée ou si une cellule est encours de modification, on ne change pas
} }
let selected = document.querySelector(".selected"); let selected = document.querySelector(".selected");
let next = document.querySelector(`[data-x="${parseInt(selected.dataset.x) + x}"][data-y="${parseInt(selected.dataset.y) + y}"][data-editable="true"]`); let next = document.querySelector(
`[data-x="${parseInt(selected.dataset.x) + x}"][data-y="${
parseInt(selected.dataset.y) + y
}"][data-editable="true"]`
);
if (next) { if (next) {
selectCell(next); selectCell(next);
@ -177,7 +198,7 @@ function keyCell(event) {
event.preventDefault(); event.preventDefault();
event.stopPropagation(); event.stopPropagation();
if (!save(this)) { if (!save(this)) {
return return;
} }
this.classList.remove("modifying"); this.classList.remove("modifying");
let selected = document.querySelector(".selected"); let selected = document.querySelector(".selected");
@ -190,22 +211,34 @@ function keyCell(event) {
function processSums() { function processSums() {
let sum = 0; let sum = 0;
document.querySelectorAll(`[data-editable="true"][data-x="${this.dataset.x}"]:not(:empty)`).forEach(e => { document
.querySelectorAll(
`[data-editable="true"][data-x="${this.dataset.x}"]:not(:empty)`
)
.forEach((e) => {
let val = parseFloat(e.innerText); let val = parseFloat(e.innerText);
if (!isNaN(val)) { if (!isNaN(val)) {
sum += val * 100; sum += val * 100;
} }
}) });
document.querySelector(`.sums[data-x="${this.dataset.x}"][data-y="${lastY}"]`).innerText = sum / 100; document.querySelector(
`.sums[data-x="${this.dataset.x}"][data-y="${lastY}"]`
).innerText = sum / 100;
sum = 0; sum = 0;
document.querySelectorAll(`[data-editable="true"][data-y="${this.dataset.y}"]:not(:empty)`).forEach(e => { document
.querySelectorAll(
`[data-editable="true"][data-y="${this.dataset.y}"]:not(:empty)`
)
.forEach((e) => {
let val = parseFloat(e.innerText); let val = parseFloat(e.innerText);
if (!isNaN(val)) { if (!isNaN(val)) {
sum += val * 100; sum += val * 100;
} }
}) });
document.querySelector(`.sums[data-x="${lastX}"][data-y="${this.dataset.y}"]`).innerText = sum / 100; document.querySelector(
`.sums[data-x="${lastX}"][data-y="${this.dataset.y}"]`
).innerText = sum / 100;
} }
/******************************/ /******************************/

View File

@ -8,4 +8,3 @@ $().ready(function () {
$(sp).load(SCO_URL + "/etud_photo_html?etudid=" + etudid); $(sp).load(SCO_URL + "/etud_photo_html?etudid=" + etudid);
} }
}); });

View File

@ -1,5 +1,5 @@
// Edition elements programme "en place" // Edition elements programme "en place"
$(function () { $(function () {
$('.span_apo_edit').jinplace(); $(".span_apo_edit").jinplace();
}); });

View File

@ -1,30 +1,30 @@
function refresh() { function refresh() {
if ($("input[name='welcome:list']").is(":checked")) { if ($("input[name='welcome:list']").is(":checked")) {
$("input[name='reset_password:list']").closest("tr").css("display", "table-row") $("input[name='reset_password:list']")
.closest("tr")
.css("display", "table-row");
if ($("input[name='reset_password:list']").is(":checked")) { if ($("input[name='reset_password:list']").is(":checked")) {
$("#tf_password").closest('tr').css("display", "none"); $("#tf_password").closest("tr").css("display", "none");
$("#tf_password2").closest('tr').css("display", "none"); $("#tf_password2").closest("tr").css("display", "none");
} else { } else {
// Le mot de passe doit être saisi // Le mot de passe doit être saisi
$("#tf_password").closest('tr').css("display", "table-row"); $("#tf_password").closest("tr").css("display", "table-row");
$("#tf_password2").closest('tr').css("display", "table-row"); $("#tf_password2").closest("tr").css("display", "table-row");
} }
} else { } else {
// Le mot de passe doit être saisi // Le mot de passe doit être saisi
$("input[name='reset_password:list']").closest("tr").css("display", "none") $("input[name='reset_password:list']").closest("tr").css("display", "none");
$("#tf_password").closest('tr').css("display", "table-row"); $("#tf_password").closest("tr").css("display", "table-row");
$("#tf_password2").closest('tr').css("display", "table-row"); $("#tf_password2").closest("tr").css("display", "table-row");
} }
} }
$(function () { $(function () {
$("input[name='welcome:list']").click(function () { $("input[name='welcome:list']").click(function () {
refresh(); refresh();
}) });
$("input[name='reset_password:list']").click(function () { $("input[name='reset_password:list']").click(function () {
refresh(); refresh();
}) });
refresh(); refresh();
}) });

View File

@ -43,7 +43,7 @@
d = new Date(dateString).getDay(); d = new Date(dateString).getDay();
if (verifyNonWorkDays(d, nonWorkDays)) return; if (isNonWorkDay(d, nonWorkDays)) return;
matin = `${dateString}T${timeMorning}`; matin = `${dateString}T${timeMorning}`;
midi = `${dateString}T${timeNoon}`; midi = `${dateString}T${timeNoon}`;

View File

@ -89,8 +89,8 @@
const readOnly = {{ readonly }}; const readOnly = {{ readonly }};
updateDate();
setupDate(); setupDate();
updateDate();
setupTimeLine(); setupTimeLine();
window.forceModule = "{{ forcer_module }}" window.forceModule = "{{ forcer_module }}"

View File

@ -3,6 +3,7 @@
{% block scripts %} {% block scripts %}
{{ super() }} {{ super() }}
<script src="{{scu.STATIC_DIR}}/js/etud_info.js"></script> <script src="{{scu.STATIC_DIR}}/js/etud_info.js"></script>
<script src="{{scu.STATIC_DIR}}/js/date_utils.js"></script>
{% endblock %} {% endblock %}
{% block app_content %} {% block app_content %}
@ -31,8 +32,8 @@
const group_ids = "{{group_ids}}"; const group_ids = "{{group_ids}}";
function stats() { function stats() {
const deb = document.querySelector('#stats_date_debut').value; const deb = Date.fromFRA(document.querySelector('#stats_date_debut').value);
const fin = document.querySelector('#stats_date_fin').value; const fin = Date.fromFRA(document.querySelector('#stats_date_fin').value);
location.href = `VisualisationAssiduitesGroupe?group_ids=${group_ids}&date_debut=${deb}&date_fin=${fin}`; location.href = `VisualisationAssiduitesGroupe?group_ids=${group_ids}&date_debut=${deb}&date_fin=${fin}`;
} }

View File

@ -954,24 +954,27 @@
editList.push(edit); editList.push(edit);
}) })
const values = { "create": {}, "edit": {} };
$.when( Promise.all(
asyncCreateAssiduiteGroup(createList, (data) => { [asyncCreateAssiduiteGroup(createList, (data) => {
values.create = data;
}), }),
asyncEditAssiduiteGroup(editList, (data) => { asyncEditAssiduiteGroup(editList, (data) => {
values.edit = data;
}) })]
).done((c, e) => { ).then(() => {
const c = values.create;
const e = values.edit;
let error; let error;
Object.keys(c[0].success).forEach((k) => { Object.keys(c.success).forEach((k) => {
const assiduite = createList[Number.parseInt(k)]; const assiduite = createList[Number.parseInt(k)];
assiduite["assiduite_id"] = c[0].success[k].message.assiduite_id; assiduite["assiduite_id"] = c.success[k].message.assiduite_id;
assiduites[assiduite.etudid].push(assiduite); assiduites[assiduite.etudid].push(assiduite);
}) })
if (c[0].errors.length > 0) { if (c.errors.length > 0) {
error = c[0].errors[Object.keys(c[0].errors)[0]]; error = c.errors[Object.keys(c.errors)[0]];
if (error.message.indexOf("Module") != -1) { if (error.message.indexOf("Module") != -1) {
const html = ` const html = `
<h3>Aucun module n'a été spécifié (préférence du semestre concerné)</h3> <h3>Aucun module n'a été spécifié (préférence du semestre concerné)</h3>
@ -982,7 +985,7 @@
toCreate.length = 0 toCreate.length = 0
} }
} }
Object.keys(e[0].success).forEach((k) => { Object.keys(e.success).forEach((k) => {
const { etudid, assiduite_id, moduleimpl_id, etat } = editList[Number.parseInt(k)] const { etudid, assiduite_id, moduleimpl_id, etat } = editList[Number.parseInt(k)]
assiduites[etudid].map((a) => { assiduites[etudid].map((a) => {
if (a.assiduite_id == assiduite_id) { if (a.assiduite_id == assiduite_id) {

View File

@ -0,0 +1,53 @@
{# -*- mode: jinja-html -*- #}
{% extends "sco_page.j2" %}
{% block styles %}
{{super()}}
{% endblock %}
{% block app_content %}
<releve-but>{{ formsemestre.id }}</releve-but>
{% endblock %}
{% block scripts %}
{{super()}}
{# <script src="{{scu.STATIC_DIR}}/js/releve-but.js"></script>#}
<script>
//let dataSrc = "{{bul_url|safe}}";
//fetch(dataSrc)
// .then(r => { return r.json() })
// .then(json => {
// let releve = document.querySelector("releve-but");
// releve.showData = json;
// // Syle custom à ajouter
// let style = document.createElement("style");
// style.textContent = `
// .module>div,
// .dateInscription,
// .numerosEtudiant,
// .dateNaissance{
// display: none;
// }`;
// releve.shadowRoot.appendChild(style);
// });
// .catch(error => {
// let div = document.createElement("div");
// div.innerText = "Une erreur s'est produite lors du transfert des données.";
// div.style.fontSize = "24px";
// div.style.color = "#d93030";
// let releve = document.querySelector("releve-but");
// releve.after(div);
// releve.remove();
// throw 'Fin du script - données invalides';
// });
document.querySelector("html").style.scrollBehavior = "smooth";
</script>
{% endblock %}

View File

@ -1019,7 +1019,7 @@ def visu_assi_group():
short=False, short=False,
), ),
date_debut=_dateiso_to_datefr(dates["debut"]), date_debut=_dateiso_to_datefr(dates["debut"]),
date_fin=_dateiso_to_datefr(dates["debut"]), date_fin=_dateiso_to_datefr(dates["fin"]),
gr_tit=gr_tit, gr_tit=gr_tit,
group_ids=request.args.get("group_ids", None), group_ids=request.args.get("group_ids", None),
sco=ScoData(formsemestre=groups_infos.get_formsemestre()), sco=ScoData(formsemestre=groups_infos.get_formsemestre()),

View File

@ -51,6 +51,7 @@ from app.but import (
jury_but_pv, jury_but_pv,
jury_but_validation_auto, jury_but_validation_auto,
jury_but_view, jury_but_view,
jury_export,
) )
from app.but.forms import jury_but_forms from app.but.forms import jury_but_forms
@ -2969,6 +2970,11 @@ sco_publish(
sco_prepajury.feuille_preparation_jury, sco_prepajury.feuille_preparation_jury,
Permission.ScoView, Permission.ScoView,
) )
sco_publish(
"/feuille_preparation_jury_but",
jury_export.feuille_preparation_jury_but,
Permission.ScoView,
)
sco_publish( sco_publish(
"/formsemestre_archive", "/formsemestre_archive",
sco_archives.formsemestre_archive, sco_archives.formsemestre_archive,

View File

@ -1,7 +1,7 @@
# -*- mode: python -*- # -*- mode: python -*-
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
SCOVERSION = "9.6.55" SCOVERSION = "9.6.56"
SCONAME = "ScoDoc" SCONAME = "ScoDoc"