From 3ef0e6e43d12d66bad81d621edf6656598972366 Mon Sep 17 00:00:00 2001 From: Ghislain Loas <ghislo@sandbox.pergame.net> Date: Wed, 9 Nov 2016 13:59:29 +0100 Subject: [PATCH] hackfest add column author and column creation date in cms list view mode --- VERSIONS_WIP/hackfest_add_author_list_view_mode | 1 + .../Controller/Action/Helper/ArticleListViewMode.php | 8 +++++--- .../admin/controllers/CmsControllerListModeTest.php | 12 ++++++++++++ 3 files changed, 18 insertions(+), 3 deletions(-) create mode 100644 VERSIONS_WIP/hackfest_add_author_list_view_mode diff --git a/VERSIONS_WIP/hackfest_add_author_list_view_mode b/VERSIONS_WIP/hackfest_add_author_list_view_mode new file mode 100644 index 00000000000..d698d9a2913 --- /dev/null +++ b/VERSIONS_WIP/hackfest_add_author_list_view_mode @@ -0,0 +1 @@ + - hackfest : Administration : la colonne créateur ainsi que la date de mise à jour ont été ajoutées dans la liste d'articles mode paginés \ No newline at end of file diff --git a/library/ZendAfi/Controller/Action/Helper/ArticleListViewMode.php b/library/ZendAfi/Controller/Action/Helper/ArticleListViewMode.php index 2983391772f..10b1ff8988a 100644 --- a/library/ZendAfi/Controller/Action/Helper/ArticleListViewMode.php +++ b/library/ZendAfi/Controller/Action/Helper/ArticleListViewMode.php @@ -243,12 +243,14 @@ class ZendAfi_Controller_Action_Helper_ArticleListViewMode extends ZendAfi_Contr public function getItemsCols() { - return [$this->_('Liste des articles')]; + return [$this->_('Liste des articles'), + $this->_('Date de création'), + $this->_('Créateur')]; } - public function getItemsLabelAttrib() { - return 'titre'; + public function getItemsAttribs() { + return ['titre', 'date_creation', 'author-name']; } diff --git a/tests/application/modules/admin/controllers/CmsControllerListModeTest.php b/tests/application/modules/admin/controllers/CmsControllerListModeTest.php index fe98668bed8..a466d1e3ff4 100644 --- a/tests/application/modules/admin/controllers/CmsControllerListModeTest.php +++ b/tests/application/modules/admin/controllers/CmsControllerListModeTest.php @@ -58,6 +58,18 @@ class CmsControllerListModeAdminRootTest extends CmsControllerListModeTestCase { $this->assertXPath('//td//a[contains(@href, "bib/permissions/id/0")]', $this->_response->getBody()); } + + + /** @test */ + public function creationDateColumnShouldBePresent() { + $this->assertXPath('//th', 'Date de création'); + } + + + /** @test */ + public function authorColumnShouldBePresent() { + $this->assertXPath('//th', 'Auteur'); + } } -- GitLab