Commit 6c18fb74cd0c214fea6f325c8679a774518443d5

Authored by andryeyev
1 parent 8ab26639

+ fix по багам после сливаний

backend/models/Menu.php
... ... @@ -36,8 +36,8 @@ class Menu extends \yii\db\ActiveRecord
36 36 public function rules()
37 37 {
38 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 41 [['name', 'url'], 'string', 'max' => 250]
42 42 ];
43 43 }
... ... @@ -52,10 +52,10 @@ class Menu extends \yii\db\ActiveRecord
52 52 'menu_pid' => Yii::t('app', 'Menu Pid'),
53 53 'level' => Yii::t('app', 'Level'),
54 54 'termin_id' => Yii::t('app', 'Termin ID'),
55   - 'show' => Yii::t('app', 'Show'),
  55 + 'status' => Yii::t('app', 'Show'),
56 56 'is_open' => Yii::t('app', 'Is Open'),
57 57 'menu_location_id' => Yii::t('app', 'Menu Location ID'),
58   - 'sortorder' => Yii::t('app', 'Sortorder'),
  58 + 'sort' => Yii::t('app', 'Sortorder'),
59 59 'name' => Yii::t('app', 'Name'),
60 60 'url' => Yii::t('app', 'Url'),
61 61 ];
... ... @@ -81,7 +81,7 @@ class Menu extends \yii\db\ActiveRecord
81 81 INNER JOIN termin ON termin.termin_id = menu.termin_id
82 82 INNER JOIN termin_lang ON termin_lang.termin_id = menu.termin_id
83 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 85 ')->queryAll();
86 86 /*
87 87 return $this->find()
... ...
backend/models/MenuSearch.php
... ... @@ -18,7 +18,7 @@ class MenuSearch extends Menu
18 18 public function rules()
19 19 {
20 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 22 [['name', 'url'], 'safe'],
23 23 ];
24 24 }
... ... @@ -61,10 +61,10 @@ class MenuSearch extends Menu
61 61 'menu_pid' => $this->menu_pid,
62 62 'level' => $this->level,
63 63 'termin_id' => $this->termin_id,
64   - 'show' => $this->show,
  64 + 'status' => $this->status,
65 65 'is_open' => $this->is_open,
66 66 'menu_location_id' => $this->menu_location_id,
67   - 'sortorder' => $this->sortorder,
  67 + 'sort' => $this->sort,
68 68 ]);
69 69  
70 70 $query->andFilterWhere(['like', 'name', $this->name])
... ...
backend/models/TerminSearch.php
... ... @@ -12,6 +12,8 @@ use backend\models\Termin;
12 12 */
13 13 class TerminSearch extends Termin
14 14 {
  15 + var $termin_parent_title;
  16 +
15 17 /**
16 18 * @inheritdoc
17 19 */
... ...
backend/models/TerminStructure.php
... ... @@ -51,6 +51,11 @@ class TerminStructure extends \yii\db\ActiveRecord
51 51 {
52 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 61 * @return \yii\db\ActiveQuery
... ...
backend/views/menu/_form.php
... ... @@ -20,13 +20,13 @@ use yii\widgets\ActiveForm;
20 20  
21 21 <?= $form->field($model, 'termin_id')->textInput() ?>
22 22  
23   - <?= $form->field($model, 'show')->textInput() ?>
  23 + <?= $form->field($model, 'status')->textInput() ?>
24 24  
25 25 <?= $form->field($model, 'is_open')->textInput() ?>
26 26  
27 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 31 <?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
32 32  
... ...
backend/views/menu/_search.php
... ... @@ -23,7 +23,7 @@ use yii\widgets\ActiveForm;
23 23  
24 24 <?= $form->field($model, 'termin_id') ?>
25 25  
26   - <?= $form->field($model, 'show') ?>
  26 + <?= $form->field($model, 'status') ?>
27 27  
28 28 <?php // echo $form->field($model, 'is_open') ?>
29 29  
... ...
backend/views/menu/index.php
... ... @@ -35,8 +35,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
35 35 ],
36 36 */
37 37 'menu_pid',
38   - 'level',
39   - // 'sortorder',
  38 + 'level',
40 39  
41 40 ['class' => 'yii\grid\ActionColumn'],
42 41 ],
... ...
backend/views/menu/view.php
... ... @@ -32,10 +32,10 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
32 32 'menu_pid',
33 33 'level',
34 34 'termin_id',
35   - 'show',
  35 + 'status',
36 36 'is_open',
37 37 'menu_location_id',
38   - 'sortorder',
  38 + 'sort',
39 39 'name',
40 40 'url:url',
41 41 ],
... ...
backend/views/termin/_form.php
... ... @@ -9,17 +9,17 @@ use yii\helpers\ArrayHelper;
9 9 /* @var $this yii\web\View */
10 10 /* @var $model backend\models\Termin */
11 11 /* @var $form yii\widgets\ActiveForm */
12   -
  12 +
13 13 ?>
14 14  
15 15 <div class="termin-form">
16 16  
17 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 21 'data' => ArrayHelper::map((new Termin)->finInfo([
22   - 'show_all' => true,
  22 + 'show_all' => true,
23 23 ]),
24 24 'termin_id',
25 25 'termin_title'
... ...
backend/views/termin/index.php
... ... @@ -17,9 +17,8 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
17 17  
18 18 <p>
19 19 <?= Html::a(Yii::t('app', 'Create'), ['create'], ['class' => 'btn btn-success']) ?>
20   - </p>
  20 + </p>
21 21  
22   -
23 22 <?= GridView::widget([
24 23 'dataProvider' => $dataProvider,
25 24 'filterModel' => $searchModel,
... ... @@ -27,11 +26,14 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
27 26 ['class' => 'yii\grid\SerialColumn'],
28 27 [
29 28 'attribute' => 'termin_title',
30   - 'value' => 'terminLangs.termin_title'
  29 + //'value' => 'terminLangs.termin_title'
31 30 ],
32 31 [
33 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 38 'termin_name',
37 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