From 3a78821c0baca61cc7c2a4d6b7b08df17920144c Mon Sep 17 00:00:00 2001 From: SoHardKI Date: Wed, 3 Jul 2019 18:06:01 +0300 Subject: [PATCH] project_dropdown --- .../modules/card/views/user-card/_additional.php | 1 - backend/modules/card/views/user-card/index.php | 15 +++++++-------- backend/modules/project/models/ProjectSearch.php | 4 ++-- backend/views/layouts/left.php | 9 ++++++++- 4 files changed, 17 insertions(+), 12 deletions(-) delete mode 100644 backend/modules/card/views/user-card/_additional.php diff --git a/backend/modules/card/views/user-card/_additional.php b/backend/modules/card/views/user-card/_additional.php deleted file mode 100644 index 4b53d2d..0000000 --- a/backend/modules/card/views/user-card/_additional.php +++ /dev/null @@ -1 +0,0 @@ -skill->name; ?> diff --git a/backend/modules/card/views/user-card/index.php b/backend/modules/card/views/user-card/index.php index bca1464..f1465f9 100755 --- a/backend/modules/card/views/user-card/index.php +++ b/backend/modules/card/views/user-card/index.php @@ -61,14 +61,13 @@ $this->params['breadcrumbs'][] = $this->title; 'label' => 'Навыки', 'format' => 'raw', 'value' => function($model){ - $dataProvider = new \yii\data\ActiveDataProvider([ - 'query' => $model->getSkillValues(), - ]); - return ListView::widget([ - 'dataProvider' => $dataProvider, - 'itemView' => '_additional', - 'layout' => "{items}", - ]); + $str = ''; + foreach ($model->skillValues as $item) + { + $str .= $item->skill->name . ', '; + } + $str = substr( $str, 0, -2); + return $str; }, 'filter' => kartik\select2\Select2::widget([ 'attribute' => 'skills', diff --git a/backend/modules/project/models/ProjectSearch.php b/backend/modules/project/models/ProjectSearch.php index 8fe9ab2..65d9c3a 100755 --- a/backend/modules/project/models/ProjectSearch.php +++ b/backend/modules/project/models/ProjectSearch.php @@ -2,7 +2,6 @@ namespace backend\modules\project\models; -use common\classes\Debug; use Yii; use yii\base\Model; use yii\data\ActiveDataProvider; @@ -19,7 +18,7 @@ class ProjectSearch extends Project public function rules() { return [ - [['id'], 'integer'], + [['id','status'], 'integer'], [['name', 'description', 'created_at', 'updated_at'], 'safe'], ]; } @@ -61,6 +60,7 @@ class ProjectSearch extends Project // grid filtering conditions $query->andFilterWhere([ 'id' => $this->id, + 'status' => $this->status, 'created_at' => $this->created_at, 'updated_at' => $this->updated_at, ]); diff --git a/backend/views/layouts/left.php b/backend/views/layouts/left.php index 8a001ed..38f07e9 100755 --- a/backend/views/layouts/left.php +++ b/backend/views/layouts/left.php @@ -6,6 +6,11 @@ foreach($userStatuses as $key => $status){ $menuItems[] = ['label' => $status, 'icon' => 'user', 'url' => ['/card/user-card?UserCardSearch[status]=' . $key]]; } + $projectStatuses = \common\models\Status::getStatusesArray(\common\models\UseStatus::USE_PROJECT); + $projectItems = [['label' => 'Все', 'icon' => 'files-o', 'url' => ['/project/project']]]; + foreach($projectStatuses as $key => $status){ + $projectItems[] = ['label' => $status, 'icon' => 'user', 'url' => ['/project/project?ProjectSearch[status]=' . $key]]; + } ?> 'Профили', 'icon' => 'users', 'url' => '#', 'items' => $menuItems, ], - ['label' => 'Проекты', 'icon' => 'files-o', 'url' => ['/project/project']], + [ 'label' => 'Проекты', 'icon' => 'files-o', 'url' => ['#'], + 'items' => $projectItems, + ], ['label' => 'Компании', 'icon' => 'files-o', 'url' => ['/company/company']], [ 'label' => 'Hh.ru', 'icon' => 'user-circle', 'url' => '#',