diff --git a/VERSIONS_HOTLINE/31743 b/VERSIONS_HOTLINE/31743 new file mode 100644 index 0000000000000000000000000000000000000000..646a2e910aed79d4e4e92cfcee73a0778eed8eac --- /dev/null +++ b/VERSIONS_HOTLINE/31743 @@ -0,0 +1 @@ + - ticket #31743 : Correction du lien d'edition et suppression des sous catégories en mode liste \ No newline at end of file diff --git a/library/ZendAfi/View/Helper/ModelActionsTable/ArticlesCategories.php b/library/ZendAfi/View/Helper/ModelActionsTable/ArticlesCategories.php index 8feffbd3713e3cb4698407b622b300e84b541bde..bdb451ed09c386f2a345f662d6c07bb82d86fa22 100644 --- a/library/ZendAfi/View/Helper/ModelActionsTable/ArticlesCategories.php +++ b/library/ZendAfi/View/Helper/ModelActionsTable/ArticlesCategories.php @@ -36,14 +36,13 @@ class ZendAfi_View_Helper_ModelActionsTable_ArticlesCategories extends ZendAfi_V ->hasParentPermissionOn(Class_Permission::createArticleCategory(), $model); }; - - $actions[] = ['url' => $this->_getUrlForAction('edit'), + $actions[] = ['url' => $this->_getUrlForAction('edit', true), 'icon' => 'ico/edit.gif', 'label' => 'Modifier', 'condition' => $parent_permission]; $actions[] = [ - 'url' => $this->_getUrlForAction('delete'), + 'url' => $this->_getUrlForAction('delete', true), 'icon' => 'ico/del.gif', 'label' => 'Supprimer', 'condition' => function($model) use ($parent_permission) { diff --git a/tests/application/modules/admin/controllers/CmsControllerListModeTest.php b/tests/application/modules/admin/controllers/CmsControllerListModeTest.php index 72043ba947ab5ebed5f3669de1c8e2ba2d2a5b28..4f2826968e12f8999a104f69b2dc9ab8510ce9c5 100644 --- a/tests/application/modules/admin/controllers/CmsControllerListModeTest.php +++ b/tests/application/modules/admin/controllers/CmsControllerListModeTest.php @@ -149,6 +149,37 @@ class CmsControllerListModeAdminBibRootWithoutPermissionsTest +class CmsControllerListModeAdminSubCategoryTest extends CmsControllerListModeTestCase { + public function setUp() { + parent::setUp(); + + $other_cat = $this->fixture('Class_ArticleCategorie', + ['id' => 452, + 'libelle' => 'Monkey', + 'parent_categorie' => $this->root_category, + ]); + + $group = Class_UserGroup::find(22); + Class_Permission::createArticleCategory()->permitTo($group, $this->root_category); + + $this->dispatch('/admin/cms/index/id_cat/1', true); + } + + + /** @test */ + public function categoryMonkeyEditLinkShouldBeCmsCategoryEditId23() { + $this->assertXPath('//td//a[contains(@href, "cms-category/edit/id/452")]'); + } + + + /** @test */ + public function categoryMonkeyDeleteLinkShouldBeCmsCategoryDeleteId23() { + $this->assertXPath('//td//a[contains(@href, "cms-category/delete/id/452")]'); + } +} + + + class CmsControllerListModeAdminBibSubCategoryTest extends CmsControllerListModeTestCase { public function setUp() { @@ -160,14 +191,16 @@ class CmsControllerListModeAdminBibSubCategoryTest 'titre' => 'Wtf', 'contenu' => 'Welcome', 'id_cat' => 1]); + $other_cat = $this->fixture('Class_ArticleCategorie', ['id' => 2, 'libelle' => 'Lyrics', 'parent_categorie' => $this->root_category, - ]); - $other_cat->setBib($this->annecy); + ]); + + $other_cat->setBib($this->annecy); $group = Class_UserGroup::find(22); - Class_ArticleCategorie::find(23)->setLibelle('Modes')->save(); + Class_ArticleCategorie::find(23)->setLibelle('Modes')->save(); Class_Permission::createArticle()->permitTo($group, $other_cat); Class_Permission::createArticleCategory()->permitTo($group, $other_cat);