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);