@@ -131,7 +131,7 @@ |
||
131 | 131 | |
132 | 132 | $displayable = $field->output($value); |
133 | 133 | |
134 | - switch(true) { |
|
134 | + switch (true) { |
|
135 | 135 | case ($field instanceof \ORM_TextField): |
136 | 136 | $displayable = $W->RichText($displayable)->setRenderingOptions(BAB_HTML_ALL ^ BAB_HTML_P); |
137 | 137 | break; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | { |
43 | 43 | $this->modelView = $modelView; |
44 | 44 | $this->modelViewId = $modelView->getId(); |
45 | - if(! isset($id) || empty($id)){ |
|
45 | + if (!isset($id) || empty($id)) { |
|
46 | 46 | $id = $this->getDefaultEditorId(); |
47 | 47 | } |
48 | 48 | parent::__construct($app, $id, $layout); |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | ); |
95 | 95 | |
96 | 96 | $select = $W->Select(); |
97 | - foreach ($pagesLengths as $pagesLength){ |
|
97 | + foreach ($pagesLengths as $pagesLength) { |
|
98 | 98 | $select->addOption($pagesLength, $pagesLength); |
99 | 99 | } |
100 | - $select->setValue($W->getUserConfiguration($this->modelViewId . '/pageLength', 'widgets')); |
|
100 | + $select->setValue($W->getUserConfiguration($this->modelViewId.'/pageLength', 'widgets')); |
|
101 | 101 | |
102 | 102 | return $W->LabelledWidget($this->App() |
103 | 103 | ->translate('Number of lines per page'), $select, 'pageLength') |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $W = bab_Widgets(); |
110 | 110 | |
111 | 111 | $checkbox = $W->CheckBox(); |
112 | - $checkbox->setValue($W->getUserConfiguration($this->modelViewId . '/displaySubTotalRow', 'widgets')); |
|
112 | + $checkbox->setValue($W->getUserConfiguration($this->modelViewId.'/displaySubTotalRow', 'widgets')); |
|
113 | 113 | |
114 | 114 | return $W->LabelledWidget($this->App() |
115 | 115 | ->translate('Display subtotal rows'), $checkbox, 'displaySubTotalRow') |
@@ -139,12 +139,12 @@ discard block |
||
139 | 139 | ->setWrap(WidgetFlexLayout::FLEX_WRAP_WRAP))); |
140 | 140 | $col = 0; |
141 | 141 | |
142 | - foreach ($columns as $path => $column){ |
|
142 | + foreach ($columns as $path => $column) { |
|
143 | 143 | |
144 | - if(! $column->isInList()){ |
|
144 | + if (!$column->isInList()) { |
|
145 | 145 | continue; |
146 | 146 | } |
147 | - if($column->isSelectable() && $column->getSelectableName() != ''){ |
|
147 | + if ($column->isSelectable() && $column->getSelectableName() != '') { |
|
148 | 148 | $columnList->addItem($W->FlexItems($labelledWidget = $W->LabelledWidget($column->getSelectableName(), $W->CheckBox() |
149 | 149 | ->setValue($column->isVisible()), array( |
150 | 150 | 'columns', |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | ->addAttribute('style', 'flex-grow: 1; width: 33%;')); |
156 | 156 | $labelledWidget->getLabelWidget()->addClass('columnListElementLabel'); |
157 | 157 | } |
158 | - $col ++; |
|
158 | + $col++; |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | return $columnsBox; |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | $W = $this->widgets; |
174 | 174 | $App = $this->App(); |
175 | 175 | |
176 | - if(isset($this->saveAction)){ |
|
176 | + if (isset($this->saveAction)) { |
|
177 | 177 | $saveLabel = isset($this->saveLabel) ? $this->saveLabel : $App->translate('Save'); |
178 | 178 | $submitButton = $W->SubmitButton(); |
179 | 179 | $submitButton->validate() |
@@ -181,13 +181,13 @@ discard block |
||
181 | 181 | ->setFailedAction($this->failedAction) |
182 | 182 | ->setSuccessAction($this->successAction) |
183 | 183 | ->setLabel($saveLabel); |
184 | - if($this->isAjax){ |
|
184 | + if ($this->isAjax) { |
|
185 | 185 | $submitButton->setAjaxAction(); |
186 | 186 | } |
187 | 187 | $this->addButton($submitButton); |
188 | 188 | } |
189 | 189 | |
190 | - if(isset($this->resetAction)){ |
|
190 | + if (isset($this->resetAction)) { |
|
191 | 191 | $resetLabel = isset($this->resetLabel) ? $this->resetLabel : $App->translate('Reset default columns'); |
192 | 192 | $resetButton = $W->SubmitButton(); |
193 | 193 | $resetButton->validate() |
@@ -196,13 +196,13 @@ discard block |
||
196 | 196 | ->setSuccessAction($this->resetAction) |
197 | 197 | ->addClass('resetButton') |
198 | 198 | ->setLabel($resetLabel); |
199 | - if($this->isAjax){ |
|
199 | + if ($this->isAjax) { |
|
200 | 200 | $resetButton->setAjaxAction(); |
201 | 201 | } |
202 | 202 | $this->addButton($resetButton); |
203 | 203 | } |
204 | 204 | |
205 | - if(isset($this->cancelAction)){ |
|
205 | + if (isset($this->cancelAction)) { |
|
206 | 206 | $cancelLabel = isset($this->cancelLabel) ? $this->cancelLabel : $App->translate('Cancel'); |
207 | 207 | $this->addButton($W->SubmitButton() |
208 | 208 | ->addClass('widget-close-dialog') |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $row = $W->Items()->setSizePolicy('row'); |
277 | 277 | foreach ($customSections as $customSection) { |
278 | 278 | |
279 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
279 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
280 | 280 | |
281 | 281 | if ($currentColumn + $nbCol > 12) { |
282 | 282 | $this->addItem($row); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $parameters = $displayField['parameters']; |
304 | 304 | $classname = isset($parameters['classname']) ? $parameters['classname'] : ''; |
305 | 305 | $label = isset($parameters['label']) ? $parameters['label'] : ''; |
306 | - $displayFieldMethod = '_' . $displayFieldName; |
|
306 | + $displayFieldMethod = '_'.$displayFieldName; |
|
307 | 307 | |
308 | 308 | if (method_exists($this, $displayFieldMethod)) { |
309 | 309 | $value = $this->$displayFieldMethod($customSection, $label); |
@@ -96,14 +96,14 @@ |
||
96 | 96 | |
97 | 97 | $html = "<div class='chip'>"; |
98 | 98 | |
99 | - if(isset($this->labelIcon)){ |
|
99 | + if (isset($this->labelIcon)) { |
|
100 | 100 | $icon = $W->Label('')->setIconFormat(16, 'left')->setIcon($this->labelIcon); |
101 | 101 | $html .= $icon->display($W->HtmlCanvas()); |
102 | 102 | } |
103 | 103 | |
104 | 104 | $html .= $this->label; |
105 | 105 | |
106 | - if(isset($this->action)){ |
|
106 | + if (isset($this->action)) { |
|
107 | 107 | $icon = $W->Link('', $this->action)->setIconFormat(16, 'left')->setOpenMode(WidgetLink::OPEN_DIALOG_AND_RELOAD); |
108 | 108 | $icon->setIcon(isset($this->actionIcon) ? $this->actionIcon : \Func_Icons::ACTIONS_DIALOG_CANCEL); |
109 | 109 | $icon->addClass('chip-right-action'); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function getShapeHtml() |
30 | 30 | { |
31 | - $path = "M{$this->size} {$this->size} " . number_format($this->size / 2, 1) . ' ' . number_format($this->size / 6, 1) . " L0 {$this->size} Z"; |
|
31 | + $path = "M{$this->size} {$this->size} ".number_format($this->size / 2, 1).' '.number_format($this->size / 6, 1)." L0 {$this->size} Z"; |
|
32 | 32 | return "<svg height='{$this->size}' width='{$this->size}'> |
33 | 33 | <path d='{$path}' fill='{$this->color}'/> |
34 | 34 | </svg>"; |
@@ -47,22 +47,22 @@ discard block |
||
47 | 47 | $App = $this->App(); |
48 | 48 | $Ui = $App->Ui(); |
49 | 49 | |
50 | - if(strpos($name, $App->classPrefix) !== false){ |
|
50 | + if (strpos($name, $App->classPrefix) !== false) { |
|
51 | 51 | list(, $name) = explode($App->classPrefix, $name); |
52 | 52 | } |
53 | 53 | |
54 | - if(method_exists($Ui, $name)){ |
|
54 | + if (method_exists($Ui, $name)) { |
|
55 | 55 | return call_user_func_array(array($Ui, $name), $arguments); |
56 | 56 | } |
57 | 57 | |
58 | 58 | $components = $App->getComponents(); |
59 | - foreach ($components as $component){ |
|
60 | - try{ |
|
59 | + foreach ($components as $component) { |
|
60 | + try { |
|
61 | 61 | $componentUi = $component->ui(); |
62 | - if(isset($componentUi) && method_exists($componentUi, $name)){ |
|
62 | + if (isset($componentUi) && method_exists($componentUi, $name)) { |
|
63 | 63 | return call_user_func_array(array($componentUi, $name), $arguments); |
64 | 64 | } |
65 | - }catch(\Exception $e){} |
|
65 | + } catch (\Exception $e) {} |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $rc = new \ReflectionClass($this); |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | $page->addMessageInfo(); |
84 | 84 | |
85 | 85 | $addon = $App->getAddon(); |
86 | - if($addon){ |
|
86 | + if ($addon) { |
|
87 | 87 | $components = $App->getComponents(); |
88 | - foreach ($components as $component){ |
|
88 | + foreach ($components as $component) { |
|
89 | 89 | $stylePath = $component->getStylePath(); |
90 | - if($stylePath){ |
|
90 | + if ($stylePath) { |
|
91 | 91 | $page->addStyleSheet($stylePath.'style.css'); |
92 | 92 | } |
93 | 93 | } |
@@ -62,7 +62,7 @@ |
||
62 | 62 | if(isset($componentUi) && method_exists($componentUi, $name)){ |
63 | 63 | return call_user_func_array(array($componentUi, $name), $arguments); |
64 | 64 | } |
65 | - }catch(\Exception $e){} |
|
65 | + } catch(\Exception $e){} |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $rc = new \ReflectionClass($this); |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | |
37 | 37 | public function __construct($id = null, WidgetLayout $layout = null) |
38 | 38 | { |
39 | - if(! isset($layout)){ |
|
39 | + if (!isset($layout)) { |
|
40 | 40 | $W = bab_Widgets(); |
41 | 41 | $layout = $W->FlowLayout()->setHorizontalSpacing(1, 'em'); |
42 | 42 | $layout->setVerticalAlign('top'); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | { |
57 | 57 | $W = bab_Widgets(); |
58 | 58 | $button = $W->Link($labelText, $action, $id); |
59 | - if(isset($iconName)){ |
|
59 | + if (isset($iconName)) { |
|
60 | 60 | $button->addClass('icon', $iconName); |
61 | 61 | } |
62 | 62 | |
@@ -68,10 +68,10 @@ discard block |
||
68 | 68 | public function addInstantForm(WidgetDisplayableInterface $form, $labelText = null, $iconName = null, $action = null, $id = null) |
69 | 69 | { |
70 | 70 | $W = bab_Widgets(); |
71 | - if(isset($iconName)){ |
|
71 | + if (isset($iconName)) { |
|
72 | 72 | $content = $W->Icon($labelText, $iconName); |
73 | 73 | } |
74 | - else{ |
|
74 | + else { |
|
75 | 75 | $content = $labelText; |
76 | 76 | } |
77 | 77 | $button = $W->Link($content, $action, $id); |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | $this->addItem($W->VBoxItems($button->addClass('widget-instant-button'), $form->addClass('widget-instant-form')) |
80 | 80 | ->addClass('widget-instant-container')); |
81 | 81 | |
82 | - if($form->getTitle() === null){ |
|
82 | + if ($form->getTitle() === null) { |
|
83 | 83 | $form->setTitle($labelText); |
84 | 84 | } |
85 | 85 | |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | |
89 | 89 | public function display(WidgetCanvas $canvas) |
90 | 90 | { |
91 | - if(! $this->local){ |
|
91 | + if (!$this->local) { |
|
92 | 92 | $this->addClass('widget-toolbar'); |
93 | 93 | } |
94 | - else{ |
|
94 | + else { |
|
95 | 95 | $this->addClass('app-toolbar'); |
96 | 96 | } |
97 | 97 | $this->addClass(\Func_Icons::ICON_LEFT_16); |
@@ -70,8 +70,7 @@ discard block |
||
70 | 70 | $W = bab_Widgets(); |
71 | 71 | if(isset($iconName)){ |
72 | 72 | $content = $W->Icon($labelText, $iconName); |
73 | - } |
|
74 | - else{ |
|
73 | + } else{ |
|
75 | 74 | $content = $labelText; |
76 | 75 | } |
77 | 76 | $button = $W->Link($content, $action, $id); |
@@ -90,8 +89,7 @@ discard block |
||
90 | 89 | { |
91 | 90 | if(! $this->local){ |
92 | 91 | $this->addClass('widget-toolbar'); |
93 | - } |
|
94 | - else{ |
|
92 | + } else{ |
|
95 | 93 | $this->addClass('app-toolbar'); |
96 | 94 | } |
97 | 95 | $this->addClass(\Func_Icons::ICON_LEFT_16); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | continue; |
304 | 304 | } |
305 | 305 | |
306 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
306 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
307 | 307 | |
308 | 308 | if ($currentColumn + $nbCol > 12) { |
309 | 309 | $container->addItem($row); |
@@ -359,19 +359,19 @@ discard block |
||
359 | 359 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
360 | 360 | $sizePolicy .= isset($parameters['transparentBackground']) && $parameters['transparentBackground'] ? 'customsection-field-box-transparentBackground' : ''; |
361 | 361 | |
362 | - $displayFieldMethod = '_' . $displayFieldName; |
|
362 | + $displayFieldMethod = '_'.$displayFieldName; |
|
363 | 363 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
364 | 364 | $item = $this->$displayFieldMethod($customSection, $label); |
365 | 365 | } |
366 | 366 | else { |
367 | - if($isGroupField){ |
|
367 | + if ($isGroupField) { |
|
368 | 368 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
369 | 369 | if (method_exists($this, '__fieldsGroup')) { |
370 | 370 | $item = $this->__fieldsGroup($customSection, $groupId, $label); |
371 | 371 | } |
372 | 372 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
373 | 373 | } |
374 | - else{ |
|
374 | + else { |
|
375 | 375 | try { |
376 | 376 | $field = $this->recordSet->getField($displayFieldName); |
377 | 377 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | } |
400 | 400 | } |
401 | 401 | |
402 | - if ($currentColumn + $nbCol> 0) { |
|
402 | + if ($currentColumn + $nbCol > 0) { |
|
403 | 403 | $container->addItem($row); |
404 | 404 | } |
405 | 405 | } |
@@ -431,8 +431,8 @@ discard block |
||
431 | 431 | $groupField = $customSection->getField('_fieldsGroup'.$groupId); |
432 | 432 | $originalFieldsLayout = $customSection->fieldsLayout; |
433 | 433 | $customSection->fieldsLayout = AppCustomSection::FIELDS_LAYOUT_VERTICAL_LABEL; |
434 | - if(isset($groupField['fields'])){ |
|
435 | - foreach ($groupField['fields'] as $field){ |
|
434 | + if (isset($groupField['fields'])) { |
|
435 | + foreach ($groupField['fields'] as $field) { |
|
436 | 436 | $item = null; |
437 | 437 | $parameters = $field['parameters']; |
438 | 438 | $labelField = isset($parameters['label']) ? $parameters['label'] : ''; |
@@ -442,11 +442,11 @@ discard block |
||
442 | 442 | |
443 | 443 | $displayFieldName = $field['fieldname']; |
444 | 444 | |
445 | - $displayFieldMethod = '_' . $displayFieldName; |
|
445 | + $displayFieldMethod = '_'.$displayFieldName; |
|
446 | 446 | if (method_exists($this, $displayFieldMethod)) { |
447 | 447 | $item = $this->$displayFieldMethod($customSection, $labelField); |
448 | 448 | } |
449 | - else{ |
|
449 | + else { |
|
450 | 450 | try { |
451 | 451 | $field = $this->recordSet->getField($displayFieldName); |
452 | 452 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | $item = null; |
463 | 463 | } |
464 | 464 | } |
465 | - if(isset($item)){ |
|
465 | + if (isset($item)) { |
|
466 | 466 | $item->addClass('app-customsection-groupedfield'); |
467 | 467 | $item->addClass($itemClass); |
468 | 468 | } |
@@ -362,16 +362,14 @@ discard block |
||
362 | 362 | $displayFieldMethod = '_' . $displayFieldName; |
363 | 363 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
364 | 364 | $item = $this->$displayFieldMethod($customSection, $label); |
365 | - } |
|
366 | - else { |
|
365 | + } else { |
|
367 | 366 | if($isGroupField){ |
368 | 367 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
369 | 368 | if (method_exists($this, '__fieldsGroup')) { |
370 | 369 | $item = $this->__fieldsGroup($customSection, $groupId, $label); |
371 | 370 | } |
372 | 371 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
373 | - } |
|
374 | - else{ |
|
372 | + } else{ |
|
375 | 373 | try { |
376 | 374 | $field = $this->recordSet->getField($displayFieldName); |
377 | 375 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -445,8 +443,7 @@ discard block |
||
445 | 443 | $displayFieldMethod = '_' . $displayFieldName; |
446 | 444 | if (method_exists($this, $displayFieldMethod)) { |
447 | 445 | $item = $this->$displayFieldMethod($customSection, $labelField); |
448 | - } |
|
449 | - else{ |
|
446 | + } else{ |
|
450 | 447 | try { |
451 | 448 | $field = $this->recordSet->getField($displayFieldName); |
452 | 449 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $this->tableview = $tableview; |
44 | 44 | |
45 | - if(isset($filter)){ |
|
45 | + if (isset($filter)) { |
|
46 | 46 | $this->setHiddenValues('filter', $filter); |
47 | 47 | } |
48 | 48 | $this->setHiddenValue('tg', $App->controllerTg); |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | |
110 | 110 | $columns = $this->tableview->getVisibleColumns(); |
111 | 111 | |
112 | - foreach ($columns as $path => $column){ |
|
113 | - if(! $column->isExportable()){ |
|
112 | + foreach ($columns as $path => $column) { |
|
113 | + if (!$column->isExportable()) { |
|
114 | 114 | continue; |
115 | 115 | } |
116 | 116 | $columnList->addItem($W->FlexItems($W->LabelledWidget($column->getSelectableName(), $checkbox = $W->CheckBox() |