From ee4955f2e2ee60c55b055a1576b05759c63688d4 Mon Sep 17 00:00:00 2001 From: Björn Geiger Date: Tue, 29 Mar 2011 16:03:30 +0200 Subject: Bei LinkRight werden nun die RightCategories angezeigt --- .../modules/user/controllers/RoleController.php | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'application/modules/user/controllers/RoleController.php') diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php index 009524f..8f4d85c 100644 --- a/application/modules/user/controllers/RoleController.php +++ b/application/modules/user/controllers/RoleController.php @@ -214,7 +214,8 @@ class User_RoleController extends Zend_Controller_Action } } if(!$found) { - $rightlist[] = $right; + $rightCategory = $right->getRightcategoryID(); + $rightlist[$rightCategory][] = $right; } $found = false; } @@ -223,11 +224,22 @@ class User_RoleController extends Zend_Controller_Action $rightlist = $rights; } if(count($rightlist) > 0) { + $rightCategoryMapper = new Application_Model_RightCategoryMapper(); + $rightCategories = $rightCategoryMapper->fetchAll(); + if(count($rightCategories) > 0) { + foreach($rightCategories as $rightCategory) { + $rightcategorieslist[$rightCategory->getID()] = $rightCategory->getTitle(); + } + } if (!isset($_POST["link"])){ - $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID)); + $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'rightcategorieslist' => $rightcategorieslist, 'roleID' => $roleID)); } else { - $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID), $_POST); + $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'rightcategorieslist' => $rightcategorieslist, 'roleID' => $roleID), $_POST); if ($linkForm->isValid($_POST)) { + if(strpos($_POST['rightID'], 'category') !== false) { + $this->_redirect($_SERVER['HTTP_REFERER']); + return; + } $rightroles = new Application_Model_RightRoles(); $rightroles->setRightID($_POST['rightID']); $rightroles->setRoleID($roleID); -- cgit v1.2.3-55-g7522