diff --git a/VERSIONS_HOTLINE/160185 b/VERSIONS_HOTLINE/160185 new file mode 100644 index 0000000000000000000000000000000000000000..0019df946e6dfb32d813c40f2529de209b173505 --- /dev/null +++ b/VERSIONS_HOTLINE/160185 @@ -0,0 +1 @@ + - correctif #160185 : Affichage : décalage bouton d'accès à la recherche avancée dans la barre de recherche \ No newline at end of file diff --git a/library/ZendAfi/Form/Element/Custom.php b/library/ZendAfi/Form/Element/Custom.php index 0673e2c2284e31137b99acafb8d85b40f007ee35..e0c086b5cb05140d438d0ce8d68901c9b47b754f 100644 --- a/library/ZendAfi/Form/Element/Custom.php +++ b/library/ZendAfi/Form/Element/Custom.php @@ -30,7 +30,8 @@ class ZendAfi_Form_Element_Custom extends Zend_Form_Element_Xhtml { $options = ['class' => $this->getAttrib('class')]; if ($this->getAttrib('title')) $options['title'] = $this->getAttrib('title'); - $this->_decorators['Link'] = (new ZendAfi_Form_Decorator_Custom())->setOptions($options); + + $this->_decorators['Custom'] = (new ZendAfi_Form_Decorator_Custom())->setOptions($options); foreach ($decorators as $name => $value) { $this->_decorators[$name] = $value; diff --git a/library/ZendAfi/View/Helper/RenderForm.php b/library/ZendAfi/View/Helper/RenderForm.php index bf5a4dd598eea1c458b4e32e7194dd7869e35b34..6f0beed2a6e1a17b035e2166fe9133c8491515a7 100644 --- a/library/ZendAfi/View/Helper/RenderForm.php +++ b/library/ZendAfi/View/Helper/RenderForm.php @@ -123,7 +123,6 @@ class ZendAfi_View_Helper_RenderForm extends ZendAfi_View_Helper_BaseHelper { $name = strtolower($name); $mapping = $this->_getDecoratorsMapping(); - if (array_key_exists($name, $mapping)) return call_user_func([$this, $mapping[$name]], $element, @@ -138,7 +137,8 @@ class ZendAfi_View_Helper_RenderForm extends ZendAfi_View_Helper_BaseHelper { protected function _getDecoratorsMapping() { return ['label' => '_labelForTableRendering', - 'link' => '_linkForTableRendering', + 'link' => '_withoutLabelForTableRendering', + 'custom' => '_withoutLabelForTableRendering', 'dtddwrapper' => '_ignoreForTableRendering', 'viewhelper' => '_viewhelperForTableRendering', 'multipleselection' => '_multipleselectionForTableRendering']; @@ -177,7 +177,7 @@ class ZendAfi_View_Helper_RenderForm extends ZendAfi_View_Helper_BaseHelper { } - protected function _linkForTableRendering($element, $decorator, $newDecorators, $name) { + protected function _withoutLabelForTableRendering($element, $decorator, $newDecorators, $name) { $decorator->setOption('tag', 'td'); $decorator->setOption('colspan', '2'); $newDecorators[$name] = $decorator; diff --git a/library/templates/Intonation/View/RenderForm.php b/library/templates/Intonation/View/RenderForm.php index a809ba251a912a07064504125a47b2653a8db1ea..2c614bd396a9742ccc8e5c25d4a4ff525cd04869 100644 --- a/library/templates/Intonation/View/RenderForm.php +++ b/library/templates/Intonation/View/RenderForm.php @@ -36,6 +36,13 @@ class Intonation_View_RenderForm extends ZendAfi_View_Helper_RenderForm { } + protected function _getDecoratorsMapping() { + $mapping = parent::_getDecoratorsMapping(); + unset($mapping['custom']); + return $mapping; + } + + protected function _getDefaultFormClass() { return 'form default_form row'; } @@ -77,7 +84,7 @@ class Intonation_View_RenderForm extends ZendAfi_View_Helper_RenderForm { } - protected function _linkForTableRendering($element, $decorator, $newDecorators, $name) { + protected function _withoutLabelForTableRendering($element, $decorator, $newDecorators, $name) { $decorator->setOptions([]); $newDecorators[$name] = $decorator; $newDecorators[] = ['HtmlTag', ['tag' => 'div', diff --git a/tests/scenarios/Templates/TemplatesSearchTest.php b/tests/scenarios/Templates/TemplatesSearchTest.php index 66f54c87c2a2cb380681ea01123f72b074c1d052..4bcdf53ff1838179e58a9a0c67a7be0a666bb098 100644 --- a/tests/scenarios/Templates/TemplatesSearchTest.php +++ b/tests/scenarios/Templates/TemplatesSearchTest.php @@ -69,6 +69,13 @@ class TemplatesSearchWithSortParameterInWidgetFromIndexPageTest extends Template public function searchSubmitButtonShouldBeRechercheSimple() { $this->assertXPathContentContains('//div[@id="boite_1"]//button[contains(@class, "search_submit_button")]', 'Recherche simple'); } + + + /** @test */ + public function widgetRechSimpleShouldContainsDropdownWithAdvancedSearchLink() { + $this->assertXPathContentContains('//div[contains(@class, "boite rech_simple")]//div[@class= "custom_advanced_search order-6"]//div[contains(@class, "dropdown")]//a[@href="/recherche/avancee/statut/reset"]', + 'Recherche avancée'); + } }