rosehill/blocks/html/users/list.inc

64 lines
1.6 KiB
PHP

<?php
/**
* @copyright 2007-2014 City of Bloomington, Indiana
* @license http://www.gnu.org/licenses/agpl.txt GNU/AGPL, see LICENSE.txt
* @author Cliff Ingham <inghamn@bloomington.in.gov>
* @param Zend\Db\Sql\Select $users
*/
use Application\Models\Person;
use Blossom\Classes\View;
?>
<div class="interfaceBox">
<h2><?php
echo $this->_(['user','users',2]);
$helper = $this->template->getHelper('buttonLink');
if (Person::isAllowed('users')) {
echo $helper->buttonLink(BASE_URI.'/users/update', $this->_('create_account'), 'add');
}
?>
</h2>
<table>
<thead>
<tr><th></th>
<th><?php echo $this->_('username'); ?></th>
<th><?php echo $this->_('name'); ?></th>
<th><?php echo $this->_('authenticationMethod'); ?></th>
<th><?php echo $this->_('role'); ?></th>
<th></th>
</tr>
</thead>
<tbody>
<?php
foreach ($this->users as $user) {
$editButton = '';
$deleteButton = '';
if (Person::isAllowed('users')) {
$editButton = $helper->buttonLink(
BASE_URI.'/users/update?user_id='.$user->getId(),
$this->_('edit_account'),
'edit'
);
$deleteButton = $helper->buttonLink(
BASE_URI.'/users/delete?user_id='.$user->getId(),
$this->_('delete_account'),
'delete'
);
}
$name = View::escape($user->getFullname());
echo "
<tr><td>$editButton</td>
<td>{$user->getUsername()}</td>
<td>$name</td>
<td>{$user->getAuthenticationMethod()}</td>
<td>{$user->getRole()}</td>
<td>$deleteButton</td>
</tr>
";
}
?>
</tbody>
</table>
</div>