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

Merge branch 'hotline#31743_wrong_link_on_adding_cms_category' into 'stable'

Hotline#31743 wrong link on adding cms category

See merge request !1179
parents 86977b99 acd3beda
Branches
Tags
No related merge requests found
- ticket #31743 : Correction du lien d'edition et suppression des sous catégories en mode liste
\ No newline at end of file
......@@ -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) {
......
......@@ -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);
......
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