@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $box->addClass('reload-configuration-page'); |
114 | 114 | $box->addClass('widget-100pc'); |
115 | 115 | |
116 | - if (! isset($itemId)) { |
|
116 | + if (!isset($itemId)) { |
|
117 | 117 | $this->resetCurrentTab(); |
118 | 118 | } |
119 | 119 | |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | $tabLinkHtml .= ' class="active"'; |
133 | 133 | } |
134 | 134 | $tabLinkHtml .= '>'; |
135 | - $tabLinkHtml .= $tabLink->display($htmlCanvas) . '</li>'; |
|
135 | + $tabLinkHtml .= $tabLink->display($htmlCanvas).'</li>'; |
|
136 | 136 | $navBoxHtml .= $tabLinkHtml; |
137 | 137 | } |
138 | 138 | |
@@ -162,14 +162,14 @@ discard block |
||
162 | 162 | ->addClass('icon-left icon-48x48 icon-left-48'); |
163 | 163 | $box->addItem($configBox); |
164 | 164 | |
165 | - if (! isset($configurationItems[$currentTab])) { |
|
165 | + if (!isset($configurationItems[$currentTab])) { |
|
166 | 166 | return $box; |
167 | 167 | } |
168 | 168 | |
169 | 169 | $tab = $configurationItems[$currentTab]; |
170 | 170 | |
171 | 171 | foreach ($tab['tabContent'] as $tabSection) { |
172 | - if (! isset($tabSection['sectionContent']) || empty($tabSection['sectionContent'])) { |
|
172 | + if (!isset($tabSection['sectionContent']) || empty($tabSection['sectionContent'])) { |
|
173 | 173 | continue; |
174 | 174 | } |
175 | 175 | $configBox->addItem($W->Section($tabSection['sectionName'], $sectionContentBox = $W->HBoxItems()) |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | $definitions = $App->getComponentDefinitions(); |
202 | 202 | foreach ($definitions as $packageName => $definition) { |
203 | 203 | /* @var $definition AppComponentDefinition */ |
204 | - if (! method_exists($definition, 'getConfiguration')) { |
|
204 | + if (!method_exists($definition, 'getConfiguration')) { |
|
205 | 205 | continue; |
206 | 206 | } |
207 | 207 | $configurationItems[$packageName] = array( |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | if ($data != '{}') { |
64 | 64 | echo "event: ping\n"; |
65 | 65 | echo "\n\n"; |
66 | - echo 'data: ' . $this->getSSEData() . "\n\n"; |
|
66 | + echo 'data: '.$this->getSSEData()."\n\n"; |
|
67 | 67 | } |
68 | 68 | ob_end_flush(); |
69 | 69 | flush(); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | |
88 | 88 | private function getRefreshFrequency() |
89 | 89 | { |
90 | - if (! isset($this->refreshFrequency)) { |
|
90 | + if (!isset($this->refreshFrequency)) { |
|
91 | 91 | $registry = app_getRegistry(); |
92 | 92 | $registry->changeDirectory('configuration'); |
93 | 93 | $registry->changeDirectory('SSE'); |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | foreach ($allViewSections as $viewSection) { |
87 | 87 | $fields = $viewSection->getFields(); |
88 | 88 | foreach ($fields as $field) { |
89 | - $allViewFieldNames[$field['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
89 | + $allViewFieldNames[$field['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
90 | 90 | } |
91 | 91 | } |
92 | 92 | |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | |
159 | 159 | $field = $customSection->getField($fieldName); |
160 | 160 | |
161 | - if (! isset($field)) { |
|
161 | + if (!isset($field)) { |
|
162 | 162 | return null; |
163 | 163 | } |
164 | 164 | |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | $manySets = $objectRecordSet->getHasManyRelations(); |
384 | 384 | $oneSets = $objectRecordSet->getHasOneRelations(); |
385 | 385 | |
386 | - if (! empty($record->visibilityCriteria)) { |
|
386 | + if (!empty($record->visibilityCriteria)) { |
|
387 | 387 | $arrCriteria = json_decode($record->visibilityCriteria, true); |
388 | 388 | |
389 | 389 | $data = array(); |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | if (is_array($value)) { |
396 | 396 | foreach ($value as $key => $subValue) { |
397 | 397 | foreach ($manySets as $manyFieldName => $manyRelation) { |
398 | - if ($key . 'Set' == $manyRelation->getForeignSetClassName()) { |
|
398 | + if ($key.'Set' == $manyRelation->getForeignSetClassName()) { |
|
399 | 399 | foreach ($subValue as $subFieldName => $subConditions) { |
400 | 400 | if ($subFieldName === '_foreignField') { |
401 | 401 | continue; |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | } |
412 | 412 | } |
413 | 413 | foreach ($oneSets as $oneFieldName => $oneRelation) { |
414 | - if ($key . 'Set' == $oneRelation->getForeignSetClassName()) { |
|
414 | + if ($key.'Set' == $oneRelation->getForeignSetClassName()) { |
|
415 | 415 | foreach ($subValue as $subFieldName => $subConditions) { |
416 | 416 | if ($subFieldName === '_foreignField') { |
417 | 417 | continue; |
@@ -458,10 +458,10 @@ discard block |
||
458 | 458 | return true; |
459 | 459 | } |
460 | 460 | |
461 | - protected function preSave(ORMRecord &$record, $data) |
|
461 | + protected function preSave(ORMRecord & $record, $data) |
|
462 | 462 | { |
463 | 463 | parent::preSave($record, $data); |
464 | - if (! isset($record->id) || empty($record->id)) { |
|
464 | + if (!isset($record->id) || empty($record->id)) { |
|
465 | 465 | $set = $record->getParentSet(); |
466 | 466 | $nbContainers = $set->select( |
467 | 467 | $set->all( |
@@ -580,7 +580,7 @@ discard block |
||
580 | 580 | |
581 | 581 | $visibilityCriteria = ''; |
582 | 582 | |
583 | - if (! empty($condition)) { |
|
583 | + if (!empty($condition)) { |
|
584 | 584 | $criteria = $field->{$condition}($data['value']); |
585 | 585 | $visibilityCriteria = $criteria->toJson(); |
586 | 586 | } |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | $customContainers->orderAsc($customContainerSet->rank); |
620 | 620 | |
621 | 621 | $containerBoxes = $W->Items(); |
622 | - if(isset($itemId)){ |
|
622 | + if (isset($itemId)) { |
|
623 | 623 | $containerBoxes->setId($itemId); |
624 | 624 | } |
625 | 625 | |
@@ -638,7 +638,7 @@ discard block |
||
638 | 638 | $menu->setSizePolicy(FuncIcons::ICON_LEFT_16); |
639 | 639 | |
640 | 640 | $hasVisibilityBox = $W->FlowItems()->addClass('widget-100'); |
641 | - if (! empty($customContainer->visibilityCriteria)) { |
|
641 | + if (!empty($customContainer->visibilityCriteria)) { |
|
642 | 642 | $hasVisibilityBox->addItem( |
643 | 643 | $W->HBoxItems( |
644 | 644 | $W->Label($App->translate('This container has a visibility condition')) |
@@ -720,7 +720,7 @@ discard block |
||
720 | 720 | } |
721 | 721 | |
722 | 722 | header('Content-type: application/json'); |
723 | - header('Content-Disposition: attachment; filename="' . $object . '.' . ($view === '' ? 'default' : $view) . '.json"' . "\n"); |
|
723 | + header('Content-Disposition: attachment; filename="'.$object.'.'.($view === '' ? 'default' : $view).'.json"'."\n"); |
|
724 | 724 | if (BabCharset::getIso() != BabCharset::UTF_8) { |
725 | 725 | $containersValues = app_utf8Encode($containersValues); |
726 | 726 | } |
@@ -796,7 +796,7 @@ discard block |
||
796 | 796 | break; |
797 | 797 | } |
798 | 798 | |
799 | - if (! isset($data)) { |
|
799 | + if (!isset($data)) { |
|
800 | 800 | $this->addError($App->translate('Unable to get file content')); |
801 | 801 | return true; |
802 | 802 | } |
@@ -983,7 +983,7 @@ discard block |
||
983 | 983 | foreach ($containersFields as $containerId => $containerFieldIds) { |
984 | 984 | foreach ($containerFieldIds as $containerFieldId) { |
985 | 985 | list($srcContainerId, $srcfieldId) = explode('.', $containerFieldId); |
986 | - if (! isset($containersRawFields[$srcContainerId][$srcfieldId])) { |
|
986 | + if (!isset($containersRawFields[$srcContainerId][$srcfieldId])) { |
|
987 | 987 | return true; |
988 | 988 | } |
989 | 989 | } |
@@ -90,10 +90,10 @@ discard block |
||
90 | 90 | foreach ($allViewSections as $viewSection) { |
91 | 91 | $fields = $viewSection->getFields(); |
92 | 92 | foreach ($fields as $field) { |
93 | - $allViewFieldNames[$field['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
93 | + $allViewFieldNames[$field['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
94 | 94 | if (isset($field["fields"]) && is_array($field['fields'])) { |
95 | 95 | foreach ($field['fields'] as $subField) { |
96 | - $allViewFieldNames[$subField['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
96 | + $allViewFieldNames[$subField['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
97 | 97 | } |
98 | 98 | } |
99 | 99 | } |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | |
169 | 169 | $field = $customSection->getField($fieldName); |
170 | 170 | |
171 | - if (! isset($field)) { |
|
171 | + if (!isset($field)) { |
|
172 | 172 | return null; |
173 | 173 | } |
174 | 174 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | } |
283 | 283 | |
284 | 284 | |
285 | - if (! isset($groupField)) { |
|
285 | + if (!isset($groupField)) { |
|
286 | 286 | return null; |
287 | 287 | } |
288 | 288 | |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | return null; |
294 | 294 | } |
295 | 295 | |
296 | - if (! isset($field)) { |
|
296 | + if (!isset($field)) { |
|
297 | 297 | return null; |
298 | 298 | } |
299 | 299 | |
@@ -444,10 +444,10 @@ discard block |
||
444 | 444 | foreach ($allViewSections as $viewSection) { |
445 | 445 | $fields = $viewSection->getFields(); |
446 | 446 | foreach ($fields as $field) { |
447 | - $allViewFieldNames[$field['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
447 | + $allViewFieldNames[$field['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
448 | 448 | if (isset($field["fields"]) && is_array($field["fields"])) { |
449 | 449 | foreach ($field['fields'] as $subField) { |
450 | - $allViewFieldNames[$subField['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
450 | + $allViewFieldNames[$subField['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
451 | 451 | } |
452 | 452 | } |
453 | 453 | } |
@@ -536,10 +536,10 @@ discard block |
||
536 | 536 | foreach ($allViewSections as $viewSection) { |
537 | 537 | $fields = $viewSection->getFields(); |
538 | 538 | foreach ($fields as $field) { |
539 | - $allViewFieldNames[$field['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
539 | + $allViewFieldNames[$field['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
540 | 540 | if (isset($field["fields"]) && is_array($field['fields'])) { |
541 | 541 | foreach ($field['fields'] as $subField) { |
542 | - $allViewFieldNames[$subField['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id; |
|
542 | + $allViewFieldNames[$subField['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id; |
|
543 | 543 | } |
544 | 544 | } |
545 | 545 | } |
@@ -723,7 +723,7 @@ discard block |
||
723 | 723 | $manySets = $objectRecordSet->getHasManyRelations(); |
724 | 724 | $oneSets = $objectRecordSet->getHasOneRelations(); |
725 | 725 | |
726 | - if (! empty($record->visibilityCriteria)) { |
|
726 | + if (!empty($record->visibilityCriteria)) { |
|
727 | 727 | $arrCriteria = json_decode($record->visibilityCriteria, true); |
728 | 728 | |
729 | 729 | $data = array(); |
@@ -735,7 +735,7 @@ discard block |
||
735 | 735 | if (is_array($value)) { |
736 | 736 | foreach ($value as $key => $subValue) { |
737 | 737 | foreach ($manySets as $manyFieldName => $manyRelation) { |
738 | - if ($key . 'Set' == $manyRelation->getForeignSetClassName()) { |
|
738 | + if ($key.'Set' == $manyRelation->getForeignSetClassName()) { |
|
739 | 739 | foreach ($subValue as $subFieldName => $subConditions) { |
740 | 740 | if ($subFieldName === '_foreignField') { |
741 | 741 | continue; |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | } |
752 | 752 | } |
753 | 753 | foreach ($oneSets as $oneFieldName => $oneRelation) { |
754 | - if ($key . 'Set' == $oneRelation->getForeignSetClassName()) { |
|
754 | + if ($key.'Set' == $oneRelation->getForeignSetClassName()) { |
|
755 | 755 | foreach ($subValue as $subFieldName => $subConditions) { |
756 | 756 | if ($subFieldName === '_foreignField') { |
757 | 757 | continue; |
@@ -792,7 +792,7 @@ discard block |
||
792 | 792 | */ |
793 | 793 | public function save($data = null) |
794 | 794 | { |
795 | - if (! isset($data['id']) && isset($data['container']) && $data['container'] != 0 && ! isset($data['rank'])) { |
|
795 | + if (!isset($data['id']) && isset($data['container']) && $data['container'] != 0 && !isset($data['rank'])) { |
|
796 | 796 | $set = $this->getRecordSet(); |
797 | 797 | $data['rank'] = $set->select($set->container->is($data['container'])) |
798 | 798 | ->count(); |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | return true; |
805 | 805 | } |
806 | 806 | |
807 | - protected function postSave(ORMRecord &$record, $data) |
|
807 | + protected function postSave(ORMRecord & $record, $data) |
|
808 | 808 | { |
809 | 809 | parent::postSave($record, $data); |
810 | 810 | $set = $record->getParentSet(); |
@@ -939,7 +939,7 @@ discard block |
||
939 | 939 | |
940 | 940 | $visibilityCriteria = ''; |
941 | 941 | |
942 | - if (! empty($condition)) { |
|
942 | + if (!empty($condition)) { |
|
943 | 943 | $criteria = $field->{$condition}($data['value']); |
944 | 944 | $visibilityCriteria = $criteria->toJson(); |
945 | 945 | } |
@@ -1005,11 +1005,11 @@ discard block |
||
1005 | 1005 | |
1006 | 1006 | $currentColumn += $nbCol; |
1007 | 1007 | |
1008 | - $sectionSection = $W->Section($customSection->name . ' (' . $customSection->rank . ')', $sectionBox = $W->VBoxItems($W->Hidden() |
|
1009 | - ->setName('#' . $customSection->id))); |
|
1008 | + $sectionSection = $W->Section($customSection->name.' ('.$customSection->rank.')', $sectionBox = $W->VBoxItems($W->Hidden() |
|
1009 | + ->setName('#'.$customSection->id))); |
|
1010 | 1010 | $sectionSection->addClass('app-custom-section'); |
1011 | 1011 | $sectionSection->addClass($customSection->classname); |
1012 | - $sectionSection->setSizePolicy($customSection->sizePolicy . ' widget-sameheight'); |
|
1012 | + $sectionSection->setSizePolicy($customSection->sizePolicy.' widget-sameheight'); |
|
1013 | 1013 | |
1014 | 1014 | $row->addItem($sectionSection); |
1015 | 1015 | |
@@ -1037,7 +1037,7 @@ discard block |
||
1037 | 1037 | ->setDialogClass('box red') |
1038 | 1038 | ) |
1039 | 1039 | ); |
1040 | - if (! empty($customSection->visibilityCriteria)) { |
|
1040 | + if (!empty($customSection->visibilityCriteria)) { |
|
1041 | 1041 | $sectionBox->addItem($W->HBoxItems($W->Label($App->translate('This section has a visibility condition'))) |
1042 | 1042 | ->setSizePolicy('alert alert-warning widget-100pc')); |
1043 | 1043 | } |
@@ -1091,7 +1091,7 @@ discard block |
||
1091 | 1091 | ->setGrowable(true) |
1092 | 1092 | ->setWrap(WidgetFlexLayout::FLEX_WRAP_WRAP)) |
1093 | 1093 | ->setSizePolicy('maximum'), $btnBox = $W->HBoxItems($W->Hidden() |
1094 | - ->setName($customSection->id . '.' . $fieldId) |
|
1094 | + ->setName($customSection->id.'.'.$fieldId) |
|
1095 | 1095 | ->setValue($fieldName)) |
1096 | 1096 | ->addClass('widget-actions')) |
1097 | 1097 | ->setSizePolicy('widget-list-element widget-actions-target') |
@@ -1117,7 +1117,7 @@ discard block |
||
1117 | 1117 | $fieldGroupBox->addItem( |
1118 | 1118 | $flexField = $W->VBoxItems( |
1119 | 1119 | $W->HBoxItems( |
1120 | - $W->Hidden(null, array($customSection->id . '.fieldsGroups', $fieldName, $groupedField['fieldname']), $groupedField['fieldname']), |
|
1120 | + $W->Hidden(null, array($customSection->id.'.fieldsGroups', $fieldName, $groupedField['fieldname']), $groupedField['fieldname']), |
|
1121 | 1121 | $W->Label($groupedFieldDetails['description']), |
1122 | 1122 | $fieldMenu = $W->FlowItems( |
1123 | 1123 | $W->Link( |
@@ -1166,11 +1166,11 @@ discard block |
||
1166 | 1166 | $groupFieldItemMenu = $W->FlowItems( |
1167 | 1167 | $W->Link( |
1168 | 1168 | '', |
1169 | - $customSectionCtrl->editGroupFieldDisplayField($customSection->id, $fieldName . '/' . $groupedField['fieldname'], $subSectionField['fieldname']) |
|
1169 | + $customSectionCtrl->editGroupFieldDisplayField($customSection->id, $fieldName.'/'.$groupedField['fieldname'], $subSectionField['fieldname']) |
|
1170 | 1170 | )->addClass('icon', FuncIcons::ACTIONS_DOCUMENT_EDIT)->setOpenMode(WidgetLink::OPEN_DIALOG), |
1171 | 1171 | $W->Link( |
1172 | 1172 | '', |
1173 | - $customSectionCtrl->removeDisplayFieldFromGroup($customSection->id, $fieldName . '/' . $groupedField['fieldname'], $subSectionField['fieldname']) |
|
1173 | + $customSectionCtrl->removeDisplayFieldFromGroup($customSection->id, $fieldName.'/'.$groupedField['fieldname'], $subSectionField['fieldname']) |
|
1174 | 1174 | )->addClass('icon', FuncIcons::ACTIONS_LIST_REMOVE)->setAjaxAction() |
1175 | 1175 | ) |
1176 | 1176 | ) |
@@ -1179,7 +1179,7 @@ discard block |
||
1179 | 1179 | $groupFieldItemMenu->addItem( |
1180 | 1180 | $W->Link( |
1181 | 1181 | '', |
1182 | - $customSectionCtrl->addDisplayFieldToGroup($customSection->id, $fieldName . '/' . $groupedField['fieldname'] . '/' . $subSectionField['fieldname']) |
|
1182 | + $customSectionCtrl->addDisplayFieldToGroup($customSection->id, $fieldName.'/'.$groupedField['fieldname'].'/'.$subSectionField['fieldname']) |
|
1183 | 1183 | )->addClass('icon', FuncIcons::ACTIONS_LIST_ADD)->setOpenMode(WidgetLink::OPEN_DIALOG), |
1184 | 1184 | 0 |
1185 | 1185 | ); |
@@ -1194,11 +1194,11 @@ discard block |
||
1194 | 1194 | $W->FlowItems( |
1195 | 1195 | $W->Link( |
1196 | 1196 | '', |
1197 | - $customSectionCtrl->editGroupFieldDisplayField($customSection->id, $fieldName . '/' . $groupedField['fieldname'] . '/' . $subSectionField['fieldname'], $subSectionFieldGroupFields['fieldname']) |
|
1197 | + $customSectionCtrl->editGroupFieldDisplayField($customSection->id, $fieldName.'/'.$groupedField['fieldname'].'/'.$subSectionField['fieldname'], $subSectionFieldGroupFields['fieldname']) |
|
1198 | 1198 | )->addClass('icon', FuncIcons::ACTIONS_DOCUMENT_EDIT)->setOpenMode(WidgetLink::OPEN_DIALOG), |
1199 | 1199 | $W->Link( |
1200 | 1200 | '', |
1201 | - $customSectionCtrl->removeDisplayFieldFromGroup($customSection->id, $fieldName . '/' . $groupedField['fieldname'] . '/' . $subSectionField['fieldname'], $subSectionFieldGroupFields['fieldname']) |
|
1201 | + $customSectionCtrl->removeDisplayFieldFromGroup($customSection->id, $fieldName.'/'.$groupedField['fieldname'].'/'.$subSectionField['fieldname'], $subSectionFieldGroupFields['fieldname']) |
|
1202 | 1202 | )->addClass('icon', FuncIcons::ACTIONS_LIST_REMOVE)->setAjaxAction() |
1203 | 1203 | ) |
1204 | 1204 | ) |
@@ -1285,7 +1285,7 @@ discard block |
||
1285 | 1285 | } |
1286 | 1286 | |
1287 | 1287 | header('Content-type: application/json'); |
1288 | - header('Content-Disposition: attachment; filename="' . $container->object . '.' . ($container->view === '' ? 'default' : $container->view) . '.' . $container->name . '.json"' . "\n"); |
|
1288 | + header('Content-Disposition: attachment; filename="'.$container->object.'.'.($container->view === '' ? 'default' : $container->view).'.'.$container->name.'.json"'."\n"); |
|
1289 | 1289 | |
1290 | 1290 | $json = bab_json_encode($sectionsValues); |
1291 | 1291 | $json = bab_convertStringFromDatabase($json, BabCharset::UTF_8); |
@@ -1342,7 +1342,7 @@ discard block |
||
1342 | 1342 | break; |
1343 | 1343 | } |
1344 | 1344 | |
1345 | - if (! isset($data)) { |
|
1345 | + if (!isset($data)) { |
|
1346 | 1346 | $this->addError($App->translate('Unable to get file content')); |
1347 | 1347 | return true; |
1348 | 1348 | } |
@@ -1430,7 +1430,7 @@ discard block |
||
1430 | 1430 | if (substr($key, 0, 1) === '#') { |
1431 | 1431 | $currentSectionId = substr($key, 1); |
1432 | 1432 | $rawSectionData[$currentSectionId] = array(); |
1433 | - if (! isset($oldSectionId)) { |
|
1433 | + if (!isset($oldSectionId)) { |
|
1434 | 1434 | $oldSectionId = $currentSectionId; |
1435 | 1435 | } |
1436 | 1436 | if (isset($currentSection) && $oldSectionId != $currentSectionId) { |
@@ -1441,7 +1441,7 @@ discard block |
||
1441 | 1441 | $currentSection = $customSectionSet->get($customSectionSet->id->is($currentSectionId)); |
1442 | 1442 | continue; |
1443 | 1443 | } |
1444 | - if (! isset($currentSection)) { |
|
1444 | + if (!isset($currentSection)) { |
|
1445 | 1445 | continue; |
1446 | 1446 | } |
1447 | 1447 | list($fieldSectionId, $fieldName) = explode('.', $key); |
@@ -1451,7 +1451,7 @@ discard block |
||
1451 | 1451 | $rawSectionData[$currentSectionId][$fieldName]['block'] = $field['block']; |
1452 | 1452 | $rawSectionData[$currentSectionId][$fieldName]['fieldname'] = '_fieldsGroup'; |
1453 | 1453 | $rawSectionData[$currentSectionId][$fieldName]['parameters'] = $field['parameters']; |
1454 | - foreach ($sections[$currentSection->id . '.fieldsGroups'][$fieldName] as $subKey => $subValue) { |
|
1454 | + foreach ($sections[$currentSection->id.'.fieldsGroups'][$fieldName] as $subKey => $subValue) { |
|
1455 | 1455 | $rawSectionData[$currentSectionId][$fieldName]['fields'][$subKey] = $field['fields'][$subKey]; |
1456 | 1456 | } |
1457 | 1457 | } elseif ($fieldName != 'fieldsGroups') { |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $App = $this->App(); |
103 | 103 | |
104 | 104 | $recordClassname = $this->getRecordClassName(); |
105 | - $recordSetClassname = $recordClassname . 'Set'; |
|
105 | + $recordSetClassname = $recordClassname.'Set'; |
|
106 | 106 | |
107 | 107 | $recordSet = $App->$recordSetClassname(); |
108 | 108 | return $recordSet; |
@@ -150,9 +150,9 @@ discard block |
||
150 | 150 | if ($showLabel) { |
151 | 151 | $text = $actions->getTitle(); |
152 | 152 | } |
153 | - $html = '<li><a class="icon ' . $actions->getIcon() . '" href="' . $actions->url() . '">' . $text . '</a></li>'; |
|
153 | + $html = '<li><a class="icon '.$actions->getIcon().'" href="'.$actions->url().'">'.$text.'</a></li>'; |
|
154 | 154 | } elseif ($actions instanceof WidgetDisplayableInterface) { |
155 | - $html = '<li>' . $actions->display($canvas) . '</li>'; |
|
155 | + $html = '<li>'.$actions->display($canvas).'</li>'; |
|
156 | 156 | } elseif (is_array($actions)) { |
157 | 157 | if (isset($actions['items'])) { |
158 | 158 | $items = $actions['items']; |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } |
165 | 165 | if (isset($actions['icon'])) { |
166 | 166 | |
167 | - $html = '<li class="dropdown">' . '<a href="#" class="' . $actions['icon'] . ' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' . ($actions['icon'] === 'actions-context-menu'/*FuncIcons::ACTIONS_CONTEXT_MENU*/ ? '' : '<span class="caret"></span>') . '</a>' . '<ul class="dropdown-menu dropdown-menu-right ' . FuncIcons::ICON_LEFT_SYMBOLIC . '">' . $html . '</ul>'; |
|
167 | + $html = '<li class="dropdown">'.'<a href="#" class="'.$actions['icon'].' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'.($actions['icon'] === 'actions-context-menu'/*FuncIcons::ACTIONS_CONTEXT_MENU*/ ? '' : '<span class="caret"></span>').'</a>'.'<ul class="dropdown-menu dropdown-menu-right '.FuncIcons::ICON_LEFT_SYMBOLIC.'">'.$html.'</ul>'; |
|
168 | 168 | } |
169 | 169 | } |
170 | 170 | |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | |
213 | 213 | foreach ($methods as $index => $method) { |
214 | 214 | try { |
215 | - $methodName = $recordClassname . $method['method']; |
|
215 | + $methodName = $recordClassname.$method['method']; |
|
216 | 216 | if ($Ui->$methodName()) { |
217 | 217 | $types[$index] = array( |
218 | 218 | 'classname' => $methodName, |
@@ -297,11 +297,11 @@ discard block |
||
297 | 297 | |
298 | 298 | if (isset($id)) { |
299 | 299 | $record = $recordSet->request($id); |
300 | - if (! $record->isUpdatable()) { |
|
300 | + if (!$record->isUpdatable()) { |
|
301 | 301 | throw new AppAccessException($App->translate('You do not have access to this page')); |
302 | 302 | } |
303 | 303 | } else { |
304 | - if (! $recordSet->isCreatable()) { |
|
304 | + if (!$recordSet->isCreatable()) { |
|
305 | 305 | throw new AppAccessException($App->translate('You do not have access to this page')); |
306 | 306 | } |
307 | 307 | $record = $recordSet->newRecord(); |
@@ -329,12 +329,12 @@ discard block |
||
329 | 329 | $W = bab_Widgets(); |
330 | 330 | |
331 | 331 | $recordClassname = $this->getRecordClassName(); |
332 | - $editorClassname = $recordClassname . 'SectionEditor'; |
|
332 | + $editorClassname = $recordClassname.'SectionEditor'; |
|
333 | 333 | |
334 | 334 | /* @var $editor AppRecordEditor */ |
335 | 335 | $editor = $Ui->$editorClassname($record); |
336 | - if (! isset($itemId)) { |
|
337 | - $itemId = $this->getClass() . '_' . __FUNCTION__; |
|
336 | + if (!isset($itemId)) { |
|
337 | + $itemId = $this->getClass().'_'.__FUNCTION__; |
|
338 | 338 | } |
339 | 339 | $editor->setId($itemId); |
340 | 340 | $editor->setController($this); |
@@ -363,8 +363,8 @@ discard block |
||
363 | 363 | */ |
364 | 364 | public function getModelViewDefaultId($itemId = null) |
365 | 365 | { |
366 | - if (! isset($itemId)) { |
|
367 | - $itemId = $this->getClass() . '_modelView'; |
|
366 | + if (!isset($itemId)) { |
|
367 | + $itemId = $this->getClass().'_modelView'; |
|
368 | 368 | } |
369 | 369 | |
370 | 370 | return $itemId; |
@@ -392,7 +392,7 @@ discard block |
||
392 | 392 | |
393 | 393 | $itemId = $this->getModelViewDefaultId($itemId); |
394 | 394 | |
395 | - if (! isset($type)) { |
|
395 | + if (!isset($type)) { |
|
396 | 396 | $type = $this->getFilteredViewType($itemId); |
397 | 397 | } |
398 | 398 | |
@@ -400,24 +400,24 @@ discard block |
||
400 | 400 | |
401 | 401 | switch ($type) { |
402 | 402 | case 'cards': |
403 | - $tableviewClassname = $recordClassname . 'CardsView'; |
|
403 | + $tableviewClassname = $recordClassname.'CardsView'; |
|
404 | 404 | break; |
405 | 405 | |
406 | 406 | case 'map': |
407 | - $tableviewClassname = $recordClassname . 'MapView'; |
|
407 | + $tableviewClassname = $recordClassname.'MapView'; |
|
408 | 408 | break; |
409 | 409 | |
410 | 410 | case 'calendar': |
411 | - $tableviewClassname = $recordClassname . 'CalendarView'; |
|
411 | + $tableviewClassname = $recordClassname.'CalendarView'; |
|
412 | 412 | break; |
413 | 413 | |
414 | 414 | case 'statistics': |
415 | - $tableviewClassname = $recordClassname . 'StatisticsView'; |
|
415 | + $tableviewClassname = $recordClassname.'StatisticsView'; |
|
416 | 416 | break; |
417 | 417 | |
418 | 418 | case 'table': |
419 | 419 | default: |
420 | - $tableviewClassname = $recordClassname . 'TableView'; |
|
420 | + $tableviewClassname = $recordClassname.'TableView'; |
|
421 | 421 | break; |
422 | 422 | } |
423 | 423 | /* @var $tableview WidgetTableModelView */ |
@@ -473,11 +473,11 @@ discard block |
||
473 | 473 | $App = $this->App(); |
474 | 474 | $Ui = $App->Ui(); |
475 | 475 | $recordClassname = $this->getRecordClassName(); |
476 | - $editorClassname = $recordClassname . 'Editor'; |
|
476 | + $editorClassname = $recordClassname.'Editor'; |
|
477 | 477 | $editor = $Ui->$editorClassname(); |
478 | 478 | |
479 | - if (! isset($itemId)) { |
|
480 | - $itemId = $this->getClass() . '_' . __FUNCTION__; |
|
479 | + if (!isset($itemId)) { |
|
480 | + $itemId = $this->getClass().'_'.__FUNCTION__; |
|
481 | 481 | } |
482 | 482 | $editor->setId($itemId); |
483 | 483 | $editor->setHiddenValue('tg', $App->controllerTg); |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | |
528 | 528 | foreach ($viewTypes as $viewTypeId => $viewType) { |
529 | 529 | $viewsBox->addItem($W->Link('', $proxy->setFilteredViewType($tableView->getId(), $viewTypeId)) |
530 | - ->addClass('icon', $viewType['icon'] . ($filteredViewType === $viewTypeId ? ' active' : '')) |
|
530 | + ->addClass('icon', $viewType['icon'].($filteredViewType === $viewTypeId ? ' active' : '')) |
|
531 | 531 | -> |
532 | 532 | // ->setSizePolicy('btn btn-xs btn-default ' . ($filteredViewType === $viewTypeId ? 'active' : '')) |
533 | 533 | setTitle($viewType['label']) |
@@ -560,8 +560,8 @@ discard block |
||
560 | 560 | $W = bab_Widgets(); |
561 | 561 | |
562 | 562 | $filterVisibility = $this->getFilterVisibility($itemId); |
563 | - $filterVisibility = ! $filterVisibility; |
|
564 | - $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility); |
|
563 | + $filterVisibility = !$filterVisibility; |
|
564 | + $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility); |
|
565 | 565 | |
566 | 566 | return true; |
567 | 567 | } |
@@ -573,10 +573,10 @@ discard block |
||
573 | 573 | protected function getFilterVisibility($itemId) |
574 | 574 | { |
575 | 575 | $W = bab_Widgets(); |
576 | - $filterVisibility = $W->getUserConfiguration($itemId . '/filterVisibility'); |
|
577 | - if (! isset($filterVisibility)) { |
|
576 | + $filterVisibility = $W->getUserConfiguration($itemId.'/filterVisibility'); |
|
577 | + if (!isset($filterVisibility)) { |
|
578 | 578 | $filterVisibility = false; |
579 | - $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility); |
|
579 | + $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility); |
|
580 | 580 | } |
581 | 581 | return $filterVisibility; |
582 | 582 | } |
@@ -591,8 +591,8 @@ discard block |
||
591 | 591 | protected function getFilteredViewType($itemId) |
592 | 592 | { |
593 | 593 | $W = bab_Widgets(); |
594 | - $type = $W->getUserConfiguration($itemId . '/viewType'); |
|
595 | - if (! isset($type)) { |
|
594 | + $type = $W->getUserConfiguration($itemId.'/viewType'); |
|
595 | + if (!isset($type)) { |
|
596 | 596 | $type = 'table'; |
597 | 597 | } |
598 | 598 | return $type; |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | public function setFilteredViewType($itemId, $type = null) |
610 | 610 | { |
611 | 611 | $W = bab_Widgets(); |
612 | - $W->setUserConfiguration($itemId . '/viewType', $type); |
|
612 | + $W->setUserConfiguration($itemId.'/viewType', $type); |
|
613 | 613 | |
614 | 614 | return true; |
615 | 615 | } |
@@ -694,13 +694,13 @@ discard block |
||
694 | 694 | $sessionOnly = isset($data['inSession']) ? $data['inSession'] : false; |
695 | 695 | |
696 | 696 | if (isset($data['pageLength'])) { |
697 | - $W->setUserConfiguration($tableModelViewId . '/pageLength', $data['pageLength'], 'widgets', $sessionOnly); |
|
697 | + $W->setUserConfiguration($tableModelViewId.'/pageLength', $data['pageLength'], 'widgets', $sessionOnly); |
|
698 | 698 | } |
699 | 699 | if (isset($data['displaySubTotalRow'])) { |
700 | - $W->setUserConfiguration($tableModelViewId . '/displaySubTotalRow', $data['displaySubTotalRow'], 'widgets', $sessionOnly); |
|
700 | + $W->setUserConfiguration($tableModelViewId.'/displaySubTotalRow', $data['displaySubTotalRow'], 'widgets', $sessionOnly); |
|
701 | 701 | } |
702 | 702 | if (isset($data['columns'])) { |
703 | - $W->setUserConfiguration($tableModelViewId . '/columns', $data['columns'], 'widgets', $sessionOnly); |
|
703 | + $W->setUserConfiguration($tableModelViewId.'/columns', $data['columns'], 'widgets', $sessionOnly); |
|
704 | 704 | } |
705 | 705 | |
706 | 706 | $this->addReloadSelector("#{$tableModelViewId}"); |
@@ -715,7 +715,7 @@ discard block |
||
715 | 715 | $tableModelViewId = $data['tableModelViewId']; |
716 | 716 | $sessionOnly = isset($data['inSession']) ? $data['inSession'] : false; |
717 | 717 | |
718 | - $W->deleteUserConfiguration($data['tableModelViewId'] . '/columns', 'widgets', $sessionOnly); |
|
718 | + $W->deleteUserConfiguration($data['tableModelViewId'].'/columns', 'widgets', $sessionOnly); |
|
719 | 719 | |
720 | 720 | $this->addReloadSelector("#{$tableModelViewId}"); |
721 | 721 | return true; |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | $columns = $tableview->getVisibleColumns(); |
816 | 816 | $column = isset($columns[$col]) ? $columns[$col] : null; |
817 | 817 | |
818 | - if (! isset($column)) { |
|
818 | + if (!isset($column)) { |
|
819 | 819 | return true; |
820 | 820 | } |
821 | 821 | |
@@ -832,7 +832,7 @@ discard block |
||
832 | 832 | $labelledWidget->getLabelWidget()->addClass($label->getClasses()); |
833 | 833 | $labelledWidget->getInputWidget()->addClass($widget->getClasses()); |
834 | 834 | |
835 | - $filter = $W->getUserConfiguration($key . '/filter', 'widgets', false); |
|
835 | + $filter = $W->getUserConfiguration($key.'/filter', 'widgets', false); |
|
836 | 836 | if (isset($filter[$col])) { |
837 | 837 | $widget->setValue($filter[$col]); |
838 | 838 | } |
@@ -849,7 +849,7 @@ discard block |
||
849 | 849 | |
850 | 850 | $key = $data['key']; |
851 | 851 | |
852 | - $filter = $W->getUserConfiguration($key . '/filter', 'widgets', false); |
|
852 | + $filter = $W->getUserConfiguration($key.'/filter', 'widgets', false); |
|
853 | 853 | if (isset($data['moreCriteria']) && $data['moreCriteria']) { |
854 | 854 | $filter = array(); |
855 | 855 | } |
@@ -861,7 +861,7 @@ discard block |
||
861 | 861 | $filter[$filterName] = $filterValue; |
862 | 862 | } |
863 | 863 | } |
864 | - $W->setUserConfiguration($key . '/filter', $filter, 'widgets', false); |
|
864 | + $W->setUserConfiguration($key.'/filter', $filter, 'widgets', false); |
|
865 | 865 | |
866 | 866 | |
867 | 867 | if (session_status() == PHP_SESSION_NONE) { |
@@ -871,7 +871,7 @@ discard block |
||
871 | 871 | unset($_SESSION['modelViewMoreCriterias'][$key]); |
872 | 872 | session_write_close(); |
873 | 873 | |
874 | - $this->addReloadSelector('.depends-' . $key . ':not(.widget-tableview-clone)'); |
|
874 | + $this->addReloadSelector('.depends-'.$key.':not(.widget-tableview-clone)'); |
|
875 | 875 | |
876 | 876 | return true; |
877 | 877 | } |
@@ -882,7 +882,7 @@ discard block |
||
882 | 882 | $Ui = $App->Ui(); |
883 | 883 | |
884 | 884 | $page = $Ui->Page(); |
885 | - $page->addClass('depends-modelViewMoreCriterias-' . $key); |
|
885 | + $page->addClass('depends-modelViewMoreCriterias-'.$key); |
|
886 | 886 | |
887 | 887 | $page->setTitle($App->translate('Search')); |
888 | 888 | |
@@ -902,7 +902,7 @@ discard block |
||
902 | 902 | $editor = $Ui->BasicEditor($itemId, $W->VBoxLayout()); |
903 | 903 | $editor->setReloadAction($this->proxy() |
904 | 904 | ->getDisplayListMoreCriteriaEditor($key, $editor->getId())); |
905 | - $editor->addClass('depends-modelViewMoreCriterias-' . $key); |
|
905 | + $editor->addClass('depends-modelViewMoreCriterias-'.$key); |
|
906 | 906 | $editor->addClass('widget-no-close'); |
907 | 907 | $editor->setIconFormat(); |
908 | 908 | $editor->isAjax = true; |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | $columns = $tableview->getVisibleColumns(); |
918 | 918 | $filter = $tableview->getFilterValues(); |
919 | 919 | |
920 | - if (! isset($itemId)) { |
|
920 | + if (!isset($itemId)) { |
|
921 | 921 | $editor->setSaveAction($this->proxy() |
922 | 922 | ->saveDisplayListFilter(), $App->translate('Search')); |
923 | 923 | $editor->setCancelAction($this->proxy() |
@@ -928,13 +928,13 @@ discard block |
||
928 | 928 | if (empty($value)) { |
929 | 929 | continue; |
930 | 930 | } |
931 | - if (! isset($columns[$fieldName])) { |
|
931 | + if (!isset($columns[$fieldName])) { |
|
932 | 932 | continue; |
933 | 933 | } |
934 | 934 | |
935 | 935 | $column = $columns[$fieldName]; |
936 | 936 | |
937 | - if (! $column->isSearchable()) { |
|
937 | + if (!$column->isSearchable()) { |
|
938 | 938 | continue; |
939 | 939 | } |
940 | 940 | |
@@ -955,12 +955,12 @@ discard block |
||
955 | 955 | $nbAlreadyAdded = 0; |
956 | 956 | |
957 | 957 | foreach ($fields as $fieldName => $fieldValue) { |
958 | - if (! isset($columns[$fieldName])) { |
|
958 | + if (!isset($columns[$fieldName])) { |
|
959 | 959 | continue; |
960 | 960 | } |
961 | 961 | $column = $columns[$fieldName]; |
962 | 962 | |
963 | - if (! $column->isSearchable()) { |
|
963 | + if (!$column->isSearchable()) { |
|
964 | 964 | continue; |
965 | 965 | } |
966 | 966 | |
@@ -971,7 +971,7 @@ discard block |
||
971 | 971 | $alreadyFilteredBox = null; |
972 | 972 | } |
973 | 973 | |
974 | - if (! isset($alreadyFilteredBox)) { |
|
974 | + if (!isset($alreadyFilteredBox)) { |
|
975 | 975 | $editor->addItem($alreadyFilteredBox = $W->FlexItems() |
976 | 976 | ->setSizePolicy('customsection-field-box customsection-fieldsgroup-box')); |
977 | 977 | } |
@@ -1004,7 +1004,7 @@ discard block |
||
1004 | 1004 | ); |
1005 | 1005 | |
1006 | 1006 | foreach ($columns as $fieldName => $column) { |
1007 | - if (! $column->isSearchable()) { |
|
1007 | + if (!$column->isSearchable()) { |
|
1008 | 1008 | continue; |
1009 | 1009 | } |
1010 | 1010 | |
@@ -1041,12 +1041,12 @@ discard block |
||
1041 | 1041 | session_start(); |
1042 | 1042 | } |
1043 | 1043 | $fields = isset($data['filter']) ? $data['filter'] : array(); |
1044 | - if (isset($data['newField']) && ! empty($data['newField'])) { |
|
1044 | + if (isset($data['newField']) && !empty($data['newField'])) { |
|
1045 | 1045 | $newField = $data['newField']; |
1046 | 1046 | unset($data['key']); |
1047 | 1047 | unset($data['moreCriteria']); |
1048 | 1048 | $fields[$newField] = ''; |
1049 | - $this->addReloadSelector('.depends-modelViewMoreCriterias-' . $key); |
|
1049 | + $this->addReloadSelector('.depends-modelViewMoreCriterias-'.$key); |
|
1050 | 1050 | } |
1051 | 1051 | $_SESSION['modelViewMoreCriterias'][$key] = $fields; |
1052 | 1052 | return true; |
@@ -1062,7 +1062,7 @@ discard block |
||
1062 | 1062 | } |
1063 | 1063 | $_SESSION['modelViewMoreCriterias'][$key] = $fields; |
1064 | 1064 | } |
1065 | - $this->addReloadSelector('.depends-modelViewMoreCriterias-' . $key); |
|
1065 | + $this->addReloadSelector('.depends-modelViewMoreCriterias-'.$key); |
|
1066 | 1066 | return true; |
1067 | 1067 | } |
1068 | 1068 | |
@@ -1118,17 +1118,17 @@ discard block |
||
1118 | 1118 | |
1119 | 1119 | switch ($format) { |
1120 | 1120 | case 'xlsx': |
1121 | - $tableview->downloadXlsx($filename . '.xlsx'); |
|
1121 | + $tableview->downloadXlsx($filename.'.xlsx'); |
|
1122 | 1122 | break; |
1123 | 1123 | case 'xls': |
1124 | - $tableview->downloadExcel($filename . '.xls'); |
|
1124 | + $tableview->downloadExcel($filename.'.xls'); |
|
1125 | 1125 | break; |
1126 | 1126 | case 'ssv': |
1127 | - $tableview->downloadCsv($filename . '.csv', ';', $inline, 'Windows-1252'); |
|
1127 | + $tableview->downloadCsv($filename.'.csv', ';', $inline, 'Windows-1252'); |
|
1128 | 1128 | break; |
1129 | 1129 | case 'csv': |
1130 | 1130 | default: |
1131 | - $tableview->downloadCsv($filename . '.csv', ',', $inline, BabCharset::getIso()); |
|
1131 | + $tableview->downloadCsv($filename.'.csv', ',', $inline, BabCharset::getIso()); |
|
1132 | 1132 | break; |
1133 | 1133 | } |
1134 | 1134 | } |
@@ -1194,7 +1194,7 @@ discard block |
||
1194 | 1194 | $recordSet = $this->getRecordSet(); |
1195 | 1195 | |
1196 | 1196 | $record = $recordSet->request($id); |
1197 | - if (! $record->isReadable()) { |
|
1197 | + if (!$record->isReadable()) { |
|
1198 | 1198 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1199 | 1199 | } |
1200 | 1200 | |
@@ -1202,7 +1202,7 @@ discard block |
||
1202 | 1202 | |
1203 | 1203 | $recordClassname = $this->getRecordClassName(); |
1204 | 1204 | |
1205 | - $viewClassname = $recordClassname . 'FullFrame'; |
|
1205 | + $viewClassname = $recordClassname.'FullFrame'; |
|
1206 | 1206 | |
1207 | 1207 | $fullFrame = $Ui->$viewClassname($record); |
1208 | 1208 | $fullFrame->setView($view); |
@@ -1217,7 +1217,7 @@ discard block |
||
1217 | 1217 | if (isset($itemId)) { |
1218 | 1218 | $page->setId($itemId); |
1219 | 1219 | } |
1220 | - $page->addClass('depends-' . $this->getRecordClassName()); |
|
1220 | + $page->addClass('depends-'.$this->getRecordClassName()); |
|
1221 | 1221 | |
1222 | 1222 | $page->addToolbar($mainMenu); |
1223 | 1223 | |
@@ -1257,11 +1257,11 @@ discard block |
||
1257 | 1257 | |
1258 | 1258 | if (isset($id)) { |
1259 | 1259 | $record = $recordSet->request($id); |
1260 | - if (! $record->isUpdatable()) { |
|
1260 | + if (!$record->isUpdatable()) { |
|
1261 | 1261 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1262 | 1262 | } |
1263 | 1263 | } else { |
1264 | - if (! $recordSet->isCreatable()) { |
|
1264 | + if (!$recordSet->isCreatable()) { |
|
1265 | 1265 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1266 | 1266 | } |
1267 | 1267 | $record = $recordSet->newRecord(); |
@@ -1297,12 +1297,12 @@ discard block |
||
1297 | 1297 | |
1298 | 1298 | if (isset($id)) { |
1299 | 1299 | $record = $recordSet->request($id); |
1300 | - if (! $record->isUpdatable()) { |
|
1300 | + if (!$record->isUpdatable()) { |
|
1301 | 1301 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1302 | 1302 | } |
1303 | 1303 | $editor->setRecord($record); |
1304 | 1304 | } else { |
1305 | - if (! $recordSet->isCreatable()) { |
|
1305 | + if (!$recordSet->isCreatable()) { |
|
1306 | 1306 | throw new AppAccessException($App->translate('You do not have access to this page')); |
1307 | 1307 | } |
1308 | 1308 | $record = $recordSet->newRecord(); |
@@ -1347,7 +1347,7 @@ discard block |
||
1347 | 1347 | |
1348 | 1348 | $recordTitle = $record->getRecordTitle(); |
1349 | 1349 | |
1350 | - $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"'); |
|
1350 | + $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"'); |
|
1351 | 1351 | return $message; |
1352 | 1352 | } |
1353 | 1353 | |
@@ -1378,14 +1378,14 @@ discard block |
||
1378 | 1378 | * |
1379 | 1379 | * @param AppRecord $record |
1380 | 1380 | */ |
1381 | - protected function preSave(ORMRecord &$record, $data) {} |
|
1381 | + protected function preSave(ORMRecord & $record, $data) {} |
|
1382 | 1382 | |
1383 | 1383 | /** |
1384 | 1384 | * Method for post save actions on record |
1385 | 1385 | * |
1386 | 1386 | * @param AppRecord $record |
1387 | 1387 | */ |
1388 | - protected function postSave(ORMRecord &$record, $data) {} |
|
1388 | + protected function postSave(ORMRecord & $record, $data) {} |
|
1389 | 1389 | |
1390 | 1390 | public function saveDraft($data = null) |
1391 | 1391 | { |
@@ -1417,12 +1417,12 @@ discard block |
||
1417 | 1417 | $pk = $recordSet->getPrimaryKey(); |
1418 | 1418 | $message = null; |
1419 | 1419 | |
1420 | - if (! empty($data[$pk])) { |
|
1420 | + if (!empty($data[$pk])) { |
|
1421 | 1421 | $record = $recordSet->request($data[$pk]); |
1422 | 1422 | $record->deleted = AppTraceableRecord::DELETED_STATUS_EXISTING; |
1423 | 1423 | unset($data[$pk]); |
1424 | 1424 | |
1425 | - if (! $record->isUpdatable()) { |
|
1425 | + if (!$record->isUpdatable()) { |
|
1426 | 1426 | throw new AppAccessException('Access denied'); |
1427 | 1427 | } |
1428 | 1428 | |
@@ -1431,18 +1431,18 @@ discard block |
||
1431 | 1431 | |
1432 | 1432 | $record = $recordSet->newRecord(); |
1433 | 1433 | |
1434 | - if (! $recordSet->isCreatable()) { |
|
1434 | + if (!$recordSet->isCreatable()) { |
|
1435 | 1435 | throw new AppAccessException('Access denied'); |
1436 | 1436 | } |
1437 | 1437 | |
1438 | 1438 | $message = $this->getCreatedMessage(); |
1439 | 1439 | } |
1440 | 1440 | |
1441 | - if (! isset($record)) { |
|
1441 | + if (!isset($record)) { |
|
1442 | 1442 | throw new AppSaveException($App->translate('The record does not exists')); |
1443 | 1443 | } |
1444 | 1444 | |
1445 | - if (! isset($data)) { |
|
1445 | + if (!isset($data)) { |
|
1446 | 1446 | throw new AppSaveException($App->translate('Nothing to save')); |
1447 | 1447 | } |
1448 | 1448 | |
@@ -1455,7 +1455,7 @@ discard block |
||
1455 | 1455 | $this->addToast($message); |
1456 | 1456 | } |
1457 | 1457 | |
1458 | - $this->addReloadSelector('.depends-' . $this->getRecordClassName()); |
|
1458 | + $this->addReloadSelector('.depends-'.$this->getRecordClassName()); |
|
1459 | 1459 | return true; |
1460 | 1460 | } |
1461 | 1461 | |
@@ -1478,7 +1478,7 @@ discard block |
||
1478 | 1478 | |
1479 | 1479 | $record = $recordSet->request($id); |
1480 | 1480 | |
1481 | - if (! $record->isDeletable()) { |
|
1481 | + if (!$record->isDeletable()) { |
|
1482 | 1482 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1483 | 1483 | } |
1484 | 1484 | $deletedMessage = $this->getDeletedMessage($record); |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | $this->addToast($deletedMessage); |
1488 | 1488 | } |
1489 | 1489 | |
1490 | - $this->addReloadSelector('.depends-' . $record->getClassName()); |
|
1490 | + $this->addReloadSelector('.depends-'.$record->getClassName()); |
|
1491 | 1491 | |
1492 | 1492 | return true; |
1493 | 1493 | } |
@@ -1511,7 +1511,7 @@ discard block |
||
1511 | 1511 | $page->addClass('app-page-editor'); |
1512 | 1512 | $page->setTitle($App->translate('Deletion')); |
1513 | 1513 | |
1514 | - if (! isset($record)) { |
|
1514 | + if (!isset($record)) { |
|
1515 | 1515 | $page->addItem($W->Label($App->translate('This element does not exists.'))); |
1516 | 1516 | $page->addClass('alert', 'alert-warning'); |
1517 | 1517 | return $page; |
@@ -1524,7 +1524,7 @@ discard block |
||
1524 | 1524 | |
1525 | 1525 | $recordTitle = $record->getRecordTitle(); |
1526 | 1526 | |
1527 | - $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"'; |
|
1527 | + $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"'; |
|
1528 | 1528 | $form->addItem($W->Title($subTitle, 5)); |
1529 | 1529 | |
1530 | 1530 | $form->addItem($W->Title($App->translate('Confirm delete?'), 6)); |
@@ -1563,7 +1563,7 @@ discard block |
||
1563 | 1563 | |
1564 | 1564 | $record = $recordSet->request($id); |
1565 | 1565 | |
1566 | - if (! $record->isRemovable()) { |
|
1566 | + if (!$record->isRemovable()) { |
|
1567 | 1567 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1568 | 1568 | } |
1569 | 1569 | |
@@ -1576,7 +1576,7 @@ discard block |
||
1576 | 1576 | } |
1577 | 1577 | } |
1578 | 1578 | |
1579 | - $this->addReloadSelector('.depends-' . $record->getClassName()); |
|
1579 | + $this->addReloadSelector('.depends-'.$record->getClassName()); |
|
1580 | 1580 | |
1581 | 1581 | return true; |
1582 | 1582 | } |
@@ -1604,7 +1604,7 @@ discard block |
||
1604 | 1604 | |
1605 | 1605 | $recordTitle = $record->getRecordTitle(); |
1606 | 1606 | |
1607 | - $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"'; |
|
1607 | + $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"'; |
|
1608 | 1608 | $form->addItem($W->Title($subTitle, 5)); |
1609 | 1609 | |
1610 | 1610 | $form->addItem($W->Title($App->translate('Confirm delete?'), 6)); |
@@ -1646,10 +1646,10 @@ discard block |
||
1646 | 1646 | $record = null; |
1647 | 1647 | foreach ($records as $record) { |
1648 | 1648 | } |
1649 | - if (! isset($record)) { |
|
1649 | + if (!isset($record)) { |
|
1650 | 1650 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1651 | 1651 | } |
1652 | - if (! $record->isRestorable()) { |
|
1652 | + if (!$record->isRestorable()) { |
|
1653 | 1653 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1654 | 1654 | } |
1655 | 1655 | |
@@ -1660,7 +1660,7 @@ discard block |
||
1660 | 1660 | $record->save(); |
1661 | 1661 | $this->addToast($deletedMessage); |
1662 | 1662 | |
1663 | - $this->addReloadSelector('.depends-' . $record->getClassName()); |
|
1663 | + $this->addReloadSelector('.depends-'.$record->getClassName()); |
|
1664 | 1664 | |
1665 | 1665 | return true; |
1666 | 1666 | } |
@@ -1682,7 +1682,7 @@ discard block |
||
1682 | 1682 | $record = null; |
1683 | 1683 | foreach ($records as $record) { |
1684 | 1684 | } |
1685 | - if (! isset($record)) { |
|
1685 | + if (!isset($record)) { |
|
1686 | 1686 | throw new AppAccessException('Sorry, You are not allowed to perform this operation'); |
1687 | 1687 | } |
1688 | 1688 | |
@@ -1695,7 +1695,7 @@ discard block |
||
1695 | 1695 | |
1696 | 1696 | $recordTitle = $record->getRecordTitle(); |
1697 | 1697 | |
1698 | - $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"'; |
|
1698 | + $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"'; |
|
1699 | 1699 | $form->addItem($W->Title($subTitle, 5)); |
1700 | 1700 | |
1701 | 1701 | $confirmedAction = $this->proxy()->restore($id); |
@@ -1805,14 +1805,14 @@ discard block |
||
1805 | 1805 | $registry = bab_getRegistryInstance(); |
1806 | 1806 | |
1807 | 1807 | $userId = '0'; |
1808 | - $registry->changeDirectory('/widgets/user/' . $userId . '/' . $id . '/filters'); |
|
1808 | + $registry->changeDirectory('/widgets/user/'.$userId.'/'.$id.'/filters'); |
|
1809 | 1809 | |
1810 | 1810 | while ($filterName = $registry->fetchChildKey()) { |
1811 | 1811 | $filters[] = $filterName; |
1812 | 1812 | } |
1813 | 1813 | |
1814 | 1814 | $userId = bab_getUserId(); |
1815 | - $registry->changeDirectory('/widgets/user/' . $userId . '/' . $id . '/filters'); |
|
1815 | + $registry->changeDirectory('/widgets/user/'.$userId.'/'.$id.'/filters'); |
|
1816 | 1816 | |
1817 | 1817 | while ($filterName = $registry->fetchChildKey()) { |
1818 | 1818 | $filters[] = $filterName; |
@@ -1831,15 +1831,15 @@ discard block |
||
1831 | 1831 | { |
1832 | 1832 | $W = bab_Widgets(); |
1833 | 1833 | $tableview = $this->modelView(null, 'table'); |
1834 | - $W->setUserConfiguration($tableview->getId() . '/currentFilterName', $filterName, 'widgets', false); |
|
1834 | + $W->setUserConfiguration($tableview->getId().'/currentFilterName', $filterName, 'widgets', false); |
|
1835 | 1835 | |
1836 | 1836 | $registry = bab_getRegistryInstance(); |
1837 | 1837 | $userId = '0'; |
1838 | - $registry->changeDirectory('/widgets/user/' . $userId . '/' . $tableview->getId() . '/filters'); |
|
1838 | + $registry->changeDirectory('/widgets/user/'.$userId.'/'.$tableview->getId().'/filters'); |
|
1839 | 1839 | $filterValues = $registry->getValue($filterName); |
1840 | 1840 | |
1841 | - if (! $filterValues) { |
|
1842 | - $filterValues = $W->getUserConfiguration($tableview->getId() . '/filters/' . $filterName, 'widgets', false); |
|
1841 | + if (!$filterValues) { |
|
1842 | + $filterValues = $W->getUserConfiguration($tableview->getId().'/filters/'.$filterName, 'widgets', false); |
|
1843 | 1843 | } |
1844 | 1844 | |
1845 | 1845 | $tableview = $this->modelView($filterValues, 'table'); |
@@ -1855,7 +1855,7 @@ discard block |
||
1855 | 1855 | { |
1856 | 1856 | $W = bab_Widgets(); |
1857 | 1857 | $id = $this->getModelViewDefaultId(); |
1858 | - $filter = $W->getUserConfiguration($id . '/currentFilterName', 'widgets', false); |
|
1858 | + $filter = $W->getUserConfiguration($id.'/currentFilterName', 'widgets', false); |
|
1859 | 1859 | |
1860 | 1860 | return $filter; |
1861 | 1861 | } |
@@ -1868,7 +1868,7 @@ discard block |
||
1868 | 1868 | if (isset($name)) { |
1869 | 1869 | $W = bab_Widgets(); |
1870 | 1870 | // @TODO : fix missing parameters |
1871 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false); |
|
1871 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false); |
|
1872 | 1872 | $filterValues = $filter['values']; |
1873 | 1873 | } else { |
1874 | 1874 | $filterValues = null; |
@@ -1905,7 +1905,7 @@ discard block |
||
1905 | 1905 | 'values' => $filterValues |
1906 | 1906 | ); |
1907 | 1907 | |
1908 | - $W->setUserConfiguration($tableview->getId() . '/filters/' . $name, $data, 'widgets', false); |
|
1908 | + $W->setUserConfiguration($tableview->getId().'/filters/'.$name, $data, 'widgets', false); |
|
1909 | 1909 | |
1910 | 1910 | return true; |
1911 | 1911 | } |
@@ -1922,7 +1922,7 @@ discard block |
||
1922 | 1922 | $Ui = $App->Ui(); |
1923 | 1923 | |
1924 | 1924 | $currentFilterName = $this->getCurrentFilterName(); |
1925 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $currentFilterName, 'widgets', false); |
|
1925 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$currentFilterName, 'widgets', false); |
|
1926 | 1926 | |
1927 | 1927 | $page = $Ui->Page(); |
1928 | 1928 | |
@@ -1965,7 +1965,7 @@ discard block |
||
1965 | 1965 | $App = $this->App(); |
1966 | 1966 | $Ui = $App->Ui(); |
1967 | 1967 | |
1968 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false); |
|
1968 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false); |
|
1969 | 1969 | |
1970 | 1970 | $page = $Ui->Page(); |
1971 | 1971 | |
@@ -2013,7 +2013,7 @@ discard block |
||
2013 | 2013 | |
2014 | 2014 | $filterNames = $this->getFilterNames(); |
2015 | 2015 | foreach ($filterNames as $filterName) { |
2016 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $filterName, 'widgets', false); |
|
2016 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$filterName, 'widgets', false); |
|
2017 | 2017 | |
2018 | 2018 | $filterBox = $W->HBoxItems() |
2019 | 2019 | ->setVerticalAlign('middle') |
@@ -2052,7 +2052,7 @@ discard block |
||
2052 | 2052 | $App = $this->App(); |
2053 | 2053 | $Ui = $App->Ui(); |
2054 | 2054 | |
2055 | - $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false); |
|
2055 | + $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false); |
|
2056 | 2056 | |
2057 | 2057 | $page = $Ui->Page(); |
2058 | 2058 | |
@@ -2084,7 +2084,7 @@ discard block |
||
2084 | 2084 | $this->requireDeleteMethod(); |
2085 | 2085 | |
2086 | 2086 | $W = bab_Widgets(); |
2087 | - $W->deleteUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false); |
|
2087 | + $W->deleteUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false); |
|
2088 | 2088 | |
2089 | 2089 | return true; |
2090 | 2090 | } |
@@ -2094,7 +2094,7 @@ discard block |
||
2094 | 2094 | $modelView = $this->modelView(); |
2095 | 2095 | $modelView->setHighlightedRows($ids); |
2096 | 2096 | |
2097 | - $this->addReloadSelector('.depends-' . $modelView->getId() . '-HighlightedRecords'); |
|
2097 | + $this->addReloadSelector('.depends-'.$modelView->getId().'-HighlightedRecords'); |
|
2098 | 2098 | |
2099 | 2099 | return true; |
2100 | 2100 | } |
@@ -2104,7 +2104,7 @@ discard block |
||
2104 | 2104 | $modelView = $this->modelView(); |
2105 | 2105 | $modelView->clearHighlightedRows(); |
2106 | 2106 | |
2107 | - $this->addReloadSelector('.depends-' . $modelView->getId() . '-HighlightedRecords'); |
|
2107 | + $this->addReloadSelector('.depends-'.$modelView->getId().'-HighlightedRecords'); |
|
2108 | 2108 | |
2109 | 2109 | return true; |
2110 | 2110 | } |
@@ -2124,7 +2124,7 @@ discard block |
||
2124 | 2124 | $W = bab_Widgets(); |
2125 | 2125 | $inSession = false; |
2126 | 2126 | // $inSession = true; |
2127 | - $highlightedRows = $W->getUserConfiguration($modelViewId . '/highlightedRows', 'widgets', $inSession); |
|
2127 | + $highlightedRows = $W->getUserConfiguration($modelViewId.'/highlightedRows', 'widgets', $inSession); |
|
2128 | 2128 | |
2129 | 2129 | |
2130 | 2130 | $recordSet = $this->getRecordSet(); |
@@ -2145,7 +2145,7 @@ discard block |
||
2145 | 2145 | // else{ |
2146 | 2146 | $Ui = $App->Ui(); |
2147 | 2147 | $recordClassname = $this->getRecordClassName(); |
2148 | - $viewClassname = $recordClassname . 'FullFrame'; |
|
2148 | + $viewClassname = $recordClassname.'FullFrame'; |
|
2149 | 2149 | // } |
2150 | 2150 | |
2151 | 2151 | if ($records->count() > 0) { |
@@ -2153,7 +2153,7 @@ discard block |
||
2153 | 2153 | ->clearHighlightedRecords()) |
2154 | 2154 | ->setAjaxAction(null, false) |
2155 | 2155 | ->addClass('icon', FuncIcons::ACTIONS_ARROW_RIGHT_DOUBLE, "app_closeHighlightButton") |
2156 | - ->setSizePolicy(FuncIcons::ICON_LEFT_32 . ' pull-right')); |
|
2156 | + ->setSizePolicy(FuncIcons::ICON_LEFT_32.' pull-right')); |
|
2157 | 2157 | |
2158 | 2158 | foreach ($records as $record) { |
2159 | 2159 | |
@@ -2172,7 +2172,7 @@ discard block |
||
2172 | 2172 | $box->addClass('box', 'shadow'); |
2173 | 2173 | } |
2174 | 2174 | |
2175 | - $box->addClass('depends-' . $modelViewId . '-HighlightedRecords'); |
|
2175 | + $box->addClass('depends-'.$modelViewId.'-HighlightedRecords'); |
|
2176 | 2176 | $box->setReloadAction($this->proxy() |
2177 | 2177 | ->previewHighlightedRecords($view)); |
2178 | 2178 | return $box; |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | use function Cofy\Utilities\User\bab_isUserAdministrator; |
64 | 64 | use function Cofy\Utilities\User\bab_isUserLogged; |
65 | 65 | |
66 | -require_once dirname(__FILE__) . '/../functions.php'; |
|
66 | +require_once dirname(__FILE__).'/../functions.php'; |
|
67 | 67 | |
68 | 68 | /** |
69 | 69 | * @method self proxy() |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | */ |
239 | 239 | public function isAjaxRequest() |
240 | 240 | { |
241 | - if (! isset($this->isAjaxRequest)) { |
|
241 | + if (!isset($this->isAjaxRequest)) { |
|
242 | 242 | $this->isAjaxRequest = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); |
243 | 243 | } |
244 | 244 | return $this->isAjaxRequest; |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | $authType = ''; |
257 | 257 | } |
258 | 258 | |
259 | - if (! isset($message)) { |
|
259 | + if (!isset($message)) { |
|
260 | 260 | $message = $this->App()->translate('You must be logged in to access this page.'); |
261 | 261 | } |
262 | 262 | |
@@ -280,10 +280,10 @@ discard block |
||
280 | 280 | list($prefix) = explode('_', __CLASS__); |
281 | 281 | $functionalityName = ucwords($prefix); |
282 | 282 | /** @var FuncApp */ |
283 | - $App = BabFunctionality::get('App/' . $functionalityName); |
|
283 | + $App = BabFunctionality::get('App/'.$functionalityName); |
|
284 | 284 | |
285 | 285 | if (!$App) { |
286 | - throw new AppException('Faild to autodetect functionality App/' . $functionalityName . ', the getInstance method is deprecated, use $App->ControllerProxy() instead'); |
|
286 | + throw new AppException('Faild to autodetect functionality App/'.$functionalityName.', the getInstance method is deprecated, use $App->ControllerProxy() instead'); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | $controller = $App->ControllerProxy($classname, $proxy); |
@@ -301,14 +301,14 @@ discard block |
||
301 | 301 | static function getProxyInstance(?BabFunctionality $App = null, $classname) |
302 | 302 | { |
303 | 303 | $class = new \ReflectionClass($classname); |
304 | - $proxyClassname = $class->getShortName() . self::PROXY_CLASS_SUFFIX; |
|
305 | - $finalProxyClassname = $class->getNamespaceName() . "\\" . $proxyClassname; |
|
306 | - if (! class_exists($finalProxyClassname)) { |
|
304 | + $proxyClassname = $class->getShortName().self::PROXY_CLASS_SUFFIX; |
|
305 | + $finalProxyClassname = $class->getNamespaceName()."\\".$proxyClassname; |
|
306 | + if (!class_exists($finalProxyClassname)) { |
|
307 | 307 | $classStr = ""; |
308 | 308 | if ($class->getNamespaceName() != "") { |
309 | - $classStr .= " namespace " . $class->getNamespaceName() . "; "; |
|
309 | + $classStr .= " namespace ".$class->getNamespaceName()."; "; |
|
310 | 310 | } |
311 | - $classStr .= 'class ' . $proxyClassname . ' extends ' . $class->getShortName() . ' {' . "\n"; |
|
311 | + $classStr .= 'class '.$proxyClassname.' extends '.$class->getShortName().' {'."\n"; |
|
312 | 312 | $methods = $class->getMethods(); |
313 | 313 | |
314 | 314 | $classStr .= ' public function __construct($App) { |
@@ -316,11 +316,11 @@ discard block |
||
316 | 316 | }' . "\n"; |
317 | 317 | |
318 | 318 | foreach ($methods as $method) { |
319 | - if ($method->name === '__construct' || ! $method->isPublic() || $method->isStatic() || $method->isFinal() || $method->name === 'setApp' || $method->name === 'App' || $method->name === 'setCrm' || $method->name === 'Crm') { |
|
319 | + if ($method->name === '__construct' || !$method->isPublic() || $method->isStatic() || $method->isFinal() || $method->name === 'setApp' || $method->name === 'App' || $method->name === 'setCrm' || $method->name === 'Crm') { |
|
320 | 320 | continue; |
321 | 321 | } |
322 | 322 | |
323 | - $classStr .= ' public function ' . $method->name . '('; |
|
323 | + $classStr .= ' public function '.$method->name.'('; |
|
324 | 324 | $types = array(); |
325 | 325 | if ($type = $method->getReturnType()) { |
326 | 326 | if ($type instanceof ReflectionUnionType) { |
@@ -340,22 +340,22 @@ discard block |
||
340 | 340 | $reference = "&"; |
341 | 341 | } |
342 | 342 | if ($parameter->isDefaultValueAvailable()) { |
343 | - $parametersStr[] = $reference . '$' . $parameter->name . ' = ' . var_export($parameter->getDefaultValue(), true); |
|
343 | + $parametersStr[] = $reference.'$'.$parameter->name.' = '.var_export($parameter->getDefaultValue(), true); |
|
344 | 344 | } else { |
345 | - $parametersStr[] = $reference . '$' . $parameter->name; |
|
345 | + $parametersStr[] = $reference.'$'.$parameter->name; |
|
346 | 346 | } |
347 | 347 | } |
348 | 348 | $classStr .= implode(', ', $parametersStr); |
349 | 349 | $classStr .= ')'; |
350 | 350 | if (count($types) != 0) { |
351 | - $classStr .= ':' . implode('|', $types); |
|
351 | + $classStr .= ':'.implode('|', $types); |
|
352 | 352 | } |
353 | - $classStr .= '{' . "\n"; |
|
354 | - $classStr .= ' $args = func_get_args();' . "\n"; |
|
355 | - $classStr .= ' return $this->getMethodAction(__FUNCTION__, $args);' . "\n"; |
|
356 | - $classStr .= ' }' . "\n"; |
|
353 | + $classStr .= '{'."\n"; |
|
354 | + $classStr .= ' $args = func_get_args();'."\n"; |
|
355 | + $classStr .= ' return $this->getMethodAction(__FUNCTION__, $args);'."\n"; |
|
356 | + $classStr .= ' }'."\n"; |
|
357 | 357 | } |
358 | - $classStr .= '}' . "\n"; |
|
358 | + $classStr .= '}'."\n"; |
|
359 | 359 | // We define the proxy class |
360 | 360 | eval($classStr); |
361 | 361 | } |
@@ -430,8 +430,8 @@ discard block |
||
430 | 430 | |
431 | 431 | $rc = new ReflectionClass($fullClassName); |
432 | 432 | |
433 | - if (! $rc->hasMethod($methodName)) { |
|
434 | - throw new BabInvalidActionException($fullClassName . '::' . $methodName); |
|
433 | + if (!$rc->hasMethod($methodName)) { |
|
434 | + throw new BabInvalidActionException($fullClassName.'::'.$methodName); |
|
435 | 435 | } |
436 | 436 | $method = new ReflectionMethod($fullClassName, $methodName); |
437 | 437 | |
@@ -454,7 +454,7 @@ discard block |
||
454 | 454 | |
455 | 455 | $action = new WidgetAction(); |
456 | 456 | |
457 | - $action->setMethod($this->getControllerTg(), $objectName . '.' . $methodName, $actionParams); |
|
457 | + $action->setMethod($this->getControllerTg(), $objectName.'.'.$methodName, $actionParams); |
|
458 | 458 | |
459 | 459 | $docComment = $method->getDocComment(); |
460 | 460 | if (strpos($docComment, '@ajax') !== false) { |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | |
495 | 495 | list(,, $file) = explode('/', $App->controllerTg); |
496 | 496 | |
497 | - $action->setParameter('addon', $App->getAddonName() . '.' . $file); |
|
497 | + $action->setParameter('addon', $App->getAddonName().'.'.$file); |
|
498 | 498 | $action->setParameter('idx', $idx); |
499 | 499 | |
500 | 500 | return $action; |
@@ -512,13 +512,13 @@ discard block |
||
512 | 512 | |
513 | 513 | $method = $action->getMethod(); |
514 | 514 | $returnedValue = null; |
515 | - if (! isset($method) || '' === $method) { |
|
515 | + if (!isset($method) || '' === $method) { |
|
516 | 516 | return false; |
517 | 517 | } |
518 | 518 | |
519 | 519 | list($objectName,) = explode('.', $method); |
520 | 520 | |
521 | - if (! method_exists($this, $objectName)) { |
|
521 | + if (!method_exists($this, $objectName)) { |
|
522 | 522 | /* @var $component AppComponent */ |
523 | 523 | $component = $this->app->getComponentByName($objectName); |
524 | 524 | if ($component) { |
@@ -530,9 +530,9 @@ discard block |
||
530 | 530 | } |
531 | 531 | } |
532 | 532 | |
533 | - if (! isset($component)) { |
|
533 | + if (!isset($component)) { |
|
534 | 534 | $objectController = $this->{$objectName}(false); |
535 | - if (! ($objectController instanceof AppController)) { |
|
535 | + if (!($objectController instanceof AppController)) { |
|
536 | 536 | return false; |
537 | 537 | } |
538 | 538 | } |
@@ -541,12 +541,12 @@ discard block |
||
541 | 541 | $returnedValue = $objectController->execAction($action); |
542 | 542 | } catch (AppAccessException $e) { |
543 | 543 | |
544 | - if (! bab_isUserLogged() && $e->requireCredential) { |
|
544 | + if (!bab_isUserLogged() && $e->requireCredential) { |
|
545 | 545 | bab_requireCredential($e->getMessage()); |
546 | 546 | } else { |
547 | 547 | if ($this->isAjaxRequest()) { |
548 | 548 | |
549 | - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
|
549 | + header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403); |
|
550 | 550 | |
551 | 551 | die(bab_json_encode(array( |
552 | 552 | 'exception' => 'app_AccessException', |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | } catch (AppSaveException $e) { |
560 | 560 | |
561 | 561 | if ($this->isAjaxRequest()) { |
562 | - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
|
562 | + header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403); |
|
563 | 563 | header('Cache-Control: no-cache, must-revalidate'); |
564 | 564 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
565 | 565 | header('Content-type: application/json'); |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | |
585 | 585 | if ($returnedValue instanceof WidgetItem) { |
586 | 586 | |
587 | - if ($returnedValue instanceof WidgetBabPage && ! $this->isAjaxRequest()) { |
|
587 | + if ($returnedValue instanceof WidgetBabPage && !$this->isAjaxRequest()) { |
|
588 | 588 | |
589 | 589 | // If the action returned a page, we display it. |
590 | 590 | $returnedValue->displayHtml(); |
@@ -610,7 +610,7 @@ discard block |
||
610 | 610 | if (method_exists($htmlCanvas, 'sendPageTitle')) { |
611 | 611 | $htmlCanvas->sendPageTitle($pageTitle); |
612 | 612 | } else { |
613 | - header('X-Cto-PageTitle: ' . $pageTitle); |
|
613 | + header('X-Cto-PageTitle: '.$pageTitle); |
|
614 | 614 | } |
615 | 615 | } |
616 | 616 | $html = $returnedValue->display($htmlCanvas); |
@@ -676,7 +676,7 @@ discard block |
||
676 | 676 | protected function deletedItemPage(WidgetAction $action, AppDeletedRecordException $e) |
677 | 677 | { |
678 | 678 | if ($this->isAjaxRequest()) { |
679 | - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
|
679 | + header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403); |
|
680 | 680 | header('Cache-Control: no-cache, must-revalidate'); |
681 | 681 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
682 | 682 | header('Content-type: application/json'); |
@@ -689,7 +689,7 @@ discard block |
||
689 | 689 | ) |
690 | 690 | )); |
691 | 691 | } |
692 | - header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404); |
|
692 | + header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404); |
|
693 | 693 | |
694 | 694 | $App = app_App(); |
695 | 695 | $W = bab_Widgets(); |
@@ -721,7 +721,7 @@ discard block |
||
721 | 721 | protected function notFoundPage(WidgetAction $action, AppNotFoundException $e) |
722 | 722 | { |
723 | 723 | if ($this->isAjaxRequest()) { |
724 | - $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle() . ' (' . $e->getId() . ')'); |
|
724 | + $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle().' ('.$e->getId().')'); |
|
725 | 725 | $json = array( |
726 | 726 | 'messages' => array( |
727 | 727 | array( |
@@ -733,7 +733,7 @@ discard block |
||
733 | 733 | echo bab_json_encode($json); |
734 | 734 | die(); |
735 | 735 | } |
736 | - header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404); |
|
736 | + header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404); |
|
737 | 737 | header('Cache-Control: no-cache, must-revalidate'); |
738 | 738 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
739 | 739 | |
@@ -763,7 +763,7 @@ discard block |
||
763 | 763 | protected function unexpectedErrorPage(\Exception $e) |
764 | 764 | { |
765 | 765 | if ($this->isAjaxRequest()) { |
766 | - $message = sprintf(app_translate('An unexpected error occured') . ':' . '%s', $e->getMessage()); |
|
766 | + $message = sprintf(app_translate('An unexpected error occured').':'.'%s', $e->getMessage()); |
|
767 | 767 | $json = array( |
768 | 768 | 'messages' => array( |
769 | 769 | array( |
@@ -775,7 +775,7 @@ discard block |
||
775 | 775 | echo bab_json_encode($json); |
776 | 776 | die(); |
777 | 777 | } |
778 | - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal server error', true, 500); |
|
778 | + header($_SERVER['SERVER_PROTOCOL'].' 500 Internal server error', true, 500); |
|
779 | 779 | header('Cache-Control: no-cache, must-revalidate'); |
780 | 780 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
781 | 781 | |
@@ -799,11 +799,11 @@ discard block |
||
799 | 799 | ->addClass('widget-50pc alert alert-danger') |
800 | 800 | ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL)); |
801 | 801 | |
802 | - $logCode = '#' . hrtime(true); |
|
802 | + $logCode = '#'.hrtime(true); |
|
803 | 803 | $message = addcslashes($e->getMessage(), "\000..\037\177..\377\\"); |
804 | 804 | $trace = addcslashes($e->getTraceAsString(), "\000..\037\177..\377\\"); |
805 | 805 | |
806 | - error_log(sprintf('Error %s : %s', $logCode, $message) . PHP_EOL . $trace); |
|
806 | + error_log(sprintf('Error %s : %s', $logCode, $message).PHP_EOL.$trace); |
|
807 | 807 | |
808 | 808 | $section->addItems($W->Title($App->translate('Error'), 1), $W->Title($App->translate('An unexpected error occured')), $W->Label(sprintf($App->translate('It has been logged with the following error code : %s'), $logCode))); |
809 | 809 | |
@@ -826,7 +826,7 @@ discard block |
||
826 | 826 | protected function errorPage(\Exception $e) |
827 | 827 | { |
828 | 828 | if ($this->isAjaxRequest()) { |
829 | - $message = sprintf(app_translate('An unexpected error occured') . ':' . '%s', $e->getMessage()); |
|
829 | + $message = sprintf(app_translate('An unexpected error occured').':'.'%s', $e->getMessage()); |
|
830 | 830 | $json = array( |
831 | 831 | 'messages' => array( |
832 | 832 | array( |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | echo bab_json_encode($json); |
839 | 839 | die(); |
840 | 840 | } |
841 | - header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal server error', true, 500); |
|
841 | + header($_SERVER['SERVER_PROTOCOL'].' 500 Internal server error', true, 500); |
|
842 | 842 | header('Cache-Control: no-cache, must-revalidate'); |
843 | 843 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
844 | 844 | |
@@ -862,11 +862,11 @@ discard block |
||
862 | 862 | ->addClass('widget-50pc alert alert-danger') |
863 | 863 | ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL)); |
864 | 864 | |
865 | - $logCode = '#' . hrtime(true); |
|
865 | + $logCode = '#'.hrtime(true); |
|
866 | 866 | $message = addcslashes($e->getMessage(), "\000..\037\177..\377\\"); |
867 | 867 | $trace = addcslashes($e->getTraceAsString(), "\000..\037\177..\377\\"); |
868 | 868 | |
869 | - error_log(sprintf('Error %s : %s', $logCode, $message) . PHP_EOL . $trace); |
|
869 | + error_log(sprintf('Error %s : %s', $logCode, $message).PHP_EOL.$trace); |
|
870 | 870 | |
871 | 871 | $section->addItems($W->Title($App->translate('Error'), 1), $W->Title($App->translate('An unexpected error occured')), $W->Label(sprintf($App->translate('It has been logged with the following error code : %s'), $logCode))); |
872 | 872 | |
@@ -901,7 +901,7 @@ discard block |
||
901 | 901 | echo bab_json_encode($json); |
902 | 902 | die(); |
903 | 903 | } |
904 | - header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403); |
|
904 | + header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403); |
|
905 | 905 | header('Cache-Control: no-cache, must-revalidate'); |
906 | 906 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
907 | 907 | |
@@ -985,7 +985,7 @@ discard block |
||
985 | 985 | 'position' => $position |
986 | 986 | ); |
987 | 987 | $babBody = bab_getBody(); |
988 | - if (! isset($babBody->messages['toasts'])) { |
|
988 | + if (!isset($babBody->messages['toasts'])) { |
|
989 | 989 | $babBody->messages['toasts'] = array(); |
990 | 990 | } |
991 | 991 | $babBody->messages['toasts'][] = $toast; |
@@ -65,13 +65,13 @@ discard block |
||
65 | 65 | |
66 | 66 | bab_Widgets(); |
67 | 67 | |
68 | -require_once dirname(__FILE__) . '/define.php'; |
|
69 | -require_once dirname(__FILE__) . '/functions.php'; |
|
68 | +require_once dirname(__FILE__).'/define.php'; |
|
69 | +require_once dirname(__FILE__).'/functions.php'; |
|
70 | 70 | |
71 | 71 | $libappAddon = bab_getAddonInfosInstance('libapp'); |
72 | 72 | $libappPhpPath = $libappAddon->getPhpPath(); |
73 | 73 | |
74 | -require_once $libappPhpPath . '../vendor/autoload.php'; |
|
74 | +require_once $libappPhpPath.'../vendor/autoload.php'; |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Provides extensible functionalities to manage an application. |
@@ -107,13 +107,13 @@ discard block |
||
107 | 107 | $this->addonPrefix = 'app'; |
108 | 108 | |
109 | 109 | $this->classPrefix = 'App'; |
110 | - $this->controllerTg = 'addon/' . $this->addonName . '/main'; |
|
110 | + $this->controllerTg = 'addon/'.$this->addonName.'/main'; |
|
111 | 111 | |
112 | 112 | $addon = bab_getAddonInfosInstance($this->addonName); |
113 | 113 | $this->phpPath = $addon->getPhpPath(); |
114 | 114 | $this->recordSetPath = $this->phpPath; |
115 | 115 | $this->ctrlPath = $this->phpPath; |
116 | - $this->uiPath = $this->phpPath . 'ui/'; |
|
116 | + $this->uiPath = $this->phpPath.'ui/'; |
|
117 | 117 | |
118 | 118 | $babDB = bab_GetDatabaseInstance(); |
119 | 119 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | public function addComponentsFromName($componentName) |
128 | 128 | { |
129 | - $componentDefinitionObjectName = 'Capwelton\App\\' . $componentName . '\ComponentDefinition\ComponentDefinition'; |
|
129 | + $componentDefinitionObjectName = 'Capwelton\App\\'.$componentName.'\ComponentDefinition\ComponentDefinition'; |
|
130 | 130 | if (class_exists($componentDefinitionObjectName)) { |
131 | 131 | $componentDefinition = new $componentDefinitionObjectName; |
132 | 132 | $components = $componentDefinition->getComponents($this); |
@@ -271,8 +271,8 @@ discard block |
||
271 | 271 | public function getRecordSetPathname($class) |
272 | 272 | { |
273 | 273 | // $App->MyRecordSet() -> myrecord.class.php |
274 | - $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php'; |
|
275 | - return $this->recordSetPath . $file; |
|
274 | + $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php'; |
|
275 | + return $this->recordSetPath.$file; |
|
276 | 276 | } |
277 | 277 | |
278 | 278 | /** |
@@ -284,8 +284,8 @@ discard block |
||
284 | 284 | public function getRecordPathname($class) |
285 | 285 | { |
286 | 286 | // $App->MyRecord() -> myrecord.class.php |
287 | - $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php'; |
|
288 | - return $this->recordSetPath . $file; |
|
287 | + $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php'; |
|
288 | + return $this->recordSetPath.$file; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | /** |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | |
386 | 386 | if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') { |
387 | 387 | $incl = $method; |
388 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
388 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
389 | 389 | |
390 | 390 | |
391 | 391 | $classname = $this->$classNameMethod(); |
@@ -409,7 +409,7 @@ discard block |
||
409 | 409 | // We need to revert to multilang fields before synchronizing. |
410 | 410 | $set->useLang(false); |
411 | 411 | } |
412 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
412 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
413 | 413 | } |
414 | 414 | } |
415 | 415 | } |
@@ -431,11 +431,11 @@ discard block |
||
431 | 431 | return $methods; |
432 | 432 | } |
433 | 433 | |
434 | - $lines = array_map(function ($line) { |
|
434 | + $lines = array_map(function($line) { |
|
435 | 435 | return trim($line, " *"); |
436 | 436 | }, explode("\n", $doc)); |
437 | 437 | |
438 | - $lines = array_filter($lines, function ($line) { |
|
438 | + $lines = array_filter($lines, function($line) { |
|
439 | 439 | return strpos($line, "@method") === 0; |
440 | 440 | }); |
441 | 441 | |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | // We need to revert to multilang fields before synchronizing. |
479 | 479 | $set->useLang(false); |
480 | 480 | } |
481 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
481 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
482 | 482 | |
483 | 483 | if (empty($component->getPackageName())) { |
484 | 484 | $noPackageNames[] = $component->getName(); |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | return null; |
548 | 548 | } |
549 | 549 | |
550 | - require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php'; |
|
550 | + require_once $GLOBALS['babInstallPath'].'utilit/devtools.php'; |
|
551 | 551 | $mysqlbackend = new ORMMySqlBackend($GLOBALS['babDB']); |
552 | 552 | $sql = ''; |
553 | 553 | |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | |
556 | 556 | if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') { |
557 | 557 | $incl = $method; |
558 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
558 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
559 | 559 | |
560 | 560 | $classname = $this->$classNameMethod(); |
561 | 561 | |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | |
571 | 571 | if (class_exists($classname) && method_exists($this, $call)) { |
572 | 572 | $set = $this->$call(); |
573 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
573 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
574 | 574 | } |
575 | 575 | } |
576 | 576 | } |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | |
585 | 585 | public function includeBase() |
586 | 586 | { |
587 | - require_once APP_PHP_PATH . 'base.class.php'; |
|
587 | + require_once APP_PHP_PATH.'base.class.php'; |
|
588 | 588 | } |
589 | 589 | |
590 | 590 | /** |
@@ -626,7 +626,7 @@ discard block |
||
626 | 626 | public function getRecordSetByRef($recordClassname) |
627 | 627 | { |
628 | 628 | $recordClassname = str_replace($this->classPrefix, '', $recordClassname); |
629 | - $classSet = $recordClassname . 'Set'; |
|
629 | + $classSet = $recordClassname.'Set'; |
|
630 | 630 | $set = $this->$classSet(); |
631 | 631 | return $set; |
632 | 632 | } |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | { |
667 | 667 | $fullClassName = get_class($record); |
668 | 668 | list(, $className) = explode('_', $fullClassName); |
669 | - return $className . ':' . $record->id; |
|
669 | + return $className.':'.$record->id; |
|
670 | 670 | } |
671 | 671 | |
672 | 672 | |
@@ -778,16 +778,16 @@ discard block |
||
778 | 778 | */ |
779 | 779 | public function mailTo($addr, $subject = null, $body = null) |
780 | 780 | { |
781 | - $mailTo = 'mailto:' . $addr; |
|
781 | + $mailTo = 'mailto:'.$addr; |
|
782 | 782 | $parameters = array(); |
783 | 783 | if (isset($subject)) { |
784 | - $parameters[] = 'subject=' . $subject; |
|
784 | + $parameters[] = 'subject='.$subject; |
|
785 | 785 | } |
786 | 786 | if (isset($body)) { |
787 | - $parameters[] = 'body=' . $body; |
|
787 | + $parameters[] = 'body='.$body; |
|
788 | 788 | } |
789 | 789 | if (!empty($parameters)) { |
790 | - $mailTo .= '?' . implode('&', $parameters); |
|
790 | + $mailTo .= '?'.implode('&', $parameters); |
|
791 | 791 | } |
792 | 792 | |
793 | 793 | return $mailTo; |
@@ -838,7 +838,7 @@ discard block |
||
838 | 838 | } |
839 | 839 | |
840 | 840 | $number = number_format($number, $decimals, ',', ' '); |
841 | - return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol); |
|
841 | + return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol); |
|
842 | 842 | } |
843 | 843 | |
844 | 844 | |
@@ -859,7 +859,7 @@ discard block |
||
859 | 859 | } |
860 | 860 | |
861 | 861 | if (!isset($format)) { |
862 | - $format = BabRegistry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
862 | + $format = BabRegistry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
863 | 863 | } |
864 | 864 | $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil(); |
865 | 865 | |
@@ -899,10 +899,10 @@ discard block |
||
899 | 899 | $prefix = ''; |
900 | 900 | if (!empty($namespace)) { |
901 | 901 | $namespaces = explode('\\', $namespace); |
902 | - $prefix = $namespaces[0] . '\\' . $namespaces[1] . '\Ctrl\\'; |
|
902 | + $prefix = $namespaces[0].'\\'.$namespaces[1].'\Ctrl\\'; |
|
903 | 903 | } |
904 | 904 | $this->includeController(); |
905 | - return bab_getInstance($prefix . $this->classPrefix . 'Controller')->setApp($this); |
|
905 | + return bab_getInstance($prefix.$this->classPrefix.'Controller')->setApp($this); |
|
906 | 906 | } |
907 | 907 | |
908 | 908 | |
@@ -945,10 +945,10 @@ discard block |
||
945 | 945 | $prefix = ''; |
946 | 946 | if (!empty($namespace)) { |
947 | 947 | $namespaces = explode('\\', $namespace); |
948 | - $prefix = $namespaces[0] . '\\' . $namespaces[1] . '\Ui\\'; |
|
948 | + $prefix = $namespaces[0].'\\'.$namespaces[1].'\Ui\\'; |
|
949 | 949 | } |
950 | 950 | $this->includeUi(); |
951 | - return bab_getInstance($prefix . $this->classPrefix . 'Ui')->setApp($this); |
|
951 | + return bab_getInstance($prefix.$this->classPrefix.'Ui')->setApp($this); |
|
952 | 952 | } |
953 | 953 | |
954 | 954 | /** |
@@ -978,22 +978,22 @@ discard block |
||
978 | 978 | if ($component = $this->getComponentByName($className)) { |
979 | 979 | return $component->getSetClassName(); |
980 | 980 | } |
981 | - $setName = $className . 'Set'; |
|
982 | - return $this->classPrefix . $setName; |
|
981 | + $setName = $className.'Set'; |
|
982 | + return $this->classPrefix.$setName; |
|
983 | 983 | |
984 | 984 | case substr($name, -strlen('ClassName')) === 'ClassName': |
985 | 985 | $recordName = substr($name, 0, strlen($name) - strlen('ClassName')); |
986 | 986 | if ($component = $this->getComponentByName($recordName)) { |
987 | 987 | return $component->getRecordClassName(); |
988 | 988 | } |
989 | - return $this->classPrefix . $recordName; |
|
989 | + return $this->classPrefix.$recordName; |
|
990 | 990 | |
991 | 991 | case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set': |
992 | 992 | $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include'))); |
993 | 993 | if ($this->getComponentByName($fileNameBase)) { |
994 | 994 | return; |
995 | 995 | } |
996 | - $path = APP_SET_PATH . $fileNameBase . '.class.php'; |
|
996 | + $path = APP_SET_PATH.$fileNameBase.'.class.php'; |
|
997 | 997 | if (is_file($path)) { |
998 | 998 | require_once $path; |
999 | 999 | } |
@@ -1016,8 +1016,8 @@ discard block |
||
1016 | 1016 | case ($component = $this->getComponentByName($name)) != false: |
1017 | 1017 | return $component; |
1018 | 1018 | default: |
1019 | - $setName = $name . 'Set'; |
|
1020 | - $recordClassNameMethod = $name . 'ClassName'; |
|
1019 | + $setName = $name.'Set'; |
|
1020 | + $recordClassNameMethod = $name.'ClassName'; |
|
1021 | 1021 | $recordClassName = $this->$recordClassNameMethod(); |
1022 | 1022 | if (isset($arguments[0])) { |
1023 | 1023 | if ($arguments[0] instanceof $recordClassName) { |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | { |
1160 | 1160 | global $babDB; |
1161 | 1161 | $users = array(); |
1162 | - $res = $babDB->db_query("SELECT DISTINCT(id_user) FROM " . BAB_USERS_LOG_TBL . " WHERE id_user != 0"); |
|
1162 | + $res = $babDB->db_query("SELECT DISTINCT(id_user) FROM ".BAB_USERS_LOG_TBL." WHERE id_user != 0"); |
|
1163 | 1163 | while (list($id_user) = $babDB->db_fetch_array($res)) { |
1164 | 1164 | $users[] = $id_user; |
1165 | 1165 | } |
@@ -1230,7 +1230,7 @@ discard block |
||
1230 | 1230 | |
1231 | 1231 | if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') { |
1232 | 1232 | $incl = $method; |
1233 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
1233 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
1234 | 1234 | |
1235 | 1235 | |
1236 | 1236 | $classname = $this->$classNameMethod(); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | protected function logSave(AppTraceableRecord $record, $noTrace) |
153 | 153 | { |
154 | - if (! $this->isLoggable()) { |
|
154 | + if (!$this->isLoggable()) { |
|
155 | 155 | return; |
156 | 156 | } |
157 | 157 | $App = $this->App(); |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | protected function logDelete(ORMCriteria $criteria, $noTrace) |
176 | 176 | { |
177 | - if (! $this->isLoggable()) { |
|
177 | + if (!$this->isLoggable()) { |
|
178 | 178 | return; |
179 | 179 | } |
180 | 180 | $App = $this->App(); |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function delete(?ORMCriteria $criteria = null, $deletedStatus = AppTraceableRecord::DELETED_STATUS_DELETED) |
252 | 252 | { |
253 | - $definitive = ($deletedStatus === true) || ! $this->isTraceable(); |
|
253 | + $definitive = ($deletedStatus === true) || !$this->isTraceable(); |
|
254 | 254 | $this->logDelete($criteria, $definitive); |
255 | 255 | if ($definitive) { |
256 | 256 | return parent::delete($criteria); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | $record->deletedOn = $now; |
268 | 268 | $record->deletedBy = bab_getUserId(); |
269 | 269 | |
270 | - if (! parent::save($record)) { |
|
270 | + if (!parent::save($record)) { |
|
271 | 271 | return false; |
272 | 272 | } |
273 | 273 | } |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | */ |
286 | 286 | public function save(ORMRecord $record, $noTrace = false) |
287 | 287 | { |
288 | - $noTrace = $noTrace || ! $this->isTraceable(); |
|
288 | + $noTrace = $noTrace || !$this->isTraceable(); |
|
289 | 289 | $this->logSave($record, $noTrace); |
290 | 290 | if ($noTrace) { |
291 | 291 | return parent::save($record); |
@@ -334,11 +334,11 @@ discard block |
||
334 | 334 | |
335 | 335 | $record = $this->get($this->uuid->is($uuid)); |
336 | 336 | |
337 | - if (! isset($record)) { |
|
337 | + if (!isset($record)) { |
|
338 | 338 | return null; |
339 | 339 | } |
340 | 340 | |
341 | - if (! ($record instanceof AppTraceableRecord)) { |
|
341 | + if (!($record instanceof AppTraceableRecord)) { |
|
342 | 342 | return null; |
343 | 343 | } |
344 | 344 | |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | */ |
359 | 359 | public function isOwn($userId = null) |
360 | 360 | { |
361 | - if (! isset($userId)) { |
|
361 | + if (!isset($userId)) { |
|
362 | 362 | $userId = bab_getUserId(); |
363 | 363 | } |
364 | 364 | return $this->createdBy->is($userId); |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | { |
70 | 70 | $value = $this->oParentSet->getBackend()->getRecordValue($this, $sFieldName); |
71 | 71 | $field = $this->oParentSet->$sFieldName; |
72 | - if (! is_null($value) && $field instanceof ORMFkField) { |
|
72 | + if (!is_null($value) && $field instanceof ORMFkField) { |
|
73 | 73 | |
74 | 74 | $sClassName = $field->getForeignSetName(); |
75 | 75 | if ($field instanceof AppFkField) { |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function App() |
109 | 109 | { |
110 | - if (! isset($this->app)) { |
|
110 | + if (!isset($this->app)) { |
|
111 | 111 | // If the app object was not specified (through the setApp() method), |
112 | 112 | // we set it as parent set's App. |
113 | 113 | $this->setApp($this->getParentSet() |
@@ -147,18 +147,18 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function getRef() |
149 | 149 | { |
150 | - if (! isset($this->id)) { |
|
150 | + if (!isset($this->id)) { |
|
151 | 151 | throw new AppException('Trying to get the reference string of a record without an id.'); |
152 | 152 | } |
153 | 153 | $classname = $this->getClassName(); |
154 | - return $classname . ':' . $this->id; |
|
154 | + return $classname.':'.$this->id; |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | public function getFrontRef() |
158 | 158 | { |
159 | 159 | if ($this->getParentSet()->usesWebIdTrait() && isset($this->webId)) { |
160 | 160 | $classname = $this->getClassName(); |
161 | - return $classname . ':' . $this->webId; |
|
161 | + return $classname.':'.$this->webId; |
|
162 | 162 | } |
163 | 163 | return $this->getRef(); |
164 | 164 | } |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | { |
188 | 188 | $App = $this->App(); |
189 | 189 | |
190 | - if (! isset($deletedStatus)) { |
|
190 | + if (!isset($deletedStatus)) { |
|
191 | 191 | $deletedStatus = AppTraceableRecord::DELETED_STATUS_DELETED; |
192 | 192 | } |
193 | 193 | |
@@ -623,9 +623,9 @@ discard block |
||
623 | 623 | */ |
624 | 624 | public function requireReadable($message = null) |
625 | 625 | { |
626 | - if (! $this->isReadable()) { |
|
626 | + if (!$this->isReadable()) { |
|
627 | 627 | $App = $this->App(); |
628 | - if (! isset($message)) { |
|
628 | + if (!isset($message)) { |
|
629 | 629 | $message = $App->translate('Access denied'); |
630 | 630 | } |
631 | 631 | throw new AppAccessException($message); |
@@ -641,9 +641,9 @@ discard block |
||
641 | 641 | */ |
642 | 642 | public function requireUpdatable($message = null) |
643 | 643 | { |
644 | - if (! $this->isUpdatable()) { |
|
644 | + if (!$this->isUpdatable()) { |
|
645 | 645 | $App = $this->App(); |
646 | - if (! isset($message)) { |
|
646 | + if (!isset($message)) { |
|
647 | 647 | $message = $App->translate('Access denied'); |
648 | 648 | } |
649 | 649 | throw new AppAccessException($message); |
@@ -659,9 +659,9 @@ discard block |
||
659 | 659 | */ |
660 | 660 | public function requireDeletable($message = null) |
661 | 661 | { |
662 | - if (! $this->isDeletable()) { |
|
662 | + if (!$this->isDeletable()) { |
|
663 | 663 | $App = $this->App(); |
664 | - if (! isset($message)) { |
|
664 | + if (!isset($message)) { |
|
665 | 665 | $message = $App->translate('Access denied'); |
666 | 666 | } |
667 | 667 | throw new AppAccessException($message); |