From ece3a6fecb367897762ccb27024bf2078e39b8c4 Mon Sep 17 00:00:00 2001
From: efalcy <efalcy@git-test.afi-sa.fr>
Date: Fri, 5 Apr 2013 10:12:45 +0000
Subject: [PATCH] Historique recherche vide : n'affiche pas "criteres de
 recherche"

---
 library/ZendAfi/View/Helper/HistoriqueRecherche.php    | 10 +++++++---
 library/ZendAfi/View/Helper/TagCriteresRecherche.php   |  7 ++++++-
 library/ZendAfi/View/Helper/TagHistoriqueRecherche.php |  2 +-
 3 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/library/ZendAfi/View/Helper/HistoriqueRecherche.php b/library/ZendAfi/View/Helper/HistoriqueRecherche.php
index c7b3ee376a4..e74ba3e7558 100644
--- a/library/ZendAfi/View/Helper/HistoriqueRecherche.php
+++ b/library/ZendAfi/View/Helper/HistoriqueRecherche.php
@@ -27,16 +27,20 @@ class ZendAfi_View_Helper_HistoriqueRecherche extends ZendAfi_View_Helper_BaseHe
 	$html='';
 		// Entete
 		$html .= '<h4>'.$this->view->_('Vos dernières recherches').'</h4>';
+		$this->_session = new Zend_Session_Namespace('historiqueRecherche');
+		if (!$this->_session->criteres)
+			return $html;
+		
 		$html .= '<table style="width:100%"><tr>		<th width="5%">&nbsp;</th>';
 		$html .= '<th width="45%%" align="left">'.$this->view->_('Expression recherchée').'</th></tr>
 		<tr><td colspan="4" style="background: transparent url(\'../images/separ.gif) repeat-x scroll center top\'">&nbsp;</td></tr>';
 
-		$this->_session = new Zend_Session_Namespace('historiqueRecherche');
+
 		$criteres_recherche = array_reverse($this->_session->criteres);
-	
+		
 		foreach($criteres_recherche as $critere)
 			{
-				$html.=$this->view->tagHistoriqueRecherche(unserialize($critere));
+				$html.=$this->view->tagHistoriqueRecherche(unserialize($critere))."";
 			}
 		return "<div class='criteres_recherche'>".$html."</table></div>";
 	}
diff --git a/library/ZendAfi/View/Helper/TagCriteresRecherche.php b/library/ZendAfi/View/Helper/TagCriteresRecherche.php
index 1bb1e0db52e..f8a2c5116ee 100644
--- a/library/ZendAfi/View/Helper/TagCriteresRecherche.php
+++ b/library/ZendAfi/View/Helper/TagCriteresRecherche.php
@@ -113,13 +113,18 @@ class ZendAfi_View_Helper_TagCriteresRecherche extends Zend_View_Helper_HtmlElem
 		$url=$this->_criteres_recherche->getUrlRetourListe();
 		$url['facettes']=implode('-', $facettes);
 		$url = array_filter($url);
-		$this->htmlAppend($libelle.'&nbsp;<a href="'.$this->view->url($url,null,true).'">Retirer</a>');
+		$this->htmlAppend('<a href="'.$this->view->url($url,null,true).'"><img src="'.URL_IMG.'suppression.gif" border="0">&nbsp;'.$libelle.'</a>');
 	}
 
 	public function visitCatalogue($catalogue) {
 	}
 
 
+	public function visitCoteDebutFin($cote_debut, $cote_fin) {
+
+	}
+
+
 	public function htmlAppend($text) {
 		$this->_html .= '<div>'.$text.'</div>';
 		return $this;
diff --git a/library/ZendAfi/View/Helper/TagHistoriqueRecherche.php b/library/ZendAfi/View/Helper/TagHistoriqueRecherche.php
index e93f85f5ffa..a10b39471e4 100644
--- a/library/ZendAfi/View/Helper/TagHistoriqueRecherche.php
+++ b/library/ZendAfi/View/Helper/TagHistoriqueRecherche.php
@@ -27,7 +27,7 @@ class ZendAfi_View_Helper_TagHistoriqueRecherche extends ZendAfi_View_Helper_Tag
 	
 		$this->_html='<tr style="cursor:pointer" onclick="document.location=\''.$url.'\'" title="'.$this->view->_(' cette recherche').'">'.'<td valign="top" style="text-align:center"><img src="'.URL_IMG.'bouton/loupe.gif" border="0" title="'.$this->view->_('Relancer cette recherche').'"></td><td>'.$this->_html;
 					
-		return $this->_html."</td></tr>";
+		return $this->_html."<br/></td></tr>";
 	}
 	public function visitRubrique($rubrique,$fil) {
 		$codification = Class_Codification::getInstance();
-- 
GitLab