From c83499b4c3f21a922a535294a27abc8046917e7c Mon Sep 17 00:00:00 2001 From: Alex Date: Tue, 13 Dec 2016 11:37:45 +0200 Subject: [PATCH] -Order index translate --- models/Order.php | 23 ++++++++++++++--------- models/OrderSearch.php | 7 +++++-- views/order/index.php | 4 ++-- 3 files changed, 21 insertions(+), 13 deletions(-) diff --git a/models/Order.php b/models/Order.php index cd3a283..2753402 100755 --- a/models/Order.php +++ b/models/Order.php @@ -183,7 +183,7 @@ public function afterFind() { parent::afterFind(); - $this->deadline = !empty( $this->deadline ) ? date('d.m.Y', $this->deadline) : ''; + $this->deadline = !empty($this->deadline) ? date('d.m.Y', $this->deadline) : ''; } @@ -200,7 +200,7 @@ protected function convertDate() { - if (!empty( $this->deadline )) { + if (!empty($this->deadline)) { $date = new \DateTime(); $date->setTimestamp(strtotime($this->deadline)); $date->format("d.m.Y"); @@ -215,7 +215,7 @@ return [ 'name' => Yii::t('app', 'order_name'), 'phone' => Yii::t('app', 'order_phone'), - 'email' => Yii::t('app', 'order_email'), + 'email' => Yii::t('app', 'E-mail'), 'comment' => Yii::t('app', 'order_comment'), 'created_at' => Yii::t('app', 'Дата добавления'), 'updated_at' => Yii::t('app', 'Дата обновления'), @@ -228,9 +228,14 @@ 'manager_id' => Yii::t('app', 'Менеджер'), 'delivery_cost' => Yii::t('app', 'Стоимость доставки'), 'published' => Yii::t('app', 'Опубликован'), - 'label' => Yii::t('app', 'Метка'), - 'declaration' => Yii::t('app', 'Номер декларации'), - 'delivery' => Yii::t('app', 'Способ доставки'), + 'label' => Yii::t('app', 'Метка'), + 'declaration' => Yii::t('app', 'Номер декларации'), + 'delivery' => Yii::t('app', 'Способ доставки'), + 'total' => Yii::t('app', 'Сумма'), + 'adress' => Yii::t('app', 'Адрес'), + 'pay' => Yii::t('app', 'Оплата'), + 'body' => Yii::t('app', 'Комментарий'), + 'id' => Yii::t('app', 'Номер'), ]; } @@ -276,8 +281,8 @@ */ public function getDeliveryString() { - if (!empty( $this->orderDelivery )) { - if (!empty( $this->orderDelivery->parent )) { + if (!empty($this->orderDelivery)) { + if (!empty($this->orderDelivery->parent)) { return $this->orderDelivery->parent->lang->title . ': ' . $this->orderDelivery->lang->title; } else { return $this->orderDelivery->lang->title; @@ -295,7 +300,7 @@ */ public function getWasted() { - if (empty( $this->deadline )) { + if (empty($this->deadline)) { return false; } else { return time() > strtotime($this->deadline); diff --git a/models/OrderSearch.php b/models/OrderSearch.php index 4503ba9..d618c08 100755 --- a/models/OrderSearch.php +++ b/models/OrderSearch.php @@ -4,6 +4,7 @@ use yii\base\Model; use yii\data\ActiveDataProvider; + use yii\helpers\ArrayHelper; use yii\helpers\VarDumper; /** @@ -193,8 +194,10 @@ public function attributeLabels() { - return [ - 'sku' => \Yii::t('app', 'Артикул'), + $labels = [ + 'sku' => \Yii::t('app', 'Артикул'), ]; + + return ArrayHelper::merge($labels, parent::attributeLabels()); } } diff --git a/views/order/index.php b/views/order/index.php index 9294a6d..d34b63e 100755 --- a/views/order/index.php +++ b/views/order/index.php @@ -78,7 +78,7 @@ JS; ->indexBy('id') ->asArray() ->column(), - 'options' => [ 'placeholder' => 'Select a state ...' ], + 'options' => [ 'placeholder' => 'Выберите метки ...' ], 'pluginOptions' => [ 'allowClear' => true, 'multiple' => true, @@ -97,7 +97,7 @@ JS; ->indexBy('id') ->asArray() ->column(), - 'options' => [ 'placeholder' => 'Select a state ...' ], + 'options' => [ 'placeholder' => 'Выберите способ доставки ...' ], 'pluginOptions' => [ 'allowClear' => true, 'multiple' => true, -- libgit2 0.21.4