@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | if (empty($description)) { |
48 | 48 | $description = $field->getName(); |
49 | 49 | } |
50 | - $fieldLabel = $W->Label($description . ':'); |
|
50 | + $fieldLabel = $W->Label($description.':'); |
|
51 | 51 | |
52 | 52 | if ($field instanceof ORM_DateField) { |
53 | 53 | $widget = $W->DatePicker(); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | if (empty($description)) { |
104 | 104 | $description = $field->getName(); |
105 | 105 | } |
106 | - $fieldLabel = $W->Label($description . ':'); |
|
106 | + $fieldLabel = $W->Label($description.':'); |
|
107 | 107 | |
108 | 108 | if ($field instanceof ORM_DateField) { |
109 | 109 | $widget = $W->PeriodPicker(); |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | $nbOptions = 0; |
207 | 207 | foreach ($iterator as $record) { |
208 | 208 | if (isset($record->code)) { |
209 | - $optionText = $record->code . ' - ' . $record->$fieldName; |
|
209 | + $optionText = $record->code.' - '.$record->$fieldName; |
|
210 | 210 | } else { |
211 | 211 | $optionText = $record->$fieldName; |
212 | 212 | } |
@@ -33,50 +33,50 @@ discard block |
||
33 | 33 | */ |
34 | 34 | function app_genericSetEditor(ORM_RecordSet $set) |
35 | 35 | { |
36 | - $O = bab_functionality::get('LibOrm'); |
|
37 | - $O->init(); |
|
38 | - $W = bab_Widgets(); |
|
39 | - $layout = $W->VBoxLayout(); |
|
40 | - $layout->setVerticalSpacing(1, 'em'); |
|
41 | - |
|
42 | - |
|
43 | - $fields = $set->getFields(); |
|
44 | - |
|
45 | - foreach ($fields as $field) { |
|
46 | - $description = $field->getDescription(); |
|
47 | - if (empty($description)) { |
|
48 | - $description = $field->getName(); |
|
49 | - } |
|
50 | - $fieldLabel = $W->Label($description . ':'); |
|
51 | - |
|
52 | - if ($field instanceof ORM_DateField) { |
|
53 | - $widget = $W->DatePicker(); |
|
54 | - } else if ($field instanceof ORM_TimeField) { |
|
55 | - $widget = $W->LineEdit()->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
56 | - } else if ($field instanceof ORM_StringField) { |
|
57 | - $widget = $W->LineEdit()->setSize(min(array(80, $field->getMaxLength()))); |
|
58 | - } else if ($field instanceof ORM_EnumField) { |
|
59 | - $widget = $W->Select(); |
|
60 | - $widget->addOption('', ''); |
|
61 | - foreach ($field->getValues() as $key => $text) { |
|
62 | - $widget->addOption($key, $text); |
|
63 | - } |
|
64 | - } else if ($field instanceof ORM_IntField) { |
|
65 | - $widget = $W->LineEdit()->setSize(9); |
|
66 | - } else if ($field instanceof ORM_TextField) { |
|
67 | - $widget = $W->TextEdit()->setColumns(80)->setLines(5); |
|
68 | - } else if ($field instanceof ORM_RecordSet) { |
|
69 | - $widget = app_genericSetEditor($field); |
|
70 | - $widget->addClass('sub-form'); |
|
71 | - } else { |
|
72 | - $widget = null; |
|
73 | - } |
|
74 | - if (isset($widget)) { |
|
75 | - $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
76 | - } |
|
77 | - } |
|
78 | - |
|
79 | - return $layout; |
|
36 | + $O = bab_functionality::get('LibOrm'); |
|
37 | + $O->init(); |
|
38 | + $W = bab_Widgets(); |
|
39 | + $layout = $W->VBoxLayout(); |
|
40 | + $layout->setVerticalSpacing(1, 'em'); |
|
41 | + |
|
42 | + |
|
43 | + $fields = $set->getFields(); |
|
44 | + |
|
45 | + foreach ($fields as $field) { |
|
46 | + $description = $field->getDescription(); |
|
47 | + if (empty($description)) { |
|
48 | + $description = $field->getName(); |
|
49 | + } |
|
50 | + $fieldLabel = $W->Label($description . ':'); |
|
51 | + |
|
52 | + if ($field instanceof ORM_DateField) { |
|
53 | + $widget = $W->DatePicker(); |
|
54 | + } else if ($field instanceof ORM_TimeField) { |
|
55 | + $widget = $W->LineEdit()->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
56 | + } else if ($field instanceof ORM_StringField) { |
|
57 | + $widget = $W->LineEdit()->setSize(min(array(80, $field->getMaxLength()))); |
|
58 | + } else if ($field instanceof ORM_EnumField) { |
|
59 | + $widget = $W->Select(); |
|
60 | + $widget->addOption('', ''); |
|
61 | + foreach ($field->getValues() as $key => $text) { |
|
62 | + $widget->addOption($key, $text); |
|
63 | + } |
|
64 | + } else if ($field instanceof ORM_IntField) { |
|
65 | + $widget = $W->LineEdit()->setSize(9); |
|
66 | + } else if ($field instanceof ORM_TextField) { |
|
67 | + $widget = $W->TextEdit()->setColumns(80)->setLines(5); |
|
68 | + } else if ($field instanceof ORM_RecordSet) { |
|
69 | + $widget = app_genericSetEditor($field); |
|
70 | + $widget->addClass('sub-form'); |
|
71 | + } else { |
|
72 | + $widget = null; |
|
73 | + } |
|
74 | + if (isset($widget)) { |
|
75 | + $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
76 | + } |
|
77 | + } |
|
78 | + |
|
79 | + return $layout; |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | |
@@ -89,50 +89,50 @@ discard block |
||
89 | 89 | */ |
90 | 90 | function app_genericSetFilterForm(ORM_RecordSet $set) |
91 | 91 | { |
92 | - $O = bab_functionality::get('LibOrm'); |
|
93 | - $O->init(); |
|
94 | - $W = bab_Widgets(); |
|
95 | - $layout = $W->FlowLayout(); |
|
96 | - $layout->setVerticalSpacing(1, 'em')->setHorizontalSpacing(1, 'em'); |
|
97 | - |
|
98 | - |
|
99 | - $fields = $set->getFields(); |
|
100 | - |
|
101 | - foreach ($fields as $field) { |
|
102 | - $description = $field->getDescription(); |
|
103 | - if (empty($description)) { |
|
104 | - $description = $field->getName(); |
|
105 | - } |
|
106 | - $fieldLabel = $W->Label($description . ':'); |
|
107 | - |
|
108 | - if ($field instanceof ORM_DateField) { |
|
109 | - $widget = $W->PeriodPicker(); |
|
110 | - } else if ($field instanceof ORM_TimeField) { |
|
111 | - $widget = $W->TimePicker(); |
|
112 | - } else if ($field instanceof ORM_StringField) { |
|
113 | - $widget = $W->LineEdit()->setSize(min(array(15, $field->getMaxLength()))); |
|
114 | - } else if ($field instanceof ORM_EnumField) { |
|
115 | - $widget = $W->Select(); |
|
116 | - $widget->addOption('', ''); |
|
117 | - foreach ($field->getValues() as $key => $text) { |
|
118 | - $widget->addOption($key, $text); |
|
119 | - } |
|
120 | - } else if ($field instanceof ORM_IntField) { |
|
121 | - $widget = $W->LineEdit()->setSize(9); |
|
122 | - } else if ($field instanceof ORM_TextField) { |
|
123 | - $widget = $widget = $W->LineEdit()->setSize(15); |
|
124 | - } else if ($field instanceof ORM_RecordSet) { |
|
125 | - $widget = app_genericSetFilterForm($field); |
|
126 | - $widget->addClass('sub-form'); |
|
127 | - } else { |
|
128 | - $widget = null; |
|
129 | - } |
|
130 | - if (isset($widget)) { |
|
131 | - $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
132 | - } |
|
133 | - } |
|
134 | - |
|
135 | - return $layout; |
|
92 | + $O = bab_functionality::get('LibOrm'); |
|
93 | + $O->init(); |
|
94 | + $W = bab_Widgets(); |
|
95 | + $layout = $W->FlowLayout(); |
|
96 | + $layout->setVerticalSpacing(1, 'em')->setHorizontalSpacing(1, 'em'); |
|
97 | + |
|
98 | + |
|
99 | + $fields = $set->getFields(); |
|
100 | + |
|
101 | + foreach ($fields as $field) { |
|
102 | + $description = $field->getDescription(); |
|
103 | + if (empty($description)) { |
|
104 | + $description = $field->getName(); |
|
105 | + } |
|
106 | + $fieldLabel = $W->Label($description . ':'); |
|
107 | + |
|
108 | + if ($field instanceof ORM_DateField) { |
|
109 | + $widget = $W->PeriodPicker(); |
|
110 | + } else if ($field instanceof ORM_TimeField) { |
|
111 | + $widget = $W->TimePicker(); |
|
112 | + } else if ($field instanceof ORM_StringField) { |
|
113 | + $widget = $W->LineEdit()->setSize(min(array(15, $field->getMaxLength()))); |
|
114 | + } else if ($field instanceof ORM_EnumField) { |
|
115 | + $widget = $W->Select(); |
|
116 | + $widget->addOption('', ''); |
|
117 | + foreach ($field->getValues() as $key => $text) { |
|
118 | + $widget->addOption($key, $text); |
|
119 | + } |
|
120 | + } else if ($field instanceof ORM_IntField) { |
|
121 | + $widget = $W->LineEdit()->setSize(9); |
|
122 | + } else if ($field instanceof ORM_TextField) { |
|
123 | + $widget = $widget = $W->LineEdit()->setSize(15); |
|
124 | + } else if ($field instanceof ORM_RecordSet) { |
|
125 | + $widget = app_genericSetFilterForm($field); |
|
126 | + $widget->addClass('sub-form'); |
|
127 | + } else { |
|
128 | + $widget = null; |
|
129 | + } |
|
130 | + if (isset($widget)) { |
|
131 | + $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
132 | + } |
|
133 | + } |
|
134 | + |
|
135 | + return $layout; |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | |
@@ -145,47 +145,47 @@ discard block |
||
145 | 145 | */ |
146 | 146 | function app_LabelledWidget($labelText, Widget_Displayable_Interface $widget) |
147 | 147 | { |
148 | - $W = bab_Widgets(); |
|
149 | - |
|
150 | - $label = $W->Label($labelText); |
|
151 | - if ($widget instanceof Widget_InputWidget) { |
|
152 | - $label->setAssociatedWidget($widget); |
|
153 | - } |
|
154 | - |
|
155 | - if ($widget instanceof Widget_CheckBox) { |
|
156 | - $layout = $W->HBoxItems( |
|
157 | - $widget->setSizePolicy(Widget_SizePolicy::MINIMUM), |
|
158 | - $label |
|
159 | - )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
160 | - } else { |
|
161 | - $layout = $W->VBoxItems( |
|
162 | - $label, |
|
163 | - $widget |
|
164 | - )->setVerticalSpacing(0.5, 'em'); |
|
165 | - } |
|
166 | - |
|
167 | - return $layout; |
|
148 | + $W = bab_Widgets(); |
|
149 | + |
|
150 | + $label = $W->Label($labelText); |
|
151 | + if ($widget instanceof Widget_InputWidget) { |
|
152 | + $label->setAssociatedWidget($widget); |
|
153 | + } |
|
154 | + |
|
155 | + if ($widget instanceof Widget_CheckBox) { |
|
156 | + $layout = $W->HBoxItems( |
|
157 | + $widget->setSizePolicy(Widget_SizePolicy::MINIMUM), |
|
158 | + $label |
|
159 | + )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
160 | + } else { |
|
161 | + $layout = $W->VBoxItems( |
|
162 | + $label, |
|
163 | + $widget |
|
164 | + )->setVerticalSpacing(0.5, 'em'); |
|
165 | + } |
|
166 | + |
|
167 | + return $layout; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | |
171 | 171 | |
172 | 172 | function app_LabelledCheckbox($labelText, $checkboxName, $options = null) |
173 | 173 | { |
174 | - $W = bab_Widgets(); |
|
174 | + $W = bab_Widgets(); |
|
175 | 175 | |
176 | - $label = $W->Label($labelText)->colon(false); |
|
177 | - $checkbox = $W->Checkbox()->setName($checkboxName); |
|
178 | - $label->setAssociatedWidget($checkbox); |
|
179 | - if (isset($options)) { |
|
180 | - $label->setSizePolicy(Widget_SizePolicy::FIXED)->setCanvasOptions($options); |
|
181 | - } |
|
176 | + $label = $W->Label($labelText)->colon(false); |
|
177 | + $checkbox = $W->Checkbox()->setName($checkboxName); |
|
178 | + $label->setAssociatedWidget($checkbox); |
|
179 | + if (isset($options)) { |
|
180 | + $label->setSizePolicy(Widget_SizePolicy::FIXED)->setCanvasOptions($options); |
|
181 | + } |
|
182 | 182 | |
183 | - $layout = $W->HBoxItems( |
|
184 | - $checkbox->setSizePolicy(Widget_SizePolicy::MINIMUM), |
|
185 | - $label |
|
186 | - )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
183 | + $layout = $W->HBoxItems( |
|
184 | + $checkbox->setSizePolicy(Widget_SizePolicy::MINIMUM), |
|
185 | + $label |
|
186 | + )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
187 | 187 | |
188 | - return $layout; |
|
188 | + return $layout; |
|
189 | 189 | } |
190 | 190 | |
191 | 191 | |
@@ -193,42 +193,42 @@ discard block |
||
193 | 193 | |
194 | 194 | function app_LabelledOrmSelect(ORM_MysqlIterator $iterator, $fieldName, $selectName, $label, $hidden = false, $groupFieldName = null) |
195 | 195 | { |
196 | - $W = bab_Widgets(); |
|
197 | - |
|
198 | - if (isset($groupFieldName)) { |
|
199 | - $groupPathElements = explode('/', $groupFieldName); |
|
200 | - } |
|
201 | - |
|
202 | - $select = $W->Select()->setName($selectName); |
|
203 | - |
|
204 | - $select->addOption('', ''); |
|
205 | - |
|
206 | - $nbOptions = 0; |
|
207 | - foreach ($iterator as $record) { |
|
208 | - if (isset($record->code)) { |
|
209 | - $optionText = $record->code . ' - ' . $record->$fieldName; |
|
210 | - } else { |
|
211 | - $optionText = $record->$fieldName; |
|
212 | - } |
|
213 | - if (isset($groupFieldName)) { |
|
214 | - $group = $record; |
|
215 | - foreach ($groupPathElements as $groupPathElement) { |
|
216 | - $group = $group->$groupPathElement; |
|
217 | - } |
|
218 | - $select->addOption($record->id, $optionText, $group); |
|
219 | - } else { |
|
220 | - $select->addOption($record->id, $optionText); |
|
221 | - } |
|
222 | - $nbOptions++; |
|
223 | - $lastId = $record->id; |
|
224 | - } |
|
225 | - |
|
226 | - if ($nbOptions == 1) { |
|
227 | - $select->setValue($lastId); |
|
228 | - } |
|
229 | - |
|
230 | - |
|
231 | - return app_LabelledWidget($label, $select); |
|
196 | + $W = bab_Widgets(); |
|
197 | + |
|
198 | + if (isset($groupFieldName)) { |
|
199 | + $groupPathElements = explode('/', $groupFieldName); |
|
200 | + } |
|
201 | + |
|
202 | + $select = $W->Select()->setName($selectName); |
|
203 | + |
|
204 | + $select->addOption('', ''); |
|
205 | + |
|
206 | + $nbOptions = 0; |
|
207 | + foreach ($iterator as $record) { |
|
208 | + if (isset($record->code)) { |
|
209 | + $optionText = $record->code . ' - ' . $record->$fieldName; |
|
210 | + } else { |
|
211 | + $optionText = $record->$fieldName; |
|
212 | + } |
|
213 | + if (isset($groupFieldName)) { |
|
214 | + $group = $record; |
|
215 | + foreach ($groupPathElements as $groupPathElement) { |
|
216 | + $group = $group->$groupPathElement; |
|
217 | + } |
|
218 | + $select->addOption($record->id, $optionText, $group); |
|
219 | + } else { |
|
220 | + $select->addOption($record->id, $optionText); |
|
221 | + } |
|
222 | + $nbOptions++; |
|
223 | + $lastId = $record->id; |
|
224 | + } |
|
225 | + |
|
226 | + if ($nbOptions == 1) { |
|
227 | + $select->setValue($lastId); |
|
228 | + } |
|
229 | + |
|
230 | + |
|
231 | + return app_LabelledWidget($label, $select); |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | |
@@ -236,108 +236,108 @@ discard block |
||
236 | 236 | |
237 | 237 | function app_OrmWidget(ORM_Field $field) |
238 | 238 | { |
239 | - $W = bab_Widgets(); |
|
239 | + $W = bab_Widgets(); |
|
240 | 240 | |
241 | 241 | |
242 | - if ($field instanceof ORM_DateField) { |
|
243 | - $widget = $W->DatePicker(); |
|
244 | - } else if ($field instanceof ORM_TimeField) { |
|
245 | - $widget = $W->TimeEdit(); //->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
246 | - } else if ($field instanceof ORM_DatetimeField) { |
|
247 | - $widget = $W->DateTimePicker(); //->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
248 | - } else if ($field instanceof ORM_EnumField) { |
|
249 | - $widget = $W->Select(); |
|
242 | + if ($field instanceof ORM_DateField) { |
|
243 | + $widget = $W->DatePicker(); |
|
244 | + } else if ($field instanceof ORM_TimeField) { |
|
245 | + $widget = $W->TimeEdit(); //->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
246 | + } else if ($field instanceof ORM_DatetimeField) { |
|
247 | + $widget = $W->DateTimePicker(); //->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
248 | + } else if ($field instanceof ORM_EnumField) { |
|
249 | + $widget = $W->Select(); |
|
250 | 250 | //// $widget = $W->MultiSelect()->setSingleSelect(); |
251 | - $widget->addOption('', ''); |
|
252 | - $values = $field->getValues(); |
|
253 | - foreach ($values as $key => $value) { |
|
254 | - $widget->addOption($key, $value); |
|
255 | - } |
|
256 | - } else if ($field instanceof ORM_SetField) { |
|
257 | - $widget = $W->MultiSelect()->setSelectedList(2); |
|
258 | - $values = $field->getValues(); |
|
259 | - foreach ($values as $key => $value) { |
|
260 | - $widget->addOption($key, $value); |
|
261 | - } |
|
262 | - } else if ($field instanceof ORM_UserField) { |
|
263 | - $widget = $W->SuggestUser() |
|
264 | - ->setMinChars(0) |
|
265 | - ->setSizePolicy(Func_Icons::ICON_LEFT_16); |
|
266 | - } else if ($field instanceof ORM_CurrencyField) { |
|
267 | - $widget = $W->LineEdit()->setSize(6)->addClass('widget-input-currency'); |
|
268 | - } else if ($field instanceof ORM_BoolField) { |
|
269 | - $widget = $W->CheckBox()->setCheckedValue('1'); |
|
270 | - } else if ($field instanceof ORM_IntField) { |
|
271 | - $widget = $W->LineEdit() |
|
272 | - ->setSize(6)->addClass('widget-input-numeric'); |
|
273 | - } else if ($field instanceof ORM_EmailField) { |
|
274 | - $widget = $W->EmailLineEdit() |
|
275 | - ->setMaxSize($field->getMaxLength()); |
|
276 | - } else if ($field instanceof ORM_FileField) { |
|
277 | - $widget = $W->FilePicker(); |
|
278 | - } else if ($field instanceof ORM_StringField) { |
|
279 | - $widget = $W->LineEdit() |
|
280 | - ->setMaxSize($field->getMaxLength()); |
|
281 | - } else if ($field instanceof ORM_TextField) { |
|
282 | - $widget = $W->TextEdit() |
|
283 | - ->addClass('widget-autoresize'); |
|
284 | - } else if ($field instanceof ORM_PkField) { |
|
285 | - $widget = $W->Hidden(); |
|
286 | - } else if ($field instanceof ORM_FkField) { |
|
287 | - $widget = $W->Select(); |
|
288 | - $fieldName = $field->getName(); |
|
289 | - $parentSet = clone $field->getParentSet(); |
|
290 | - $parentSet->join($fieldName); |
|
291 | - $set = $parentSet->$fieldName; |
|
292 | - $records = $set->select(); |
|
293 | - $records->orderAsc($set->name); |
|
294 | - $pkName = $set->getPrimaryKey(); |
|
295 | - $widget->addOption('', ''); |
|
296 | - foreach ($records as $record) { |
|
297 | - $widget->addOption($record->$pkName, $record->name); |
|
298 | - } |
|
299 | - } else if ($field instanceof ORM_RecordSet) { |
|
300 | - $widget = $W->Select(); |
|
251 | + $widget->addOption('', ''); |
|
252 | + $values = $field->getValues(); |
|
253 | + foreach ($values as $key => $value) { |
|
254 | + $widget->addOption($key, $value); |
|
255 | + } |
|
256 | + } else if ($field instanceof ORM_SetField) { |
|
257 | + $widget = $W->MultiSelect()->setSelectedList(2); |
|
258 | + $values = $field->getValues(); |
|
259 | + foreach ($values as $key => $value) { |
|
260 | + $widget->addOption($key, $value); |
|
261 | + } |
|
262 | + } else if ($field instanceof ORM_UserField) { |
|
263 | + $widget = $W->SuggestUser() |
|
264 | + ->setMinChars(0) |
|
265 | + ->setSizePolicy(Func_Icons::ICON_LEFT_16); |
|
266 | + } else if ($field instanceof ORM_CurrencyField) { |
|
267 | + $widget = $W->LineEdit()->setSize(6)->addClass('widget-input-currency'); |
|
268 | + } else if ($field instanceof ORM_BoolField) { |
|
269 | + $widget = $W->CheckBox()->setCheckedValue('1'); |
|
270 | + } else if ($field instanceof ORM_IntField) { |
|
271 | + $widget = $W->LineEdit() |
|
272 | + ->setSize(6)->addClass('widget-input-numeric'); |
|
273 | + } else if ($field instanceof ORM_EmailField) { |
|
274 | + $widget = $W->EmailLineEdit() |
|
275 | + ->setMaxSize($field->getMaxLength()); |
|
276 | + } else if ($field instanceof ORM_FileField) { |
|
277 | + $widget = $W->FilePicker(); |
|
278 | + } else if ($field instanceof ORM_StringField) { |
|
279 | + $widget = $W->LineEdit() |
|
280 | + ->setMaxSize($field->getMaxLength()); |
|
281 | + } else if ($field instanceof ORM_TextField) { |
|
282 | + $widget = $W->TextEdit() |
|
283 | + ->addClass('widget-autoresize'); |
|
284 | + } else if ($field instanceof ORM_PkField) { |
|
285 | + $widget = $W->Hidden(); |
|
286 | + } else if ($field instanceof ORM_FkField) { |
|
287 | + $widget = $W->Select(); |
|
288 | + $fieldName = $field->getName(); |
|
289 | + $parentSet = clone $field->getParentSet(); |
|
290 | + $parentSet->join($fieldName); |
|
291 | + $set = $parentSet->$fieldName; |
|
292 | + $records = $set->select(); |
|
293 | + $records->orderAsc($set->name); |
|
294 | + $pkName = $set->getPrimaryKey(); |
|
295 | + $widget->addOption('', ''); |
|
296 | + foreach ($records as $record) { |
|
297 | + $widget->addOption($record->$pkName, $record->name); |
|
298 | + } |
|
299 | + } else if ($field instanceof ORM_RecordSet) { |
|
300 | + $widget = $W->Select(); |
|
301 | 301 | //// $widget = $W->MultiSelect()->setSingleSelect(); |
302 | 302 | // $fieldName = $field->getName(); |
303 | 303 | // $parentSet = $field->getParentSet(); |
304 | 304 | // $parentSet->join($fieldName); |
305 | 305 | // $set = $parentSet->$fieldName; |
306 | - $records = $field->select(); |
|
307 | - $records->orderAsc($field->name); |
|
308 | - $pkName = $field->getPrimaryKey(); |
|
309 | - $widget->addOption('', ''); |
|
310 | - foreach ($records as $record) { |
|
311 | - $widget->addOption($record->$pkName, $record->name); |
|
312 | - } |
|
313 | - } else { |
|
314 | - $widget = $W->LineEdit(); |
|
315 | - } |
|
316 | - |
|
317 | - $widget->setName($field->getName()); |
|
318 | - |
|
319 | - return $widget; |
|
306 | + $records = $field->select(); |
|
307 | + $records->orderAsc($field->name); |
|
308 | + $pkName = $field->getPrimaryKey(); |
|
309 | + $widget->addOption('', ''); |
|
310 | + foreach ($records as $record) { |
|
311 | + $widget->addOption($record->$pkName, $record->name); |
|
312 | + } |
|
313 | + } else { |
|
314 | + $widget = $W->LineEdit(); |
|
315 | + } |
|
316 | + |
|
317 | + $widget->setName($field->getName()); |
|
318 | + |
|
319 | + return $widget; |
|
320 | 320 | } |
321 | 321 | |
322 | 322 | |
323 | 323 | |
324 | 324 | function app_LabelledOrmWidget(ORM_Field $field, $label = null, $hidden = false) |
325 | 325 | { |
326 | - $W = bab_Widgets(); |
|
326 | + $W = bab_Widgets(); |
|
327 | 327 | |
328 | - if ($hidden) { |
|
329 | - $widget = $W->Hidden(); |
|
330 | - $widget->setName($field->getName()); |
|
331 | - return $widget; |
|
332 | - } |
|
328 | + if ($hidden) { |
|
329 | + $widget = $W->Hidden(); |
|
330 | + $widget->setName($field->getName()); |
|
331 | + return $widget; |
|
332 | + } |
|
333 | 333 | |
334 | - if (is_null($label)) { |
|
335 | - $label = $field->getDescription(); |
|
336 | - } |
|
334 | + if (is_null($label)) { |
|
335 | + $label = $field->getDescription(); |
|
336 | + } |
|
337 | 337 | |
338 | - $widget = app_OrmWidget($field); |
|
338 | + $widget = app_OrmWidget($field); |
|
339 | 339 | |
340 | - return app_LabelledWidget($label, $widget); |
|
340 | + return app_LabelledWidget($label, $widget); |
|
341 | 341 | } |
342 | 342 | |
343 | 343 | |
@@ -353,16 +353,16 @@ discard block |
||
353 | 353 | */ |
354 | 354 | function app_dateTime(ORM_Field $field, $value) { |
355 | 355 | |
356 | - $W = bab_functionality::get('Widgets'); |
|
357 | - $name = $field->getName(); |
|
358 | - $label = $W->Label($field->getDescription()); |
|
356 | + $W = bab_functionality::get('Widgets'); |
|
357 | + $name = $field->getName(); |
|
358 | + $label = $W->Label($field->getDescription()); |
|
359 | 359 | |
360 | - $frame = app_dateTimeField($name, $label, $value); |
|
360 | + $frame = app_dateTimeField($name, $label, $value); |
|
361 | 361 | |
362 | - return $W->VBoxItems( |
|
363 | - $label, |
|
364 | - $frame |
|
365 | - ); |
|
362 | + return $W->VBoxItems( |
|
363 | + $label, |
|
364 | + $frame |
|
365 | + ); |
|
366 | 366 | |
367 | 367 | } |
368 | 368 | |
@@ -376,24 +376,24 @@ discard block |
||
376 | 376 | */ |
377 | 377 | function app_dateTimeField($fieldName, Widget_Label $label, $value = null) |
378 | 378 | { |
379 | - $W = bab_functionality::get('Widgets'); |
|
379 | + $W = bab_functionality::get('Widgets'); |
|
380 | 380 | |
381 | - $datepart = $W->DatePicker()->setAssociatedLabel($label)->setName('date'); |
|
382 | - $timepart = $W->TimePicker()->setName('time'); |
|
381 | + $datepart = $W->DatePicker()->setAssociatedLabel($label)->setName('date'); |
|
382 | + $timepart = $W->TimePicker()->setName('time'); |
|
383 | 383 | |
384 | - if (isset($value)) { |
|
384 | + if (isset($value)) { |
|
385 | 385 | |
386 | - $value = explode(' ', $value); |
|
386 | + $value = explode(' ', $value); |
|
387 | 387 | |
388 | - $datepart->setValue($value[0]); |
|
389 | - $timepart->setValue($value[1]); |
|
390 | - } |
|
388 | + $datepart->setValue($value[0]); |
|
389 | + $timepart->setValue($value[1]); |
|
390 | + } |
|
391 | 391 | |
392 | - $datetime = $W->Frame(null, $W->HBoxLayout())->setName($fieldName) |
|
393 | - ->addItem($datepart) |
|
394 | - ->addItem($timepart); |
|
392 | + $datetime = $W->Frame(null, $W->HBoxLayout())->setName($fieldName) |
|
393 | + ->addItem($datepart) |
|
394 | + ->addItem($timepart); |
|
395 | 395 | |
396 | - return $datetime; |
|
396 | + return $datetime; |
|
397 | 397 | } |
398 | 398 | |
399 | 399 |
@@ -34,13 +34,13 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function includeBase() |
36 | 36 | { |
37 | - require_once APP_UI_PATH . 'base.ui.php'; |
|
38 | - require_once APP_UI_PATH . 'ui.helpers.php'; |
|
37 | + require_once APP_UI_PATH.'base.ui.php'; |
|
38 | + require_once APP_UI_PATH.'ui.helpers.php'; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | public function includePage() |
42 | 42 | { |
43 | - require_once APP_UI_PATH . 'page.class.php'; |
|
43 | + require_once APP_UI_PATH.'page.class.php'; |
|
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function ExportSelectEditor($id, app_TableModelView $tableview, $filter = null) |
79 | 79 | { |
80 | - require_once dirname(__FILE__) . '/exportselect.ui.php'; |
|
80 | + require_once dirname(__FILE__).'/exportselect.ui.php'; |
|
81 | 81 | return new app_ExportSelectEditor($this->App(), $id, $tableview, $filter); |
82 | 82 | } |
83 | 83 | } |
84 | 84 | \ No newline at end of file |
@@ -23,12 +23,12 @@ |
||
23 | 23 | |
24 | 24 | |
25 | 25 | |
26 | -require_once dirname(__FILE__). '/functions.php'; |
|
26 | +require_once dirname(__FILE__).'/functions.php'; |
|
27 | 27 | |
28 | 28 | |
29 | 29 | function LibApp_upgrade($sVersionBase, $sVersionIni) |
30 | 30 | { |
31 | - require_once dirname(__FILE__) . '/app.php'; |
|
31 | + require_once dirname(__FILE__).'/app.php'; |
|
32 | 32 | Func_App::register(); |
33 | 33 | |
34 | 34 | $App = app_App(); |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | */ |
23 | 23 | |
24 | 24 | |
25 | -require_once APP_SET_PATH . 'traceablerecord.class.php'; |
|
25 | +require_once APP_SET_PATH.'traceablerecord.class.php'; |
|
26 | 26 | |
27 | 27 | |
28 | 28 | /** |
@@ -317,9 +317,9 @@ discard block |
||
317 | 317 | if (is_array($parameters)) { |
318 | 318 | $params = array(); |
319 | 319 | foreach ($parameters as $key => $value) { |
320 | - $params[] = $key . '=' . $value; |
|
320 | + $params[] = $key.'='.$value; |
|
321 | 321 | } |
322 | - $rawField .= ':' . implode(';', $params); |
|
322 | + $rawField .= ':'.implode(';', $params); |
|
323 | 323 | } |
324 | 324 | array_push($rawFields, $rawField); |
325 | 325 | $this->fields = implode(',', $rawFields); |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | if (empty($rawField)) { |
339 | 339 | continue; |
340 | 340 | } |
341 | - list($fieldName, ) = explode(':', $rawField); |
|
341 | + list($fieldName,) = explode(':', $rawField); |
|
342 | 342 | |
343 | 343 | if ($removedFieldName == $fieldName) { |
344 | 344 | continue; |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | { |
176 | 176 | $App = $this->App(); |
177 | 177 | |
178 | - $customFieldSet= $App->CustomFieldSet(); |
|
178 | + $customFieldSet = $App->CustomFieldSet(); |
|
179 | 179 | $object = mb_substr(get_class($this), mb_strlen($App->classPrefix), -mb_strlen('Set')); |
180 | 180 | |
181 | 181 | $customFields = $customFieldSet->select($customFieldSet->object->is($object)); |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | throw new app_Exception('Trying to get the reference string of a record without an id.'); |
391 | 391 | } |
392 | 392 | $classname = $this->getClassName(); |
393 | - return $classname . ':' . $this->id; |
|
393 | + return $classname.':'.$this->id; |
|
394 | 394 | } |
395 | 395 | |
396 | 396 | |
@@ -650,13 +650,13 @@ discard block |
||
650 | 650 | */ |
651 | 651 | protected function importDate($name, $value) |
652 | 652 | { |
653 | - if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/',$value)) { |
|
653 | + if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $value)) { |
|
654 | 654 | return $this->importProperty($name, $value); |
655 | 655 | } |
656 | 656 | |
657 | 657 | // try in DD/MM/YYYY format |
658 | 658 | |
659 | - if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/',$value, $matches)) { |
|
659 | + if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/', $value, $matches)) { |
|
660 | 660 | |
661 | 661 | $value = sprintf('%04d-%02d-%02d', (int) $matches['year'], (int) $matches['month'], (int) $matches['day']); |
662 | 662 |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | if (null === $url) { |
113 | 113 | $script = '<script type="text/javascript">'; |
114 | 114 | if (isset($message)) { |
115 | - $script .= 'alert("' . bab_toHtml($message, BAB_HTML_JS) . '");'; |
|
115 | + $script .= 'alert("'.bab_toHtml($message, BAB_HTML_JS).'");'; |
|
116 | 116 | } |
117 | 117 | $script .= 'history.back();'; |
118 | 118 | $script .= '</script>'; |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $url = $url->url(); |
125 | 125 | } |
126 | 126 | if (!empty($babBody->msgerror)) { |
127 | - $url .= '&msgerror=' . urlencode($babBody->msgerror); |
|
127 | + $url .= '&msgerror='.urlencode($babBody->msgerror); |
|
128 | 128 | } |
129 | 129 | if (isset($message)) { |
130 | 130 | $lines = explode("\n", $message); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
136 | - header('Location: ' . $url); |
|
136 | + header('Location: '.$url); |
|
137 | 137 | die; |
138 | 138 | } |
139 | 139 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | function app_fileUploadError($error) |
167 | 167 | { |
168 | - switch($error) { |
|
168 | + switch ($error) { |
|
169 | 169 | case UPLOAD_ERR_OK: |
170 | 170 | return null; |
171 | 171 |
@@ -21,8 +21,8 @@ discard block |
||
21 | 21 | * @copyright Copyright (c) 2018 by CANTICO ({@link http://www.cantico.fr}) |
22 | 22 | */ |
23 | 23 | |
24 | -require_once dirname(__FILE__) . '/define.php'; |
|
25 | -require_once dirname(__FILE__) . '/functions.php'; |
|
24 | +require_once dirname(__FILE__).'/define.php'; |
|
25 | +require_once dirname(__FILE__).'/functions.php'; |
|
26 | 26 | |
27 | 27 | |
28 | 28 | spl_autoload_register(array(app_App(), 'loadObject')); |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | $this->addonName = 'libapp'; |
54 | 54 | $this->addonPrefix = 'app'; |
55 | 55 | |
56 | - $this->classPrefix = $this->addonPrefix . '_'; |
|
57 | - $this->controllerTg = 'addon/' . $this->addonName . '/main'; |
|
56 | + $this->classPrefix = $this->addonPrefix.'_'; |
|
57 | + $this->controllerTg = 'addon/'.$this->addonName.'/main'; |
|
58 | 58 | |
59 | 59 | $addon = bab_getAddonInfosInstance($this->addonName); |
60 | 60 | $this->phpPath = $addon->getPhpPath(); |
61 | 61 | $this->recordSetPath = $this->phpPath; |
62 | 62 | $this->ctrlPath = $this->phpPath; |
63 | - $this->uiPath = $this->phpPath . 'ui/'; |
|
63 | + $this->uiPath = $this->phpPath.'ui/'; |
|
64 | 64 | |
65 | 65 | $babDB = bab_getDB(); |
66 | 66 | |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | public function getRecordSetPathname($class) |
108 | 108 | { |
109 | 109 | // $App->MyRecordSet() -> myrecord.class.php |
110 | - $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php'; |
|
111 | - return $this->recordSetPath . $file; |
|
110 | + $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php'; |
|
111 | + return $this->recordSetPath.$file; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -120,8 +120,8 @@ discard block |
||
120 | 120 | public function getRecordPathname($class) |
121 | 121 | { |
122 | 122 | // $App->MyRecord() -> myrecord.class.php |
123 | - $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php'; |
|
124 | - return $this->recordSetPath . $file; |
|
123 | + $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php'; |
|
124 | + return $this->recordSetPath.$file; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | /** |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') { |
227 | 227 | $incl = $method; |
228 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
228 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
229 | 229 | |
230 | 230 | |
231 | 231 | $classname = $this->$classNameMethod(); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | // We need to revert to multilang fields before synchronizing. |
248 | 248 | $set->useLang(false); |
249 | 249 | } |
250 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
250 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
251 | 251 | } |
252 | 252 | } |
253 | 253 | } |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | |
279 | 279 | if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') { |
280 | 280 | $incl = $method; |
281 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
281 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
282 | 282 | |
283 | 283 | $classname = $this->$classNameMethod(); |
284 | 284 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | |
293 | 293 | if (class_exists($classname) && method_exists($this, $call)) { |
294 | 294 | $set = $this->$call(); |
295 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
295 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
296 | 296 | } |
297 | 297 | } |
298 | 298 | } |
@@ -306,7 +306,7 @@ discard block |
||
306 | 306 | |
307 | 307 | public function includeBase() |
308 | 308 | { |
309 | - require_once APP_PHP_PATH . 'base.class.php'; |
|
309 | + require_once APP_PHP_PATH.'base.class.php'; |
|
310 | 310 | } |
311 | 311 | |
312 | 312 | /** |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | */ |
315 | 315 | public function includeRecordSet() |
316 | 316 | { |
317 | - require_once APP_SET_PATH . 'record.class.php'; |
|
317 | + require_once APP_SET_PATH.'record.class.php'; |
|
318 | 318 | } |
319 | 319 | |
320 | 320 | |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | */ |
324 | 324 | public function includeTraceableRecordSet() |
325 | 325 | { |
326 | - require_once APP_SET_PATH . 'traceablerecord.class.php'; |
|
326 | + require_once APP_SET_PATH.'traceablerecord.class.php'; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | */ |
336 | 336 | public function includeLinkSet() |
337 | 337 | { |
338 | - require_once APP_SET_PATH . 'link.class.php'; |
|
338 | + require_once APP_SET_PATH.'link.class.php'; |
|
339 | 339 | } |
340 | 340 | |
341 | 341 | /** |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | */ |
352 | 352 | public function LinkSetClassName() |
353 | 353 | { |
354 | - return $this->LinkClassName() . 'Set'; |
|
354 | + return $this->LinkClassName().'Set'; |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | /** |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | return null; |
386 | 386 | } |
387 | 387 | list($classname, $id) = $refParts; |
388 | - $classSet = $classname . 'Set'; |
|
388 | + $classSet = $classname.'Set'; |
|
389 | 389 | $set = $this->$classSet(); |
390 | 390 | if (isset($set)) { |
391 | 391 | return $set->get($id); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | { |
405 | 405 | $fullClassName = get_class($record); |
406 | 406 | list(, $className) = explode('_', $fullClassName); |
407 | - return $className . ':' . $record->id; |
|
407 | + return $className.':'.$record->id; |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | */ |
432 | 432 | public function translate($str, $str_plurals = null, $number = null) |
433 | 433 | { |
434 | - require_once APP_PHP_PATH . 'functions.php'; |
|
434 | + require_once APP_PHP_PATH.'functions.php'; |
|
435 | 435 | $translation = $str; |
436 | 436 | if ($translate = bab_functionality::get('Translate/Gettext')) { |
437 | 437 | /* @var $translate Func_Translate_Gettext */ |
@@ -482,16 +482,16 @@ discard block |
||
482 | 482 | */ |
483 | 483 | public function mailTo($addr, $subject = null, $body = null) |
484 | 484 | { |
485 | - $mailTo = 'mailto:' . $addr; |
|
485 | + $mailTo = 'mailto:'.$addr; |
|
486 | 486 | $parameters = array(); |
487 | 487 | if (isset($subject)) { |
488 | - $parameters[] = 'subject=' . $subject; |
|
488 | + $parameters[] = 'subject='.$subject; |
|
489 | 489 | } |
490 | 490 | if (isset($body)) { |
491 | - $parameters[] = 'body=' . $body; |
|
491 | + $parameters[] = 'body='.$body; |
|
492 | 492 | } |
493 | 493 | if (!empty($parameters)) { |
494 | - $mailTo .= '?' . implode('&', $parameters); |
|
494 | + $mailTo .= '?'.implode('&', $parameters); |
|
495 | 495 | } |
496 | 496 | |
497 | 497 | return $mailTo; |
@@ -542,7 +542,7 @@ discard block |
||
542 | 542 | } |
543 | 543 | |
544 | 544 | $number = number_format($number, $decimals, ',', ' '); |
545 | - return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol); |
|
545 | + return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol); |
|
546 | 546 | } |
547 | 547 | |
548 | 548 | |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | } |
563 | 563 | |
564 | 564 | if (!isset($format)) { |
565 | - $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
565 | + $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
566 | 566 | } |
567 | 567 | $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil(); |
568 | 568 | |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | */ |
584 | 584 | public function includeController() |
585 | 585 | { |
586 | - require_once APP_PHP_PATH . '/controller.class.php'; |
|
586 | + require_once APP_PHP_PATH.'/controller.class.php'; |
|
587 | 587 | } |
588 | 588 | |
589 | 589 | |
@@ -592,7 +592,7 @@ discard block |
||
592 | 592 | */ |
593 | 593 | public function includeRecordController() |
594 | 594 | { |
595 | - require_once APP_CTRL_PATH . '/record.ctrl.php'; |
|
595 | + require_once APP_CTRL_PATH.'/record.ctrl.php'; |
|
596 | 596 | } |
597 | 597 | |
598 | 598 | |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | */ |
633 | 633 | public function includeUi() |
634 | 634 | { |
635 | - require_once APP_UI_PATH . 'ui.class.php'; |
|
635 | + require_once APP_UI_PATH.'ui.class.php'; |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | |
@@ -644,14 +644,14 @@ discard block |
||
644 | 644 | public function Ui() |
645 | 645 | { |
646 | 646 | $this->includeUi(); |
647 | - return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this); |
|
647 | + return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this); |
|
648 | 648 | } |
649 | 649 | |
650 | 650 | |
651 | 651 | |
652 | 652 | protected function includeAccess() |
653 | 653 | { |
654 | - require_once WORKSPACE_PHP_PATH . '/access.class.php'; |
|
654 | + require_once WORKSPACE_PHP_PATH.'/access.class.php'; |
|
655 | 655 | } |
656 | 656 | |
657 | 657 | |
@@ -683,29 +683,29 @@ discard block |
||
683 | 683 | |
684 | 684 | case substr($name, -strlen('SetClassName')) === 'SetClassName': |
685 | 685 | $setName = substr($name, 0, strlen($name) - strlen('ClassName')); |
686 | - return $this->classPrefix . $setName; |
|
686 | + return $this->classPrefix.$setName; |
|
687 | 687 | |
688 | 688 | case substr($name, -strlen('ClassName')) === 'ClassName': |
689 | 689 | $recordName = substr($name, 0, strlen($name) - strlen('ClassName')); |
690 | - return $this->classPrefix . $recordName; |
|
690 | + return $this->classPrefix.$recordName; |
|
691 | 691 | |
692 | 692 | case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set': |
693 | 693 | $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include'))); |
694 | - require_once PHP_SET_PATH . $fileNameBase . '.class.php'; |
|
694 | + require_once PHP_SET_PATH.$fileNameBase.'.class.php'; |
|
695 | 695 | return; |
696 | 696 | |
697 | 697 | case substr($name, -strlen('Set')) === 'Set': |
698 | - $includeMethod = 'include' . $name; |
|
698 | + $includeMethod = 'include'.$name; |
|
699 | 699 | $this->$includeMethod(); |
700 | - $setClassNameMethod = $name . 'ClassName'; |
|
700 | + $setClassNameMethod = $name.'ClassName'; |
|
701 | 701 | $className = $this->$setClassNameMethod(); |
702 | 702 | $set = new $className($this); |
703 | 703 | return $set; |
704 | 704 | |
705 | 705 | //case method_exists($this, $name . 'Set'): |
706 | 706 | default: |
707 | - $setName = $name . 'Set'; |
|
708 | - $recordClassNameMethod = $name . 'ClassName'; |
|
707 | + $setName = $name.'Set'; |
|
708 | + $recordClassNameMethod = $name.'ClassName'; |
|
709 | 709 | $recordClassName = $this->$recordClassNameMethod(); |
710 | 710 | if (isset($arguments[0])) { |
711 | 711 | if ($arguments[0] instanceof $recordClassName) { |