@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | $this->editDialogClass() |
61 | 61 | ); |
62 | 62 | |
63 | - if(isset($this->record->id)){ |
|
63 | + if (isset($this->record->id)) { |
|
64 | 64 | $box->addItem( |
65 | 65 | $W->Hidden(null, 'id', $this->record->id) |
66 | 66 | ); |
@@ -102,9 +102,9 @@ discard block |
||
102 | 102 | |
103 | 103 | $options = array(); |
104 | 104 | $rank = 1; |
105 | - foreach ($containers as $container){ |
|
105 | + foreach ($containers as $container) { |
|
106 | 106 | $options[$container->id] = sprintf('%d (%s)', $rank, $container->name); |
107 | - $rank ++; |
|
107 | + $rank++; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | $containerSections = $customSectionSet->select( |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | )->orderDesc($customSectionSet->rank); |
113 | 113 | |
114 | 114 | $nbSections = 0; |
115 | - foreach ($containerSections as $containerSection){ |
|
115 | + foreach ($containerSections as $containerSection) { |
|
116 | 116 | $nbSections = $containerSection->rank + 1; |
117 | 117 | break; |
118 | 118 | } |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | $extraLargeDeviceClassnames = array(); //XL |
144 | 144 | $extraExtraLargeDeviceClassnames = array(); //XXL |
145 | 145 | |
146 | - for($i = 1; $i <= 12; $i++){ |
|
146 | + for ($i = 1; $i <= 12; $i++) { |
|
147 | 147 | $extraSmallDeviceClassnames['col-xs-'.$i] = $i; |
148 | 148 | $smallDeviceClassnames['col-sm-'.$i] = $i; |
149 | 149 | $mediumDeviceClassnames['col-md-'.$i] = $i; |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | ) |
182 | 182 | ); |
183 | 183 | |
184 | - foreach($sizes as $sizePrefix => $size){ |
|
184 | + foreach ($sizes as $sizePrefix => $size) { |
|
185 | 185 | $box->addItem( |
186 | 186 | $this->labelledField( |
187 | 187 | sprintf('%s (%s)', $size['label'], 'col-'.$sizePrefix.'-*'), |
@@ -106,20 +106,20 @@ |
||
106 | 106 | $html = "<div class='chip'"; |
107 | 107 | |
108 | 108 | $attributes = $this->getAttributes(); |
109 | - foreach($attributes as $attributeName => $attributeValue){ |
|
109 | + foreach ($attributes as $attributeName => $attributeValue) { |
|
110 | 110 | $html .= ' '.$attributeName.'="'.$attributeValue.'"'; |
111 | 111 | } |
112 | 112 | |
113 | 113 | $html .= '>'; |
114 | 114 | |
115 | - if(isset($this->labelIcon)){ |
|
115 | + if (isset($this->labelIcon)) { |
|
116 | 116 | $icon = $W->Label('')->setIconFormat(16, 'left')->setIcon($this->labelIcon); |
117 | 117 | $html .= $icon->display($W->HtmlCanvas()); |
118 | 118 | } |
119 | 119 | |
120 | 120 | $html .= $this->label; |
121 | 121 | |
122 | - if(isset($this->action)){ |
|
122 | + if (isset($this->action)) { |
|
123 | 123 | $icon = $W->Link('', $this->action)->setIconFormat(16, 'left')->setOpenMode(WidgetLink::OPEN_DIALOG_AND_RELOAD); |
124 | 124 | $icon->setIcon(isset($this->actionIcon) ? $this->actionIcon : FuncIcons::ACTIONS_DIALOG_CANCEL); |
125 | 125 | $icon->addClass('chip-right-action'); |
@@ -122,9 +122,9 @@ discard block |
||
122 | 122 | |
123 | 123 | $filterValues = $this->getFilterValues(); |
124 | 124 | |
125 | - foreach ($this->visibleColumns as $columnPath => $column){ |
|
125 | + foreach ($this->visibleColumns as $columnPath => $column) { |
|
126 | 126 | |
127 | - if(! isset($this->columnsDescriptions[$columnPath])){ |
|
127 | + if (!isset($this->columnsDescriptions[$columnPath])) { |
|
128 | 128 | $this->columnsDescriptions[$columnPath] = $column->getDescription(); |
129 | 129 | } |
130 | 130 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | $sizePolicy = 'widget-actions-target'; |
138 | 138 | |
139 | - if($this->isMultiSelect() && $columnPath === '_select_'){ |
|
139 | + if ($this->isMultiSelect() && $columnPath === '_select_') { |
|
140 | 140 | $columnItem = $this->computeMultiSelectHeaderColumn(); |
141 | 141 | $isSearchable = false; |
142 | 142 | $isSortable = false; |
@@ -146,28 +146,28 @@ discard block |
||
146 | 146 | |
147 | 147 | } |
148 | 148 | |
149 | - if($this->sortField === $columnPath && $this->sortAscending){ |
|
149 | + if ($this->sortField === $columnPath && $this->sortAscending) { |
|
150 | 150 | $direction = ':down'; |
151 | 151 | } |
152 | - else{ |
|
152 | + else { |
|
153 | 153 | $direction = ':up'; |
154 | 154 | } |
155 | 155 | |
156 | - $url = BabUrl::mod($this->sortBaseUrl, $this->sortParameterName, $columnPath . $direction); |
|
156 | + $url = BabUrl::mod($this->sortBaseUrl, $this->sortParameterName, $columnPath.$direction); |
|
157 | 157 | if ($anchor = $this->getAnchor()) { |
158 | - $url .= '#' . urlencode($anchor); |
|
158 | + $url .= '#'.urlencode($anchor); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | $columnItem = $W->Link($W->FlexItems($W->Label($columnLabel), $W->Items() |
162 | 162 | ->addClass('widget-table-column-sorting-icons')) |
163 | 163 | ->setAlignItems(WidgetFlexLayout::FLEX_ALIGN_CONTENT_CENTER), $url) |
164 | 164 | ->addClass('widget-table-column-sorting-action'); |
165 | - if($this->sortAjaxAction){ |
|
166 | - $columnItem->setAjaxAction($this->sortAjaxAction->setParameter('sort', $columnPath . $direction), ''); |
|
165 | + if ($this->sortAjaxAction) { |
|
166 | + $columnItem->setAjaxAction($this->sortAjaxAction->setParameter('sort', $columnPath.$direction), ''); |
|
167 | 167 | } |
168 | 168 | $columnItem = $W->FlexItems($columnItem); |
169 | 169 | } |
170 | - else{ |
|
170 | + else { |
|
171 | 171 | $columnItem = $W->FlexItems($W->Label($columnLabel), $W->Label('')); |
172 | 172 | } |
173 | 173 | |
@@ -179,11 +179,11 @@ discard block |
||
179 | 179 | |
180 | 180 | } |
181 | 181 | |
182 | - if($isSortable){ |
|
182 | + if ($isSortable) { |
|
183 | 183 | $sizePolicy .= ' widget-table-column-sortable'; |
184 | 184 | } |
185 | - if($isSearchable){ |
|
186 | - if(! isset($this->filterBaseUrl)){ |
|
185 | + if ($isSearchable) { |
|
186 | + if (!isset($this->filterBaseUrl)) { |
|
187 | 187 | $this->filterBaseUrl = $this->getRecordControllerProxy()->displayListFilter(); |
188 | 188 | } |
189 | 189 | $url = $this->filterBaseUrl; |
@@ -195,14 +195,14 @@ discard block |
||
195 | 195 | ->setDialogClass('box blue') |
196 | 196 | ->setDialogPositionRelativeToLink(true), 0); |
197 | 197 | $sizePolicy .= ' widget-table-column-searchable'; |
198 | - if(isset($filterValues[$columnPath]) && ! empty($filterValues[$columnPath])){ |
|
198 | + if (isset($filterValues[$columnPath]) && !empty($filterValues[$columnPath])) { |
|
199 | 199 | $sizePolicy .= ' widget-table-column-searched'; |
200 | 200 | } |
201 | 201 | } |
202 | 202 | $items = $W->Items()->setSizePolicy($sizePolicy); |
203 | 203 | $items->addItem($columnItem); |
204 | 204 | |
205 | - $this->addItem($items, 0, $col ++); |
|
205 | + $this->addItem($items, 0, $col++); |
|
206 | 206 | } |
207 | 207 | } |
208 | 208 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $this->toggleCheckAllBox->setTitle(widget_translate('Select all on page')); |
215 | 215 | $this->toggleCheckAllBox->setSizePolicy('condensed'); |
216 | 216 | $this->toggleCheckAllBox->setCheckedValue(true); |
217 | - if(isset($_SESSION['toggleCheckAllBox'][$this->getId()]) && ! empty($_SESSION['toggleCheckAllBox'][$this->getId()]) && $_SESSION['toggleCheckAllBox'][$this->getId()] == 'on'){ |
|
217 | + if (isset($_SESSION['toggleCheckAllBox'][$this->getId()]) && !empty($_SESSION['toggleCheckAllBox'][$this->getId()]) && $_SESSION['toggleCheckAllBox'][$this->getId()] == 'on') { |
|
218 | 218 | $this->toggleCheckAllBox->setValue(true); |
219 | 219 | } |
220 | 220 | return $W->FlexItems($this->toggleCheckAllBox); |
@@ -222,14 +222,14 @@ discard block |
||
222 | 222 | |
223 | 223 | protected function initRow($record, $row) |
224 | 224 | { |
225 | - if($this->highlightRows == null){ |
|
225 | + if ($this->highlightRows == null) { |
|
226 | 226 | $this->highlightRows = $this->getHighlightedRows(); |
227 | 227 | } |
228 | 228 | |
229 | - if($this->highlightRows == null){ |
|
230 | - return parent::initRow($record,$row); |
|
229 | + if ($this->highlightRows == null) { |
|
230 | + return parent::initRow($record, $row); |
|
231 | 231 | } |
232 | - if(in_array($record->id,$this->highlightRows)){ |
|
232 | + if (in_array($record->id, $this->highlightRows)) { |
|
233 | 233 | $this->addRowClass($row, "app_highlightRow"); |
234 | 234 | } |
235 | 235 | $this->addRowClass($row, "app_highlightAvailable"); |
@@ -255,12 +255,12 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public function App() |
257 | 257 | { |
258 | - if(! isset($this->app)){ |
|
258 | + if (!isset($this->app)) { |
|
259 | 259 | // If the app object was not specified (through the setApp() method) |
260 | 260 | // we try to select one according to the classname prefix. |
261 | 261 | list ($prefix) = explode('_', get_class($this)); |
262 | 262 | $functionalityName = ucwords($prefix); |
263 | - $this->app = BabFunctionality::get('App/' . $functionalityName); |
|
263 | + $this->app = BabFunctionality::get('App/'.$functionalityName); |
|
264 | 264 | if (!$this->app) { |
265 | 265 | $this->app = BabFunctionality::get('App'); |
266 | 266 | } |
@@ -272,7 +272,7 @@ discard block |
||
272 | 272 | { |
273 | 273 | $customFields = $recordSet->getCustomFields(); |
274 | 274 | |
275 | - foreach ($customFields as $customField){ |
|
275 | + foreach ($customFields as $customField) { |
|
276 | 276 | $fieldname = $customField->fieldname; |
277 | 277 | $this->addColumn(app_TableModelViewColumn($recordSet->$fieldname, $customField->name)->setSortable(true) |
278 | 278 | ->setExportable(true) |
@@ -299,39 +299,39 @@ discard block |
||
299 | 299 | |
300 | 300 | $filterPanel = $W->Filter(); |
301 | 301 | $filterPanel->setLayout($W->VBoxLayout()); |
302 | - if(isset($name)){ |
|
302 | + if (isset($name)) { |
|
303 | 303 | $filterPanel->setName($name); |
304 | 304 | } |
305 | 305 | |
306 | 306 | $pageLength = $this->getPageLength(); |
307 | - if(null === $pageLength){ |
|
307 | + if (null === $pageLength) { |
|
308 | 308 | $pageLength = 15; |
309 | 309 | } |
310 | 310 | |
311 | 311 | $pageNumber = $this->getCurrentPage(); |
312 | - if(null === $pageNumber){ |
|
312 | + if (null === $pageNumber) { |
|
313 | 313 | $pageNumber = 0; |
314 | 314 | } |
315 | 315 | |
316 | 316 | $this->setPageLength(isset($filter['pageSize']) ? $filter['pageSize'] : $pageLength); |
317 | 317 | $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber); |
318 | 318 | |
319 | - if(isset($name)){ |
|
320 | - $this->sortParameterName = $name . '[filter][sort]'; |
|
319 | + if (isset($name)) { |
|
320 | + $this->sortParameterName = $name.'[filter][sort]'; |
|
321 | 321 | } |
322 | - else{ |
|
322 | + else { |
|
323 | 323 | $this->sortParameterName = 'filter[sort]'; |
324 | 324 | } |
325 | 325 | |
326 | - if(isset($filter['sort'])){ |
|
326 | + if (isset($filter['sort'])) { |
|
327 | 327 | $this->setSortField($filter['sort']); |
328 | 328 | } |
329 | - elseif(! isset($this->sortField)){ |
|
329 | + elseif (!isset($this->sortField)) { |
|
330 | 330 | |
331 | - if(method_exists($this, 'getDefaultSortField')){ |
|
331 | + if (method_exists($this, 'getDefaultSortField')) { |
|
332 | 332 | $this->setSortField($this->getDefaultSortField()); |
333 | 333 | } |
334 | - else{ |
|
334 | + else { |
|
335 | 335 | $columns = $this->getVisibleColumns(); |
336 | 336 | $sortField = key($columns); |
337 | 337 | $this->setSortField($sortField); |
@@ -340,14 +340,14 @@ discard block |
||
340 | 340 | |
341 | 341 | $form = $this->getFilterForm(); |
342 | 342 | |
343 | - if(isset($filter)){ |
|
344 | - if(isset($name)){ |
|
343 | + if (isset($filter)) { |
|
344 | + if (isset($name)) { |
|
345 | 345 | $path = array( |
346 | 346 | $name, |
347 | 347 | 'filter' |
348 | 348 | ); |
349 | 349 | } |
350 | - else{ |
|
350 | + else { |
|
351 | 351 | $path = array( |
352 | 352 | 'filter' |
353 | 353 | ); |
@@ -373,19 +373,19 @@ discard block |
||
373 | 373 | |
374 | 374 | protected function isFilterFieldSpecified($filter, $fieldPath) |
375 | 375 | { |
376 | - if(isset($filter[$fieldPath])){ |
|
376 | + if (isset($filter[$fieldPath])) { |
|
377 | 377 | $value = $filter[$fieldPath]; |
378 | - if(is_array($value)){ |
|
379 | - foreach ($value as $val){ |
|
378 | + if (is_array($value)) { |
|
379 | + foreach ($value as $val) { |
|
380 | 380 | $val = trim($val); |
381 | - if(! empty($val)){ |
|
381 | + if (!empty($val)) { |
|
382 | 382 | return true; |
383 | 383 | } |
384 | 384 | } |
385 | 385 | return false; |
386 | 386 | } |
387 | 387 | |
388 | - if(trim($value) !== ''){ |
|
388 | + if (trim($value) !== '') { |
|
389 | 389 | return true; |
390 | 390 | } |
391 | 391 | } |
@@ -395,23 +395,23 @@ discard block |
||
395 | 395 | |
396 | 396 | protected function handleFilterInputWidget($name, ORMField $field = null) |
397 | 397 | { |
398 | - if(null === $field){ |
|
398 | + if (null === $field) { |
|
399 | 399 | return null; |
400 | 400 | } |
401 | 401 | |
402 | 402 | $W = bab_Widgets(); |
403 | 403 | |
404 | - if($field instanceof ORMFkField){ |
|
404 | + if ($field instanceof ORMFkField) { |
|
405 | 405 | $App = $this->App(); |
406 | 406 | $setName = $field->getForeignSetName(); |
407 | 407 | $pos = strrpos($setName, '\\'); |
408 | - if($pos === false){ |
|
408 | + if ($pos === false) { |
|
409 | 409 | |
410 | 410 | // micheal bay |
411 | 411 | $explosion = explode('_', $setName); |
412 | - $appSetName = $explosion[count($explosion)-1]; |
|
412 | + $appSetName = $explosion[count($explosion) - 1]; |
|
413 | 413 | } |
414 | - else{ |
|
414 | + else { |
|
415 | 415 | list (, $appSetName) = array( |
416 | 416 | substr($setName, 0, $pos), |
417 | 417 | substr($setName, $pos + 1) |
@@ -421,18 +421,18 @@ discard block |
||
421 | 421 | $set->setName($field->getName()); |
422 | 422 | $set->setDescription($field->getDescription()); |
423 | 423 | |
424 | - if($set === null){ |
|
424 | + if ($set === null) { |
|
425 | 425 | return null; |
426 | 426 | } |
427 | 427 | |
428 | 428 | $values = $set->select(); |
429 | - if($values->count()>15){ |
|
429 | + if ($values->count() > 15) { |
|
430 | 430 | $widget = bab_Widgets()->select2(); |
431 | 431 | $widget->setDataSource($set->getController()->search()); |
432 | - }else{ |
|
432 | + } else { |
|
433 | 433 | $widget = $W->Select(); |
434 | 434 | $widget->addOption('', ''); |
435 | - foreach ($values as $record){ |
|
435 | + foreach ($values as $record) { |
|
436 | 436 | $widget->addOption($record->id, (string) $record->name); |
437 | 437 | } |
438 | 438 | |
@@ -522,7 +522,7 @@ discard block |
||
522 | 522 | $displayAdvancedForm = $this->isAdvancedFormDisplayed(); |
523 | 523 | $advancedFiltersFrame = $W->VBoxItems($addFilterButton)->addClass('widget-instant-container'); |
524 | 524 | |
525 | - if($displayAdvancedForm){ |
|
525 | + if ($displayAdvancedForm) { |
|
526 | 526 | $filterBox = $W->FlowLayout() |
527 | 527 | ->addClass('widget-instant-form') |
528 | 528 | ->setHorizontalSpacing(2, 'em') |
@@ -533,18 +533,18 @@ discard block |
||
533 | 533 | |
534 | 534 | $columns = $this->getVisibleColumns(); |
535 | 535 | |
536 | - foreach ($columns as $fieldName => $column){ |
|
536 | + foreach ($columns as $fieldName => $column) { |
|
537 | 537 | $field = $column->getField(); |
538 | - if(! $column->isSearchable()){ |
|
538 | + if (!$column->isSearchable()) { |
|
539 | 539 | continue; |
540 | 540 | } |
541 | 541 | |
542 | - if(! ($field instanceof ORMField)){ |
|
542 | + if (!($field instanceof ORMField)) { |
|
543 | 543 | $field = null; |
544 | 544 | } |
545 | 545 | |
546 | 546 | $mainSearch = (method_exists($column, 'isMainSearch') && $column->isMainSearch()); |
547 | - if($mainSearch || $this->isFilterFieldSpecified($filter, $column->getFieldPath())){ |
|
547 | + if ($mainSearch || $this->isFilterFieldSpecified($filter, $column->getFieldPath())) { |
|
548 | 548 | $removeColumnsAction = $W->Action(); |
549 | 549 | $removeColumnsAction->setMethod('addon/widgets/configurationstorage', 'removeFilter', array( |
550 | 550 | 'key' => $this->getId(), |
@@ -559,19 +559,19 @@ discard block |
||
559 | 559 | ->addAttribute('data-removefor', $column->getFieldPath())) |
560 | 560 | ->setAlignItems(WidgetFlexLayout::FLEX_ALIGN_ITEMS_FLEX_END)); |
561 | 561 | } |
562 | - elseif($displayAdvancedForm){ |
|
562 | + elseif ($displayAdvancedForm) { |
|
563 | 563 | $formItem = $this->getFormItem($fieldName, $field); |
564 | 564 | $formItem->setSizePolicy('col-lg-2 col-md-3 col-sm-6 col-xs-12'); |
565 | 565 | $filterBox->addItem($formItem); |
566 | 566 | } |
567 | 567 | } |
568 | 568 | |
569 | - if(! $this->submit){ |
|
569 | + if (!$this->submit) { |
|
570 | 570 | $this->submit = $W->SubmitButton(); |
571 | 571 | $this->submit->setLabel(Widget_translate('Apply filter')); |
572 | 572 | } |
573 | 573 | |
574 | - if($controller = $this->getRecordController()){ |
|
574 | + if ($controller = $this->getRecordController()) { |
|
575 | 575 | $proxy = $controller->proxy(); |
576 | 576 | $this->reset = $W->Link($App->translate('Reset'), $proxy->resetFilters()) |
577 | 577 | ->addClass('icon', FuncIcons::ACTIONS_VIEW_REFRESH, 'widget-actionbutton') |
@@ -593,14 +593,14 @@ discard block |
||
593 | 593 | $this->filterMenu->addClass(FuncIcons::ICON_LEFT_16); |
594 | 594 | |
595 | 595 | $filterNames = $controller->getFilterNames(); |
596 | - if(count($filterNames) > 0){ |
|
596 | + if (count($filterNames) > 0) { |
|
597 | 597 | // $this->select = $W->Menu(null, $W->VBoxItems()); |
598 | 598 | // $this->select->setButtonClass('widget-link icon actions-list-filter'); |
599 | 599 | // $this->select->setButtonLabel($App->translate('Saved filters')); |
600 | 600 | // $this->select->addClass(FuncIcons::ICON_LEFT_16); |
601 | 601 | |
602 | - foreach ($filterNames as $filterName){ |
|
603 | - $filter = $W->getUserConfiguration($controller->getModelViewDefaultId() . '/filters/' . $filterName, 'widgets', false); |
|
602 | + foreach ($filterNames as $filterName) { |
|
603 | + $filter = $W->getUserConfiguration($controller->getModelViewDefaultId().'/filters/'.$filterName, 'widgets', false); |
|
604 | 604 | |
605 | 605 | // $this->select->addItem( |
606 | 606 | // $W->Link( |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | { |
661 | 661 | $label = $this->handleFilterLabelWidget($fieldName, $field); |
662 | 662 | $input = $this->handleFilterInputWidget($fieldName, $field); |
663 | - if($input == null){ |
|
663 | + if ($input == null) { |
|
664 | 664 | return bab_Widgets()->items(); |
665 | 665 | } |
666 | 666 | $input->setName($fieldName); |
@@ -669,7 +669,7 @@ discard block |
||
669 | 669 | $input->addClass('widget-100pc'); |
670 | 670 | |
671 | 671 | $formItem = $this->handleFilterLabel($label, $input); |
672 | - $formItem->addClass('compact', 'field_' . $fieldName); |
|
672 | + $formItem->addClass('compact', 'field_'.$fieldName); |
|
673 | 673 | |
674 | 674 | return $formItem; |
675 | 675 | } |
@@ -692,39 +692,39 @@ discard block |
||
692 | 692 | |
693 | 693 | $filterPanel = $W->Filter(); |
694 | 694 | $filterPanel->setLayout($W->VBoxLayout()); |
695 | - if(isset($name)){ |
|
695 | + if (isset($name)) { |
|
696 | 696 | $filterPanel->setName($name); |
697 | 697 | } |
698 | 698 | |
699 | 699 | $pageLength = $this->getPageLength(); |
700 | - if(null === $pageLength){ |
|
700 | + if (null === $pageLength) { |
|
701 | 701 | $pageLength = 15; |
702 | 702 | } |
703 | 703 | |
704 | 704 | $pageNumber = $this->getCurrentPage(); |
705 | - if(null === $pageNumber){ |
|
705 | + if (null === $pageNumber) { |
|
706 | 706 | $pageNumber = 0; |
707 | 707 | } |
708 | 708 | |
709 | 709 | $this->setPageLength(isset($filter['pageSize']) ? $filter['pageSize'] : $pageLength); |
710 | 710 | // $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber); |
711 | 711 | |
712 | - if(isset($name)){ |
|
713 | - $this->sortParameterName = $name . '[filter][sort]'; |
|
712 | + if (isset($name)) { |
|
713 | + $this->sortParameterName = $name.'[filter][sort]'; |
|
714 | 714 | } |
715 | - else{ |
|
715 | + else { |
|
716 | 716 | $this->sortParameterName = 'filter[sort]'; |
717 | 717 | } |
718 | 718 | |
719 | - if(isset($filter['sort'])){ |
|
719 | + if (isset($filter['sort'])) { |
|
720 | 720 | $this->setSortField($filter['sort']); |
721 | 721 | } |
722 | - elseif(! isset($this->sortField)){ |
|
722 | + elseif (!isset($this->sortField)) { |
|
723 | 723 | |
724 | - if(method_exists($this, 'getDefaultSortField')){ |
|
724 | + if (method_exists($this, 'getDefaultSortField')) { |
|
725 | 725 | $this->setSortField($this->getDefaultSortField()); |
726 | 726 | } |
727 | - else{ |
|
727 | + else { |
|
728 | 728 | $columns = $this->getVisibleColumns(); |
729 | 729 | $sortField = key($columns); |
730 | 730 | $this->setSortField($sortField); |
@@ -733,14 +733,14 @@ discard block |
||
733 | 733 | |
734 | 734 | $form = $this->getAdvancedFilterForm(null, $filter); |
735 | 735 | |
736 | - if(isset($filter)){ |
|
737 | - if(isset($name)){ |
|
736 | + if (isset($filter)) { |
|
737 | + if (isset($name)) { |
|
738 | 738 | $path = array( |
739 | 739 | $name, |
740 | 740 | 'filter' |
741 | 741 | ); |
742 | 742 | } |
743 | - else{ |
|
743 | + else { |
|
744 | 744 | $path = array( |
745 | 745 | 'filter' |
746 | 746 | ); |
@@ -777,7 +777,7 @@ discard block |
||
777 | 777 | */ |
778 | 778 | public function getRecordControllerProxy() |
779 | 779 | { |
780 | - if(! isset($this->recordControllerProxy)){ |
|
780 | + if (!isset($this->recordControllerProxy)) { |
|
781 | 781 | $this->recordControllerProxy = $this->getRecordController()->proxy(); |
782 | 782 | } |
783 | 783 | return $this->recordControllerProxy; |
@@ -792,11 +792,11 @@ discard block |
||
792 | 792 | */ |
793 | 793 | function app_TableModelViewColumn($field, $description = null) |
794 | 794 | { |
795 | - if(null === $field){ |
|
795 | + if (null === $field) { |
|
796 | 796 | return null; |
797 | 797 | } |
798 | 798 | |
799 | - if(! isset($description) && $field instanceof ORMField){ |
|
799 | + if (!isset($description) && $field instanceof ORMField) { |
|
800 | 800 | $App = $field->getParentSet()->App(); |
801 | 801 | $description = $App->translate($field->getDescription()); |
802 | 802 | } |
@@ -148,8 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | if($this->sortField === $columnPath && $this->sortAscending){ |
150 | 150 | $direction = ':down'; |
151 | - } |
|
152 | - else{ |
|
151 | + } else{ |
|
153 | 152 | $direction = ':up'; |
154 | 153 | } |
155 | 154 | |
@@ -166,8 +165,7 @@ discard block |
||
166 | 165 | $columnItem->setAjaxAction($this->sortAjaxAction->setParameter('sort', $columnPath . $direction), ''); |
167 | 166 | } |
168 | 167 | $columnItem = $W->FlexItems($columnItem); |
169 | - } |
|
170 | - else{ |
|
168 | + } else{ |
|
171 | 169 | $columnItem = $W->FlexItems($W->Label($columnLabel), $W->Label('')); |
172 | 170 | } |
173 | 171 | |
@@ -318,20 +316,17 @@ discard block |
||
318 | 316 | |
319 | 317 | if(isset($name)){ |
320 | 318 | $this->sortParameterName = $name . '[filter][sort]'; |
321 | - } |
|
322 | - else{ |
|
319 | + } else{ |
|
323 | 320 | $this->sortParameterName = 'filter[sort]'; |
324 | 321 | } |
325 | 322 | |
326 | 323 | if(isset($filter['sort'])){ |
327 | 324 | $this->setSortField($filter['sort']); |
328 | - } |
|
329 | - elseif(! isset($this->sortField)){ |
|
325 | + } elseif(! isset($this->sortField)){ |
|
330 | 326 | |
331 | 327 | if(method_exists($this, 'getDefaultSortField')){ |
332 | 328 | $this->setSortField($this->getDefaultSortField()); |
333 | - } |
|
334 | - else{ |
|
329 | + } else{ |
|
335 | 330 | $columns = $this->getVisibleColumns(); |
336 | 331 | $sortField = key($columns); |
337 | 332 | $this->setSortField($sortField); |
@@ -346,8 +341,7 @@ discard block |
||
346 | 341 | $name, |
347 | 342 | 'filter' |
348 | 343 | ); |
349 | - } |
|
350 | - else{ |
|
344 | + } else{ |
|
351 | 345 | $path = array( |
352 | 346 | 'filter' |
353 | 347 | ); |
@@ -410,8 +404,7 @@ discard block |
||
410 | 404 | // micheal bay |
411 | 405 | $explosion = explode('_', $setName); |
412 | 406 | $appSetName = $explosion[count($explosion)-1]; |
413 | - } |
|
414 | - else{ |
|
407 | + } else{ |
|
415 | 408 | list (, $appSetName) = array( |
416 | 409 | substr($setName, 0, $pos), |
417 | 410 | substr($setName, $pos + 1) |
@@ -429,7 +422,7 @@ discard block |
||
429 | 422 | if($values->count()>15){ |
430 | 423 | $widget = bab_Widgets()->select2(); |
431 | 424 | $widget->setDataSource($set->getController()->search()); |
432 | - }else{ |
|
425 | + } else{ |
|
433 | 426 | $widget = $W->Select(); |
434 | 427 | $widget->addOption('', ''); |
435 | 428 | foreach ($values as $record){ |
@@ -558,8 +551,7 @@ discard block |
||
558 | 551 | ->addClass('icon', FuncIcons::STATUS_DIALOG_ERROR) |
559 | 552 | ->addAttribute('data-removefor', $column->getFieldPath())) |
560 | 553 | ->setAlignItems(WidgetFlexLayout::FLEX_ALIGN_ITEMS_FLEX_END)); |
561 | - } |
|
562 | - elseif($displayAdvancedForm){ |
|
554 | + } elseif($displayAdvancedForm){ |
|
563 | 555 | $formItem = $this->getFormItem($fieldName, $field); |
564 | 556 | $formItem->setSizePolicy('col-lg-2 col-md-3 col-sm-6 col-xs-12'); |
565 | 557 | $filterBox->addItem($formItem); |
@@ -711,20 +703,17 @@ discard block |
||
711 | 703 | |
712 | 704 | if(isset($name)){ |
713 | 705 | $this->sortParameterName = $name . '[filter][sort]'; |
714 | - } |
|
715 | - else{ |
|
706 | + } else{ |
|
716 | 707 | $this->sortParameterName = 'filter[sort]'; |
717 | 708 | } |
718 | 709 | |
719 | 710 | if(isset($filter['sort'])){ |
720 | 711 | $this->setSortField($filter['sort']); |
721 | - } |
|
722 | - elseif(! isset($this->sortField)){ |
|
712 | + } elseif(! isset($this->sortField)){ |
|
723 | 713 | |
724 | 714 | if(method_exists($this, 'getDefaultSortField')){ |
725 | 715 | $this->setSortField($this->getDefaultSortField()); |
726 | - } |
|
727 | - else{ |
|
716 | + } else{ |
|
728 | 717 | $columns = $this->getVisibleColumns(); |
729 | 718 | $sortField = key($columns); |
730 | 719 | $this->setSortField($sortField); |
@@ -739,8 +728,7 @@ discard block |
||
739 | 728 | $name, |
740 | 729 | 'filter' |
741 | 730 | ); |
742 | - } |
|
743 | - else{ |
|
731 | + } else{ |
|
744 | 732 | $path = array( |
745 | 733 | 'filter' |
746 | 734 | ); |