summaryrefslogblamecommitdiffstats
path: root/application/modules/user/views/scripts/group/show.phtml
blob: ea677ac3826792ca3064fb52f64b86ca4df9608d (plain) (tree)
1
2
3
4
5
6





                                                       






                                                                                                           


                      





























                                                                                                                                               







































                                                                                                            










                                                                                      






                                                                                   
                                                                                                                  
      










                                                                                                 
 

                                                                              















                                                                                                 
<?php
if($this->groupID) {
	if(isset($this->userIDsNamespace['groupID'])) {
		?>
<h1>Group</h1>
		<?php
		echo $this->formButton('deletegroup', 'Delete', array(
							'onclick' => 'self.location="/user/group/delete/"',
							'class' => 'rightbutton'));
		echo $this->formButton('editgroup', 'Edit', array(
							'onclick' => 'self.location="/user/group/edit/"',
							'class' => 'rightbutton'));
	} else {
		?>
<h1>Group Details</h1>
		<?php
		echo $this->formButton('deletegroup', 'Delete', array(
							'onclick' => 'self.location="/user/group/delete/groupID/' . $this->group->getID() .'"',
							'class' => 'rightbutton'));
		echo $this->formButton('editgroup', 'Edit', array(
							'onclick' => 'self.location="/user/group/edit/groupID/' . $this->group->getID() .'"',
							'class' => 'rightbutton'));
	}
	?>
<span class="clear"></span>
<table>
	<tr>
		<th>Title</th>
		<th>Description</th>
	</tr>
	<tr class="entry">
		<td><?php echo $this->group->getTitle(); ?></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 />
<h2>Requests:</h2>
<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 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="/user/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
	}
	?>
</table>
	<?php
	}
	if(isset($this->membersList)) {
		?>
<br />
<h2>Members:</h2>
<div class='listelement'><?php if(count($this->membersList)==0)
echo "This hroup has no members." ?> <?php foreach ($this->membersList as $member): ?>
<?php
$membershipID = $member['membershipID'];
$person = $member['person'];
$role = $member['role'];
?>
<div class='element'>
<div class='content'>
<div class='actions'><a
	href="<?php echo $this->url(
					array(
						'module'	=> 'user',
						'controller' => 'group',
						'action'     => 'revokeperson',
						'membershipID'   =>  $membershipID,
					),
					'default',
					true) ?>"> <img src='/media/img/delete.png' alt='Revoke Membership' /></a>
</div>
<div class='title'><?php echo $person->getFirstname(); ?> <?php echo $person->getName(); ?></div>
<div class='subtitle'>Role: <?php echo $role->getTitle(); ?></div>
<div class='details dispnone'><label>Email</label>
<div class='item'><?php echo $person->getEmail(); ?></div>
<label>City</label>
<div class='item'><?php echo $person->getCity(); ?></div>
</div>
</div>
<div class='clear'></div>
</div>
					<?php endforeach ?></div>

					<?php echo $this->memberPagination; ?>
					<?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>";
}
?>
<br />
<br />