summaryrefslogtreecommitdiffstats
path: root/application/modules/dev/views/scripts/group/show.phtml
blob: addf3db63a16c5bbcb30e395bff838d712d5b006 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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>";
}