- [x] [view/users] Affichage des groupes des utilisateurs

This commit is contained in:
xdrm-brackets 2016-02-14 13:55:06 +01:00
parent 5b025ee58f
commit 863e27f1db
3 changed files with 21 additions and 25 deletions

View File

@ -25,34 +25,24 @@
// Pour chaque entree
foreach( $json as $user ){
$insertRequest = Database::getPDO()->prepare("INSERT INTO user(id_user, code, username, firstname, lastname, mail, password, status)
VALUES(
DEFAULT,
:code,
:username,
:firstname,
:lastname,
:mail,
:password,
:status
)");
$status = $insertRequest->execute(array(
':code' => $user['code'],
':username' => $user['username'],
':firstname' => $user['firstname'],
':lastname' => $user['lastname'],
':mail' => $user['email'],
':password' => $user['password'],
':status' => $user['status']
// Creation de la requete
$request = new ModuleRequest('userDefault/create', array(
$user['code'],
$user['username'],
$user['firstname'],
$user['lastname'],
$user['email'],
$user['password'],
$user['status']
));
var_dump( $status );
$answer = $request->dispatch();
// Debug error
var_dump( $answer->error == ManagerError::Success );
}
return true;
}// insertUsersFromJSON();
}insertUsersFromJSON();

View File

@ -39,6 +39,7 @@
########
# FAIT #
########
- [x] [view/users] Affichage des groupes des utilisateurs
- [x] [cluster::link/unlink] Ajout/Suppression d'association des utilisateurs/machines a des groupes
- [x] [user::getClusters] Recuperation des groupes d'un utilisateur
- [x] [manager/repo/]Creation des repos

View File

@ -3,6 +3,7 @@
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
use \manager\Repo;
?>
<!-- [1] Gestion du sous-menu de gauche -->
@ -73,6 +74,9 @@
// Si aucune erreur, on affiche les resultats
else{
foreach( $answer->get('users') as $user){
$clusters = new Repo('user/getClusters', array($user['id_user']));
$clusters = $clusters->answer();
echo "<article class='inline-box'>";
// Prenom Nom
echo "<span class='title'>".$user['username']." <span>(".$user['firstname']." ".$user['lastname'].")</span></span>";
@ -99,8 +103,9 @@
echo "<span class='groups'>";
echo ResourceDispatcher::getResource('f/svg/group/st/container');
echo "<span>a</span>";
echo "<span>a</span>";
if( $clusters != false )
foreach($clusters as $cluster)
echo "<span>".$cluster['name']."</span>";
echo"</span>";