diff --git a/library/ZendAfi/Controller/Action/Helper/BibListViewMode.php b/library/ZendAfi/Controller/Action/Helper/BibListViewMode.php index e0a3004e3338afbd62c060d20dcdd8778a67b639..664c28bc4d4284baf6b0f977a12ed7c5395ce471 100644 --- a/library/ZendAfi/Controller/Action/Helper/BibListViewMode.php +++ b/library/ZendAfi/Controller/Action/Helper/BibListViewMode.php @@ -33,6 +33,21 @@ class ZendAfi_Controller_Action_Helper_BibListViewMode extends ZendAfi_Controlle } + protected function _describeCategoriesIn($description) { + return $description + ->addColumn($this->_('Localisation'), ['attribute' => 'libelle', + 'callback' => function ($model, $attrib) + { + return $this->_renderCategory($model, $attrib); + }]); + } + + + protected function _describeItemsIn($description) { + return $description; + } + + public function getBaseUrl() { return ['module' => 'admin', 'controller' => 'cms']; @@ -59,28 +74,7 @@ class ZendAfi_Controller_Action_Helper_BibListViewMode extends ZendAfi_Controlle } - public function countItemsFor($model) { - $id = $model ? $model->getId() : 0; - return Class_ArticleCategorie::countBy(['id_site' => $id]); - } - - - public function getCategoriesCols() { - return [$this->_('Localisation')]; - } - - - public function getCategoriesLabelAttrib() { - return 'libelle'; - } - - public function getStrategyLabel() { return 'bib'; } - - - public function getItemsPaginator() { - return new Zend_Paginator(new Zend_Paginator_Adapter_Null(0)); - } } \ No newline at end of file diff --git a/tests/application/modules/admin/controllers/CmsControllerListModeTest.php b/tests/application/modules/admin/controllers/CmsControllerListModeTest.php index 1925aad3e359559a6177ed885131a411695ad93d..8c6a8ed11dacc4f991b4d1f2a0d4d3d9efd41f8b 100644 --- a/tests/application/modules/admin/controllers/CmsControllerListModeTest.php +++ b/tests/application/modules/admin/controllers/CmsControllerListModeTest.php @@ -42,7 +42,8 @@ class CmsControllerListModeAdminRootTest extends CmsControllerListModeTestCase { /** @test */ public function shouldDisplayPortal() { $this->assertXPathContentContains('//td/a[contains(@href, "cms/index/id_bib/0")]', - 'Portail'); + 'Portail', + $this->_response->getBody()); }