<?php

$this->breadcrumbs = array(
    $model->label(2) => array('index'),
    Yii::t('app', 'Manage'),
);

$this->menu = array(
   // array('label' => Yii::t('app', 'List') . ' ' . $model->label(2), 'url' => array('index')),
    array('label' => Yii::t('app', 'Create') . ' ' . $model->label(), 'url' => array('create'), 'visible' => Yii::app()->user->checkAccess('Bi:Report:Create')),
);


?>

    <h3><?php echo Yii::t('app', 'Manage') . ' ' . GxHtml::encode($model->label(2)); ?></h3>


    <script type="text/javascript">
        jQuery(function ($) {
            $("body").on("dblclick", ".grid-view tbody > tr", function (e) {
                window.location.href = $(this).find('.view').attr('href');
            });
        });
    </script>



<?php $this->widget('zii.widgets.grid.CGridView', array(
    'id' => 'report-grid',
    'dataProvider' => $model->search(),
    'template' => '{items}{summary}{pager}',
    'itemsCssClass' => 'table table-striped',
    'showTableOnEmpty' => true,
    'pager' => array(
        'class' => 'CLinkPager',
        'htmlOptions' => array('class' => 'pagination pagination-sm'),
        'selectedPageCssClass' => 'active',
        'header' => '',
    ),
    'filter' => $model,

    'columns' => array(
        // 'report_id',
        'name',
        'note',
        //	'sql_query',
        //	'pivot_config',
        //	'disable_edit',
        /*
        'date_range',
        'active',
        'order_number',
        'user_owner_id',
        'user_created_id',
        'user_last_modification_id',
        'time_last_modification',
        */
        array(
            'class' => 'DigButtonColumn',
            'header' => Yii::t('app', 'Administration'),
            'template'=>'{view}',
            'buttons' => array
            (
                'view' => array(
                    'visible' => "Yii::app()->user->checkAccess('Bi:Report:View')",
                ),
                'update' => array(
                    'visible' => "Yii::app()->user->checkAccess('Bi:Report:Update')",
                ),
                'delete' => array(
                    'visible' => " Yii::app()->user->checkAccess('Bi:Report:Delete')",
                ),

            ),

        ),
    ),
)); ?>