- [x] [view/][view] Ajout de "use CLASS;"

This commit is contained in:
xdrm-brackets 2016-02-13 18:47:20 +01:00
parent dc65466364
commit f238a18204
11 changed files with 65 additions and 51 deletions

View File

@ -1,8 +1,6 @@
<?php
namespace manager;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
class DataBase{

View File

@ -1,7 +1,6 @@
<?php
namespace manager;
use \manager\ManagerError;
// FORMAT:

View File

@ -1,9 +1,6 @@
<?php
namespace manager;
use \manager\ModuleAnswer;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
// FORMAT:
//

View File

@ -39,6 +39,7 @@
########
# FAIT #
########
- [x] [view/][view] Ajout de "use CLASS;"
- [x] Ajout de "use CLASS;" dans les fichiers pour simplifier la lisibilite
- [x] [phpunit/sessionManager] test unitaires du manager de session php
- [x] [ModuleAnswer] Gestion des erreurs au niveau interne des Modules

View File

@ -1,3 +1,4 @@
<?php use \manager\ResourceDispatcher; ?>
<!DOCTYPE html>
<html>
<head>
@ -42,15 +43,15 @@
<!-- MENU DE LA PAGE -->
<nav id='MENU-SIDE'>
<span data-link='profile' data-desc='Profil' class='mb' ><?php echo \manager\ResourceDispatcher::getResource('f/svg/dashboard/st/menu-side'); ?></span>
<span data-link='profile' data-desc='Profil' class='mb' ><?php echo ResourceDispatcher::getResource('f/svg/dashboard/st/menu-side'); ?></span>
<span data-link='dashboard' data-desc='Tableau de bord' class='apart' ><?php echo \manager\ResourceDispatcher::getResource('f/svg/dashboard/st/menu-side'); ?></span>
<span data-link='machines' data-desc='Véhicules' ><?php echo \manager\ResourceDispatcher::getResource('f/svg/machines/st/menu-side' ); ?></span>
<span data-link='users' data-desc='Utilisateurs' ><?php echo \manager\ResourceDispatcher::getResource('f/svg/users/st/menu-side' ); ?></span>
<span data-link='analytics' data-desc='Statistiques et suivi' ><?php echo \manager\ResourceDispatcher::getResource('f/svg/analytics/st/menu-side'); ?></span>
<span data-link='dashboard' data-desc='Tableau de bord' class='apart' ><?php echo ResourceDispatcher::getResource('f/svg/dashboard/st/menu-side'); ?></span>
<span data-link='machines' data-desc='Véhicules' ><?php echo ResourceDispatcher::getResource('f/svg/machines/st/menu-side' ); ?></span>
<span data-link='users' data-desc='Utilisateurs' ><?php echo ResourceDispatcher::getResource('f/svg/users/st/menu-side' ); ?></span>
<span data-link='analytics' data-desc='Statistiques et suivi' ><?php echo ResourceDispatcher::getResource('f/svg/analytics/st/menu-side'); ?></span>
<span data-link='settings' data-desc='Paramètres' class='mt' ><?php echo \manager\ResourceDispatcher::getResource('f/svg/settings/st/menu-side' ); ?></span>
<span data-link='settings' data-desc='Paramètres' class='mt' ><?php echo ResourceDispatcher::getResource('f/svg/settings/st/menu-side' ); ?></span>
</nav>

View File

@ -1,5 +1,8 @@
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
?>
@ -7,22 +10,22 @@
<nav class='sub-menu-side'>
<span data-sublink='analytics'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/analytics/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/analytics/st/sub-menu-side' ); ?></span>
<span>Statistiques</span>
</span>
<span data-sublink='view' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span>Consulter le suivi</span>
</span>
<span data-sublink='start' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/sync/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/sync/st/sub-menu-side' ); ?></span>
<span>Demarrer un suivi</span>
</span>
<span data-sublink='search' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span>Recherche</span>
</span>

View File

@ -1,27 +1,30 @@
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
?>
<!-- [1] Gestion du sous-menu de gauche -->
<nav class='sub-menu-side'>
<span data-sublink='displayall'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span>Tout afficher</span>
</span>
<span data-sublink='filter' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span>Filtrer</span>
</span>
<span data-sublink='search' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span>Recherche</span>
</span>
<span data-sublink='remove' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span>Vider l'historique</span>
</span>
</nav>

View File

@ -1,37 +1,40 @@
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
?>
<!-- [1] Gestion du sous-menu de gauche -->
<nav class='sub-menu-side'>
<span data-sublink='view'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span>Tout afficher</span>
</span>
<span data-sublink='create'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/create/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/create/st/sub-menu-side' ); ?></span>
<span>Creation</span>
</span>
<span data-sublink='remove'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span>Suppression</span>
</span>
<span data-sublink='edit'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/edit/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/edit/st/sub-menu-side' ); ?></span>
<span>Modification</span>
</span>
<span data-sublink='filter'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span>Filtrer</span>
</span>
<span data-sublink='search'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span>Recherche</span>
</span>
@ -52,15 +55,15 @@
// On recupere toutes les machines
debug();
$request = new \manager\ModuleRequest('machineDefault/getAll'); // On utilise la methode 'getAll' du module 'machineDefault'
$request = new ModuleRequest('machineDefault/getAll'); // On utilise la methode 'getAll' du module 'machineDefault'
$answer = $request->dispatch(); // On recupere la reponse
echo "<section data-sublink='view' class='list'>";
// echo 'Liste des utilisateurs: <br>';
// si erreur, on affiche l'explicitation
if( $answer->error != \manager\ManagerError::Success )
var_dump( \manager\ManagerError::explicit($answer->error) );
if( $answer->error != ManagerError::Success )
var_dump( ManagerError::explicit($answer->error) );
// Si aucune erreur, on affiche les resultats
else{
@ -71,7 +74,7 @@
// Code RFID
echo "<span class='code'>";
echo \manager\ResourceDispatcher::getResource('f/svg/card/st/container');
echo ResourceDispatcher::getResource('f/svg/card/st/container');
echo "<span>";
echo $machine['code'];
@ -80,7 +83,7 @@
// Groupes de la machine
echo "<span class='groups'>";
echo \manager\ResourceDispatcher::getResource('f/svg/group/st/container');
echo ResourceDispatcher::getResource('f/svg/group/st/container');
echo "<span>a</span>";
echo "<span>a</span>";

View File

@ -1,5 +1,8 @@
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
?>
@ -7,12 +10,12 @@
<nav class='sub-menu-side'>
<span data-sublink='view'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span>Mon Profil</span>
</span>
<span data-sublink='password'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/password/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/password/st/sub-menu-side' ); ?></span>
<span>Mot de passe</span>
</span>

View File

@ -1,37 +1,40 @@
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
?>
<!-- [1] Gestion du sous-menu de gauche -->
<nav class='sub-menu-side'>
<span data-sublink='displayall'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span>Tout afficher</span>
</span>
<span data-sublink='create' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/create/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/create/st/sub-menu-side' ); ?></span>
<span>Creation</span>
</span>
<span data-sublink='remove' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span>Suppression</span>
</span>
<span data-sublink='edit' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/edit/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/edit/st/sub-menu-side' ); ?></span>
<span>Modification</span>
</span>
<span data-sublink='filter' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span>Filtrer</span>
</span>
<span data-sublink='search' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span>Recherche</span>
</span>

View File

@ -1,37 +1,40 @@
<?php define('__ROOT__', dirname(dirname(__FILE__)) );
require_once __ROOT__.'/manager/autoloader.php';
use \manager\ModuleRequest;
use \manager\ManagerError;
use \manager\ResourceDispatcher;
?>
<!-- [1] Gestion du sous-menu de gauche -->
<nav class='sub-menu-side'>
<span data-sublink='view'>
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/view/st/sub-menu-side' ); ?></span>
<span>Tout afficher</span>
</span>
<span data-sublink='create' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/create/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/create/st/sub-menu-side' ); ?></span>
<span>Creation</span>
</span>
<span data-sublink='remove' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/remove/st/sub-menu-side' ); ?></span>
<span>Suppression</span>
</span>
<span data-sublink='edit' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/edit/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/edit/st/sub-menu-side' ); ?></span>
<span>Modification</span>
</span>
<span data-sublink='filter' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/filter/st/sub-menu-side' ); ?></span>
<span>Filtrer</span>
</span>
<span data-sublink='search' >
<span class='svg'><?php echo \manager\ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span class='svg'><?php echo ResourceDispatcher::getResource( 'f/svg/search/st/sub-menu-side' ); ?></span>
<span>Recherche</span>
</span>
@ -57,15 +60,15 @@
// On recupere tous les utilisateurs
debug();
$request = new \manager\ModuleRequest('userDefault/getAll'); // On utilise la methode 'getAll' du module 'userDefault'
$request = new ModuleRequest('userDefault/getAll'); // On utilise la methode 'getAll' du module 'userDefault'
$answer = $request->dispatch(); // On recupere la reponse
echo "<section data-sublink='view' class='list'>";
// echo 'Liste des utilisateurs: <br>';
// si erreur, on affiche l'explicitation
if( $answer->error != \manager\ManagerError::Success )
var_dump( \manager\ManagerError::explicit($answer->error) );
if( $answer->error != ManagerError::Success )
var_dump( ManagerError::explicit($answer->error) );
// Si aucune erreur, on affiche les resultats
else{
@ -76,7 +79,7 @@
// Code RFID
echo "<span class='code'>";
echo \manager\ResourceDispatcher::getResource('f/svg/card/st/container');
echo ResourceDispatcher::getResource('f/svg/card/st/container');
echo "<span>";
echo $user['code'];
@ -85,7 +88,7 @@
// Adresse email
echo "<span class='mail'>";
echo \manager\ResourceDispatcher::getResource('f/svg/mail/st/container');
echo ResourceDispatcher::getResource('f/svg/mail/st/container');
echo "<span>";
echo $user['mail'];
@ -94,7 +97,7 @@
// Groupes de la machine
echo "<span class='groups'>";
echo \manager\ResourceDispatcher::getResource('f/svg/group/st/container');
echo ResourceDispatcher::getResource('f/svg/group/st/container');
echo "<span>a</span>";
echo "<span>a</span>";