Completed
Push — master ( b5207b...337c6f )
by Alexey
05:05
created
system/modules/Money/Money.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
             if (empty($blocks[$block->wallet->currency_id])) {
103 103
                 $blocks[$block->wallet->currency_id] = $block->amount;
104 104
             } else {
105
-                $blocks[$block->wallet->currency_id]+= $block->amount;
105
+                $blocks[$block->wallet->currency_id] += $block->amount;
106 106
             }
107 107
         }
108 108
         return $blocks;
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
         $rootUser = $rootUser ? $rootUser : \Users\User::$cur;
167 167
         $reward = \Money\Reward::get($reward_id);
168 168
         $reward->checkBlocked();
169
-        $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id ]]);
169
+        $reward_count = \Money\Reward\Recive::getCount(['where' => ['reward_id', $reward_id]]);
170 170
         if ($reward_count >= $reward->quantity && $reward->quantity)
171 171
             return false;
172 172
         $types = $this->getSnippets('rewardType');
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
                 $recives = \Money\Reward\Recive::getList(['where' => [['user_id', $user->id], ['reward_id', $reward->id]]]);
188 188
                 $amount = 0;
189 189
                 foreach ($recives as $recive) {
190
-                    $amount+=$recive->amount;
190
+                    $amount += $recive->amount;
191 191
                 }
192 192
                 if ($amount >= $reward->peruser) {
193 193
                     continue;
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -167,8 +167,9 @@
 block discarded – undo
167 167
         $reward = \Money\Reward::get($reward_id);
168 168
         $reward->checkBlocked();
169 169
         $reward_count = \Money\Reward\Recive::getCount([ 'where' => [ 'reward_id', $reward_id ]]);
170
-        if ($reward_count >= $reward->quantity && $reward->quantity)
171
-            return false;
170
+        if ($reward_count >= $reward->quantity && $reward->quantity) {
171
+                    return false;
172
+        }
172 173
         $types = $this->getSnippets('rewardType');
173 174
         foreach ($reward->levels(['order' => ['level', 'asc']]) as $level) {
174 175
             $user = $rootUser;
Please login to merge, or discard this patch.
system/modules/UserForms/widgets/userForm.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -14,29 +14,29 @@
 block discarded – undo
14 14
 ?>
15 15
 <form method = "POST" action = "">
16 16
   <?php
17
-  if ($form->description) {
18
-      echo "<p class = 'text-center'>{$form->description}</p>";
19
-  }
20
-  foreach ($form->inputs(['order' => ['weight']]) as $input) {
21
-      switch ($input->type) {
22
-          case 'text':
17
+    if ($form->description) {
18
+        echo "<p class = 'text-center'>{$form->description}</p>";
19
+    }
20
+    foreach ($form->inputs(['order' => ['weight']]) as $input) {
21
+        switch ($input->type) {
22
+            case 'text':
23 23
               ?>
24 24
               <div class ='form-group'>
25 25
                 <label><?= $input->label; ?></label>
26 26
                 <input class ='form-control' type ='text' name ='UserForms[<?= (int) $form_id; ?>][input<?= $input->id; ?>]' <?= $input->required ? 'required' : ''; ?> />
27 27
               </div>
28 28
               <?php
29
-              break;
30
-          case 'textarea':
29
+                break;
30
+            case 'textarea':
31 31
               ?>
32 32
               <div class ='form-group'>
33 33
                 <label><?= $input->label; ?></label>
34 34
                 <textarea class ='form-control' name ='UserForms[<?= (int) $form_id; ?>][input<?= $input->id; ?>]' <?= $input->required ? 'required' : ''; ?> /></textarea>
35 35
               </div>
36 36
               <?php
37
-              break;
38
-      }
39
-  }
40
-  ?>
37
+                break;
38
+        }
39
+    }
40
+    ?>
41 41
   <button class = 'btn btn-success btn-block'>Отправить</button>
42 42
 </form>
43 43
\ No newline at end of file
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/Ui/objects/Tree.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -23,17 +23,17 @@
 block discarded – undo
23 23
         ?>
24 24
         <ul class="treeview" data-col='tree_path'>
25 25
           <?php
26
-          if (is_string($objectRoot)) {
27
-              $items = $objectRoot::getList(['where' => ['parent_id', 0]]);
28
-          } else {
29
-              $class = get_class($objectRoot);
30
-              $items = $class::getList(['where' => ['parent_id', $objectRoot->pk()]]);
31
-          }
32
-          $count += count($items);
33
-          foreach ($items as $objectChild) {
34
-              $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc);
35
-          }
36
-          ?>
26
+            if (is_string($objectRoot)) {
27
+                $items = $objectRoot::getList(['where' => ['parent_id', 0]]);
28
+            } else {
29
+                $class = get_class($objectRoot);
30
+                $items = $class::getList(['where' => ['parent_id', $objectRoot->pk()]]);
31
+            }
32
+            $count += count($items);
33
+            foreach ($items as $objectChild) {
34
+                $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc);
35
+            }
36
+            ?>
37 37
         </ul>
38 38
         <?php
39 39
         return $count;
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
           }
32 32
           $count += count($items);
33 33
           foreach ($items as $objectChild) {
34
-              $count+=static::showLi($objectChild, 1, $maxDeep, $hrefFunc);
34
+              $count += static::showLi($objectChild, 1, $maxDeep, $hrefFunc);
35 35
           }
36 36
           ?>
37 37
         </ul>
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
                     echo \Html::el('li', $attributes, $item, true);
64 64
                     echo '<ul>';
65 65
                 }
66
-                $count+=static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc);
66
+                $count += static::showLi($objectChild, $deep + 1, $maxDeep, $hrefFunc);
67 67
             }
68 68
         }
69 69
         if ($isset) {
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/delivery.php 2 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -2,24 +2,24 @@
 block discarded – undo
2 2
   <div class="col-md-4">
3 3
     <ul class="nav nav-pills nav-stacked">
4 4
       <?php
5
-      $hiddenId = Tools::randomString();
6
-      foreach ($deliverys as $delivery) {
7
-          if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || $delivery->id == $cartDelivery->id) {
8
-              $checked = 'checked';
9
-          } else {
10
-              $checked = '';
11
-          }
12
-          echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">';
13
-          echo $delivery->name;
14
-          echo '</a></li>';
15
-      }
16
-      $form->input('hidden', "delivery", '', [
17
-          'value' => $cartDelivery->id,
18
-          'attributes' => [
19
-              'id' => $hiddenId
20
-          ],
21
-      ]);
22
-      ?>
5
+        $hiddenId = Tools::randomString();
6
+        foreach ($deliverys as $delivery) {
7
+            if ((!empty($_POST['delivery']) && $_POST['delivery'] == $delivery->id) || $delivery->id == $cartDelivery->id) {
8
+                $checked = 'checked';
9
+            } else {
10
+                $checked = '';
11
+            }
12
+            echo '<li' . ($checked ? ' class="active"' : '') . '><a href = "#" onclick = "document.getElementById(\'' . $hiddenId . '\').value=\'' . $delivery->id . '\';inji.Ecommerce.Cart.calcSum();return false;">';
13
+            echo $delivery->name;
14
+            echo '</a></li>';
15
+        }
16
+        $form->input('hidden', "delivery", '', [
17
+            'value' => $cartDelivery->id,
18
+            'attributes' => [
19
+                'id' => $hiddenId
20
+            ],
21
+        ]);
22
+        ?>
23 23
     </ul>
24 24
   </div>
25 25
   <div class="col-md-8">
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -27,13 +27,13 @@
 block discarded – undo
27 27
     <?php
28 28
     $delivery = $cartDelivery;
29 29
     if ($delivery->price_text || $delivery->price) {
30
-        echo "<div>Стоимость доставки: <b>" . ($delivery->price_text ? $delivery->price_text : ( $delivery->price . ' ' . ($delivery->currency ? $delivery->currency->acronym() : 'руб.') )) . '</b></div>';
30
+        echo "<div>Стоимость доставки: <b>" . ($delivery->price_text ? $delivery->price_text : ($delivery->price . ' ' . ($delivery->currency ? $delivery->currency->acronym() : 'руб.'))) . '</b></div>';
31 31
     }
32 32
     if ((float) $delivery->max_cart_price) {
33 33
         echo '<div>При заказе товаров на сумму от ' . $delivery->max_cart_price . ' руб - бесплатно</div>';
34 34
     }
35 35
     echo $delivery->info;
36
-    if($delivery->fields) {
36
+    if ($delivery->fields) {
37 37
         echo '<hr \>';
38 38
         foreach ($delivery->fields as $field) {
39 39
             $form->input($field->type, "deliveryFields[{$field->id}]", $field->name, ['required' => $field->required]);
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/Ecommerce/widgets/filters.php 1 patch
Indentation   +24 added lines, -24 removed lines patch added patch discarded remove patch
@@ -17,30 +17,30 @@  discard block
 block discarded – undo
17 17
         ?>
18 18
         <div class="filter">    
19 19
           <?php
20
-          switch ($option->type) {
21
-              case 'radio':
20
+            switch ($option->type) {
21
+                case 'radio':
22 22
                   foreach ($option->items as $item) {
23
-                      $this->widget('Ui\Form/' . $option->type, [
24
-                          'label' => $item->name,
25
-                          'name' => "filters[options][{$option->id}]",
26
-                          !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false,
27
-                          'options' => [
28
-                              'value' => $item->id,
29
-                          ]
30
-                      ]);
31
-                  }
32
-                  break;
33
-              default:
23
+                        $this->widget('Ui\Form/' . $option->type, [
24
+                            'label' => $item->name,
25
+                            'name' => "filters[options][{$option->id}]",
26
+                            !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : false,
27
+                            'options' => [
28
+                                'value' => $item->id,
29
+                            ]
30
+                        ]);
31
+                    }
32
+                    break;
33
+                default:
34 34
                   $this->widget('Ui\Form/' . $option->type, [
35
-                      'label' => $option->name,
36
-                      'name' => "filters[options][{$option->id}]",
37
-                      'options' => [
38
-                          'value' => !empty($_GET['filters']['options'][$option->id]) ? $_GET['filters']['options'][$option->id] : '',
39
-                      ]
40
-                  ]);
41
-          }
42
-          foreach ($option->items as $item) {
43
-              ?>
35
+                        'label' => $option->name,
36
+                        'name' => "filters[options][{$option->id}]",
37
+                        'options' => [
38
+                            'value' => !empty($_GET['filters']['options'][$option->id]) ? $_GET['filters']['options'][$option->id] : '',
39
+                        ]
40
+                    ]);
41
+            }
42
+            foreach ($option->items as $item) {
43
+                ?>
44 44
               <div class="radio">
45 45
                 <label>
46 46
                   <input type="radio" name = 'filters[options][<?= $option->id; ?>]' value ="<?= $item->id; ?>" <?= !empty($_GET['filters']['options'][$option->id]) && $_GET['filters']['options'][$option->id] == $item->id ? 'checked' : ''; ?>>
@@ -48,8 +48,8 @@  discard block
 block discarded – undo
48 48
                 </label>
49 49
               </div>
50 50
               <?php
51
-          }
52
-          ?>
51
+            }
52
+            ?>
53 53
         </div>
54 54
         <?php
55 55
     }
Please login to merge, or discard this patch.
system/modules/Ecommerce/objects/CloseCartBtn.php 1 patch
Indentation   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * Item name
4
- *
5
- * Info
6
- *
7
- * @author Alexey Krupskiy <[email protected]>
8
- * @link http://inji.ru/
9
- * @copyright 2016 Alexey Krupskiy
10
- * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
11
- */
3
+             * Item name
4
+             *
5
+             * Info
6
+             *
7
+             * @author Alexey Krupskiy <[email protected]>
8
+             * @link http://inji.ru/
9
+             * @copyright 2016 Alexey Krupskiy
10
+             * @license https://github.com/injitools/cms-Inji/blob/master/LICENSE
11
+             */
12 12
 
13 13
 namespace Ecommerce;
14 14
 
Please login to merge, or discard this patch.