<?php $can_edit = (bool) Yii::app()->user->checkAccess("D2tasks.TcmnCommunication.Update"); $bft = !$can_edit ? 'false' : 'true'; $tcmn_model = new TcmnCommunication(); $tcmn_model->tcmn_ttsk_id = $model->primaryKey; // render grid view $this->widget('TbGridView', array('id' => 'tcmn-communication-grid', 'dataProvider' => $tcmn_model->search(), 'template' => '{summary}{items}', 'rowCssClassExpression' => '$data->tcmnTcst->tcst_css_class', 'summaryText' => ' ', 'htmlOptions' => array('class' => 'rel-grid-view'), 'columns' => array(array('class' => 'editable.EditableColumn', 'name' => 'tcmn_pprs_id', 'value' => !$can_edit ? '!empty($data->tcmn_pprs_id)?$data->tcmnPprs->itemLabel:" - "' : '', 'editable' => array('type' => 'select', 'url' => $this->createUrl('//d2tasks/tcmnCommunication/editableSaver'), 'source' => CHtml::listData(PprsPerson::model()->getSysCompanyPersons(), 'pprs_id', 'itemLabel'), 'placement' => 'right', 'apply' => $can_edit)), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_client_pprs_id', 'value' => !$can_edit ? '!empty($data->tcmn_client_pprs_id)?$data->tcmnClientPprs->itemLabel:" - "' : '', 'editable' => array('type' => 'select', 'url' => $this->createUrl('//d2tasks/tcmnCommunication/editableSaver'), 'source' => CHtml::listData(PprsPerson::model()->getCompanyPersons($model->ttsk_ccmp_id), 'pprs_id', 'itemLabel'), 'apply' => $can_edit)), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_task', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('//d2tasks/tcmnCommunication/editableSaver'), 'apply' => $can_edit)), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_result', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('//d2tasks/tcmnCommunication/editableSaver'), 'apply' => $can_edit)), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_tcst_id', 'value' => '!empty($data->tcmn_tcst_id)?$data->tcmnTcst->itemLabel:" - "', 'editable' => array('type' => 'select', 'url' => $this->createUrl('//d2tasks/tcmnCommunication/editableSaver'), 'source' => CHtml::listData(TcstCommunicationStatus::model()->findAll(), 'tcst_id', 'itemLabel'), 'apply' => $can_edit)), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_datetime', 'editable' => array('type' => 'datetime', 'url' => $this->createUrl('//d2tasks/tcmnCommunication/editableSaver'), 'apply' => $can_edit)), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_tmed_id', 'value' => '!empty($data->tcmn_tmed_id)?$data->tcmnTmed->itemLabel:" - "', 'type' => 'raw', 'editable' => array('type' => 'select', 'url' => $this->createUrl('//d2tasks/tcmnCommunication/editableSaver'), 'source' => CHtml::listData(TmedMedia::model()->findAll(array('limit' => 1000)), 'tmed_id', 'itemLabel'), 'apply' => $can_edit)))));
if (!$ajax) { $this->setPageTitle(Yii::t('D2tasksModule.model', 'Tasks')); Yii::app()->clientScript->registerScript('re-install-date-picker', "\nfunction reinstallDatePicker(id, data) {\n filter_TcmnCommunication_tcmn_date_range_init();\n }\n"); ?> <div class="clearfix"> <div class="btn-toolbar pull-left"> <div class="btn-group"> <?php $this->widget('bootstrap.widgets.TbButton', array('label' => Yii::t('D2tasksModule.crud', 'Create'), 'icon' => 'icon-plus', 'size' => 'large', 'type' => 'success', 'url' => array('create'), 'visible' => Yii::app()->user->checkAccess('D2tasks.TcmnCommunication.*') || Yii::app()->user->checkAccess('D2tasks.TcmnCommunication.Create'))); ?> </div> <div class="btn-group"> <h1> <i class="icon-ticket"></i> <?php echo Yii::t('D2tasksModule.model', 'Tasks'); ?> </h1> </div> </div> </div> <?php Yii::beginProfile('TcmnCommunication.view.grid'); } $this->widget('TbGridView', array('id' => 'tcmn-communication-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'template' => '{summary}{pager}{items}{pager}', 'pager' => array('class' => 'TbPager', 'displayFirstAndLast' => true), 'afterAjaxUpdate' => 'reinstallDatePicker', 'columns' => array(array('header' => Yii::t('D2tasksModule.model', 'Client'), 'value' => '$data->ccmp_name', 'name' => 'tcmn_ttsk_id', 'filter' => CHtml::listData(CcmpCompany::model()->findAll(array('order' => 'ccmp_name')), 'ccmp_id', 'itemLabel')), array('header' => Yii::t('D2tasksModule.model', 'Project'), 'name' => 'task_name', 'value' => '$data->ttsk_name'), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_pprs_id', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/d2tasks/tcmnCommunication/editableSaver'), 'source' => CHtml::listData(PprsPerson::model()->findAll(array('limit' => 1000)), 'pprs_id', 'itemLabel'))), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_client_pprs_id', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/d2tasks/tcmnCommunication/editableSaver'), 'source' => CHtml::listData(PprsPerson::model()->findAll(array('limit' => 1000)), 'pprs_id', 'itemLabel'))), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_task', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('/d2tasks/tcmnCommunication/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_result', 'editable' => array('type' => 'textarea', 'url' => $this->createUrl('/d2tasks/tcmnCommunication/editableSaver'))), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_tcst_id', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/d2tasks/tcmnCommunication/editableSaver'), 'source' => CHtml::listData(TcstCommunicationStatus::model()->findAll(array('limit' => 1000)), 'tcst_id', 'itemLabel')), 'filter' => CHtml::listData(TcstCommunicationStatus::model()->findAll(array('limit' => 1000)), 'tcst_id', 'itemLabel')), array('name' => 'tcmn_datetime', 'filter' => $this->widget('vendor.dbrisinajumi.DbrLib.widgets.TbFilterDateRangePicker', array('model' => $model, 'attribute' => 'tcmn_date_range', 'options' => array('ranges' => array('today', 'yesterday', 'this_week', 'last_week', 'this_month', 'last_month', 'this_year'))), TRUE)), array('class' => 'editable.EditableColumn', 'name' => 'tcmn_tmed_id', 'editable' => array('type' => 'select', 'url' => $this->createUrl('/d2tasks/tcmnCommunication/editableSaver'), 'source' => CHtml::listData(TmedMedia::model()->findAll(array('limit' => 1000)), 'tmed_id', 'itemLabel')), 'filter' => CHtml::listData(TmedMedia::model()->findAll(array('limit' => 1000)), 'tmed_id', 'itemLabel')), array('class' => 'TbButtonColumn', 'buttons' => array('view' => array('visible' => 'Yii::app()->user->checkAccess("D2tasks.TcmnCommunication.View")'), 'update' => array('visible' => 'FALSE'), 'delete' => array('visible' => 'FALSE')), 'viewButtonUrl' => 'Yii::app()->controller->createUrl("ttskTask/view", array("ttsk_id" => $data->tcmn_ttsk_id))', 'deleteButtonUrl' => 'Yii::app()->controller->createUrl("delete", array("tcmn_id" => $data->tcmn_id))', 'deleteConfirmation' => Yii::t('D2tasksModule.crud', 'Do you want to delete this item?'), 'viewButtonOptions' => array('data-toggle' => 'tooltip'), 'deleteButtonOptions' => array('data-toggle' => 'tooltip'))))); if (!$ajax) { Yii::endProfile('TcmnCommunication.view.grid'); }