Completed
Push — master ( dd64f4...310ecf )
by Alexey
03:59
created
system/modules/Users/snippets/cabinetSection/usersTree.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-if (App::$cur->users->config['invites']) {
3
+if (App::$cur->users->config['invites']) {
4 4
     return [
5 5
         'name' => 'Мои партнеры',
6 6
         'fullWidget' => 'Users\cabinet/usersTree'
Please login to merge, or discard this patch.
system/modules/Ui/appAdminControllers/content/dataManager/view.php 1 patch
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -35,11 +35,11 @@  discard block
 block discarded – undo
35 35
 ?>
36 36
 <div>
37 37
     <h3>Комментарии (<?=
38
-      \Dashboard\Comment::getCount(['where' => [
39
-              ['item_id', $item->id],
40
-              ['model', $modelName],
41
-      ]]);
42
-      ?>)</h3>
38
+        \Dashboard\Comment::getCount(['where' => [
39
+                ['item_id', $item->id],
40
+                ['model', $modelName],
41
+        ]]);
42
+        ?>)</h3>
43 43
     <?php
44 44
     foreach (\Dashboard\Comment::getList([ 'where' => [
45 45
             ['item_id', $item->id],
@@ -61,11 +61,11 @@  discard block
 block discarded – undo
61 61
 </div>
62 62
 <div>
63 63
   <?php
64
-  $form = new \Ui\Form();
65
-  $form->begin('Оставить комментарий');
66
-  $form->input('textarea', 'comment', 'Комментарий');
67
-  $form->end();
68
-  ?>
64
+    $form = new \Ui\Form();
65
+    $form->begin('Оставить комментарий');
66
+    $form->input('textarea', 'comment', 'Комментарий');
67
+    $form->end();
68
+    ?>
69 69
 </div>
70 70
 <div>
71 71
     <h1>Хронология</h1>
Please login to merge, or discard this patch.
system/modules/Ui/widgets/DataManager/filters.php 1 patch
Indentation   +125 added lines, -125 removed lines patch added patch discarded remove patch
@@ -8,110 +8,110 @@  discard block
 block discarded – undo
8 8
       return false;">
9 9
     <div class="row">       
10 10
       <?php
11
-      $i = -1;
12
-      $form = new Ui\Form();
13
-      foreach ($dataManager->managerOptions['filters'] as $col) {
11
+        $i = -1;
12
+        $form = new Ui\Form();
13
+        foreach ($dataManager->managerOptions['filters'] as $col) {
14 14
 
15
-          if ($dataManager->modelName) {
16
-              $modelName = $dataManager->modelName;
17
-              $colInfo = $modelName::getColInfo($col);
18
-          } else {
19
-              $colInfo = $dataManager->managerOptions['cols'][$col];
20
-          }
21
-          $values = [];
22
-          $inputOptions = [];
23
-          if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
24
-              $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
25
-              if (!empty($colOptions['userCol'])) {
26
-                  if (strpos($colOptions['userCol'], ':')) {
27
-                      $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
28
-                      $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
15
+            if ($dataManager->modelName) {
16
+                $modelName = $dataManager->modelName;
17
+                $colInfo = $modelName::getColInfo($col);
18
+            } else {
19
+                $colInfo = $dataManager->managerOptions['cols'][$col];
20
+            }
21
+            $values = [];
22
+            $inputOptions = [];
23
+            if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
24
+                $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
25
+                if (!empty($colOptions['userCol'])) {
26
+                    if (strpos($colOptions['userCol'], ':')) {
27
+                        $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
28
+                        $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
29 29
 
30
-                      $inputOptions['value'] = \Users\User::$cur->$rel->$param;
31
-                  } else {
32
-                      $this->model->$col = \Users\User::$cur->{$preset['userCol']};
33
-                  }
34
-              } elseif (!empty($colOptions['value'])) {
35
-                  $inputOptions['value'] = $colOptions['value'];
36
-              }
37
-              if (is_array($inputOptions['value'])) {
38
-                  $values = $inputOptions['value'];
39
-                  foreach ($values as $key => $value) {
40
-                      $inputOptions['value'] = $value;
41
-                      $form->input('hidden', "datamanagerFilters[{$col}][value][{$key}]", '', $inputOptions);
42
-                  }
43
-              } else {
44
-                  $form->input('hidden', "datamanagerFilters[{$col}][value]", '', $inputOptions);
45
-              }
46
-              continue;
47
-          }
48
-          if (++$i && !($i % 2)) {
49
-              echo '</div><div class="row">';
50
-          }
51
-          echo '<div class="col-md-6">';
52
-          if (!empty($colInfo['colParams']['type'])) {
53
-              switch ($colInfo['colParams']['type']) {
54
-                  case'select':
30
+                        $inputOptions['value'] = \Users\User::$cur->$rel->$param;
31
+                    } else {
32
+                        $this->model->$col = \Users\User::$cur->{$preset['userCol']};
33
+                    }
34
+                } elseif (!empty($colOptions['value'])) {
35
+                    $inputOptions['value'] = $colOptions['value'];
36
+                }
37
+                if (is_array($inputOptions['value'])) {
38
+                    $values = $inputOptions['value'];
39
+                    foreach ($values as $key => $value) {
40
+                        $inputOptions['value'] = $value;
41
+                        $form->input('hidden', "datamanagerFilters[{$col}][value][{$key}]", '', $inputOptions);
42
+                    }
43
+                } else {
44
+                    $form->input('hidden', "datamanagerFilters[{$col}][value]", '', $inputOptions);
45
+                }
46
+                continue;
47
+            }
48
+            if (++$i && !($i % 2)) {
49
+                echo '</div><div class="row">';
50
+            }
51
+            echo '<div class="col-md-6">';
52
+            if (!empty($colInfo['colParams']['type'])) {
53
+                switch ($colInfo['colParams']['type']) {
54
+                    case'select':
55 55
                       switch ($colInfo['colParams']['source']) {
56
-                          case 'array':
56
+                            case 'array':
57 57
                               $values = ['' => 'Не важно'] + $colInfo['colParams']['sourceArray'];
58
-                              break;
59
-                          case 'method':
58
+                                break;
59
+                            case 'method':
60 60
                               if (!empty($colInfo['colParams']['params'])) {
61
-                                  $values = call_user_func_array([App::$cur->$colInfo['colParams']['module'], $colInfo['colParams']['method']], $colInfo['colParams']['params']);
62
-                              } else {
63
-                                  $values = ['' => 'Не важно'] + App::$cur->$colInfo['colParams']['module']->$colInfo['colParams']['method']();
64
-                              }
65
-                              break;
66
-                          case 'model':
61
+                                    $values = call_user_func_array([App::$cur->$colInfo['colParams']['module'], $colInfo['colParams']['method']], $colInfo['colParams']['params']);
62
+                                } else {
63
+                                    $values = ['' => 'Не важно'] + App::$cur->$colInfo['colParams']['module']->$colInfo['colParams']['method']();
64
+                                }
65
+                                break;
66
+                            case 'model':
67 67
                               $values = ['' => 'Не важно'] + $colInfo['colParams']['model']::getList(['forSelect' => true]);
68
-                              break;
69
-                          case 'relation':
68
+                                break;
69
+                            case 'relation':
70 70
                               $relations = $colInfo['modelName']::relations();
71
-                              $filters = $relations[$colInfo['colParams']['relation']]['model']::managerFilters();
72
-                              $cols = $relations[$colInfo['colParams']['relation']]['model']::cols();
73
-                              $options = [
74
-                                  'where' => !empty($filters['getRows']['where']) ? $filters['getRows']['where'] : ''
75
-                              ];
76
-                              if (isset($cols[$relations[$colInfo['colParams']['relation']]['model']::colPrefix() . 'name'])) {
77
-                                  $options['order'] = 'name';
78
-                              }
79
-                              $items = $relations[$colInfo['colParams']['relation']]['model']::getList($options);
80
-                              $values = ['' => 'Не задано'];
81
-                              foreach ($items as $key => $item) {
82
-                                  if (!empty($inputParams['showCol'])) {
83
-                                      $values[$key] = $item->$inputParams['showCol'];
84
-                                  } else {
85
-                                      $values[$key] = $item->name();
86
-                                  }
87
-                              }
88
-                              $values;
89
-                              break;
90
-                      }
91
-                      $value = !empty($_GET['datamanagerFilters'][$col]['value']) ? $_GET['datamanagerFilters'][$col]['value'] : (!empty($params['filters'][$col]['value']) ? $params['filters'][$col]['value'] : '');
92
-                      $inputOptions = ['value' => $value, 'values' => $values, 'multiple' => true];
93
-                      if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
71
+                                $filters = $relations[$colInfo['colParams']['relation']]['model']::managerFilters();
72
+                                $cols = $relations[$colInfo['colParams']['relation']]['model']::cols();
73
+                                $options = [
74
+                                    'where' => !empty($filters['getRows']['where']) ? $filters['getRows']['where'] : ''
75
+                                ];
76
+                                if (isset($cols[$relations[$colInfo['colParams']['relation']]['model']::colPrefix() . 'name'])) {
77
+                                    $options['order'] = 'name';
78
+                                }
79
+                                $items = $relations[$colInfo['colParams']['relation']]['model']::getList($options);
80
+                                $values = ['' => 'Не задано'];
81
+                                foreach ($items as $key => $item) {
82
+                                    if (!empty($inputParams['showCol'])) {
83
+                                        $values[$key] = $item->$inputParams['showCol'];
84
+                                    } else {
85
+                                        $values[$key] = $item->name();
86
+                                    }
87
+                                }
88
+                                $values;
89
+                                break;
90
+                        }
91
+                        $value = !empty($_GET['datamanagerFilters'][$col]['value']) ? $_GET['datamanagerFilters'][$col]['value'] : (!empty($params['filters'][$col]['value']) ? $params['filters'][$col]['value'] : '');
92
+                        $inputOptions = ['value' => $value, 'values' => $values, 'multiple' => true];
93
+                        if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
94 94
 
95
-                          $inputOptions['disabled'] = true;
96
-                          $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
97
-                          if (!empty($colOptions['userCol'])) {
98
-                              if (strpos($colOptions['userCol'], ':')) {
99
-                                  $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
100
-                                  $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
95
+                            $inputOptions['disabled'] = true;
96
+                            $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
97
+                            if (!empty($colOptions['userCol'])) {
98
+                                if (strpos($colOptions['userCol'], ':')) {
99
+                                    $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
100
+                                    $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
101 101
 
102
-                                  $inputOptions['value'] = \Users\User::$cur->$rel->$param;
103
-                              } else {
104
-                                  $this->model->$col = \Users\User::$cur->{$preset['userCol']};
105
-                              }
106
-                          } elseif (!empty($colOptions['value'])) {
102
+                                    $inputOptions['value'] = \Users\User::$cur->$rel->$param;
103
+                                } else {
104
+                                    $this->model->$col = \Users\User::$cur->{$preset['userCol']};
105
+                                }
106
+                            } elseif (!empty($colOptions['value'])) {
107 107
 
108
-                              $inputOptions['value'] = $colOptions['value'];
109
-                          }
110
-                      }
111
-                      $inputOptions['class'] = 'input-sm';
112
-                      $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions);
113
-                      break;
114
-                  case 'email':
108
+                                $inputOptions['value'] = $colOptions['value'];
109
+                            }
110
+                        }
111
+                        $inputOptions['class'] = 'input-sm';
112
+                        $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions);
113
+                        break;
114
+                    case 'email':
115 115
                   case 'text':
116 116
                   case 'textarea':
117 117
                   case 'html':
@@ -139,40 +139,40 @@  discard block
 block discarded – undo
139 139
                         ?>
140 140
                         <div class="filter_form_field filter_select">
141 141
                           <?php
142
-                          if (!empty($_GET['datamanagerFilters'][$col]['value'])) {
143
-                              $value = 1;
144
-                          } elseif (isset($_GET['datamanagerFilters'][$col]['value'])) {
145
-                              $value = 0;
146
-                          } else {
147
-                              $value = '';
148
-                          }
149
-                          $inputOptions = ['value' => $value, 'values' => [
150
-                                  '' => 'Не важно',
151
-                                  '1' => $colInfo['label'],
152
-                                  '0' => 'Нет'
153
-                              ]
154
-                          ];
155
-                          if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
142
+                            if (!empty($_GET['datamanagerFilters'][$col]['value'])) {
143
+                                $value = 1;
144
+                            } elseif (isset($_GET['datamanagerFilters'][$col]['value'])) {
145
+                                $value = 0;
146
+                            } else {
147
+                                $value = '';
148
+                            }
149
+                            $inputOptions = ['value' => $value, 'values' => [
150
+                                    '' => 'Не важно',
151
+                                    '1' => $colInfo['label'],
152
+                                    '0' => 'Нет'
153
+                                ]
154
+                            ];
155
+                            if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
156 156
 
157
-                              $inputOptions['disabled'] = true;
158
-                              $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
159
-                              if (!empty($colOptions['userCol'])) {
160
-                                  if (strpos($colOptions['userCol'], ':')) {
161
-                                      $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
162
-                                      $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
157
+                                $inputOptions['disabled'] = true;
158
+                                $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
159
+                                if (!empty($colOptions['userCol'])) {
160
+                                    if (strpos($colOptions['userCol'], ':')) {
161
+                                        $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
162
+                                        $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
163 163
 
164
-                                      $inputOptions['value'] = \Users\User::$cur->$rel->$param;
165
-                                  } else {
166
-                                      $this->model->$col = \Users\User::$cur->{$preset['userCol']};
167
-                                  }
168
-                              } elseif (!empty($colOptions['value'])) {
164
+                                        $inputOptions['value'] = \Users\User::$cur->$rel->$param;
165
+                                    } else {
166
+                                        $this->model->$col = \Users\User::$cur->{$preset['userCol']};
167
+                                    }
168
+                                } elseif (!empty($colOptions['value'])) {
169 169
 
170
-                                  $inputOptions['value'] = $colOptions['value'];
171
-                              }
172
-                          }
173
-                          $inputOptions['class'] = 'input-sm';
174
-                          $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions);
175
-                          ?>
170
+                                    $inputOptions['value'] = $colOptions['value'];
171
+                                }
172
+                            }
173
+                            $inputOptions['class'] = 'input-sm';
174
+                            $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions);
175
+                            ?>
176 176
                         </div>
177 177
 
178 178
                         <?php
Please login to merge, or discard this patch.
system/modules/View/appAdminControllers/content/Template/chooseFile.php 1 patch
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,8 +2,8 @@
 block discarded – undo
2 2
 <a href ='/admin/view/template/editFile/<?= $template->name; ?>?path=<?= $template->config['file']; ?>'>Основной файл темы</a>
3 3
 <hr/>
4 4
 <?php
5
-foreach ($template->config['css'] as $file) {
6
-    if (file_exists($template->path . '/css/' . $file)) {
5
+foreach ($template->config['css'] as $file) {
6
+    if (file_exists($template->path . '/css/' . $file)) {
7 7
         ?>
8 8
         <a href ='/admin/view/template/editFile/<?= $template->name; ?>?path=<?= 'css/' . $file; ?>'><?= $file; ?></a>
9 9
         <?php
Please login to merge, or discard this patch.
system/modules/View/appAdminControllers/content/index.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -11,12 +11,13 @@
 block discarded – undo
11 11
     '',
12 12
     ''
13 13
 ]);
14
-if (!empty($templates['app']['installed']))
14
+if (!empty($templates['app']['installed'])) {
15 15
     foreach ($templates['app']['installed'] as $template => $name) {
16 16
         $table->addRow([
17 17
             $name,
18 18
             (empty($templates['app']['current']) || $templates['app']['current'] != $template) ? '<a href = "/admin/view/setDefault/' . $template . '">Установить по умолчанию</a>' : 'Тема по умолчанию',
19 19
             '<a href = "/admin/view/template/editFile/' . $template . '">Файлы</a> <a href = "/admin/view/editTemplate/' . $template . '">Редактировать</a>'
20 20
         ]);
21
+}
21 22
     }
22 23
 $table->draw();
Please login to merge, or discard this patch.
system/modules/Money/snippets/userActivity/lastPurchase.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 
3 3
 return [
4 4
     'name' => 'Последняя покупка не позднее 90 дней',
5
-    'checker' => function($user) {
5
+    'checker' => function($user) {
6 6
         $query = 'SELECT * FROM inji_ecommerce_cart iec WHERE iec.cart_cart_status_id >= 5 AND iec.cart_date_create >= NOW() - INTERVAL 90 DAY AND cart_user_id = ?';
7 7
         $result = \App::$cur->db->query(['query' => $query, 'params' => [$user->id]]);
8 8
         return (bool) $result ? $result->fetch() : false;
Please login to merge, or discard this patch.
system/modules/Money/widgets/cabinet/walletsWidget.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@
 block discarded – undo
2 2
 <?php
3 3
 $blocked = App::$cur->money->getUserBlocks();
4 4
 $wallets = App::$cur->money->getUserWallets();
5
-foreach ($wallets as $wallet) {
5
+foreach ($wallets as $wallet) {
6 6
     ?>
7 7
     <b><?= $wallet->showAmount(); ?></b> <?= $wallet->currency->acronym(); ?><br />
8 8
     <?php
Please login to merge, or discard this patch.
system/modules/UserForms/widgets/userForm.php 1 patch
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if (!empty($params[0])) {
2
+if (!empty($params[0])) {
3 3
     $form_id = $params[0];
4 4
 }
5
-if (empty($form_id)) {
5
+if (empty($form_id)) {
6 6
     echo('form not found');
7 7
     return;
8 8
 }
9 9
 $userForm = \UserForms\Form::get((int) $form_id);
10
-if (!$userForm) {
10
+if (!$userForm) {
11 11
     echo('form not found');
12 12
     return;
13 13
 }
@@ -15,10 +15,10 @@  discard block
 block discarded – undo
15 15
 $form->begin();
16 16
 ?>
17 17
 <?php
18
-if ($userForm->description) {
18
+if ($userForm->description) {
19 19
     echo "<p class = 'text-center'>{$userForm->description}</p>";
20 20
 }
21
-foreach ($userForm->inputs(['order' => ['weight']]) as $input) {
21
+foreach ($userForm->inputs(['order' => ['weight']]) as $input) {
22 22
     $form->input($input->type, 'UserForms[' . (int) $form_id . '][input' . $input->id . ']', $input->label, ['required' => $input->required]);
23 23
 }
24 24
 ?>
Please login to merge, or discard this patch.
system/modules/Migrations/objects/Walker.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -27,7 +27,8 @@  discard block
 block discarded – undo
27 27
         //walk know pathes
28 28
         foreach ($this->map->paths(['where' => ['path', $this->curPath]]) as $path) {
29 29
             if (isset($this->data[$path->item])) {
30
-                if ($path->type == 'container') { //create walker for container
30
+                if ($path->type == 'container') {
31
+//create walker for container
31 32
                     $walker = new Walker();
32 33
                     $walker->migration = $this->migration;
33 34
                     $walker->map = $this->map;
@@ -37,7 +38,8 @@  discard block
 block discarded – undo
37 38
                     $walker->mapPathParent = $this->mapPath;
38 39
                     $walker->migtarionLog = $this->migtarionLog;
39 40
                     $walker->walk();
40
-                } elseif ($path->type == 'object') { //start parse path data
41
+                } elseif ($path->type == 'object') {
42
+//start parse path data
41 43
                     $this->startObjectParse($path->object_id, $this->data[$path->item]);
42 44
                 }
43 45
             }
@@ -54,9 +56,11 @@  discard block
 block discarded – undo
54 56
                         ['code', $key],
55 57
                         ['migration_id', $this->migration->id]
56 58
             ]);
57
-            if ($object) { //parse as object
59
+            if ($object) {
60
+//parse as object
58 61
                 $this->startObjectParse($object, $data);
59
-            } else { //create new map path for configure unknown path
62
+            } else {
63
+//create new map path for configure unknown path
60 64
                 $this->mapPath = new Migration\Map\Path();
61 65
                 $this->mapPath->parent_id = $this->mapPathParent ? $this->mapPathParent->id : 0;
62 66
                 $this->mapPath->path = $this->curPath;
Please login to merge, or discard this patch.