diff options
Diffstat (limited to 'application/modules/user/controllers/RoleController.php')
| -rw-r--r-- | application/modules/user/controllers/RoleController.php | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php index dcd00ef..d8ed9e6 100644 --- a/application/modules/user/controllers/RoleController.php +++ b/application/modules/user/controllers/RoleController.php @@ -220,6 +220,7 @@ class User_RoleController extends Zend_Controller_Action $rights = $this->rightMapper->fetchAll(); if(count($rightroles) > 0) { if(count($rights) > 0) { + $rightCategoryMapper = new Application_Model_RightCategoryMapper(); foreach($rights as $right) { foreach($rightroles as $rightrole) { if($right->getID() == $rightrole['rightID']) { @@ -228,7 +229,8 @@ class User_RoleController extends Zend_Controller_Action } } if(!$found) { - $rightlist[$right->getRightcategoryID()][] = $right; + $rightCategory = $rightCategoryMapper->find($right->getRightcategoryID()); + $rightlist[$rightCategory->getTitle()][$right->getID()] = $right->getTitle(); } $found = false; } @@ -237,22 +239,11 @@ 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, 'rightcategorieslist' => $rightcategorieslist, 'roleID' => $roleID)); + $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID)); } else { - $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, 'rightcategorieslist' => $rightcategorieslist, 'roleID' => $roleID), $_POST); + $linkForm = new user_Form_LinkRight(array('rightlist' => $rightlist, '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); |
