Commit 02d3b38688c356a2158a7e0ec96ca138fb9cd62d

Authored by Mihail
2 parents 98533894 4f24d74c

merge with server

backend/models/Importers.php
@@ -6,7 +6,7 @@ use Yii; @@ -6,7 +6,7 @@ use Yii;
6 use backend\components\base\BaseActiveRecord; 6 use backend\components\base\BaseActiveRecord;
7 7
8 /** 8 /**
9 - * This is the model class for table "{{%importer}}". 9 + *
10 * 10 *
11 * @property integer $id 11 * @property integer $id
12 * @property string $code 12 * @property string $code
@@ -33,6 +33,9 @@ use backend\components\base\BaseActiveRecord; @@ -33,6 +33,9 @@ use backend\components\base\BaseActiveRecord;
33 */ 33 */
34 class Importers extends BaseActiveRecord 34 class Importers extends BaseActiveRecord
35 { 35 {
  36 + /**
  37 + * @inheritdoc
  38 + */
36 39
37 public function rules() 40 public function rules()
38 { 41 {
@@ -56,27 +59,27 @@ class Importers extends BaseActiveRecord @@ -56,27 +59,27 @@ class Importers extends BaseActiveRecord
56 public function attributeLabels() 59 public function attributeLabels()
57 { 60 {
58 return [ 61 return [
59 - 'id' => Yii::t('app', 'ID'),  
60 - 'code' => Yii::t('app', 'Code'),  
61 - 'name' => Yii::t('app', 'Name'),  
62 - 'name_price' => Yii::t('app', 'Name Price'),  
63 - 'currency_id' => Yii::t('app', 'Currency ID'),  
64 - 'delivery' => Yii::t('app', 'Delivery'),  
65 - 'email' => Yii::t('app', 'Email'),  
66 - 'info' => Yii::t('app', 'Info'),  
67 - 'active' => Yii::t('app', 'Active'),  
68 - 'PARSER_IS_ACTIVE' => Yii::t('app', 'Parser Is Active'),  
69 - 'PARSER_COLUMN_COUNT' => Yii::t('app', 'Parser Column Count'),  
70 - 'PARSER_FIELD_BRAND' => Yii::t('app', 'Parser Field Brand'),  
71 - 'PARSER_FIELD_ARTICLE' => Yii::t('app', 'Parser Field Article'),  
72 - 'PARSER_FIELD_ARTICLE_PREFIX' => Yii::t('app', 'Parser Field Article Prefix'),  
73 - 'PARSER_FIELD_PRICE' => Yii::t('app', 'Parser Field Price'),  
74 - 'PARSER_FIELD_DESCR' => Yii::t('app', 'Parser Field Descr'),  
75 - 'PARSER_FIELD_BOX' => Yii::t('app', 'Parser Field Box'),  
76 - 'PARSER_FIELD_ADD_BOX' => Yii::t('app', 'Parser Field Add Box'),  
77 - 'PARSER_FIELD_GROUP_RG' => Yii::t('app', 'Parser Field Group Rg'),  
78 - 'PARSER_FIELD_SIGN' => Yii::t('app', 'Parser Field Sign'),  
79 - 'PARSER_FIELD_MULTIPLIER' => Yii::t('app', 'Parser Field Multiplier'), 62 + 'id' =>'ID',
  63 + 'code' => 'Код',
  64 + 'name' => 'Название',
  65 + 'name_price' => 'Прайс лист',
  66 + 'currency_id' => 'Валюта',
  67 + 'delivery' => 'Ожидаемый срок, дн.',
  68 + 'email' => 'E-mail',
  69 + 'info' => 'Комментарий к поставщику',
  70 + 'active' => 'Активность',
  71 + 'PARSER_IS_ACTIVE' => 'Активность авто колонок',
  72 + 'PARSER_COLUMN_COUNT' => 'Количество колонок (только загрузка с почты)',
  73 + 'PARSER_FIELD_BRAND' => '№ колонки с брендом',
  74 + 'PARSER_FIELD_ARTICLE' => '№ колонки с артикулом',
  75 + 'PARSER_FIELD_ARTICLE_PREFIX' => 'Колонка с префиксом?',
  76 + 'PARSER_FIELD_PRICE' => '№ колонки с ценой',
  77 + 'PARSER_FIELD_DESCR' => '№ колонки с наименованием',
  78 + 'PARSER_FIELD_BOX' => '№ колонки с количеством',
  79 + 'PARSER_FIELD_ADD_BOX' => '№ колонки с удалённым наличием',
  80 + 'PARSER_FIELD_GROUP_RG' => '№ колонки с группой RG',
  81 + 'PARSER_FIELD_SIGN' => 'Операция с ценой',
  82 + 'PARSER_FIELD_MULTIPLIER' => 'Значение операции',
80 'price_date_update' => Yii::t('app', 'Price Date Update'), 83 'price_date_update' => Yii::t('app', 'Price Date Update'),
81 ]; 84 ];
82 } 85 }
backend/web/css/plugins/daterangepicker/daterangepicker-bs3.css 100755 → 100644
backend/web/css/plugins/daterangepicker/daterangepicker.js 100755 → 100644
backend/web/css/plugins/daterangepicker/moment.js 100755 → 100644
backend/web/css/plugins/daterangepicker/moment.min.js 100755 → 100644
common/config/.gitignore
No preview for this file type
common/config/main-local.php 0 → 100644
  1 +<?php
  2 +return [
  3 + 'components' => [
  4 + 'db' => [
  5 + //'class' => 'yii\db\Connection',
  6 + 'class' => 'backend\components\base\CustomDbConnection',
  7 + 'dsn' => 'mysql:host=195.248.225.150;dbname=italautocomua',
  8 + 'username' => 'italautocomua',
  9 + 'password' => 'MBi7jrTl2',
  10 + 'charset' => 'utf8',
  11 + 'tablePrefix' => 'w_',
  12 + ],
  13 + 'mailer' => [
  14 + 'class' => 'yii\swiftmailer\Mailer',
  15 + 'viewPath' => '@common/mail',
  16 + // send all mails to a file by default. You have to set
  17 + // 'useFileTransport' to false and configure a transport
  18 + // for the mailer to send real emails.
  19 + 'useFileTransport' => true,
  20 + ],
  21 + ],
  22 +];
common/config/params-local.php 0 → 100644
  1 +<?php
  2 +return [
  3 +];
common/models/WAccounts.php deleted
1 -<?php  
2 -  
3 -namespace common\models;  
4 -  
5 -use Yii;  
6 -  
7 -/**  
8 - * This is the model class for table "w_accounts".  
9 - *  
10 - * @property integer $id  
11 - * @property integer $if_manager  
12 - * @property string $email  
13 - * @property string $pass  
14 - * @property integer $margin_id  
15 - * @property string $name  
16 - * @property string $phones  
17 - * @property integer $country  
18 - * @property integer $city  
19 - * @property string $address  
20 - * @property string $comment  
21 - * @property integer $rating  
22 - * @property string $dt  
23 - * @property integer $is_active  
24 - * @property integer $is_firm  
25 - * @property string $last_loginin  
26 - * @property string $firm_inn  
27 - * @property string $firm_bank  
28 - * @property double $balance  
29 - * @property integer $office_id  
30 - * @property integer $is_scribe  
31 - * @property integer $set_manager_id  
32 - * @property string $phones2  
33 - * @property string $phones3  
34 - * @property integer $car  
35 - * @property integer $mod  
36 - * @property string $snumb  
37 - * @property integer $deliveries  
38 - * @property integer $scode  
39 - * @property string $firm_ur_adr  
40 - * @property string $firm_fiz_adr  
41 - * @property string $firm_code_eg  
42 - * @property string $firm_rs  
43 - * @property string $firm_mfo  
44 - * @property string $firm_site  
45 - * @property string $company  
46 - */  
47 -class WAccounts extends \yii\db\ActiveRecord  
48 -{  
49 - /**  
50 - * @inheritdoc  
51 - */  
52 - public static function tableName()  
53 - {  
54 - return 'w_accounts';  
55 - }  
56 -  
57 - /**  
58 - * @inheritdoc  
59 - */  
60 - public function rules()  
61 - {  
62 - return [  
63 - [['if_manager', 'margin_id', 'country', 'city', 'rating', 'dt', 'is_active', 'is_firm', 'office_id', 'is_scribe', 'set_manager_id', 'car', 'mod', 'deliveries', 'scode'], 'integer'],  
64 - [['email', 'pass', 'name', 'phones', 'comment', 'dt', 'set_manager_id'], 'required'],  
65 - [['comment'], 'string'],  
66 - [['balance'], 'number'],  
67 - [['email', 'name', 'firm_site'], 'string', 'max' => 150],  
68 - [['pass'], 'string', 'max' => 30],  
69 - [['phones', 'phones2', 'phones3'], 'string', 'max' => 50],  
70 - [['address', 'firm_inn', 'firm_bank'], 'string', 'max' => 254],  
71 - [['last_loginin'], 'string', 'max' => 15],  
72 - [['snumb', 'firm_ur_adr', 'firm_fiz_adr', 'firm_code_eg', 'firm_rs', 'firm_mfo', 'company'], 'string', 'max' => 255],  
73 - [['email'], 'unique']  
74 - ];  
75 - }  
76 -  
77 - /**  
78 - * @inheritdoc  
79 - */  
80 - public function attributeLabels()  
81 - {  
82 - return [  
83 - 'id' => Yii::t('app', 'ID'),  
84 - 'if_manager' => Yii::t('app', 'If Manager'),  
85 - 'email' => Yii::t('app', 'Email'),  
86 - 'pass' => Yii::t('app', 'Pass'),  
87 - 'margin_id' => Yii::t('app', 'Margin ID'),  
88 - 'name' => Yii::t('app', 'Name'),  
89 - 'phones' => Yii::t('app', 'Phones'),  
90 - 'country' => Yii::t('app', 'Country'),  
91 - 'city' => Yii::t('app', 'City'),  
92 - 'address' => Yii::t('app', 'Address'),  
93 - 'comment' => Yii::t('app', 'Comment'),  
94 - 'rating' => Yii::t('app', 'Rating'),  
95 - 'dt' => Yii::t('app', 'Dt'),  
96 - 'is_active' => Yii::t('app', 'Is Active'),  
97 - 'is_firm' => Yii::t('app', 'Is Firm'),  
98 - 'last_loginin' => Yii::t('app', 'Last Loginin'),  
99 - 'firm_inn' => Yii::t('app', 'Firm Inn'),  
100 - 'firm_bank' => Yii::t('app', 'Firm Bank'),  
101 - 'balance' => Yii::t('app', 'Balance'),  
102 - 'office_id' => Yii::t('app', 'Office ID'),  
103 - 'is_scribe' => Yii::t('app', 'Is Scribe'),  
104 - 'set_manager_id' => Yii::t('app', 'Set Manager ID'),  
105 - 'phones2' => Yii::t('app', 'Phones2'),  
106 - 'phones3' => Yii::t('app', 'Phones3'),  
107 - 'car' => Yii::t('app', 'Car'),  
108 - 'mod' => Yii::t('app', 'Mod'),  
109 - 'snumb' => Yii::t('app', 'Snumb'),  
110 - 'deliveries' => Yii::t('app', 'Deliveries'),  
111 - 'scode' => Yii::t('app', 'Scode'),  
112 - 'firm_ur_adr' => Yii::t('app', 'Firm Ur Adr'),  
113 - 'firm_fiz_adr' => Yii::t('app', 'Firm Fiz Adr'),  
114 - 'firm_code_eg' => Yii::t('app', 'Firm Code Eg'),  
115 - 'firm_rs' => Yii::t('app', 'Firm Rs'),  
116 - 'firm_mfo' => Yii::t('app', 'Firm Mfo'),  
117 - 'firm_site' => Yii::t('app', 'Firm Site'),  
118 - 'company' => Yii::t('app', 'Company'),  
119 - ];  
120 - }  
121 -}  
common/models/WAccountsSearch.php deleted
1 -<?php  
2 -  
3 -namespace common\models;  
4 -  
5 -use Yii;  
6 -use yii\base\Model;  
7 -use yii\data\ActiveDataProvider;  
8 -use common\models\WAccounts;  
9 -  
10 -/**  
11 - * WAccountsSearch represents the model behind the search form about `common\models\WAccounts`.  
12 - */  
13 -class WAccountsSearch extends WAccounts  
14 -{  
15 - /**  
16 - * @inheritdoc  
17 - */  
18 - public function rules()  
19 - {  
20 - return [  
21 - [['id', 'if_manager', 'margin_id', 'country', 'city', 'rating', 'dt', 'is_active', 'is_firm', 'office_id', 'is_scribe', 'set_manager_id', 'car', 'mod', 'deliveries', 'scode'], 'integer'],  
22 - [['email', 'pass', 'name', 'phones', 'address', 'comment', 'last_loginin', 'firm_inn', 'firm_bank', 'phones2', 'phones3', 'snumb', 'firm_ur_adr', 'firm_fiz_adr', 'firm_code_eg', 'firm_rs', 'firm_mfo', 'firm_site', 'company'], 'safe'],  
23 - [['balance'], 'number'],  
24 - ];  
25 - }  
26 -  
27 - /**  
28 - * @inheritdoc  
29 - */  
30 - public function scenarios()  
31 - {  
32 - // bypass scenarios() implementation in the parent class  
33 - return Model::scenarios();  
34 - }  
35 -  
36 - /**  
37 - * Creates data provider instance with search query applied  
38 - *  
39 - * @param array $params  
40 - *  
41 - * @return ActiveDataProvider  
42 - */  
43 - public function search($params)  
44 - {  
45 - $query = WAccounts::find();  
46 -  
47 - $dataProvider = new ActiveDataProvider([  
48 - 'query' => $query,  
49 - ]);  
50 -  
51 - $this->load($params);  
52 -  
53 - if (!$this->validate()) {  
54 - // uncomment the following line if you do not want to return any records when validation fails  
55 - // $query->where('0=1');  
56 - return $dataProvider;  
57 - }  
58 -  
59 - $query->andFilterWhere([  
60 - 'id' => $this->id,  
61 - 'if_manager' => $this->if_manager,  
62 - 'margin_id' => $this->margin_id,  
63 - 'country' => $this->country,  
64 - 'city' => $this->city,  
65 - 'rating' => $this->rating,  
66 - 'dt' => $this->dt,  
67 - 'is_active' => $this->is_active,  
68 - 'is_firm' => $this->is_firm,  
69 - 'balance' => $this->balance,  
70 - 'office_id' => $this->office_id,  
71 - 'is_scribe' => $this->is_scribe,  
72 - 'set_manager_id' => $this->set_manager_id,  
73 - 'car' => $this->car,  
74 - 'mod' => $this->mod,  
75 - 'deliveries' => $this->deliveries,  
76 - 'scode' => $this->scode,  
77 - ]);  
78 -  
79 - $query->andFilterWhere(['like', 'email', $this->email])  
80 - ->andFilterWhere(['like', 'pass', $this->pass])  
81 - ->andFilterWhere(['like', 'name', $this->name])  
82 - ->andFilterWhere(['like', 'phones', $this->phones])  
83 - ->andFilterWhere(['like', 'address', $this->address])  
84 - ->andFilterWhere(['like', 'comment', $this->comment])  
85 - ->andFilterWhere(['like', 'last_loginin', $this->last_loginin])  
86 - ->andFilterWhere(['like', 'firm_inn', $this->firm_inn])  
87 - ->andFilterWhere(['like', 'firm_bank', $this->firm_bank])  
88 - ->andFilterWhere(['like', 'phones2', $this->phones2])  
89 - ->andFilterWhere(['like', 'phones3', $this->phones3])  
90 - ->andFilterWhere(['like', 'snumb', $this->snumb])  
91 - ->andFilterWhere(['like', 'firm_ur_adr', $this->firm_ur_adr])  
92 - ->andFilterWhere(['like', 'firm_fiz_adr', $this->firm_fiz_adr])  
93 - ->andFilterWhere(['like', 'firm_code_eg', $this->firm_code_eg])  
94 - ->andFilterWhere(['like', 'firm_rs', $this->firm_rs])  
95 - ->andFilterWhere(['like', 'firm_mfo', $this->firm_mfo])  
96 - ->andFilterWhere(['like', 'firm_site', $this->firm_site])  
97 - ->andFilterWhere(['like', 'company', $this->company]);  
98 -  
99 - return $dataProvider;  
100 - }  
101 -}  
common/models/WDicCities.php deleted
1 -<?php  
2 -  
3 -namespace common\models;  
4 -  
5 -use Yii;  
6 -  
7 -/**  
8 - * This is the model class for table "w_dic_cities".  
9 - *  
10 - * @property integer $id  
11 - * @property string $name  
12 - * @property integer $is_active  
13 - * @property integer $parent  
14 - */  
15 -class WDicCities extends \yii\db\ActiveRecord  
16 -{  
17 - /**  
18 - * @inheritdoc  
19 - */  
20 - public static function tableName()  
21 - {  
22 - return 'w_dic_cities';  
23 - }  
24 -  
25 - /**  
26 - * @inheritdoc  
27 - */  
28 - public function rules()  
29 - {  
30 - return [  
31 - [['name', 'parent'], 'required'],  
32 - [['is_active', 'parent'], 'integer'],  
33 - [['name'], 'string', 'max' => 254],  
34 - [['parent', 'name'], 'unique', 'targetAttribute' => ['parent', 'name'], 'message' => 'The combination of Name and Parent has already been taken.']  
35 - ];  
36 - }  
37 -  
38 - /**  
39 - * @inheritdoc  
40 - */  
41 - public function attributeLabels()  
42 - {  
43 - return [  
44 - 'id' => Yii::t('app', 'ID'),  
45 - 'name' => Yii::t('app', 'Name'),  
46 - 'is_active' => Yii::t('app', 'Is Active'),  
47 - 'parent' => Yii::t('app', 'Parent'),  
48 - ];  
49 - }  
50 -}  
console/migrations/m130524_201442_init.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Schema;
  4 +use yii\db\Migration;
  5 +
  6 +class m130524_201442_init extends Migration
  7 +{
  8 + public function up()
  9 + {
  10 + $tableOptions = null;
  11 + if ($this->db->driverName === 'mysql') {
  12 + // http://stackoverflow.com/questions/766809/whats-the-difference-between-utf8-general-ci-and-utf8-unicode-ci
  13 + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
  14 + }
  15 +
  16 + $this->createTable('{{%user}}', [
  17 + 'id' => $this->primaryKey(),
  18 + 'username' => $this->string()->notNull()->unique(),
  19 + 'auth_key' => $this->string(32)->notNull(),
  20 + 'password_hash' => $this->string()->notNull(),
  21 + 'password_reset_token' => $this->string()->unique(),
  22 + 'email' => $this->string()->notNull()->unique(),
  23 +
  24 + 'status' => $this->smallInteger()->notNull()->defaultValue(10),
  25 + 'created_at' => $this->integer()->notNull(),
  26 + 'updated_at' => $this->integer()->notNull(),
  27 + ], $tableOptions);
  28 + }
  29 +
  30 + public function down()
  31 + {
  32 + $this->dropTable('{{%user}}');
  33 + }
  34 +}
console/migrations/m150818_125718_create_user_180815.php 0 → 100644
  1 +<?php
  2 +
  3 +
  4 +use yii\db\Schema;
  5 +use yii\db\Migration;
  6 +
  7 +
  8 +class m150818_125718_create_user_180815 extends Migration
  9 +{
  10 + public function up()
  11 + {
  12 +
  13 +
  14 + $user_array = [
  15 + 'username' => 'admin',
  16 + 'auth_key' => 'admin',
  17 + 'password_hash' => Yii::$app->security->generatePasswordHash('admin'),
  18 + 'password_reset_token' => 'admin',
  19 + 'email'=> 'admin@test.com',
  20 + 'status' => '10',
  21 + 'created_at'=>'000000',
  22 + 'updated_at' => '000000'
  23 + ];
  24 + $this->insert('{{%user}}', $user_array);
  25 + }
  26 +
  27 +
  28 +
  29 + public function down()
  30 + {
  31 + $this->dropTable('{{%user}}');
  32 + }
  33 +
  34 + /*
  35 + // Use safeUp/safeDown to run migration code within a transaction
  36 + public function safeUp()
  37 + {
  38 + }
  39 +
  40 + public function safeDown()
  41 + {
  42 + }
  43 + */
  44 +}
console/migrations/m150831_130250_addImporters.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Schema;
  4 +use yii\db\Migration;
  5 +
  6 +class m150831_130250_addImporters extends Migration
  7 +{
  8 + public function up()
  9 + {
  10 + $tableOptions = null;
  11 + if ($this->db->driverName === 'mysql') {
  12 + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
  13 + }
  14 +
  15 + $this->createTable('{{%importer}}', [
  16 + 'id' => $this->primaryKey(6)->notNull() . ' AUTO_INCREMENT',
  17 + 'code' =>'varchar(254) NOT NULL',
  18 + 'name' => 'varchar(254) NOT NULL',
  19 + 'name_price' => 'varchar(254) NOT NULL',
  20 + 'currency_id' => 'int(3) unsigned NOT NULL',
  21 + 'delivery' => 'varchar(254) NOT NULL',
  22 + 'email' => 'varchar(254) NOT NULL',
  23 + 'info' => 'text NOT NULL',
  24 + 'active' => 'tinyint(1) unsigned NOT NULL DEFAULT 1',
  25 + 'PARSER_IS_ACTIVE' => 'tinyint(1) unsigned NOT NULL DEFAULT 0',
  26 + 'PARSER_COLUMN_COUNT' => 'int(6) unsigned DEFAULT NULL',
  27 + 'PARSER_FIELD_BRAND' => 'int(3) unsigned DEFAULT NULL',
  28 + 'PARSER_FIELD_ARTICLE' => 'int(3) unsigned DEFAULT NULL',
  29 + 'PARSER_FIELD_ARTICLE_PREFIX' => 'tinyint(1) unsigned NOT NULL DEFAULT 0',
  30 + 'PARSER_FIELD_PRICE' => 'int(3) unsigned DEFAULT NULL',
  31 + 'PARSER_FIELD_DESCR' =>'int(3) unsigned DEFAULT NULL',
  32 + 'PARSER_FIELD_BOX' => 'int(3) unsigned DEFAULT NULL',
  33 + 'PARSER_FIELD_ADD_BOX' => 'int(3) unsigned DEFAULT NULL',
  34 + 'PARSER_FIELD_GROUP_RG' => 'int(3) unsigned DEFAULT NULL',
  35 + 'PARSER_FIELD_SIGN' => 'varchar(1) NOT NULL',
  36 + 'PARSER_FIELD_MULTIPLIER' => 'float(8,2) unsigned DEFAULT NULL',
  37 + 'price_date_update' => 'varchar(15) NOT NULL'
  38 +
  39 + ], $tableOptions);
  40 +
  41 + $this->createIndex('code', '{{%importer}}', 'code', true);
  42 + $this->createIndex('name', '{{%importer}}', 'name', true);
  43 + $this->createIndex('active', '{{%importer}}', 'active', false);
  44 + }
  45 +
  46 + public function down()
  47 + {
  48 + $this->dropTable('{{%importer}}');
  49 +
  50 + }
  51 +
  52 + /*
  53 + // Use safeUp/safeDown to run migration code within a transaction
  54 + public function safeUp()
  55 + {
  56 + }
  57 +
  58 + public function safeDown()
  59 + {
  60 + }
  61 + */
  62 +}
console/migrations/m150901_135806_addImportersFiles.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Schema;
  4 +use yii\db\Migration;
  5 +
  6 +class m150901_135806_addImportersFiles extends Migration
  7 +{
  8 + public function up()
  9 + {
  10 + $tableOptions = null;
  11 + if ($this->db->driverName === 'mysql') {
  12 + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
  13 + }
  14 +
  15 + $this->createTable('{{%importer_files}}', [
  16 + 'id' => $this->primaryKey(10)->notNull() . ' AUTO_INCREMENT',
  17 + 'importer_id' => 'int(6) unsigned NOT NULL',
  18 + 'upload_time' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP',
  19 + 'time_start' => 'timestamp NULL DEFAULT NULL',
  20 + 'time_end' => 'timestamp NULL DEFAULT NULL',
  21 + ], $tableOptions);
  22 +
  23 +
  24 + $this->createIndex('importer_id', '{{%importer_files}}', 'importer_id, time_start', false);
  25 + }
  26 +
  27 + public function down()
  28 + {
  29 + $this->dropTable('{{%importer_files}}');
  30 + }
  31 +
  32 + /*
  33 + // Use safeUp/safeDown to run migration code within a transaction
  34 + public function safeUp()
  35 + {
  36 + }
  37 +
  38 + public function safeDown()
  39 + {
  40 + }
  41 + */
  42 +}
console/migrations/m150901_141850_addImportersPrefix.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Schema;
  4 +use yii\db\Migration;
  5 +
  6 +class m150901_141850_addImportersPrefix extends Migration
  7 +{
  8 + public function up()
  9 + {
  10 + $tableOptions = null;
  11 + if ($this->db->driverName === 'mysql') {
  12 + $tableOptions = 'CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB';
  13 + }
  14 +
  15 + $this->createTable('{{%importer_prefix}}', [
  16 + 'id' => $this->primaryKey(10)->notNull() . ' AUTO_INCREMENT',
  17 + 'importer_id' => 'int(6) unsigned NOT NULL',
  18 + 'brand' => 'varchar(100) NOT NULL',
  19 + 'prefix' => 'varchar(50) NOT NULL',
  20 + 'timestamp' => 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP',
  21 + ], $tableOptions);
  22 +
  23 + $this->createIndex('importer_id', '{{%importer_prefix}}', 'importer_id, brand, prefix', true);
  24 + }
  25 +
  26 + public function down()
  27 + {
  28 + $this->dropTable('{{%importer_prefix}}');
  29 + }
  30 +
  31 + /*
  32 + // Use safeUp/safeDown to run migration code within a transaction
  33 + public function safeUp()
  34 + {
  35 + }
  36 +
  37 + public function safeDown()
  38 + {
  39 + }
  40 + */
  41 +}
console/migrations/m150915_125129_addDetails.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Schema;
  4 +use yii\db\Migration;
  5 +
  6 +class m150915_125129_addDetails extends Migration
  7 +{
  8 + public function up()
  9 + {
  10 + $this->execute('CREATE TABLE `details` (
  11 + `ID` int(10) unsigned NOT NULL AUTO_INCREMENT,
  12 + `IMPORT_ID` int(6) unsigned NOT NULL,
  13 + `BRAND` varchar(100) NOT NULL,
  14 + `ARTICLE` varchar(100) NOT NULL,
  15 + `FULL_ARTICLE` varchar(150) NOT NULL,
  16 + `PRICE` float(15,2) unsigned NOT NULL,
  17 + `DESCR` varchar(200) NOT NULL,
  18 + `BOX` int(6) unsigned NOT NULL,
  19 + `ADD_BOX` int(6) unsigned NOT NULL DEFAULT 0,
  20 + `GROUP` varchar(200) NOT NULL DEFAULT \'\',
  21 + `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  22 + PRIMARY KEY (`ARTICLE`,`BRAND`,`IMPORT_ID`),
  23 + UNIQUE KEY `ID_delete` (`ID`),
  24 + KEY `timestamp` (`timestamp`),
  25 + KEY `ARTICLE` (`ARTICLE`,`BRAND`,`BOX`),
  26 + KEY `BRAND` (`BRAND`,`ARTICLE`),
  27 + KEY `ARTICLE_2` (`ARTICLE`,`BRAND`,`ADD_BOX`),
  28 + KEY `IMPORT_ID` (`IMPORT_ID`,`ARTICLE`),
  29 + KEY `IMPORT_ID_2` (`IMPORT_ID`,`timestamp`)
  30 + ) ENGINE=InnoDB DEFAULT CHARSET=utf8');
  31 +
  32 + }
  33 +
  34 + public function down()
  35 + {
  36 + $this->dropTable('{{%details}}');
  37 +
  38 + }
  39 +
  40 +}
console/migrations/m150922_094313_change_key_ImportFiles.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Schema;
  4 +use yii\db\Migration;
  5 +
  6 +class m150922_094313_change_key_ImportFiles extends Migration
  7 +{
  8 + //@todo вероятно что эта миграция ненужна - посмотреть ближе к концу проекта на ключи которые используются - остальные удалить.
  9 + public function up()
  10 + {
  11 + $this->dropIndex('importer_id', '{{%importer_files}}');
  12 + $this->createIndex('importer_id', '{{%importer_files}}', 'importer_id, upload_time', false);
  13 + }
  14 +
  15 + public function down()
  16 + {
  17 + $this->dropIndex('importer_id', '{{%importer_files}}');
  18 + $this->createIndex('importer_id', '{{%importer_files}}', 'importer_id, time_start', false);
  19 + }
  20 +
  21 +
  22 +}
console/migrations/m150922_144040_change_Importer_dataPrice.php 0 → 100644
  1 +<?php
  2 +
  3 +use yii\db\Schema;
  4 +use yii\db\Migration;
  5 +
  6 +class m150922_144040_change_Importer_dataPrice extends Migration
  7 +{
  8 + public function up()
  9 + {
  10 + $this->alterColumn('{{%importer}}','price_date_update','TIMESTAMP' );
  11 + $this->createIndex('price_date', '{{%importer}}', 'price_date_update', false);
  12 + }
  13 +
  14 + public function down()
  15 + {
  16 + $this->alterColumn('{{%importer}}','price_date','varchar(15)' );
  17 + $this->dropIndex('price_date', '{{%importer}}');
  18 + }
  19 +
  20 +
  21 +}
framework/lang/da.yml
@@ -23,7 +23,7 @@ da: @@ -23,7 +23,7 @@ da:
23 PLEASESAVE: 'Gem siden: Denne side kunne ikke blive opdateret, fordi den endnu ikke er gemt.' 23 PLEASESAVE: 'Gem siden: Denne side kunne ikke blive opdateret, fordi den endnu ikke er gemt.'
24 ModelAdmin: 24 ModelAdmin:
25 DELETE: Slet 25 DELETE: Slet
26 - IMPORT: 'Importers fra CSV' 26 + IMPORT: 'Importer fra CSV'
27 NOCSVFILE: 'Tryk p&aring; Gennemse for at v&aelig;lge en CSVfil til importering' 27 NOCSVFILE: 'Tryk p&aring; Gennemse for at v&aelig;lge en CSVfil til importering'
28 NOIMPORT: 'Intet at importere' 28 NOIMPORT: 'Intet at importere'
29 SecurityAdmin: 29 SecurityAdmin:
framework/lang/fr.yml
@@ -234,7 +234,7 @@ fr: @@ -234,7 +234,7 @@ fr:
234 has_many_Permissions: Autorisations 234 has_many_Permissions: Autorisations
235 many_many_Members: Membres 235 many_many_Members: Membres
236 GroupImportForm: 236 GroupImportForm:
237 - Help1: '<p>Importers un ou plusieurs groupe(s) au format <em>CSV</em> (comma-separated values). <small><a href="#" class="toggle-advanced">Montrer l''usage avancé</a></small></p>' 237 + Help1: '<p>Importer un ou plusieurs groupe(s) au format <em>CSV</em> (comma-separated values). <small><a href="#" class="toggle-advanced">Montrer l''usage avancé</a></small></p>'
238 Help2: "<div class=\"advanced\">\n<h4>Utilisation avancée</h4>\n<ul>\n<li>Colonnes autorisées&nbsp;: <em>%s</em></li>\n<li>Les utilisateurs existants sont retrouvés avec leur <em>Code</em> unique et les registres sont mis à jour avec les nouvelles valeurs du fichier importé.</li>\n<li>Des hiérarchies de groupes peuvent être créées à l’aide de la colonne <em>ParentCode</em>.</li>\n<li>Les autorisations sont assignées par la colonne <em>PermissionCode</em>. Les autorisations actuelles ne sont pas modifiées.</li>\n</ul>\n</div>" 238 Help2: "<div class=\"advanced\">\n<h4>Utilisation avancée</h4>\n<ul>\n<li>Colonnes autorisées&nbsp;: <em>%s</em></li>\n<li>Les utilisateurs existants sont retrouvés avec leur <em>Code</em> unique et les registres sont mis à jour avec les nouvelles valeurs du fichier importé.</li>\n<li>Des hiérarchies de groupes peuvent être créées à l’aide de la colonne <em>ParentCode</em>.</li>\n<li>Les autorisations sont assignées par la colonne <em>PermissionCode</em>. Les autorisations actuelles ne sont pas modifiées.</li>\n</ul>\n</div>"
239 ResultCreated: '{count} groupes créés' 239 ResultCreated: '{count} groupes créés'
240 ResultDeleted: '%d groupes supprimés' 240 ResultDeleted: '%d groupes supprimés'
@@ -388,7 +388,7 @@ fr: @@ -388,7 +388,7 @@ fr:
388 TWODIGITYEAR: 'L’année sur deux chiffres' 388 TWODIGITYEAR: 'L’année sur deux chiffres'
389 Toggle: 'Afficher l’aide de mise en forme' 389 Toggle: 'Afficher l’aide de mise en forme'
390 MemberImportForm: 390 MemberImportForm:
391 - Help1: '<p>Importers les membres au format<em>CSV format</em> (comma-separated values). <small><a href="#" class="toggle-advanced">Afficher l''usage avancé.</a></small></p>' 391 + Help1: '<p>Importer les membres au format<em>CSV format</em> (comma-separated values). <small><a href="#" class="toggle-advanced">Afficher l''usage avancé.</a></small></p>'
392 Help2: "<div class=\"advanced\">\n<h4>Utilisation avancée</h4>\n<ul>\n<li>Colonnes autorisées&nbsp;: <em>%s</em></li>\n<li>Les utilisateurs existants sont retrouvés avec leur <em>Code</em> unique et les registres sont mis à jour avec les nouvelles valeurs du fichier importé.</li>\n<li>Des groupes peuvent être assignés à l’aide de la colonne <em>Groups</em>. Les groupes sont identifiés par leur <em>Code</em>, plusieurs groupes peuvent être indiqués en les séparant par des virgules. L’appartenance actuelle aux groupes n’est pas modifiée.</li>\n</ul>\n</div>" 392 Help2: "<div class=\"advanced\">\n<h4>Utilisation avancée</h4>\n<ul>\n<li>Colonnes autorisées&nbsp;: <em>%s</em></li>\n<li>Les utilisateurs existants sont retrouvés avec leur <em>Code</em> unique et les registres sont mis à jour avec les nouvelles valeurs du fichier importé.</li>\n<li>Des groupes peuvent être assignés à l’aide de la colonne <em>Groups</em>. Les groupes sont identifiés par leur <em>Code</em>, plusieurs groupes peuvent être indiqués en les séparant par des virgules. L’appartenance actuelle aux groupes n’est pas modifiée.</li>\n</ul>\n</div>"
393 ResultCreated: '{count} membres créés' 393 ResultCreated: '{count} membres créés'
394 ResultDeleted: '%d membres supprimés' 394 ResultDeleted: '%d membres supprimés'
@@ -403,7 +403,11 @@ fr: @@ -403,7 +403,11 @@ fr:
403 DELETE: Supprime 403 DELETE: Supprime
404 DELETEDRECORDS: '{count} enregistrements supprimés.' 404 DELETEDRECORDS: '{count} enregistrements supprimés.'
405 EMPTYBEFOREIMPORT: 'Remplacer les données' 405 EMPTYBEFOREIMPORT: 'Remplacer les données'
  406 +<<<<<<< HEAD
  407 + IMPORT: 'Importer de CSV'
  408 +=======
406 IMPORT: 'Importers de CSV' 409 IMPORT: 'Importers de CSV'
  410 +>>>>>>> ead5cb60ac983cdb680ec70731de195b537be6cd
407 IMPORTEDRECORDS: '{count} enregistrements importés.' 411 IMPORTEDRECORDS: '{count} enregistrements importés.'
408 NOCSVFILE: 'Veuillez choisir un fichier CSV à importer' 412 NOCSVFILE: 'Veuillez choisir un fichier CSV à importer'
409 NOIMPORT: 'Rien à importer' 413 NOIMPORT: 'Rien à importer'
@@ -417,9 +421,15 @@ fr: @@ -417,9 +421,15 @@ fr:
417 IMPORTSPECTITLE: 'Spécification de %s' 421 IMPORTSPECTITLE: 'Spécification de %s'
418 ModelAdmin_Tools_ss: 422 ModelAdmin_Tools_ss:
419 FILTER: Filtrer 423 FILTER: Filtrer
  424 +<<<<<<< HEAD
  425 + IMPORT: Importer
  426 + ModelSidebar_ss:
  427 + IMPORT_TAB_HEADER: Importer
  428 +=======
420 IMPORT: Importers 429 IMPORT: Importers
421 ModelSidebar_ss: 430 ModelSidebar_ss:
422 IMPORT_TAB_HEADER: Importers 431 IMPORT_TAB_HEADER: Importers
  432 +>>>>>>> ead5cb60ac983cdb680ec70731de195b537be6cd
423 SEARCHLISTINGS: Rechercher 433 SEARCHLISTINGS: Rechercher
424 MoneyField: 434 MoneyField:
425 FIELDLABELAMOUNT: Quantité 435 FIELDLABELAMOUNT: Quantité
@@ -481,8 +491,8 @@ fr: @@ -481,8 +491,8 @@ fr:
481 EDITPERMISSIONS: 'Gérer les autorisations des groupes' 491 EDITPERMISSIONS: 'Gérer les autorisations des groupes'
482 EDITPERMISSIONS_HELP: 'Possibilité d''éditer les autorisations et les adresses IP pour un groupe. Nécessite l’autorisation « Accès à la section “Securité” ».' 492 EDITPERMISSIONS_HELP: 'Possibilité d''éditer les autorisations et les adresses IP pour un groupe. Nécessite l’autorisation « Accès à la section “Securité” ».'
483 GROUPNAME: 'Nom du group' 493 GROUPNAME: 'Nom du group'
484 - IMPORTGROUPS: 'Importers des groupes'  
485 - IMPORTUSERS: 'Importers des utilisateurs' 494 + IMPORTGROUPS: 'Importer des groupes'
  495 + IMPORTUSERS: 'Importer des utilisateurs'
486 MEMBERS: Membres 496 MEMBERS: Membres
487 MENUTITLE: Sécurité 497 MENUTITLE: Sécurité
488 MemberListCaution: 'Attention&nbsp;: en supprimant des membres de cette liste vous les enlèverez de tous les groupes ainsi que de la base de données' 498 MemberListCaution: 'Attention&nbsp;: en supprimant des membres de cette liste vous les enlèverez de tous les groupes ainsi que de la base de données'
@@ -493,7 +503,7 @@ fr: @@ -493,7 +503,7 @@ fr:
493 TABROLES: Rôles 503 TABROLES: Rôles
494 Users: Utilisateurs 504 Users: Utilisateurs
495 SecurityAdmin_MemberImportForm: 505 SecurityAdmin_MemberImportForm:
496 - BtnImport: 'Importers' 506 + BtnImport: 'Importer'
497 FileFieldLabel: 'Fichier CSV <small>(extension autorisée&nbsp;: *.csv)</small>' 507 FileFieldLabel: 'Fichier CSV <small>(extension autorisée&nbsp;: *.csv)</small>'
498 SilverStripeNavigator: 508 SilverStripeNavigator:
499 Auto: Auto 509 Auto: Auto
framework/lang/nb.yml
@@ -236,7 +236,7 @@ nb: @@ -236,7 +236,7 @@ nb:
236 has_many_Permissions: Tillatelser 236 has_many_Permissions: Tillatelser
237 many_many_Members: Medlemmer 237 many_many_Members: Medlemmer
238 GroupImportForm: 238 GroupImportForm:
239 - Help1: '<p>Importers en eller flere grupper i <em>CSV</em>-format (kommaseparerte verdier). <small><a href="#" class="toggle-advanced">Vis avanserte alternativer</a></small></p>' 239 + Help1: '<p>Importer en eller flere grupper i <em>CSV</em>-format (kommaseparerte verdier). <small><a href="#" class="toggle-advanced">Vis avanserte alternativer</a></small></p>'
240 Help2: "<div class=\"advanced\">\n<h4>Avanserte alternativer</h4>\n<ul>\n<li>Tillatte kolonner: <em>%s</em></li>\n<li>Eksisterende grupper matches mot deres <em>Code</em>-verdi og oppdateres med nye verdier fra den importerte filen.</li>\n<li>Gruppehierarkier kan bli opprettet ved å benytte en <em>ParentCode</em>-kolonne.</li>\n<li>Tillatelseskoder kan bli angitt med <em>PermissionCode</em>-kolonnen. Eksisterende tillatelselskoder blir ikke fjernet.</li>\n</ul>\n</div>" 240 Help2: "<div class=\"advanced\">\n<h4>Avanserte alternativer</h4>\n<ul>\n<li>Tillatte kolonner: <em>%s</em></li>\n<li>Eksisterende grupper matches mot deres <em>Code</em>-verdi og oppdateres med nye verdier fra den importerte filen.</li>\n<li>Gruppehierarkier kan bli opprettet ved å benytte en <em>ParentCode</em>-kolonne.</li>\n<li>Tillatelseskoder kan bli angitt med <em>PermissionCode</em>-kolonnen. Eksisterende tillatelselskoder blir ikke fjernet.</li>\n</ul>\n</div>"
241 ResultCreated: 'Opprettet {count} grupper' 241 ResultCreated: 'Opprettet {count} grupper'
242 ResultDeleted: 'Slettet %d grupper' 242 ResultDeleted: 'Slettet %d grupper'
@@ -390,7 +390,7 @@ nb: @@ -390,7 +390,7 @@ nb:
390 TWODIGITYEAR: 'Tosifret årstall' 390 TWODIGITYEAR: 'Tosifret årstall'
391 Toggle: 'Vis formateringshjelp' 391 Toggle: 'Vis formateringshjelp'
392 MemberImportForm: 392 MemberImportForm:
393 - Help1: '<p>Importers brukere i <em>CSV-format</em> (verdier adskilt med komma). <small><a href="#" class="toggle-advanced">Vis avanserte alternativer</a></small></p>' 393 + Help1: '<p>Importer brukere i <em>CSV-format</em> (verdier adskilt med komma). <small><a href="#" class="toggle-advanced">Vis avanserte alternativer</a></small></p>'
394 Help2: "<div class=\"advanced\">\n<h4>Avanserte alternativer</h4>\n<ul>\n<li>Tillatte kolonner: <em>%s</em></li>\n<li>Eksisterende brukere blir matchet mot deres unike <em>Code</em> og oppdatert med nye verdier fra den importerte filen.</li>\n<li>Grupper kan angis med <em>Groups</em>-kolonnen. Grupper er identifisert ved deres <em>Code</em>. Grupper kan adskilles med komma. Eksisterende gruppemedlemskap blir ikke fjernet.</li>\n</ul>\n</div>" 394 Help2: "<div class=\"advanced\">\n<h4>Avanserte alternativer</h4>\n<ul>\n<li>Tillatte kolonner: <em>%s</em></li>\n<li>Eksisterende brukere blir matchet mot deres unike <em>Code</em> og oppdatert med nye verdier fra den importerte filen.</li>\n<li>Grupper kan angis med <em>Groups</em>-kolonnen. Grupper er identifisert ved deres <em>Code</em>. Grupper kan adskilles med komma. Eksisterende gruppemedlemskap blir ikke fjernet.</li>\n</ul>\n</div>"
395 ResultCreated: 'Opprettet {count} medlemmer' 395 ResultCreated: 'Opprettet {count} medlemmer'
396 ResultDeleted: 'Slettet %d medlemmer' 396 ResultDeleted: 'Slettet %d medlemmer'
@@ -405,7 +405,7 @@ nb: @@ -405,7 +405,7 @@ nb:
405 DELETE: Slett 405 DELETE: Slett
406 DELETEDRECORDS: 'Slettet {count} oppføringer.' 406 DELETEDRECORDS: 'Slettet {count} oppføringer.'
407 EMPTYBEFOREIMPORT: 'Erstatt data' 407 EMPTYBEFOREIMPORT: 'Erstatt data'
408 - IMPORT: 'Importers fra CSV' 408 + IMPORT: 'Importer fra CSV'
409 IMPORTEDRECORDS: 'Importerte {count} oppføringer.' 409 IMPORTEDRECORDS: 'Importerte {count} oppføringer.'
410 NOCSVFILE: 'Vennligst finn en CSV-fil å importere' 410 NOCSVFILE: 'Vennligst finn en CSV-fil å importere'
411 NOIMPORT: 'Ingenting å importere' 411 NOIMPORT: 'Ingenting å importere'
@@ -419,9 +419,9 @@ nb: @@ -419,9 +419,9 @@ nb:
419 IMPORTSPECTITLE: 'Spesifikasjon for %s' 419 IMPORTSPECTITLE: 'Spesifikasjon for %s'
420 ModelAdmin_Tools_ss: 420 ModelAdmin_Tools_ss:
421 FILTER: Filtrer 421 FILTER: Filtrer
422 - IMPORT: Importers 422 + IMPORT: Importer
423 ModelSidebar_ss: 423 ModelSidebar_ss:
424 - IMPORT_TAB_HEADER: Importers 424 + IMPORT_TAB_HEADER: Importer
425 SEARCHLISTINGS: Søk 425 SEARCHLISTINGS: Søk
426 MoneyField: 426 MoneyField:
427 FIELDLABELAMOUNT: Mengde 427 FIELDLABELAMOUNT: Mengde
@@ -485,8 +485,8 @@ nb: @@ -485,8 +485,8 @@ nb:
485 EDITPERMISSIONS: 'Administrer tillatelser for grupper' 485 EDITPERMISSIONS: 'Administrer tillatelser for grupper'
486 EDITPERMISSIONS_HELP: 'Mulighet for å endre tillatelser og IP-adresser for en gruppe. Brukere må ha adgang til sikkerhetsseksjon.' 486 EDITPERMISSIONS_HELP: 'Mulighet for å endre tillatelser og IP-adresser for en gruppe. Brukere må ha adgang til sikkerhetsseksjon.'
487 GROUPNAME: 'Gruppenavn' 487 GROUPNAME: 'Gruppenavn'
488 - IMPORTGROUPS: 'Importers grupper'  
489 - IMPORTUSERS: 'Importers brukere' 488 + IMPORTGROUPS: 'Importer grupper'
  489 + IMPORTUSERS: 'Importer brukere'
490 MEMBERS: Medlemmer 490 MEMBERS: Medlemmer
491 MENUTITLE: Sikkerhet 491 MENUTITLE: Sikkerhet
492 MemberListCaution: 'Advarsel: Hvis du fjerner medlemmer fra denne listen vil det samtidig fjerne dem fra alle grupper og databasen' 492 MemberListCaution: 'Advarsel: Hvis du fjerner medlemmer fra denne listen vil det samtidig fjerne dem fra alle grupper og databasen'
@@ -497,7 +497,7 @@ nb: @@ -497,7 +497,7 @@ nb:
497 TABROLES: Roller 497 TABROLES: Roller
498 Users: Brukere 498 Users: Brukere
499 SecurityAdmin_MemberImportForm: 499 SecurityAdmin_MemberImportForm:
500 - BtnImport: 'Importers fra CSV' 500 + BtnImport: 'Importer fra CSV'
501 FileFieldLabel: 'CSV-fil <small>(Tillatt filtype: *.csv)</small>' 501 FileFieldLabel: 'CSV-fil <small>(Tillatt filtype: *.csv)</small>'
502 SilverStripeNavigator: 502 SilverStripeNavigator:
503 Auto: Automatisk 503 Auto: Automatisk