<label><input type='checkbox' onclick='check(this,"tasks")'/> 部门权限</label>
<table class="widefat post" id="tasks">
<tr>
<?php foreach ($tasks as $key=>$task):?>
<td width="200px">

<label>
<input type="checkbox" name="assign[]" <?php if (is_array($hasoperations) && in_array($key, $hasoperations)):?>checked="checked"<?php endif;?> value="<?php echo $key;?>">
<?php $label = Label::getItemByName($key);?>
<?php if (!empty($label)):?>
    <?php echo $label.'|'.$key;?>
<?php else:?>
    <?php echo CHtml::link($key, '#', array('onclick'=>'openDialog("'.$key.'")'));?>
<?php endif;?>
</label>

 </td>
<?php if((++$i)%4==0):?>
 </tr>
  <tr>
 <?php endif;?>
 <?php endforeach;?>
  </tr>
</table>

