summaryrefslogtreecommitdiffstats
path: root/application/modules/user/controllers/RoleController.php
diff options
context:
space:
mode:
authorBjörn Geiger2011-03-29 16:50:56 +0200
committerBjörn Geiger2011-03-29 16:50:56 +0200
commitd94330a3714271829fad03b878e3ca284ad95579 (patch)
tree4736ff48cd32701b844d67ae0779fe589bf680f6 /application/modules/user/controllers/RoleController.php
parentAdd Right nur anzeigen, wenn nicht schon alle Rechte vorhanden (diff)
downloadpbs2-d94330a3714271829fad03b878e3ca284ad95579.tar.gz
pbs2-d94330a3714271829fad03b878e3ca284ad95579.tar.xz
pbs2-d94330a3714271829fad03b878e3ca284ad95579.zip
Add Right Form Select mit optgroup
Diffstat (limited to 'application/modules/user/controllers/RoleController.php')
-rw-r--r--application/modules/user/controllers/RoleController.php19
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);