Passed
Push — master ( 6ceb79...0b3ee0 )
by Laurent
02:34
created
programs/customsection.ctrl.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 
24 24
 
25
-require_once APP_CTRL_PATH . '/record.ctrl.php';
25
+require_once APP_CTRL_PATH.'/record.ctrl.php';
26 26
 
27 27
 
28 28
 /**
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $box = $W->VBoxItems();
75 75
 
76 76
         foreach ($availableFields as $field) {
77
-            $fieldName =  $field['name'];
77
+            $fieldName = $field['name'];
78 78
             $fieldDescription = $field['description'];
79 79
             if (substr($fieldName, 0, 1) !== '_') {
80 80
                 $fieldDescription = $App->translate($fieldDescription);
@@ -280,7 +280,7 @@  discard block
 block discarded – undo
280 280
         $recordSet = $this->getRecordSet();
281 281
         $record = $recordSet->request($id);
282 282
 
283
-        $object = $record->object . 'Set';
283
+        $object = $record->object.'Set';
284 284
 
285 285
         $objectRecordSet = $App->$object();
286 286
 
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
         $recordSet = $this->getRecordSet();
355 355
         $record = $recordSet->request($data['id']);
356 356
 
357
-        $object = $record->object . 'Set';
357
+        $object = $record->object.'Set';
358 358
 
359 359
         $objectRecordSet = $App->$object();
360 360
 
Please login to merge, or discard this patch.
programs/ui/ui.helpers.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
Indentation   +260 added lines, -260 removed lines patch added patch discarded remove patch
@@ -33,50 +33,50 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
programs/ui/ui.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.
programs/init.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,12 +23,12 @@
 block discarded – undo
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();
Please login to merge, or discard this patch.
programs/customsection.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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;
Please login to merge, or discard this patch.
programs/record.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -175,7 +175,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
programs/app.php 1 patch
Spacing   +43 added lines, -43 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
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.
@@ -45,8 +45,8 @@  discard block
 block discarded – undo
45 45
         $this->addonPrefix = 'libapp';
46 46
         $this->addonName = 'libapp';
47 47
 
48
-        $this->classPrefix = $this->addonPrefix . '_';
49
-        $this->controllerTg = 'addon/' . $this->addonName . '/main';
48
+        $this->classPrefix = $this->addonPrefix.'_';
49
+        $this->controllerTg = 'addon/'.$this->addonName.'/main';
50 50
 
51 51
         $babDB = bab_getDB();
52 52
 
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
             if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') {
160 160
                 $incl = $method;
161
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
161
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
162 162
 
163 163
 
164 164
                 $classname = $this->$classNameMethod();
@@ -180,7 +180,7 @@  discard block
 block discarded – undo
180 180
                                 // We need to revert to multilang fields before synchronizing.
181 181
                                 $set->useLang(false);
182 182
                             }
183
-                            $sql .= $mysqlbackend->setToSql($set) . "\n";
183
+                            $sql .= $mysqlbackend->setToSql($set)."\n";
184 184
                         }
185 185
                     }
186 186
                 }
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
 
212 212
             if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') {
213 213
                 $incl = $method;
214
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
214
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
215 215
 
216 216
                 $classname = $this->$classNameMethod();
217 217
 
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
                             if (class_exists($classname) && method_exists($this, $call)) {
227 227
                                 $set = $this->$call();
228
-                                $sql .= $mysqlbackend->setToSql($set) . "\n";
228
+                                $sql .= $mysqlbackend->setToSql($set)."\n";
229 229
                             }
230 230
                         }
231 231
                     }
@@ -239,7 +239,7 @@  discard block
 block discarded – undo
239 239
 
240 240
     public function includeBase()
241 241
     {
242
-        require_once APP_PHP_PATH . 'base.class.php';
242
+        require_once APP_PHP_PATH.'base.class.php';
243 243
     }
244 244
 
245 245
     /**
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
      */
248 248
     public function includeRecordSet()
249 249
     {
250
-        require_once APP_SET_PATH . 'record.class.php';
250
+        require_once APP_SET_PATH.'record.class.php';
251 251
     }
252 252
 
253 253
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
      */
257 257
     public function includeTraceableRecordSet()
258 258
     {
259
-        require_once APP_SET_PATH . 'traceablerecord.class.php';
259
+        require_once APP_SET_PATH.'traceablerecord.class.php';
260 260
     }
261 261
 
262 262
 
@@ -272,7 +272,7 @@  discard block
 block discarded – undo
272 272
      */
273 273
     public function includeLogSet()
274 274
     {
275
-        require_once APP_SET_PATH . 'log.class.php';
275
+        require_once APP_SET_PATH.'log.class.php';
276 276
     }
277 277
 
278 278
     /**
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
      */
289 289
     public function LogSetClassName()
290 290
     {
291
-        return $this->LogClassName() . 'Set';
291
+        return $this->LogClassName().'Set';
292 292
     }
293 293
 
294 294
     /**
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      */
311 311
     public function includeLinkSet()
312 312
     {
313
-        require_once APP_SET_PATH . 'link.class.php';
313
+        require_once APP_SET_PATH.'link.class.php';
314 314
     }
315 315
 
316 316
     /**
@@ -326,7 +326,7 @@  discard block
 block discarded – undo
326 326
      */
327 327
     public function LinkSetClassName()
328 328
     {
329
-        return $this->LinkClassName() . 'Set';
329
+        return $this->LinkClassName().'Set';
330 330
     }
331 331
 
332 332
     /**
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
      */
348 348
     public function includeCustomFieldSet()
349 349
     {
350
-        require_once APP_SET_PATH . 'customfield.class.php';
350
+        require_once APP_SET_PATH.'customfield.class.php';
351 351
     }
352 352
 
353 353
     /**
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
      */
364 364
     public function CustomFieldSetClassName()
365 365
     {
366
-        return $this->CustomFieldClassName() . 'Set';
366
+        return $this->CustomFieldClassName().'Set';
367 367
     }
368 368
 
369 369
     /**
@@ -385,8 +385,8 @@  discard block
 block discarded – undo
385 385
      */
386 386
     public function includeCustomSectionSet()
387 387
     {
388
-        require_once APP_SET_PATH . 'traceablerecord.class.php';
389
-        require_once APP_SET_PATH . 'customsection.class.php';
388
+        require_once APP_SET_PATH.'traceablerecord.class.php';
389
+        require_once APP_SET_PATH.'customsection.class.php';
390 390
     }
391 391
 
392 392
     /**
@@ -402,7 +402,7 @@  discard block
 block discarded – undo
402 402
      */
403 403
     public function CustomSectionSetClassName()
404 404
     {
405
-        return $this->CustomSectionClassName() . 'Set';
405
+        return $this->CustomSectionClassName().'Set';
406 406
     }
407 407
 
408 408
     /**
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
      */
425 425
     public function includeTagSet()
426 426
     {
427
-        require_once APP_SET_PATH . 'tag.class.php';
427
+        require_once APP_SET_PATH.'tag.class.php';
428 428
     }
429 429
 
430 430
     /**
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
      */
441 441
     public function TagSetClassName()
442 442
     {
443
-        return $this->TagClassName() . 'Set';
443
+        return $this->TagClassName().'Set';
444 444
     }
445 445
 
446 446
     /**
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
             return null;
476 476
         }
477 477
         list($classname, $id) = $refParts;
478
-        $classSet = $classname . 'Set';
478
+        $classSet = $classname.'Set';
479 479
         $set = $this->$classSet();
480 480
         if (isset($set)) {
481 481
             return $set->get($id);
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
     {
495 495
         $fullClassName = get_class($record);
496 496
         list(, $className) = explode('_', $fullClassName);
497
-        return $className . ':' . $record->id;
497
+        return $className.':'.$record->id;
498 498
     }
499 499
 
500 500
 
@@ -521,7 +521,7 @@  discard block
 block discarded – undo
521 521
      */
522 522
     public function translate($str, $str_plurals = null, $number = null)
523 523
     {
524
-        require_once APP_PHP_PATH . 'functions.php';
524
+        require_once APP_PHP_PATH.'functions.php';
525 525
         $translation = $str;
526 526
         if ($translate = bab_functionality::get('Translate/Gettext')) {
527 527
             /* @var $translate Func_Translate_Gettext */
@@ -572,16 +572,16 @@  discard block
 block discarded – undo
572 572
      */
573 573
     public function mailTo($addr, $subject = null, $body = null)
574 574
     {
575
-        $mailTo = 'mailto:' . $addr;
575
+        $mailTo = 'mailto:'.$addr;
576 576
         $parameters = array();
577 577
         if (isset($subject)) {
578
-            $parameters[] = 'subject=' . $subject;
578
+            $parameters[] = 'subject='.$subject;
579 579
         }
580 580
         if (isset($body)) {
581
-            $parameters[] = 'body=' . $body;
581
+            $parameters[] = 'body='.$body;
582 582
         }
583 583
         if (!empty($parameters)) {
584
-            $mailTo .= '?' . implode('&', $parameters);
584
+            $mailTo .= '?'.implode('&', $parameters);
585 585
         }
586 586
 
587 587
         return $mailTo;
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
         }
633 633
 
634 634
         $number = number_format($number, $decimals, ',', ' ');
635
-        return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol);
635
+        return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol);
636 636
     }
637 637
 
638 638
 
@@ -652,7 +652,7 @@  discard block
 block discarded – undo
652 652
         }
653 653
 
654 654
         if (!isset($format)) {
655
-            $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat());
655
+            $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat());
656 656
         }
657 657
         $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil();
658 658
 
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
      */
674 674
     public function includeController()
675 675
     {
676
-        require_once APP_PHP_PATH . '/controller.class.php';
676
+        require_once APP_PHP_PATH.'/controller.class.php';
677 677
     }
678 678
 
679 679
 
@@ -682,7 +682,7 @@  discard block
 block discarded – undo
682 682
      */
683 683
     public function includeRecordController()
684 684
     {
685
-        require_once APP_CTRL_PATH . '/record.ctrl.php';
685
+        require_once APP_CTRL_PATH.'/record.ctrl.php';
686 686
     }
687 687
 
688 688
 
@@ -722,7 +722,7 @@  discard block
 block discarded – undo
722 722
      */
723 723
     public function includeUi()
724 724
     {
725
-        require_once APP_UI_PATH . 'ui.class.php';
725
+        require_once APP_UI_PATH.'ui.class.php';
726 726
     }
727 727
 
728 728
 
@@ -734,14 +734,14 @@  discard block
 block discarded – undo
734 734
     public function Ui()
735 735
     {
736 736
         $this->includeUi();
737
-        return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this);
737
+        return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this);
738 738
     }
739 739
 
740 740
 
741 741
 
742 742
     protected function includeAccess()
743 743
     {
744
-        require_once WORKSPACE_PHP_PATH . '/access.class.php';
744
+        require_once WORKSPACE_PHP_PATH.'/access.class.php';
745 745
     }
746 746
 
747 747
 
@@ -773,29 +773,29 @@  discard block
 block discarded – undo
773 773
 
774 774
             case substr($name, -strlen('SetClassName')) === 'SetClassName':
775 775
                 $setName = substr($name, 0, strlen($name) - strlen('ClassName'));
776
-                return $this->classPrefix . $setName;
776
+                return $this->classPrefix.$setName;
777 777
 
778 778
             case substr($name, -strlen('ClassName')) === 'ClassName':
779 779
                 $recordName = substr($name, 0, strlen($name) - strlen('ClassName'));
780
-                return $this->classPrefix . $recordName;
780
+                return $this->classPrefix.$recordName;
781 781
 
782 782
             case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set':
783 783
                 $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include')));
784
-                require_once PHP_SET_PATH . $fileNameBase . '.class.php';
784
+                require_once PHP_SET_PATH.$fileNameBase.'.class.php';
785 785
                 return;
786 786
 
787 787
             case substr($name, -strlen('Set')) === 'Set':
788
-                $includeMethod = 'include' . $name;
788
+                $includeMethod = 'include'.$name;
789 789
                 $this->$includeMethod();
790
-                $setClassNameMethod = $name . 'ClassName';
790
+                $setClassNameMethod = $name.'ClassName';
791 791
                 $className = $this->$setClassNameMethod();
792 792
                 $set = new $className($this);
793 793
                 return $set;
794 794
 
795 795
                 //case method_exists($this, $name . 'Set'):
796 796
             default:
797
-                $setName = $name . 'Set';
798
-                $recordClassNameMethod = $name . 'ClassName';
797
+                $setName = $name.'Set';
798
+                $recordClassNameMethod = $name.'ClassName';
799 799
                 $recordClassName = $this->$recordClassNameMethod();
800 800
                 if (isset($arguments[0])) {
801 801
                     if ($arguments[0] instanceof $recordClassName) {
Please login to merge, or discard this patch.