From 6521222deb21df89ba62fe5b92d25fcf8fc643bb Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Tue, 29 Mar 2011 16:26:39 +0200 Subject: RightCategories auch auf der Role Detail Seite --- application/modules/user/controllers/RoleController.php | 13 ++++++++++--- application/modules/user/views/scripts/role/show.phtml | 11 +++++++++-- 2 files changed, 19 insertions(+), 5 deletions(-) (limited to 'application/modules') diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php index 3db425f..3d8e0de 100644 --- a/application/modules/user/controllers/RoleController.php +++ b/application/modules/user/controllers/RoleController.php @@ -131,12 +131,20 @@ class User_RoleController extends Zend_Controller_Action if(count($rightroles) > 0) { foreach($rightroles as $rightrole) { $right = $this->rightMapper->find($rightrole['rightID']); - $rightsList[] = $right; + $rightsList[$right->getRightcategoryID()][] = $right; } if(is_array($rightsList)) { $this->view->rightsList = $rightsList; } } + $rightCategoryMapper = new Application_Model_RightCategoryMapper(); + $rightCategories = $rightCategoryMapper->fetchAll(); + if(count($rightCategories) > 0) { + foreach($rightCategories as $rightCategory) { + $rightcategorieslist[$rightCategory->getID()] = $rightCategory->getTitle(); + } + $this->view->rightcategorieslist = $rightcategorieslist; + } $this->view->role = $this->roleMapper->find($roleID); $this->view->roleID = $roleID; $this->view->userIDsNamespace = $this->userIDsNamespace; @@ -214,8 +222,7 @@ class User_RoleController extends Zend_Controller_Action } } if(!$found) { - $rightCategory = $right->getRightcategoryID(); - $rightlist[$rightCategory][] = $right; + $rightlist[$right->getRightcategoryID()][] = $right; } $found = false; } diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml index b99c1f8..0a7522a 100644 --- a/application/modules/user/views/scripts/role/show.phtml +++ b/application/modules/user/views/scripts/role/show.phtml @@ -34,8 +34,13 @@ if($this->roleID) { formButton('linkright', 'Add Right', array( 'onclick' => 'self.location="/user/role/linkright/roleID/' . $this->role->getID() .'"', 'class' => 'addbutton'))?> +
rightsList)) { - ?> + if(isset($this->rightcategorieslist)) { + foreach($this->rightcategorieslist as $k => $v) { + $rights = $this->rightsList[$k]; + ?> +

@@ -44,7 +49,7 @@ if($this->roleID) { rightsList as $right) { + foreach($rights as $right) { ?> @@ -66,6 +71,8 @@ if($this->roleID) { ?>
Title
getTitle(); ?>

-- cgit v1.2.3-55-g7522