add_status_to_project_index

This commit is contained in:
SoHardKI
2019-07-02 17:35:39 +03:00
parent 45dcde26ae
commit 9affc6b402
7 changed files with 62 additions and 1 deletions

View File

@ -2,6 +2,7 @@
namespace backend\modules\project\models;
use common\classes\Debug;
use Yii;
use yii\base\Model;
use yii\data\ActiveDataProvider;

View File

@ -30,6 +30,16 @@ use yii\widgets\ActiveForm;
]
); ?>
<?= $form->field($model, 'status')
->dropDownList(\yii\helpers\ArrayHelper::map(
\common\models\Status::find()
->joinWith('useStatuses')
->where(['`use_status`.`use`' => \common\models\UseStatus::USE_PROJECT])->all(), 'id', 'name'),
[
'prompt' => 'Выберите'
]
) ?>
<?= $form->field($model, 'hh_id')->widget(Select2::class,
[
'data' => \yii\helpers\ArrayHelper::map(\common\models\Hh::find()->all(),'id', 'title'),

View File

@ -1,6 +1,8 @@
<?php
use common\models\Project;
use common\models\UseStatus;
use kartik\select2\Select2;
use yii\helpers\Html;
use yii\grid\GridView;
@ -46,6 +48,21 @@ $this->params['breadcrumbs'][] = $this->title;
return implode(', ', $model->getUsersNameList());
}
],
[
'attribute' => 'status',
'value' => function($model){
return $model->status0['name'];
},
'filter' => kartik\select2\Select2::widget([
'model' => $searchModel,
'attribute' => 'status',
'data' => \common\models\Status::getStatusesArray(\common\models\UseStatus::USE_PROJECT),
'options' => ['placeholder' => 'Начните вводить...','class' => 'form-control'],
'pluginOptions' => [
'allowClear' => true
],
]),
],
//'created_at',
//'updated_at',

View File

@ -35,6 +35,7 @@ $this->params['breadcrumbs'][] = $this->title;
'attribute' => 'hh.url'
],
'description:ntext',
'status',
'created_at',
'updated_at',
],