Commit c83499b4c3f21a922a535294a27abc8046917e7c
1 parent
facb6c13
-Order index translate
Showing
3 changed files
with
21 additions
and
13 deletions
Show diff stats
models/Order.php
| ... | ... | @@ -183,7 +183,7 @@ |
| 183 | 183 | public function afterFind() |
| 184 | 184 | { |
| 185 | 185 | parent::afterFind(); |
| 186 | - $this->deadline = !empty( $this->deadline ) ? date('d.m.Y', $this->deadline) : ''; | |
| 186 | + $this->deadline = !empty($this->deadline) ? date('d.m.Y', $this->deadline) : ''; | |
| 187 | 187 | |
| 188 | 188 | } |
| 189 | 189 | |
| ... | ... | @@ -200,7 +200,7 @@ |
| 200 | 200 | |
| 201 | 201 | protected function convertDate() |
| 202 | 202 | { |
| 203 | - if (!empty( $this->deadline )) { | |
| 203 | + if (!empty($this->deadline)) { | |
| 204 | 204 | $date = new \DateTime(); |
| 205 | 205 | $date->setTimestamp(strtotime($this->deadline)); |
| 206 | 206 | $date->format("d.m.Y"); |
| ... | ... | @@ -215,7 +215,7 @@ |
| 215 | 215 | return [ |
| 216 | 216 | 'name' => Yii::t('app', 'order_name'), |
| 217 | 217 | 'phone' => Yii::t('app', 'order_phone'), |
| 218 | - 'email' => Yii::t('app', 'order_email'), | |
| 218 | + 'email' => Yii::t('app', 'E-mail'), | |
| 219 | 219 | 'comment' => Yii::t('app', 'order_comment'), |
| 220 | 220 | 'created_at' => Yii::t('app', 'Дата добавления'), |
| 221 | 221 | 'updated_at' => Yii::t('app', 'Дата обновления'), |
| ... | ... | @@ -228,9 +228,14 @@ |
| 228 | 228 | 'manager_id' => Yii::t('app', 'Менеджер'), |
| 229 | 229 | 'delivery_cost' => Yii::t('app', 'Стоимость доставки'), |
| 230 | 230 | 'published' => Yii::t('app', 'Опубликован'), |
| 231 | - 'label' => Yii::t('app', 'Метка'), | |
| 232 | - 'declaration' => Yii::t('app', 'Номер декларации'), | |
| 233 | - 'delivery' => Yii::t('app', 'Способ доставки'), | |
| 231 | + 'label' => Yii::t('app', 'Метка'), | |
| 232 | + 'declaration' => Yii::t('app', 'Номер декларации'), | |
| 233 | + 'delivery' => Yii::t('app', 'Способ доставки'), | |
| 234 | + 'total' => Yii::t('app', 'Сумма'), | |
| 235 | + 'adress' => Yii::t('app', 'Адрес'), | |
| 236 | + 'pay' => Yii::t('app', 'Оплата'), | |
| 237 | + 'body' => Yii::t('app', 'Комментарий'), | |
| 238 | + 'id' => Yii::t('app', 'Номер'), | |
| 234 | 239 | ]; |
| 235 | 240 | } |
| 236 | 241 | |
| ... | ... | @@ -276,8 +281,8 @@ |
| 276 | 281 | */ |
| 277 | 282 | public function getDeliveryString() |
| 278 | 283 | { |
| 279 | - if (!empty( $this->orderDelivery )) { | |
| 280 | - if (!empty( $this->orderDelivery->parent )) { | |
| 284 | + if (!empty($this->orderDelivery)) { | |
| 285 | + if (!empty($this->orderDelivery->parent)) { | |
| 281 | 286 | return $this->orderDelivery->parent->lang->title . ': ' . $this->orderDelivery->lang->title; |
| 282 | 287 | } else { |
| 283 | 288 | return $this->orderDelivery->lang->title; |
| ... | ... | @@ -295,7 +300,7 @@ |
| 295 | 300 | */ |
| 296 | 301 | public function getWasted() |
| 297 | 302 | { |
| 298 | - if (empty( $this->deadline )) { | |
| 303 | + if (empty($this->deadline)) { | |
| 299 | 304 | return false; |
| 300 | 305 | } else { |
| 301 | 306 | return time() > strtotime($this->deadline); | ... | ... |
models/OrderSearch.php
| ... | ... | @@ -4,6 +4,7 @@ |
| 4 | 4 | |
| 5 | 5 | use yii\base\Model; |
| 6 | 6 | use yii\data\ActiveDataProvider; |
| 7 | + use yii\helpers\ArrayHelper; | |
| 7 | 8 | use yii\helpers\VarDumper; |
| 8 | 9 | |
| 9 | 10 | /** |
| ... | ... | @@ -193,8 +194,10 @@ |
| 193 | 194 | |
| 194 | 195 | public function attributeLabels() |
| 195 | 196 | { |
| 196 | - return [ | |
| 197 | - 'sku' => \Yii::t('app', 'Артикул'), | |
| 197 | + $labels = [ | |
| 198 | + 'sku' => \Yii::t('app', 'Артикул'), | |
| 198 | 199 | ]; |
| 200 | + | |
| 201 | + return ArrayHelper::merge($labels, parent::attributeLabels()); | |
| 199 | 202 | } |
| 200 | 203 | } | ... | ... |
views/order/index.php
| ... | ... | @@ -78,7 +78,7 @@ JS; |
| 78 | 78 | ->indexBy('id') |
| 79 | 79 | ->asArray() |
| 80 | 80 | ->column(), |
| 81 | - 'options' => [ 'placeholder' => 'Select a state ...' ], | |
| 81 | + 'options' => [ 'placeholder' => 'Выберите метки ...' ], | |
| 82 | 82 | 'pluginOptions' => [ |
| 83 | 83 | 'allowClear' => true, |
| 84 | 84 | 'multiple' => true, |
| ... | ... | @@ -97,7 +97,7 @@ JS; |
| 97 | 97 | ->indexBy('id') |
| 98 | 98 | ->asArray() |
| 99 | 99 | ->column(), |
| 100 | - 'options' => [ 'placeholder' => 'Select a state ...' ], | |
| 100 | + 'options' => [ 'placeholder' => 'Выберите способ доставки ...' ], | |
| 101 | 101 | 'pluginOptions' => [ |
| 102 | 102 | 'allowClear' => true, |
| 103 | 103 | 'multiple' => true, | ... | ... |