From 96818b5737745c09fe6820aeb5594814af32cff7 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Wed, 15 May 2013 18:42:00 +0000 Subject: [PATCH] Change the dialog name --- .../controllers/DashboardController.php | 27 ++++++++++--------- .../views/default/scripts/user/index.phtml | 2 +- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/application/controllers/DashboardController.php b/application/controllers/DashboardController.php index 2c19e514c..5fc082e4a 100644 --- a/application/controllers/DashboardController.php +++ b/application/controllers/DashboardController.php @@ -164,7 +164,7 @@ class DashboardController extends Zend_Controller_Action $this->view->assign('Liens', $liens); } - + /** * Créer des graphiques pour les statistiques * @param array $data @@ -174,9 +174,9 @@ class DashboardController extends Zend_Controller_Action protected function statChart($data, $labels, $name) { require_once("Vendors/ChartDirector/phpchartdir.php"); - + $hChart = 210; - + $c = new PieChart($hChart*3, $hChart); $c->setPieSize($hChart/2, $hChart/2, $hChart/3); $c->set3D(10); @@ -187,7 +187,7 @@ class DashboardController extends Zend_Controller_Action $textBoxObj = $c->setLabelStyle("arial.ttf", 10); $textBoxObj->setBackground(Transparent); - + $b = $c->addLegend($hChart*1.5, $hChart/2, true, "arial.ttf", 10); $b->setAlignment(Left); $b->setBackground(Transparent, 0xaaaaaa); @@ -198,12 +198,12 @@ class DashboardController extends Zend_Controller_Action $b->setText( "<*block,valign=top*>{={sector}+1}.<*advanceTo=22*><*block,width=120*>{label}". "<*/*><*block,width=40,halign=right*>{percent}<*/*>%"); - + $fChart = fopen('themes/default/images/charts/chart-'.$name.'.png', "w"); fwrite($fChart, $c->makeChart2('png')); fclose($fChart); } - + /** * Affichage des statistiques des clients */ @@ -212,12 +212,12 @@ class DashboardController extends Zend_Controller_Action $client_stat = new Application_Model_ClientStat(); $statTypes = array('Navigateur'=>'browserName', 'Résolution d\'écran'=>'screenSize', 'Type d\'appareil'=>'isMobile'); - + while($statType = current($statTypes)) { $sql = $client_stat->select($statType) ->group($statType); $rows = $client_stat->fetchAll($sql); - $i=0; + $i=0; $values = array(); $keys = array(); foreach ($rows as $item) { @@ -227,12 +227,12 @@ class DashboardController extends Zend_Controller_Action $i++; } $this->statChart($keys, $values, $statType); - + next($statTypes); } $this->view->assign('statTypes', $statTypes); } - + /** * Gestion des commandes de l'extranet * Type : greffes | kbis | graydon | giant @@ -659,8 +659,11 @@ class DashboardController extends Zend_Controller_Action $ws = new WsScores(); $services = $ws->getServices($idClient); - $this->view->assign('services', $services->item); - + if (is_array($services)) { + $this->view->assign('services', $services->item); + } else { + $this->view->assign('services', array()); + } if ( null === $service ) { $infos = $ws->getListeUtilisateurs($user->getLogin(), $idClient); $utilisateurs = $infos->result->item; diff --git a/application/views/default/scripts/user/index.phtml b/application/views/default/scripts/user/index.phtml index b7d45e3cb..8c1d4a5f8 100644 --- a/application/views/default/scripts/user/index.phtml +++ b/application/views/default/scripts/user/index.phtml @@ -247,7 +247,7 @@ if ( $this->options->modeEdition==true ) { -
+