2015-10-30 11:52:50 +00:00
|
|
|
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
|
|
|
|
require_once __ROOT__.'/manager/security.php';
|
|
|
|
|
|
|
|
|
|
|
|
/***************/
|
|
|
|
/*** PROFILE ***/
|
|
|
|
/***************/
|
2015-11-06 22:00:08 +00:00
|
|
|
if( connected() ){ // si l'utilisateur est connecté
|
2015-11-15 14:42:12 +00:00
|
|
|
echo "<section name='myprofile' data-title='Profil'>";
|
2015-10-30 11:52:50 +00:00
|
|
|
echo 'profil';
|
|
|
|
echo '</section>';
|
|
|
|
|
2015-11-20 08:54:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*****************************/
|
|
|
|
/*** ATTRIBUTION DES RÔLES ***/
|
|
|
|
/*****************************/
|
|
|
|
if( permission('admin') ){
|
|
|
|
// inclusion du manager utilisateur
|
|
|
|
require_once __ROOT__.'/manager/user.php';
|
2015-11-23 19:56:00 +00:00
|
|
|
require_once __ROOT__.'/manager/database.php';
|
|
|
|
|
|
|
|
// on récupère la liste de tous les modules
|
|
|
|
$completeModuleList = DataBase::getInstance()->getExhaustiveModuleList();
|
2015-11-20 08:54:15 +00:00
|
|
|
|
|
|
|
// création de la requête
|
|
|
|
$request = new stdClass(); $answer = new stdClass();
|
2015-11-23 15:21:03 +00:00
|
|
|
$request->level_1 = 'getListeEnseignantsModules';
|
2015-11-20 08:54:15 +00:00
|
|
|
|
|
|
|
// gestion de la requête
|
|
|
|
user_switch_level_1($request, $answer);
|
|
|
|
|
|
|
|
if( $answer->request == 'success' ){ // si aucune erreur
|
|
|
|
|
2015-11-20 09:32:07 +00:00
|
|
|
echo "<section name='attributionrole' data-title='Rôles' class='basic' >";
|
|
|
|
|
|
|
|
// var_dump( $answer->userlist );
|
|
|
|
|
2015-11-22 18:17:04 +00:00
|
|
|
echo "<table class='basic col5'><tbody>";
|
2015-11-20 09:32:07 +00:00
|
|
|
foreach($answer->userlist as $user){
|
|
|
|
echo "<tr>";
|
|
|
|
echo "<td><span class='link'>".$user['id']."</span></td>";
|
|
|
|
echo "<td>".$user['prenom']."</td>";
|
|
|
|
echo "<td>".$user['nom']."</td>";
|
|
|
|
|
|
|
|
// si l'utilisateur est admin
|
|
|
|
if( in_array('admin', $user['role']) )
|
2015-11-24 09:37:02 +00:00
|
|
|
echo "<td><input data-usr='".$user['id']."' class='check_admin' type='checkbox' id='".$user['id']."administrateur' checked><label for='".$user['id']."administrateur'></label> administrateur</td>";
|
2015-11-20 09:32:07 +00:00
|
|
|
else
|
2015-11-24 09:37:02 +00:00
|
|
|
echo "<td><input data-usr='".$user['id']."' class='check_admin' type='checkbox' id='".$user['id']."administrateur'><label for='".$user['id']."administrateur'></label> administrateur</td>";
|
2015-11-22 18:17:04 +00:00
|
|
|
|
|
|
|
// si l'utilisateur est référent
|
|
|
|
if( in_array('master', $user['role']) )
|
2015-11-24 09:37:02 +00:00
|
|
|
echo "<td><input data-usr='".$user['id']."' class='check_master' type='checkbox' id='".$user['id']."referent' checked><label for='".$user['id']."referent'></label> référent</td>";
|
2015-11-22 18:17:04 +00:00
|
|
|
else
|
2015-11-24 09:37:02 +00:00
|
|
|
echo "<td><input data-usr='".$user['id']."' class='check_master' type='checkbox' id='".$user['id']."referent'><label for='".$user['id']."referent'></label> référent</td>";
|
2015-11-20 09:32:07 +00:00
|
|
|
|
|
|
|
echo "</tr>";
|
2015-11-23 15:40:54 +00:00
|
|
|
|
|
|
|
|
2015-11-23 19:56:00 +00:00
|
|
|
/* LISTE DES MODULES CORRIGEABLES */
|
|
|
|
$userModulesUID = array();
|
|
|
|
|
|
|
|
echo "<tr class='transparentbg noborder'><td></td><td colspan=4>";
|
|
|
|
echo "<table class='basic col4'><tbody>";
|
|
|
|
|
|
|
|
if( $user['semestreList'] != null ){
|
|
|
|
|
|
|
|
foreach($user['semestreList'] as $semestre){
|
|
|
|
foreach($semestre['UElist'] as $ue){
|
|
|
|
foreach($ue['modules'] as $module){
|
2015-11-24 08:59:17 +00:00
|
|
|
|
2015-11-23 19:56:00 +00:00
|
|
|
array_push($userModulesUID, $module['id']);
|
|
|
|
echo "<tr>";
|
2015-11-24 09:37:02 +00:00
|
|
|
echo "<td>".$module['nom']." - ".$module['libelle']."</td>";
|
2015-11-23 19:56:00 +00:00
|
|
|
echo "<td>".$ue['nom']." - ".$ue['libelle']."</td>";
|
|
|
|
echo "<td>".$semestre['formation']." - ".$semestre['nom']."</td>";
|
|
|
|
echo "<td>";
|
2015-11-24 09:37:02 +00:00
|
|
|
echo "<input data-usr='".$user['id']."' data-mccmod='".$module['id_mcc_module']."' class='del_module' type='checkbox' id='".$user['id']."correcteur".$module['id']."' checked><label for='".$user['id']."correcteur".$module['id']."'></label> correcteur";
|
2015-11-23 19:56:00 +00:00
|
|
|
echo "</td>";
|
|
|
|
echo "</tr>";
|
|
|
|
}
|
2015-11-23 15:40:54 +00:00
|
|
|
}
|
|
|
|
}
|
2015-11-23 19:56:00 +00:00
|
|
|
|
2015-11-23 15:40:54 +00:00
|
|
|
}
|
|
|
|
|
2015-11-23 19:56:00 +00:00
|
|
|
/* AJOUT DE MODULES */
|
|
|
|
// saisie d'un nouveau module
|
|
|
|
echo "<tr class='grayscale'>";
|
|
|
|
echo "<td><select name='modules'>";
|
|
|
|
foreach($completeModuleList as $module){ if( !in_array($module['id'], $userModulesUID) ){
|
2015-11-24 09:37:02 +00:00
|
|
|
echo "<option value='".$module['id_mcc_module']."'>".$module['nom']." - ".$module['libelle']."</option>";
|
2015-11-23 19:56:00 +00:00
|
|
|
}}
|
|
|
|
echo "</select></td>";
|
2015-11-24 09:37:02 +00:00
|
|
|
echo "<td><div data-usr='".$user['id']."' class='confirm active set_correcteur'>Définir comme correcteur</div></td>";
|
2015-11-23 19:56:00 +00:00
|
|
|
echo "<td></td>";
|
|
|
|
echo "<td></td>";
|
|
|
|
echo "</tr>";
|
|
|
|
|
|
|
|
echo "</tbody></table></tr>";
|
|
|
|
|
2015-11-23 15:40:54 +00:00
|
|
|
|
|
|
|
|
2015-11-20 09:32:07 +00:00
|
|
|
}
|
|
|
|
echo "</tbody></table>";
|
2015-11-20 08:54:15 +00:00
|
|
|
|
|
|
|
echo "</section>";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|