예제 #1
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param integer the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = FeedbackStatus::model()->findByPk($id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
예제 #2
0
<legend>Сообщение #<?php 
echo $model->id;
?>
</legend>

<?php 
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'attributes' => array('email', 'name', 'subject.title', 'body')));
?>

<?php 
$form = $this->beginWidget('bootstrap.widgets.TbActiveForm', array('id' => 'feedback-form', 'enableAjaxValidation' => false, 'type' => 'horizontal'));
?>

    <?php 
echo $form->dropDownListRow($model, 'status_id', array(0 => 'Новое') + CHtml::listData(FeedbackStatus::model()->findAll(), 'id', 'title'));
?>

    <div class="form-actions">
        <?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'htmlOptions' => array('style' => 'margin-right: 20px'), 'label' => $model->isNewRecord ? $this->t('MODULE.OPERATIONS.CREATE') : $this->t('MODULE.OPERATIONS.SAVE')));
?>

        <?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'submit', 'type' => 'primary', 'htmlOptions' => array('name' => 'go_to_list', 'style' => 'margin-right: 20px'), 'label' => $model->isNewRecord ? Yii::t('Bootstrap', 'PHRASE.BUTTON.CREATE_RETURN') : Yii::t('Bootstrap', 'PHRASE.BUTTON.SAVE_RETURN')));
?>

        <?php 
$this->widget('bootstrap.widgets.TbButton', array('buttonType' => 'link', 'label' => Yii::t('Bootstrap', 'PHRASE.BUTTON.RETURN'), 'url' => $this->listUrl('admin')));
?>

    </div>
예제 #3
0
<legend>Обратная связь</legend>

<?php 
$this->widget('backendfilterWidget', array('listId' => 'feedback-grid', 'model' => $model, 'columns' => array(array('user_ids', 'user', 'multiple' => true), array('subject_id', 'select', 'listData' => CHtml::listData(FeedbackSubject::model()->findAll(array('order' => 'title')), 'id', 'title'), 'htmlOptions' => array('class' => 'span5')), array('email', function ($model, $attribute, $form) {
    return $form->textFieldRow($model, $attribute, array('class' => 'span5'));
}), array('created_at', 'date'), array('created_at', 'date', 'range' => true), array('status_id', 'select', 'listData' => CHtml::listData(FeedbackStatus::model()->findAll(array('order' => 'title')), 'id', 'title'), 'htmlOptions' => array('class' => 'span5')))));
$this->widget('bootstrap.widgets.TbExtendedGridView', array('template' => "{items}\n{pager}", 'id' => 'feedback-grid', 'enableHistory' => true, 'dataProvider' => $model->search(), 'filter' => null, 'type' => 'bordered striped', 'bulkActions' => array('actionButtons' => $this->bulkRemoveButton(), 'checkBoxColumnConfig' => array('name' => 'id')), 'columns' => array(array('header' => '#', 'name' => 'id', 'htmlOptions' => array('style' => 'width:40px;white-space:nowrap')), array('name' => 'created_at', 'htmlOptions' => array('style' => 'min-width: 160px;white-space:nowrap')), array('name' => 'subject_id', 'value' => '$data->subject->title', 'filter' => CHtml::listData(FeedbackSubject::model()->findAll(array('order' => 'title')), 'id', 'title')), array('name' => 'name', 'value' => '$data->name'), array('name' => 'email', 'value' => '$data->email'), array('class' => 'CLinkColumn', 'header' => $this->t('PROFILE'), 'labelExpression' => '$data->user_id > 0 ? "' . $this->t('PROFILE') . '" : null', 'urlExpression' => '$data->user_id > 0 ? array("/user/list/update", "id" => $data->user_id) : null'), array('name' => 'status_id', 'value' => '$data->status ? $data->status->title : "новое"', 'filter' => CHtml::listData(FeedbackStatus::model()->findAll(array('order' => 'title')), 'id', 'title'), 'htmlOptions' => array('style' => 'width: 80px;')), array('class' => 'bootstrap.widgets.TbButtonColumn', 'template' => '{view}&nbsp;&nbsp;{delete}', 'buttons' => array('view' => array('label' => 'Смотреть данные', 'options' => array(), 'url' => function ($data) {
    return Yii::app()->controller->itemUrl('view', $data->id);
}), 'delete' => array('label' => 'Удалить', 'options' => array())), 'htmlOptions' => array('style' => 'white-space:nowrap')))));