Skip to content
Snippets Groups Projects
Commit ba45698e authored by lbrun's avatar lbrun
Browse files

hotline#37341 : fix search result type doc display

parent c3214471
Branches
Tags
10 merge requests!1587Master,!1553Master,!1519Master,!1505Stable,!1502Master,!1501Stable,!1491Master,!1490Hotline master,!1489Stable,!1478Hotline#37341 perte des types doc en resultat de recherche dans charte graphique
- ticket #37341 : CASQY : Correction de l'affichage des types docs en résultat de recherche
\ No newline at end of file
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Notice_FacettesTypeDoc extends Zend_View_Helper_HtmlElement {
public function notice_FacettesTypeDoc($facettes) {
......@@ -26,10 +26,10 @@ class ZendAfi_View_Helper_Notice_FacettesTypeDoc extends Zend_View_Helper_HtmlEl
if (!isset($facettes['T']))
$facettes['T'] = [];
foreach($facettes['T'] as $facette) {
if (!is_array($facette))
continue;
$html .= $this->renderFacette($facette['id'], $facette['libelle'], $facette['nombre']);
foreach($facettes['T'] as $code => $value) {
$label = Class_Codification::getInstance()->getLibelleFacette($code);
$html .= $this->renderFacette($code, $label, $value);
}
return $html.'</div>';
......@@ -37,7 +37,7 @@ class ZendAfi_View_Helper_Notice_FacettesTypeDoc extends Zend_View_Helper_HtmlEl
public function renderFacette($id, $libelle, $nombre) {
return $this->view->tagAnchor(['facette' => $id], $nombre,
return $this->view->tagAnchor(['facette' => $id], $nombre,
['class' => 'type_doc_'.substr($id, 1 ),
'libelle' => $libelle]);
}
......
......@@ -16,7 +16,7 @@
*
* You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE
* along with BOKEH; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class ZendAfi_View_Helper_Notice_FacettesTypeDocTest extends ViewHelperTestCase {
......@@ -26,29 +26,22 @@ class ZendAfi_View_Helper_Notice_FacettesTypeDocTest extends ViewHelperTestCase
parent::setUp();
$this->_helper = new ZendAfi_View_Helper_Notice_FacettesTypeDoc();
$this->_helper->setView(new ZendAfi_Controller_Action_Helper_View());
$this->_html = $this->_helper->notice_FacettesTypeDoc(['T' => [ 'titre' => 'Type de document',
1 => ['id' => 'T1',
'libelle' => 'Livres',
'nombre' => 22],
2 => ['id' => 'T3',
'libelle' => 'DVD',
'nombre' => 34]]]);
$this->_html = $this->_helper->notice_FacettesTypeDoc(['T' => ['T1' => 22,
'T3' => 34]]);
}
/** @test */
public function linkForTypeDocLivreShouldContains22() {
$this->assertXPathContentContains($this->_html,
'//div[@class="facettes_type_doc"]//a[@class="type_doc_1"][contains(@href, "facette/T1")]',
'22');
'//div[@class="facettes_type_doc"]//a[@class="type_doc_1"][contains(@href, "facette/T1")]', '22');
}
/** @test */
public function linkForTypeDVDShouldContains34() {
$this->assertXPathContentContains($this->_html,
'//div[@class="facettes_type_doc"]//a[@class="type_doc_3"][contains(@href, "facette/T3")]',
'34');
'//div[@class="facettes_type_doc"]//a[@class="type_doc_3"][contains(@href, "facette/T3")]', '34');
}
}
?>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment