From ef8274759076d2976d7032e5c99a1226370391fc Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Thu, 5 Jan 2012 16:27:24 +0000 Subject: [PATCH] On affiche que le message de comptage sur la page index/index --- application/views/default/scripts/header.phtml | 2 ++ .../Application/Controller/Plugin/Comptage.php | 16 ++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/application/views/default/scripts/header.phtml b/application/views/default/scripts/header.phtml index f542145e..a4507fd2 100644 --- a/application/views/default/scripts/header.phtml +++ b/application/views/default/scripts/header.phtml @@ -13,6 +13,7 @@
+msgComptage){?>
total)) {?> Nombre sélectionnées : @@ -29,4 +30,5 @@ [Initialiser les critères], [Sauvegarder le profil du ciblage]
+
\ No newline at end of file diff --git a/library/Application/Controller/Plugin/Comptage.php b/library/Application/Controller/Plugin/Comptage.php index 2bf8c943..67835df5 100644 --- a/library/Application/Controller/Plugin/Comptage.php +++ b/library/Application/Controller/Plugin/Comptage.php @@ -6,12 +6,16 @@ class Application_Controller_Plugin_Comptage extends Zend_Controller_Plugin_Abst $layout = Zend_Layout::getMVCInstance(); if ($layout->isEnabled()) { $controller = $this->_request->getControllerName(); - $action = $this->_request->getActionName(); - require_once 'Scores/SessionCiblage.php'; - $session = new SessionCiblage(); - $view = $layout->getView(); - $view->total = number_format($session->getNb('total'), 0, '', ' '); - $view->insee = number_format($session->getNb('insee'), 0, '', ' '); + $action = $this->_request->getActionName(); + + if ($controller == 'index' && $action == 'index') { + require_once 'Scores/SessionCiblage.php'; + $session = new SessionCiblage(); + $view = $layout->getView(); + $view->total = number_format($session->getNb('total'), 0, '', ' '); + $view->insee = number_format($session->getNb('insee'), 0, '', ' '); + $view->msgComptage = true; + } } } } \ No newline at end of file