Completed
Push — master ( 604db9...9db94b )
by Alexey
07:34
created
system/modules/Ecommerce/models/Item/Offer.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -72,12 +72,12 @@
 block discarded – undo
72 72
     {
73 73
         $warehouse = Offer\Warehouse::get([['count', '0', '>'], ['item_offer_id', $this->id]]);
74 74
         if ($warehouse) {
75
-            $warehouse->count +=(float) $count;
75
+            $warehouse->count += (float) $count;
76 76
             $warehouse->save();
77 77
         } else {
78 78
             $warehouse = Offer\Warehouse::get([['item_offer_id', $this->id]]);
79 79
             if ($warehouse) {
80
-                $warehouse->count +=(float) $count;
80
+                $warehouse->count += (float) $count;
81 81
                 $warehouse->save();
82 82
             }
83 83
         }
Please login to merge, or discard this patch.
system/modules/Ecommerce/models/Item/Offer/Price.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@
 block discarded – undo
39 39
     static $forms = [
40 40
         'manager' => [
41 41
             'map' => [
42
-                ['price', 'currency_id',],
42
+                ['price', 'currency_id', ],
43 43
                 ['item_offer_price_type_id', 'item_offer_id']
44 44
             ]
45 45
     ]];
Please login to merge, or discard this patch.
system/modules/Ecommerce/objects/Florange.php 1 patch
Braces   +12 added lines, -10 removed lines patch added patch discarded remove patch
@@ -40,8 +40,9 @@  discard block
 block discarded – undo
40 40
         $i = 0;
41 41
         foreach ($html->find('ul li ul li ul li a') as $element) {
42 42
             $item = Item::get(['ci_imported', 'http://florange.ru' . $element->href]);
43
-            if ($item)
44
-                continue;
43
+            if ($item) {
44
+                            continue;
45
+            }
45 46
 
46 47
             $elem = file_get_html('http://florange.ru' . $element->href);
47 48
 
@@ -57,10 +58,11 @@  discard block
 block discarded – undo
57 58
             foreach ($elem->find('.description p') as $p) {
58 59
                 if ($p->find('strong') && $p->find('strong', 0)->innertext != 'Выберите стиль:') {
59 60
                     //$item['head'][] = $p->find('strong', 0)->innertext;
60
-                } elseif ($p->find('strong') && $p->find('strong', 0)->innertext == 'Выберите стиль:')
61
-                    break;
62
-                else
63
-                    $prices[$i++]['ciprice_about'] = $p->innertext;
61
+                } elseif ($p->find('strong') && $p->find('strong', 0)->innertext == 'Выберите стиль:') {
62
+                                    break;
63
+                } else {
64
+                                    $prices[$i++]['ciprice_about'] = $p->innertext;
65
+                }
64 66
             }
65 67
             $i = 0;
66 68
             foreach ($elem->find('.description .tabcontent') as $t) {
@@ -101,12 +103,12 @@  discard block
 block discarded – undo
101 103
             $html = file_get_html('http://florange.ru/production/style/pushup/');
102 104
 
103 105
             foreach ($html->find('.leftside .nav>li>a') as $element) {
104
-                if (strpos($element->href, '/style/'))
105
-                    continue;
106
+                if (strpos($element->href, '/style/')) {
107
+                                    continue;
108
+                }
106 109
                 $catalogs[] = ['name' => $element->innertext, 'href' => 'http://florange.ru' . $element->href];
107 110
             }
108
-        }
109
-        else {
111
+        } else {
110 112
             $html = file_get_html('http://florange.ru/production/style/pushup/');
111 113
             $element = $html->find('.leftside .nav>li>a', $parent);
112 114
             $html = file_get_html('http://florange.ru' . $element->href);
Please login to merge, or discard this patch.
system/modules/Ecommerce/widgets/cart/history.php 1 patch
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -19,87 +19,87 @@  discard block
 block discarded – undo
19 19
     </thead>
20 20
     <tbody>
21 21
       <?php
22
-      foreach ($carts as $cart) {
23
-          $sums = [];
24
-          foreach ($cart->cartItems as $cartItem) {
25
-              $currency_id = $cartItem->price && $cartItem->price->currency ? $cartItem->price->currency->id : (!empty(\App::$cur->ecommerce->config['defaultCurrency']) ? \App::$cur->ecommerce->config['defaultCurrency'] : 0);
26
-              if (empty($sums[$currency_id])) {
27
-                  $sums[$currency_id] = $cartItem->final_price * $cartItem->count;
28
-              } else {
29
-                  $sums[$currency_id] += $cartItem->final_price * $cartItem->count;
30
-              }
31
-          }
32
-          if ($cart->delivery && $cart->delivery->price) {
33
-              $currency_id = $cart->delivery->currency_id;
34
-              if (empty($sums[$currency_id])) {
35
-                  $sums[$currency_id] = $cart->delivery->price;
36
-              } else {
37
-                  $sums[$currency_id] += $cart->delivery->price;
38
-              }
39
-          }
40
-          foreach ($cart->extras as $extra) {
41
-              $currency_id = $extra->currency ? $extra->currency->id : \App::$cur->ecommerce->config['defaultCurrency'];
42
-              if (empty($sums[$currency_id])) {
43
-                  $sums[$currency_id] = $extra->price * $extra->count;
44
-              } else {
45
-                  $sums[$currency_id] += $extra->price * $extra->count;
46
-              }
47
-          }
48
-          ?>
22
+        foreach ($carts as $cart) {
23
+            $sums = [];
24
+            foreach ($cart->cartItems as $cartItem) {
25
+                $currency_id = $cartItem->price && $cartItem->price->currency ? $cartItem->price->currency->id : (!empty(\App::$cur->ecommerce->config['defaultCurrency']) ? \App::$cur->ecommerce->config['defaultCurrency'] : 0);
26
+                if (empty($sums[$currency_id])) {
27
+                    $sums[$currency_id] = $cartItem->final_price * $cartItem->count;
28
+                } else {
29
+                    $sums[$currency_id] += $cartItem->final_price * $cartItem->count;
30
+                }
31
+            }
32
+            if ($cart->delivery && $cart->delivery->price) {
33
+                $currency_id = $cart->delivery->currency_id;
34
+                if (empty($sums[$currency_id])) {
35
+                    $sums[$currency_id] = $cart->delivery->price;
36
+                } else {
37
+                    $sums[$currency_id] += $cart->delivery->price;
38
+                }
39
+            }
40
+            foreach ($cart->extras as $extra) {
41
+                $currency_id = $extra->currency ? $extra->currency->id : \App::$cur->ecommerce->config['defaultCurrency'];
42
+                if (empty($sums[$currency_id])) {
43
+                    $sums[$currency_id] = $extra->price * $extra->count;
44
+                } else {
45
+                    $sums[$currency_id] += $extra->price * $extra->count;
46
+                }
47
+            }
48
+            ?>
49 49
           <tr>
50 50
             <td class="text-right">#<?= $cart->id; ?></td>
51 51
             <td class="text-left"><?= $cart->status ? $cart->status->name : 'Наполняется'; ?></td>
52 52
             <td class="text-right"><?= count($cart->cartItems); ?></td>
53 53
             <td class="text-right"><?php
54
-              if ($sums) {
55
-                  foreach ($sums as $currency_id => $sum) {
56
-                      if (!$sum) {
57
-                          continue;
58
-                      }
59
-                      echo number_format($sum, 2, '.', ' ');
60
-                      if (App::$cur->money) {
61
-                          $currency = Money\Currency::get($currency_id);
62
-                          if ($currency) {
63
-                              echo '&nbsp;' . $currency->acronym();
64
-                          } else {
65
-                              echo '&nbsp;р.';
66
-                          }
67
-                      } else {
68
-                          echo '&nbsp;р.';
69
-                      }
70
-                      echo '<br />';
71
-                  }
72
-              }
73
-              ?></td>
54
+                if ($sums) {
55
+                    foreach ($sums as $currency_id => $sum) {
56
+                        if (!$sum) {
57
+                            continue;
58
+                        }
59
+                        echo number_format($sum, 2, '.', ' ');
60
+                        if (App::$cur->money) {
61
+                            $currency = Money\Currency::get($currency_id);
62
+                            if ($currency) {
63
+                                echo '&nbsp;' . $currency->acronym();
64
+                            } else {
65
+                                echo '&nbsp;р.';
66
+                            }
67
+                        } else {
68
+                            echo '&nbsp;р.';
69
+                        }
70
+                        echo '<br />';
71
+                    }
72
+                }
73
+                ?></td>
74 74
             <td class="text-left"><?= $cart->complete_data; ?></td>
75 75
             <td><?php
76
-              if ($cart->payed) {
77
-                  echo 'Оплачено';
78
-              } elseif (!App::$cur->money) {
79
-                  echo 'Не оплачено';
80
-              } else {
81
-                  $handlers = App::$cur->ecommerce->getSnippets('payTypeHandler');
82
-                  $redirect = ['/ecommerce/cart/success'];
83
-                  if ($cart->payType && !empty($handlers[$cart->payType->handler]['handler'])) {
84
-                      $newRedirect = $handlers[$cart->payType->handler]['handler']($cart);
85
-                  }
86
-                  if (!empty($newRedirect[0])) {
87
-                      echo '<a class="btn btn-warning btn-sm" href = "' . $newRedirect[0] . '">Оплатить</a>';
88
-                  } else {
89
-                      echo 'Не оплачено';
90
-                  }
91
-              }
92
-              ?></td>
76
+                if ($cart->payed) {
77
+                    echo 'Оплачено';
78
+                } elseif (!App::$cur->money) {
79
+                    echo 'Не оплачено';
80
+                } else {
81
+                    $handlers = App::$cur->ecommerce->getSnippets('payTypeHandler');
82
+                    $redirect = ['/ecommerce/cart/success'];
83
+                    if ($cart->payType && !empty($handlers[$cart->payType->handler]['handler'])) {
84
+                        $newRedirect = $handlers[$cart->payType->handler]['handler']($cart);
85
+                    }
86
+                    if (!empty($newRedirect[0])) {
87
+                        echo '<a class="btn btn-warning btn-sm" href = "' . $newRedirect[0] . '">Оплатить</a>';
88
+                    } else {
89
+                        echo 'Не оплачено';
90
+                    }
91
+                }
92
+                ?></td>
93 93
             <td class="text-right">
94 94
               <?php
95
-              if ($cart->cart_status_id < 2) {
96
-                  ?>
95
+                if ($cart->cart_status_id < 2) {
96
+                    ?>
97 97
                   <a title="Продолжить покупки" href="/ecommerce/cart/continue/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-success btn-sm"><i class="glyphicon glyphicon-chevron-right"></i></a>
98 98
                   <a title="Удалить заказ" onclick="return confirm('Вы уверены?')" href="/ecommerce/cart/delete/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-danger btn-sm"><i class="glyphicon glyphicon-trash"></i></a>
99 99
                   <?php
100
-              }
101
-              if ($cart->cart_status_id >= 2) {
102
-                  ?>
100
+                }
101
+                if ($cart->cart_status_id >= 2) {
102
+                    ?>
103 103
                   <a title="Просмотр" href="/ecommerce/cart/orderDetail/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-info btn-sm"><i class="glyphicon glyphicon-eye-open"></i></a>
104 104
                   <a title="Заказать повторно" href="/ecommerce/cart/refill/<?= $cart->id; ?>" data-toggle="tooltip" title="" class="btn btn-primary btn-sm"><i class="glyphicon glyphicon-refresh"></i></a>
105 105
                     <?php
@@ -108,8 +108,8 @@  discard block
 block discarded – undo
108 108
             </td>
109 109
           </tr>
110 110
           <?php
111
-      }
112
-      ?>
111
+        }
112
+        ?>
113 113
     </tbody>
114 114
   </table>
115 115
 </div>
Please login to merge, or discard this patch.
system/modules/Ecommerce/widgets/filters.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -7,8 +7,8 @@  discard block
 block discarded – undo
7 7
         <div class="filter">    
8 8
           <h4><?= $option->name; ?></h4>
9 9
           <?php
10
-          foreach ($option->items as $item) {
11
-              ?>
10
+            foreach ($option->items as $item) {
11
+                ?>
12 12
 
13 13
               <div class="radio">
14 14
                 <label>
@@ -18,8 +18,8 @@  discard block
 block discarded – undo
18 18
               </div>
19 19
 
20 20
               <?php
21
-          }
22
-          ?>
21
+            }
22
+            ?>
23 23
         </div>
24 24
         <?php
25 25
     }
Please login to merge, or discard this patch.
system/modules/Files/Files.php 1 patch
Braces   +24 added lines, -16 removed lines patch added patch discarded remove patch
@@ -22,16 +22,19 @@  discard block
 block discarded – undo
22 22
 
23 23
         $sitePath = App::$primary->path;
24 24
 
25
-        if (!is_uploaded_file($file['tmp_name']))
26
-            return 0;
25
+        if (!is_uploaded_file($file['tmp_name'])) {
26
+                    return 0;
27
+        }
27 28
 
28 29
         $fileinfo = pathinfo($file['name']);
29
-        if (empty($fileinfo['extension']))
30
-            return 0;
30
+        if (empty($fileinfo['extension'])) {
31
+                    return 0;
32
+        }
31 33
 
32 34
         $type = Files\Type::get($fileinfo['extension'], 'ext');
33
-        if (!$type)
34
-            return 0;
35
+        if (!$type) {
36
+                    return 0;
37
+        }
35 38
 
36 39
         if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) {
37 40
             return 0;
@@ -47,13 +50,15 @@  discard block
 block discarded – undo
47 50
         }
48 51
         $fileObject->name = $fileinfo['filename'];
49 52
         $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension'];
50
-        if ($fileObject->id && file_exists($sitePath . $fileObject->path))
51
-            unlink($sitePath . $fileObject->path);
53
+        if ($fileObject->id && file_exists($sitePath . $fileObject->path)) {
54
+                    unlink($sitePath . $fileObject->path);
55
+        }
52 56
 
53 57
         Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/');
54 58
 
55
-        if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path))
56
-            return false;
59
+        if (!move_uploaded_file($file['tmp_name'], $sitePath . $fileObject->path)) {
60
+                    return false;
61
+        }
57 62
 
58 63
         $fileObject->type_id = $type->pk();
59 64
         $fileObject->original_name = $file['name'];
@@ -76,12 +81,14 @@  discard block
 block discarded – undo
76 81
         $sitePath = App::$primary->path;
77 82
 
78 83
         $fileinfo = pathinfo($url);
79
-        if (empty($fileinfo['extension']))
80
-            return 0;
84
+        if (empty($fileinfo['extension'])) {
85
+                    return 0;
86
+        }
81 87
 
82 88
         $type = Files\Type::get($fileinfo['extension'], 'ext');
83
-        if (!$type)
84
-            return 0;
89
+        if (!$type) {
90
+                    return 0;
91
+        }
85 92
 
86 93
         if (!empty($options['accept_group']) && $options['accept_group'] != $type->group) {
87 94
             return 0;
@@ -97,8 +104,9 @@  discard block
 block discarded – undo
97 104
         }
98 105
         $fileObject->name = $fileinfo['filename'];
99 106
         $fileObject->path = $type->type_dir . date('Y-m-d') . '/' . microtime(true) . '.' . $fileinfo['extension'];
100
-        if ($fileObject->id && file_exists($sitePath . $fileObject->path))
101
-            unlink($sitePath . $fileObject->path);
107
+        if ($fileObject->id && file_exists($sitePath . $fileObject->path)) {
108
+                    unlink($sitePath . $fileObject->path);
109
+        }
102 110
 
103 111
         Tools::createDir($sitePath . $type->type_dir . date('Y-m-d') . '/');
104 112
 
Please login to merge, or discard this patch.
system/modules/Libs/Controllers/LibsController.php 2 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -15,7 +15,7 @@
 block discarded – undo
15 15
         $args = func_get_args();
16 16
         $path = $this->module->getPath($args);
17 17
         if($path){
18
-             $this->StaticLoader->giveFile($path);
18
+                $this->StaticLoader->giveFile($path);
19 19
         }
20 20
     }
21 21
 
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@
 block discarded – undo
14 14
     {
15 15
         $args = func_get_args();
16 16
         $path = $this->module->getPath($args);
17
-        if($path){
17
+        if ($path) {
18 18
              $this->StaticLoader->giveFile($path);
19 19
         }
20 20
     }
Please login to merge, or discard this patch.
system/modules/Libs/Libs.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
                     $this->loadLib($rLib);
26 26
                 }
27 27
             }
28
-            if (!empty($className::$files['css']) && (!isset($options['loadCss']) || $options['loadCss'] )) {
28
+            if (!empty($className::$files['css']) && (!isset($options['loadCss']) || $options['loadCss'])) {
29 29
                 foreach ($className::$files['css'] as $file) {
30 30
                     if (strpos($file, '/') === 0 || strpos($file, 'http') === 0) {
31 31
                         App::$cur->view->customAsset('css', $file, $libName);
Please login to merge, or discard this patch.
system/modules/Materials/Materials.php 1 patch
Indentation   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Materials module
4
- *
5
- * @author Alexey Krupskiy <[email protected]>
6
- * @link http://inji.ru/
7
- * @copyright 2015 Alexey Krupskiy
8
- * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
9
- */
3
+     * Materials module
4
+     *
5
+     * @author Alexey Krupskiy <[email protected]>
6
+     * @link http://inji.ru/
7
+     * @copyright 2015 Alexey Krupskiy
8
+     * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
9
+     */
10 10
 class Materials extends Module
11 11
 {
12 12
     function viewsList()
Please login to merge, or discard this patch.