2020-09-26 16:19:37 +02:00
|
|
|
// Affiche popup avec info sur etudiant (pour les listes d'etudiants)
|
|
|
|
// affecte les elements de classe "etudinfo" portant l'id d'un etudiant
|
|
|
|
// utilise jQuery / qTip
|
|
|
|
|
|
|
|
function get_etudid_from_elem(e) {
|
2023-07-26 14:07:42 +02:00
|
|
|
// renvoie l'etudid, obtenu a partir de l'id de l'element
|
|
|
|
// qui est soit de la forme xxxx-etudid, soit tout simplement etudid
|
|
|
|
var etudid = e.id.split("-")[1];
|
|
|
|
if (etudid == undefined) {
|
|
|
|
return e.id;
|
|
|
|
} else {
|
|
|
|
return etudid;
|
|
|
|
}
|
2020-09-26 16:19:37 +02:00
|
|
|
}
|
|
|
|
|
2021-06-21 14:40:58 +02:00
|
|
|
$().ready(function () {
|
2024-07-03 21:32:33 +02:00
|
|
|
if (typeof SCO_URL == 'undefined') {
|
|
|
|
return;
|
|
|
|
}
|
2023-07-26 14:07:42 +02:00
|
|
|
var elems = $(".etudinfo:not(th)");
|
2020-09-26 16:19:37 +02:00
|
|
|
|
2023-07-26 14:07:42 +02:00
|
|
|
var q_args = get_query_args();
|
|
|
|
var args_to_pass = new Set([
|
|
|
|
"formsemestre_id",
|
|
|
|
"group_ids",
|
|
|
|
"group_id",
|
|
|
|
"partition_id",
|
|
|
|
"moduleimpl_id",
|
|
|
|
"evaluation_id",
|
|
|
|
]);
|
|
|
|
var qs = "";
|
|
|
|
for (var k in q_args) {
|
|
|
|
if (args_to_pass.has(k)) {
|
|
|
|
qs += "&" + k + "=" + q_args[k];
|
2020-09-26 16:19:37 +02:00
|
|
|
}
|
2023-07-26 14:07:42 +02:00
|
|
|
}
|
|
|
|
for (var i = 0; i < elems.length; i++) {
|
|
|
|
$(elems[i]).qtip({
|
|
|
|
content: {
|
|
|
|
ajax: {
|
2024-07-03 21:32:33 +02:00
|
|
|
url: `${SCO_URL}etud_info_html?etudid=` + get_etudid_from_elem(elems[i]) + qs,
|
2023-07-26 14:07:42 +02:00
|
|
|
type: "GET",
|
|
|
|
//success: function(data, status) {
|
|
|
|
// this.set('content.text', data);
|
|
|
|
// xxx called twice on each success ???
|
|
|
|
// console.log(status);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
text: "Loading...",
|
|
|
|
position: {
|
|
|
|
at: "right bottom",
|
|
|
|
my: "left top",
|
|
|
|
},
|
|
|
|
style: {
|
|
|
|
classes: "qtip-etud",
|
|
|
|
},
|
|
|
|
hide: {
|
|
|
|
fixed: true,
|
|
|
|
delay: 300,
|
|
|
|
},
|
|
|
|
// utile pour debugguer le css:
|
|
|
|
// hide: { event: 'unfocus' }
|
|
|
|
});
|
|
|
|
}
|
2020-09-26 16:19:37 +02:00
|
|
|
});
|