2015-11-15 18:10:33 +00:00
|
|
|
<!--
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/********************************/
|
|
|
|
/* GESTION DE L'AFFINAGE PAR UE */
|
|
|
|
/********************************/
|
2015-11-21 10:41:32 +00:00
|
|
|
var selectList = document.querySelectorAll("#CONTAINER > section[name] > .p > select[name=annee]");
|
|
|
|
var partList = document.querySelectorAll("#CONTAINER > section[name] > table.partlist[name=UE], "+
|
|
|
|
"#CONTAINER > section[name] > table.partlist[name=semestre], "+
|
|
|
|
"#CONTAINER > section[name] > table.partlist[name=formation], "+
|
|
|
|
"#CONTAINER > section[name] > .p > div.partlist[name=semestre] > span[data-stre]");
|
2015-11-15 18:10:33 +00:00
|
|
|
|
|
|
|
for( var i = 0 ; i < partList.length ; i++ ){
|
|
|
|
|
|
|
|
partList[i].addEventListener('click', function(e){
|
|
|
|
var tableauParent = e.target.parentNode.parentNode.parentNode;
|
|
|
|
|
2015-11-16 11:02:03 +00:00
|
|
|
if( tableauParent.tagName == 'TABLE' && e.target.dataset.hasOwnProperty('value') ){
|
2015-11-15 18:10:33 +00:00
|
|
|
|
2015-11-16 16:03:16 +00:00
|
|
|
/* SI c'est une affinage par FORMATION */
|
|
|
|
if( tableauParent.getAttribute('name') == 'formation' ){
|
|
|
|
pageM.vars[1] = 'f:'+e.target.dataset.value;
|
|
|
|
if( pageM.vars.length > 2 ) // si un deuxième affinage existe, on le supprime lors du choix de la formation
|
|
|
|
pageM.vars.pop();
|
|
|
|
}
|
|
|
|
|
2015-11-16 11:02:03 +00:00
|
|
|
/* SI c'est une affinage par SEMESTRE */
|
|
|
|
if( tableauParent.getAttribute('name') == 'semestre' )
|
2015-11-16 16:03:16 +00:00
|
|
|
pageM.vars[2] = 's:'+e.target.dataset.value;
|
2015-11-16 11:02:03 +00:00
|
|
|
|
|
|
|
/* SI c'est un affinage par UE */
|
|
|
|
if( tableauParent.getAttribute('name') == 'UE' )
|
2015-11-16 16:03:16 +00:00
|
|
|
pageM.vars[2] = 'u:'+e.target.dataset.value;
|
2015-11-16 11:02:03 +00:00
|
|
|
|
2015-11-21 10:41:32 +00:00
|
|
|
}else if( e.target.parentNode.getAttribute('name') == 'semestre' && e.target.dataset.hasOwnProperty('stre') )
|
|
|
|
pageM.vars[2] = 's:'+e.target.dataset.stre;
|
|
|
|
|
|
|
|
// si la formation n'est pas définie, on l'active
|
|
|
|
if( !/^[fa]:/.test(pageM.vars[1]) )
|
|
|
|
if( document.querySelector('#CONTAINER > section[name] > table.partlist[name=formation] td[data-value].active') != null )
|
|
|
|
pageM.vars[1] = 'f:'+document.querySelector('#CONTAINER > section[name] > table.partlist[name=formation] td[data-value].active').dataset.value;
|
|
|
|
|
|
|
|
// si on a '*' comme valeur, on l'enlève
|
|
|
|
if( /\*$/.test(pageM.vars[2]) )
|
|
|
|
pageM.vars.pop();
|
|
|
|
|
|
|
|
reload();
|
|
|
|
|
|
|
|
}, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// GESTION DE L'AFFINAGE PAR ANNEE //
|
|
|
|
for( var i = 0 ; i < selectList.length ; i++ ){
|
|
|
|
|
|
|
|
selectList[i].addEventListener('change', function(e){
|
|
|
|
|
|
|
|
if( e.target.tagName == 'SELECT' ){
|
|
|
|
|
|
|
|
if( e.target.getAttribute('name') == 'annee' )
|
|
|
|
pageM.vars[1] = 'a:'+e.target.value;
|
2015-11-16 16:03:16 +00:00
|
|
|
|
|
|
|
// si la formation n'est pas définie, on l'active
|
2015-11-21 10:41:32 +00:00
|
|
|
if( !/^[fa]:/.test(pageM.vars[1]) )
|
2015-11-16 18:07:39 +00:00
|
|
|
if( document.querySelector('#CONTAINER > section[name] > table.partlist[name=formation] td[data-value].active') != null )
|
|
|
|
pageM.vars[1] = 'f:'+document.querySelector('#CONTAINER > section[name] > table.partlist[name=formation] td[data-value].active').dataset.value;
|
2015-11-16 16:03:16 +00:00
|
|
|
|
2015-11-15 18:10:33 +00:00
|
|
|
// si on a '*' comme valeur, on l'enlève
|
2015-11-16 16:03:16 +00:00
|
|
|
if( /\*$/.test(pageM.vars[2]) )
|
2015-11-15 18:10:33 +00:00
|
|
|
pageM.vars.pop();
|
|
|
|
|
|
|
|
reload();
|
|
|
|
}
|
2015-11-21 10:41:32 +00:00
|
|
|
|
2015-11-15 18:10:33 +00:00
|
|
|
}, false);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-11-21 12:01:12 +00:00
|
|
|
|
|
|
|
|
|
|
|
/* LIEN VERS LA PAGE "CREER UN SEMESTRE" */
|
|
|
|
var creerSemestre = document.getElementById('creer_semestre');
|
|
|
|
creerSemestre.addEventListener('click', function(e){
|
|
|
|
|
|
|
|
pageM.vars[0] = 'createsemestre';
|
|
|
|
reload();
|
|
|
|
|
|
|
|
}, false);
|
|
|
|
|
2015-11-15 18:10:33 +00:00
|
|
|
-->
|