From 6e8e0ff786d13031a0c4b387df7f8d576d7d32be Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Thu, 21 Jul 2016 12:23:18 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=A9paration=20de=20la=20vue=20'dashboard'?= =?UTF-8?q?=20renomm=C3=A9e=20en=20'history'=20+=20mise=20en=20place=20des?= =?UTF-8?q?=20sous-sections=20avec=20icon=20+=20icon=20du=20menu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 4 +-- js/action-script-min.js | 2 +- js/action-script.js | 2 +- manager/repo/user.php | 6 ++-- manager/view/user/view.php | 1 - src/static/menu-side/dashboard.svg | 48 --------------------------- src/static/menu-side/history.svg | 49 ++++++++++++++++++++++++++++ src/static/sub-menu-side/archive.svg | 47 ++++++++++++++++++++++++++ view/{dashboard.php => history.php} | 11 ++----- view/js/users.js | 1 + view/view.php | 14 ++++---- 11 files changed, 114 insertions(+), 71 deletions(-) delete mode 100755 src/static/menu-side/dashboard.svg create mode 100755 src/static/menu-side/history.svg create mode 100644 src/static/sub-menu-side/archive.svg rename view/{dashboard.php => history.php} (84%) diff --git a/index.php b/index.php index ad22e61..4b5e881 100755 --- a/index.php +++ b/index.php @@ -30,7 +30,7 @@ /* (2) On définit la page d'accueil */ - if( $auth == 2 ) define('__REDIRECT__', 'Location: /dashboard/'); // Connecté -> Accès + if( $auth == 2 ) define('__REDIRECT__', 'Location: /history/'); // Connecté -> Accès elseif( $auth == 1 ) define('__REDIRECT__', 'Location: /admin/'); // Pas identifié -> Identification else define('__REDIRECT__', 'Location: /warehouse/'); // Pas localisé -> Localisation @@ -87,7 +87,7 @@ // nomPage/arg1/arg2 -> inclusion de la page $R->get('(.*)', function($m){ // Liste des pages du site - $page_list = [ 'dashboard', 'profile', 'machines', 'users', 'groups', 'analytics', 'settings' ]; + $page_list = [ 'history', 'profile', 'machines', 'users', 'groups', 'analytics', 'settings' ]; if( !preg_match('#^(?:'.implode('|', $page_list).')(?:/[\w-]+)*/?$#i', $m[0]) ) diff --git a/js/action-script-min.js b/js/action-script-min.js index c69851c..4dc7a4a 100644 --- a/js/action-script-min.js +++ b/js/action-script-min.js @@ -1,4 +1,4 @@ -DOM={WRAPPER:$("WRAPPER"),HEADER:$("HEADER"),MENUSIDE:$("MENU-SIDE"),CONTAINER:$("CONTAINER")};var pageManager=new pageManagerClass;pageManager.setPage(null,"/view",DOM.CONTAINER,"profile dashboard machines users groups analytics settings".split(" "));var api=new APIClass("/api/"); +DOM={WRAPPER:$("WRAPPER"),HEADER:$("HEADER"),MENUSIDE:$("MENU-SIDE"),CONTAINER:$("CONTAINER")};var pageManager=new pageManagerClass;pageManager.setPage(null,"/view",DOM.CONTAINER,"history profile machines users groups analytics settings".split(" "));var api=new APIClass("/api/"); function navSubMenu(a){var d=document.querySelector('#CONTAINER > .sub-menu-side > span[data-sublink="'+pageManager.vars[0]+'"]'),b=null,b=a instanceof Element?a:null,b="string"==typeof a?document.querySelector('#CONTAINER > .sub-menu-side > span[data-sublink="'+a+'"]'):b,b=null==b?document.querySelector("#CONTAINER > .sub-menu-side > span[data-sublink]"):b;if(null==b)return!1;null!=d&&d.remClass("active");a=document.querySelectorAll("#CONTAINER > section[data-sublink].active");for(d=0;d section[data-sublink="'+b.getData("sublink")+'"]'),null!=a&&a.addClass("active"));if(!b.getData("sublink"))return!1;a=pageManager.vars[0]!=b.getData("sublink");pageManager.vars[0]=b.getData("sublink");a&&pageManager.updateURL()} function navMenu(a,d){var b=document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.page+'"]'),c=null,c=a instanceof Element?a:null,c="string"==typeof a?document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+a+'"]'):c,c=null==c?document.querySelector('#WRAPPER > #MENU-SIDE > span[data-link="'+pageManager.pagelist[0]+'"]'):c;if(null==c)return!1;d=!0===d?!0:!1;null!=b&&b.remClass("active");null!=c&&c.addClass("active");d||b==c||(pageManager.vars=[]);c.getData("link")&& diff --git a/js/action-script.js b/js/action-script.js index 3e63c2b..e3c5640 100755 --- a/js/action-script.js +++ b/js/action-script.js @@ -9,7 +9,7 @@ DOM = { /* [0] Instanciation ===========================================*/ var pageManager = new pageManagerClass(); -pageManager.setPage(null, '/view', DOM.CONTAINER, ['profile', 'dashboard', 'machines', 'users', 'groups', 'analytics', 'settings'] ); +pageManager.setPage(null, '/view', DOM.CONTAINER, ['history', 'profile', 'machines', 'users', 'groups', 'analytics', 'settings'] ); var api = new APIClass('/api/'); diff --git a/manager/repo/user.php b/manager/repo/user.php index 091b63c..56e8d42 100755 --- a/manager/repo/user.php +++ b/manager/repo/user.php @@ -247,7 +247,7 @@ public static function getById($id_warehouse, $id_user){ /* [1] On rédige/execute la requête =========================================================*/ - $get = Database::getPDO()->prepare("SELECT u.id_user, u.code, u.username, u.firstname, u.lastname, u.mail, u.status + $get = Database::getPDO()->prepare("SELECT u.id_user, u.code, u.username, u.firstname, u.lastname, u.mail FROM user as u WHERE u.id_warehouse = :id_warehouse AND u.id_user = :id_user"); @@ -325,7 +325,7 @@ public static function getByUsername($id_warehouse, $username){ /* [1] On rédige/execute la requête =========================================================*/ - $get = Database::getPDO()->prepare("SELECT u.id_user, u.code, u.username, u.firstname, u.lastname, u.mail, u.status + $get = Database::getPDO()->prepare("SELECT u.id_user, u.code, u.username, u.firstname, u.lastname, u.mail FROM user as u WHERE u.id_warehouse = :id_warehouse AND u.username = :username"); @@ -362,7 +362,7 @@ public static function getAll($id_warehouse){ /* [1] On rédige/execute la requête =========================================================*/ - $get = Database::getPDO()->prepare("SELECT u.id_user, u.code, u.username, u.firstname, u.lastname, u.mail, u.status + $get = Database::getPDO()->prepare("SELECT u.id_user, u.code, u.username, u.firstname, u.lastname, u.mail FROM user as u WHERE u.id_warehouse = :id_warehouse"); $get->execute([ diff --git a/manager/view/user/view.php b/manager/view/user/view.php index afe25ba..beb9607 100644 --- a/manager/view/user/view.php +++ b/manager/view/user/view.php @@ -72,7 +72,6 @@ $USERLIST = $answer->get('users'); - foreach($USERLIST as $u=>$user){ $clustersReq = new ModuleRequest('userDefault/getClusters', [ 'id_user' => $user['id_user'] ]); $clustersRes = $clustersReq->dispatch(); diff --git a/src/static/menu-side/dashboard.svg b/src/static/menu-side/dashboard.svg deleted file mode 100755 index 5f77cb0..0000000 --- a/src/static/menu-side/dashboard.svg +++ /dev/null @@ -1,48 +0,0 @@ - -image/svg+xml diff --git a/src/static/menu-side/history.svg b/src/static/menu-side/history.svg new file mode 100755 index 0000000..a581e7d --- /dev/null +++ b/src/static/menu-side/history.svg @@ -0,0 +1,49 @@ + +image/svg+xml diff --git a/src/static/sub-menu-side/archive.svg b/src/static/sub-menu-side/archive.svg new file mode 100644 index 0000000..d421018 --- /dev/null +++ b/src/static/sub-menu-side/archive.svg @@ -0,0 +1,47 @@ + +image/svg+xml diff --git a/view/dashboard.php b/view/history.php similarity index 84% rename from view/dashboard.php rename to view/history.php index 85495c0..e7c80e4 100755 --- a/view/dashboard.php +++ b/view/history.php @@ -15,17 +15,12 @@ - Filtrer - - - - - Recherche + Détails - - Vider l'historique + + Archiver diff --git a/view/js/users.js b/view/js/users.js index 87b0f63..f574c0e 100755 --- a/view/js/users.js +++ b/view/js/users.js @@ -208,6 +208,7 @@ if( section.create.element != null ){ section.create.input.submit.anim('active', 1500); document.location = ''; + }else // Erreur console.error('ModuleError::'+answer.ModuleError); diff --git a/view/view.php b/view/view.php index 8b20eed..347729e 100755 --- a/view/view.php +++ b/view/view.php @@ -43,16 +43,16 @@