Completed
Push — master ( 125ee5...b3888f )
by Alexey
05:20
created
system/modules/Ecommerce/models/Item/Offer.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -78,12 +78,12 @@  discard block
 block discarded – undo
78 78
     {
79 79
         $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]);
80 80
         if ($warehouse) {
81
-            $warehouse->count +=(float) $count;
81
+            $warehouse->count += (float) $count;
82 82
             $warehouse->save();
83 83
         } else {
84 84
             $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]);
85 85
             if ($warehouse) {
86
-                $warehouse->count +=(float) $count;
86
+                $warehouse->count += (float) $count;
87 87
                 $warehouse->save();
88 88
             }
89 89
         }
@@ -101,21 +101,21 @@  discard block
 block discarded – undo
101 101
             }
102 102
         }
103 103
         if ($warehouseIds) {
104
-            \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Warehouse::index(), $warehouseIds, 'IN');
104
+            \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Warehouse::index(), $warehouseIds, 'IN');
105 105
         }
106
-        \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id);
107
-        \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Item\Offer\Warehouse::colPrefix() . 'count),0) as `sum` ';
106
+        \App::$cur->db->where(\Ecommerce\Item\Offer\Warehouse::colPrefix().\Ecommerce\Item\Offer::index(), $this->id);
107
+        \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Item\Offer\Warehouse::colPrefix().'count),0) as `sum` ';
108 108
         $warehouse = \App::$cur->db->select(\Ecommerce\Item\Offer\Warehouse::table())->fetch();
109 109
 
110
-        \App::$cur->db->cols = 'COALESCE(sum(' . \Ecommerce\Warehouse\Block::colPrefix() . 'count) ,0) as `sum` ';
111
-        \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Item\Offer::index(), $this->id);
110
+        \App::$cur->db->cols = 'COALESCE(sum('.\Ecommerce\Warehouse\Block::colPrefix().'count) ,0) as `sum` ';
111
+        \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Item\Offer::index(), $this->id);
112 112
         if ($cart_id) {
113
-            \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index(), (int) $cart_id, '!=');
113
+            \App::$cur->db->where(\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index(), (int) $cart_id, '!=');
114 114
         }
115 115
         $on = '
116
-            ' . \Ecommerce\Cart::index() . ' = ' . \Ecommerce\Warehouse\Block::colPrefix() . \Ecommerce\Cart::index() . ' AND (
117
-            (`' . \Ecommerce\Cart::colPrefix() . 'warehouse_block` = 1 and `' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(2,3,6)) || 
118
-            (`' . \Ecommerce\Cart::colPrefix() . 'cart_status_id` in(0,1) and `' . \Ecommerce\Cart::colPrefix() . 'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE))
116
+            ' . \Ecommerce\Cart::index().' = '.\Ecommerce\Warehouse\Block::colPrefix().\Ecommerce\Cart::index().' AND (
117
+            (`' . \Ecommerce\Cart::colPrefix().'warehouse_block` = 1 and `'.\Ecommerce\Cart::colPrefix().'cart_status_id` in(2,3,6)) || 
118
+            (`' . \Ecommerce\Cart::colPrefix().'cart_status_id` in(0,1) and `'.\Ecommerce\Cart::colPrefix().'date_last_activ` >=subdate(now(),INTERVAL 30 MINUTE))
119 119
             )
120 120
         ';
121 121
         \App::$cur->db->join(\Ecommerce\Cart::table(), $on, 'inner');
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Parser/Object/Value.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
                 $dir = pathinfo($this->object->walker->migtarionLog->source, PATHINFO_DIRNAME);
73 73
                 if ($this->model->{$this->param->value}) {
74 74
                     $file = \Files\File::get($this->model->{$this->param->value});
75
-                    if ($file && $value && file_exists($dir . '/' . $value) && file_exists(\App::$primary->path . $file->path) && md5_file($dir . '/' . $value) == md5_file(\App::$primary->path . $file->path)) {
75
+                    if ($file && $value && file_exists($dir.'/'.$value) && file_exists(\App::$primary->path.$file->path) && md5_file($dir.'/'.$value) == md5_file(\App::$primary->path.$file->path)) {
76 76
                         $notEq = false;
77 77
                     }
78 78
                     if ($file && $notEq) {
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
                     }
82 82
                 }
83 83
                 if ($notEq) {
84
-                    $this->model->{$this->param->value} = \App::$primary->files->uploadFromUrl($dir . '/' . $value, ['accept_group' => 'image', 'upload_code' => 'MigrationUpload']);
84
+                    $this->model->{$this->param->value} = \App::$primary->files->uploadFromUrl($dir.'/'.$value, ['accept_group' => 'image', 'upload_code' => 'MigrationUpload']);
85 85
                 }
86 86
                 break;
87 87
             default:
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Parser/Object.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@
 block discarded – undo
62 62
                         if ($param->type == 'custom') {
63 63
                             $parserName = $param->value;
64 64
                         } else {
65
-                            $parserName = '\Migrations\Parser\Object\\' . ucfirst($param->type);
65
+                            $parserName = '\Migrations\Parser\Object\\'.ucfirst($param->type);
66 66
                         }
67 67
                         $parser = new $parserName;
68 68
                         $parser->data = &$data[$param->code];
Please login to merge, or discard this patch.
system/modules/Ui/objects/Tree.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
           }
32 32
           $count += count($items);
33 33
           foreach ($items as $objectChild) {
34
-              $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc, $order);
34
+              $count += static::showLi($objectChild, 1, $maxDeep, $hrefFunc, $order);
35 35
           }
36 36
           ?>
37 37
         </ul>
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
             $item = $item['text'];
53 53
         }
54 54
         if (!isset($attributes['id'])) {
55
-            $attributes['id'] = str_replace('\\', '_', get_class($object)) . "-{$object->pk()}";
55
+            $attributes['id'] = str_replace('\\', '_', get_class($object))."-{$object->pk()}";
56 56
         }
57 57
         if (!$maxDeep || $deep < $maxDeep) {
58 58
             $items = $class::getList(['where' => ['parent_id', $object->pk()], 'order' => $order]);
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                     echo \Html::el('li', $attributes, $item, true);
64 64
                     echo '<ul>';
65 65
                 }
66
-                $count+=static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc, $order);
66
+                $count += static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc, $order);
67 67
             }
68 68
         }
69 69
         if ($isset) {
Please login to merge, or discard this patch.
system/modules/Money/models/Wallet.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
         'manager' => [
44 44
             'cols' => ['user:id', 'user_id', 'currency_id', 'amount'],
45 45
             'sortable' => ['user:id', 'user_id', 'currency_id', 'amount'],
46
-            'filters' => [ 'currency_id'],
46
+            'filters' => ['currency_id'],
47 47
         ]
48 48
     ];
49 49
 
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
     {
67 67
         $amount = (float) $amount;
68 68
         $query = \App::$cur->db->newQuery();
69
-        $string = 'UPDATE ' . \App::$cur->db->table_prefix . $this->table() . ' SET `' . $this->colPrefix() . 'amount`=`' . $this->colPrefix() . 'amount`+' . $amount . ' where `' . $this->index() . '` = ' . $this->id;
69
+        $string = 'UPDATE '.\App::$cur->db->table_prefix.$this->table().' SET `'.$this->colPrefix().'amount`=`'.$this->colPrefix().'amount`+'.$amount.' where `'.$this->index().'` = '.$this->id;
70 70
         $query->query($string);
71 71
         $history = new Wallet\History();
72 72
         $history->wallet_id = $this->pk();
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
     {
87 87
         switch ($this->currency->round_type) {
88 88
             case 'floor':
89
-                $dif = (float) ('1' . str_repeat('0', $this->currency->round_precision));
89
+                $dif = (float) ('1'.str_repeat('0', $this->currency->round_precision));
90 90
                 return floor($this->amount * $dif) / $dif;
91 91
             default :
92 92
                 return $this->amount;
Please login to merge, or discard this patch.
system/modules/StaticLoader/StaticLoader.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -26,16 +26,16 @@  discard block
 block discarded – undo
26 26
         }
27 27
         $app = substr($path, 0, strpos($path, '/'));
28 28
        
29
-        if ($app && file_exists(INJI_SYSTEM_DIR . '/program/' . $app)) {
29
+        if ($app && file_exists(INJI_SYSTEM_DIR.'/program/'.$app)) {
30 30
             $path = substr($path, strpos($path, '/') + 1);
31 31
             if (\App::$cur->name != $app) {
32 32
                 $scriptApp = new App();
33 33
                 $scriptApp->name = $app;
34 34
                 $scriptApp->system = true;
35
-                $scriptApp->staticPath = "/" . $scriptApp->name . "/static";
36
-                $scriptApp->templatesPath = "/" . $scriptApp->name . "/static/templates";
37
-                $scriptApp->path = INJI_SYSTEM_DIR . '/program/' . $scriptApp->name;
38
-                $scriptApp->type = 'app' . ucfirst(strtolower($scriptApp->name));
35
+                $scriptApp->staticPath = "/".$scriptApp->name."/static";
36
+                $scriptApp->templatesPath = "/".$scriptApp->name."/static/templates";
37
+                $scriptApp->path = INJI_SYSTEM_DIR.'/program/'.$scriptApp->name;
38
+                $scriptApp->type = 'app'.ucfirst(strtolower($scriptApp->name));
39 39
                 $scriptApp->installed = true;
40 40
                 $scriptApp->params = [];
41 41
                 $scriptApp->config = Config::app($scriptApp);
@@ -53,13 +53,13 @@  discard block
 block discarded – undo
53 53
         $type = substr($path, 0, strpos($path, '/'));
54 54
         switch ($type) {
55 55
             case 'libs':
56
-                return App::$cur->Libs->getPath(array_slice(explode('/', $path),2));
56
+                return App::$cur->Libs->getPath(array_slice(explode('/', $path), 2));
57 57
             case 'templates':
58 58
                 $path = substr($path, strpos($path, '/') + 1);
59
-                return $scriptApp->view->templatesPath . '/' . $path;
59
+                return $scriptApp->view->templatesPath.'/'.$path;
60 60
             case 'system':
61 61
                 $path = substr($path, strpos($path, '/') + 1);
62
-                return INJI_SYSTEM_DIR . '/static/' . $path;
62
+                return INJI_SYSTEM_DIR.'/static/'.$path;
63 63
             case 'moduleAsset':
64 64
                 $path = substr($path, strpos($path, '/') + 1);
65 65
                 if (!strpos($path, '/')) {
@@ -72,11 +72,11 @@  discard block
 block discarded – undo
72 72
                 }
73 73
                 $path = substr($path, strpos($path, '/') + 1);
74 74
                 if (is_callable([$module, 'staticCalled'])) {
75
-                    return $scriptApp->$module->staticCalled($path, $scriptApp->$module->path . '/static/');
75
+                    return $scriptApp->$module->staticCalled($path, $scriptApp->$module->path.'/static/');
76 76
                 }
77
-                return $scriptApp->$module->path . '/static/' . $path;
77
+                return $scriptApp->$module->path.'/static/'.$path;
78 78
             default:
79
-                return $scriptApp->path . '/static/' . $path;
79
+                return $scriptApp->path.'/static/'.$path;
80 80
         }
81 81
     }
82 82
 
@@ -139,9 +139,9 @@  discard block
 block discarded – undo
139 139
                         $pos = $_GET['resize_pos'];
140 140
                     }
141 141
                     $dirnoslash = str_replace('/', '', substr($fileinfo['dirname'], strpos($fileinfo['dirname'], '/static')));
142
-                    $path = $dir . '/static/cache/' . $dirnoslash . $fileinfo['filename'] . '.' . $sizes[0] . 'x' . $sizes[1] . $crop . $pos . '.' . $fileinfo['extension'];
142
+                    $path = $dir.'/static/cache/'.$dirnoslash.$fileinfo['filename'].'.'.$sizes[0].'x'.$sizes[1].$crop.$pos.'.'.$fileinfo['extension'];
143 143
                     if (!file_exists($path)) {
144
-                        Tools::createDir($dir . '/static/cache/');
144
+                        Tools::createDir($dir.'/static/cache/');
145 145
                         copy($file, $path);
146 146
                         Tools::resizeImage($path, $sizes[0], $sizes[1], $crop, $pos);
147 147
                     }
@@ -166,9 +166,9 @@  discard block
 block discarded – undo
166 166
         header("Cache-control: public");
167 167
         header("Accept-Ranges: bytes");
168 168
         header("Pragma: public");
169
-        header("Content-Length: " . filesize($file));
170
-        header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime($file)) . ' GMT');
171
-        header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 60 * 60 * 24 * 256) . ' GMT');
169
+        header("Content-Length: ".filesize($file));
170
+        header('Last-Modified: '.gmdate('D, d M Y H:i:s', filemtime($file)).' GMT');
171
+        header('Expires: '.gmdate('D, d M Y H:i:s', time() + 60 * 60 * 24 * 256).' GMT');
172 172
         if (filemtime($file) <= $modifiedSince && (!isset($_SERVER['HTTP_CACHE_CONTROL']) || $_SERVER['HTTP_CACHE_CONTROL'] != 'no-cache')) {
173 173
             // Разгружаем канал передачи данных!
174 174
             header('HTTP/1.1 304 Not Modified');
@@ -179,19 +179,19 @@  discard block
 block discarded – undo
179 179
         header('Content-Description: File Transfer');
180 180
         //}
181 181
         if (isset($this->mimes[strtolower($fileinfo['extension'])])) {
182
-            header("Content-Type: " . $this->mimes[strtolower($fileinfo['extension'])]);
182
+            header("Content-Type: ".$this->mimes[strtolower($fileinfo['extension'])]);
183 183
         }
184 184
 
185 185
         if (isset($_GET['frustrate_dl']) || in_array($fileinfo['extension'], array('doc', 'docx', 'xls', 'xlsx'))) {
186 186
 
187
-            $fileName = $fileinfo['filename'] . '.' . $fileinfo['extension'];
187
+            $fileName = $fileinfo['filename'].'.'.$fileinfo['extension'];
188 188
             if (App::$cur->db->connect) {
189
-                $fileObj = Files\File::get([ 'path', '%/' . $fileinfo['filename'] . '.' . $fileinfo['extension'], 'LIKE']);
189
+                $fileObj = Files\File::get(['path', '%/'.$fileinfo['filename'].'.'.$fileinfo['extension'], 'LIKE']);
190 190
                 if ($fileObj) {
191 191
                     $fileName = $fileObj->original_name;
192 192
                 }
193 193
             }
194
-            header('Content-Disposition: attachment; filename="' . $fileName . '"');
194
+            header('Content-Disposition: attachment; filename="'.$fileName.'"');
195 195
         }
196 196
 
197 197
         header('Content-Transfer-Encoding: binary');
Please login to merge, or discard this patch.
system/modules/Dashboard/appAdminControllers/content/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <div class="dashboard-widgets">
2
-  <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', ' . \Users\User::$cur->name() : ''; ?></h4>
2
+  <h4 class ='dashboard-widgets-welcome'>Добро Пожаловать в панель управления<?= class_exists('\Users\User') ? ', '.\Users\User::$cur->name() : ''; ?></h4>
3 3
   <div class = "row">
4 4
     <?php
5 5
     $rowSum = 0;
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
         }
10 10
 
11 11
         $widgetSize = !empty($section['size']) ? $section['size'] : 1;
12
-        $rowSum+=$widgetSize;
12
+        $rowSum += $widgetSize;
13 13
         ?>
14 14
         <div class="col-sm-<?= $widgetSize * 4; ?>" style="margin-bottom: 10px;"><?= $section['widget'](); ?></div>
15 15
         <?php
Please login to merge, or discard this patch.
system/modules/View/appAdminControllers/content/index.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -15,8 +15,8 @@
 block discarded – undo
15 15
     foreach ($templates['app']['installed'] as $template => $name) {
16 16
         $table->addRow([
17 17
             $name,
18
-            (empty($templates['app']['current']) || $templates['app']['current'] != $template) ? '<a href = "/admin/view/setDefault/' . $template . '">Установить по умолчанию</a>' : 'Тема по умолчанию',
19
-            '<a href = "/admin/view/template/editFile/' . $template . '">Файлы</a> <a href = "/admin/view/editTemplate/' . $template . '">Редактировать</a>'
18
+            (empty($templates['app']['current']) || $templates['app']['current'] != $template) ? '<a href = "/admin/view/setDefault/'.$template.'">Установить по умолчанию</a>' : 'Тема по умолчанию',
19
+            '<a href = "/admin/view/template/editFile/'.$template.'">Файлы</a> <a href = "/admin/view/editTemplate/'.$template.'">Редактировать</a>'
20 20
         ]);
21 21
     }
22 22
 $table->draw();
23 23
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/View/appAdminControllers/content/template/chooseFile.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,9 +3,9 @@
 block discarded – undo
3 3
 <hr/>
4 4
 <?php
5 5
 foreach ($template->config['css'] as $file) {
6
-    if (file_exists($template->path . '/css/' . $file)) {
6
+    if (file_exists($template->path.'/css/'.$file)) {
7 7
         ?>
8
-        <a href ='/admin/view/template/editFile/<?= $template->name; ?>?path=<?= 'css/' . $file; ?>'><?= $file; ?></a>
8
+        <a href ='/admin/view/template/editFile/<?= $template->name; ?>?path=<?= 'css/'.$file; ?>'><?= $file; ?></a>
9 9
         <?php
10 10
     }
11 11
 }
Please login to merge, or discard this patch.