deptaction.phtml 2.59 KB
<?php
$resource = Adminx_Models_Dept_Client::getDeptResourceByDeptId($this->dept_id);
$havePurview = Adminx_Models_Profile_Client::getProfilePurview($this->pid, $this->dept_id);
$rolePurview = Adminx_Models_Profile_Purview::rolePurview($this->pid);
foreach($resource as $resourceKey =>$resourceVal){
    $resourceAction = Adminx_Models_Resource_Client::getResourceActionByResourceID($resourceVal['resource_id']);
    if(empty($resourceAction)){
        continue;
    }
    ?>
    <div class="form-group">
        <label class="col-md-help col-md-1 control-label" style="margin-top: 6px;">
            <?php echo $resourceVal['resource_name'];?>:
        </label>
        <div class="col-md-11">
            <?php
                foreach($resourceAction as $resourceActionKey=>$resourceActionVal){
                    $checked = '';
                    $uniformClass = '';
                    if(isset($havePurview[$resourceActionVal['id']])){
                        $checked = 'checked="checked"';
                        $uniformClass = 'checked';
                    }
            ?>
                <label class="checkbox-inline">
                    <div class="checker" id="uniform-profile_purview_<?php echo $this->dept_id.'_'.$resourceActionVal['id'];?>">
                        <?php if(isset( $rolePurview[$resourceActionVal['id']] )){ ?>
                            <span class="checked">
                                <input  checked="checked" disabled="disabled" type="checkbox" class="uniform">
                            </span>
                        <?php }else{ ?>
                            <span class="<?php echo $uniformClass;?>">
                                <input name="profile_purview[<?php echo $this->dept_id;?>][<?php echo $resourceVal['resource_id'];?>][]" <?php echo $checked;?> id="profile_purview_<?php echo $this->dept_id.'_'.$resourceActionVal['id'];?>" type="checkbox" class="uniform" value="<?php echo $resourceActionVal['id'];?>">
                            </span>
                        <?php }?>
                    </div>
                    <?php echo $resourceActionVal['action_name'];?>
                </label>
            <?php }?>
            <label class="checkbox-inline" id="expires_box_<?php echo $resourceVal['resource_id'];?>">
                <input type="text" class="form-control" name="purview_expires[<?php echo $resourceVal['resource_id'];?>]" id="expires_purview_<?php echo $resourceVal['resource_id'];?>" placeholder="过期时间" size="10">
            </label>
        </div>
    </div>
<?php }?>
<input type="hidden" name="dept_purview[]" value="<?php echo $this->dept_id;?>">