<?php $this->breadcrumbs = array( Yii::t('app', 'Users')=>array('index'), Yii::t('app', 'Manage') ); ?>
<?php $menu = array(); ?>
<?php $menu[] = array('label'=>Yii::t('app', 'Create User'),'url'=>array('create'),'auth'=>array('manage_users','user_create')); ?>
<?php $menu[] = array('label'=>Yii::t('app', 'Reset user\'s passwords'),'url'=>array('ResetPasswords'),'auth'=>array('manage_users','user_reset_password')); ?>
<?php $this->printMenu ( t('Actions') , $menu ); ?>
<h2><?php echo htmlspecialchars(Yii::t('app', 'Manage Users'),ENT_QUOTES,'UTF-8'); ?></h2>
<?php if($debug_string!==null) { ?>
  <pre>
    <?php echo htmlspecialchars($debug_string,ENT_QUOTES,'UTF-8'); ?>
  </pre>
<?php } ?>
<?php $this->widget('bootstrap.widgets.TbGridView',array('id'=>'user-grid','dataProvider'=>$model->search(),'filter'=>$model,'columns'=>array('username',array('name'=>'email','type'=>'raw','value'=>'isEmpty($data->email)?"":"<a href=\"mailto:{$data->email}\">{$data->email}</a>"'),array('name'=>'status', 'type'=>'raw', 'value'=>'SystemInfoHelper::getFullSwitchButtonLabel("user","switchActive",$data->id,$data->status=="active", "Active", "Inactive")'),array('name'=>'superuser', 'type'=>'raw', 'value'=>'SystemInfoHelper::getFullSwitchButtonLabel("user","switchSuperuser",$data->id,$data->superuser==1, "Enabled", "Disabled")', 'visible'=>user()->checkAccess('manage_superuser')),'first_name','last_name','matriculation_number','qualification',array('header'=>t('Last action'), 'type'=>'raw', 'value'=>'$data->LastActionTime == null ? t("Never") : SystemInfoHelper::getRecentTimeLabel($data->LastActionTime,"00-00-00 23:59:59")'),array('class'=>'bootstrap.widgets.TbButtonColumn','template'=>'{view} {update} {resetpassword} {delete}','buttons'=>array('resetpassword'=>array('label'=>'','url'=>"url('user/ResetPassword', array('id'=>\$data->id))",'visible'=>"user()->checkAccess('user_reset_password')",'options'=>array('class'=>'icon-refresh', 'title'=>t('Reset password')),),),),),)); ?>
