Completed
Push — master ( 32019c...1dd400 )
by Alexey
03:57
created
system/modules/Ecommerce/models/Category.php 1 patch
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -13,50 +13,50 @@  discard block
 block discarded – undo
13 13
 
14 14
 class Category extends \Model {
15 15
 
16
-  public static $objectName = 'Категория магазина';
17
-  public static $treeCategory = 'Ecommerce\Item';
18
-  public static $cols = [
19
-      //Основные параметры
20
-      'parent_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'parent'],
21
-      'name' => ['type' => 'text'],
22
-      'alias' => ['type' => 'text'],
23
-      'viewer' => ['type' => 'select', 'source' => 'method', 'method' => 'viewsCategoryList', 'module' => 'Ecommerce'],
24
-      'template' => ['type' => 'select', 'source' => 'method', 'method' => 'templatesCategoryList', 'module' => 'Ecommerce'],
25
-      'description' => ['type' => 'html'],
26
-      'image_file_id' => ['type' => 'image'],
27
-      'options_inherit' => ['type' => 'bool'],
28
-      //Системные
29
-      'imported' => ['type' => 'bool'],
30
-      'weight' => ['type' => 'number'],
31
-      'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'],
32
-      'tree_path' => ['type' => 'text'],
33
-      'date_create' => ['type' => 'dateTime'],
34
-      //Менеджеры
35
-      'options' => ['type' => 'dataManager', 'relation' => 'options'],
36
-  ];
37
-  public static $labels = [
38
-      'name' => 'Название',
39
-      'alias' => 'Алиас',
40
-      'parent_id' => 'Родительская категория',
41
-      'image_file_id' => 'Изображение',
42
-      'description' => 'Описание',
43
-      'options_inherit' => 'Наследовать набор свойств',
44
-      'options' => 'Свойства товаров',
45
-  ];
46
-  public static $forms = [
47
-      'manager' => [
48
-          'map' => [
49
-              ['name', 'alias'],
50
-              ['parent_id', 'image_file_id'],
51
-              ['viewer', 'template'],
52
-              ['options_inherit'],
53
-              ['options'],
54
-              ['description']
55
-          ]
56
-      ]
57
-  ];
16
+    public static $objectName = 'Категория магазина';
17
+    public static $treeCategory = 'Ecommerce\Item';
18
+    public static $cols = [
19
+        //Основные параметры
20
+        'parent_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'parent'],
21
+        'name' => ['type' => 'text'],
22
+        'alias' => ['type' => 'text'],
23
+        'viewer' => ['type' => 'select', 'source' => 'method', 'method' => 'viewsCategoryList', 'module' => 'Ecommerce'],
24
+        'template' => ['type' => 'select', 'source' => 'method', 'method' => 'templatesCategoryList', 'module' => 'Ecommerce'],
25
+        'description' => ['type' => 'html'],
26
+        'image_file_id' => ['type' => 'image'],
27
+        'options_inherit' => ['type' => 'bool'],
28
+        //Системные
29
+        'imported' => ['type' => 'bool'],
30
+        'weight' => ['type' => 'number'],
31
+        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'],
32
+        'tree_path' => ['type' => 'text'],
33
+        'date_create' => ['type' => 'dateTime'],
34
+        //Менеджеры
35
+        'options' => ['type' => 'dataManager', 'relation' => 'options'],
36
+    ];
37
+    public static $labels = [
38
+        'name' => 'Название',
39
+        'alias' => 'Алиас',
40
+        'parent_id' => 'Родительская категория',
41
+        'image_file_id' => 'Изображение',
42
+        'description' => 'Описание',
43
+        'options_inherit' => 'Наследовать набор свойств',
44
+        'options' => 'Свойства товаров',
45
+    ];
46
+    public static $forms = [
47
+        'manager' => [
48
+            'map' => [
49
+                ['name', 'alias'],
50
+                ['parent_id', 'image_file_id'],
51
+                ['viewer', 'template'],
52
+                ['options_inherit'],
53
+                ['options'],
54
+                ['description']
55
+            ]
56
+        ]
57
+    ];
58 58
 
59
-  public static function indexes() {
59
+    public static function indexes() {
60 60
     return [
61 61
         'ecommerce_category_category_parent_id' => [
62 62
             'type' => 'INDEX',
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
             ]
72 72
         ],
73 73
     ];
74
-  }
74
+    }
75 75
 
76
-  public static function relations() {
76
+    public static function relations() {
77 77
     return [
78 78
         'items' => [
79 79
             'type' => 'many',
@@ -103,50 +103,50 @@  discard block
 block discarded – undo
103 103
             'col' => 'parent_id',
104 104
         ]
105 105
     ];
106
-  }
106
+    }
107 107
 
108
-  public static $dataManagers = [
109
-      'manager' => [
110
-          'name' => 'Категории товаров',
111
-          'cols' => [
112
-              'name',
113
-              'parent_id',
114
-          ],
115
-          'sortMode' => true
116
-      ]
117
-  ];
108
+    public static $dataManagers = [
109
+        'manager' => [
110
+            'name' => 'Категории товаров',
111
+            'cols' => [
112
+                'name',
113
+                'parent_id',
114
+            ],
115
+            'sortMode' => true
116
+        ]
117
+    ];
118 118
 
119
-  public function beforeSave() {
119
+    public function beforeSave() {
120 120
     if ($this->id && $this->id == $this->parent_id) {
121
-      $this->parent_id = 0;
122
-      \Msg::add('Категория не может быть сама себе родителем');
121
+        $this->parent_id = 0;
122
+        \Msg::add('Категория не может быть сама себе родителем');
123
+    }
123 124
     }
124
-  }
125 125
 
126
-  public function beforeDelete() {
126
+    public function beforeDelete() {
127 127
     foreach ($this->catalogs as $category) {
128
-      $category->delete();
128
+        $category->delete();
129
+    }
129 130
     }
130
-  }
131 131
 
132
-  public function resolveTemplate() {
132
+    public function resolveTemplate() {
133 133
     if ($this->template !== 'inherit') {
134
-      return $this->template;
134
+        return $this->template;
135 135
     } elseif ($this->template == 'inherit' && $this->category) {
136
-      return $this->category->resolveTemplate(true);
136
+        return $this->category->resolveTemplate(true);
137 137
     } else {
138
-      return (!empty(\App::$cur->ecommerce->config['defaultCategoryTemplate']) ? \App::$cur->ecommerce->config['defaultCategoryTemplate'] : 'current');
138
+        return (!empty(\App::$cur->ecommerce->config['defaultCategoryTemplate']) ? \App::$cur->ecommerce->config['defaultCategoryTemplate'] : 'current');
139
+    }
139 140
     }
140
-  }
141 141
 
142
-  public function resolveViewer() {
142
+    public function resolveViewer() {
143 143
     if ($this->viewer !== 'inherit') {
144
-      return $this->viewer;
144
+        return $this->viewer;
145 145
     } elseif ($this->viewer == 'inherit' && $this->category) {
146
-      return $this->category->resolveViewer(true);
146
+        return $this->category->resolveViewer(true);
147 147
     } else {
148
-      return (!empty(\App::$cur->ecommerce->config['defaultCategoryView']) ? \App::$cur->ecommerce->config['defaultCategoryView'] : 'itemList');
148
+        return (!empty(\App::$cur->ecommerce->config['defaultCategoryView']) ? \App::$cur->ecommerce->config['defaultCategoryView'] : 'itemList');
149
+    }
149 150
     }
150
-  }
151 151
 
152 152
 }
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Item/Image.php 1 patch
Indentation   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -13,22 +13,22 @@  discard block
 block discarded – undo
13 13
 
14 14
 class Image extends \Model {
15 15
 
16
-  static $objectName = 'Фото товара';
17
-  static $labels = [
18
-      'file_id' => 'Изображение',
19
-      'item_id' => 'Товар',
20
-      'name' => 'Название',
21
-      'description' => 'Описание',
22
-  ];
23
-  static $cols = [
24
-      'file_id' => ['type' => 'image'],
25
-      'item_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'item'],
26
-      'name' => ['type' => 'text'],
27
-      'description' => ['type' => 'html'],
28
-      'weight' => ['type' => 'number'],
29
-  ];
16
+    static $objectName = 'Фото товара';
17
+    static $labels = [
18
+        'file_id' => 'Изображение',
19
+        'item_id' => 'Товар',
20
+        'name' => 'Название',
21
+        'description' => 'Описание',
22
+    ];
23
+    static $cols = [
24
+        'file_id' => ['type' => 'image'],
25
+        'item_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'item'],
26
+        'name' => ['type' => 'text'],
27
+        'description' => ['type' => 'html'],
28
+        'weight' => ['type' => 'number'],
29
+    ];
30 30
 
31
-  static function relations() {
31
+    static function relations() {
32 32
     return [
33 33
         'item' => [
34 34
             'col' => 'item_id',
@@ -39,30 +39,30 @@  discard block
 block discarded – undo
39 39
             'model' => 'Files\File'
40 40
         ]
41 41
     ];
42
-  }
42
+    }
43 43
 
44
-  static $dataManagers = [
45
-      'manager' => [
46
-          'name' => 'Фото товара',
47
-          'cols' => [
48
-              'file_id', 'name'
49
-          ]
50
-      ]
51
-  ];
52
-  static $forms = [
53
-      'manager' => [
54
-          'map' => [
55
-              ['name'],
56
-              ['item_id', 'file_id'],
57
-              ['description']
58
-          ]
59
-      ]
60
-  ];
44
+    static $dataManagers = [
45
+        'manager' => [
46
+            'name' => 'Фото товара',
47
+            'cols' => [
48
+                'file_id', 'name'
49
+            ]
50
+        ]
51
+    ];
52
+    static $forms = [
53
+        'manager' => [
54
+            'map' => [
55
+                ['name'],
56
+                ['item_id', 'file_id'],
57
+                ['description']
58
+            ]
59
+        ]
60
+    ];
61 61
 
62
-  function beforeDelete() {
62
+    function beforeDelete() {
63 63
     if ($this->file) {
64
-      $this->file->delete();
64
+        $this->file->delete();
65
+    }
65 66
     }
66
-  }
67 67
 
68 68
 }
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Delivery/Save.php 1 patch
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -13,12 +13,12 @@  discard block
 block discarded – undo
13 13
 
14 14
 class Save extends \Model {
15 15
 
16
-  public static $cols = [
17
-      'name' => ['type' => 'text'],
18
-      'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user']
19
-  ];
16
+    public static $cols = [
17
+        'name' => ['type' => 'text'],
18
+        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user']
19
+    ];
20 20
 
21
-  public static function relations() {
21
+    public static function relations() {
22 22
     return [
23 23
         'values' => [
24 24
             'type' => 'many',
@@ -31,6 +31,6 @@  discard block
 block discarded – undo
31 31
             'col' => 'user_id'
32 32
         ]
33 33
     ];
34
-  }
34
+    }
35 35
 
36 36
 }
Please login to merge, or discard this patch.
system/modules/Exchange1c/objects/Mode/Init.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -13,43 +13,43 @@
 block discarded – undo
13 13
 
14 14
 class Init extends \Exchange1c\Mode {
15 15
 
16
-  public function process() {
16
+    public function process() {
17 17
     echo "zip=no\n";
18 18
     echo 'file_limit=' . \Tools::toBytes(ini_get('post_max_size'));
19 19
     $this->end();
20 20
 
21 21
     //clean files
22 22
     if (!empty(\App::$cur->exchange1c->config['maxSaveFilesInterval'])) {
23
-      $query = \App::$cur->db->newQuery();
24
-      $query->operation = 'select';
25
-      $query->table = \Exchange1c\Exchange\File::table();
26
-      $query->cols = \Exchange1c\Exchange\File::colPrefix() . 'id';
27
-      $queryArr = $query->buildQuery();
28
-      $queryArr['query'].=' where `' . \Exchange1c\Exchange\File::colPrefix() . 'deleted` = 0 AND  `' . \Exchange1c\Exchange\File::colPrefix() . 'date_create` < NOW() - INTERVAL ' . \App::$cur->exchange1c->config['maxSaveFilesInterval'];
29
-      try {
23
+        $query = \App::$cur->db->newQuery();
24
+        $query->operation = 'select';
25
+        $query->table = \Exchange1c\Exchange\File::table();
26
+        $query->cols = \Exchange1c\Exchange\File::colPrefix() . 'id';
27
+        $queryArr = $query->buildQuery();
28
+        $queryArr['query'].=' where `' . \Exchange1c\Exchange\File::colPrefix() . 'deleted` = 0 AND  `' . \Exchange1c\Exchange\File::colPrefix() . 'date_create` < NOW() - INTERVAL ' . \App::$cur->exchange1c->config['maxSaveFilesInterval'];
29
+        try {
30 30
         $ids = array_keys($query->query($queryArr)->getArray(\Exchange1c\Exchange\File::colPrefix().'id'));
31
-      } catch (\PDOException $exc) {
31
+        } catch (\PDOException $exc) {
32 32
         if ($exc->getCode() == '42S02') {
33
-          \Exchange1c\Exchange\File::createTable();
33
+            \Exchange1c\Exchange\File::createTable();
34 34
         } elseif ($exc->getCode() == '42S22') {
35
-          $cols = \Exchange1c\Exchange\File::cols();
36
-          foreach (\Exchange1c\Exchange\File::$cols as $colName => $params) {
35
+            $cols = \Exchange1c\Exchange\File::cols();
36
+            foreach (\Exchange1c\Exchange\File::$cols as $colName => $params) {
37 37
             if (!isset($cols[\Exchange1c\Exchange\File::colPrefix() . $colName])) {
38
-              \Exchange1c\Exchange\File::createCol($colName);
38
+                \Exchange1c\Exchange\File::createCol($colName);
39
+            }
39 40
             }
40
-          }
41 41
         }
42 42
         $ids = array_keys($query->query($queryArr)->getArray(\Exchange1c\Exchange\File::colPrefix().'id'));
43
-      }
44
-      foreach (array_chunk($ids, 500) as $idGroup) {
43
+        }
44
+        foreach (array_chunk($ids, 500) as $idGroup) {
45 45
         $dfiles = \Exchange1c\Exchange\File::getList(['where' => ['id', $idGroup, 'IN']]);
46 46
         foreach ($dfiles as $dfile) {
47
-          $dfile->deleteFile();
48
-          unset($dfile);
47
+            $dfile->deleteFile();
48
+            unset($dfile);
49 49
         }
50 50
         unset($dfiles);
51
-      }
51
+        }
52
+    }
52 53
     }
53
-  }
54 54
 
55 55
 }
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@  discard block
 block discarded – undo
15 15
 
16 16
   public function process() {
17 17
     echo "zip=no\n";
18
-    echo 'file_limit=' . \Tools::toBytes(ini_get('post_max_size'));
18
+    echo 'file_limit='.\Tools::toBytes(ini_get('post_max_size'));
19 19
     $this->end();
20 20
 
21 21
     //clean files
@@ -23,9 +23,9 @@  discard block
 block discarded – undo
23 23
       $query = \App::$cur->db->newQuery();
24 24
       $query->operation = 'select';
25 25
       $query->table = \Exchange1c\Exchange\File::table();
26
-      $query->cols = \Exchange1c\Exchange\File::colPrefix() . 'id';
26
+      $query->cols = \Exchange1c\Exchange\File::colPrefix().'id';
27 27
       $queryArr = $query->buildQuery();
28
-      $queryArr['query'].=' where `' . \Exchange1c\Exchange\File::colPrefix() . 'deleted` = 0 AND  `' . \Exchange1c\Exchange\File::colPrefix() . 'date_create` < NOW() - INTERVAL ' . \App::$cur->exchange1c->config['maxSaveFilesInterval'];
28
+      $queryArr['query'] .= ' where `'.\Exchange1c\Exchange\File::colPrefix().'deleted` = 0 AND  `'.\Exchange1c\Exchange\File::colPrefix().'date_create` < NOW() - INTERVAL '.\App::$cur->exchange1c->config['maxSaveFilesInterval'];
29 29
       try {
30 30
         $ids = array_keys($query->query($queryArr)->getArray(\Exchange1c\Exchange\File::colPrefix().'id'));
31 31
       } catch (\PDOException $exc) {
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
         } elseif ($exc->getCode() == '42S22') {
35 35
           $cols = \Exchange1c\Exchange\File::cols();
36 36
           foreach (\Exchange1c\Exchange\File::$cols as $colName => $params) {
37
-            if (!isset($cols[\Exchange1c\Exchange\File::colPrefix() . $colName])) {
37
+            if (!isset($cols[\Exchange1c\Exchange\File::colPrefix().$colName])) {
38 38
               \Exchange1c\Exchange\File::createCol($colName);
39 39
             }
40 40
           }
Please login to merge, or discard this patch.
system/modules/Exchange1c/objects/Mode/File.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 
14 14
 class File extends \Exchange1c\Mode {
15 15
 
16
-  public function process() {
16
+    public function process() {
17 17
     $dir = $this->exchange->path;
18 18
     \Tools::createDir($dir);
19 19
     $file = new \Exchange1c\Exchange\File();
@@ -24,26 +24,26 @@  discard block
 block discarded – undo
24 24
 
25 25
     $filename = \Tools::parsePath($_GET['filename']);
26 26
     if (strpos($filename, '/') !== false) {
27
-      $subDir = substr($filename, 0, strrpos($filename, "/") + 1);
28
-      \Tools::createDir($dir . '/' . $subDir);
27
+        $subDir = substr($filename, 0, strrpos($filename, "/") + 1);
28
+        \Tools::createDir($dir . '/' . $subDir);
29 29
     }
30 30
     $text = '';
31 31
     if (false === file_put_contents($dir . '/' . $filename, file_get_contents("php://input"))) {
32
-      $text = 'Fail on save file: ' . $filename;
33
-      $file->status = 'failure';
32
+        $text = 'Fail on save file: ' . $filename;
33
+        $file->status = 'failure';
34 34
     } else {
35
-      $file->size = ceil(filesize($dir . '/' . $filename));
36
-      $file->name = $filename;
37
-      $file->status = 'success';
35
+        $file->size = ceil(filesize($dir . '/' . $filename));
36
+        $file->name = $filename;
37
+        $file->status = 'success';
38 38
     }
39 39
     $file->save();
40 40
     if (strpos($filename, '1cbitrix') !== false) {
41
-      $data = new \SimpleXMLElement(file_get_contents($dir . '/' . $filename));
42
-      $orders = new \Exchange1c\Parser\Orders($data);
43
-      $orders->process();
41
+        $data = new \SimpleXMLElement(file_get_contents($dir . '/' . $filename));
42
+        $orders = new \Exchange1c\Parser\Orders($data);
43
+        $orders->process();
44 44
     }
45 45
     \App::$cur->exchange1c->response($file->status, $text, false);
46 46
     $this->end($file->status);
47
-  }
47
+    }
48 48
 
49 49
 }
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -25,20 +25,20 @@
 block discarded – undo
25 25
     $filename = \Tools::parsePath($_GET['filename']);
26 26
     if (strpos($filename, '/') !== false) {
27 27
       $subDir = substr($filename, 0, strrpos($filename, "/") + 1);
28
-      \Tools::createDir($dir . '/' . $subDir);
28
+      \Tools::createDir($dir.'/'.$subDir);
29 29
     }
30 30
     $text = '';
31
-    if (false === file_put_contents($dir . '/' . $filename, file_get_contents("php://input"))) {
32
-      $text = 'Fail on save file: ' . $filename;
31
+    if (false === file_put_contents($dir.'/'.$filename, file_get_contents("php://input"))) {
32
+      $text = 'Fail on save file: '.$filename;
33 33
       $file->status = 'failure';
34 34
     } else {
35
-      $file->size = ceil(filesize($dir . '/' . $filename));
35
+      $file->size = ceil(filesize($dir.'/'.$filename));
36 36
       $file->name = $filename;
37 37
       $file->status = 'success';
38 38
     }
39 39
     $file->save();
40 40
     if (strpos($filename, '1cbitrix') !== false) {
41
-      $data = new \SimpleXMLElement(file_get_contents($dir . '/' . $filename));
41
+      $data = new \SimpleXMLElement(file_get_contents($dir.'/'.$filename));
42 42
       $orders = new \Exchange1c\Parser\Orders($data);
43 43
       $orders->process();
44 44
     }
Please login to merge, or discard this patch.
system/modules/Exchange1c/models/Exchange/File.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -13,37 +13,37 @@
 block discarded – undo
13 13
 
14 14
 class File extends \Model {
15 15
 
16
-  public static $cols = [
17
-      'name' => ['type' => 'text'],
18
-      'exchange_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'exchange'],
19
-      'size' => ['type' => 'number'],
20
-      'status' => ['type' => 'text'],
21
-      'deleted' => ['type' => 'bool'],
22
-      'date_create' => ['type' => 'dateTime'],
23
-  ];
24
-  public static $dataManagers = [
25
-      'manager' => [
26
-          'cols' => [
27
-              'name', 'size', 'status', 'deleted', 'date_create'
28
-          ],
29
-      ]
30
-  ];
16
+    public static $cols = [
17
+        'name' => ['type' => 'text'],
18
+        'exchange_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'exchange'],
19
+        'size' => ['type' => 'number'],
20
+        'status' => ['type' => 'text'],
21
+        'deleted' => ['type' => 'bool'],
22
+        'date_create' => ['type' => 'dateTime'],
23
+    ];
24
+    public static $dataManagers = [
25
+        'manager' => [
26
+            'cols' => [
27
+                'name', 'size', 'status', 'deleted', 'date_create'
28
+            ],
29
+        ]
30
+    ];
31 31
 
32
-  public function deleteFile() {
32
+    public function deleteFile() {
33 33
     if ($this->exchange && file_exists($this->exchange->path . '/' . $this->name)) {
34
-      unlink($this->exchange->path . '/' . $this->name);
34
+        unlink($this->exchange->path . '/' . $this->name);
35 35
     }
36 36
     $this->deleted = 1;
37 37
     $this->save();
38
-  }
38
+    }
39 39
 
40
-  public static function relations() {
40
+    public static function relations() {
41 41
     return [
42 42
         'exchange' => [
43 43
             'model' => 'Exchange1c\Exchange',
44 44
             'col' => 'exchange_id'
45 45
         ]
46 46
     ];
47
-  }
47
+    }
48 48
 
49 49
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -30,8 +30,8 @@
 block discarded – undo
30 30
   ];
31 31
 
32 32
   public function deleteFile() {
33
-    if ($this->exchange && file_exists($this->exchange->path . '/' . $this->name)) {
34
-      unlink($this->exchange->path . '/' . $this->name);
33
+    if ($this->exchange && file_exists($this->exchange->path.'/'.$this->name)) {
34
+      unlink($this->exchange->path.'/'.$this->name);
35 35
     }
36 36
     $this->deleted = 1;
37 37
     $this->save();
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Delivery.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -13,65 +13,65 @@  discard block
 block discarded – undo
13 13
 
14 14
 class Delivery extends \Model {
15 15
 
16
-  public static $objectName = 'Доставка';
17
-  public static $cols = [
18
-      //Основные параметры
19
-      'name' => ['type' => 'text'],
20
-      'price' => ['type' => 'decimal'],
21
-      'currency_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'currency'],
22
-      'price_text' => ['type' => 'textarea'],
23
-      'max_cart_price' => ['type' => 'decimal'],
24
-      'icon_file_id' => ['type' => 'image'],
25
-      'info' => ['type' => 'html'],
26
-      'disabled' => ['type' => 'bool'],
27
-      //Системные
28
-      'weight' => ['type' => 'number'],
29
-      'date_create' => ['type' => 'dateTime'],
30
-      //Менеджеры
31
-      'field' => ['type' => 'dataManager', 'relation' => 'fields'],
32
-      'priceChanger' => ['type' => 'dataManager', 'relation' => 'prices']
33
-  ];
34
-  public static $labels = [
35
-      'name' => 'Название',
36
-      'price' => 'Стоимость',
37
-      'price_text' => 'Текстовое описание стоимости (отображается вместо цены)',
38
-      'max_cart_price' => 'Басплатно при',
39
-      'icon_file_id' => 'Иконка',
40
-      'currency_id' => 'Валюта',
41
-      'info' => 'Дополнительная информация',
42
-      'priceChanger' => 'Градация стоимости',
43
-      'field' => 'Поля',
44
-      'disabled' => 'Отключено',
45
-  ];
46
-  public static $dataManagers = [
47
-      'manager' => [
48
-          'name' => 'Варианты доставки',
49
-          'cols' => [
50
-              'name',
51
-              'price',
52
-              'currency_id',
53
-              'max_cart_price',
54
-              'disabled',
55
-              'field',
56
-              'priceChanger',
57
-          ],
58
-          'sortMode' => true
59
-      ],
60
-  ];
61
-  public static $forms = [
62
-      'manager' => [
63
-          'map' => [
64
-              ['name', 'disabled'],
65
-              ['max_cart_price', 'icon_file_id'],
66
-              ['price', 'currency_id'],
67
-              ['price_text'],
68
-              ['info'],
69
-              ['priceChanger'],
70
-              ['field']
71
-          ]
72
-  ]];
16
+    public static $objectName = 'Доставка';
17
+    public static $cols = [
18
+        //Основные параметры
19
+        'name' => ['type' => 'text'],
20
+        'price' => ['type' => 'decimal'],
21
+        'currency_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'currency'],
22
+        'price_text' => ['type' => 'textarea'],
23
+        'max_cart_price' => ['type' => 'decimal'],
24
+        'icon_file_id' => ['type' => 'image'],
25
+        'info' => ['type' => 'html'],
26
+        'disabled' => ['type' => 'bool'],
27
+        //Системные
28
+        'weight' => ['type' => 'number'],
29
+        'date_create' => ['type' => 'dateTime'],
30
+        //Менеджеры
31
+        'field' => ['type' => 'dataManager', 'relation' => 'fields'],
32
+        'priceChanger' => ['type' => 'dataManager', 'relation' => 'prices']
33
+    ];
34
+    public static $labels = [
35
+        'name' => 'Название',
36
+        'price' => 'Стоимость',
37
+        'price_text' => 'Текстовое описание стоимости (отображается вместо цены)',
38
+        'max_cart_price' => 'Басплатно при',
39
+        'icon_file_id' => 'Иконка',
40
+        'currency_id' => 'Валюта',
41
+        'info' => 'Дополнительная информация',
42
+        'priceChanger' => 'Градация стоимости',
43
+        'field' => 'Поля',
44
+        'disabled' => 'Отключено',
45
+    ];
46
+    public static $dataManagers = [
47
+        'manager' => [
48
+            'name' => 'Варианты доставки',
49
+            'cols' => [
50
+                'name',
51
+                'price',
52
+                'currency_id',
53
+                'max_cart_price',
54
+                'disabled',
55
+                'field',
56
+                'priceChanger',
57
+            ],
58
+            'sortMode' => true
59
+        ],
60
+    ];
61
+    public static $forms = [
62
+        'manager' => [
63
+            'map' => [
64
+                ['name', 'disabled'],
65
+                ['max_cart_price', 'icon_file_id'],
66
+                ['price', 'currency_id'],
67
+                ['price_text'],
68
+                ['info'],
69
+                ['priceChanger'],
70
+                ['field']
71
+            ]
72
+    ]];
73 73
 
74
-  public static function relations() {
74
+    public static function relations() {
75 75
     return [
76 76
         'icon' => [
77 77
             'model' => 'Files\File',
@@ -92,6 +92,6 @@  discard block
 block discarded – undo
92 92
             'col' => 'delivery_id'
93 93
         ]
94 94
     ];
95
-  }
95
+    }
96 96
 
97 97
 }
Please login to merge, or discard this patch.
system/modules/Dashboard/appAdminControllers/DashboardController.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -10,38 +10,38 @@
 block discarded – undo
10 10
  */
11 11
 class DashboardController extends adminController {
12 12
 
13
-  public function indexAction() {
13
+    public function indexAction() {
14 14
     $sections = $this->module->getSnippets('adminDashboardWidget');
15 15
     $this->view->setTitle('Панель управления');
16 16
     $this->view->page(['data' => compact('sections')]);
17
-  }
17
+    }
18 18
 
19
-  public function siteConfigAction() {
19
+    public function siteConfigAction() {
20 20
     if (isset($_POST['site_name'])) {
21
-      $config = \App::$primary->config;
22
-      $config['site']['name'] = $_POST['site_name'];
23
-      $config['site']['company_name'] = $_POST['company_name'];
24
-      $config['site']['email'] = $_POST['site_email'];
25
-      $config['site']['keywords'] = $_POST['site_keywords'];
26
-      $config['site']['description'] = $_POST['site_description'];
27
-      $config['site']['domain'] = $_POST['site_domain'];
28
-      if (isset($_POST['metatags'])) {
21
+        $config = \App::$primary->config;
22
+        $config['site']['name'] = $_POST['site_name'];
23
+        $config['site']['company_name'] = $_POST['company_name'];
24
+        $config['site']['email'] = $_POST['site_email'];
25
+        $config['site']['keywords'] = $_POST['site_keywords'];
26
+        $config['site']['description'] = $_POST['site_description'];
27
+        $config['site']['domain'] = $_POST['site_domain'];
28
+        if (isset($_POST['metatags'])) {
29 29
         $config['site']['metatags'] = $_POST['metatags'];
30
-      }
31
-      if (!empty($_FILES['site_logo']['tmp_name'])) {
30
+        }
31
+        if (!empty($_FILES['site_logo']['tmp_name'])) {
32 32
         $fileId = $this->Files->upload($_FILES['site_logo'], array('file_code' => 'site_logo'));
33 33
         $config['site']['site_logo'] = Files\File::get($fileId)->path;
34
-      }
35
-      Config::save('app', $config);
36
-      Tools::redirect('/admin/dashboard/siteConfig', 'Изменения сохранены', 'success');
34
+        }
35
+        Config::save('app', $config);
36
+        Tools::redirect('/admin/dashboard/siteConfig', 'Изменения сохранены', 'success');
37 37
     }
38 38
 
39 39
     $this->view->setTitle('Общие настройки сайта');
40 40
     $this->view->page();
41
-  }
41
+    }
42 42
 
43
-  public function phpInfoAction() {
43
+    public function phpInfoAction() {
44 44
     $this->view->page();
45
-  }
45
+    }
46 46
 
47 47
 }
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Walker.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@
 block discarded – undo
32 32
           $walker->migration = $this->migration;
33 33
           $walker->map = $this->map;
34 34
           $walker->data = &$this->data[$path->item];
35
-          $walker->curPath = $this->curPath . $path->item . '/';
35
+          $walker->curPath = $this->curPath.$path->item.'/';
36 36
           $walker->mapPath = $path;
37 37
           $walker->mapPathParent = $this->mapPath;
38 38
           $walker->migtarionLog = $this->migtarionLog;
Please login to merge, or discard this patch.
Indentation   +53 added lines, -53 removed lines patch added patch discarded remove patch
@@ -13,61 +13,61 @@  discard block
 block discarded – undo
13 13
 
14 14
 class Walker {
15 15
 
16
-  public $migration = null;
17
-  public $map = null;
18
-  public $data = null;
19
-  public $mapPath = null;
20
-  public $mapPathParent = null;
21
-  public $curPath = '/';
22
-  public $migtarionLog = null;
16
+    public $migration = null;
17
+    public $map = null;
18
+    public $data = null;
19
+    public $mapPath = null;
20
+    public $mapPathParent = null;
21
+    public $curPath = '/';
22
+    public $migtarionLog = null;
23 23
 
24
-  //walk map pathes on cur path
25
-  public function walk() {
24
+    //walk map pathes on cur path
25
+    public function walk() {
26 26
     $walked = [];
27 27
     //walk know pathes
28 28
     foreach ($this->map->paths(['where' => ['path', $this->curPath]]) as $path) {
29
-      if (isset($this->data[$path->item])) {
29
+        if (isset($this->data[$path->item])) {
30 30
         if ($path->type == 'container') { //create walker for container
31
-          $walker = new Walker();
32
-          $walker->migration = $this->migration;
33
-          $walker->map = $this->map;
34
-          $walker->data = &$this->data[$path->item];
35
-          $walker->curPath = $this->curPath . $path->item . '/';
36
-          $walker->mapPath = $path;
37
-          $walker->mapPathParent = $this->mapPath;
38
-          $walker->migtarionLog = $this->migtarionLog;
39
-          $walker->walk();
31
+            $walker = new Walker();
32
+            $walker->migration = $this->migration;
33
+            $walker->map = $this->map;
34
+            $walker->data = &$this->data[$path->item];
35
+            $walker->curPath = $this->curPath . $path->item . '/';
36
+            $walker->mapPath = $path;
37
+            $walker->mapPathParent = $this->mapPath;
38
+            $walker->migtarionLog = $this->migtarionLog;
39
+            $walker->walk();
40 40
         } elseif ($path->type == 'object') { //start parse path data
41
-          $this->startObjectParse($path->object_id, $this->data[$path->item]);
41
+            $this->startObjectParse($path->object_id, $this->data[$path->item]);
42 42
         }
43
-      }
44
-      $walked[$path->item] = true;
43
+        }
44
+        $walked[$path->item] = true;
45 45
     }
46 46
     //check unparsed paths
47 47
     foreach ($this->data as $key => &$data) {
48
-      //skip parsed and attribtes
49
-      if ($key == '@attributes' || !empty($walked[$key])) {
48
+        //skip parsed and attribtes
49
+        if ($key == '@attributes' || !empty($walked[$key])) {
50 50
         continue;
51
-      }
52
-      //search object for parse
53
-      $object = Migration\Object::get([
54
-                  ['code', $key],
55
-                  ['migration_id', $this->migration->id]
56
-      ]);
57
-      if ($object) { //parse as object
51
+        }
52
+        //search object for parse
53
+        $object = Migration\Object::get([
54
+                    ['code', $key],
55
+                    ['migration_id', $this->migration->id]
56
+        ]);
57
+        if ($object) { //parse as object
58 58
         $this->startObjectParse($object, $data);
59
-      } else { //create new map path for configure unknown path
59
+        } else { //create new map path for configure unknown path
60 60
         $this->mapPath = new Migration\Map\Path();
61 61
         $this->mapPath->parent_id = $this->mapPathParent ? $this->mapPathParent->id : 0;
62 62
         $this->mapPath->path = $this->curPath;
63 63
         $this->mapPath->item = $key;
64 64
         $this->mapPath->migration_map_id = $this->map->id;
65 65
         $this->mapPath->save();
66
-      }
66
+        }
67
+    }
67 68
     }
68
-  }
69 69
 
70
-  private function startObjectParse($object_id, &$data) {
70
+    private function startObjectParse($object_id, &$data) {
71 71
     $objectParser = new Parser\Object();
72 72
     $objectParser->object = is_object($object_id) ? $object_id : \App::$cur->migrations->getMigrationObject($object_id);
73 73
     $objectParser->data = $data;
@@ -76,33 +76,33 @@  discard block
 block discarded – undo
76 76
 
77 77
     if ($objectParser->object->clear && json_decode($objectParser->object->clear, true)) {
78 78
 
79
-      $where = json_decode($objectParser->object->clear, true);
80
-      if (!$where) {
79
+        $where = json_decode($objectParser->object->clear, true);
80
+        if (!$where) {
81 81
         $where = [];
82
-      } else {
82
+        } else {
83 83
         $where = [[$where]];
84
-      }
85
-      if ($ids) {
84
+        }
85
+        if ($ids) {
86 86
         $where[] = ['id', implode(',', $ids), 'NOT IN'];
87
-      }
88
-      if (empty(\App::$cur->migrations->ids['objectIds'])) {
87
+        }
88
+        if (empty(\App::$cur->migrations->ids['objectIds'])) {
89 89
         \App::$cur->migrations->loadObjectIds($objectParser->object->model);
90
-      }
91
-      if (!empty(\App::$cur->migrations->ids['objectIds'][$objectParser->object->model])) {
90
+        }
91
+        if (!empty(\App::$cur->migrations->ids['objectIds'][$objectParser->object->model])) {
92 92
         $where[] = ['id', implode(',', array_keys(\App::$cur->migrations->ids['objectIds'][$objectParser->object->model])), 'IN'];
93
-      }
94
-      $modelName = $objectParser->object->model;
95
-      $objects = $modelName::getList(['where' => $where]);
96
-      foreach ($objects as $object) {
93
+        }
94
+        $modelName = $objectParser->object->model;
95
+        $objects = $modelName::getList(['where' => $where]);
96
+        foreach ($objects as $object) {
97 97
         $objectId = \App::$cur->migrations->findParse($object->id, $objectParser->object->model);
98 98
         if ($objectId) {
99
-          $objectId->delete();
100
-          unset(\App::$cur->migrations->ids['objectIds'][$objectParser->object->model][$object->id]);
101
-          unset(\App::$cur->migrations->ids['parseIds'][$objectParser->object->model][$objectId->parse_id]);
99
+            $objectId->delete();
100
+            unset(\App::$cur->migrations->ids['objectIds'][$objectParser->object->model][$object->id]);
101
+            unset(\App::$cur->migrations->ids['parseIds'][$objectParser->object->model][$objectId->parse_id]);
102 102
         }
103 103
         $object->delete();
104
-      }
104
+        }
105
+    }
105 106
     }
106
-  }
107 107
 
108 108
 }
Please login to merge, or discard this patch.