Skip to content
Snippets Groups Projects
Commit 694e2956 authored by Ghislain Loas's avatar Ghislain Loas
Browse files

Merge branch 'hotline#35768_footer_select_profil_admin_tool' into 'stable'

Hotline#35768 footer select profil admin tool

See merge request !1419
parents 2e0af791 85687e80
Branches
Tags
7 merge requests!1553Master,!1502Master,!1501Stable,!1472Stable,!1428Master,!1427Hotline master,!1426Stable
- ticket #35768 : Correction du sélecteur de profil dans les outils d'adminitration situés en bas de page
...@@ -25,8 +25,7 @@ class ZendAfi_Form_Decorator_ComboProfils extends Zend_Form_Decorator_Abstract { ...@@ -25,8 +25,7 @@ class ZendAfi_Form_Decorator_ComboProfils extends Zend_Form_Decorator_Abstract {
return $content return $content
. $this->_element->getView() . $this->_element->getView()
->comboProfils($this->_element->getProfil(), ->comboProfils($this->_element->getProfil(),
$this->_element->profil_filter $this->_element->profil_filter);
);
} }
} }
?> ?>
\ No newline at end of file
...@@ -28,11 +28,13 @@ class ZendAfi_View_Helper_ComboProfils extends ZendAfi_View_Helper_BaseHelper { ...@@ -28,11 +28,13 @@ class ZendAfi_View_Helper_ComboProfils extends ZendAfi_View_Helper_BaseHelper {
$_id_zone, $_id_zone,
$_id_bib; $_id_bib;
public function comboProfils($id_zone='ALL', $id_bib='ALL', $id_profil=1,
$autoload=false, $empty_option=false) { public function comboProfils($id_zone='ALL', $id_bib='ALL', $id_profil = 1, $autoload=false, $empty_option=false) {
$this->_select_profil_id = $id_profil; $this->_select_profil_id = $id_profil;
if ($empty_option) if ($empty_option)
$this->addEmptyOption(); $this->addEmptyOption();
$this->_id_zone = 'ALL'; $this->_id_zone = 'ALL';
$this->_id_bib = 'ALL'; $this->_id_bib = 'ALL';
...@@ -73,7 +75,7 @@ class ZendAfi_View_Helper_ComboProfils extends ZendAfi_View_Helper_BaseHelper { ...@@ -73,7 +75,7 @@ class ZendAfi_View_Helper_ComboProfils extends ZendAfi_View_Helper_BaseHelper {
$extra = ''; $extra = '';
if ($autoload) if ($autoload)
$extra = ' onchange="window.location=\''. Class_Url::baseUrl() . '?id_profil=\' + this.value"'; $extra = ' onchange="window.location=\''. $this->getProfilUrl() . '\' + this.value"';
return sprintf('<label for="%s" style="display:none">'. return sprintf('<label for="%s" style="display:none">'.
$this->view->_('Profil'). $this->view->_('Profil').
...@@ -86,6 +88,11 @@ class ZendAfi_View_Helper_ComboProfils extends ZendAfi_View_Helper_BaseHelper { ...@@ -86,6 +88,11 @@ class ZendAfi_View_Helper_ComboProfils extends ZendAfi_View_Helper_BaseHelper {
} }
protected function getProfilUrl() {
return $this->view->url(['id_profil' => ''], null, true);
}
public function getProfilsByBib() { public function getProfilsByBib() {
return Class_Profil::getProfilsByBib($this->_id_zone, $this->_id_bib); return Class_Profil::getProfilsByBib($this->_id_zone, $this->_id_bib);
} }
......
...@@ -124,7 +124,13 @@ class IndexControllerAsAdminWithCssEditorAndNoHeaderCss extends IndexControllerA ...@@ -124,7 +124,13 @@ class IndexControllerAsAdminWithCssEditorAndNoHeaderCss extends IndexControllerA
/** @test */ /** @test */
public function comboProfilOnChangeShouldContainsBaseUrl() { public function comboProfilOnChangeShouldContainsBaseUrl() {
$this->assertXPath('//div[@class="footer"]//select[@id="select_clef_profil"][contains(@onchange, "' . Class_Url::baseUrl() . '?id_profil=")]'); $this->assertXPath('//div[@class="footer"]//select[@id="select_clef_profil"][contains(@onchange, "\'/index/index/id_profil/\' + this.value")]');
}
/** @test */
public function comboProfilCurrentProfilShouldBeOne() {
$this->assertXPath('//div[@class="footer"]//select[@id="select_clef_profil"]//option[@value="1"][@selected="selected"]');
} }
} }
......
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