
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
    'id'=>'manager-form',
    'enableAjaxValidation'=>false,
));
?>
<fieldset>
    <legend><?php echo $title;?></legend>

    <div>
        <table class="widefat post">
        <thead>
            <tr>
                <th>编号</th><th>角色名称</th><th>角色描述</th><th>用户列表</th><th>操作</th></tr>
        </thead>
        <tbody>
        <?php foreach ($tasks as $task):?>
        <tr>
            <td>
                <?php echo ++$i; ?>
            </td>
            <td>
                 <?php echo CHtml::link($task->name, array('taskassign','name'=>$task->name));?>
            </td>
            <td>
                <?php echo $task->description; ?>
            </td>
            <td width="500px">
                <?php foreach($users as $user):?>
                <?php if(Yii::app()->authManager->isAssigned($task->name,$user->username)):?>
                <?php echo CHtml::link($user->username,array('userassign','name'=>$user->username)); ?>
                <?php endif;?>
                <?php endforeach;?>
            </td>
            <td>
                <?php echo CHtml::link('权限维护',array('taskassign','name'=>$task->name));?>
                <?php echo CHtml::link('权限指派',array('authorityassign','name'=>$task->name));?>
            </td>
        </tr>
        <?php endforeach;?>
       </tbody>
    </table>
    </div>
</fieldset>
<?php $this->endWidget(); ?>
</div>
