<?php

$this->widget('ext.PlGrid.PlGridView', array(
    'id' => 'advanced-queue-report-grid_' . $grid_key,
    'itemsCssClass' => 'plTable items',
    'dataProvider' => $model->getDataProvider($data),
    'filter' => $model,
    'enableSearchButton' => false,
    'enableAddButton' => false,
    'showNavbar' => false,
    'summaryText' => false,
    'showHelpBtn' => false,
    'headerTitle' => 'HEADER',
    'enableHeaderTranslation' => true,
    'navBarTitleAppend' => $model->getFormatedQueueName($data),
    'columns' => array(
        array(
            'header' => $model->getAttributeLabel('agent'),
            'value' => array($this, 'renderAgent'),
            'headerHtmlOptions' => array('data-translation-target' => 'ADVANCED_QUEUE_REPORT_AGENT_COLUMN'),
        ),
        array(
            'name' => 'incommingCalls',
            'header' => $model->getAttributeLabel('incommingCalls'),
            'headerHtmlOptions' => array('data-translation-id' => 'ADVANCED_QUEUE_REPORT_INCOMMING_CALLS'),
        ),
        array(
            'name' => 'acceptedCalls',
            'header' => $model->getAttributeLabel('acceptedCalls'),
            'headerHtmlOptions' => array('data-translation-id' => 'ADVANCED_QUEUE_REPORT_ACCEPTED_CALLS'),
        ),
        array(
            'name' => 'missedCalls',
            'header' => $model->getAttributeLabel('missedCalls'),
            'headerHtmlOptions' => array('data-translation-id' => 'ADVANCED_QUEUE_REPORT_MISSED_CALLS'),
        ),
        array(
            'name' => 'averageLatencyTime',
            'header' => $model->getAttributeLabel('averageLatencyTime'),
            'value' => array($this, 'renderDatetimeFormat'),
            'headerHtmlOptions' => array('data-translation-id' => 'ADVANCED_QUEUE_REPORT_AVERAGE_LATENCY_TIME'),
        ),
        array(
            'name' => 'averageCallDuration',
            'header' => $model->getAttributeLabel('averageCallDuration'),
            'value' => array($this, 'renderDatetimeFormat'),
            'headerHtmlOptions' => array('data-translation-id' => 'ADVANCED_QUEUE_REPORT_AVERAGE_CALL_DURATION'),
        ),
        array(
            'name' => 'readyTime',
            'header' => $model->getAttributeLabel('readyTime'),
            'value' => array($this, 'renderReadyTime'),
            'type' => 'raw',
            'headerHtmlOptions' => array(
                'title' => __('ADVANCED_QUEUE_REPORT_READY_TIME_TOOLTIP'),
                'data-translation-target' => 'ADVANCED_QUEUE_REPORT_READY_TIME_TRANSLATIONS'
            )
        ),
        array(
            'name' => 'callTime',
            'header' => $model->getAttributeLabel('callTime'),
            'value' => array($this, 'renderDatetimeFormat'),
            'headerHtmlOptions' => array('data-translation-id' => 'ADVANCED_QUEUE_REPORT_CALL_TIME'),
        ),
        array(
            'name' => 'successRate',
            'header' => $model->getAttributeLabel('successRate'),
            'value' => array($this, 'renderSuccessRateFormat'),
            'headerHtmlOptions' => array(
                'title' => __('ADVANCED_QUEUE_REPORT_SUCCESS_TOOLTIP'),
                'data-translation-target' => 'ADVANCED_QUEUE_REPORT_SUCCESS_RATE_TRANSLATIONS'
            ),
            'htmlOptions' => array('class' => 'successRateInPercent')
        ),
    ),
        )
);
