summaryrefslogtreecommitdiffstats
path: root/application/modules
diff options
context:
space:
mode:
authorBjörn Geiger2011-03-28 14:38:51 +0200
committerBjörn Geiger2011-03-28 14:38:51 +0200
commit49ebfec064bb6d7a732466fa2071778665beb184 (patch)
tree98895379ee4152b7312bc415cfc6e2f3dd305faf /application/modules
parentEinführung einer Rightcategory (diff)
downloadpbs2-49ebfec064bb6d7a732466fa2071778665beb184.tar.gz
pbs2-49ebfec064bb6d7a732466fa2071778665beb184.tar.xz
pbs2-49ebfec064bb6d7a732466fa2071778665beb184.zip
Einführung von Vererbung von Rollen
Diffstat (limited to 'application/modules')
-rw-r--r--application/modules/dev/controllers/RoleController.php1
-rw-r--r--application/modules/dev/forms/RoleAdd.php4
-rw-r--r--application/modules/dev/forms/RoleEdit.php19
-rw-r--r--application/modules/dev/views/scripts/role/show.phtml2
-rw-r--r--application/modules/user/controllers/GroupController.php12
-rw-r--r--application/modules/user/controllers/RoleController.php8
-rw-r--r--application/modules/user/forms/RoleAdd.php4
-rw-r--r--application/modules/user/forms/RoleEdit.php11
-rw-r--r--application/modules/user/views/scripts/role/show.phtml2
9 files changed, 56 insertions, 7 deletions
diff --git a/application/modules/dev/controllers/RoleController.php b/application/modules/dev/controllers/RoleController.php
index 709d623..65989b6 100644
--- a/application/modules/dev/controllers/RoleController.php
+++ b/application/modules/dev/controllers/RoleController.php
@@ -75,6 +75,7 @@ class dev_RoleController extends Zend_Controller_Action
$_POST['title'] = $role->getTitle();
$_POST['description'] = $role->getDescription();
$_POST['groupID'] = $role->getGroupID();
+ $_POST['inheritance'] = $role->getInheritance();
$editForm = new dev_Form_RoleEdit();
} else {
$editForm = new dev_Form_RoleEdit($_POST);
diff --git a/application/modules/dev/forms/RoleAdd.php b/application/modules/dev/forms/RoleAdd.php
index d773b17..7aae426 100644
--- a/application/modules/dev/forms/RoleAdd.php
+++ b/application/modules/dev/forms/RoleAdd.php
@@ -31,6 +31,10 @@ class dev_Form_RoleAdd extends Zend_Form
'label' => 'Description:',
));
+ $this->addElement('checkbox', 'inheritance', array(
+ 'label' => 'Inheritance:',
+ ));
+
$this->addElement('submit', 'add', array(
'required' => false,
'ignore' => true,
diff --git a/application/modules/dev/forms/RoleEdit.php b/application/modules/dev/forms/RoleEdit.php
index 2c79050..c0617b7 100644
--- a/application/modules/dev/forms/RoleEdit.php
+++ b/application/modules/dev/forms/RoleEdit.php
@@ -3,9 +3,9 @@
class dev_Form_RoleEdit extends Zend_Form
{
- public function init()
- {
- $this->setName("RoleEdit");
+ public function init()
+ {
+ $this->setName("RoleEdit");
$this->setMethod('post');
$this->addElement('text', 'title', array(
@@ -28,6 +28,17 @@ class dev_Form_RoleEdit extends Zend_Form
'value' => $_POST['description'],
));
+ if($_POST['inheritance'] == 1) {
+ $this->addElement('checkbox', 'inheritance', array(
+ 'label' => 'Inheritance:',
+ 'checked' => 'checked',
+ ));
+ } else {
+ $this->addElement('checkbox', 'inheritance', array(
+ 'label' => 'Inheritance:',
+ ));
+ }
+
$this->addElement('hidden', 'groupID', array(
'value' => $_POST['groupID'],
));
@@ -44,7 +55,7 @@ class dev_Form_RoleEdit extends Zend_Form
'label' => 'Cancel',
'onclick' => 'location.href="/dev/role/"',
));
- }
+ }
}
diff --git a/application/modules/dev/views/scripts/role/show.phtml b/application/modules/dev/views/scripts/role/show.phtml
index 93f2782..38e6023 100644
--- a/application/modules/dev/views/scripts/role/show.phtml
+++ b/application/modules/dev/views/scripts/role/show.phtml
@@ -13,10 +13,12 @@ if($this->roleID) {
<tr>
<th>Title</th>
<th>Description</th>
+ <th>Inheritance</th>
</tr>
<tr class="entry">
<td><?php echo $this->role->getTitle(); ?></td>
<td><?php echo $this->role->getDescription(); ?></td>
+ <td><?php if($this->role->getInheritance() == 1) echo "yes"; else echo "no"; ?></td>
</tr>
</table>
<br />
diff --git a/application/modules/user/controllers/GroupController.php b/application/modules/user/controllers/GroupController.php
index 3180ebd..1ceb844 100644
--- a/application/modules/user/controllers/GroupController.php
+++ b/application/modules/user/controllers/GroupController.php
@@ -110,7 +110,15 @@ class User_GroupController extends Zend_Controller_Action
echo "Message: " . $e->getMessage() . "<br/>";
return;
}
- $this->_helper->redirector('', 'group');
+ if(strpos($_SERVER['HTTP_REFERER'], '/user/group/show')) {
+ if(strpos($_SERVER['HTTP_REFERER'], '/groupID/')) {
+ $this->_redirect('/user/group/groupID/' . $groupID);
+ } else {
+ $this->_helper->redirector('show', 'group');
+ }
+ } else {
+ $this->_helper->redirector('showall', 'group');
+ }
return;
}
}
@@ -210,7 +218,7 @@ class User_GroupController extends Zend_Controller_Action
}
if(strpos($_SERVER['HTTP_REFERER'], '/user/group/show')) {
if(strpos($_SERVER['HTTP_REFERER'], '/groupID/')) {
- $this->_redirect('/user/group/show/groupID/' . $groupID);
+ $this->_redirect('/user/group/showall');
} else {
$this->_helper->redirector('changemembership', 'person');
}
diff --git a/application/modules/user/controllers/RoleController.php b/application/modules/user/controllers/RoleController.php
index b3795de..62d1550 100644
--- a/application/modules/user/controllers/RoleController.php
+++ b/application/modules/user/controllers/RoleController.php
@@ -76,10 +76,12 @@ class User_RoleController extends Zend_Controller_Action
$_POST['title'] = $role->getTitle();
$_POST['description'] = $role->getDescription();
$_POST['groupID'] = $role->getGroupID();
+ $_POST['inheritance'] = $role->getInheritance();
$editForm = new user_Form_RoleEdit(array('roleID' => $roleID));
} else {
$editForm = new user_Form_RoleEdit(array('roleID' => $roleID), $_POST);
if ($editForm->isValid($_POST)) {
+
$role = new Application_Model_Role($_POST);
$role->setID($this->_request->getParam('roleID'));
try {
@@ -90,7 +92,11 @@ class User_RoleController extends Zend_Controller_Action
echo "Message: " . $e->getMessage() . "<br/>";
return;
}
- $this->_helper->redirector('', 'role');
+ if(strpos($_SERVER['HTTP_REFERER'], '/user/role/show/roleID')) {
+ $this->_redirect('/user/role/show/roleID/' . $roleID);
+ } else {
+ $this->_helper->redirector('', 'role');
+ }
return;
}
}
diff --git a/application/modules/user/forms/RoleAdd.php b/application/modules/user/forms/RoleAdd.php
index 3b5200b..a7e43a7 100644
--- a/application/modules/user/forms/RoleAdd.php
+++ b/application/modules/user/forms/RoleAdd.php
@@ -31,6 +31,10 @@ class user_Form_RoleAdd extends Zend_Form
'label' => 'Description:',
));
+ $this->addElement('checkbox', 'inheritance', array(
+ 'label' => 'Inheritance:',
+ ));
+
$this->addElement('submit', 'add', array(
'required' => false,
'ignore' => true,
diff --git a/application/modules/user/forms/RoleEdit.php b/application/modules/user/forms/RoleEdit.php
index 170a2f9..848dba3 100644
--- a/application/modules/user/forms/RoleEdit.php
+++ b/application/modules/user/forms/RoleEdit.php
@@ -33,6 +33,17 @@ class user_Form_RoleEdit extends Zend_Form
'value' => $_POST['description'],
));
+ if($_POST['inheritance'] == 1) {
+ $this->addElement('checkbox', 'inheritance', array(
+ 'label' => 'Inheritance:',
+ 'checked' => 'checked',
+ ));
+ } else {
+ $this->addElement('checkbox', 'inheritance', array(
+ 'label' => 'Inheritance:',
+ ));
+ }
+
$this->addElement('hidden', 'groupID', array(
'value' => $_POST['groupID'],
));
diff --git a/application/modules/user/views/scripts/role/show.phtml b/application/modules/user/views/scripts/role/show.phtml
index 9abab1a..8213e73 100644
--- a/application/modules/user/views/scripts/role/show.phtml
+++ b/application/modules/user/views/scripts/role/show.phtml
@@ -13,10 +13,12 @@ if($this->roleID) {
<tr>
<th>Title</th>
<th>Description</th>
+ <th>Inheritance</th>
</tr>
<tr class="entry">
<td><?php echo $this->role->getTitle(); ?></td>
<td><?php echo $this->role->getDescription(); ?></td>
+ <td><?php if($this->role->getInheritance() == 1) echo "yes"; else echo "no"; ?></td>
</tr>
</table>
<br />