summaryrefslogtreecommitdiffstats
path: root/application/modules/dev
diff options
context:
space:
mode:
authorBjörn Geiger2011-03-17 14:03:43 +0100
committerBjörn Geiger2011-03-17 14:03:43 +0100
commita26061089a91bf3a214d6a0dba9ffad8a7006a61 (patch)
tree718ef3992621aba600e39f877f9c9068e17662ca /application/modules/dev
parentClientMapper return value (diff)
downloadpbs2-a26061089a91bf3a214d6a0dba9ffad8a7006a61.tar.gz
pbs2-a26061089a91bf3a214d6a0dba9ffad8a7006a61.tar.xz
pbs2-a26061089a91bf3a214d6a0dba9ffad8a7006a61.zip
Person und Gruppen, Fehler korrigiert + Layout
Diffstat (limited to 'application/modules/dev')
-rw-r--r--application/modules/dev/controllers/AuthController.php10
-rw-r--r--application/modules/dev/controllers/GroupController.php61
-rw-r--r--application/modules/dev/controllers/PersonController.php50
-rw-r--r--application/modules/dev/views/scripts/auth/delete.phtml0
-rw-r--r--application/modules/dev/views/scripts/auth/index.phtml0
-rw-r--r--application/modules/dev/views/scripts/auth/logout.phtml1
-rw-r--r--application/modules/dev/views/scripts/bootos/index.phtml82
-rw-r--r--application/modules/dev/views/scripts/group/delete.phtml6
-rw-r--r--application/modules/dev/views/scripts/group/grantperson.phtml11
-rw-r--r--application/modules/dev/views/scripts/group/index.phtml58
-rw-r--r--application/modules/dev/views/scripts/group/revokeperson.phtml6
-rw-r--r--application/modules/dev/views/scripts/group/show.phtml91
-rw-r--r--application/modules/dev/views/scripts/person/index.phtml0
-rw-r--r--application/modules/dev/views/scripts/person/leave.phtml6
-rw-r--r--application/modules/dev/views/scripts/person/show.phtml94
15 files changed, 235 insertions, 241 deletions
diff --git a/application/modules/dev/controllers/AuthController.php b/application/modules/dev/controllers/AuthController.php
index 49640c0..8265c6e 100644
--- a/application/modules/dev/controllers/AuthController.php
+++ b/application/modules/dev/controllers/AuthController.php
@@ -13,13 +13,14 @@ class dev_AuthController extends Zend_Controller_Action
public function indexAction()
{
+ $this->_helper-> viewRenderer-> setNoRender();
$this->_helper->redirector('login', 'auth');
}
public function loginAction()
{
if (Zend_Auth::getInstance()->hasIdentity()) {
- print_a('Already logged in.');
+ $this->_redirect('/dev/');
} else {
if (!isset($_POST["login"])){
$loginForm = new dev_Form_AuthLogin();
@@ -61,7 +62,6 @@ class dev_AuthController extends Zend_Controller_Action
}
}
}
-
$this->view->loginForm = $loginForm;
}
}
@@ -101,16 +101,17 @@ class dev_AuthController extends Zend_Controller_Action
return;
}
}
-
$this->view->registerForm = $registerForm;
}
}
public function logoutAction()
{
+ $this->_helper-> viewRenderer-> setNoRender();
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
$this->_helper->redirector('login', 'auth');
+ return;
}
public function recoverpasswordAction()
@@ -141,12 +142,12 @@ class dev_AuthController extends Zend_Controller_Action
}
*/
}
-
$this->view->recoverPasswordForm = $recoverPasswordForm;
}
public function deleteAction()
{
+ $this->_helper-> viewRenderer-> setNoRender();
$result = $this->personmapper->findBy('email', Zend_Auth::getInstance()->getIdentity());
$person = $result[0];
$personID = $person["personID"];
@@ -164,6 +165,7 @@ class dev_AuthController extends Zend_Controller_Action
$auth = Zend_Auth::getInstance();
$auth->clearIdentity();
$this->_helper->redirector('login', 'auth');
+ return;
}
}
}
diff --git a/application/modules/dev/controllers/GroupController.php b/application/modules/dev/controllers/GroupController.php
index 1a063a7..c86e4fe 100644
--- a/application/modules/dev/controllers/GroupController.php
+++ b/application/modules/dev/controllers/GroupController.php
@@ -20,8 +20,9 @@ class dev_GroupController extends Zend_Controller_Action
$this->personmapper = new Application_Model_PersonMapper();
$this->rolemapper = new Application_Model_RoleMapper();
$this->groupList = $this->groupMapper->fetchAll();
- } else {
- $this->_redirect('/dev/login/auth');
+ } else {
+ $this->_helper->redirector('login', 'auth');
+ return;
}
}
@@ -62,7 +63,8 @@ class dev_GroupController extends Zend_Controller_Action
}
}
- echo "Group successfully added. <br/>";
+ $this->_helper->redirector('', 'group');
+ return;
}
}
@@ -71,13 +73,14 @@ class dev_GroupController extends Zend_Controller_Action
public function editAction()
{
- if(!isset($_POST['groupID'])) {
+ $groupID = $this->_request->getParam('groupID');
+ if(!isset($groupID)) {
$addForm = new dev_Form_GroupAdd(array('grouplist' => $this->groupList));
$this->view->addForm = $addForm;
return;
}
if (!isset($_POST["save"])){
- $group = $this->groupMapper->find($_POST['groupID']);
+ $group = $this->groupMapper->find($groupID);
$_POST['title'] = $group->getTitle();
$_POST['description'] = $group->getDescription();
$editForm = new dev_Form_GroupEdit();
@@ -94,7 +97,8 @@ class dev_GroupController extends Zend_Controller_Action
echo "Message: " . $e->getMessage() . "<br/>";
return;
}
- echo "Successfully saved. <br/>";
+ $this->_helper->redirector('', 'group');
+ return;
}
}
@@ -103,8 +107,9 @@ class dev_GroupController extends Zend_Controller_Action
public function showAction()
{
- if($_POST['groupID']) {
- $groupRequests = $this->groupRequestMapper->findBy('groupID', $_POST['groupID']);
+ $groupID = $this->_request->getParam('groupID');
+ if($groupID) {
+ $groupRequests = $this->groupRequestMapper->findBy('groupID', $groupID);
if(isset($groupRequests)) {
foreach($groupRequests as $groupRequest) {
$person = $this->personmapper->find($groupRequest['personID']);
@@ -113,10 +118,12 @@ class dev_GroupController extends Zend_Controller_Action
'person' => $person
);
}
- $this->view->groupRequestList = $groupRequestList;
- $this->view->roleList = $this->rolemapper->findBy('groupID', $_POST['groupID']);
+ if(is_array($groupRequestList)) {
+ $this->view->groupRequestList = $groupRequestList;
+ }
+ $this->view->roleList = $this->rolemapper->findBy('groupID', $groupID);
}
- $members = $this->membershipMapper->findBy('groupID', $_POST['groupID']);
+ $members = $this->membershipMapper->findBy('groupID', $groupID);
if(isset($members)) {
foreach($members as $member) {
$person = $this->personmapper->find($member['personID']);
@@ -125,15 +132,18 @@ class dev_GroupController extends Zend_Controller_Action
'person' => $person
);
}
- $this->view->memberslist = $membersList;
+ if(is_array($membersList)) {
+ $this->view->membersList = $membersList;
+ }
}
- $groupgroups = $this->groupGroupsMapper->findBy('groupID', $_POST['groupID']);
+ $groupgroups = $this->groupGroupsMapper->findBy('groupID', $groupID);
if(is_object($groupgroups)) {
$parentGroup = $this->groupMapper->find($groupgroups->getParentID());
$this->view->$parentGroup = $parentGroup;
}
- $group = $this->groupMapper->find($_POST['groupID']);
+ $group = $this->groupMapper->find($groupID);
$this->view->group = $group;
+ $this->view->groupID = $groupID;
}
}
@@ -156,7 +166,8 @@ class dev_GroupController extends Zend_Controller_Action
echo "Message: " . $e->getMessage() . "<br/>";
return;
}
- echo "Groups successfully linked. <br/>";
+ $this->_helper->redirector('', 'group');
+ return;
}
}
@@ -165,8 +176,10 @@ class dev_GroupController extends Zend_Controller_Action
public function deleteAction()
{
- if (isset($_POST["groupID"])){
- $group = $this->groupMapper->find($_POST["groupID"]);
+ $this->_helper->viewRenderer->setNoRender();
+ $groupID = $this->_request->getParam('groupID');
+ if (isset($groupID)){
+ $group = $this->groupMapper->find($groupID);
try {
$this->groupMapper->delete($group);
} catch(Zend_Exception $e)
@@ -175,12 +188,14 @@ class dev_GroupController extends Zend_Controller_Action
echo "Message: " . $e->getMessage() . "<br/>";
return;
}
- echo "Group successfully deleted. <br/>";
+ $this->_helper->redirector('', 'group');
+ return;
}
}
public function grantpersonAction()
{
+ $this->_helper->viewRenderer->setNoRender();
if(isset($_POST['grouprequestID']) && isset($_POST['roleID'])) {
$groupRequest = $this->groupRequestMapper->find($_POST['grouprequestID']);
try {
@@ -203,14 +218,16 @@ class dev_GroupController extends Zend_Controller_Action
echo "Message: " . $e->getMessage() . "<br/>";
return;
}
- echo "Chosen Person has been successfully added to the chosen group. <br />";
+ $this->_redirect("/dev/group/show/groupID/" . $groupRequest->getGroupID());
}
}
public function revokepersonAction()
{
- if(isset($_POST['membershipID'])) {
- $membership = $this->membershipMapper->find($_POST['membershipID']);
+ $this->_helper->viewRenderer->setNoRender();
+ $membershipID = $this->_request->getParam('membershipID');
+ if(isset($membershipID)) {
+ $membership = $this->membershipMapper->find($membershipID);
if(isset($membership)) {
try {
$this->membershipMapper->delete($membership);
@@ -220,7 +237,7 @@ class dev_GroupController extends Zend_Controller_Action
echo "Message: " . $e->getMessage() . "<br/>";
return;
}
- echo "Chosen Person has been successfully removed from the chosen group. <br />";
+ $this->_redirect("/dev/group/edit/groupID/" . $membership->getGroupID());
}
}
diff --git a/application/modules/dev/controllers/PersonController.php b/application/modules/dev/controllers/PersonController.php
index b7e050f..e422870 100644
--- a/application/modules/dev/controllers/PersonController.php
+++ b/application/modules/dev/controllers/PersonController.php
@@ -24,19 +24,24 @@ class dev_PersonController extends Zend_Controller_Action
foreach($this->memberships as $membership) {
$group = $this->groupMapper->find($membership['groupID']);
$this->groups[] = array (
- 'id' => $group->getID(),
- 'title' => $group->getTitle()
+ 'groupID' => $group->getID(),
+ 'title' => $group->getTitle(),
+ 'description' => $group->getDescription(),
+ 'membershipID' => $membership['membershipID']
);
}
}
} else {
- $this->_redirect('/dev/auth/login');
+ $this->_helper->redirector('login', 'auth');
+ return;
}
}
public function indexAction()
{
- $this->_redirect('/dev/person/show');
+ $this->_helper-> viewRenderer-> setNoRender();
+ $this->_helper->redirector('show', 'person');
+ return;
}
public function showAction()
@@ -69,10 +74,10 @@ class dev_PersonController extends Zend_Controller_Action
echo "Email Address already existing.";
return;
}
- echo "Successfully saved. <br/>";
+ $this->_helper->redirector('show', 'person');
+ return;
}
}
-
$this->view->editForm = $editForm;
}
@@ -112,7 +117,8 @@ class dev_PersonController extends Zend_Controller_Action
echo "Message: " . $e->getMessage() . "<br/>";
return;
}
- echo "Successfully requested. <br />";
+ $this->_helper->redirector('show', 'person');
+ return;
}
}
$this->view->requestForm = $requestForm;
@@ -120,24 +126,21 @@ class dev_PersonController extends Zend_Controller_Action
public function leaveAction()
{
+ $this->_helper-> viewRenderer-> setNoRender();
$this->view->person = $this->person;
- if(isset($_POST['groupID'])) {
- if(isset($this->memberships)) {
- foreach($this->memberships as $membership) {
- if($membership['groupID'] == $_POST['groupID']) {
- $membershipObject = $this->membershipMapper->find($membership['membershipID']);
- try {
- $this->membershipMapper->delete($membershipObject);
- } catch(Zend_Exception $e)
- {
- echo "Caught exception: " . get_class($e) . "<br/>";
- echo "Message: " . $e->getMessage() . "<br/>";
- return;
- }
- echo "You have been successfully removed from the chosen group. <br />";
- }
- }
+ $membershipID = $this->_request->getParam('membershipID');
+ if(isset($membershipID)) {
+ $membership = $this->membershipMapper->find($membershipID);
+ try {
+ $this->membershipMapper->delete($membership);
+ } catch(Zend_Exception $e)
+ {
+ echo "Caught exception: " . get_class($e) . "<br/>";
+ echo "Message: " . $e->getMessage() . "<br/>";
+ return;
}
+ $this->_helper->redirector('show', 'person');
+ return;
}
}
}
@@ -152,3 +155,4 @@ class dev_PersonController extends Zend_Controller_Action
+
diff --git a/application/modules/dev/views/scripts/auth/delete.phtml b/application/modules/dev/views/scripts/auth/delete.phtml
deleted file mode 100644
index e69de29..0000000
--- a/application/modules/dev/views/scripts/auth/delete.phtml
+++ /dev/null
diff --git a/application/modules/dev/views/scripts/auth/index.phtml b/application/modules/dev/views/scripts/auth/index.phtml
deleted file mode 100644
index e69de29..0000000
--- a/application/modules/dev/views/scripts/auth/index.phtml
+++ /dev/null
diff --git a/application/modules/dev/views/scripts/auth/logout.phtml b/application/modules/dev/views/scripts/auth/logout.phtml
deleted file mode 100644
index a709bd9..0000000
--- a/application/modules/dev/views/scripts/auth/logout.phtml
+++ /dev/null
@@ -1 +0,0 @@
-<br /><br /><center>View script for controller <b>Auth</b> and script/action name <b>logout</b></center> \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/bootos/index.phtml b/application/modules/dev/views/scripts/bootos/index.phtml
index 6462b1f..c5970b6 100644
--- a/application/modules/dev/views/scripts/bootos/index.phtml
+++ b/application/modules/dev/views/scripts/bootos/index.phtml
@@ -4,38 +4,39 @@
'class' => 'addbutton'))?>
<table>
- <tr>
- <th>ID</th>
- <th>Title</th>
- <th>GroupID</th>
- <th>MembershipID</th>
- <th>ConfigID</th>
- <th>Init</th>
- <th>Kernel</th>
- <th>Kcl</th>
- <th>Description</th>
- <th>Changed</th>
- <th>Expires</th>
- <th>Public</th>
- <th colspan=2>Actions</th>
- </tr>
- <?php if(count($this->bootoslist)==0)
- echo "</table> There are no BootOs's to display." ?>
- <?php foreach ($this->bootoslist as $bootos): ?>
- <tr class=entry>
- <td><?php echo $this->escape($bootos->getID()); ?></td>
- <td><?php echo $this->escape($bootos->getTitle()); ?></td>
- <td><?php echo $this->escape($bootos->getGroupID()); ?></td>
- <td><?php echo $this->escape($bootos->getMembershipID()); ?></td>
- <td><?php echo $this->escape($bootos->getConfigID()); ?></td>
- <td><?php echo $this->escape($bootos->getPath_init()); ?></td>
- <td><?php echo $this->escape($bootos->getPath_kernel()); ?></td>
- <td><?php echo $this->escape($bootos->getDefaultkcl()); ?></td>
- <td><?php echo $this->escape($bootos->getDescription()); ?></td>
- <td><?php echo $this->escape(date('Y-m-d H:i:s', $bootos->getCreated())); ?></td>
- <td><?php echo $this->escape($bootos->getExpires()); ?></td>
- <td><?php echo $this->escape($bootos->getPublic()); ?></td>
- <td class='action'><a href="<?php echo $this->url(
+ <tr>
+ <th>ID</th>
+ <th>Title</th>
+ <th>GroupID</th>
+ <th>MembershipID</th>
+ <th>ConfigID</th>
+ <th>Init</th>
+ <th>Kernel</th>
+ <th>Kcl</th>
+ <th>Description</th>
+ <th>Changed</th>
+ <th>Expires</th>
+ <th>Public</th>
+ <th colspan=2>Actions</th>
+ </tr>
+ <?php if(count($this->bootoslist)==0)
+ echo "</table> There are no BootOs's to display." ?>
+ <?php foreach ($this->bootoslist as $bootos): ?>
+ <tr class=entry>
+ <td><?php echo $this->escape($bootos->getID()); ?></td>
+ <td><?php echo $this->escape($bootos->getTitle()); ?></td>
+ <td><?php echo $this->escape($bootos->getGroupID()); ?></td>
+ <td><?php echo $this->escape($bootos->getMembershipID()); ?></td>
+ <td><?php echo $this->escape($bootos->getConfigID()); ?></td>
+ <td><?php echo $this->escape($bootos->getPath_init()); ?></td>
+ <td><?php echo $this->escape($bootos->getPath_kernel()); ?></td>
+ <td><?php echo $this->escape($bootos->getDefaultkcl()); ?></td>
+ <td><?php echo $this->escape($bootos->getDescription()); ?></td>
+ <td><?php echo $this->escape(date('Y-m-d H:i:s', $bootos->getCreated())); ?></td>
+ <td><?php echo $this->escape($bootos->getExpires()); ?></td>
+ <td><?php echo $this->escape($bootos->getPublic()); ?></td>
+ <td class='action'><a
+ href="<?php echo $this->url(
array(
'module' => 'dev',
'controller' => 'bootos',
@@ -43,8 +44,9 @@
'bootosID' => $bootos->getID()
),
'default',
- true, false) ?>"><img src='/media/img/edit.png' alt='Edit BootOS'/></a></td>
- <td class='action'><a href="<?php echo $this->url(
+ true, false) ?>"><img src='/media/img/edit.png' alt='Edit BootOS' /></a></td>
+ <td class='action'><a
+ href="<?php echo $this->url(
array(
'module' => 'dev',
'controller' => 'bootos',
@@ -52,13 +54,13 @@
'bootosID' => $bootos->getID()
),
'default',
- true) ?>"><img src='/media/img/delete.png' alt='Delete BootOS'/></a></td>
- </tr>
- <?php endforeach; ?>
+ true) ?>"><img src='/media/img/delete.png' alt='Delete BootOS' /></a></td>
+ </tr>
+ <?php endforeach; ?>
</table>
-
-
-
+
+
+
diff --git a/application/modules/dev/views/scripts/group/delete.phtml b/application/modules/dev/views/scripts/group/delete.phtml
deleted file mode 100644
index fc96431..0000000
--- a/application/modules/dev/views/scripts/group/delete.phtml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-if(!isset($_POST['groupID'])) {
- ?>
-<div>No group has been chosen.</div>
- <?php
-} \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/group/grantperson.phtml b/application/modules/dev/views/scripts/group/grantperson.phtml
deleted file mode 100644
index f15d08a..0000000
--- a/application/modules/dev/views/scripts/group/grantperson.phtml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?php
-if(!isset($_POST['grouprequestID'])) {
- ?>
-<div>No Request has been chosen.</div>
- <?php
-}
-if(!isset($_POST['roleID'])) {
- ?>
-<div>No Role has been chosen.</div>
- <?php
-} \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/group/index.phtml b/application/modules/dev/views/scripts/group/index.phtml
index 714498e..a3d1269 100644
--- a/application/modules/dev/views/scripts/group/index.phtml
+++ b/application/modules/dev/views/scripts/group/index.phtml
@@ -1,27 +1,48 @@
+<h1>Groups</h1>
+<?php echo $this->formButton('addgroup', 'Add Group', array(
+ 'onclick' => 'self.location="/dev/group/add"',
+ 'class' => 'addbutton'))?>
<table>
<tr>
- <th>Title:</th>
- <th>Functions:</th>
+ <th>Title</th>
+ <th colspan=3>Actions</th>
</tr>
<?php
$count = 0;
foreach($this->groupList as $group) {
?>
- <tr>
+ <tr class="entry">
<td><?php echo $group->getTitle(); ?></td>
- <td>
- <form name="show<?php echo $count; ?>" action="/dev/group/show"
- method="post"><input type="hidden" name="groupID"
- value="<?php echo $group->getID(); ?>" /><a
- href="javascript:document.show<?php echo $count; ?>.submit();">Details</a></form>
- <form name="edit<?php echo $count; ?>" action="/group/edit"
- method="post"><input type="hidden" name="groupID"
- value="<?php echo $group->getID(); ?>" /><a
- href="javascript:document.edit<?php echo $count; ?>.submit();">Edit</a></form>
- <form name="delete<?php echo $count; ?>" action="/group/delete"
- method="post"><input type="hidden" name="groupID"
- value="<?php echo $group->getID(); ?>" /><a
- href="javascript:document.delete<?php echo $count; ?>.submit();">Delete</a></form>
+ <td class='action'><a
+ href="<?php echo $this->url(
+ array(
+ 'module' => 'dev',
+ 'controller' => 'group',
+ 'action' => 'show',
+ 'groupID' => $group->getID()
+ ),
+ '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' => 'group',
+ 'action' => 'edit',
+ 'groupID' => $group->getID()
+ ),
+ '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' => 'group',
+ 'action' => 'delete',
+ 'groupID' => $group->getID()
+ ),
+ 'default',
+ true) ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a>
</td>
</tr>
<?php
@@ -29,7 +50,8 @@
}
?>
</table>
-<br />
<div>
-<button onclick="location.href='/dev/group/link'">Link Groups</button>
+<?php echo $this->formButton('linkgroups', 'Link Groups', array(
+ 'onclick' => 'self.location="/dev/group/link"',
+ 'class' => 'addbutton'))?>
</div>
diff --git a/application/modules/dev/views/scripts/group/revokeperson.phtml b/application/modules/dev/views/scripts/group/revokeperson.phtml
deleted file mode 100644
index 6af5564..0000000
--- a/application/modules/dev/views/scripts/group/revokeperson.phtml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-if(!isset($_POST['membershipID'])) {
- ?>
-<div>No Membership has been chosen.</div>
- <?php
-} \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/group/show.phtml b/application/modules/dev/views/scripts/group/show.phtml
index 7b3660d..f8fbe1e 100644
--- a/application/modules/dev/views/scripts/group/show.phtml
+++ b/application/modules/dev/views/scripts/group/show.phtml
@@ -1,23 +1,21 @@
+<h1>Group Details</h1>
<?php
-if($_POST['groupID']) {
+if($this->groupID) {
?>
-<div align="right">
-<form name="editForm" action="/dev/group/edit/" method="post"><input
- type="hidden" name="groupID"
- value="<?php echo $this->group->getID(); ?>" /> <input type="submit"
- name="edit" value="Edit" /></form>
-<form name="deleteForm" action="/dev/group/delete/" method="post"><input
- type="hidden" name="groupID"
- value="<?php echo $this->group->getID(); ?>" /> <input type="submit"
- name="delete" value="Delete" /></form>
-</div>
+ <?php echo $this->formButton('deletegroup', 'Delete', array(
+ 'onclick' => 'self.location="/dev/group/delete/groupID/' . $this->group->getID() .'"',
+ 'class' => 'rightbutton'))?>
+ <?php echo $this->formButton('editgroup', 'Edit', array(
+ 'onclick' => 'self.location="/dev/group/edit/groupID/' . $this->group->getID() .'"',
+ 'class' => 'rightbutton'))?>
+<span class="clear"></span>
<table>
<tr>
- <td><b>Title:</b></td>
- <td><?php echo $this->group->getTitle(); ?></td>
+ <th>Title</th>
+ <th>Description</th>
</tr>
- <tr>
- <td><b>Description:</b></td>
+ <tr class="entry">
+ <td><?php echo $this->group->getTitle(); ?></td>
<td><?php echo $this->group->getDescription(); ?></td>
</tr>
<?php
@@ -35,30 +33,31 @@ if($_POST['groupID']) {
if(isset($this->groupRequestList)) {
?>
<br />
-<div>Grouprequests:</div>
-<br />
+<h2>Requests:</h2>
<table>
<tr>
- <th>Firstname:</th>
- <th>Name:</th>
- <th>email:</th>
- <th>city:</th>
- <th>grant:</th>
+ <th>Firstname</th>
+ <th>Name</th>
+ <th>email</th>
+ <th>city</th>
+ <th>grant</th>
</tr>
<?php
foreach($this->groupRequestList as $grouprequest) {
$grouprequestID = $grouprequest['grouprequestID'];
$person = $grouprequest['person'];
?>
- <tr>
+ <tr class="entry">
<td><?php echo $person->getFirstname(); ?></td>
<td><?php echo $person->getName(); ?></td>
<td><?php echo $person->getEmail(); ?></td>
<td><?php echo $person->getCity(); ?></td>
<td>
- <form action="/dev/group/grantperson" method="post"><input type="hidden"
- name="grouprequestID" value="<?php echo $grouprequestID; ?>" /> <?php printRoleSelect($this->roleList); ?>
- <input type="submit" name="confirm" value="confirm" /></form>
+ <form action="/dev/group/grantperson" method="post"><input
+ type="hidden" name="grouprequestID"
+ value="<?php echo $grouprequestID; ?>" /> <?php printRoleSelect($this->roleList); ?>
+ <input type="image" src='/media/img/save.png' alt='Grant Person'
+ name="confirm" value="confirm" /></form>
</td>
</tr>
<?php
@@ -67,35 +66,39 @@ if($_POST['groupID']) {
</table>
<?php
}
- if(isset($this->memberslist)) {
+ if(isset($this->membersList)) {
?>
<br />
-<div>Members:</div>
-<br />
+<h2>Members:</h2>
<table>
<tr>
- <th>Firstname:</th>
- <th>Name:</th>
- <th>email:</th>
- <th>city:</th>
- <th></th>
+ <th>Firstname</th>
+ <th>Name</th>
+ <th>email</th>
+ <th>city</th>
+ <th>revoke</th>
</tr>
<?php
- foreach($this->memberslist as $member) {
+ foreach($this->membersList as $member) {
$membershipID = $member['membershipID'];
$person = $member['person'];
?>
- <tr>
+ <tr class="entry">
<td><?php echo $person->getFirstname(); ?></td>
<td><?php echo $person->getName(); ?></td>
<td><?php echo $person->getEmail(); ?></td>
<td><?php echo $person->getCity(); ?></td>
- <td>
- <form action="/dev/group/revokeperson" method="post"><input type="hidden"
- name="membershipID" value="<?php echo $membershipID; ?>" /><input
- type="hidden" name="personID" value="<?php echo $person->getID(); ?>" />
- <input type="submit" name="revoke" value="revoke" /></form>
+ <td class='action'><a
+ href="<?php echo $this->url(
+ array(
+ 'module' => 'dev',
+ 'controller' => 'group',
+ 'action' => 'revokeperson',
+ 'membershipID' => $membershipID,
+ ),
+ 'default',
+ true) ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a>
</td>
</tr>
<?php
@@ -104,10 +107,6 @@ if($_POST['groupID']) {
</table>
<?php
}
-} else {
- ?>
-<div>No Group has been chosen.</div>
- <?php
}
function printRoleSelect($roleList) {
@@ -120,3 +119,5 @@ function printRoleSelect($roleList) {
}
echo "</select>";
}
+?>
+<br /><br /><br /><br /><br /> \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/person/index.phtml b/application/modules/dev/views/scripts/person/index.phtml
deleted file mode 100644
index e69de29..0000000
--- a/application/modules/dev/views/scripts/person/index.phtml
+++ /dev/null
diff --git a/application/modules/dev/views/scripts/person/leave.phtml b/application/modules/dev/views/scripts/person/leave.phtml
deleted file mode 100644
index fc96431..0000000
--- a/application/modules/dev/views/scripts/person/leave.phtml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?php
-if(!isset($_POST['groupID'])) {
- ?>
-<div>No group has been chosen.</div>
- <?php
-} \ No newline at end of file
diff --git a/application/modules/dev/views/scripts/person/show.phtml b/application/modules/dev/views/scripts/person/show.phtml
index 945bb61..b0c6fc1 100644
--- a/application/modules/dev/views/scripts/person/show.phtml
+++ b/application/modules/dev/views/scripts/person/show.phtml
@@ -1,70 +1,45 @@
-<div align="right">
-<button onclick="location.href='/dev/person/edit'">Edit</button>
-</div>
-<table>
- <tr>
- <td><b>Title:</b></td>
- <td><?php echo $this->person->getTitle(); ?></td>
- </tr>
- <tr>
- <td><b>Name:</b></td>
- <td><?php echo $this->person->getName(); ?></td>
- </tr>
- <tr>
- <td><b>Firstname:</b></td>
- <td><?php echo $this->person->getFirstname(); ?></td>
- </tr>
- <tr>
- <td><b>Street:</b></td>
- <td><?php echo $this->person->getStreet(); ?></td>
- </tr>
- <tr>
- <td><b>Housenumber:</b></td>
- <td><?php echo $this->person->getHousenumber(); ?></td>
- </tr>
- <tr>
- <td><b>City:</b></td>
- <td><?php echo $this->person->getCity(); ?></td>
- </tr>
- <tr>
- <td><b>Postalcode:</b></td>
- <td><?php echo $this->person->getPostalcode(); ?></td>
- </tr>
- <tr>
- <td><b>Email:</b></td>
- <td><?php echo $this->person->getEmail(); ?></td>
- </tr>
- <tr>
- <td><b>Last Login Date:</b></td>
- <td><?php if( $this->person->getLogindate()) echo date ('d. F Y - H:i', $this->person->getLogindate()); ?> Uhr</td>
- </tr>
- <tr>
- <td><b>Register Date:</b></td>
- <td><?php echo date ('d. F Y - H:i', $this->person->getRegisterdate()); ?> Uhr</td>
- </tr>
-</table>
+<h1>Person</h1>
+<?php echo $this->formButton('editperson', 'Edit', array(
+ 'onclick' => 'self.location="/dev/person/edit/"',
+ 'class' => 'rightbutton'))?>
+<br /><br />
+<div class="personColorDiv"><span class="bold">Title:</span>&nbsp;<?php echo $this->person->getTitle(); ?></div>
+<div class="personDiv"><span class="bold">Name:</span>&nbsp;<?php echo $this->person->getName(); ?></div>
+<div class="personColorDiv"><span class="bold">Firstname:</span>&nbsp;<?php echo $this->person->getFirstname(); ?></div>
+<div class="personDiv"><span class="bold">Street:</span>&nbsp;<?php echo $this->person->getStreet(); ?></div>
+<div class="personColorDiv"><span class="bold">Housenumber:</span>&nbsp;<?php echo $this->person->getHousenumber(); ?></div>
+<div class="personDiv"><span class="bold">City:</span>&nbsp;<?php echo $this->person->getCity(); ?></div>
+<div class="personColorDiv"><span class="bold">Postalcode:</span>&nbsp;<?php echo $this->person->getPostalcode(); ?></div>
+<div class="personDiv"><span class="bold">Email:</span>&nbsp;<?php echo $this->person->getEmail(); ?></div>
+<div class="personColorDiv"><span class="bold">Last Login Date:</span>&nbsp;<?php if( $this->person->getLogindate()) echo date ('d. F Y - H:i', $this->person->getLogindate()) . " Uhr"; ?></div>
+<div class="personDiv"><span class="bold">Register Date:</span>&nbsp;<?php echo date ('d. F Y - H:i', $this->person->getRegisterdate()) . ' Uhr'; ?></div>
<?php
if(isset($this->groups)) {
?>
<br />
-<div>Member in the following Groups:</div>
-<br />
+<h2>Member in the following Groups:</h2>
<table>
<?php
foreach($this->groups as $group) {
?>
<tr>
<th>Title</th>
- <th>Functions</th>
+ <th>Description</th>
+ <th>Leave</th>
</tr>
<tr>
<td><?php echo $group['title']; ?></td>
- <td>
- <form name="leaveGroup<?php echo $group['id']; ?>"
- action="/dev/person/leave/" method="post"><input type="hidden"
- name="groupID" value="<?php echo $group['id']; ?>" /> <a
- href="javascript:document.leaveGroup<?php echo $group['id']; ?>.submit();">Remove
- Membership</a></form>
+ <td><?php echo $group['description']; ?></td>
+ <td class='action'><a
+ href="<?php echo $this->url(
+ array(
+ 'module' => 'dev',
+ 'controller' => 'person',
+ 'action' => 'leave',
+ 'membershipID' => $group['membershipID']
+ ),
+ 'default',
+ true) ?>"> <img src='/media/img/delete.png' alt='Delete Group' /></a>
</td>
</tr>
<?php
@@ -72,8 +47,9 @@ foreach($this->groups as $group) {
}
?>
</table>
-<br />
-<div>
-<button onclick="location.href='/dev/person/request'">Add to additional
-Groups</button>
-</div>
+<?php echo $this->formButton('addtogroup', 'Add to additional
+Groups', array(
+ 'onclick' => 'self.location="/dev/person/request/"',
+ 'class' => 'addbutton'));
+?>
+<br /><br /><br /><br /><br /> \ No newline at end of file