Completed
Push — master ( b5b491...b93a9c )
by Alexey
05:05
created
system/modules/Ui/objects/DataManager.php 3 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -329,6 +329,9 @@
 block discarded – undo
329 329
         return $rows;
330 330
     }
331 331
 
332
+    /**
333
+     * @param DataManager $dataManager
334
+     */
332 335
     public static function drawCol($item, $colName, $params = [], $dataManager = null, $originalCol = '', $originalItem = null)
333 336
     {
334 337
         $modelName = get_class($item);
Please login to merge, or discard this patch.
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -164,12 +164,12 @@
 block discarded – undo
164 164
             <li><a href ='' onclick='inji.Ui.dataManagers.get(this).rowSelection("inverse");return false;'>Инвертировать</a></li>
165 165
             <li role="separator" class="divider"></li>
166 166
               <?php
167
-              foreach ($actions as $action => $actionParams) {
168
-                  if (class_exists($actionParams['className']) && $actionParams['className']::$groupAction) {
169
-                      echo "<li><a href ='' onclick='inji.Ui.dataManagers.get(this).groupAction(\"" . str_replace('\\', '\\\\', $action) . "\");return false;'>{$actionParams['className']::$name}</a></li>";
170
-                  }
171
-              }
172
-              ?>
167
+                foreach ($actions as $action => $actionParams) {
168
+                    if (class_exists($actionParams['className']) && $actionParams['className']::$groupAction) {
169
+                        echo "<li><a href ='' onclick='inji.Ui.dataManagers.get(this).groupAction(\"" . str_replace('\\', '\\\\', $action) . "\");return false;'>{$actionParams['className']::$name}</a></li>";
170
+                    }
171
+                }
172
+                ?>
173 173
           </ul>
174 174
         </div>
175 175
         <?php
Please login to merge, or discard this patch.
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             $this->name = $this->managerOptions['name'];
59 59
         }
60 60
 
61
-        $this->managerId = str_replace('\\', '_', 'dataManager_' . $this->modelName . '_' . $this->managerName . '_' . \Tools::randomString());
61
+        $this->managerId = str_replace('\\', '_', 'dataManager_'.$this->modelName.'_'.$this->managerName.'_'.\Tools::randomString());
62 62
     }
63 63
 
64 64
     /**
@@ -102,13 +102,13 @@  discard block
 block discarded – undo
102 102
         if (!empty($this->managerOptions['filters'])) {
103 103
             $buttons[] = [
104 104
                 'text' => 'Фильтры',
105
-                'onclick' => '  var modal = $("#' . $this->managerId . '_filters");
105
+                'onclick' => '  var modal = $("#'.$this->managerId.'_filters");
106 106
                 modal.modal("show");',
107 107
             ];
108 108
         }
109 109
         $buttons[] = [
110 110
             'text' => 'Добавить элемент',
111
-            'onclick' => 'inji.Ui.dataManagers.get(this).newItem("' . str_replace('\\', '\\\\', $modelName) . '",' . json_encode($formParams) . ');',
111
+            'onclick' => 'inji.Ui.dataManagers.get(this).newItem("'.str_replace('\\', '\\\\', $modelName).'",'.json_encode($formParams).');',
112 112
         ];
113 113
 
114 114
         return $buttons;
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
                     'className' => $action
139 139
                 ];
140 140
             }
141
-            $return[$key]['className'] = strpos($return[$key]['className'], '\\') === false && class_exists('Ui\DataManager\Action\\' . $return[$key]['className']) ? 'Ui\DataManager\Action\\' . $return[$key]['className'] : $return[$key]['className'];
141
+            $return[$key]['className'] = strpos($return[$key]['className'], '\\') === false && class_exists('Ui\DataManager\Action\\'.$return[$key]['className']) ? 'Ui\DataManager\Action\\'.$return[$key]['className'] : $return[$key]['className'];
142 142
             if (!class_exists($return[$key]['className']) || ($onlyGroupActions && !$return[$key]['className']::$groupAction)) {
143 143
                 unset($return[$key]);
144 144
             }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
               <?php
171 171
               foreach ($actions as $action => $actionParams) {
172 172
                   if (class_exists($actionParams['className']) && $actionParams['className']::$groupAction) {
173
-                      echo "<li><a href ='' onclick='inji.Ui.dataManagers.get(this).groupAction(\"" . str_replace('\\', '\\\\', $action) . "\");return false;'>{$actionParams['className']::$name}</a></li>";
173
+                      echo "<li><a href ='' onclick='inji.Ui.dataManagers.get(this).groupAction(\"".str_replace('\\', '\\\\', $action)."\");return false;'>{$actionParams['className']::$name}</a></li>";
174 174
                   }
175 175
               }
176 176
               ?>
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
             return [];
222 222
         }
223 223
         if (!$this->checkAccess()) {
224
-            $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"');
224
+            $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"');
225 225
             return [];
226 226
         }
227 227
         $modelName = $this->modelName;
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
             $queryParams['start'] = $this->page * $this->limit - $this->limit;
238 238
         }
239 239
         if (!empty($params['categoryPath']) && $modelName::$categoryModel) {
240
-            $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE'];
240
+            $queryParams['where'][] = ['tree_path', $params['categoryPath'].'%', 'LIKE'];
241 241
         }
242 242
         if (!empty($params['appType'])) {
243 243
             $queryParams['appType'] = $params['appType'];
@@ -296,7 +296,7 @@  discard block
 block discarded – undo
296 296
                         if (!empty($params['filters'][$col]['max'])) {
297 297
                             if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) {
298 298
 
299
-                                $date = $params['filters'][$col]['max'] . ' 23:59:59';
299
+                                $date = $params['filters'][$col]['max'].' 23:59:59';
300 300
                             } else {
301 301
                                 $date = $params['filters'][$col]['max'];
302 302
                             }
@@ -323,16 +323,16 @@  discard block
 block discarded – undo
323 323
                         }
324 324
                         switch ($params['filters'][$col]['compareType']) {
325 325
                             case 'contains':
326
-                                $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'] . '%', 'LIKE'];
326
+                                $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'].'%', 'LIKE'];
327 327
                                 break;
328 328
                             case 'equals':
329 329
                                 $queryParams['where'][] = [$col, $params['filters'][$col]['value']];
330 330
                                 break;
331 331
                             case 'starts_with':
332
-                                $queryParams['where'][] = [$col, $params['filters'][$col]['value'] . '%', 'LIKE'];
332
+                                $queryParams['where'][] = [$col, $params['filters'][$col]['value'].'%', 'LIKE'];
333 333
                                 break;
334 334
                             case 'ends_with':
335
-                                $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'], 'LIKE'];
335
+                                $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'], 'LIKE'];
336 336
                                 break;
337 337
                         }
338 338
                         break;
@@ -371,7 +371,7 @@  discard block
 block discarded – undo
371 371
                 $item = $relation['relModel']::get([[$item->index(), $item->id], [$model->index(), $model->id]]);
372 372
             }
373 373
             $row = [];
374
-            $row[] = '<input type ="checkbox" name = "pk[]" value =' . $item->pk() . '>';
374
+            $row[] = '<input type ="checkbox" name = "pk[]" value ='.$item->pk().'>';
375 375
             $row[] = $item->pk();
376 376
             foreach ($this->managerOptions['cols'] as $key => $colName) {
377 377
                 if (!empty($params['download'])) {
@@ -417,16 +417,16 @@  discard block
 block discarded – undo
417 417
                     $managerParams = ['relation' => $modelName::$cols[$colName]['relation']];
418 418
                     $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1]));
419 419
                     $count = $count ? $count : 'Нет';
420
-                    return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count}</a>";
420
+                    return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count}</a>";
421 421
                 case 'many':
422 422
                     $managerParams = ['relation' => $modelName::$cols[$colName]['relation']];
423 423
                     $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1]));
424 424
                     $count = $count ? $count : 'Нет';
425
-                    return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count}</a>";
425
+                    return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count}</a>";
426 426
                 default :
427 427
                     if ($item->{$modelName::$cols[$colName]['relation']}) {
428 428
                         if (\App::$cur->name == 'admin') {
429
-                            $href = "<a href ='/admin/" . str_replace('\\', '/view/', $relations[$modelName::$cols[$colName]['relation']]['model']) . "/" . $item->{$modelName::$cols[$colName]['relation']}->pk() . "'>";
429
+                            $href = "<a href ='/admin/".str_replace('\\', '/view/', $relations[$modelName::$cols[$colName]['relation']]['model'])."/".$item->{$modelName::$cols[$colName]['relation']}->pk()."'>";
430 430
                             if (!empty($modelName::$cols[$colName]['showCol'])) {
431 431
                                 $href .= $item->{$modelName::$cols[$colName]['relation']}->{$modelName::$cols[$colName]['showCol']};
432 432
                             } else {
@@ -456,18 +456,18 @@  discard block
 block discarded – undo
456 456
                     case 'many':
457 457
                         $managerParams = ['relation' => $modelName::$cols[$colName]['relation']];
458 458
                         $count = $item->{$modelName::$cols[$colName]['relation']}(array_merge($params, ['count' => 1]));
459
-                        return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"" . str_replace('\\', '\\\\', $modelName) . ":" . $item->pk() . "\"," . json_encode(array_merge($params, $managerParams)) . ")'>{$count} " . \Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов']) . "</a>";
459
+                        return "<a class = 'btn btn-xs btn-primary' onclick = 'inji.Ui.dataManagers.popUp(\"".str_replace('\\', '\\\\', $modelName).":".$item->pk()."\",".json_encode(array_merge($params, $managerParams)).")'>{$count} ".\Tools::getNumEnding($count, ['Элемент', 'Элемента', 'Элементов'])."</a>";
460 460
                     default:
461 461
                         return $item->$colName;
462 462
                 }
463 463
             } elseif (!empty($modelName::$cols[$colName]['type'])) {
464
-                if (\App::$cur->name == 'admin' && $originalCol == 'name' || ( $dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
464
+                if (\App::$cur->name == 'admin' && $originalCol == 'name' || ($dataManager && !empty($dataManager->managerOptions['colToView']) && $dataManager->managerOptions['colToView'] == $originalCol)) {
465 465
                     $formName = $dataManager && !empty($dataManager->managerOptions['editForm']) ? $dataManager->managerOptions['editForm'] : 'manager';
466
-                    $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem));
467
-                    return "<a href ='/admin/" . str_replace('\\', '/view/', get_class($originalItem)) . "/{$originalItem->id}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
466
+                    $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '/', get_class($originalItem));
467
+                    return "<a href ='/admin/".str_replace('\\', '/view/', get_class($originalItem))."/{$originalItem->id}?formName={$formName}&redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
468 468
                 } elseif (\App::$cur->name == 'admin' && $colName == 'name') {
469
-                    $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/' . str_replace('\\', '/', get_class($originalItem));
470
-                    return "<a href ='/admin/" . str_replace('\\', '/view/', get_class($item)) . "/{$item->id}?redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
469
+                    $redirectUrl = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/admin/'.str_replace('\\', '/', get_class($originalItem));
470
+                    return "<a href ='/admin/".str_replace('\\', '/view/', get_class($item))."/{$item->id}?redirectUrl={$redirectUrl}'>{$item->$colName}</a>";
471 471
                 } else {
472 472
                     return \Model::resloveTypeValue($item, $colName);
473 473
                 }
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
             return [];
503 503
         }
504 504
         if (!$this->checkAccess()) {
505
-            $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"');
505
+            $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"');
506 506
             return [];
507 507
         }
508 508
         if (!empty($params['limit'])) {
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
         ];
517 517
         $modelName = $this->modelName;
518 518
         if (!empty($params['categoryPath']) && $modelName::$categoryModel) {
519
-            $queryParams['where'][] = ['tree_path', $params['categoryPath'] . '%', 'LIKE'];
519
+            $queryParams['where'][] = ['tree_path', $params['categoryPath'].'%', 'LIKE'];
520 520
         }
521 521
         if (!empty($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'])) {
522 522
             foreach ($this->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'] as $colName => $colOptions) {
@@ -570,7 +570,7 @@  discard block
 block discarded – undo
570 570
                         if (!empty($params['filters'][$col]['max'])) {
571 571
                             if ($colInfo['colParams']['type'] == 'dateTime' && !strpos($params['filters'][$col]['max'], ' ')) {
572 572
 
573
-                                $date = $params['filters'][$col]['max'] . ' 23:59:59';
573
+                                $date = $params['filters'][$col]['max'].' 23:59:59';
574 574
                             } else {
575 575
                                 $date = $params['filters'][$col]['max'];
576 576
                             }
@@ -597,16 +597,16 @@  discard block
 block discarded – undo
597 597
                         }
598 598
                         switch ($params['filters'][$col]['compareType']) {
599 599
                             case 'contains':
600
-                                $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'] . '%', 'LIKE'];
600
+                                $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'].'%', 'LIKE'];
601 601
                                 break;
602 602
                             case 'equals':
603 603
                                 $queryParams['where'][] = [$col, $params['filters'][$col]['value']];
604 604
                                 break;
605 605
                             case 'starts_with':
606
-                                $queryParams['where'][] = [$col, $params['filters'][$col]['value'] . '%', 'LIKE'];
606
+                                $queryParams['where'][] = [$col, $params['filters'][$col]['value'].'%', 'LIKE'];
607 607
                                 break;
608 608
                             case 'ends_with':
609
-                                $queryParams['where'][] = [$col, '%' . $params['filters'][$col]['value'], 'LIKE'];
609
+                                $queryParams['where'][] = [$col, '%'.$params['filters'][$col]['value'], 'LIKE'];
610 610
                                 break;
611 611
                         }
612 612
                         break;
@@ -640,7 +640,7 @@  discard block
 block discarded – undo
640 640
             $tableCols[] = !empty($colOptions['label']) ? $colOptions['label'] : $colName;
641 641
         }
642 642
         $tableCols[] = '';
643
-        $this->table->class .=' datamanagertable';
643
+        $this->table->class .= ' datamanagertable';
644 644
         $this->table->setCols($tableCols);
645 645
     }
646 646
 
@@ -663,12 +663,12 @@  discard block
 block discarded – undo
663 663
             return false;
664 664
         }
665 665
         if (!$this->checkAccess()) {
666
-            $this->drawError('you not have access to "' . $this->modelName . '" manager with name: "' . $this->managerName . '"');
666
+            $this->drawError('you not have access to "'.$this->modelName.'" manager with name: "'.$this->managerName.'"');
667 667
             return [];
668 668
         }
669 669
         $tree = new Tree();
670 670
         $tree->ul($this->managerOptions['categorys']['model'], 0, function($category) {
671
-            $path = $category->tree_path . ($category->pk() ? $category->pk() . "/" : '');
671
+            $path = $category->tree_path.($category->pk() ? $category->pk()."/" : '');
672 672
             $cleanClassName = str_replace('\\', '\\\\', get_class($category));
673 673
             return "<a href='#' onclick='inji.Ui.dataManagers.get(this).switchCategory(this);return false;' data-index='{$category->index()}' data-path ='{$path}' data-id='{$category->pk()}'> {$category->name}</a> 
674 674
                 
Please login to merge, or discard this patch.
system/modules/Ecommerce/appControllers/CartController.php 2 patches
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -270,10 +270,11 @@
 block discarded – undo
270 270
         $item->sales ++;
271 271
         $item->save();
272 272
 
273
-        if (empty($_GET['count']))
274
-            $count = 1;
275
-        else
276
-            $count = (float) $_GET['count'];
273
+        if (empty($_GET['count'])) {
274
+                    $count = 1;
275
+        } else {
276
+                    $count = (float) $_GET['count'];
277
+        }
277 278
 
278 279
         $cart = $this->ecommerce->getCurCart();
279 280
 
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
                         $warecount = $cartitem->price->offer->warehouseCount($cart->id);
63 63
                         if ($cartitem->count > $warecount) {
64 64
                             $error = true;
65
-                            Msg::add('Вы заказали <b>' . $cartitem->item->name . '</b> больше чем есть на складе. на складе: <b>' . $warecount . '</b>', 'danger');
65
+                            Msg::add('Вы заказали <b>'.$cartitem->item->name.'</b> больше чем есть на складе. на складе: <b>'.$warecount.'</b>', 'danger');
66 66
                         }
67 67
                     }
68 68
                 }
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
                     foreach ($deliverys[$cart->delivery_id]->fields as $field) {
75 75
                         if (empty($_POST['deliveryFields'][$field->id]) && $field->required) {
76 76
                             $error = 1;
77
-                            Msg::add('Вы не указали: ' . $field->name);
77
+                            Msg::add('Вы не указали: '.$field->name);
78 78
                         }
79 79
                     }
80 80
                 }
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
                 foreach (\Ecommerce\UserAdds\Field::getList() as $field) {
91 91
                     if (empty($_POST['userAdds']['fields'][$field->id]) && $field->required) {
92 92
                         $error = 1;
93
-                        Msg::add('Вы не указали: ' . $field->name);
93
+                        Msg::add('Вы не указали: '.$field->name);
94 94
                     }
95 95
                 }
96 96
                 if (!empty($_POST['discounts']['card_item_id'])) {
@@ -127,13 +127,13 @@  discard block
 block discarded – undo
127 127
                     }
128 128
                     $cart = \Ecommerce\Cart::get($cart->id);
129 129
                     if (!empty(\App::$cur->ecommerce->config['notify_mail'])) {
130
-                        $text = 'Перейдите в админ панель чтобы просмотреть новый заказ <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/admin/ecommerce/Cart">Админ панель</a>';
131
-                        $title = 'Новый заказ в интернет магазине на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
132
-                        \Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, \App::$cur->ecommerce->config['notify_mail'], $title, $text);
130
+                        $text = 'Перейдите в админ панель чтобы просмотреть новый заказ <a href = "http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/admin/ecommerce/Cart">Админ панель</a>';
131
+                        $title = 'Новый заказ в интернет магазине на сайте '.idn_to_utf8(INJI_DOMAIN_NAME);
132
+                        \Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, \App::$cur->ecommerce->config['notify_mail'], $title, $text);
133 133
                     }
134 134
                     if ($this->notifications) {
135 135
                         $notification = new Notifications\Notification();
136
-                        $notification->name = 'Новый заказ в интернет магазине на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
136
+                        $notification->name = 'Новый заказ в интернет магазине на сайте '.idn_to_utf8(INJI_DOMAIN_NAME);
137 137
                         $notification->text = 'Перейдите в админ панель чтобы просмотреть новый заказ';
138 138
                         $notification->chanel_id = $this->notifications->getChanel('Ecommerce-orders')->id;
139 139
                         $notification->save();
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
             'href' => '/ecommerce/cart'
180 180
         ];
181 181
         $bread[] = [
182
-            'text' => 'Заказ: №' . $cart->id,
183
-            'href' => '/ecommerce/cart/orderDetail/' . $cart->id
182
+            'text' => 'Заказ: №'.$cart->id,
183
+            'href' => '/ecommerce/cart/orderDetail/'.$cart->id
184 184
         ];
185
-        $this->view->setTitle('Заказ №' . $cart->id);
185
+        $this->view->setTitle('Заказ №'.$cart->id);
186 186
         $this->view->page(['data' => compact('cart', 'bread')]);
187 187
     }
188 188
 
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
             $result->send();
276 276
         }
277 277
 
278
-        $item->sales ++;
278
+        $item->sales++;
279 279
         $item->save();
280 280
 
281 281
         if (empty($_GET['count']))
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
         if (empty($this->module->config['sell_over_warehouse']) && $price->offer->warehouseCount() < $count) {
290 290
             $result->success = false;
291
-            $result->content = 'На складе недостаточно товара! Доступно: ' . $price->offer->warehouseCount();
291
+            $result->content = 'На складе недостаточно товара! Доступно: '.$price->offer->warehouseCount();
292 292
             $result->send();
293 293
         }
294 294
 
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
             $cart->addItem($price->id, $count);
306 306
         }
307 307
         $cart->calc();
308
-        $result->successMsg = '<a href="/ecommerce/view/' . $item->id . '">' . $item->name() . ($price->offer->name() ? ' (' . $price->offer->name() . ')' : '') . '</a> добавлен <a href="/ecommerce/cart">в корзину покупок</a>!';
308
+        $result->successMsg = '<a href="/ecommerce/view/'.$item->id.'">'.$item->name().($price->offer->name() ? ' ('.$price->offer->name().')' : '').'</a> добавлен <a href="/ecommerce/cart">в корзину покупок</a>!';
309 309
         $result->send();
310 310
     }
311 311
 
Please login to merge, or discard this patch.
system/modules/Ui/appAdminControllers/content/dataManager/view.php 2 patches
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -58,11 +58,11 @@  discard block
 block discarded – undo
58 58
     ]]);
59 59
     ?>)</h3>
60 60
   <?php
61
-  foreach (\Dashboard\Comment::getList([ 'where' => [
62
-          ['item_id', $item->id],
63
-          ['model', $modelName],
64
-      ], 'order' => ['date_create', 'desc']]) as $comment) {
65
-      ?>
61
+    foreach (\Dashboard\Comment::getList([ 'where' => [
62
+            ['item_id', $item->id],
63
+            ['model', $modelName],
64
+        ], 'order' => ['date_create', 'desc']]) as $comment) {
65
+        ?>
66 66
       <div class="row">
67 67
         <div class="col-sm-3" style="max-width: 300px;">
68 68
           <a href='/admin/Users/view/User/<?= $comment->user->pk(); ?>'><?= $comment->user->name(); ?></a><br />
@@ -73,14 +73,14 @@  discard block
 block discarded – undo
73 73
         </div>
74 74
       </div>
75 75
       <?php
76
-  }
77
-  ?>
76
+    }
77
+    ?>
78 78
 </div>
79 79
 <div>
80 80
   <?php
81
-  $form = new \Ui\Form();
82
-  $form->begin();
83
-  $form->input('textarea', 'comment', 'Комментарий');
84
-  $form->end();
85
-  ?>
81
+    $form = new \Ui\Form();
82
+    $form->begin();
83
+    $form->input('textarea', 'comment', 'Комментарий');
84
+    $form->end();
85
+    ?>
86 86
 </div>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -24,14 +24,14 @@  discard block
 block discarded – undo
24 24
                 case 'relation':
25 25
                     $relations = $colInfo['modelName']::relations();
26 26
                     $relValue = $relations[$colInfo['colParams']['relation']]['model']::get($item->$colName);
27
-                    $value = $relValue ? "<a href='/admin/" . str_replace('\\', '/view/', $relations[$colInfo['colParams']['relation']]['model']) . "/" . $relValue->pk() . "'>" . $relValue->name() . "</a>" : 'Не задано';
27
+                    $value = $relValue ? "<a href='/admin/".str_replace('\\', '/view/', $relations[$colInfo['colParams']['relation']]['model'])."/".$relValue->pk()."'>".$relValue->name()."</a>" : 'Не задано';
28 28
                     break;
29 29
             }
30 30
             break;
31 31
         case 'image':
32 32
             $file = Files\File::get($item->$colName);
33 33
             if ($file) {
34
-                $value = '<img src="' . $file->path . '?resize=60x120" />';
34
+                $value = '<img src="'.$file->path.'?resize=60x120" />';
35 35
             } else {
36 36
                 $value = '<img src="/static/system/images/no-image.png?resize=60x120" />';
37 37
             }
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
     ]]);
59 59
     ?>)</h3>
60 60
   <?php
61
-  foreach (\Dashboard\Comment::getList([ 'where' => [
61
+  foreach (\Dashboard\Comment::getList(['where' => [
62 62
           ['item_id', $item->id],
63 63
           ['model', $modelName],
64 64
       ], 'order' => ['date_create', 'desc']]) as $comment) {
Please login to merge, or discard this patch.
system/modules/Ui/widgets/DataManager/rowButtons.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,7 +11,7 @@
 block discarded – undo
11 11
 $buttons = [];
12 12
 foreach ($actions as $action => $actionParams) {
13 13
     if (class_exists($actionParams['className']) && $actionParams['className']::$rowAction) {
14
-        $buttons[]= $actionParams['className']::rowButton($dataManager, $item, $params, $actionParams);
14
+        $buttons[] = $actionParams['className']::rowButton($dataManager, $item, $params, $actionParams);
15 15
     }
16 16
 }
17 17
 echo implode('&nbsp;', $buttons);
Please login to merge, or discard this patch.
system/modules/Users/Users.php 3 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -92,6 +92,9 @@  discard block
 block discarded – undo
92 92
         }
93 93
     }
94 94
 
95
+    /**
96
+     * @param string $user_mail
97
+     */
95 98
     public function passre($user_mail)
96 99
     {
97 100
         $user = $this->get($user_mail, 'mail');
@@ -322,6 +325,9 @@  discard block
 block discarded – undo
322 325
         return $user->id;
323 326
     }
324 327
 
328
+    /**
329
+     * @param string $pass
330
+     */
325 331
     public function hashpass($pass)
326 332
     {
327 333
         return password_hash($pass, PASSWORD_DEFAULT);
@@ -359,6 +365,9 @@  discard block
 block discarded – undo
359 365
         return $return;
360 366
     }
361 367
 
368
+    /**
369
+     * @param integer $cat_id
370
+     */
362 371
     public function addUserActivity($user_id, $cat_id , $text = '')
363 372
     {
364 373
         $ua = new Users\Activity([
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -196,17 +196,20 @@
 block discarded – undo
196 196
      */
197 197
     public function get($idn, $ltype = 'id')
198 198
     {
199
-        if (!$idn)
200
-            return false;
199
+        if (!$idn) {
200
+                    return false;
201
+        }
201 202
 
202
-        if (is_numeric($idn) && $ltype != 'login')
203
-            $user = Users\User::get($idn, 'id');
204
-        elseif ($ltype == 'login')
205
-            $user = Users\User::get($idn, 'login');
206
-        else
207
-            $user = Users\User::get($idn, 'mail');
208
-        if (!$user)
209
-            return [];
203
+        if (is_numeric($idn) && $ltype != 'login') {
204
+                    $user = Users\User::get($idn, 'id');
205
+        } elseif ($ltype == 'login') {
206
+                    $user = Users\User::get($idn, 'login');
207
+        } else {
208
+                    $user = Users\User::get($idn, 'mail');
209
+        }
210
+        if (!$user) {
211
+                    return [];
212
+        }
210 213
 
211 214
         return $user;
212 215
     }
Please login to merge, or discard this patch.
Spacing   +34 added lines, -34 removed lines patch added patch discarded remove patch
@@ -24,8 +24,8 @@  discard block
 block discarded – undo
24 24
         if (isset($_GET['logout'])) {
25 25
             return $this->logOut();
26 26
         }
27
-        if (filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_session_hash') && filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_id')) {
28
-            return $this->cuntinueSession(filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_session_hash'), filter_input(INPUT_COOKIE, $this->cookiePrefix . '_user_id'));
27
+        if (filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_session_hash') && filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_id')) {
28
+            return $this->cuntinueSession(filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_session_hash'), filter_input(INPUT_COOKIE, $this->cookiePrefix.'_user_id'));
29 29
         }
30 30
         if (isset($_POST['autorization']) && trim(filter_input(INPUT_POST, 'user_login')) && trim(filter_input(INPUT_POST, 'user_pass'))) {
31 31
             unset($_POST['autorization']);
@@ -41,18 +41,18 @@  discard block
 block discarded – undo
41 41
 
42 42
     public function logOut($redirect = true)
43 43
     {
44
-        if (!empty($_COOKIE[$this->cookiePrefix . "_user_session_hash"]) && !empty($_COOKIE[$this->cookiePrefix . "_user_id"])) {
44
+        if (!empty($_COOKIE[$this->cookiePrefix."_user_session_hash"]) && !empty($_COOKIE[$this->cookiePrefix."_user_id"])) {
45 45
             $session = Users\Session::get([
46
-                        ['user_id', $_COOKIE[$this->cookiePrefix . "_user_id"]],
47
-                        ['hash', $_COOKIE[$this->cookiePrefix . "_user_session_hash"]]
46
+                        ['user_id', $_COOKIE[$this->cookiePrefix."_user_id"]],
47
+                        ['hash', $_COOKIE[$this->cookiePrefix."_user_session_hash"]]
48 48
             ]);
49 49
             if ($session) {
50 50
                 $session->delete();
51 51
             }
52 52
         }
53 53
         if (!headers_sent()) {
54
-            setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/");
55
-            setcookie($this->cookiePrefix . "_user_id", '', 0, "/");
54
+            setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/");
55
+            setcookie($this->cookiePrefix."_user_id", '', 0, "/");
56 56
         }
57 57
         if ($redirect) {
58 58
             if (!empty($this->config['logoutUrl'][$this->app->type])) {
@@ -70,25 +70,25 @@  discard block
 block discarded – undo
70 70
         ]);
71 71
         if ($session && $session->user && $session->user->blocked) {
72 72
             if (!headers_sent()) {
73
-                setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/");
74
-                setcookie($this->cookiePrefix . "_user_id", '', 0, "/");
73
+                setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/");
74
+                setcookie($this->cookiePrefix."_user_id", '', 0, "/");
75 75
             }
76 76
             Msg::add('Ваш аккаунт заблокирован', 'info');
77 77
             return;
78 78
         }
79 79
         if ($session && $session->user && !$session->user->blocked) {
80 80
             if (!headers_sent()) {
81
-                setcookie($this->cookiePrefix . "_user_session_hash", $session->hash, time() + 360000, "/");
82
-                setcookie($this->cookiePrefix . "_user_id", $session->user_id, time() + 360000, "/");
81
+                setcookie($this->cookiePrefix."_user_session_hash", $session->hash, time() + 360000, "/");
82
+                setcookie($this->cookiePrefix."_user_id", $session->user_id, time() + 360000, "/");
83 83
             }
84 84
             if (!empty($this->config['needActivation']) && $session->user->activation) {
85 85
                 if (!headers_sent()) {
86
-                    setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/");
87
-                    setcookie($this->cookiePrefix . "_user_id", '', 0, "/");
86
+                    setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/");
87
+                    setcookie($this->cookiePrefix."_user_id", '', 0, "/");
88 88
                 }
89
-                Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $session->user->id . '"><b>повторно выслать ссылку активации</b></a>');
89
+                Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$session->user->id.'"><b>повторно выслать ссылку активации</b></a>');
90 90
             } elseif ($session->user->activation) {
91
-                Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $session->user->id . '"><b>повторно выслать ссылку активации</b></a>');
91
+                Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$session->user->id.'"><b>повторно выслать ссылку активации</b></a>');
92 92
             }
93 93
             if (!$session->user->mail && !empty($this->config['noMailNotify'])) {
94 94
                 Msg::add($this->config['noMailNotify']);
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
             Users\User::$cur->save();
99 99
         } else {
100 100
             if (!headers_sent()) {
101
-                setcookie($this->cookiePrefix . "_user_session_hash", '', 0, "/");
102
-                setcookie($this->cookiePrefix . "_user_id", '', 0, "/");
101
+                setcookie($this->cookiePrefix."_user_session_hash", '', 0, "/");
102
+                setcookie($this->cookiePrefix."_user_id", '', 0, "/");
103 103
             }
104 104
             Msg::add('Ваша сессия устарела или более недействительна, вам необходимо пройти <a href = "/users/login">авторизацию</a> заново', 'info');
105 105
         }
@@ -109,7 +109,7 @@  discard block
 block discarded – undo
109 109
     {
110 110
         $user = $this->get($user_mail, 'mail');
111 111
         if (!$user) {
112
-            Msg::add('Пользователь ' . $user_mail . ' не найден, проверьте првильность ввода e-mail или зарегистрируйтесь', 'danger');
112
+            Msg::add('Пользователь '.$user_mail.' не найден, проверьте првильность ввода e-mail или зарегистрируйтесь', 'danger');
113 113
             return false;
114 114
         }
115 115
         $passre = Users\Passre::get([['user_id', $user->id], ['status', 1]]);
@@ -117,10 +117,10 @@  discard block
 block discarded – undo
117 117
             $passre->status = 2;
118 118
             $passre->save();
119 119
         }
120
-        $hash = $user->id . '_' . Tools::randomString(50);
120
+        $hash = $user->id.'_'.Tools::randomString(50);
121 121
         $passre = new Users\Passre(['user_id' => $user->id, 'status' => 1, 'hash' => $hash]);
122 122
         $passre->save();
123
-        Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, $user_mail, 'Восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для продолжения восстановления пароля перейдите по ссылке: <a href = "http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/?passrecont=1&hash=' . $hash . '">' . idn_to_utf8(INJI_DOMAIN_NAME) . '/?passrecont=1&hash=' . $hash . '</a>');
123
+        Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, $user_mail, 'Восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для продолжения восстановления пароля перейдите по ссылке: <a href = "http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/?passrecont=1&hash='.$hash.'">'.idn_to_utf8(INJI_DOMAIN_NAME).'/?passrecont=1&hash='.$hash.'</a>');
124 124
         Tools::redirect('/', 'На указанный почтовый ящик была выслана инструкция по восстановлению пароля', 'success');
125 125
     }
126 126
 
@@ -138,7 +138,7 @@  discard block
 block discarded – undo
138 138
             $user->pass = $this->hashpass($pass);
139 139
             $user->save();
140 140
             $this->autorization($user->mail, $user->pass, 'mail');
141
-            Tools::sendMail('noreply@' . INJI_DOMAIN_NAME, $user->mail, 'Новый пароль на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />Ваш новый пароль: ' . $pass);
141
+            Tools::sendMail('noreply@'.INJI_DOMAIN_NAME, $user->mail, 'Новый пароль на сайте '.idn_to_utf8(INJI_DOMAIN_NAME), 'Было запрошено восстановление пароля на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />Ваш новый пароль: '.$pass);
142 142
             Tools::redirect('/', 'На указанный почтовый ящик был выслан новый пароль', 'success');
143 143
         }
144 144
     }
@@ -151,9 +151,9 @@  discard block
 block discarded – undo
151 151
         $user = $this->get($login, $ltype);
152 152
         if ($user && $this->verifypass($pass, $user->pass) && !$user->blocked) {
153 153
             if (!empty($this->config['needActivation']) && $user->activation) {
154
-                Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $user->id . '"><b>повторно выслать ссылку активации</b></a>');
154
+                Tools::redirect('/', 'Этот аккаунт ещё не активирован. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$user->id.'"><b>повторно выслать ссылку активации</b></a>');
155 155
             } elseif ($user->activation) {
156
-                Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/' . $user->id . '"><b>повторно выслать ссылку активации</b></a>');
156
+                Msg::add('Этот аккаунт ещё не активирован, не все функции могут быть доступны. <br />Если вы не получали письмо с ссылкой для активации, нажмите на - <a href = "/users/resendActivation/'.$user->id.'"><b>повторно выслать ссылку активации</b></a>');
157 157
             }
158 158
             if (!$user->mail && !empty($this->config['noMailNotify'])) {
159 159
                 Msg::add($this->config['noMailNotify']);
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             if ($user && $user->blocked) {
173 173
                 Msg::add('Вы заблокированы', 'danger');
174 174
             } elseif ($user) {
175
-                Msg::add('Вы ошиблись при наборе пароля или логина, попробуйте ещё раз или воспользуйтесь <a href = "?passre=1&user_mail=' . $user->mail . '">Восстановлением пароля</a>', 'danger');
175
+                Msg::add('Вы ошиблись при наборе пароля или логина, попробуйте ещё раз или воспользуйтесь <a href = "?passre=1&user_mail='.$user->mail.'">Восстановлением пароля</a>', 'danger');
176 176
             } else {
177 177
                 Msg::add('Данный почтовый ящик не зарегистрирован в системе', 'danger');
178 178
             }
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
         $session->save();
196 196
 
197 197
         if (!headers_sent()) {
198
-            setcookie($this->cookiePrefix . "_user_session_hash", $session->hash, time() + 360000, "/");
199
-            setcookie($this->cookiePrefix . "_user_id", $session->user_id, time() + 360000, "/");
198
+            setcookie($this->cookiePrefix."_user_session_hash", $session->hash, time() + 360000, "/");
199
+            setcookie($this->cookiePrefix."_user_id", $session->user_id, time() + 360000, "/");
200 200
         } else {
201 201
             Msg::add('Не удалось провести авторизацию. Попробуйте позже', 'info');
202 202
         }
@@ -318,20 +318,20 @@  discard block
 block discarded – undo
318 318
             $this->autorization($user_mail, $pass, 'mail');
319 319
         }
320 320
         if (!empty($this->config['needActivation'])) {
321
-            $from = 'noreply@' . INJI_DOMAIN_NAME;
321
+            $from = 'noreply@'.INJI_DOMAIN_NAME;
322 322
             $to = $user_mail;
323
-            $subject = 'Регистрация на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
324
-            $text = 'Вы были зарегистрированы на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: ' . $pass;
325
-            $text .='<br />';
323
+            $subject = 'Регистрация на сайте '.idn_to_utf8(INJI_DOMAIN_NAME);
324
+            $text = 'Вы были зарегистрированы на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: '.$pass;
326 325
             $text .= '<br />';
327
-            $text .= 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://' . INJI_DOMAIN_NAME . '/users/activation/' . $user->id . '/' . $user->activation . '">http://' . idn_to_utf8(INJI_DOMAIN_NAME) . '/users/activation/' . $user->id . '/' . $user->activation . '</a>';
326
+            $text .= '<br />';
327
+            $text .= 'Для активации вашего аккаунта перейдите по ссылке <a href = "http://'.INJI_DOMAIN_NAME.'/users/activation/'.$user->id.'/'.$user->activation.'">http://'.idn_to_utf8(INJI_DOMAIN_NAME).'/users/activation/'.$user->id.'/'.$user->activation.'</a>';
328 328
             Tools::sendMail($from, $to, $subject, $text);
329 329
             Msg::add('Вы были зарегистрированы. На указанный почтовый ящик был выслан ваш пароль и ссылка для активации', 'success');
330 330
         } else {
331
-            $from = 'noreply@' . INJI_DOMAIN_NAME;
331
+            $from = 'noreply@'.INJI_DOMAIN_NAME;
332 332
             $to = $user_mail;
333
-            $subject = 'Регистрация на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME);
334
-            $text = 'Вы были зарегистрированы на сайте ' . idn_to_utf8(INJI_DOMAIN_NAME) . '<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: ' . $pass;
333
+            $subject = 'Регистрация на сайте '.idn_to_utf8(INJI_DOMAIN_NAME);
334
+            $text = 'Вы были зарегистрированы на сайте '.idn_to_utf8(INJI_DOMAIN_NAME).'<br />для входа используйте ваш почтовый ящик в качестве логина и пароль: '.$pass;
335 335
             Tools::sendMail($from, $to, $subject, $text);
336 336
             Msg::add('Вы были зарегистрированы. На указанный почтовый ящик был выслан ваш пароль', 'success');
337 337
         }
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/UserAdds/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             'map' => [
45 45
                 ['name', 'type'],
46 46
                 ['required', 'save'],
47
-                [ 'userfield']
47
+                ['userfield']
48 48
             ]
49 49
         ]
50 50
     ];
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Delivery/Field.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             'map' => [
45 45
                 ['name', 'type'],
46 46
                 ['required', 'save'],
47
-                [ 'userfield']
47
+                ['userfield']
48 48
             ]
49 49
         ]
50 50
     ];
Please login to merge, or discard this patch.
system/modules/Ecommerce/widgets/cart/fields.php 1 patch
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  discard block
 block discarded – undo
1 1
 <fieldset>
2 2
   <?php
3
-  if (\Users\User::$cur->id) {
4
-      $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]);
5
-      $values = [];
6
-      foreach ($userAdds as $userAdd) {
7
-          $values[$userAdd->id] = $userAdd->values(['array' => true]);
8
-      }
9
-      if ($userAdds) {
10
-          $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]);
11
-          echo '<hr />';
12
-      }
13
-      ?>
3
+    if (\Users\User::$cur->id) {
4
+        $userAdds = Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id]]);
5
+        $values = [];
6
+        foreach ($userAdds as $userAdd) {
7
+            $values[$userAdd->id] = $userAdd->values(['array' => true]);
8
+        }
9
+        if ($userAdds) {
10
+            $form->input('select', 'userAddsId', 'Ваши контакты', ['values' => ['' => 'Выберите'] + Ecommerce\UserAdds::getList(['where' => ['user_id', \Users\User::$cur->id], 'forSelect' => true])]);
11
+            echo '<hr />';
12
+        }
13
+        ?>
14 14
       <script>
15 15
           var userAddsValues = <?= json_encode($values); ?>;
16 16
           inji.onLoad(function () {
@@ -24,9 +24,9 @@  discard block
 block discarded – undo
24 24
           })
25 25
       </script>
26 26
       <?php
27
-  }
28
-  foreach (Ecommerce\UserAdds\Field::getList(['order' => ['weight', 'asc']]) as $field) {
29
-      $form->input($field->type, "userAdds[fields][{$field->id}]", $field->name, ['required' => $field->required]);
30
-  }
31
-  ?>
27
+    }
28
+    foreach (Ecommerce\UserAdds\Field::getList(['order' => ['weight', 'asc']]) as $field) {
29
+        $form->input($field->type, "userAdds[fields][{$field->id}]", $field->name, ['required' => $field->required]);
30
+    }
31
+    ?>
32 32
 </fieldset>
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
system/modules/YandexExport/appControllers/YandexExportController.php 2 patches
Doc Comments   +5 added lines patch added patch discarded remove patch
@@ -11,6 +11,11 @@
 block discarded – undo
11 11
 {
12 12
     function indexAction()
13 13
     {
14
+
15
+        /**
16
+         * @param DOMDocument $xml
17
+         * @param string $nodeName
18
+         */
14 19
         function addToXml($xml, $parent, $nodeName, $text)
15 20
         {
16 21
             $node = $parent->appendChild($xml->createElement($nodeName));
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 
37 37
         addToXml($xml, $shop, 'name', \App::$cur->config['site']['name']);
38 38
         addToXml($xml, $shop, 'company', \App::$cur->config['site']['company_name']);
39
-        addToXml($xml, $shop, 'url', 'http://' . INJI_DOMAIN_NAME);
39
+        addToXml($xml, $shop, 'url', 'http://'.INJI_DOMAIN_NAME);
40 40
 
41 41
         $currencies = $xml->createElement('currencies');
42 42
         $currency = $currencies->appendChild($xml->createElement('currency'));
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $offers = $xml->createElement('offers');
61 61
         foreach (App::$cur->ecommerce->getItems() as $item) {
62 62
             $offer = $offers->appendChild($xml->createElement('offer'));
63
-            addToXml($xml, $offer, 'url', 'http://' . INJI_DOMAIN_NAME . '/ecommerce/view/' . $item->id);
63
+            addToXml($xml, $offer, 'url', 'http://'.INJI_DOMAIN_NAME.'/ecommerce/view/'.$item->id);
64 64
             addToXml($xml, $offer, 'price', $item->getPrice()->price);
65 65
             addToXml($xml, $offer, 'currencyId', 'RUR');
66 66
             addToXml($xml, $offer, 'categoryId', $item->category_id);
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
 
87 87
         header("Content-Type: text/xml");
88 88
         header("Expires: Thu, 19 Feb 1998 13:24:18 GMT");
89
-        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
89
+        header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
90 90
         header("Cache-Control: no-cache, must-revalidate");
91 91
         header("Cache-Control: post-check=0,pre-check=0");
92 92
         header("Cache-Control: max-age=0");
Please login to merge, or discard this patch.