From eaa2bc65e083d295b0b7eb46836daa1f06d62313 Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Wed, 28 Mar 2018 11:32:59 +0200 Subject: [PATCH 1/6] =?UTF-8?q?[page.home]=20{fix}=C2=A0affichage=20sur=20?= =?UTF-8?q?r=C3=A9ponse=20de=20l'API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack/component/home/page1.vue | 59 ++++++++++++++++---------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/webpack/component/home/page1.vue b/webpack/component/home/page1.vue index fe52b31..61f655e 100644 --- a/webpack/component/home/page1.vue +++ b/webpack/component/home/page1.vue @@ -2,40 +2,41 @@
- + - 0 - - -
bla
From 1e93e712c397469481c7492052009dc8efc2cd20 Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Sat, 31 Mar 2018 13:11:59 +0200 Subject: [PATCH 2/6] =?UTF-8?q?[master]=20{correction}=C2=A0affiche=20les?= =?UTF-8?q?=20messages=20d'erreur=20de=20connexion=20plus=20longtemps?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack/page/login.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/webpack/page/login.js b/webpack/page/login.js index 4aba0dc..eb90194 100644 --- a/webpack/page/login.js +++ b/webpack/page/login.js @@ -43,7 +43,7 @@ window.cas_callback = function(cas_login){ // re-activate button gstore.add('popup_opened', false); - setTimeout(function(){ gstore.get.login_class = 'neutral'; }, 1500); + setTimeout(function(){ gstore.get.login_class = 'neutral'; }, 3000); /* (4) If error code -> display error */ }else if( !isNaN(cas_login) ){ @@ -71,7 +71,7 @@ window.cas_callback = function(cas_login){ // re-activate button gstore.add('popup_opened', false); - setTimeout(function(){ gstore.get.login_class = 'neutral'; }, 1500); + setTimeout(function(){ gstore.get.login_class = 'neutral'; }, 3000); /* (4) If login -> reload page */ }else{ @@ -81,7 +81,7 @@ window.cas_callback = function(cas_login){ var redirect_url = `/${gstore.get.URI.join('/')}`; - setTimeout(function(){ document.location = redirect_url; }, 1500); + setTimeout(function(){ document.location = redirect_url; }, 3000); } From c40d45e7c94719cdaa4cf8f67e8fa936c920908c Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Sat, 31 Mar 2018 13:33:08 +0200 Subject: [PATCH 3/6] =?UTF-8?q?[page.home]=20{correction}=C2=A0maj=20des?= =?UTF-8?q?=20noms=20des=20heures=20+=20ajout=20de=20l=C3=A9gendes=20extra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack/component/home/page1.vue | 2 +- webpack/data/home.js | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/webpack/component/home/page1.vue b/webpack/component/home/page1.vue index 61f655e..83e7a48 100644 --- a/webpack/component/home/page1.vue +++ b/webpack/component/home/page1.vue @@ -33,7 +33,7 @@ :height="gstore.dimensions.bin.width" :width="gstore.dimensions.bin.margin + (gstore.dimensions.axis.width * value)/gstore.maxValue" :data-info="value"> - {{ value }} + {{ (gstore.titles && gstore.titles[key]) ? value + ' ' + gstore.titles[key] : value }} diff --git a/webpack/data/home.js b/webpack/data/home.js index 3e45aa0..984eeb9 100644 --- a/webpack/data/home.js +++ b/webpack/data/home.js @@ -14,30 +14,35 @@ api.call('GET department/stats', {}, function(rs) { } let maxValue = null; - let maxKeyLength = null; + let maxLabelLength = null; let data = {}; let map = { - "potentiel" : "Heures dûes", - "sous_service" : "Heures à faire", + "potentiel" : "Heures potentielles", + "sous_service" : "Heures en sous-services", "heures_comp" : "Heures comp.", "heures_vacataire" : "Heures vacataires", - "heures_exterieur" : "Heures extérieurs", + "heures_exterieur" : "Heures à l'extérieurs", "heures_ue_desactive" : "Heures UE annulées", "nbr_ue_desactive" : "Nombre d'UE annulées" }; for (let stat in rs.data) { maxValue = rs.data[stat] > maxValue ? rs.data[stat] : maxValue; - maxKeyLength = stat.length > maxKeyLength ? stat.length : maxKeyLength; + maxLabelLength = map[stat].length > maxLabelLength ? map[stat].length : maxLabelLength; data[map[stat]] = Math.round(rs.data[stat] * 100) / 100; } + gstore.get.titles = {}; + gstore.get.titles[map['heures_ue_desactive']] = `sur ${data[map['nbr_ue_desactive']]} UE annulées`; + + delete data[map['nbr_ue_desactive']]; + gstore.get.stats = data; gstore.get.dimensions = { padding: 5, text: { - size: maxKeyLength * 9.5, + size: maxLabelLength * 9.5, alignH: 5, alignV: 20, }, From 1c2de0b5dfe4e396c789fea9baeb5ade0b0dadc3 Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Sat, 31 Mar 2018 13:36:32 +0200 Subject: [PATCH 4/6] =?UTF-8?q?[page.home]=20{upd}=C2=A0ajout=20de=20comme?= =?UTF-8?q?ntaires?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack/data/home.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/webpack/data/home.js b/webpack/data/home.js index 984eeb9..133cb7d 100644 --- a/webpack/data/home.js +++ b/webpack/data/home.js @@ -13,9 +13,9 @@ api.call('GET department/stats', {}, function(rs) { return console.log('No formation found, error: ' + rs.error); } - let maxValue = null; - let maxLabelLength = null; - let data = {}; + let maxValue = null; // plus haute valeur des stats + let maxLabelLength = null; // plus longues chaîne de caractères pour les stats + let data = {}; // ensemble des statistiques à transmettre à VueJS let map = { "potentiel" : "Heures potentielles", "sous_service" : "Heures en sous-services", @@ -27,15 +27,19 @@ api.call('GET department/stats', {}, function(rs) { }; for (let stat in rs.data) { + // détection de la plus grande valeur statistique maxValue = rs.data[stat] > maxValue ? rs.data[stat] : maxValue; + // détection du plus grand nom présent maxLabelLength = map[stat].length > maxLabelLength ? map[stat].length : maxLabelLength; data[map[stat]] = Math.round(rs.data[stat] * 100) / 100; } + // légendes à afficher en plus de la valeur gstore.get.titles = {}; gstore.get.titles[map['heures_ue_desactive']] = `sur ${data[map['nbr_ue_desactive']]} UE annulées`; + // statistiques à ne pas afficher delete data[map['nbr_ue_desactive']]; gstore.get.stats = data; From 32da5131b4c203bc0495f980a2d1cfc3ec15423c Mon Sep 17 00:00:00 2001 From: Unknown Date: Sun, 1 Apr 2018 13:10:36 +0200 Subject: [PATCH 5/6] [repo.ue] Fixed request stacker + fixed UE request --- build/database/core/PDOWrapper/PDOWrapper.php | 13 +++++-------- build/database/repo/ue.php | 6 +++--- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/build/database/core/PDOWrapper/PDOWrapper.php b/build/database/core/PDOWrapper/PDOWrapper.php index ffd5cb8..8d64b60 100644 --- a/build/database/core/PDOWrapper/PDOWrapper.php +++ b/build/database/core/PDOWrapper/PDOWrapper.php @@ -154,23 +154,19 @@ class PDOWrapper extends \PDO //find the given pattern in the request, then call our function and replace the matched string by the return value of our function $finalStatement .= rtrim(preg_replace_callback("/(:[a-z_\-0-9]*)/is",function($matches) use (&$i,&$tempParametes){ - //get next number - $i++; - //delete the ':' at the beginning of the string - $tempKey = ltrim($matches[0],':'); //copy the parameter with the modified index - $tempParametes[$tempKey.$i] = $tempParametes[$tempKey]; + $tempParametes[":$i"] = $tempParametes[$matches[0]]; //delete the old index - unset($tempParametes[$tempKey]); + unset($tempParametes[$matches[0]]); //return the modified string for replacement - return $matches[0].$i; + return ":".$i++; },$statement),';').';'; - $finalExecute = array_merge($finalExecute,$tempParametes); + $finalExecute += $tempParametes; } //disable stacking @@ -184,6 +180,7 @@ class PDOWrapper extends \PDO $req = $this->prepare($finalStatement); $success = $req->execute($finalExecute); + //as we execute multiple query that we don't fetch, we have to close the cursor if we want to do other requests later $req->closeCursor(); $this->commit(); diff --git a/build/database/repo/ue.php b/build/database/repo/ue.php index 6ec3f37..5f00462 100644 --- a/build/database/repo/ue.php +++ b/build/database/repo/ue.php @@ -195,9 +195,9 @@ class ue extends Repo_i { IFNULL(formlist.nbrCours,0) nbrCours, IFNULL(formlist.nbrTD,0) nbrTD, IFNULL(formlist.nbrTP,0) nbrTP, - IFNULL(formlist.modCours,1) modCours, - IFNULL(formlist.modTD,1) modTD, - IFNULL(formlist.modTP,1) modTP, + IFNULL(formlist.modCours,0) modCours, + IFNULL(formlist.modTD,0) modTD, + IFNULL(formlist.modTP,0) modTP, IFNULL(formlist.nbrProfCours,0) nbrProfCours, IFNULL(formlist.nbrProfTD,0) nbrProfTD, IFNULL(formlist.nbrProfTP,0) nbrProfTP From 21d67f3d2a0e96c9fa56eb9b258823411fecad3d Mon Sep 17 00:00:00 2001 From: Guillaume FAUVET Date: Sat, 7 Apr 2018 12:40:40 +0200 Subject: [PATCH 6/6] =?UTF-8?q?{upd}=C2=A0statistiques=20are=20responsive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webpack/component/home/page1.vue | 2 +- webpack/data/home.js | 6 ++++-- webpack/scss/container/svg.scss | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/webpack/component/home/page1.vue b/webpack/component/home/page1.vue index 83e7a48..1b0c4cb 100644 --- a/webpack/component/home/page1.vue +++ b/webpack/component/home/page1.vue @@ -1,7 +1,7 @@