summaryrefslogtreecommitdiffstats
path: root/application/views/scripts/group
diff options
context:
space:
mode:
Diffstat (limited to 'application/views/scripts/group')
-rw-r--r--application/views/scripts/group/add.phtml4
-rw-r--r--application/views/scripts/group/delete.phtml6
-rw-r--r--application/views/scripts/group/edit.phtml10
-rw-r--r--application/views/scripts/group/grantperson.phtml11
-rw-r--r--application/views/scripts/group/index.phtml35
-rw-r--r--application/views/scripts/group/link.phtml4
-rw-r--r--application/views/scripts/group/revokeperson.phtml6
-rw-r--r--application/views/scripts/group/show.phtml122
8 files changed, 198 insertions, 0 deletions
diff --git a/application/views/scripts/group/add.phtml b/application/views/scripts/group/add.phtml
new file mode 100644
index 0000000..4f96cf0
--- /dev/null
+++ b/application/views/scripts/group/add.phtml
@@ -0,0 +1,4 @@
+<?php
+$this->addForm->setAction($this->url());
+echo $this->addForm;
+?> \ No newline at end of file
diff --git a/application/views/scripts/group/delete.phtml b/application/views/scripts/group/delete.phtml
new file mode 100644
index 0000000..fc96431
--- /dev/null
+++ b/application/views/scripts/group/delete.phtml
@@ -0,0 +1,6 @@
+<?php
+if(!isset($_POST['groupID'])) {
+ ?>
+<div>No group has been chosen.</div>
+ <?php
+} \ No newline at end of file
diff --git a/application/views/scripts/group/edit.phtml b/application/views/scripts/group/edit.phtml
new file mode 100644
index 0000000..64dde9d
--- /dev/null
+++ b/application/views/scripts/group/edit.phtml
@@ -0,0 +1,10 @@
+<?php
+if(isset($this->addForm)) {
+ $this->addForm->setAction('/group/add');
+ echo $this->addForm;
+}
+else {
+ $this->editForm->setAction($this->url());
+ echo $this->editForm;
+}
+?> \ No newline at end of file
diff --git a/application/views/scripts/group/grantperson.phtml b/application/views/scripts/group/grantperson.phtml
new file mode 100644
index 0000000..f15d08a
--- /dev/null
+++ b/application/views/scripts/group/grantperson.phtml
@@ -0,0 +1,11 @@
+<?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/views/scripts/group/index.phtml b/application/views/scripts/group/index.phtml
new file mode 100644
index 0000000..b8178dc
--- /dev/null
+++ b/application/views/scripts/group/index.phtml
@@ -0,0 +1,35 @@
+<table>
+ <tr>
+ <th>Title:</th>
+ <th>Functions:</th>
+ </tr>
+ <?php
+ $count = 0;
+ foreach($this->groupList as $group) {
+ ?>
+ <tr>
+ <td><?php echo $group->getTitle(); ?></td>
+ <td>
+ <form name="show<?php echo $count; ?>" action="/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>
+ </tr>
+ <?php
+ $count++;
+ }
+ ?>
+</table>
+<br />
+<div>
+<button onclick="location.href='/group/link'">Link Groups</button>
+</div>
diff --git a/application/views/scripts/group/link.phtml b/application/views/scripts/group/link.phtml
new file mode 100644
index 0000000..94ad343
--- /dev/null
+++ b/application/views/scripts/group/link.phtml
@@ -0,0 +1,4 @@
+<?php
+$this->linkForm->setAction($this->url());
+echo $this->linkForm;
+?> \ No newline at end of file
diff --git a/application/views/scripts/group/revokeperson.phtml b/application/views/scripts/group/revokeperson.phtml
new file mode 100644
index 0000000..6af5564
--- /dev/null
+++ b/application/views/scripts/group/revokeperson.phtml
@@ -0,0 +1,6 @@
+<?php
+if(!isset($_POST['membershipID'])) {
+ ?>
+<div>No Membership has been chosen.</div>
+ <?php
+} \ No newline at end of file
diff --git a/application/views/scripts/group/show.phtml b/application/views/scripts/group/show.phtml
new file mode 100644
index 0000000..addf3db
--- /dev/null
+++ b/application/views/scripts/group/show.phtml
@@ -0,0 +1,122 @@
+<?php
+if($_POST['groupID']) {
+ ?>
+<div align="right">
+<form name="editForm" action="/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="/group/delete/" method="post"><input
+ type="hidden" name="groupID"
+ value="<?php echo $this->group->getID(); ?>" /> <input type="submit"
+ name="delete" value="Delete" /></form>
+</div>
+<table>
+ <tr>
+ <td><b>Title:</b></td>
+ <td><?php echo $this->group->getTitle(); ?></td>
+ </tr>
+ <tr>
+ <td><b>Description:</b></td>
+ <td><?php echo $this->group->getDescription(); ?></td>
+ </tr>
+ <?php
+ if(isset($parentGroup) && is_object($parentGroup)) {
+ ?>
+ <tr>
+ <td><b>Superordinated Group:</b></td>
+ <td><?php echo $this->parentGroup->getTitle(); ?></td>
+ </tr>
+ <?php
+ }
+ ?>
+</table>
+ <?php
+ if(isset($this->groupRequestList)) {
+ ?>
+<br />
+<div>Grouprequests:</div>
+<br />
+<table>
+ <tr>
+ <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>
+ <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="/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>
+ </td>
+ </tr>
+ <?php
+ }
+ ?>
+</table>
+ <?php
+ }
+ if(isset($this->memberslist)) {
+ ?>
+<br />
+<div>Members:</div>
+<br />
+<table>
+ <tr>
+ <th>Firstname:</th>
+ <th>Name:</th>
+ <th>email:</th>
+ <th>city:</th>
+ <th></th>
+ </tr>
+
+ <?php
+ foreach($this->memberslist as $member) {
+ $membershipID = $member['membershipID'];
+ $person = $member['person'];
+ ?>
+ <tr>
+ <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="/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>
+ </tr>
+ <?php
+ }
+ ?>
+</table>
+ <?php
+ }
+} else {
+ ?>
+<div>No Group has been chosen.</div>
+ <?php
+}
+
+function printRoleSelect($roleList) {
+ if(!is_array($roleList)) {
+ return;
+ }
+ echo "<select name=\"roleID\">";
+ foreach($roleList as $role) {
+ echo "<option value=\"" . $role['roleID'] . "\">" . $role['title'] . "</option>";
+ }
+ echo "</select>";
+} \ No newline at end of file