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,7 +183,7 @@ | ||
183 | public function afterFind() | 183 | public function afterFind() |
184 | { | 184 | { |
185 | parent::afterFind(); | 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,7 +200,7 @@ | ||
200 | 200 | ||
201 | protected function convertDate() | 201 | protected function convertDate() |
202 | { | 202 | { |
203 | - if (!empty( $this->deadline )) { | 203 | + if (!empty($this->deadline)) { |
204 | $date = new \DateTime(); | 204 | $date = new \DateTime(); |
205 | $date->setTimestamp(strtotime($this->deadline)); | 205 | $date->setTimestamp(strtotime($this->deadline)); |
206 | $date->format("d.m.Y"); | 206 | $date->format("d.m.Y"); |
@@ -215,7 +215,7 @@ | @@ -215,7 +215,7 @@ | ||
215 | return [ | 215 | return [ |
216 | 'name' => Yii::t('app', 'order_name'), | 216 | 'name' => Yii::t('app', 'order_name'), |
217 | 'phone' => Yii::t('app', 'order_phone'), | 217 | 'phone' => Yii::t('app', 'order_phone'), |
218 | - 'email' => Yii::t('app', 'order_email'), | 218 | + 'email' => Yii::t('app', 'E-mail'), |
219 | 'comment' => Yii::t('app', 'order_comment'), | 219 | 'comment' => Yii::t('app', 'order_comment'), |
220 | 'created_at' => Yii::t('app', 'Дата добавления'), | 220 | 'created_at' => Yii::t('app', 'Дата добавления'), |
221 | 'updated_at' => Yii::t('app', 'Дата обновления'), | 221 | 'updated_at' => Yii::t('app', 'Дата обновления'), |
@@ -228,9 +228,14 @@ | @@ -228,9 +228,14 @@ | ||
228 | 'manager_id' => Yii::t('app', 'Менеджер'), | 228 | 'manager_id' => Yii::t('app', 'Менеджер'), |
229 | 'delivery_cost' => Yii::t('app', 'Стоимость доставки'), | 229 | 'delivery_cost' => Yii::t('app', 'Стоимость доставки'), |
230 | 'published' => Yii::t('app', 'Опубликован'), | 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,8 +281,8 @@ | ||
276 | */ | 281 | */ |
277 | public function getDeliveryString() | 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 | return $this->orderDelivery->parent->lang->title . ': ' . $this->orderDelivery->lang->title; | 286 | return $this->orderDelivery->parent->lang->title . ': ' . $this->orderDelivery->lang->title; |
282 | } else { | 287 | } else { |
283 | return $this->orderDelivery->lang->title; | 288 | return $this->orderDelivery->lang->title; |
@@ -295,7 +300,7 @@ | @@ -295,7 +300,7 @@ | ||
295 | */ | 300 | */ |
296 | public function getWasted() | 301 | public function getWasted() |
297 | { | 302 | { |
298 | - if (empty( $this->deadline )) { | 303 | + if (empty($this->deadline)) { |
299 | return false; | 304 | return false; |
300 | } else { | 305 | } else { |
301 | return time() > strtotime($this->deadline); | 306 | return time() > strtotime($this->deadline); |
models/OrderSearch.php
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | 4 | ||
5 | use yii\base\Model; | 5 | use yii\base\Model; |
6 | use yii\data\ActiveDataProvider; | 6 | use yii\data\ActiveDataProvider; |
7 | + use yii\helpers\ArrayHelper; | ||
7 | use yii\helpers\VarDumper; | 8 | use yii\helpers\VarDumper; |
8 | 9 | ||
9 | /** | 10 | /** |
@@ -193,8 +194,10 @@ | @@ -193,8 +194,10 @@ | ||
193 | 194 | ||
194 | public function attributeLabels() | 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,7 +78,7 @@ JS; | ||
78 | ->indexBy('id') | 78 | ->indexBy('id') |
79 | ->asArray() | 79 | ->asArray() |
80 | ->column(), | 80 | ->column(), |
81 | - 'options' => [ 'placeholder' => 'Select a state ...' ], | 81 | + 'options' => [ 'placeholder' => 'Выберите метки ...' ], |
82 | 'pluginOptions' => [ | 82 | 'pluginOptions' => [ |
83 | 'allowClear' => true, | 83 | 'allowClear' => true, |
84 | 'multiple' => true, | 84 | 'multiple' => true, |
@@ -97,7 +97,7 @@ JS; | @@ -97,7 +97,7 @@ JS; | ||
97 | ->indexBy('id') | 97 | ->indexBy('id') |
98 | ->asArray() | 98 | ->asArray() |
99 | ->column(), | 99 | ->column(), |
100 | - 'options' => [ 'placeholder' => 'Select a state ...' ], | 100 | + 'options' => [ 'placeholder' => 'Выберите способ доставки ...' ], |
101 | 'pluginOptions' => [ | 101 | 'pluginOptions' => [ |
102 | 'allowClear' => true, | 102 | 'allowClear' => true, |
103 | 'multiple' => true, | 103 | 'multiple' => true, |