Skip to content

Commit

Permalink
closed #2537
Browse files Browse the repository at this point in the history
  • Loading branch information
yupe committed Aug 5, 2016
1 parent d21fe61 commit 2bf68f5
Show file tree
Hide file tree
Showing 10 changed files with 143 additions and 72 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -7,6 +7,7 @@
- #2489: Исправлено отображение заголовков страниц (@sabian, @PushingUp)
- #2492: Выбор цвета для пользовательских статусов заказов (@sabian)
- #2522: Удален неактуальный статус товара (@sabian)
- #2537: Добавлено поле "описание" для атрибутов товара (@samox1n, @yupe)

Версия 1.0-beta-2 17 июня 2016
-------------------------
Expand Down
88 changes: 44 additions & 44 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion protected/modules/order/views/orderBackend/index.php
Expand Up @@ -41,7 +41,7 @@
],
];
?>
<div class="">
<div>
<h1>
<?= Yii::t('OrderModule.order', 'Orders'); ?>
<small><?= Yii::t('OrderModule.order', 'manage'); ?></small>
Expand Down
@@ -0,0 +1,14 @@
<?php

class m160805_070905_add_attribute_description extends yupe\components\DbMigration
{
public function safeUp()
{
$this->addColumn('{{store_attribute}}', 'description', 'text null');
}

public function safeDown()
{
$this->dropColumn('{{store_attribute}}', 'description');
}
}
2 changes: 1 addition & 1 deletion protected/modules/store/messages/ru/store.php
Expand Up @@ -272,7 +272,7 @@
'Total price' => 'Итоговая цена',
'Type attributes' => 'Атрибуты типа',
'Type manage' => 'Управление типами',
'Type' => 'Тип атрибута',
'Type' => 'Тип',
'Types list' => 'Типы товаров',
'Types' => 'Типы товаров',
'Unit' => 'Единица измерения',
Expand Down
12 changes: 7 additions & 5 deletions protected/modules/store/models/Attribute.php
Expand Up @@ -13,7 +13,7 @@
* @property string $unit
* @property integer $sort
* @property integer $is_filter
*
* @property string $description
* @property-read AttributeOption[] $options
* @property-read AttributeGroup $group
*
Expand Down Expand Up @@ -79,7 +79,8 @@ public static function model($className = __CLASS__)
public function rules()
{
return [
['name, title', 'filter', 'filter' => 'trim'],
['name, title, description', 'filter', 'filter' => 'trim'],
['name, title, description', 'filter', 'filter' => 'strip_tags'],
['name, type, title', 'required'],
['name', 'unique'],
[
Expand Down Expand Up @@ -126,6 +127,7 @@ public function attributeLabels()
'unit' => Yii::t('StoreModule.store', 'Unit'),
'sort' => Yii::t('StoreModule.store', 'Sort'),
'is_filter' => Yii::t('StoreModule.store', 'Filter'),
'description' => Yii::t('StoreModule.store', 'Description'),
];
}

Expand Down Expand Up @@ -191,7 +193,7 @@ public function getTypesList()
self::TYPE_CHECKBOX => Yii::t('StoreModule.store', 'Checkbox'),
self::TYPE_NUMBER => Yii::t('StoreModule.store', 'Number'),
self::TYPE_FILE => Yii::t('StoreModule.store', 'File'),
self::TYPE_CHECKBOX_LIST => Yii::t('StoreModule.store', 'Checkbox list')
self::TYPE_CHECKBOX_LIST => Yii::t('StoreModule.store', 'Checkbox list'),
];
}

Expand Down Expand Up @@ -355,7 +357,7 @@ public function getTypes()
*/
public function setMultipleValuesAttributes(array $attributes)
{
if(!$this->isMultipleValues()){
if (!$this->isMultipleValues()) {
return true;
}

Expand Down Expand Up @@ -390,7 +392,7 @@ public function setMultipleValuesAttributes(array $attributes)
*/
public function isMultipleValues()
{
return $this->type == self::TYPE_DROPDOWN || $this->type == self::TYPE_CHECKBOX_LIST;
return $this->type == self::TYPE_DROPDOWN || $this->type == self::TYPE_CHECKBOX_LIST;
}

/**
Expand Down

0 comments on commit 2bf68f5

Please sign in to comment.