From 200a4a8a9f4391e6899ae58a83677016489bfb69 Mon Sep 17 00:00:00 2001 From: Michael RICOIS Date: Fri, 10 Jun 2011 15:01:46 +0000 Subject: [PATCH] =?UTF-8?q?Correction=20pour=20passer=20dans=20la=20recher?= =?UTF-8?q?che=20giant=20apr=C3=A8s=20enregistrement=20de=20la=20session?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controllers/RechercheController.php | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/application/controllers/RechercheController.php b/application/controllers/RechercheController.php index a666b98fd..deac72de8 100644 --- a/application/controllers/RechercheController.php +++ b/application/controllers/RechercheController.php @@ -137,14 +137,20 @@ class RechercheController extends Zend_Controller_Action $request = $this->getRequest(); $params = $request->getParams(); - //Giant - $pays = $request->getParam('pays'); - if( !empty($pays) ) - $this->_forward('index', 'giant'); - $type = $request->getParam('type', ''); + + $rechercheParams = new RechercheHistorique(); + if (count($rechercheParams->liste())>0){ + $recherche = $rechercheParams->item(0); + $type = $recherche['type']; + $params = $recherche['params']; + } + + //Giant + if( isset($params['pays']) && !empty($params['pays']) ){ + $this->_forward('index', 'giant'); + } - $rechercheParams = new RechercheHistorique(); //Si le formulaire a été soumis alors on enregistre en session et on redirige if ($request->isPost() && !empty($type)) { $rechercheParams->save($type, $params); @@ -152,10 +158,6 @@ class RechercheController extends Zend_Controller_Action } $page = $request->getParam('page', 1); - - $recherche = $rechercheParams->item(0); - $type = $recherche['type']; - $params = $recherche['params']; //Criteres recherche entreprise if ($type=='ent'){ @@ -350,7 +352,7 @@ class RechercheController extends Zend_Controller_Action } else { $this->view->assign('blockDirToEntreprise', false); } - + $this->view->assign('liste', $liste); $this->view->assign('totPage', $totPage); $this->view->assign('curPage', $curPage);