diff options
| author | Björn Geiger | 2011-03-29 16:03:30 +0200 |
|---|---|---|
| committer | Björn Geiger | 2011-03-29 16:03:30 +0200 |
| commit | ee4955f2e2ee60c55b055a1576b05759c63688d4 (patch) | |
| tree | 8d435486700a78f8aef75572ee89ad551a53d89f /application/modules/user/controllers/RoleController.php | |
| parent | Merge branch 'master' of ssh://git.openslx.org/lsfks/master-teamprojekt/pbs2 (diff) | |
| download | pbs2-ee4955f2e2ee60c55b055a1576b05759c63688d4.tar.gz pbs2-ee4955f2e2ee60c55b055a1576b05759c63688d4.tar.xz pbs2-ee4955f2e2ee60c55b055a1576b05759c63688d4.zip | |
Bei LinkRight werden nun die RightCategories angezeigt
Diffstat (limited to 'application/modules/user/controllers/RoleController.php')
| -rw-r--r-- | application/modules/user/controllers/RoleController.php | 18 |
1 files changed, 15 insertions, 3 deletions
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); |
