Completed
Push — master ( cdfa80...308a3c )
by Alexey
18:18
created
system/modules/Dashboard/models/Activity.php 1 patch
Indentation   +56 added lines, -56 removed lines patch added patch discarded remove patch
@@ -20,62 +20,62 @@  discard block
 block discarded – undo
20 20
  */
21 21
 class Activity extends \Model {
22 22
 
23
-  public static $logging = false;
24
-  public static $cols = [
25
-      'type' => ['type' => 'select', 'source' => 'array',
26
-          'sourceArray' => [
27
-              'changes' => 'Изменение',
28
-              'new' => 'Создание',
29
-              'delete' => 'Удаление'
30
-          ]
31
-      ],
32
-      'item_id' => ['type' => 'number',
33
-          'view' => [
34
-              'type' => 'moduleMethod',
35
-              'module' => 'Dashboard',
36
-              'method' => 'itemHref'
37
-          ]
38
-      ],
39
-      'module' => ['type' => 'text',
40
-          'view' => [
41
-              'type' => 'moduleMethod',
42
-              'module' => 'Dashboard',
43
-              'method' => 'moduleHref'
44
-          ]
45
-      ],
46
-      'model' => ['type' => 'text',
47
-          'view' => [
48
-              'type' => 'moduleMethod',
49
-              'module' => 'Dashboard',
50
-              'method' => 'modelHref'
51
-          ]
52
-      ],
53
-      'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'],
54
-      'changes_text' => ['type' => 'text'],
55
-      'date_create' => ['type' => 'dateTime'],
56
-      'change' => ['type' => 'dataManager', 'relation' => 'changes']
57
-  ];
58
-  public static $dataManagers = [
59
-      'manager' => [
60
-          'cols' => ['type', 'module', 'model', 'item_id', 'user_id', 'changes_text', 'change', 'date_create'],
61
-          'sortable' => ['type', 'item_id', 'module', 'model', 'user_id', 'date_create'],
62
-          'preSort' => ['date_create' => 'desc'],
63
-          'actions' => ['Edit' => ['access' => ['groups' => [0]]], 'Delete' => ['access' => ['groups' => [0]]]],
64
-          'filters' => ['type', 'module', 'model', 'item_id', 'changes_text', 'change', 'date_create']
65
-      ]
66
-  ];
67
-  public static $labels = [
68
-      'type' => 'Тип события',
69
-      'item_id' => 'Объект',
70
-      'module' => 'Модуль',
71
-      'model' => 'Сущность',
72
-      'user_id' => 'Пользователь',
73
-      'changes_text' => 'Сводка изменений',
74
-      'change' => 'Изменения',
75
-      'date_create' => 'Дата события'
76
-  ];
23
+    public static $logging = false;
24
+    public static $cols = [
25
+        'type' => ['type' => 'select', 'source' => 'array',
26
+            'sourceArray' => [
27
+                'changes' => 'Изменение',
28
+                'new' => 'Создание',
29
+                'delete' => 'Удаление'
30
+            ]
31
+        ],
32
+        'item_id' => ['type' => 'number',
33
+            'view' => [
34
+                'type' => 'moduleMethod',
35
+                'module' => 'Dashboard',
36
+                'method' => 'itemHref'
37
+            ]
38
+        ],
39
+        'module' => ['type' => 'text',
40
+            'view' => [
41
+                'type' => 'moduleMethod',
42
+                'module' => 'Dashboard',
43
+                'method' => 'moduleHref'
44
+            ]
45
+        ],
46
+        'model' => ['type' => 'text',
47
+            'view' => [
48
+                'type' => 'moduleMethod',
49
+                'module' => 'Dashboard',
50
+                'method' => 'modelHref'
51
+            ]
52
+        ],
53
+        'user_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'user'],
54
+        'changes_text' => ['type' => 'text'],
55
+        'date_create' => ['type' => 'dateTime'],
56
+        'change' => ['type' => 'dataManager', 'relation' => 'changes']
57
+    ];
58
+    public static $dataManagers = [
59
+        'manager' => [
60
+            'cols' => ['type', 'module', 'model', 'item_id', 'user_id', 'changes_text', 'change', 'date_create'],
61
+            'sortable' => ['type', 'item_id', 'module', 'model', 'user_id', 'date_create'],
62
+            'preSort' => ['date_create' => 'desc'],
63
+            'actions' => ['Edit' => ['access' => ['groups' => [0]]], 'Delete' => ['access' => ['groups' => [0]]]],
64
+            'filters' => ['type', 'module', 'model', 'item_id', 'changes_text', 'change', 'date_create']
65
+        ]
66
+    ];
67
+    public static $labels = [
68
+        'type' => 'Тип события',
69
+        'item_id' => 'Объект',
70
+        'module' => 'Модуль',
71
+        'model' => 'Сущность',
72
+        'user_id' => 'Пользователь',
73
+        'changes_text' => 'Сводка изменений',
74
+        'change' => 'Изменения',
75
+        'date_create' => 'Дата события'
76
+    ];
77 77
 
78
-  public static function relations() {
78
+    public static function relations() {
79 79
     return [
80 80
         'user' => [
81 81
             'col' => 'user_id',
@@ -87,6 +87,6 @@  discard block
 block discarded – undo
87 87
             'model' => 'Dashboard\Activity\Change'
88 88
         ]
89 89
     ];
90
-  }
90
+    }
91 91
 
92 92
 }
Please login to merge, or discard this patch.
system/modules/Dashboard/models/Activity/Change.php 1 patch
Indentation   +21 added lines, -21 removed lines patch added patch discarded remove patch
@@ -15,33 +15,33 @@
 block discarded – undo
15 15
 
16 16
 class Change extends \Model {
17 17
 
18
-  public static $logging = false;
19
-  public static $cols = [
20
-      'activity_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'activity'],
21
-      'col' => ['type' => 'text'],
22
-      'old' => ['type' => 'textarea'],
23
-      'new' => ['type' => 'textarea'],
24
-      'date_create' => ['type' => 'dateTime']
25
-  ];
26
-  public static $dataManagers = [
27
-      'manager' => [
28
-          'cols' => ['col', 'old', 'new'],
29
-          'actions' => ['Edit' => ['access' => ['groups' => [0]]], 'Delete' => ['access' => ['groups' => [0]]]]
30
-      ]
31
-  ];
32
-  public static $labels = [
33
-      'col' => 'Поле',
34
-      'old' => 'Старое значение',
35
-      'new' => 'Новое значение'
36
-  ];
18
+    public static $logging = false;
19
+    public static $cols = [
20
+        'activity_id' => ['type' => 'select', 'source' => 'relation', 'relation' => 'activity'],
21
+        'col' => ['type' => 'text'],
22
+        'old' => ['type' => 'textarea'],
23
+        'new' => ['type' => 'textarea'],
24
+        'date_create' => ['type' => 'dateTime']
25
+    ];
26
+    public static $dataManagers = [
27
+        'manager' => [
28
+            'cols' => ['col', 'old', 'new'],
29
+            'actions' => ['Edit' => ['access' => ['groups' => [0]]], 'Delete' => ['access' => ['groups' => [0]]]]
30
+        ]
31
+    ];
32
+    public static $labels = [
33
+        'col' => 'Поле',
34
+        'old' => 'Старое значение',
35
+        'new' => 'Новое значение'
36
+    ];
37 37
 
38
-  public static function relations() {
38
+    public static function relations() {
39 39
     return [
40 40
         'activity' => [
41 41
             'col' => 'activity_id',
42 42
             'model' => 'Dashboard\Activity'
43 43
         ]
44 44
     ];
45
-  }
45
+    }
46 46
 
47 47
 }
Please login to merge, or discard this patch.
system/modules/Dashboard/Dashboard.php 2 patches
Indentation   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -10,35 +10,35 @@
 block discarded – undo
10 10
  */
11 11
 class Dashboard extends Module {
12 12
 
13
-  public function itemHref($item, $col, $colParam) {
13
+    public function itemHref($item, $col, $colParam) {
14 14
     $modelName = $item->model;
15 15
     $relItem = $modelName::get($item->$col);
16 16
     if ($relItem) {
17
-      return "<a href='/admin/" . $relItem->genViewLink() . "'>" . $relItem->name() . "</a>";
17
+        return "<a href='/admin/" . $relItem->genViewLink() . "'>" . $relItem->name() . "</a>";
18 18
     }
19 19
     return 'Ресурс удален';
20
-  }
20
+    }
21 21
 
22
-  public function moduleHref($item, $col, $colParam) {
22
+    public function moduleHref($item, $col, $colParam) {
23 23
     if (!$item->$col) {
24
-      return 'Модуль не задан';
24
+        return 'Модуль не задан';
25 25
     }
26 26
     if (!Module::installed($item->$col, \App::$primary)) {
27
-      return 'Модуль ' . $item->$col . ' не установлен';
27
+        return 'Модуль ' . $item->$col . ' не установлен';
28 28
     }
29 29
     $moduleInfo = Module::getInfo($item->$col);
30 30
     return !empty($moduleInfo['name']) ? $moduleInfo['name'] : $item->$col;
31
-  }
31
+    }
32 32
 
33
-  public function modelHref($item, $col, $colParam) {
33
+    public function modelHref($item, $col, $colParam) {
34 34
     if (!$item->$col) {
35
-      return 'Модель не задана';
35
+        return 'Модель не задана';
36 36
     }
37 37
     if (!class_exists($item->$col)) {
38
-      return 'Модель ' . $item->$col . ' несуществует';
38
+        return 'Модель ' . $item->$col . ' несуществует';
39 39
     }
40 40
     $modelName = $item->$col;
41 41
     return $modelName::$objectName ? $modelName::$objectName : $modelName;
42
-  }
42
+    }
43 43
 
44 44
 }
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
     $modelName = $item->model;
15 15
     $relItem = $modelName::get($item->$col);
16 16
     if ($relItem) {
17
-      return "<a href='/admin/" . $relItem->genViewLink() . "'>" . $relItem->name() . "</a>";
17
+      return "<a href='/admin/".$relItem->genViewLink()."'>".$relItem->name()."</a>";
18 18
     }
19 19
     return 'Ресурс удален';
20 20
   }
@@ -24,7 +24,7 @@  discard block
 block discarded – undo
24 24
       return 'Модуль не задан';
25 25
     }
26 26
     if (!Module::installed($item->$col, \App::$primary)) {
27
-      return 'Модуль ' . $item->$col . ' не установлен';
27
+      return 'Модуль '.$item->$col.' не установлен';
28 28
     }
29 29
     $moduleInfo = Module::getInfo($item->$col);
30 30
     return !empty($moduleInfo['name']) ? $moduleInfo['name'] : $item->$col;
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
       return 'Модель не задана';
36 36
     }
37 37
     if (!class_exists($item->$col)) {
38
-      return 'Модель ' . $item->$col . ' несуществует';
38
+      return 'Модель '.$item->$col.' несуществует';
39 39
     }
40 40
     $modelName = $item->$col;
41 41
     return $modelName::$objectName ? $modelName::$objectName : $modelName;
Please login to merge, or discard this patch.
system/modules/Ui/widgets/DataManager/filters.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if (!$dataManager->checkAccess()) {
3
-  echo 'you not have access to "' . $dataManager->modelName . '" manager with name: "' . $dataManager->managerName . '"';
4
-  return false;
3
+    echo 'you not have access to "' . $dataManager->modelName . '" manager with name: "' . $dataManager->managerName . '"';
4
+    return false;
5 5
 }
6 6
 ?>
7 7
 <form accept-charset="UTF-8" action="" class="dataManagerFilters" method="get" onsubmit="inji.Ui.dataManagers.get(document.getElementById('<?= $dataManager->managerId; ?>')).reload();
@@ -12,61 +12,61 @@  discard block
 block discarded – undo
12 12
     $form = new Ui\Form();
13 13
     foreach ($dataManager->managerOptions['filters'] as $col) {
14 14
 
15
-      if ($dataManager->modelName) {
15
+        if ($dataManager->modelName) {
16 16
         $modelName = $dataManager->modelName;
17 17
         $colInfo = $modelName::getColInfo($col);
18
-      } else {
18
+        } else {
19 19
         $colInfo = $dataManager->managerOptions['cols'][$col];
20
-      }
21
-      $values = [];
22
-      $inputOptions = [];
23
-      if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
20
+        }
21
+        $values = [];
22
+        $inputOptions = [];
23
+        if (!empty($dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col])) {
24 24
         $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
25 25
         if (!empty($colOptions['userCol'])) {
26
-          if (strpos($colOptions['userCol'], ':')) {
26
+            if (strpos($colOptions['userCol'], ':')) {
27 27
             $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
28 28
             $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
29 29
 
30 30
             $inputOptions['value'] = \Users\User::$cur->$rel->$param;
31
-          } else {
31
+            } else {
32 32
             $this->model->$col = \Users\User::$cur->{$preset['userCol']};
33
-          }
33
+            }
34 34
         } elseif (!empty($colOptions['value'])) {
35
-          $inputOptions['value'] = $colOptions['value'];
35
+            $inputOptions['value'] = $colOptions['value'];
36 36
         }
37 37
         if (is_array($inputOptions['value'])) {
38
-          $values = $inputOptions['value'];
39
-          foreach ($values as $key => $value) {
38
+            $values = $inputOptions['value'];
39
+            foreach ($values as $key => $value) {
40 40
             $inputOptions['value'] = $value;
41 41
             $form->input('hidden', "datamanagerFilters[{$col}][value][{$key}]", '', $inputOptions);
42
-          }
42
+            }
43 43
         } else {
44
-          $form->input('hidden', "datamanagerFilters[{$col}][value]", '', $inputOptions);
44
+            $form->input('hidden', "datamanagerFilters[{$col}][value]", '', $inputOptions);
45 45
         }
46 46
         continue;
47
-      }
48
-      if (++$i && !($i % 2)) {
47
+        }
48
+        if (++$i && !($i % 2)) {
49 49
         echo '</div><div class="row">';
50
-      }
51
-      echo '<div class="col-md-6">';
52
-      if (!empty($colInfo['colParams']['type'])) {
50
+        }
51
+        echo '<div class="col-md-6">';
52
+        if (!empty($colInfo['colParams']['type'])) {
53 53
         switch ($colInfo['colParams']['type']) {
54
-          case'select':
54
+            case'select':
55 55
             switch ($colInfo['colParams']['source']) {
56
-              case 'array':
56
+                case 'array':
57 57
                 $values = ['' => 'Не важно'] + $colInfo['colParams']['sourceArray'];
58 58
                 break;
59
-              case 'method':
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']);
61
+                    $values = call_user_func_array([App::$cur->$colInfo['colParams']['module'], $colInfo['colParams']['method']], $colInfo['colParams']['params']);
62 62
                 } else {
63
-                  $values = ['' => 'Не важно'] + App::$cur->$colInfo['colParams']['module']->$colInfo['colParams']['method']();
63
+                    $values = ['' => 'Не важно'] + App::$cur->$colInfo['colParams']['module']->$colInfo['colParams']['method']();
64 64
                 }
65 65
                 break;
66
-              case 'model':
66
+                case 'model':
67 67
                 $values = ['' => 'Не важно'] + $colInfo['colParams']['model']::getList(['forSelect' => true]);
68 68
                 break;
69
-              case 'relation':
69
+                case 'relation':
70 70
                 $relations = $colInfo['modelName']::relations();
71 71
                 $filters = $relations[$colInfo['colParams']['relation']]['model']::managerFilters();
72 72
                 $cols = $relations[$colInfo['colParams']['relation']]['model']::cols();
@@ -74,16 +74,16 @@  discard block
 block discarded – undo
74 74
                     'where' => !empty($filters['getRows']['where']) ? $filters['getRows']['where'] : ''
75 75
                 ];
76 76
                 if (isset($cols[$relations[$colInfo['colParams']['relation']]['model']::colPrefix() . 'name'])) {
77
-                  $options['order'] = 'name';
77
+                    $options['order'] = 'name';
78 78
                 }
79 79
                 $items = $relations[$colInfo['colParams']['relation']]['model']::getList($options);
80 80
                 $values = ['' => 'Не задано'];
81 81
                 foreach ($items as $key => $item) {
82
-                  if (!empty($inputParams['showCol'])) {
82
+                    if (!empty($inputParams['showCol'])) {
83 83
                     $values[$key] = $item->$inputParams['showCol'];
84
-                  } else {
84
+                    } else {
85 85
                     $values[$key] = $item->name();
86
-                  }
86
+                    }
87 87
                 }
88 88
                 $values;
89 89
                 break;
@@ -92,26 +92,26 @@  discard block
 block discarded – undo
92 92
             $inputOptions = ['value' => $value, 'values' => $values, 'multiple' => true];
93 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'])) {
95
+                $inputOptions['disabled'] = true;
96
+                $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
97
+                if (!empty($colOptions['userCol'])) {
98 98
                 if (strpos($colOptions['userCol'], ':')) {
99
-                  $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
100
-                  $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
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;
102
+                    $inputOptions['value'] = \Users\User::$cur->$rel->$param;
103 103
                 } else {
104
-                  $this->model->$col = \Users\User::$cur->{$preset['userCol']};
104
+                    $this->model->$col = \Users\User::$cur->{$preset['userCol']};
105 105
                 }
106
-              } elseif (!empty($colOptions['value'])) {
106
+                } elseif (!empty($colOptions['value'])) {
107 107
 
108 108
                 $inputOptions['value'] = $colOptions['value'];
109
-              }
109
+                }
110 110
             }
111 111
             $inputOptions['class'] = 'input-sm';
112 112
             $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions);
113 113
             break;
114
-          case 'email':
114
+            case 'email':
115 115
           case 'text':
116 116
           case 'textarea':
117 117
           case 'html':
@@ -135,49 +135,49 @@  discard block
 block discarded – undo
135 135
             </div>
136 136
             <?php
137 137
             break;
138
-          case 'bool':
138
+            case 'bool':
139 139
             ?>
140 140
             <div class="filter_form_field filter_select">
141 141
               <?php
142
-              if (!empty($_GET['datamanagerFilters'][$col]['value'])) {
142
+                if (!empty($_GET['datamanagerFilters'][$col]['value'])) {
143 143
                 $value = 1;
144
-              } elseif (isset($_GET['datamanagerFilters'][$col]['value'])) {
144
+                } elseif (isset($_GET['datamanagerFilters'][$col]['value'])) {
145 145
                 $value = 0;
146
-              } else {
146
+                } else {
147 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])) {
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 157
                 $inputOptions['disabled'] = true;
158 158
                 $colOptions = $dataManager->managerOptions['userGroupFilter'][\Users\User::$cur->group_id]['getRows'][$col];
159 159
                 if (!empty($colOptions['userCol'])) {
160
-                  if (strpos($colOptions['userCol'], ':')) {
160
+                    if (strpos($colOptions['userCol'], ':')) {
161 161
                     $rel = substr($colOptions['userCol'], 0, strpos($colOptions['userCol'], ':'));
162 162
                     $param = substr($colOptions['userCol'], strpos($colOptions['userCol'], ':') + 1);
163 163
 
164 164
                     $inputOptions['value'] = \Users\User::$cur->$rel->$param;
165
-                  } else {
165
+                    } else {
166 166
                     $this->model->$col = \Users\User::$cur->{$preset['userCol']};
167
-                  }
167
+                    }
168 168
                 } elseif (!empty($colOptions['value'])) {
169 169
 
170
-                  $inputOptions['value'] = $colOptions['value'];
170
+                    $inputOptions['value'] = $colOptions['value'];
171 171
                 }
172
-              }
173
-              $inputOptions['class'] = 'input-sm';
174
-              $form->input('select', "datamanagerFilters[{$col}][value]", $colInfo['label'], $inputOptions);
175
-              ?>
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
179 179
             break;
180
-          case 'number':
180
+            case 'number':
181 181
             ?>
182 182
             <div class="form-group">
183 183
               <label><?= $colInfo['label']; ?></label>
@@ -192,7 +192,7 @@  discard block
 block discarded – undo
192 192
             </div>
193 193
             <?php
194 194
             break;
195
-          case 'dateTime':
195
+            case 'dateTime':
196 196
           case 'currentDateTime':
197 197
             ?>
198 198
             <div class="form-group">
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
             </div>
209 209
             <?php
210 210
             break;
211
-          case 'date':
211
+            case 'date':
212 212
             ?>
213 213
             <div class="form-group">
214 214
               <label><?= $colInfo['label']; ?></label>
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
             <?php
225 225
             break;
226 226
         }
227
-      }
228
-      echo '</div>';
227
+        }
228
+        echo '</div>';
229 229
     }
230 230
     ?>
231 231
   </div>
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if (!$dataManager->checkAccess()) {
3
-  echo 'you not have access to "' . $dataManager->modelName . '" manager with name: "' . $dataManager->managerName . '"';
3
+  echo 'you not have access to "'.$dataManager->modelName.'" manager with name: "'.$dataManager->managerName.'"';
4 4
   return false;
5 5
 }
6 6
 ?>
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
                 $options = [
74 74
                     'where' => !empty($filters['getRows']['where']) ? $filters['getRows']['where'] : ''
75 75
                 ];
76
-                if (isset($cols[$relations[$colInfo['colParams']['relation']]['model']::colPrefix() . 'name'])) {
76
+                if (isset($cols[$relations[$colInfo['colParams']['relation']]['model']::colPrefix().'name'])) {
77 77
                   $options['order'] = 'name';
78 78
                 }
79 79
                 $items = $relations[$colInfo['colParams']['relation']]['model']::getList($options);
Please login to merge, or discard this patch.
system/modules/Ui/appAdminControllers/content/dataManager/view.php 1 patch
Indentation   +28 added lines, -28 removed lines patch added patch discarded remove patch
@@ -5,32 +5,32 @@  discard block
 block discarded – undo
5 5
 $formParams = ['formName' => 'manager'];
6 6
 $aform = new \Ui\ActiveForm($item, $formParams['formName']);
7 7
 if ($aform->checkAccess()) {
8
-  $table->addButton([
9
-      'text' => 'Редактировать',
10
-      'onclick' => 'inji.Ui.forms.popUp("' . addcslashes($modelName, '\\') . ':' . $item->pk() . '",' . json_encode($formParams) . ');',
11
-  ]);
8
+    $table->addButton([
9
+        'text' => 'Редактировать',
10
+        'onclick' => 'inji.Ui.forms.popUp("' . addcslashes($modelName, '\\') . ':' . $item->pk() . '",' . json_encode($formParams) . ');',
11
+    ]);
12 12
 }
13 13
 $row = [];
14 14
 $cols = !empty($modelName::$views['manager']['cols']) ? $modelName::$views['manager']['cols'] : array_keys($modelName::$cols);
15 15
 foreach ($cols as $colName) {
16
-  $colInfo = $modelName::getColInfo($colName);
17
-  $type = !empty($colInfo['colParams']['type']) ? $colInfo['colParams']['type'] : 'string';
18
-  if ($type != 'dataManager') {
16
+    $colInfo = $modelName::getColInfo($colName);
17
+    $type = !empty($colInfo['colParams']['type']) ? $colInfo['colParams']['type'] : 'string';
18
+    if ($type != 'dataManager') {
19 19
     $table->addRow([
20 20
         !empty($modelName::$labels[$colName]) ? $modelName::$labels[$colName] : $colName,
21 21
         \Model::resloveTypeValue($item, $colName, true)
22 22
     ]);
23
-  }
23
+    }
24 24
 }
25 25
 $table->draw();
26 26
 $form = new \Ui\Form();
27 27
 $relations = $modelName::relations();
28 28
 foreach ($cols as $colName) {
29
-  $colInfo = $modelName::getColInfo($colName);
30
-  if ($colInfo['colParams']['type'] == 'dataManager') {
29
+    $colInfo = $modelName::getColInfo($colName);
30
+    if ($colInfo['colParams']['type'] == 'dataManager') {
31 31
     $dataManager = new \Ui\DataManager($relations[$colInfo['colParams']['relation']]['model']);
32 32
     $dataManager->draw(['relation' => $colInfo['colParams']['relation']], $item);
33
-  }
33
+    }
34 34
 }
35 35
 ?>
36 36
 <div>
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
     ]]);
42 42
     ?>)</h3>
43 43
   <?php
44
-  foreach (\Dashboard\Comment::getList([ 'where' => [
45
-          ['item_id', $item->id],
46
-          ['model', $modelName],
47
-      ], 'order' => ['date_create', 'desc']]) as $comment) {
44
+    foreach (\Dashboard\Comment::getList([ 'where' => [
45
+            ['item_id', $item->id],
46
+            ['model', $modelName],
47
+        ], 'order' => ['date_create', 'desc']]) as $comment) {
48 48
     ?>
49 49
     <div class="row">
50 50
       <div class="col-sm-3" style="max-width: 300px;">
@@ -56,24 +56,24 @@  discard block
 block discarded – undo
56 56
       </div>
57 57
     </div>
58 58
     <?php
59
-  }
60
-  ?>
59
+    }
60
+    ?>
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>
72 72
   <?php
73
-  $dataManager = new \Ui\DataManager('Dashboard\Activity');
74
-  $dataManager->draw(['filters' => [
75
-          'item_id' => ['max' => $item->id, 'min' => $item->id],
76
-          'model' => ['compareType' => 'equals', 'value' => $modelName]
77
-  ]]);
78
-  ?>
73
+    $dataManager = new \Ui\DataManager('Dashboard\Activity');
74
+    $dataManager->draw(['filters' => [
75
+            'item_id' => ['max' => $item->id, 'min' => $item->id],
76
+            'model' => ['compareType' => 'equals', 'value' => $modelName]
77
+    ]]);
78
+    ?>
79 79
 </div>
80 80
\ No newline at end of file
Please login to merge, or discard this patch.