Completed
Push — master ( 4e62c3...4a84db )
by Alexey
04:58
created
system/modules/Modules/Modules.php 1 patch
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -13,19 +13,19 @@  discard block
 block discarded – undo
13 13
     public function createBlankModule($name, $codeName)
14 14
     {
15 15
         $codeName = ucfirst($codeName);
16
-        Tools::createDir(App::$primary->path . '/modules/' . $codeName);
16
+        Tools::createDir(App::$primary->path.'/modules/'.$codeName);
17 17
         ob_start();
18
-        include $this->path . '/tpls/BlankModule.php';
18
+        include $this->path.'/tpls/BlankModule.php';
19 19
         $moduleCode = ob_get_contents();
20 20
         ob_end_clean();
21
-        file_put_contents(App::$primary->path . '/modules/' . $codeName . '/' . $codeName . '.php', $moduleCode);
22
-        file_put_contents(App::$primary->path . '/modules/' . $codeName . '/info.php', "<?php\nreturn " . CodeGenerator::genArray(['name' => $name]));
23
-        file_put_contents(App::$primary->path . '/modules/' . $codeName . '/generatorHash.php', "<?php\nreturn " . CodeGenerator::genArray([$codeName . '.php' => md5($moduleCode)]));
21
+        file_put_contents(App::$primary->path.'/modules/'.$codeName.'/'.$codeName.'.php', $moduleCode);
22
+        file_put_contents(App::$primary->path.'/modules/'.$codeName.'/info.php', "<?php\nreturn ".CodeGenerator::genArray(['name' => $name]));
23
+        file_put_contents(App::$primary->path.'/modules/'.$codeName.'/generatorHash.php', "<?php\nreturn ".CodeGenerator::genArray([$codeName.'.php' => md5($moduleCode)]));
24 24
     }
25 25
 
26 26
     public function parseColsForModel($cols = [])
27 27
     {
28
-        $modelCols = [ 'labels' => [], 'cols' => [], 'relations' => []];
28
+        $modelCols = ['labels' => [], 'cols' => [], 'relations' => []];
29 29
         foreach ($cols as $col) {
30 30
             $modelCols['labels'][$col['code']] = $col['label'];
31 31
             $colType = !empty($col['type']['primary']) ? $col['type']['primary'] : $col['type'];
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 
51 51
         $colsExist = App::$cur->db->getTableCols($tableName);
52 52
         $tableCols = [];
53
-        if (empty($colsExist[$colPrefix . 'id'])) {
54
-            $tableCols[$colPrefix . 'id'] = 'pk';
53
+        if (empty($colsExist[$colPrefix.'id'])) {
54
+            $tableCols[$colPrefix.'id'] = 'pk';
55 55
         }
56 56
         foreach ($cols as $col) {
57
-            if (!empty($colsExist[$colPrefix . $col['code']])) {
57
+            if (!empty($colsExist[$colPrefix.$col['code']])) {
58 58
                 continue;
59 59
             }
60 60
             $colType = !empty($col['type']['primary']) ? $col['type']['primary'] : $col['type'];
@@ -62,23 +62,23 @@  discard block
 block discarded – undo
62 62
                 case 'image':
63 63
                 case 'number':
64 64
                 case 'relation':
65
-                    $tableCols[$colPrefix . $col['code']] = 'int(11) NOT NULL';
65
+                    $tableCols[$colPrefix.$col['code']] = 'int(11) NOT NULL';
66 66
                     break;
67 67
                 case 'decimal':
68
-                    $tableCols[$colPrefix . $col['code']] = 'decimal(11,2) NOT NULL';
68
+                    $tableCols[$colPrefix.$col['code']] = 'decimal(11,2) NOT NULL';
69 69
                     break;
70 70
                 case 'dateTime':
71
-                    $tableCols[$colPrefix . $col['code']] = 'timestamp NOT NULL';
71
+                    $tableCols[$colPrefix.$col['code']] = 'timestamp NOT NULL';
72 72
                     break;
73 73
                 case 'currentDateTime':
74
-                    $tableCols[$colPrefix . $col['code']] = 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP';
74
+                    $tableCols[$colPrefix.$col['code']] = 'timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP';
75 75
                     break;
76 76
                 case 'text':
77
-                    $tableCols[$colPrefix . $col['code']] = 'varchar(255) NOT NULL';
77
+                    $tableCols[$colPrefix.$col['code']] = 'varchar(255) NOT NULL';
78 78
                     break;
79 79
                 case 'textarea':
80 80
                 default:
81
-                    $tableCols[$colPrefix . $col['code']] = 'text NOT NULL';
81
+                    $tableCols[$colPrefix.$col['code']] = 'text NOT NULL';
82 82
                     break;
83 83
             }
84 84
         }
@@ -94,8 +94,8 @@  discard block
 block discarded – undo
94 94
         $modelCols = $this->parseColsForModel();
95 95
         if (!empty($options['cols'])) {
96 96
             $modelCols = $this->parseColsForModel($options['cols']);
97
-            $tableName = strtolower($module) . '_' . strtolower($codeName);
98
-            $tableCols = $this->parseColsForTable($options['cols'], strtolower($codeName) . '_', $tableName);
97
+            $tableName = strtolower($module).'_'.strtolower($codeName);
98
+            $tableCols = $this->parseColsForTable($options['cols'], strtolower($codeName).'_', $tableName);
99 99
             if (App::$cur->db->tableExist($tableName)) {
100 100
                 foreach ($tableCols as $colKey => $params) {
101 101
                     App::$cur->db->add_col($tableName, $colKey, $params);
@@ -107,15 +107,15 @@  discard block
 block discarded – undo
107 107
         $class->addProperty('objectName', $name, true);
108 108
         $class->addProperty('cols', $modelCols['cols'], true);
109 109
         $class->addProperty('labels', $modelCols['labels'], true);
110
-        $class->addMethod('relations', 'return ' . CodeGenerator::genArray($modelCols['relations']), [], true);
111
-        $modelCode = "<?php \n\nnamespace {$module};\n\n" . $class->generate();
110
+        $class->addMethod('relations', 'return '.CodeGenerator::genArray($modelCols['relations']), [], true);
111
+        $modelCode = "<?php \n\nnamespace {$module};\n\n".$class->generate();
112 112
 
113 113
         $modulePath = Module::getModulePath($module);
114
-        Tools::createDir($modulePath . '/models');
115
-        file_put_contents($modulePath . '/models/' . $codeName . '.php', $modelCode);
116
-        $config = Config::custom($modulePath . '/generatorHash.php');
117
-        $config['models/' . $codeName . '.php'] = md5($modelCode);
118
-        Config::save($modulePath . '/generatorHash.php', $config);
114
+        Tools::createDir($modulePath.'/models');
115
+        file_put_contents($modulePath.'/models/'.$codeName.'.php', $modelCode);
116
+        $config = Config::custom($modulePath.'/generatorHash.php');
117
+        $config['models/'.$codeName.'.php'] = md5($modelCode);
118
+        Config::save($modulePath.'/generatorHash.php', $config);
119 119
     }
120 120
 
121 121
     public function install($module, $params = [])
@@ -135,7 +135,7 @@  discard block
 block discarded – undo
135 135
 
136 136
         $type = 'modules';
137 137
 
138
-        $path = INJI_SYSTEM_DIR . '/modules/';
138
+        $path = INJI_SYSTEM_DIR.'/modules/';
139 139
         $location = 'modules';
140 140
 
141 141
         $config[$location][] = $module;
@@ -148,8 +148,8 @@  discard block
 block discarded – undo
148 148
             }
149 149
         }
150 150
         Config::save('app', $config, null, App::$primary);
151
-        if (file_exists($path . $module . '/install_script.php')) {
152
-            $installFunction = include $path . $module . '/install_script.php';
151
+        if (file_exists($path.$module.'/install_script.php')) {
152
+            $installFunction = include $path.$module.'/install_script.php';
153 153
             $installFunction(1, $params);
154 154
         }
155 155
     }
@@ -178,8 +178,8 @@  discard block
 block discarded – undo
178 178
             $info = Modules::getInfo($module);
179 179
             $moduleName = !empty($info['name']) ? $info['name'] : $module;
180 180
             foreach ($modelsNames as $modelName) {
181
-                $fullModelName = $module . '\\' . $modelName;
182
-                $models[$fullModelName] = $moduleName . ' - ' . ($fullModelName::$objectName ? $fullModelName::$objectName : $modelName);
181
+                $fullModelName = $module.'\\'.$modelName;
182
+                $models[$fullModelName] = $moduleName.' - '.($fullModelName::$objectName ? $fullModelName::$objectName : $modelName);
183 183
             }
184 184
         }
185 185
         foreach (App::$primary->config['modules'] as $configModule) {
@@ -190,9 +190,9 @@  discard block
 block discarded – undo
190 190
             $info = Modules::getInfo($configModule);
191 191
             $moduleName = !empty($info['name']) ? $info['name'] : $configModule;
192 192
             foreach ($modelsNames as $modelName) {
193
-                $fullModelName = $configModule . '\\' . $modelName;
193
+                $fullModelName = $configModule.'\\'.$modelName;
194 194
                 Router::loadClass($fullModelName);
195
-                $models[$fullModelName] = $moduleName . ' - ' . ($fullModelName::$objectName ? $fullModelName::$objectName : $modelName);
195
+                $models[$fullModelName] = $moduleName.' - '.($fullModelName::$objectName ? $fullModelName::$objectName : $modelName);
196 196
             }
197 197
         }
198 198
         return $models;
@@ -201,16 +201,16 @@  discard block
 block discarded – undo
201 201
     public function getModelsList($module, $dir = '')
202 202
     {
203 203
         $modulePath = Module::getModulePath($module);
204
-        $path = rtrim($modulePath . '/models/' . $dir, '/');
204
+        $path = rtrim($modulePath.'/models/'.$dir, '/');
205 205
         $models = [];
206 206
         if (file_exists($path)) {
207 207
             foreach (array_slice(scandir($path), 2) as $file) {
208 208
                 $modelLastName = pathinfo($file, PATHINFO_FILENAME);
209
-                if (is_dir($path . '/' . $file)) {
210
-                    $models = array_merge($models, $this->getModelsList($module, $dir . '/' . $modelLastName));
209
+                if (is_dir($path.'/'.$file)) {
210
+                    $models = array_merge($models, $this->getModelsList($module, $dir.'/'.$modelLastName));
211 211
                 }
212
-                $nameSpace = trim(preg_replace('!/' . $modelLastName . '$!', '', $dir), '/');
213
-                $models[] = trim(str_replace('/', '\\', $nameSpace) . '\\' . $modelLastName, '\\');
212
+                $nameSpace = trim(preg_replace('!/'.$modelLastName.'$!', '', $dir), '/');
213
+                $models[] = trim(str_replace('/', '\\', $nameSpace).'\\'.$modelLastName, '\\');
214 214
             }
215 215
         }
216 216
         return $models;
@@ -219,30 +219,30 @@  discard block
 block discarded – undo
219 219
     public function createController($module, $controllerType)
220 220
     {
221 221
         $modulePath = Module::getModulePath($module);
222
-        $path = $modulePath . '/' . $controllerType . '/' . $module . 'Controller.php';
222
+        $path = $modulePath.'/'.$controllerType.'/'.$module.'Controller.php';
223 223
         $class = new CodeGenerator\ClassGenerator();
224
-        $class->name = $module . 'Controller';
224
+        $class->name = $module.'Controller';
225 225
         $class->extends = 'Controller';
226
-        $controllerCode = "<?php\n\n" . $class->generate();
226
+        $controllerCode = "<?php\n\n".$class->generate();
227 227
         Tools::createDir(pathinfo($path, PATHINFO_DIRNAME));
228 228
         file_put_contents($path, $controllerCode);
229
-        $config = Config::custom($modulePath . '/generatorHash.php');
230
-        $config[$controllerType . '/' . $module . 'Controller.php'] = md5($controllerCode);
231
-        Config::save($modulePath . '/generatorHash.php', $config);
229
+        $config = Config::custom($modulePath.'/generatorHash.php');
230
+        $config[$controllerType.'/'.$module.'Controller.php'] = md5($controllerCode);
231
+        Config::save($modulePath.'/generatorHash.php', $config);
232 232
     }
233 233
 
234 234
     public function addActionToController($module, $type, $controller, $url)
235 235
     {
236 236
         $modulePath = Module::getModulePath($module);
237
-        $path = Modules::getModulePath($module) . '/' . $type . '/' . $controller . '.php';
237
+        $path = Modules::getModulePath($module).'/'.$type.'/'.$controller.'.php';
238 238
         $class = CodeGenerator::parseClass($path);
239
-        $class->addMethod($url . 'Action');
240
-        $controllerCode = "<?php\n\n" . $class->generate();
239
+        $class->addMethod($url.'Action');
240
+        $controllerCode = "<?php\n\n".$class->generate();
241 241
         Tools::createDir(pathinfo($path, PATHINFO_DIRNAME));
242 242
         file_put_contents($path, $controllerCode);
243
-        $config = Config::custom($modulePath . '/generatorHash.php');
244
-        $config[$type . '/' . $module . 'Controller.php'] = md5($controllerCode);
245
-        Config::save($modulePath . '/generatorHash.php', $config);
243
+        $config = Config::custom($modulePath.'/generatorHash.php');
244
+        $config[$type.'/'.$module.'Controller.php'] = md5($controllerCode);
245
+        Config::save($modulePath.'/generatorHash.php', $config);
246 246
     }
247 247
 
248 248
 }
Please login to merge, or discard this patch.
system/modules/Modules/tpls/Model.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,13 +5,13 @@
 block discarded – undo
5 5
 class <?= $codeName; ?> extends \Model {
6 6
 //modelParams<?php
7 7
 if (!empty($name)) {
8
-    echo "\n    static " . '$objectName = \'' . $name . "';";
8
+    echo "\n    static ".'$objectName = \''.$name."';";
9 9
 }
10 10
 if (!empty($labels)) {
11
-    echo "\n    static " . '$labels = [' . CodeGenerator::genArray($labels, 1) . "\n    ];";
11
+    echo "\n    static ".'$labels = ['.CodeGenerator::genArray($labels, 1)."\n    ];";
12 12
 }
13 13
 if (!empty($cols)) {
14
-    echo "\n    static " . '$cols = [' . CodeGenerator::genArray($cols, 1) . "\n    ];";
14
+    echo "\n    static ".'$cols = ['.CodeGenerator::genArray($cols, 1)."\n    ];";
15 15
 }
16 16
 ?>
17 17
 //!modelParams
Please login to merge, or discard this patch.
system/modules/Money/models/Reward.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -63,7 +63,7 @@
 block discarded – undo
63 63
     public function checkBlocked()
64 64
     {
65 65
         $blocked = Wallet\Block::getList(['where' => [
66
-                        ['data', 'reward:' . $this->id],
66
+                        ['data', 'reward:'.$this->id],
67 67
                         [
68 68
                             ['date_expired', '0000-00-00 00:00:00'],
69 69
                             ['date_expired', date('Y-m-d H:i:s'), '>', 'OR']
Please login to merge, or discard this patch.
system/modules/Money/models/Transfer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 
39 39
     public static function itemName($item)
40 40
     {
41
-        return $item->pk() . '. ' . $item->name();
41
+        return $item->pk().'. '.$item->name();
42 42
     }
43 43
 
44 44
     public static $dataManagers = [
@@ -48,16 +48,16 @@  discard block
 block discarded – undo
48 48
             ],
49 49
             'name' => 'Переводы',
50 50
             'cols' => [
51
-                'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create'
51
+                'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create'
52 52
             ],
53 53
             'actions' => [
54 54
                 'Money\CancelTransfer', 'Money\CompleteTransfer'
55 55
             ],
56 56
             'sortable' => [
57
-                'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create'
57
+                'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create'
58 58
             ],
59 59
             'filters' => [
60
-                'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled','date_create'
60
+                'user_id', 'to_user_id', 'currency_id', 'amount', 'comment', 'complete', 'canceled', 'date_create'
61 61
             ]
62 62
         ]
63 63
     ];
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
 
183 183
     public function name()
184 184
     {
185
-        return 'Перевод на сумму ' . $this->amount . ' ' . $this->currency->name . ' от ' . $this->user->name() . ' для ' . $this->toUser->name();
185
+        return 'Перевод на сумму '.$this->amount.' '.$this->currency->name.' от '.$this->user->name().' для '.$this->toUser->name();
186 186
     }
187 187
 
188 188
     public function cancel()
@@ -192,14 +192,14 @@  discard block
 block discarded – undo
192 192
         }
193 193
 
194 194
         $this->canceled = 1;
195
-        $block = \Money\Wallet\Block::get('Money\Transfer:' . $this->id, 'data');
195
+        $block = \Money\Wallet\Block::get('Money\Transfer:'.$this->id, 'data');
196 196
         if ($block) {
197 197
             $block->delete();
198 198
         }
199 199
         $wallets = \App::$cur->money->getUserWallets($this->user_id);
200 200
         $text = 'Отмена перевода средств';
201 201
         $wallets[$this->currency_id]->diff($this->amount, $text);
202
-        \App::$cur->users->AddUserActivity($this->user_id, 4, $text . '<br />' . (float) $this->amount . ' ' . $wallets[$this->currency_id]->currency->acronym());
202
+        \App::$cur->users->AddUserActivity($this->user_id, 4, $text.'<br />'.(float) $this->amount.' '.$wallets[$this->currency_id]->currency->acronym());
203 203
         $this->save();
204 204
         return true;
205 205
     }
@@ -211,14 +211,14 @@  discard block
 block discarded – undo
211 211
         }
212 212
 
213 213
         $this->complete = 1;
214
-        $block = \Money\Wallet\Block::get('Money\Transfer:' . $this->id, 'data');
214
+        $block = \Money\Wallet\Block::get('Money\Transfer:'.$this->id, 'data');
215 215
         if ($block) {
216 216
             $block->delete();
217 217
         }
218 218
         $wallets = \App::$cur->money->getUserWallets($this->to_user_id);
219
-        $text = 'Перевод средств от ' . $this->user->name() . '.' . ($this->comment ? ' Комментарий:' . $this->comment : '');
219
+        $text = 'Перевод средств от '.$this->user->name().'.'.($this->comment ? ' Комментарий:'.$this->comment : '');
220 220
         $wallets[$this->currency_id]->diff($this->amount, $text);
221
-        \App::$cur->users->AddUserActivity($this->to_user_id, 4, $text . '<br />' . (float) $this->amount . ' ' . $wallets[$this->currency_id]->currency->acronym());
221
+        \App::$cur->users->AddUserActivity($this->to_user_id, 4, $text.'<br />'.(float) $this->amount.' '.$wallets[$this->currency_id]->currency->acronym());
222 222
         $this->save();
223 223
         return true;
224 224
     }
Please login to merge, or discard this patch.
system/modules/Money/install_script.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-return function ($step = NULL, $params = []) {
3
+return function($step = NULL, $params = []) {
4 4
 
5 5
     $currencies = [
6 6
         [
@@ -46,22 +46,22 @@  discard block
 block discarded – undo
46 46
         [
47 47
             'name' => 'Wallet One',
48 48
             'object_name' => 'WalletOne',
49
-            'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__ . '/static/images/WalletOne.png')
49
+            'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__.'/static/images/WalletOne.png')
50 50
         ],
51 51
         [
52 52
             'name' => 'Robokassa',
53 53
             'object_name' => 'Robokassa',
54
-            'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__ . '/static/images/Robokassa.png')
54
+            'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__.'/static/images/Robokassa.png')
55 55
         ],
56 56
         [
57 57
             'name' => 'Payeer',
58 58
             'object_name' => 'Payeer',
59
-            'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__ . '/static/images/Payeer.png')
59
+            'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__.'/static/images/Payeer.png')
60 60
         ],
61 61
         [
62 62
             'name' => 'PerfectMoney',
63 63
             'object_name' => 'PerfectMoney',
64
-            'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__ . '/static/images/PerfectMoney.png')
64
+            'image_file_id' => App::$cur->Files->uploadFromUrl(__DIR__.'/static/images/PerfectMoney.png')
65 65
         ],
66 66
     ];
67 67
     $merchantsConfig = [
Please login to merge, or discard this patch.
system/modules/Money/appControllers/MerchantsController.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
             'callback_method' => ''
22 22
                 ], null, [
23 23
             'description' => 'Тестовый платеж',
24
-            'success' => 'http://' . INJI_DOMAIN_NAME . '/',
25
-            'false' => 'http://' . INJI_DOMAIN_NAME . '/'
24
+            'success' => 'http://'.INJI_DOMAIN_NAME.'/',
25
+            'false' => 'http://'.INJI_DOMAIN_NAME.'/'
26 26
         ]);
27 27
     }
28 28
 
@@ -122,9 +122,9 @@  discard block
 block discarded – undo
122 122
             Tools::redirect('/', 'Валюта для этого способа оплаты не найдена', 'danger');
123 123
         }
124 124
         $merchantOptions = [
125
-            'description' => $pay->description ? '#' . $pay->id . ' ' . $pay->description : 'Оплата счета №' . $pay->id . ' на сайте: ' . idn_to_utf8(INJI_DOMAIN_NAME),
126
-            'success' => 'http://' . INJI_DOMAIN_NAME . '/',
127
-            'false' => 'http://' . INJI_DOMAIN_NAME . '/'
125
+            'description' => $pay->description ? '#'.$pay->id.' '.$pay->description : 'Оплата счета №'.$pay->id.' на сайте: '.idn_to_utf8(INJI_DOMAIN_NAME),
126
+            'success' => 'http://'.INJI_DOMAIN_NAME.'/',
127
+            'false' => 'http://'.INJI_DOMAIN_NAME.'/'
128 128
         ];
129 129
 
130 130
         $this->Money->goToMerchant($pay, $merchant, $method, $merchantOptions);
Please login to merge, or discard this patch.
system/modules/Money/appControllers/content/pays.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -17,8 +17,8 @@
 block discarded – undo
17 17
             $pay->description,
18 18
             $pay->sum,
19 19
             $pay->currency->name(),
20
-            '<a href = "/money/merchants/pay/' . $pay->id . '" class="btn btn-success btn-sm">Оплатить</a>',
21
-            '<a href = "/money/merchants/cancelPay/' . $pay->id . '" class="btn btn-danger btn-sm">Отказаться</a>'
20
+            '<a href = "/money/merchants/pay/'.$pay->id.'" class="btn btn-success btn-sm">Оплатить</a>',
21
+            '<a href = "/money/merchants/cancelPay/'.$pay->id.'" class="btn btn-danger btn-sm">Отказаться</a>'
22 22
         ]);
23 23
     }
24 24
     $table->draw();
Please login to merge, or discard this patch.
system/modules/Money/appControllers/content/pay.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
             <td>
25 25
               <?php
26 26
               foreach ($allowCurrencies as $allowCurrency) {
27
-                  $className = 'Money\MerchantHelper\\' . $merchant->object_name;
27
+                  $className = 'Money\MerchantHelper\\'.$merchant->object_name;
28 28
                   $sum = $className::getFinalSum($pay, $allowCurrency);
29 29
                   ?>
30 30
                   <b><?= $allowCurrency['currency']->name(); ?></b>
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
               ?>
35 35
             </td>
36 36
             <td width="100%">
37
-              <?= $merchant->previewImage ? '<img src="' . $merchant->previewImage->path . '" class="img-responsive" />' : ''; ?>
37
+              <?= $merchant->previewImage ? '<img src="'.$merchant->previewImage->path.'" class="img-responsive" />' : ''; ?>
38 38
             </td>
39 39
           </tr>
40 40
           <?php
Please login to merge, or discard this patch.
system/modules/Money/appControllers/MoneyController.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -22,23 +22,23 @@  discard block
 block discarded – undo
22 22
             $transfer->save();
23 23
 
24 24
             $wallets = $this->money->getUserWallets();
25
-            $text = 'Перевод средств для ' . $transfer->toUser->name();
25
+            $text = 'Перевод средств для '.$transfer->toUser->name();
26 26
             $wallets[$transfer->currency_id]->diff(-$transfer->amount, $text);
27
-            \App::$cur->users->AddUserActivity($transfer->user_id, 4, $text . '<br />' . (float) $transfer->amount . ' ' . $wallets[$transfer->currency_id]->currency->acronym());
27
+            \App::$cur->users->AddUserActivity($transfer->user_id, 4, $text.'<br />'.(float) $transfer->amount.' '.$wallets[$transfer->currency_id]->currency->acronym());
28 28
 
29 29
             $block = new Money\Wallet\Block();
30 30
             $block->wallet_id = $wallets[$transfer->currency_id]->id;
31 31
             $block->amount = $transfer->amount;
32
-            $block->comment = 'Заблокированно на перевод средств для ' . $transfer->toUser->name();
33
-            $block->data = 'Money\Transfer:' . $transfer->id;
32
+            $block->comment = 'Заблокированно на перевод средств для '.$transfer->toUser->name();
33
+            $block->data = 'Money\Transfer:'.$transfer->id;
34 34
             $block->save();
35 35
 
36
-            $from = 'noreply@' . INJI_DOMAIN_NAME;
36
+            $from = 'noreply@'.INJI_DOMAIN_NAME;
37 37
             $to = \Users\User::$cur->mail;
38 38
             $subject = 'Подтверждение перевода';
39
-            $text = 'Чтобы подтвержить перевод №' . $transfer->id . ' введите код <b>' . $transfer->code . '</b> на <a href = "http://' . INJI_DOMAIN_NAME . '/money/confirmTransfer/' . $transfer->id . '?code=' . $transfer->code . '">странице</a> перевода';
39
+            $text = 'Чтобы подтвержить перевод №'.$transfer->id.' введите код <b>'.$transfer->code.'</b> на <a href = "http://'.INJI_DOMAIN_NAME.'/money/confirmTransfer/'.$transfer->id.'?code='.$transfer->code.'">странице</a> перевода';
40 40
             Tools::sendMail($from, $to, $subject, $text);
41
-            Tools::redirect('/money/confirmTransfer/' . $transfer->id);
41
+            Tools::redirect('/money/confirmTransfer/'.$transfer->id);
42 42
         }
43 43
         $this->view->setTitle('Перевод средств');
44 44
         $this->view->page(['data' => compact('form')]);
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
                 Msg::add('Код не совпадает', 'danger');
56 56
             } else {
57 57
                 $transfer->complete = 1;
58
-                $block = Money\Wallet\Block::get('Money\Transfer:' . $transfer->id, 'data');
58
+                $block = Money\Wallet\Block::get('Money\Transfer:'.$transfer->id, 'data');
59 59
                 $block->delete();
60 60
                 $wallets = $this->money->getUserWallets($transfer->to_user_id);
61
-                $text = 'Перевод средств от ' . $transfer->user->name() . '.' . ($transfer->comment ? ' Комментарий:' . $transfer->comment : '');
61
+                $text = 'Перевод средств от '.$transfer->user->name().'.'.($transfer->comment ? ' Комментарий:'.$transfer->comment : '');
62 62
                 $wallets[$transfer->currency_id]->diff($transfer->amount, $text);
63
-                \App::$cur->users->AddUserActivity($transfer->to_user_id, 4, $text . '<br />' . (float) $transfer->amount . ' ' . $wallets[$transfer->currency_id]->currency->acronym());
63
+                \App::$cur->users->AddUserActivity($transfer->to_user_id, 4, $text.'<br />'.(float) $transfer->amount.' '.$wallets[$transfer->currency_id]->currency->acronym());
64 64
                 $transfer->save();
65 65
                 Tools::redirect('/users/cabinet', 'Перевод был успешно завершен', 'success');
66 66
             }
@@ -92,12 +92,12 @@  discard block
 block discarded – undo
92 92
                 'currency_id' => $currency->id,
93 93
                 'sum' => (float) str_replace(',', '.', $_POST['amount']),
94 94
                 'type' => 'refill',
95
-                'description' => 'Пополнение баланса ' . $currency->name(),
95
+                'description' => 'Пополнение баланса '.$currency->name(),
96 96
                 'callback_module' => 'Money',
97 97
                 'callback_method' => 'refillPayRecive'
98 98
             ]);
99 99
             $pay->save();
100
-            Tools::redirect('/money/merchants/pay/' . $pay->id);
100
+            Tools::redirect('/money/merchants/pay/'.$pay->id);
101 101
         } else {
102 102
             $currencies = Money\Currency::getList(['where' => ['refill', 1], 'forSelect' => true]);
103 103
             $this->view->setTitle('Пополнение счета');
@@ -146,8 +146,8 @@  discard block
 block discarded – undo
146 146
                 $error = true;
147 147
             }
148 148
             if (!$error) {
149
-                $wallets[$currency->id]->diff(-$amount, 'Обмен валюты на ' . $targetCurrency->name());
150
-                $wallets[$targetCurrency->id]->diff($amount * $rate->rate, 'Обмне валюты с ' . $currency->name());
149
+                $wallets[$currency->id]->diff(-$amount, 'Обмен валюты на '.$targetCurrency->name());
150
+                $wallets[$targetCurrency->id]->diff($amount * $rate->rate, 'Обмне валюты с '.$currency->name());
151 151
                 Tools::redirect('/users/cabinet', 'Обмен был успешно проведен');
152 152
             }
153 153
         }
@@ -163,21 +163,21 @@  discard block
 block discarded – undo
163 163
         }
164 164
         $wallet = Money\Wallet::get((int) $walletId);
165 165
         if (!$wallet || $wallet->user_id != \Users\User::$cur->id) {
166
-            Tools::redirect('/money/merchants/pay/' . $pay->id, 'Такой кошелек не найден');
166
+            Tools::redirect('/money/merchants/pay/'.$pay->id, 'Такой кошелек не найден');
167 167
         }
168 168
         if ($pay->currency_id != $wallet->currency_id) {
169 169
             $rate = \Money\Currency\ExchangeRate::get([['currency_id', $wallet->currency_id], ['target_currency_id', $pay->currency_id]]);
170 170
             if (!$rate) {
171
-                Tools::redirect('/money/merchants/pay/' . $pay->id, 'Нет возможности оплатить счет в валюте ' . $pay->currency->name() . ' валютой ' . $wallet->currency->name());
171
+                Tools::redirect('/money/merchants/pay/'.$pay->id, 'Нет возможности оплатить счет в валюте '.$pay->currency->name().' валютой '.$wallet->currency->name());
172 172
             }
173 173
             $sum = $pay->sum / $rate->rate;
174 174
         } else {
175 175
             $sum = $pay->sum;
176 176
         }
177 177
         if ($sum > $wallet->amount) {
178
-            Tools::redirect('/money/merchants/pay/' . $pay->id, 'На вашем счете недостаточно средств', 'danger');
178
+            Tools::redirect('/money/merchants/pay/'.$pay->id, 'На вашем счете недостаточно средств', 'danger');
179 179
         }
180
-        $wallet->diff(-$sum, 'Оплата счета №' . $payId);
180
+        $wallet->diff(-$sum, 'Оплата счета №'.$payId);
181 181
         $statuses = \Money\Pay\Status::getList(['key' => 'code']);
182 182
         if (!empty($statuses['success'])) {
183 183
             $pay->pay_status_id = $statuses['success']->id;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
         }
199 199
         $merchant = \Money\MerchantHelper\Primary::getMerchant();
200 200
         if (!$merchant->active) {
201
-            Tools::redirect('/money/merchants/pay/' . $pay->id, 'Этот способ оплаты недоступен');
201
+            Tools::redirect('/money/merchants/pay/'.$pay->id, 'Этот способ оплаты недоступен');
202 202
         }
203 203
         $allowCurrencies = $merchant->allowCurrencies($pay);
204 204
         $method = [];
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         if (!$method) {
212 212
             Tools::redirect('/', 'Валюта для этого способа оплаты не найдена', 'danger');
213 213
         }
214
-        $className = 'Money\MerchantHelper\\' . $merchant->object_name;
214
+        $className = 'Money\MerchantHelper\\'.$merchant->object_name;
215 215
         $sum = $className::getFinalSum($pay, $method);
216 216
         $this->view->setTitle('Прямая оплата');
217 217
         $this->view->page(['data' => compact('pay', 'sum', 'method')]);
Please login to merge, or discard this patch.