public function actionIndex()
 {
     $statusList = AnswerList::getStatusList();
     $searchModel = new WriteTestSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index_', ['dataProvider' => $dataProvider, 'searchModel' => $searchModel, 'statusList' => $statusList]);
 }
Example #2
0
<?php

use yii\widgets\DetailView;
use yii\grid\GridView;
use app\modules\unicred\questionlist\models\AnswerList;
/* @var $this yii\web\View */
/* @var $model app\modules\unicred\questionlist\models\AnswerList */
$statusList = AnswerList::getStatusList();
?>
<div class="answer-list-delete">
    <p> Данный опрос находится в статусе <b>"<?php 
echo $model->statusName;
?>
"</b>.<br/>
        Перенести в архив невозможно.
        <?php 
if ($model->status == 'archive') {
    ?>
            Опрос уже находится в данной группе.
        <?php 
}
?>
    </p>
    <p> Для переноса в архив, опрос должен быть в статусе <br>
        <b>"<?php 
echo $statusList['done'];
?>
"</b>. </p>
</div>
Example #3
0
<div class="answer-list-form">

    <?php 
$form = ActiveForm::begin();
?>

    <?php 
echo $form->field($model, "question_list_id")->dropDownList($questionLists, [$model->question_list_id => ['selected' => 'selected']]);
?>

    <?php 
if (!$model->isNewRecord) {
    ?>
        <?php 
    echo $form->field($model, "status")->dropDownList(AnswerList::getStatusList(), [$model->status => ['selected' => 'selected']]);
    ?>
    <?php 
}
?>
    <?php 
echo $form->field($model, "do_id")->dropDownList($DoList, [$model->question_list_id => ['selected' => 'selected']]);
?>

    <div class="form-group field-answerlist-dates">
        <?php 
echo DatePicker::widget(['name' => 'date_from', 'type' => DatePicker::TYPE_RANGE, 'name2' => 'date_to', 'form' => $form, 'model' => $model, 'attribute' => 'date_from', 'attribute2' => 'date_to', 'language' => 'ru', 'separator' => ' - ', 'pluginOptions' => ['format' => 'yyyy-mm-dd']]);
?>
    </div>

    <?php 
Example #4
0
<?php

use yii\helpers\Url;
use yii\helpers\ArrayHelper;
use app\modules\unicred\questionlist\models\Office;
use app\modules\unicred\questionlist\models\AnswerList;
use yii\helpers\Html;
return [['class' => 'kartik\\grid\\SerialColumn', 'width' => '30px'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'questionList.title'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'date_from'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'date_to'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'statusName', 'filter' => AnswerList::getStatusList()], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'officeName', 'filter' => ArrayHelper::map(Office::find()->all(), 'id', 'name')], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'date'], ['class' => '\\kartik\\grid\\DataColumn', 'attribute' => 'author'], ['class' => '\\kartik\\grid\\ActionColumn', 'template' => '{confirm}', 'buttons' => ['confirm' => function ($url, $model) {
    return Html::a('<span class="glyphicon glyphicon-list"></span>', Url::toRoute(['confirm', 'id' => $model->id]));
}]]];