@@ -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 | * Provides extensible functionalities to manage an application. |
@@ -49,14 +49,14 @@ discard block |
||
49 | 49 | $this->addonPrefix = 'libapp'; |
50 | 50 | $this->addonName = 'libapp'; |
51 | 51 | |
52 | - $this->classPrefix = $this->addonPrefix . '_'; |
|
53 | - $this->controllerTg = 'addon/' . $this->addonName . '/main'; |
|
52 | + $this->classPrefix = $this->addonPrefix.'_'; |
|
53 | + $this->controllerTg = 'addon/'.$this->addonName.'/main'; |
|
54 | 54 | |
55 | 55 | $addon = bab_getAddonInfosInstance($this->addonName); |
56 | 56 | $this->phpPath = $addon->getPhpPath(); |
57 | 57 | $this->recordSetPath = $this->phpPath; |
58 | 58 | $this->ctrlPath = $this->phpPath; |
59 | - $this->uiPath = $this->phpPath . 'ui/'; |
|
59 | + $this->uiPath = $this->phpPath.'ui/'; |
|
60 | 60 | |
61 | 61 | $babDB = bab_getDB(); |
62 | 62 | |
@@ -76,15 +76,15 @@ discard block |
||
76 | 76 | { |
77 | 77 | if (substr($class, 0, strlen($this->classPrefix)) === $this->classPrefix) { |
78 | 78 | if (substr($class, -3) === 'Set') { |
79 | - $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php'; |
|
80 | - if (file_exists($this->recordSetPath . $file)) { |
|
81 | - require $this->recordSetPath . $file; |
|
79 | + $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php'; |
|
80 | + if (file_exists($this->recordSetPath.$file)) { |
|
81 | + require $this->recordSetPath.$file; |
|
82 | 82 | return true; |
83 | 83 | } |
84 | 84 | } else { |
85 | - $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php'; |
|
86 | - if (file_exists($this->recordSetPath . $file)) { |
|
87 | - require $this->recordSetPath . $file; |
|
85 | + $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php'; |
|
86 | + if (file_exists($this->recordSetPath.$file)) { |
|
87 | + require $this->recordSetPath.$file; |
|
88 | 88 | return true; |
89 | 89 | } |
90 | 90 | } |
@@ -194,7 +194,7 @@ discard block |
||
194 | 194 | |
195 | 195 | if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') { |
196 | 196 | $incl = $method; |
197 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
197 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
198 | 198 | |
199 | 199 | |
200 | 200 | $classname = $this->$classNameMethod(); |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | // We need to revert to multilang fields before synchronizing. |
217 | 217 | $set->useLang(false); |
218 | 218 | } |
219 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
219 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | } |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | |
248 | 248 | if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') { |
249 | 249 | $incl = $method; |
250 | - $classNameMethod = substr($method, strlen('include')) . 'ClassName'; |
|
250 | + $classNameMethod = substr($method, strlen('include')).'ClassName'; |
|
251 | 251 | |
252 | 252 | $classname = $this->$classNameMethod(); |
253 | 253 | |
@@ -261,7 +261,7 @@ discard block |
||
261 | 261 | |
262 | 262 | if (class_exists($classname) && method_exists($this, $call)) { |
263 | 263 | $set = $this->$call(); |
264 | - $sql .= $mysqlbackend->setToSql($set) . "\n"; |
|
264 | + $sql .= $mysqlbackend->setToSql($set)."\n"; |
|
265 | 265 | } |
266 | 266 | } |
267 | 267 | } |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | |
276 | 276 | public function includeBase() |
277 | 277 | { |
278 | - require_once APP_PHP_PATH . 'base.class.php'; |
|
278 | + require_once APP_PHP_PATH.'base.class.php'; |
|
279 | 279 | } |
280 | 280 | |
281 | 281 | /** |
@@ -283,7 +283,7 @@ discard block |
||
283 | 283 | */ |
284 | 284 | public function includeRecordSet() |
285 | 285 | { |
286 | - require_once APP_SET_PATH . 'record.class.php'; |
|
286 | + require_once APP_SET_PATH.'record.class.php'; |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | */ |
293 | 293 | public function includeTraceableRecordSet() |
294 | 294 | { |
295 | - require_once APP_SET_PATH . 'traceablerecord.class.php'; |
|
295 | + require_once APP_SET_PATH.'traceablerecord.class.php'; |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | |
@@ -308,7 +308,7 @@ discard block |
||
308 | 308 | */ |
309 | 309 | public function includeLogSet() |
310 | 310 | { |
311 | - require_once APP_SET_PATH . 'log.class.php'; |
|
311 | + require_once APP_SET_PATH.'log.class.php'; |
|
312 | 312 | } |
313 | 313 | |
314 | 314 | /** |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | */ |
325 | 325 | public function LogSetClassName() |
326 | 326 | { |
327 | - return $this->LogClassName() . 'Set'; |
|
327 | + return $this->LogClassName().'Set'; |
|
328 | 328 | } |
329 | 329 | |
330 | 330 | /** |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | */ |
347 | 347 | public function includeLinkSet() |
348 | 348 | { |
349 | - require_once APP_SET_PATH . 'link.class.php'; |
|
349 | + require_once APP_SET_PATH.'link.class.php'; |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | /** |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | */ |
363 | 363 | public function LinkSetClassName() |
364 | 364 | { |
365 | - return $this->LinkClassName() . 'Set'; |
|
365 | + return $this->LinkClassName().'Set'; |
|
366 | 366 | } |
367 | 367 | |
368 | 368 | /** |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | */ |
384 | 384 | public function includeCustomFieldSet() |
385 | 385 | { |
386 | - require_once APP_SET_PATH . 'customfield.class.php'; |
|
386 | + require_once APP_SET_PATH.'customfield.class.php'; |
|
387 | 387 | } |
388 | 388 | |
389 | 389 | /** |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | */ |
400 | 400 | public function CustomFieldSetClassName() |
401 | 401 | { |
402 | - return $this->CustomFieldClassName() . 'Set'; |
|
402 | + return $this->CustomFieldClassName().'Set'; |
|
403 | 403 | } |
404 | 404 | |
405 | 405 | /** |
@@ -421,8 +421,8 @@ discard block |
||
421 | 421 | */ |
422 | 422 | public function includeCustomSectionSet() |
423 | 423 | { |
424 | - require_once APP_SET_PATH . 'traceablerecord.class.php'; |
|
425 | - require_once APP_SET_PATH . 'customsection.class.php'; |
|
424 | + require_once APP_SET_PATH.'traceablerecord.class.php'; |
|
425 | + require_once APP_SET_PATH.'customsection.class.php'; |
|
426 | 426 | } |
427 | 427 | |
428 | 428 | /** |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | */ |
439 | 439 | public function CustomSectionSetClassName() |
440 | 440 | { |
441 | - return $this->CustomSectionClassName() . 'Set'; |
|
441 | + return $this->CustomSectionClassName().'Set'; |
|
442 | 442 | } |
443 | 443 | |
444 | 444 | /** |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | */ |
461 | 461 | public function includeTagSet() |
462 | 462 | { |
463 | - require_once APP_SET_PATH . 'tag.class.php'; |
|
463 | + require_once APP_SET_PATH.'tag.class.php'; |
|
464 | 464 | } |
465 | 465 | |
466 | 466 | /** |
@@ -476,7 +476,7 @@ discard block |
||
476 | 476 | */ |
477 | 477 | public function TagSetClassName() |
478 | 478 | { |
479 | - return $this->TagClassName() . 'Set'; |
|
479 | + return $this->TagClassName().'Set'; |
|
480 | 480 | } |
481 | 481 | |
482 | 482 | /** |
@@ -511,7 +511,7 @@ discard block |
||
511 | 511 | return null; |
512 | 512 | } |
513 | 513 | list($classname, $id) = $refParts; |
514 | - $classSet = $classname . 'Set'; |
|
514 | + $classSet = $classname.'Set'; |
|
515 | 515 | $set = $this->$classSet(); |
516 | 516 | if (isset($set)) { |
517 | 517 | return $set->get($id); |
@@ -530,7 +530,7 @@ discard block |
||
530 | 530 | { |
531 | 531 | $fullClassName = get_class($record); |
532 | 532 | list(, $className) = explode('_', $fullClassName); |
533 | - return $className . ':' . $record->id; |
|
533 | + return $className.':'.$record->id; |
|
534 | 534 | } |
535 | 535 | |
536 | 536 | |
@@ -557,7 +557,7 @@ discard block |
||
557 | 557 | */ |
558 | 558 | public function translate($str, $str_plurals = null, $number = null) |
559 | 559 | { |
560 | - require_once APP_PHP_PATH . 'functions.php'; |
|
560 | + require_once APP_PHP_PATH.'functions.php'; |
|
561 | 561 | $translation = $str; |
562 | 562 | if ($translate = bab_functionality::get('Translate/Gettext')) { |
563 | 563 | /* @var $translate Func_Translate_Gettext */ |
@@ -608,16 +608,16 @@ discard block |
||
608 | 608 | */ |
609 | 609 | public function mailTo($addr, $subject = null, $body = null) |
610 | 610 | { |
611 | - $mailTo = 'mailto:' . $addr; |
|
611 | + $mailTo = 'mailto:'.$addr; |
|
612 | 612 | $parameters = array(); |
613 | 613 | if (isset($subject)) { |
614 | - $parameters[] = 'subject=' . $subject; |
|
614 | + $parameters[] = 'subject='.$subject; |
|
615 | 615 | } |
616 | 616 | if (isset($body)) { |
617 | - $parameters[] = 'body=' . $body; |
|
617 | + $parameters[] = 'body='.$body; |
|
618 | 618 | } |
619 | 619 | if (!empty($parameters)) { |
620 | - $mailTo .= '?' . implode('&', $parameters); |
|
620 | + $mailTo .= '?'.implode('&', $parameters); |
|
621 | 621 | } |
622 | 622 | |
623 | 623 | return $mailTo; |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | } |
669 | 669 | |
670 | 670 | $number = number_format($number, $decimals, ',', ' '); |
671 | - return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol); |
|
671 | + return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol); |
|
672 | 672 | } |
673 | 673 | |
674 | 674 | |
@@ -688,7 +688,7 @@ discard block |
||
688 | 688 | } |
689 | 689 | |
690 | 690 | if (!isset($format)) { |
691 | - $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
691 | + $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat()); |
|
692 | 692 | } |
693 | 693 | $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil(); |
694 | 694 | |
@@ -709,7 +709,7 @@ discard block |
||
709 | 709 | */ |
710 | 710 | public function includeController() |
711 | 711 | { |
712 | - require_once APP_PHP_PATH . '/controller.class.php'; |
|
712 | + require_once APP_PHP_PATH.'/controller.class.php'; |
|
713 | 713 | } |
714 | 714 | |
715 | 715 | |
@@ -718,7 +718,7 @@ discard block |
||
718 | 718 | */ |
719 | 719 | public function includeRecordController() |
720 | 720 | { |
721 | - require_once APP_CTRL_PATH . '/record.ctrl.php'; |
|
721 | + require_once APP_CTRL_PATH.'/record.ctrl.php'; |
|
722 | 722 | } |
723 | 723 | |
724 | 724 | |
@@ -758,7 +758,7 @@ discard block |
||
758 | 758 | */ |
759 | 759 | public function includeUi() |
760 | 760 | { |
761 | - require_once APP_UI_PATH . 'ui.class.php'; |
|
761 | + require_once APP_UI_PATH.'ui.class.php'; |
|
762 | 762 | } |
763 | 763 | |
764 | 764 | |
@@ -770,14 +770,14 @@ discard block |
||
770 | 770 | public function Ui() |
771 | 771 | { |
772 | 772 | $this->includeUi(); |
773 | - return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this); |
|
773 | + return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this); |
|
774 | 774 | } |
775 | 775 | |
776 | 776 | |
777 | 777 | |
778 | 778 | protected function includeAccess() |
779 | 779 | { |
780 | - require_once WORKSPACE_PHP_PATH . '/access.class.php'; |
|
780 | + require_once WORKSPACE_PHP_PATH.'/access.class.php'; |
|
781 | 781 | } |
782 | 782 | |
783 | 783 | |
@@ -809,29 +809,29 @@ discard block |
||
809 | 809 | |
810 | 810 | case substr($name, -strlen('SetClassName')) === 'SetClassName': |
811 | 811 | $setName = substr($name, 0, strlen($name) - strlen('ClassName')); |
812 | - return $this->classPrefix . $setName; |
|
812 | + return $this->classPrefix.$setName; |
|
813 | 813 | |
814 | 814 | case substr($name, -strlen('ClassName')) === 'ClassName': |
815 | 815 | $recordName = substr($name, 0, strlen($name) - strlen('ClassName')); |
816 | - return $this->classPrefix . $recordName; |
|
816 | + return $this->classPrefix.$recordName; |
|
817 | 817 | |
818 | 818 | case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set': |
819 | 819 | $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include'))); |
820 | - require_once PHP_SET_PATH . $fileNameBase . '.class.php'; |
|
820 | + require_once PHP_SET_PATH.$fileNameBase.'.class.php'; |
|
821 | 821 | return; |
822 | 822 | |
823 | 823 | case substr($name, -strlen('Set')) === 'Set': |
824 | - $includeMethod = 'include' . $name; |
|
824 | + $includeMethod = 'include'.$name; |
|
825 | 825 | $this->$includeMethod(); |
826 | - $setClassNameMethod = $name . 'ClassName'; |
|
826 | + $setClassNameMethod = $name.'ClassName'; |
|
827 | 827 | $className = $this->$setClassNameMethod(); |
828 | 828 | $set = new $className($this); |
829 | 829 | return $set; |
830 | 830 | |
831 | 831 | //case method_exists($this, $name . 'Set'): |
832 | 832 | default: |
833 | - $setName = $name . 'Set'; |
|
834 | - $recordClassNameMethod = $name . 'ClassName'; |
|
833 | + $setName = $name.'Set'; |
|
834 | + $recordClassNameMethod = $name.'ClassName'; |
|
835 | 835 | $recordClassName = $this->$recordClassNameMethod(); |
836 | 836 | if (isset($arguments[0])) { |
837 | 837 | if ($arguments[0] instanceof $recordClassName) { |