Commit 6c18fb74cd0c214fea6f325c8679a774518443d5
1 parent
8ab26639
+ fix по багам после сливаний
Showing
14 changed files
with
30 additions
and
22 deletions
Show diff stats
backend/models/Menu.php
| @@ -36,8 +36,8 @@ class Menu extends \yii\db\ActiveRecord | @@ -36,8 +36,8 @@ class Menu extends \yii\db\ActiveRecord | ||
| 36 | public function rules() | 36 | public function rules() |
| 37 | { | 37 | { |
| 38 | return [ | 38 | return [ |
| 39 | - [['menu_id', 'menu_pid', 'level', 'termin_id', 'show', 'is_open', 'menu_location_id', 'sortorder'], 'required'], | ||
| 40 | - [['menu_id', 'menu_pid', 'level', 'termin_id', 'show', 'is_open', 'menu_location_id', 'sortorder'], 'integer'], | 39 | + [['menu_id', 'menu_pid', 'level', 'termin_id', 'status', 'is_open', 'menu_location_id', 'sort'], 'required'], |
| 40 | + [['menu_id', 'menu_pid', 'level', 'termin_id', 'status', 'is_open', 'menu_location_id', 'sort'], 'integer'], | ||
| 41 | [['name', 'url'], 'string', 'max' => 250] | 41 | [['name', 'url'], 'string', 'max' => 250] |
| 42 | ]; | 42 | ]; |
| 43 | } | 43 | } |
| @@ -52,10 +52,10 @@ class Menu extends \yii\db\ActiveRecord | @@ -52,10 +52,10 @@ class Menu extends \yii\db\ActiveRecord | ||
| 52 | 'menu_pid' => Yii::t('app', 'Menu Pid'), | 52 | 'menu_pid' => Yii::t('app', 'Menu Pid'), |
| 53 | 'level' => Yii::t('app', 'Level'), | 53 | 'level' => Yii::t('app', 'Level'), |
| 54 | 'termin_id' => Yii::t('app', 'Termin ID'), | 54 | 'termin_id' => Yii::t('app', 'Termin ID'), |
| 55 | - 'show' => Yii::t('app', 'Show'), | 55 | + 'status' => Yii::t('app', 'Show'), |
| 56 | 'is_open' => Yii::t('app', 'Is Open'), | 56 | 'is_open' => Yii::t('app', 'Is Open'), |
| 57 | 'menu_location_id' => Yii::t('app', 'Menu Location ID'), | 57 | 'menu_location_id' => Yii::t('app', 'Menu Location ID'), |
| 58 | - 'sortorder' => Yii::t('app', 'Sortorder'), | 58 | + 'sort' => Yii::t('app', 'Sortorder'), |
| 59 | 'name' => Yii::t('app', 'Name'), | 59 | 'name' => Yii::t('app', 'Name'), |
| 60 | 'url' => Yii::t('app', 'Url'), | 60 | 'url' => Yii::t('app', 'Url'), |
| 61 | ]; | 61 | ]; |
| @@ -81,7 +81,7 @@ class Menu extends \yii\db\ActiveRecord | @@ -81,7 +81,7 @@ class Menu extends \yii\db\ActiveRecord | ||
| 81 | INNER JOIN termin ON termin.termin_id = menu.termin_id | 81 | INNER JOIN termin ON termin.termin_id = menu.termin_id |
| 82 | INNER JOIN termin_lang ON termin_lang.termin_id = menu.termin_id | 82 | INNER JOIN termin_lang ON termin_lang.termin_id = menu.termin_id |
| 83 | AND termin_lang.language_id = '.Yii::$app->params['language_id'].' | 83 | AND termin_lang.language_id = '.Yii::$app->params['language_id'].' |
| 84 | - ORDER BY menu.level ASC, menu.sortorder ASC | 84 | + ORDER BY menu.level ASC, menu.sort ASC |
| 85 | ')->queryAll(); | 85 | ')->queryAll(); |
| 86 | /* | 86 | /* |
| 87 | return $this->find() | 87 | return $this->find() |
backend/models/MenuSearch.php
| @@ -18,7 +18,7 @@ class MenuSearch extends Menu | @@ -18,7 +18,7 @@ class MenuSearch extends Menu | ||
| 18 | public function rules() | 18 | public function rules() |
| 19 | { | 19 | { |
| 20 | return [ | 20 | return [ |
| 21 | - [['menu_id', 'menu_pid', 'level', 'termin_id', 'show', 'is_open', 'menu_location_id', 'sortorder'], 'integer'], | 21 | + [['menu_id', 'menu_pid', 'level', 'termin_id', 'status', 'is_open', 'menu_location_id', 'sort'], 'integer'], |
| 22 | [['name', 'url'], 'safe'], | 22 | [['name', 'url'], 'safe'], |
| 23 | ]; | 23 | ]; |
| 24 | } | 24 | } |
| @@ -61,10 +61,10 @@ class MenuSearch extends Menu | @@ -61,10 +61,10 @@ class MenuSearch extends Menu | ||
| 61 | 'menu_pid' => $this->menu_pid, | 61 | 'menu_pid' => $this->menu_pid, |
| 62 | 'level' => $this->level, | 62 | 'level' => $this->level, |
| 63 | 'termin_id' => $this->termin_id, | 63 | 'termin_id' => $this->termin_id, |
| 64 | - 'show' => $this->show, | 64 | + 'status' => $this->status, |
| 65 | 'is_open' => $this->is_open, | 65 | 'is_open' => $this->is_open, |
| 66 | 'menu_location_id' => $this->menu_location_id, | 66 | 'menu_location_id' => $this->menu_location_id, |
| 67 | - 'sortorder' => $this->sortorder, | 67 | + 'sort' => $this->sort, |
| 68 | ]); | 68 | ]); |
| 69 | 69 | ||
| 70 | $query->andFilterWhere(['like', 'name', $this->name]) | 70 | $query->andFilterWhere(['like', 'name', $this->name]) |
backend/models/TerminSearch.php
backend/models/TerminStructure.php
| @@ -51,6 +51,11 @@ class TerminStructure extends \yii\db\ActiveRecord | @@ -51,6 +51,11 @@ class TerminStructure extends \yii\db\ActiveRecord | ||
| 51 | { | 51 | { |
| 52 | return $this->hasOne(Termin::className(), ['termin_id' => 'termin_id']); | 52 | return $this->hasOne(Termin::className(), ['termin_id' => 'termin_id']); |
| 53 | } | 53 | } |
| 54 | + | ||
| 55 | + public function getParent() | ||
| 56 | + { | ||
| 57 | + return $this->hasOne(Termin::className(), ['termin_id' => 'termin_pid']); | ||
| 58 | + } | ||
| 54 | 59 | ||
| 55 | /** | 60 | /** |
| 56 | * @return \yii\db\ActiveQuery | 61 | * @return \yii\db\ActiveQuery |
backend/views/menu/_form.php
| @@ -20,13 +20,13 @@ use yii\widgets\ActiveForm; | @@ -20,13 +20,13 @@ use yii\widgets\ActiveForm; | ||
| 20 | 20 | ||
| 21 | <?= $form->field($model, 'termin_id')->textInput() ?> | 21 | <?= $form->field($model, 'termin_id')->textInput() ?> |
| 22 | 22 | ||
| 23 | - <?= $form->field($model, 'show')->textInput() ?> | 23 | + <?= $form->field($model, 'status')->textInput() ?> |
| 24 | 24 | ||
| 25 | <?= $form->field($model, 'is_open')->textInput() ?> | 25 | <?= $form->field($model, 'is_open')->textInput() ?> |
| 26 | 26 | ||
| 27 | <?= $form->field($model, 'menu_location_id')->textInput() ?> | 27 | <?= $form->field($model, 'menu_location_id')->textInput() ?> |
| 28 | 28 | ||
| 29 | - <?= $form->field($model, 'sortorder')->textInput() ?> | 29 | + <?= $form->field($model, 'sort')->textInput() ?> |
| 30 | 30 | ||
| 31 | <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> | 31 | <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?> |
| 32 | 32 |
backend/views/menu/_search.php
| @@ -23,7 +23,7 @@ use yii\widgets\ActiveForm; | @@ -23,7 +23,7 @@ use yii\widgets\ActiveForm; | ||
| 23 | 23 | ||
| 24 | <?= $form->field($model, 'termin_id') ?> | 24 | <?= $form->field($model, 'termin_id') ?> |
| 25 | 25 | ||
| 26 | - <?= $form->field($model, 'show') ?> | 26 | + <?= $form->field($model, 'status') ?> |
| 27 | 27 | ||
| 28 | <?php // echo $form->field($model, 'is_open') ?> | 28 | <?php // echo $form->field($model, 'is_open') ?> |
| 29 | 29 |
backend/views/menu/index.php
| @@ -35,8 +35,7 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -35,8 +35,7 @@ $this->params['breadcrumbs'][] = $this->title; | ||
| 35 | ], | 35 | ], |
| 36 | */ | 36 | */ |
| 37 | 'menu_pid', | 37 | 'menu_pid', |
| 38 | - 'level', | ||
| 39 | - // 'sortorder', | 38 | + 'level', |
| 40 | 39 | ||
| 41 | ['class' => 'yii\grid\ActionColumn'], | 40 | ['class' => 'yii\grid\ActionColumn'], |
| 42 | ], | 41 | ], |
backend/views/menu/view.php
| @@ -32,10 +32,10 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -32,10 +32,10 @@ $this->params['breadcrumbs'][] = $this->title; | ||
| 32 | 'menu_pid', | 32 | 'menu_pid', |
| 33 | 'level', | 33 | 'level', |
| 34 | 'termin_id', | 34 | 'termin_id', |
| 35 | - 'show', | 35 | + 'status', |
| 36 | 'is_open', | 36 | 'is_open', |
| 37 | 'menu_location_id', | 37 | 'menu_location_id', |
| 38 | - 'sortorder', | 38 | + 'sort', |
| 39 | 'name', | 39 | 'name', |
| 40 | 'url:url', | 40 | 'url:url', |
| 41 | ], | 41 | ], |
backend/views/termin/_form.php
| @@ -9,17 +9,17 @@ use yii\helpers\ArrayHelper; | @@ -9,17 +9,17 @@ use yii\helpers\ArrayHelper; | ||
| 9 | /* @var $this yii\web\View */ | 9 | /* @var $this yii\web\View */ |
| 10 | /* @var $model backend\models\Termin */ | 10 | /* @var $model backend\models\Termin */ |
| 11 | /* @var $form yii\widgets\ActiveForm */ | 11 | /* @var $form yii\widgets\ActiveForm */ |
| 12 | - | 12 | + |
| 13 | ?> | 13 | ?> |
| 14 | 14 | ||
| 15 | <div class="termin-form"> | 15 | <div class="termin-form"> |
| 16 | 16 | ||
| 17 | <?php $form = ActiveForm::begin(); ?> | 17 | <?php $form = ActiveForm::begin(); ?> |
| 18 | 18 | ||
| 19 | - <?= $form->field($model_pid->termin, 'termin_pid')->widget(Select2::classname(), | 19 | + <?= $form->field($model_pid->termin, 'termin_id')->widget(Select2::classname(), |
| 20 | [ | 20 | [ |
| 21 | 'data' => ArrayHelper::map((new Termin)->finInfo([ | 21 | 'data' => ArrayHelper::map((new Termin)->finInfo([ |
| 22 | - 'show_all' => true, | 22 | + 'show_all' => true, |
| 23 | ]), | 23 | ]), |
| 24 | 'termin_id', | 24 | 'termin_id', |
| 25 | 'termin_title' | 25 | 'termin_title' |
backend/views/termin/index.php
| @@ -17,9 +17,8 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -17,9 +17,8 @@ $this->params['breadcrumbs'][] = $this->title; | ||
| 17 | 17 | ||
| 18 | <p> | 18 | <p> |
| 19 | <?= Html::a(Yii::t('app', 'Create'), ['create'], ['class' => 'btn btn-success']) ?> | 19 | <?= Html::a(Yii::t('app', 'Create'), ['create'], ['class' => 'btn btn-success']) ?> |
| 20 | - </p> | 20 | + </p> |
| 21 | 21 | ||
| 22 | - | ||
| 23 | <?= GridView::widget([ | 22 | <?= GridView::widget([ |
| 24 | 'dataProvider' => $dataProvider, | 23 | 'dataProvider' => $dataProvider, |
| 25 | 'filterModel' => $searchModel, | 24 | 'filterModel' => $searchModel, |
| @@ -27,11 +26,14 @@ $this->params['breadcrumbs'][] = $this->title; | @@ -27,11 +26,14 @@ $this->params['breadcrumbs'][] = $this->title; | ||
| 27 | ['class' => 'yii\grid\SerialColumn'], | 26 | ['class' => 'yii\grid\SerialColumn'], |
| 28 | [ | 27 | [ |
| 29 | 'attribute' => 'termin_title', | 28 | 'attribute' => 'termin_title', |
| 30 | - 'value' => 'terminLangs.termin_title' | 29 | + //'value' => 'terminLangs.termin_title' |
| 31 | ], | 30 | ], |
| 32 | [ | 31 | [ |
| 33 | 'attribute' => 'termin_parent_title', | 32 | 'attribute' => 'termin_parent_title', |
| 34 | - 'value' => 'parent.terminLangs.termin_title' | 33 | + 'value' => 'terminStructures.parent.terminLangs.termin_title', |
| 34 | + 'content' => function($model, $key, $index, $column) { | ||
| 35 | + return $model->terminStructures[0]->parent->terminLangs[0]->termin_title; | ||
| 36 | + } | ||
| 35 | ], | 37 | ], |
| 36 | 'termin_name', | 38 | 'termin_name', |
| 37 | 'is_book', | 39 | 'is_book', |
db-migration/andryeyev/all.backup
No preview for this file type
db-migration/andryeyev/menu.backup
No preview for this file type
db-migration/andryeyev/termin.backup
No preview for this file type
db-migration/artbox/artbox_db.backup
No preview for this file type