summaryrefslogtreecommitdiffstats
path: root/application/modules/dev
diff options
context:
space:
mode:
authorBjörn Geiger2011-03-23 19:31:03 +0100
committerBjörn Geiger2011-03-23 19:31:03 +0100
commitf581446f90526dd3466becddd625d23bd1c26ed4 (patch)
tree22b5708100e6c71e7cbd3a567527dcfc013fca91 /application/modules/dev
parentseriel liegt jetzt im root/ (diff)
downloadpbs2-f581446f90526dd3466becddd625d23bd1c26ed4.tar.gz
pbs2-f581446f90526dd3466becddd625d23bd1c26ed4.tar.xz
pbs2-f581446f90526dd3466becddd625d23bd1c26ed4.zip
Rollenverwaltung in Dev Modul
Diffstat (limited to 'application/modules/dev')
-rw-r--r--application/modules/dev/controllers/AuthController.php1
-rw-r--r--application/modules/dev/controllers/GroupController.php3
-rw-r--r--application/modules/dev/controllers/RoleController.php237
-rw-r--r--application/modules/dev/forms/GroupAdd.php4
-rw-r--r--application/modules/dev/forms/GroupEdit.php6
-rw-r--r--application/modules/dev/forms/GroupLink.php2
-rw-r--r--application/modules/dev/forms/GroupSelect.php42
-rw-r--r--application/modules/dev/forms/LinkRight.php48
-rw-r--r--application/modules/dev/forms/PersonEdit.php4
-rw-r--r--application/modules/dev/forms/RoleAdd.php50
-rw-r--r--application/modules/dev/forms/RoleEdit.php51
-rw-r--r--application/modules/dev/views/scripts/role/add.phtml5
-rw-r--r--application/modules/dev/views/scripts/role/delete.phtml1
-rw-r--r--application/modules/dev/views/scripts/role/edit.phtml11
-rw-r--r--application/modules/dev/views/scripts/role/groupselect.phtml4
-rw-r--r--application/modules/dev/views/scripts/role/index.phtml62
-rw-r--r--application/modules/dev/views/scripts/role/linkright.phtml5
-rw-r--r--application/modules/dev/views/scripts/role/show.phtml68
-rw-r--r--application/modules/dev/views/scripts/role/unlinkright.phtml1
19 files changed, 579 insertions, 26 deletions
diff --git a/application/modules/dev/controllers/AuthController.php b/application/modules/dev/controllers/AuthController.php
index 8265c6e..b237e38 100644
--- a/application/modules/dev/controllers/AuthController.php
+++ b/application/modules/dev/controllers/AuthController.php
@@ -111,6 +111,7 @@ class dev_AuthController extends Zend_Controller_Action
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
$this->_helper->redirector('login', 'auth');
+ Zend_Session::forgetMe();
return;
}
diff --git a/application/modules/dev/controllers/GroupController.php b/application/modules/dev/controllers/GroupController.php
index c86e4fe..2770fd7 100644
--- a/application/modules/dev/controllers/GroupController.php
+++ b/application/modules/dev/controllers/GroupController.php
@@ -88,11 +88,11 @@ class dev_GroupController extends Zend_Controller_Action
$editForm = new dev_Form_GroupEdit($_POST);
if ($editForm->isValid($_POST)) {
$group = new Application_Model_Group($_POST);
+ $group->setID($this->_request->getParam('groupID'));
try {
$this->groupMapper->save($group);
} catch(Zend_Exception $e)
{
- echo "Email Address already existing.";
echo "Caught exception: " . get_class($e) . "<br/>";
echo "Message: " . $e->getMessage() . "<br/>";
return;
@@ -103,6 +103,7 @@ class dev_GroupController extends Zend_Controller_Action
}
$this->view->editForm = $editForm;
+
}
public function showAction()
diff --git a/application/modules/dev/controllers/RoleController.php b/application/modules/dev/controllers/RoleController.php
index 3b45a8c..709d623 100644
--- a/application/modules/dev/controllers/RoleController.php
+++ b/application/modules/dev/controllers/RoleController.php
@@ -2,49 +2,266 @@
class dev_RoleController extends Zend_Controller_Action
{
+ protected $roleMapper;
+ protected $rightMapper;
+ protected $rightRolesMapper;
public function init()
{
if (Zend_Auth::getInstance()->hasIdentity()) {
-
+ $this->roleMapper = new Application_Model_RoleMapper();
+ $this->rightMapper = new Application_Model_RightMapper();
+ $this->rightRolesMapper = new Application_Model_RightRolesMapper();
} else {
- $this->_redirect('/dev/login/auth');
+ $this->_helper->redirector('login', 'auth');
}
}
public function indexAction()
{
-
+ $roleNamespace = Zend_Session::namespaceGet('role');
+ if(isset($roleNamespace['groupID'])) {
+ $roleList = $this->roleMapper->findBy('groupID', $roleNamespace['groupID']);
+ $this->view->groupID = $roleNamespace['groupID'];
+ $this->view->roleList = $roleList;
+ } else {
+ $this->_helper->redirector('groupselect', 'role');
+ return;
+ }
}
public function addAction()
{
+ $roleNamespace = Zend_Session::namespaceGet('role');
+ if(isset($roleNamespace['groupID'])) {
+ if (!isset($_POST["add"])){
+ $addForm = new dev_Form_RoleAdd(array('rightlist' => $rightList));
+ } else {
+ $addForm = new dev_Form_RoleAdd(array('rightlist' => $rightList),$_POST);
+ if ($addForm->isValid($_POST)) {
+
+ $_POST['groupID'] = $roleNamespace['groupID'];
+ $role = new Application_Model_Role($_POST);
+ try {
+ $this->roleMapper->save($role);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_helper->redirector('', 'role');
+ return;
+ }
+ }
+ $this->view->addForm = $addForm;
+ } else {
+ $this->_helper->redirector('groupselect', 'role');
+ return;
+ }
}
public function editAction()
{
-
+ $roleID = $this->_request->getParam('roleID');
+ if(!isset($roleID)) {
+ $addForm = new dev_Form_RoleAdd();
+ $this->view->addForm = $addForm;
+ return;
+ }
+ if (!isset($_POST["save"])){
+ $role = $this->roleMapper->find($roleID);
+ $_POST['title'] = $role->getTitle();
+ $_POST['description'] = $role->getDescription();
+ $_POST['groupID'] = $role->getGroupID();
+ $editForm = new dev_Form_RoleEdit();
+ } else {
+ $editForm = new dev_Form_RoleEdit($_POST);
+ if ($editForm->isValid($_POST)) {
+ $role = new Application_Model_Role($_POST);
+ $role->setID($this->_request->getParam('roleID'));
+ try {
+ $this->roleMapper->save($role);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_helper->redirector('', 'role');
+ return;
+ }
+ }
+ $this->view->editForm = $editForm;
}
public function showAction()
{
-
+ $roleID = $this->_request->getParam('roleID');
+ if($roleID) {
+ $rightroles = $this->rightRolesMapper->findBy('roleID', $roleID);
+ if(count($rightroles) > 0) {
+ foreach($rightroles as $rightrole) {
+ $right = $this->rightMapper->find($rightrole['rightID']);
+ $rightsList[] = $right;
+ }
+ if(is_array($rightsList)) {
+ $this->view->rightsList = $rightsList;
+ }
+ }
+ $this->view->role = $this->roleMapper->find($roleID);
+ $this->view->roleID = $roleID;
+ } else {
+ $this->_helper->redirector('', 'role');
+ return;
+ }
}
public function deleteAction()
{
-
+ $this->_helper->viewRenderer->setNoRender();
+ $roleID = $this->_request->getParam('roleID');
+ if (isset($roleID)){
+ $role = $this->roleMapper->find($roleID);
+ try {
+ $this->roleMapper->delete($role);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_helper->redirector('', 'role');
+ return;
+ } else {
+ $this->_helper->redirector('', 'role');
+ return;
+ }
}
public function linkrightAction()
{
- // action body
+ $roleID = $this->_request->getParam('roleID');
+ if(isset($roleID)) {
+ $rightroles = $this->rightRolesMapper->findBy('roleID', $roleID);
+ $rights = $this->rightMapper->fetchAll();
+ if(count($rightroles) > 0) {
+ if(count($rights) > 0) {
+ foreach($rights as $right) {
+ foreach($rightroles as $rightrole) {
+ if($right->getID() == $rightrole['rightID']) {
+ $found = true;
+ break;
+ }
+ }
+ if(!$found) {
+ $rightlist[] = $right;
+ }
+ $found = false;
+ }
+ }
+ } else {
+ $rightlist = $rights;
+ }
+ if(count($rightlist) > 0) {
+ if (!isset($_POST["link"])){
+ $linkForm = new dev_Form_LinkRight(array('rightlist' => $rightlist, 'roleID' => $roleID));
+ } else {
+ $linkForm = new dev_Form_LinkRight(array('rightlist' => $rightlist),$_POST);
+ if ($linkForm->isValid($_POST)) {
+ $rightroles = new Application_Model_RightRoles();
+ $rightroles->setRightID($_POST['rightID']);
+ $rightroles->setRoleID($roleID);
+ try {
+ $this->rightRolesMapper->save($rightroles);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect('/dev/role/show/roleID/' . $roleID);
+ return;
+ }
+ }
+ $this->view->linkForm = $linkForm;
+ } else {
+ $this->_redirect('/dev/role/show/roleID/' . $roleID);
+ return;
+ }
+ } else {
+ $this->_helper->redirector('', 'role');
+ return;
+ }
}
public function unlinkrightAction()
{
- // action body
+ $this->_helper-> viewRenderer-> setNoRender();
+ $rightRolesID = $this->_request->getParam('rightrolesID');
+ if(isset($rightRolesID)) {
+ $rightRolesID = explode('-',$rightRolesID);
+ $roleID = $rightRolesID[0];
+ $rightID = $rightRolesID[1];
+ if (isset($roleID) && isset($rightID)){
+ $rightroles = new Application_Model_RightRoles();
+ $rightroles->setRoleID($roleID);
+ $rightroles->setRightID($rightID);
+ try {
+ $this->rightRolesMapper->delete($rightroles);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
+ }
+ $this->_redirect('/dev/role/show/roleID/' . $roleID);
+ return;
+ }
+ } else {
+ $this->_helper->redirector('', 'role');
+ return;
+ }
+ }
+
+ public function groupselectAction()
+ {
+ $roleNamespace = Zend_Session::namespaceGet('role');
+ if(isset($roleNamespace['groupID'])) {
+ $this->_helper->redirector('', 'role');
+ } else {
+ if(isset($_POST['selectgroup'])) {
+ $roleSession = new Zend_Session_Namespace('role');
+ $roleSession->groupID = $_POST['groupID'];
+ $this->_helper->redirector('', 'role');
+ return;
+ } else {
+ $personMapper = new Application_Model_PersonMapper();
+ $result = $personMapper->findBy('email', Zend_Auth::getInstance()->getIdentity());
+ $person = new Application_Model_Person($result[0]);
+ $person->setID($result[0]['personID']);
+ $membershipMapper = new Application_Model_MembershipMapper();
+ $memberships = $membershipMapper->findBy("personID",$person->getID());
+ $groupMapper = new Application_Model_GroupMapper();
+ if(isset($memberships)) {
+ foreach($memberships as $membership) {
+ $group = $groupMapper->find($membership['groupID']);
+ $groupList[] = $group;
+ }
+ }
+ $groupSelectForm = new dev_Form_GroupSelect(array('grouplist' => $groupList));
+ $this->view->groupSelectForm = $groupSelectForm;
+ }
+ }
+ }
+
+ public function changegroupAction()
+ {
+ $this->_helper-> viewRenderer-> setNoRender();
+ Zend_Session::namespaceUnset('role');
+ $this->_helper->redirector('groupselect', 'role');
+ return;
}
@@ -62,3 +279,7 @@ class dev_RoleController extends Zend_Controller_Action
+
+
+
+
diff --git a/application/modules/dev/forms/GroupAdd.php b/application/modules/dev/forms/GroupAdd.php
index f7636e7..a235b56 100644
--- a/application/modules/dev/forms/GroupAdd.php
+++ b/application/modules/dev/forms/GroupAdd.php
@@ -37,7 +37,7 @@ class dev_Form_GroupAdd extends Zend_Form
$groupfield ->setLabel('superordinated Group:');
$groupfield->addMultiOption('-1', '---- none ----');
-
+
if(count($this->grouplist)>0){
foreach($this->grouplist as $group => $g){
$groupfield->addMultiOption($g->getID(), $g->getTitle());
@@ -56,7 +56,7 @@ class dev_Form_GroupAdd extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/group/show"',
+ 'onclick' => 'location.href="/dev/group/"',
));
}
diff --git a/application/modules/dev/forms/GroupEdit.php b/application/modules/dev/forms/GroupEdit.php
index fb1ed03..f2f51a4 100644
--- a/application/modules/dev/forms/GroupEdit.php
+++ b/application/modules/dev/forms/GroupEdit.php
@@ -29,10 +29,6 @@ class dev_Form_GroupEdit extends Zend_Form
'value' => $_POST['description'],
));
- $this->addElement('hidden', 'groupID', array(
- 'value' => $_POST['groupID'],
- ));
-
$this->addElement('submit', 'save', array(
'required' => false,
'ignore' => true,
@@ -43,7 +39,7 @@ class dev_Form_GroupEdit extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/group/show"',
+ 'onclick' => 'location.href="/dev/group/"',
));
}
diff --git a/application/modules/dev/forms/GroupLink.php b/application/modules/dev/forms/GroupLink.php
index 05782c7..81c2dbe 100644
--- a/application/modules/dev/forms/GroupLink.php
+++ b/application/modules/dev/forms/GroupLink.php
@@ -46,7 +46,7 @@ class dev_Form_GroupLink extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/group/show"',
+ 'onclick' => 'location.href="/dev/group/"',
));
}
diff --git a/application/modules/dev/forms/GroupSelect.php b/application/modules/dev/forms/GroupSelect.php
new file mode 100644
index 0000000..1eaf455
--- /dev/null
+++ b/application/modules/dev/forms/GroupSelect.php
@@ -0,0 +1,42 @@
+<?php
+
+class dev_Form_GroupSelect extends Zend_Form
+{
+ private $grouplist;
+
+ public function setGrouplist($grouplist){
+ $this->grouplist = $grouplist;
+
+ }
+
+ public function getGrouplist(){
+ return $this->grouplist;
+ }
+
+ public function init()
+ {
+ $this->setName("GroupSelect");
+ $this->setMethod('post');
+
+ $groupfield = $this->createElement('select','groupID');
+ $groupfield ->setLabel('Group:');
+
+ if(count($this->grouplist)>0){
+ foreach($this->grouplist as $group => $g){
+ $groupfield->addMultiOption($g->getID(), $g->getTitle());
+ }
+ }
+
+ $groupfield->setRegisterInArrayValidator(false);
+ $this->addElement($groupfield);
+
+ $this->addElement('submit', 'selectgroup', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Select Group',
+ ));
+ }
+
+
+}
+
diff --git a/application/modules/dev/forms/LinkRight.php b/application/modules/dev/forms/LinkRight.php
new file mode 100644
index 0000000..8b9c3a9
--- /dev/null
+++ b/application/modules/dev/forms/LinkRight.php
@@ -0,0 +1,48 @@
+<?php
+
+class dev_Form_LinkRight extends Zend_Form
+{
+ private $rightlist;
+ private $roleID;
+
+ public function setRightlist($rightlist){
+ $this->rightlist = $rightlist;
+ }
+
+ public function setRoleID($roleID){
+ $this->roleID = $roleID;
+ }
+
+ public function init()
+ {
+ $this->setName("LinkRight");
+ $this->setMethod('post');
+
+ $rightfield = $this->createElement('select','rightID');
+ $rightfield ->setLabel('Right:');
+
+ if(count($this->rightlist)>0){
+ foreach($this->rightlist as $right => $r){
+ $rightfield->addMultiOption($r->getID(), $r->getTitle());
+ }
+ }
+ $rightfield->setRegisterInArrayValidator(false);
+ $this->addElement($rightfield);
+
+ $this->addElement('submit', 'link', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Add Right',
+ ));
+
+ $this->addElement('button', 'cancel', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Cancel',
+ 'onclick' => 'location.href="/dev/role/show/roleID/' . $this->roleID . '"',
+ ));
+ }
+
+
+}
+
diff --git a/application/modules/dev/forms/PersonEdit.php b/application/modules/dev/forms/PersonEdit.php
index 3baf4a6..aa39c34 100644
--- a/application/modules/dev/forms/PersonEdit.php
+++ b/application/modules/dev/forms/PersonEdit.php
@@ -7,7 +7,7 @@ class dev_Form_PersonEdit extends Zend_Form
{
$this->setName("PersonEdit");
$this->setMethod('post');
-
+
$this->addElement('text', 'title', array(
'filters' => array('StringTrim'),
'validators' => array(
@@ -108,7 +108,7 @@ class dev_Form_PersonEdit extends Zend_Form
'required' => false,
'ignore' => true,
'label' => 'Cancel',
- 'onclick' => 'location.href="/person/show"',
+ 'onclick' => 'location.href="/dev/person/"',
));
}
diff --git a/application/modules/dev/forms/RoleAdd.php b/application/modules/dev/forms/RoleAdd.php
new file mode 100644
index 0000000..d773b17
--- /dev/null
+++ b/application/modules/dev/forms/RoleAdd.php
@@ -0,0 +1,50 @@
+<?php
+
+class dev_Form_RoleAdd extends Zend_Form
+{
+ private $rightlist;
+
+ public function setRightlist($rightlist){
+ $this->rightlist = $rightlist;
+ }
+
+ public function init()
+ {
+ $this->setName("RoleAdd");
+ $this->setMethod('post');
+
+ $this->addElement('text', 'title', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => true,
+ 'label' => 'Title:',
+ ));
+
+ $this->addElement('text', 'description', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 140)),
+ ),
+ 'required' => false,
+ 'label' => 'Description:',
+ ));
+
+ $this->addElement('submit', 'add', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Add',
+ ));
+
+ $this->addElement('button', 'cancel', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Cancel',
+ 'onclick' => 'location.href="/dev/role/"',
+ ));
+ }
+
+
+}
+
diff --git a/application/modules/dev/forms/RoleEdit.php b/application/modules/dev/forms/RoleEdit.php
new file mode 100644
index 0000000..2c79050
--- /dev/null
+++ b/application/modules/dev/forms/RoleEdit.php
@@ -0,0 +1,51 @@
+<?php
+
+class dev_Form_RoleEdit extends Zend_Form
+{
+
+ public function init()
+ {
+ $this->setName("RoleEdit");
+ $this->setMethod('post');
+
+ $this->addElement('text', 'title', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 50)),
+ ),
+ 'required' => true,
+ 'label' => 'Title:',
+ 'value' => $_POST['title'],
+ ));
+
+ $this->addElement('text', 'description', array(
+ 'filters' => array('StringTrim'),
+ 'validators' => array(
+ array('StringLength', false, array(0, 140)),
+ ),
+ 'required' => false,
+ 'label' => 'Description:',
+ 'value' => $_POST['description'],
+ ));
+
+ $this->addElement('hidden', 'groupID', array(
+ 'value' => $_POST['groupID'],
+ ));
+
+ $this->addElement('submit', 'save', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Save',
+ ));
+
+ $this->addElement('button', 'cancel', array(
+ 'required' => false,
+ 'ignore' => true,
+ 'label' => 'Cancel',
+ 'onclick' => 'location.href="/dev/role/"',
+ ));
+ }
+
+
+}
+
diff --git a/application/modules/dev/views/scripts/role/add.phtml b/application/modules/dev/views/scripts/role/add.phtml
index 5277b9d..4f96cf0 100644
--- a/application/modules/dev/views/scripts/role/add.phtml
+++ b/application/modules/dev/views/scripts/role/add.phtml
@@ -1 +1,4 @@
-<br /><br /><center>View script for controller <b>Role</b> and script/action name <b>add</b></center> \ No newline at end of file
+<?php
+$this->addForm->setAction($this->url());
+echo $this->addForm;
+?> \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/role/delete.phtml b/application/modules/dev/views/scripts/role/delete.phtml
deleted file mode 100644
index 6b0ebf1..0000000
--- a/application/modules/dev/views/scripts/role/delete.phtml
+++ /dev/null
@@ -1 +0,0 @@
-<br /><br /><center>View script for controller <b>Role</b> and script/action name <b>delete</b></center> \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/role/edit.phtml b/application/modules/dev/views/scripts/role/edit.phtml
index c30d295..c976a90 100644
--- a/application/modules/dev/views/scripts/role/edit.phtml
+++ b/application/modules/dev/views/scripts/role/edit.phtml
@@ -1 +1,10 @@
-<br /><br /><center>View script for controller <b>Role</b> and script/action name <b>edit</b></center> \ No newline at end of file
+<?php
+if(isset($this->addForm)) {
+ $this->addForm->setAction('/etc/role/add');
+ echo $this->addForm;
+}
+else {
+ $this->editForm->setAction($this->url());
+ echo $this->editForm;
+}
+?>
diff --git a/application/modules/dev/views/scripts/role/groupselect.phtml b/application/modules/dev/views/scripts/role/groupselect.phtml
new file mode 100644
index 0000000..fe81758
--- /dev/null
+++ b/application/modules/dev/views/scripts/role/groupselect.phtml
@@ -0,0 +1,4 @@
+<?php
+$this->groupSelectForm->setAction($this->url());
+echo $this->groupSelectForm;
+?> \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/role/index.phtml b/application/modules/dev/views/scripts/role/index.phtml
index d30131e..59b66d7 100644
--- a/application/modules/dev/views/scripts/role/index.phtml
+++ b/application/modules/dev/views/scripts/role/index.phtml
@@ -1 +1,61 @@
-<br /><br /><center>View script for controller <b>Role</b> and script/action name <b>index</b></center> \ No newline at end of file
+<?php
+if($this->groupID) {
+ ?>
+<h1>Roles</h1>
+ <?php echo $this->formButton('addrole', 'Add Role', array(
+ 'onclick' => 'self.location="/dev/role/add"',
+ 'class' => 'addbutton'))?>
+<table>
+ <tr>
+ <th>Title</th>
+ <th colspan=3>Actions</th>
+ </tr>
+ <?php
+ $count = 0;
+ foreach($this->roleList as $role) {
+ ?>
+ <tr class="entry">
+ <td><?php echo $role['title'] ?></td>
+ <td class='action'><a
+ href="<?php echo $this->url(
+ array(
+ 'module' => 'dev',
+ 'controller' => 'role',
+ 'action' => 'show',
+ 'roleID' => $role['roleID']
+ ),
+ 'default',
+ true) ?>"> <img src='/media/img/show.png' alt='Show Group' /></a></td>
+ <td class='action'><a
+ href="<?php echo $this->url(
+ array(
+ 'module' => 'dev',
+ 'controller' => 'role',
+ 'action' => 'edit',
+ 'roleID' => $role['roleID']
+ ),
+ 'default',
+ true) ?>"> <img src='/media/img/edit.png' alt='Edit Group' /></a></td>
+ <td class='action'><a
+ href="<?php echo $this->url(
+ array(
+ 'module' => 'dev',
+ 'controller' => 'role',
+ 'action' => 'delete',
+ 'roleID' => $role['roleID']
+ ),
+ 'default',
+ true) ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a>
+ </td>
+ </tr>
+ <?php
+ $count++;
+ }
+ ?>
+</table>
+<?php echo $this->formButton('changeGroup', 'Change Group', array(
+ 'onclick' => 'self.location="/dev/role/changegroup"',
+ 'class' => 'rightbutton'))?>
+<?php
+}
+?> \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/role/linkright.phtml b/application/modules/dev/views/scripts/role/linkright.phtml
index bfba9db..94ad343 100644
--- a/application/modules/dev/views/scripts/role/linkright.phtml
+++ b/application/modules/dev/views/scripts/role/linkright.phtml
@@ -1 +1,4 @@
-<br /><br /><center>View script for controller <b>Role</b> and script/action name <b>linkright</b></center> \ No newline at end of file
+<?php
+$this->linkForm->setAction($this->url());
+echo $this->linkForm;
+?> \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/role/show.phtml b/application/modules/dev/views/scripts/role/show.phtml
index dcd232b..93f2782 100644
--- a/application/modules/dev/views/scripts/role/show.phtml
+++ b/application/modules/dev/views/scripts/role/show.phtml
@@ -1 +1,67 @@
-<br /><br /><center>View script for controller <b>Role</b> and script/action name <b>show</b></center> \ No newline at end of file
+<h1>Role Details</h1>
+<?php
+if($this->roleID) {
+ ?>
+ <?php echo $this->formButton('deleterole', 'Delete', array(
+ 'onclick' => 'self.location="/dev/role/delete/roleID/' . $this->role->getID() .'"',
+ 'class' => 'rightbutton'))?>
+ <?php echo $this->formButton('editrole', 'Edit', array(
+ 'onclick' => 'self.location="/dev/role/edit/roleID/' . $this->role->getID() .'"',
+ 'class' => 'rightbutton'))?>
+<span class="clear"></span>
+<table>
+ <tr>
+ <th>Title</th>
+ <th>Description</th>
+ </tr>
+ <tr class="entry">
+ <td><?php echo $this->role->getTitle(); ?></td>
+ <td><?php echo $this->role->getDescription(); ?></td>
+ </tr>
+</table>
+<br />
+<h2>Rights:</h2>
+ <?php echo $this->formButton('linkright', 'Add Right', array(
+ 'onclick' => 'self.location="/dev/role/linkright/roleID/' . $this->role->getID() .'"',
+ 'class' => 'addbutton'))?>
+ <?php if(isset($this->rightsList)) {
+ ?>
+<table>
+ <tr>
+ <th>Title</th>
+ <th>Description</th>
+ <th>Remove</th>
+ </tr>
+
+ <?php
+ foreach($this->rightsList as $right) {
+ ?>
+ <tr class="entry">
+ <td><?php echo $right->getTitle(); ?></td>
+ <td><?php echo $right->getDescription(); ?></td>
+ <td class='action'><a
+ href="<?php echo $this->url(
+ array(
+ 'module' => 'dev',
+ 'controller' => 'role',
+ 'action' => 'unlinkright',
+ 'rightrolesID' => $this->roleID . '-' . $right->getID(),
+ ),
+ 'default',
+ true) ?>"> <img src='/media/img/delete.png' alt='Remove Right' /></a>
+ </td>
+ </tr>
+ <?php
+ }
+ ?>
+</table>
+ <?php
+ } else {
+ ?>
+<br />
+<center>
+<h3>No Rights have been added!</h3>
+</center>
+ <?php
+ }
+} \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/role/unlinkright.phtml b/application/modules/dev/views/scripts/role/unlinkright.phtml
deleted file mode 100644
index 8c7615d..0000000
--- a/application/modules/dev/views/scripts/role/unlinkright.phtml
+++ /dev/null
@@ -1 +0,0 @@
-<br /><br /><center>View script for controller <b>Role</b> and script/action name <b>unlinkright</b></center> \ No newline at end of file