public function loadModel($id) { $m = TcmtComments::model(); // apply scope, if available $scopes = $m->scopes(); if (isset($scopes[$this->scope])) { $m->{$this->scope}(); } $model = $m->findByPk($id); if ($model === null) { throw new CHttpException(404, Yii::t('D2tasksModule.crud', 'The requested page does not exist.')); } return $model; }
?> <div class="table-header"> <i class="icon-comments"></i> <?php echo Yii::t('D2tasksModule.model', 'Tcmt Comments'); ?> <?php if (Yii::app()->user->checkAccess("D2tasks.TcmtComments.Create")) { $this->widget('bootstrap.widgets.TbButton', array('id' => 'add_tcmt_comment', 'buttonType' => 'link', 'type' => 'primary', 'size' => 'mini', 'icon' => 'icon-plus', 'htmlOptions' => array('title' => Yii::t('D2tasksModule.model', 'Add Comment'), 'data-toggle' => 'tooltip'))); } ?> </div> <?php $model = new TcmtComments(); $model->tcmt_ttsk_id = $modelMain->primaryKey; // render grid view $this->widget('TbGridView', array('id' => 'tcmt-comments-grid', 'dataProvider' => $model->search(), 'template' => '{summary}{items}', 'summaryText' => ' ', 'htmlOptions' => array('class' => 'rel-grid-view'), 'columns' => array(array('name' => 'tcmt_pprs_id', 'value' => '$data->tcmtPprs->itemLabel', 'htmlOptions' => array('class' => 'span3')), array('name' => 'tcmt_datetime', 'htmlOptions' => array('class' => 'span3')), array('name' => 'tcmt_notes', 'htmlOptions' => array('class' => 'span12'))))); ?> <?php Yii::endProfile('tcmt_ttsk_id.view.grid'); } ?> <?php if ((!$ajax || $ajax == 'tprs-persons-grid') && Yii::app()->user->checkAccess("D2tasks.TprsPersons.View")) { Yii::beginProfile('tprs_ttsk_id.view.grid'); ?>