Passed
Push — master ( fda82f...bdc416 )
by Robin
02:13 queued 12s
created
programs/link.class.php 1 patch
Indentation   +230 added lines, -230 removed lines patch added patch discarded remove patch
@@ -104,243 +104,243 @@
 block discarded – undo
104 104
     }
105 105
 
106 106
 
107
-	/**
108
-	 * @param	string	$sourceClass
109
-	 */
110
-	public function joinSource($sourceClass)
111
-	{
112
-	    if (get_class($this->sourceId) !== $sourceClass . 'Set') {
113
-    	    $this->hasOne('sourceId', $sourceClass . 'Set');
114
-    		$this->join('sourceId');
115
-	    }
116
-	}
117
-
118
-
119
-	/**
120
-	 * @param	string	$targetClass
121
-	 */
122
-	public function joinTarget($targetClass = null)
123
-	{
124
-	    if (get_class($this->targetId) !== $targetClass . 'Set') {
125
-    		$this->hasOne('targetId', $targetClass . 'Set');
126
-    		$this->join('targetId');
127
-	    }
128
-	}
107
+    /**
108
+     * @param	string	$sourceClass
109
+     */
110
+    public function joinSource($sourceClass)
111
+    {
112
+        if (get_class($this->sourceId) !== $sourceClass . 'Set') {
113
+            $this->hasOne('sourceId', $sourceClass . 'Set');
114
+            $this->join('sourceId');
115
+        }
116
+    }
117
+
118
+
119
+    /**
120
+     * @param	string	$targetClass
121
+     */
122
+    public function joinTarget($targetClass = null)
123
+    {
124
+        if (get_class($this->targetId) !== $targetClass . 'Set') {
125
+            $this->hasOne('targetId', $targetClass . 'Set');
126
+            $this->join('targetId');
127
+        }
128
+    }
129
+
130
+
131
+    /**
132
+     * @param string $recordClass
133
+     * @return ORM_IsCriterion
134
+     */
135
+    public function sourceIsA($recordClass)
136
+    {
137
+        return $this->sourceClass->is($recordClass);
138
+    }
139
+
140
+
141
+    /**
142
+     * @param app_Record $record
143
+     * @return ORM_Criteria
144
+     */
145
+    public function sourceIs(app_Record $record)
146
+    {
147
+        return $this->all(
148
+            $this->sourceId->is($record->id),
149
+            $this->sourceIsA(get_class($record))
150
+        );
151
+    }
129 152
 
130 153
 
131 154
     /**
132 155
      * @param string $recordClass
133 156
      * @return ORM_IsCriterion
134 157
      */
135
-	public function sourceIsA($recordClass)
136
-	{
137
-		return $this->sourceClass->is($recordClass);
138
-	}
139
-
140
-
141
-	/**
142
-	 * @param app_Record $record
143
-	 * @return ORM_Criteria
144
-	 */
145
-	public function sourceIs(app_Record $record)
146
-	{
147
-	    return $this->all(
148
-	        $this->sourceId->is($record->id),
149
-	       $this->sourceIsA(get_class($record))
150
-	    );
151
-	}
152
-
153
-
154
-	/**
155
-	 * @param string $recordClass
156
-	 * @return ORM_IsCriterion
157
-	 */
158
-	public function targetIsA($recordClass)
159
-	{
160
-	    return $this->targetClass->is($recordClass);
161
-	}
162
-
163
-
164
-	/**
165
-	 * @param app_Record $record
166
-	 * @return ORM_Criteria
167
-	 */
168
-	public function targetIs(app_Record $record)
169
-	{
170
-	    return $this->all(
171
-	        $this->targetId->is($record->id),
172
-	        $this->targetIsA(get_class($record))
158
+    public function targetIsA($recordClass)
159
+    {
160
+        return $this->targetClass->is($recordClass);
161
+    }
162
+
163
+
164
+    /**
165
+     * @param app_Record $record
166
+     * @return ORM_Criteria
167
+     */
168
+    public function targetIs(app_Record $record)
169
+    {
170
+        return $this->all(
171
+            $this->targetId->is($record->id),
172
+            $this->targetIsA(get_class($record))
173 173
         );
174
-	}
175
-
176
-
177
-	/**
178
-	 *
179
-	 * @return ORM_Iterator
180
-	 */
181
-	public function selectForSource(app_Record $object, $targetClass = null, $linkType = null)
182
-	{
183
-	    $criteria = $this->sourceIs($object);
184
-
185
-		if (isset($targetClass)) {
186
-		    $this->joinTarget($targetClass);
187
-		    $criteria = $criteria->_AND_($this->targetClass->is($targetClass));
188
-		}
189
-
190
-		if (isset($linkType)) {
191
-			if (is_array($linkType)) {
192
-				$criteria = $criteria->_AND_($this->type->in($linkType));
193
-			} else {
194
-				$criteria = $criteria->_AND_($this->type->is($linkType));
195
-			}
196
-		}
197
-
198
-		if (is_a($this->targetId, 'app_TraceableRecordSet')) {
199
-			$criteria = $criteria->_AND_($this->targetId->deleted->is(false));
200
-		}
201
-
202
-		return $this->select($criteria);
203
-	}
204
-
205
-
206
-	/**
207
-	 *
208
-	 * @return ORM_Iterator
209
-	 */
210
-	public function selectForSources($objects, $targetClass, $linkType = null)
211
-	{
212
-		$sourceClass = null;
213
-		$sourceIds = array();
214
-
215
-		foreach ($objects as $obj) {
216
-			if (is_null($sourceClass)) {
217
-				$sourceClass = get_class($obj);
218
-			}
219
-			$sourceIds[] = $obj->id;
220
-		}
221
-		$criteria = $this->sourceId->in($sourceIds)
222
-			->_AND_($this->sourceClass->is($sourceClass));
223
-
224
-		if (isset($targetClass)) {
225
-		    $this->joinTarget($targetClass);
226
-		    $criteria = $criteria->_AND_($this->targetClass->is($targetClass));
227
-		}
228
-
229
-		if (isset($linkType)) {
230
-			if (is_array($linkType)) {
231
-				$criteria = $criteria->_AND_($this->type->in($linkType));
232
-			} else {
233
-				$criteria = $criteria->_AND_($this->type->is($linkType));
234
-			}
235
-		}
236
-		return $this->select($criteria);
237
-	}
238
-
239
-
240
-	/**
241
-	 *
242
-	 * @return ORM_Iterator
243
-	 */
244
-	public function selectForTarget(app_Record $object, $sourceClass = null, $linkType = null)
245
-	{
246
-	    $criteria = $this->targetIs($object);
247
-
248
-		if (isset($sourceClass)) {
249
-		    $this->joinSource($sourceClass);
250
-			$criteria = $criteria->_AND_($this->sourceClass->is($sourceClass));
251
-		}
252
-
253
-		if (isset($linkType)) {
254
-			if (is_array($linkType)) {
255
-				$criteria = $criteria->_AND_($this->type->in($linkType));
256
-			} else {
257
-				$criteria = $criteria->_AND_($this->type->is($linkType));
258
-			}
259
-		}
260
-
261
-		return $this->select($criteria);
262
-	}
263
-
264
-
265
-	/**
266
-	 *
267
-	 * @return ORM_Iterator
268
-	 */
269
-	public function selectForTargets($objects, $sourceClass = null, $linkType = null)
270
-	{
271
-		$targetClass = null;
272
-		$targetIds = array();
273
-
274
-		foreach ($objects as $obj) {
275
-			if (is_null($targetClass)) {
276
-				$targetClass = get_class($obj);
277
-			}
278
-			$targetIds[] = $obj->id;
279
-		}
280
-		$criteria = $this->targetId->in($targetIds)
281
-			->_AND_($this->targetClass->is($targetClass));
282
-
283
-		if (isset($sourceClass)) {
284
-		    $this->joinSource($sourceClass);
285
-			$criteria = $criteria->_AND_($this->sourceClass->is($sourceClass));
286
-		}
287
-
288
-		if (isset($linkType)) {
289
-			if (is_array($linkType)) {
290
-				$criteria = $criteria->_AND_($this->type->in($linkType));
291
-			} else {
292
-				$criteria = $criteria->_AND_($this->type->is($linkType));
293
-			}
294
-		}
295
-
296
-		return $this->select($criteria);
297
-	}
298
-
299
-
300
-
301
-	/**
302
-	 * delete all links to an object
303
-	 *
304
-	 * @param	app_Record		$object
305
-	 * @param	string			$targetClass 	if target class is set, links will be deleted only for target classes
306
-	 * @param	bool			$deleteTarget	if set to true, the target will be deleted to
307
-	 */
308
-	public function deleteForSource(app_Record $object, $targetClass = null, $deleteTarget = false, $linkType = null)
309
-	{
310
-		$set = clone $this;
311
-		$App = $object->App();
312
-
313
-		$criteria = $set->sourceId->is($object->id)->_AND_(
314
-			$set->sourceClass->is(get_class($object))
315
-		);
316
-
317
-		if (null !== $targetClass) {
318
-			$criteria = $criteria->_AND_(
319
-				$set->targetClass->is($targetClass)
320
-			);
321
-		}
322
-		if (null !== $linkType) {
323
-			$criteria = $criteria->_AND_(
324
-				$set->type->is($linkType)
325
-			);
326
-		}
327
-
328
-		if ($deleteTarget) {
329
-			foreach($set->select($criteria) as $link) {
330
-
331
-				$className = $link->targetClass.'Set';
332
-
333
-				// remove prefix
334
-
335
-				$className = mb_substr($className, 1 + mb_strpos($className, '_'));
336
-				$targetSet = $App->$className();
337
-
338
-				$targetSet->delete($targetSet->id->is($link->targetId));
339
-			}
340
-		}
341
-
342
-		return $set->delete($criteria);
343
-	}
174
+    }
175
+
176
+
177
+    /**
178
+     *
179
+     * @return ORM_Iterator
180
+     */
181
+    public function selectForSource(app_Record $object, $targetClass = null, $linkType = null)
182
+    {
183
+        $criteria = $this->sourceIs($object);
184
+
185
+        if (isset($targetClass)) {
186
+            $this->joinTarget($targetClass);
187
+            $criteria = $criteria->_AND_($this->targetClass->is($targetClass));
188
+        }
189
+
190
+        if (isset($linkType)) {
191
+            if (is_array($linkType)) {
192
+                $criteria = $criteria->_AND_($this->type->in($linkType));
193
+            } else {
194
+                $criteria = $criteria->_AND_($this->type->is($linkType));
195
+            }
196
+        }
197
+
198
+        if (is_a($this->targetId, 'app_TraceableRecordSet')) {
199
+            $criteria = $criteria->_AND_($this->targetId->deleted->is(false));
200
+        }
201
+
202
+        return $this->select($criteria);
203
+    }
204
+
205
+
206
+    /**
207
+     *
208
+     * @return ORM_Iterator
209
+     */
210
+    public function selectForSources($objects, $targetClass, $linkType = null)
211
+    {
212
+        $sourceClass = null;
213
+        $sourceIds = array();
214
+
215
+        foreach ($objects as $obj) {
216
+            if (is_null($sourceClass)) {
217
+                $sourceClass = get_class($obj);
218
+            }
219
+            $sourceIds[] = $obj->id;
220
+        }
221
+        $criteria = $this->sourceId->in($sourceIds)
222
+            ->_AND_($this->sourceClass->is($sourceClass));
223
+
224
+        if (isset($targetClass)) {
225
+            $this->joinTarget($targetClass);
226
+            $criteria = $criteria->_AND_($this->targetClass->is($targetClass));
227
+        }
228
+
229
+        if (isset($linkType)) {
230
+            if (is_array($linkType)) {
231
+                $criteria = $criteria->_AND_($this->type->in($linkType));
232
+            } else {
233
+                $criteria = $criteria->_AND_($this->type->is($linkType));
234
+            }
235
+        }
236
+        return $this->select($criteria);
237
+    }
238
+
239
+
240
+    /**
241
+     *
242
+     * @return ORM_Iterator
243
+     */
244
+    public function selectForTarget(app_Record $object, $sourceClass = null, $linkType = null)
245
+    {
246
+        $criteria = $this->targetIs($object);
247
+
248
+        if (isset($sourceClass)) {
249
+            $this->joinSource($sourceClass);
250
+            $criteria = $criteria->_AND_($this->sourceClass->is($sourceClass));
251
+        }
252
+
253
+        if (isset($linkType)) {
254
+            if (is_array($linkType)) {
255
+                $criteria = $criteria->_AND_($this->type->in($linkType));
256
+            } else {
257
+                $criteria = $criteria->_AND_($this->type->is($linkType));
258
+            }
259
+        }
260
+
261
+        return $this->select($criteria);
262
+    }
263
+
264
+
265
+    /**
266
+     *
267
+     * @return ORM_Iterator
268
+     */
269
+    public function selectForTargets($objects, $sourceClass = null, $linkType = null)
270
+    {
271
+        $targetClass = null;
272
+        $targetIds = array();
273
+
274
+        foreach ($objects as $obj) {
275
+            if (is_null($targetClass)) {
276
+                $targetClass = get_class($obj);
277
+            }
278
+            $targetIds[] = $obj->id;
279
+        }
280
+        $criteria = $this->targetId->in($targetIds)
281
+            ->_AND_($this->targetClass->is($targetClass));
282
+
283
+        if (isset($sourceClass)) {
284
+            $this->joinSource($sourceClass);
285
+            $criteria = $criteria->_AND_($this->sourceClass->is($sourceClass));
286
+        }
287
+
288
+        if (isset($linkType)) {
289
+            if (is_array($linkType)) {
290
+                $criteria = $criteria->_AND_($this->type->in($linkType));
291
+            } else {
292
+                $criteria = $criteria->_AND_($this->type->is($linkType));
293
+            }
294
+        }
295
+
296
+        return $this->select($criteria);
297
+    }
298
+
299
+
300
+
301
+    /**
302
+     * delete all links to an object
303
+     *
304
+     * @param	app_Record		$object
305
+     * @param	string			$targetClass 	if target class is set, links will be deleted only for target classes
306
+     * @param	bool			$deleteTarget	if set to true, the target will be deleted to
307
+     */
308
+    public function deleteForSource(app_Record $object, $targetClass = null, $deleteTarget = false, $linkType = null)
309
+    {
310
+        $set = clone $this;
311
+        $App = $object->App();
312
+
313
+        $criteria = $set->sourceId->is($object->id)->_AND_(
314
+            $set->sourceClass->is(get_class($object))
315
+        );
316
+
317
+        if (null !== $targetClass) {
318
+            $criteria = $criteria->_AND_(
319
+                $set->targetClass->is($targetClass)
320
+            );
321
+        }
322
+        if (null !== $linkType) {
323
+            $criteria = $criteria->_AND_(
324
+                $set->type->is($linkType)
325
+            );
326
+        }
327
+
328
+        if ($deleteTarget) {
329
+            foreach($set->select($criteria) as $link) {
330
+
331
+                $className = $link->targetClass.'Set';
332
+
333
+                // remove prefix
334
+
335
+                $className = mb_substr($className, 1 + mb_strpos($className, '_'));
336
+                $targetSet = $App->$className();
337
+
338
+                $targetSet->delete($targetSet->id->is($link->targetId));
339
+            }
340
+        }
341
+
342
+        return $set->delete($criteria);
343
+    }
344 344
 
345 345
 
346 346
     /**
Please login to merge, or discard this patch.
programs/define.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@
 block discarded – undo
21 21
  * @copyright Copyright (c) 2006 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-define('APP_PHP_PATH', dirname(__FILE__) . '/');
25
-define('APP_SET_PATH', dirname(__FILE__) . '/');
26
-define('APP_UI_PATH', dirname(__FILE__) . '/ui/');
27
-define('APP_WIDGETS_PATH', APP_UI_PATH . 'widgets/');
28
-define('APP_CTRL_PATH', dirname(__FILE__) . '/');
24
+define('APP_PHP_PATH', dirname(__FILE__).'/');
25
+define('APP_SET_PATH', dirname(__FILE__).'/');
26
+define('APP_UI_PATH', dirname(__FILE__).'/ui/');
27
+define('APP_WIDGETS_PATH', APP_UI_PATH.'widgets/');
28
+define('APP_CTRL_PATH', dirname(__FILE__).'/');
29 29
 
30
-require_once APP_PHP_PATH . 'base.class.php';
31
-require_once APP_UI_PATH . 'base.ui.php';
30
+require_once APP_PHP_PATH.'base.class.php';
31
+require_once APP_UI_PATH.'base.ui.php';
32 32
 
33
-require_once $GLOBALS['babInstallPath'] . 'utilit/dateTime.php';
33
+require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
34 34
 
35 35
 
36 36
 
Please login to merge, or discard this patch.
programs/component.class.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2019 by CapWelton ({@link http://www.capwelton.com})
22 22
  */
23 23
 
24
-require_once dirname(__FILE__). '/record.ctrl.php';
24
+require_once dirname(__FILE__).'/record.ctrl.php';
25 25
 
26 26
 class app_Component 
27 27
 {
@@ -56,15 +56,15 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $main = new ReflectionClass($this->set);
58 58
         $dependencies = array();
59
-        if($main->hasMethod('getRequiredComponents')){
59
+        if ($main->hasMethod('getRequiredComponents')) {
60 60
             $requiredComponents = $this->recordSet()->getRequiredComponents();
61
-            foreach ($requiredComponents as $requiredComponent){
61
+            foreach ($requiredComponents as $requiredComponent) {
62 62
                 $dependencies['requiredComponents'][] = $requiredComponent;
63 63
             }
64 64
         }
65
-        if($main->hasMethod('getOptionalComponents')){
65
+        if ($main->hasMethod('getOptionalComponents')) {
66 66
             $optionalComponents = $this->recordSet()->getOptionalComponents();
67
-            foreach ($optionalComponents as $optionalComponent){
67
+            foreach ($optionalComponents as $optionalComponent) {
68 68
                 $dependencies['optionalComponents'][] = $optionalComponent;
69 69
             }
70 70
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function onUpdate()
80 80
     {
81 81
         $main = new ReflectionClass($this->set);
82
-        if($main->hasMethod('onUpdate')){
82
+        if ($main->hasMethod('onUpdate')) {
83 83
             $this->recordSet()->onUpdate();
84 84
         }
85 85
     }
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function controller($proxy = true)
91 91
     {
92
-        if(!isset($this->controllerObject)){
92
+        if (!isset($this->controllerObject)) {
93 93
             $this->app->includeRecordController();
94 94
             $ctrl = $this->controller;
95 95
             $this->controllerObject = new $ctrl($this->app, $this);
96 96
         }
97
-        if($proxy){
97
+        if ($proxy) {
98 98
             return $this->controllerObject->proxy();
99 99
         }
100 100
         return $this->controllerObject;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function ui()
115 115
     {
116
-        if(!isset($this->uiObject)){
116
+        if (!isset($this->uiObject)) {
117 117
             $ui = $this->ui;
118 118
             $this->uiObject = new $ui($this->app);
119 119
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     public function getSetClassName()
130 130
     {
131 131
         $reflectionClass = new ReflectionClass($this->set);
132
-        return $this->app->classPrefix . $reflectionClass->getShortName();
132
+        return $this->app->classPrefix.$reflectionClass->getShortName();
133 133
     }
134 134
     
135 135
     public function getRecordClassName()
Please login to merge, or discard this patch.
programs/ui/ui.class.php 1 patch
Spacing   +7 added lines, -7 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,25 +77,25 @@  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
     public function Chip($label, $labelIcon = null, $action = null, $actionIcon = null, $id = null)
85 85
     {
86
-        require_once APP_WIDGETS_PATH . 'chip.class.php';
86
+        require_once APP_WIDGETS_PATH.'chip.class.php';
87 87
         return new app_Chip($this->App(), $label, $labelIcon, $action, $actionIcon, $id);
88 88
     }
89 89
     
90 90
     public function CustomFieldTableView($id = null)
91 91
     {
92
-        require_once APP_UI_PATH . 'customfield.ui.php';
92
+        require_once APP_UI_PATH.'customfield.ui.php';
93 93
         return new app_CustomFieldTableView($this->App(), $id);
94 94
     }
95 95
     
96 96
     public function CustomFieldEditor(app_CustomField $customField = null, $id = null, $layout = null)
97 97
     {
98
-        require_once APP_UI_PATH . 'customfield.ui.php';
98
+        require_once APP_UI_PATH.'customfield.ui.php';
99 99
         return new app_CustomFieldEditor($this->App(), $customField, $id, $layout);
100 100
     }
101 101
 }
102 102
\ No newline at end of file
Please login to merge, or discard this patch.
programs/ui/base.ui.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 bab_Widgets()->includePhpClass('widget_InputWidget');
27 27
 bab_Widgets()->includePhpClass('widget_TableModelView');
28 28
 
29
-require_once dirname(__FILE__) . '/ui.helpers.php';
29
+require_once dirname(__FILE__).'/ui.helpers.php';
30 30
 
31 31
 /**
32 32
  * @return Widget_Form
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                 continue;
677 677
             }
678 678
 
679
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
679
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
680 680
 
681 681
             if ($currentColumn + $nbCol > 12) {
682 682
                 $this->addItem($row);
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
                 $parameters = $displayField['parameters'];
705 705
                 $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
706 706
                 $label = isset($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : '';
707
-                $displayFieldMethod = '_' . $displayFieldName;
707
+                $displayFieldMethod = '_'.$displayFieldName;
708 708
 
709 709
                 if (method_exists($this, $displayFieldMethod)) {
710 710
                     $widget = $this->$displayFieldMethod($customSection, $label);
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
             $parameters = $displayField['parameters'];
763 763
             $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
764 764
             $label = isset($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : '';
765
-            $displayFieldMethod = '_' . $displayFieldName;
765
+            $displayFieldMethod = '_'.$displayFieldName;
766 766
 
767 767
             if (method_exists($this, $displayFieldMethod)) {
768 768
                 $widget = $this->$displayFieldMethod($customSection, $label);
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
         $row = $W->Items()->setSizePolicy('row');
1048 1048
         foreach ($customSections as $customSection) {
1049 1049
 
1050
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
1050
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
1051 1051
 
1052 1052
             if ($currentColumn + $nbCol > 12) {
1053 1053
                 $this->addItem($row);
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
                 $parameters = $displayField['parameters'];
1075 1075
                 $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
1076 1076
                 $label = isset($parameters['label']) ? $parameters['label'] : '';
1077
-                $displayFieldMethod = '_' . $displayFieldName;
1077
+                $displayFieldMethod = '_'.$displayFieldName;
1078 1078
 
1079 1079
                 if (method_exists($this, $displayFieldMethod)) {
1080 1080
                     $value = $this->$displayFieldMethod($customSection, $label);
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
             // we try to select one according to the classname prefix.
1177 1177
             list($prefix) = explode('_', get_class($this));
1178 1178
             $functionalityName = ucwords($prefix);
1179
-            $this->app = @bab_functionality::get('App/' . $functionalityName);
1179
+            $this->app = @bab_functionality::get('App/'.$functionalityName);
1180 1180
             if (!$this->app) {
1181 1181
                 $this->app = @bab_functionality::get('App');
1182 1182
             }
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
         $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber);
1238 1238
 
1239 1239
         if (isset($name)) {
1240
-            $this->sortParameterName = $name . '[filter][sort]';
1240
+            $this->sortParameterName = $name.'[filter][sort]';
1241 1241
         } else {
1242 1242
             $this->sortParameterName = 'filter[sort]';
1243 1243
         }
@@ -1342,7 +1342,7 @@  discard block
 block discarded – undo
1342 1342
 
1343 1343
             $values = $set->select();
1344 1344
             foreach ($values as $record) {
1345
-                $widget->addOption($record->id, (string)$record->name);
1345
+                $widget->addOption($record->id, (string) $record->name);
1346 1346
             }
1347 1347
 
1348 1348
             return $widget;
@@ -1434,11 +1434,11 @@  discard block
 block discarded – undo
1434 1434
 
1435 1435
         foreach ($columns as $fieldName => $column) {
1436 1436
             $field = $column->getField();
1437
-            if (! $column->isSearchable()) {
1437
+            if (!$column->isSearchable()) {
1438 1438
                 continue;
1439 1439
             }
1440 1440
 
1441
-            if (! ($field instanceof ORM_Field)) {
1441
+            if (!($field instanceof ORM_Field)) {
1442 1442
                 $field = null;
1443 1443
             }
1444 1444
 
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
                 $input->addClass('widget-100pc');
1454 1454
 
1455 1455
                 $formItem = $this->handleFilterLabel($label, $input);
1456
-                $formItem->addClass('field_' . $fieldName);
1456
+                $formItem->addClass('field_'.$fieldName);
1457 1457
 
1458 1458
                 $mainSearch = (method_exists($column, 'isMainSearch') && $column->isMainSearch());
1459 1459
 
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
         }
1487 1487
 
1488 1488
 
1489
-        if (! $this->submit) {
1489
+        if (!$this->submit) {
1490 1490
             $this->submit = $W->SubmitButton();
1491 1491
             $this->submit->setLabel(widget_translate('Apply filter'));
1492 1492
         }
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 
1526 1526
 
1527 1527
                 foreach ($filterNames as $filterName) {
1528
-                    $filter = $W->getUserConfiguration($controller->getModelViewDefaultId() . '/filters/' . $filterName, 'widgets', false);
1528
+                    $filter = $W->getUserConfiguration($controller->getModelViewDefaultId().'/filters/'.$filterName, 'widgets', false);
1529 1529
 
1530 1530
 //                     $this->select->addItem(
1531 1531
 //                         $W->Link(
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
 //        $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber);
1640 1640
 
1641 1641
         if (isset($name)) {
1642
-            $this->sortParameterName = $name . '[filter][sort]';
1642
+            $this->sortParameterName = $name.'[filter][sort]';
1643 1643
         } else {
1644 1644
             $this->sortParameterName = 'filter[sort]';
1645 1645
         }
@@ -1737,7 +1737,7 @@  discard block
 block discarded – undo
1737 1737
 
1738 1738
     $tableview->setCurrentPage(isset($filterValues['pageNumber']) ? $filterValues['pageNumber'] : 0);
1739 1739
 
1740
-    $tableview->sortParameterName = $name . '[filter][sort]';
1740
+    $tableview->sortParameterName = $name.'[filter][sort]';
1741 1741
 
1742 1742
     if (isset($filterValues['sort'])) {
1743 1743
         $tableview->setSortField($filterValues['sort']);
@@ -2038,7 +2038,7 @@  discard block
 block discarded – undo
2038 2038
                 continue;
2039 2039
             }
2040 2040
 
2041
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
2041
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
2042 2042
 
2043 2043
             if ($currentColumn + $nbCol > 12) {
2044 2044
                 $this->addItem($row);
@@ -2089,7 +2089,7 @@  discard block
 block discarded – undo
2089 2089
                 $label = isset($parameters['label']) ? $parameters['label'] : null;
2090 2090
                 $sizePolicy = isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : '';
2091 2091
 
2092
-                $displayFieldMethod = '_' . $displayFieldName;
2092
+                $displayFieldMethod = '_'.$displayFieldName;
2093 2093
                 if (method_exists($this, $displayFieldMethod)) {
2094 2094
                     $item = $this->$displayFieldMethod($customSection, $label);
2095 2095
                 } else {
@@ -2120,7 +2120,7 @@  discard block
 block discarded – undo
2120 2120
             }
2121 2121
         }
2122 2122
 
2123
-        if ($currentColumn + $nbCol> 0) {
2123
+        if ($currentColumn + $nbCol > 0) {
2124 2124
             $this->addItem($row);
2125 2125
         }
2126 2126
     }
@@ -2241,7 +2241,7 @@  discard block
 block discarded – undo
2241 2241
 
2242 2242
         $displayable = $field->output($value);
2243 2243
 
2244
-        switch(true) {
2244
+        switch (true) {
2245 2245
             case ($field instanceof ORM_TextField):
2246 2246
                 $displayable = $W->RichText($displayable)->setRenderingOptions(BAB_HTML_ALL ^ BAB_HTML_P);
2247 2247
                 break;
Please login to merge, or discard this patch.
programs/ui/customfield.ui.php 1 patch
Indentation   +44 added lines, -44 removed lines patch added patch discarded remove patch
@@ -30,19 +30,19 @@  discard block
 block discarded – undo
30 30
  */
31 31
 class app_CustomFieldTableView extends app_TableModelView
32 32
 {
33
-	/**
34
-	 * @param ORM_Record	$record
35
-	 * @param string		$fieldPath
36
-	 * @return Widget_Item
37
-	 */
38
-	protected function computeCellContent(ORM_Record $record, $fieldPath)
39
-	{
40
-		$W = bab_Widgets();
41
-		$App = $record->App();
33
+    /**
34
+     * @param ORM_Record	$record
35
+     * @param string		$fieldPath
36
+     * @return Widget_Item
37
+     */
38
+    protected function computeCellContent(ORM_Record $record, $fieldPath)
39
+    {
40
+        $W = bab_Widgets();
41
+        $App = $record->App();
42 42
 
43
-		$editAction = $App->Controller()->CustomField()->edit($record->id);
43
+        $editAction = $App->Controller()->CustomField()->edit($record->id);
44 44
 
45
-		switch ($fieldPath) {
45
+        switch ($fieldPath) {
46 46
 
47 47
             case '_actions_':
48 48
                 $box = $W->FlowItems();
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
                 }
63 63
                 return $box;
64 64
 
65
-			case 'mandatory':
66
-			case 'visible_in_shop':
67
-				if (self::getRecordFieldValue($record, $fieldPath))
68
-				{
69
-					return $W->Label($App->translate('Yes'));
70
-				} else {
71
-					return $W->Label($App->translate('No'));
72
-				}
73
-				break;
74
-		}
65
+            case 'mandatory':
66
+            case 'visible_in_shop':
67
+                if (self::getRecordFieldValue($record, $fieldPath))
68
+                {
69
+                    return $W->Label($App->translate('Yes'));
70
+                } else {
71
+                    return $W->Label($App->translate('No'));
72
+                }
73
+                break;
74
+        }
75 75
 
76
-		return parent::computeCellContent($record, $fieldPath);
77
-	}
76
+        return parent::computeCellContent($record, $fieldPath);
77
+    }
78 78
 
79 79
 
80 80
 
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
                 ->addClass('widget-close-dialog')
215 215
                 ->setLabel($App->translate('Cancel'))
216 216
         );
217
-	}
217
+    }
218 218
 
219 219
 
220 220
     protected function section()
@@ -371,27 +371,27 @@  discard block
 block discarded – undo
371 371
 
372 372
 
373 373
 
374
-	public function mandatory()
375
-	{
376
-		$App = $this->App();
377
-		$W = $this->widgets;
374
+    public function mandatory()
375
+    {
376
+        $App = $this->App();
377
+        $W = $this->widgets;
378 378
 
379
-		return $this->labelledField(
380
-			$App->translate('Mandatory field'),
381
-			$W->Checkbox(),
382
-			__FUNCTION__
383
-		);
384
-	}
379
+        return $this->labelledField(
380
+            $App->translate('Mandatory field'),
381
+            $W->Checkbox(),
382
+            __FUNCTION__
383
+        );
384
+    }
385 385
 
386
-	public function visible_in_shop()
387
-	{
388
-		$App = $this->App();
389
-		$W = $this->widgets;
386
+    public function visible_in_shop()
387
+    {
388
+        $App = $this->App();
389
+        $W = $this->widgets;
390 390
 
391
-		return $this->labelledField(
392
-			$App->translate('Visible in online shop'),
393
-			$W->Checkbox(),
394
-			__FUNCTION__
395
-		);
396
-	}
391
+        return $this->labelledField(
392
+            $App->translate('Visible in online shop'),
393
+            $W->Checkbox(),
394
+            __FUNCTION__
395
+        );
396
+    }
397 397
 }
Please login to merge, or discard this patch.
programs/ui/widgets/chip.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,14 +70,14 @@
 block discarded – undo
70 70
         
71 71
         $html = "<div class='chip'>";
72 72
         
73
-        if(isset($this->labelIcon)){
73
+        if (isset($this->labelIcon)) {
74 74
             $icon = $W->Label('')->setIconFormat(16, 'left')->setIcon($this->labelIcon);
75 75
             $html .= $icon->display($W->HtmlCanvas());
76 76
         }
77 77
         
78 78
         $html .= $this->label;
79 79
         
80
-        if(isset($this->action)){
80
+        if (isset($this->action)) {
81 81
             $icon = $W->Link('', $this->action)->setIconFormat(16, 'left')->setOpenMode(Widget_Link::OPEN_DIALOG_AND_RELOAD);
82 82
             $icon->setIcon(isset($this->actionIcon) ? $this->actionIcon : Func_Icons::ACTIONS_DIALOG_CANCEL);
83 83
             $icon->addClass('chip-right-action');
Please login to merge, or discard this patch.
programs/record.ctrl.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1104,7 +1104,7 @@  discard block
 block discarded – undo
1104 1104
             $W->SubmitButton()
1105 1105
                 ->setAjaxAction($confirmedAction)
1106 1106
                 ->setLabel($App->translate('Delete'))
1107
-         );
1107
+            );
1108 1108
         $form->addButton($W->SubmitButton()->setLabel($App->translate('Cancel'))->addClass('widget-close-dialog'));
1109 1109
         $page->addItem($form);
1110 1110
 
@@ -1374,8 +1374,8 @@  discard block
 block discarded – undo
1374 1374
 
1375 1375
 
1376 1376
         /**
1377
-     * @return string[]
1378
-     */
1377
+         * @return string[]
1378
+         */
1379 1379
     public function getFilterNames()
1380 1380
     {
1381 1381
         $id = $this->getModelViewDefaultId();
Please login to merge, or discard this patch.
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2006 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once dirname(__FILE__) . '/controller.class.php';
24
+require_once dirname(__FILE__).'/controller.class.php';
25 25
 
26 26
 
27 27
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     protected function getRecordClassName()
38 38
     {
39 39
         $App = $this->App();
40
-        if($currentComponent = $App->getCurrentComponent()){
40
+        if ($currentComponent = $App->getCurrentComponent()) {
41 41
             return $currentComponent->getRecordClassName();
42 42
         }
43 43
         list(, $recordClassname) = explode('_Ctrl', $this->getClass());
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
     protected function getRecordSet()
56 56
     {
57 57
         $App = $this->App();
58
-        if($currentComponent = $App->getCurrentComponent()){
58
+        if ($currentComponent = $App->getCurrentComponent()) {
59 59
             return $currentComponent->recordSet();
60 60
         }
61 61
         $recordClassname = $this->getRecordClassName();
62
-        $recordSetClassname = $recordClassname . 'Set';
62
+        $recordSetClassname = $recordClassname.'Set';
63 63
 
64 64
         $recordSet = $App->$recordSetClassname();
65 65
         return $recordSet;
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
             if ($showLabel) {
112 112
                 $text = $actions->getTitle();
113 113
             }
114
-            $html = '<li><a class="icon ' . $actions->getIcon() .  '" href="' . $actions->url() . '">' . $text . '</a></li>';
114
+            $html = '<li><a class="icon '.$actions->getIcon().'" href="'.$actions->url().'">'.$text.'</a></li>';
115 115
         } elseif ($actions instanceof Widget_Link) {
116
-            $html = '<li>' . $actions->display($canvas) . '</li>';
116
+            $html = '<li>'.$actions->display($canvas).'</li>';
117 117
         } elseif (is_array($actions)) {
118 118
             if (isset($actions['items'])) {
119 119
                 $items = $actions['items'];
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
             if (isset($actions['icon'])) {
127 127
 
128 128
                 $html = '<li class="dropdown">'
129
-                    . '<a href="#" class="' . $actions['icon'] . ' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'
129
+                    . '<a href="#" class="'.$actions['icon'].' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'
130 130
                     . ($actions['icon'] === 'actions-context-menu'/*Func_Icons::ACTIONS_CONTEXT_MENU*/ ? '' : '<span class="caret"></span>')
131 131
                     . '</a>'
132
-                    . '<ul class="dropdown-menu dropdown-menu-right ' . Func_Icons::ICON_LEFT_SYMBOLIC . '">'
132
+                    . '<ul class="dropdown-menu dropdown-menu-right '.Func_Icons::ICON_LEFT_SYMBOLIC.'">'
133 133
                     . $html
134 134
                     . '</ul>';
135 135
             }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
         $recordClassname = $this->getRecordClassName();
154 154
 
155
-        $viewClassname =  $recordClassname . 'TableView';
155
+        $viewClassname = $recordClassname.'TableView';
156 156
         if (method_exists($Ui, $viewClassname)) {
157 157
             $types['table'] = array(
158 158
                 'classname' => $viewClassname,
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
             );
162 162
         }
163 163
 
164
-        $viewClassname =  $recordClassname . 'CardsView';
164
+        $viewClassname = $recordClassname.'CardsView';
165 165
         if (method_exists($Ui, $viewClassname)) {
166 166
             $types['cards'] = array(
167 167
                 'classname' => $viewClassname,
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             );
171 171
         }
172 172
 
173
-        $viewClassname =  $recordClassname . 'MapView';
173
+        $viewClassname = $recordClassname.'MapView';
174 174
         if (method_exists($Ui, $viewClassname)) {
175 175
             $types['map'] = array(
176 176
                 'classname' => $viewClassname,
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             );
180 180
         }
181 181
 
182
-        $viewClassname =  $recordClassname . 'CalendarView';
182
+        $viewClassname = $recordClassname.'CalendarView';
183 183
         if (method_exists($Ui, $viewClassname)) {
184 184
             $types['calendar'] = array(
185 185
                 'classname' => $viewClassname,
@@ -258,11 +258,11 @@  discard block
 block discarded – undo
258 258
         $recordSet = $this->getEditRecordSet();
259 259
 
260 260
         $recordClassname = $this->getRecordClassName();
261
-        $editorClassname =  $recordClassname . 'SectionEditor';
261
+        $editorClassname = $recordClassname.'SectionEditor';
262 262
         /* @var $editor app_RecordEditor */
263 263
         $editor = $Ui->$editorClassname();
264 264
         if (!isset($itemId)) {
265
-            $itemId = $this->getClass() . '_' . __FUNCTION__;
265
+            $itemId = $this->getClass().'_'.__FUNCTION__;
266 266
         }
267 267
         $editor->setId($itemId);
268 268
         $editor->setHiddenValue('tg', $App->controllerTg);
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     public function getModelViewDefaultId($itemId = null)
306 306
     {
307 307
         if (!isset($itemId)) {
308
-            $itemId = $this->getClass() . '_modelView';
308
+            $itemId = $this->getClass().'_modelView';
309 309
         }
310 310
 
311 311
         return $itemId;
@@ -323,10 +323,10 @@  discard block
 block discarded – undo
323 323
     protected function modelView($filter = null, $type = null, $columns = null, $itemId = null)
324 324
     {
325 325
         $App = $this->App();
326
-        if($currentComponent = $App->getCurrentComponent()){
326
+        if ($currentComponent = $App->getCurrentComponent()) {
327 327
             $Ui = $currentComponent->ui();
328 328
         }
329
-        else{
329
+        else {
330 330
             $Ui = $App->Ui();
331 331
         }
332 332
 
@@ -344,20 +344,20 @@  discard block
 block discarded – undo
344 344
 
345 345
         switch ($type) {
346 346
             case 'cards':
347
-                $tableviewClassname =  $currentComponent ? 'cardsView' : $recordClassname . 'CardsView';
347
+                $tableviewClassname = $currentComponent ? 'cardsView' : $recordClassname.'CardsView';
348 348
                 break;
349 349
 
350 350
             case 'map':
351
-                $tableviewClassname =  $currentComponent ? 'mapView' : $recordClassname . 'MapView';
351
+                $tableviewClassname = $currentComponent ? 'mapView' : $recordClassname.'MapView';
352 352
                 break;
353 353
 
354 354
             case 'calendar':
355
-                $tableviewClassname =  $currentComponent ? 'calendarView' : $recordClassname . 'CalendarView';
355
+                $tableviewClassname = $currentComponent ? 'calendarView' : $recordClassname.'CalendarView';
356 356
                 break;
357 357
 
358 358
             case 'table':
359 359
             default:
360
-                $tableviewClassname =  $currentComponent ? 'tableView' : $recordClassname . 'TableView';
360
+                $tableviewClassname = $currentComponent ? 'tableView' : $recordClassname.'TableView';
361 361
                 break;
362 362
         }
363 363
 
@@ -422,18 +422,18 @@  discard block
 block discarded – undo
422 422
     {
423 423
         $App = $this->App();
424 424
         $Ui = $App->Ui();
425
-        if($currentComponent = $App->getCurrentComponent()){
425
+        if ($currentComponent = $App->getCurrentComponent()) {
426 426
             $editor = $currentComponent->ui()->editor();
427 427
         }
428
-        else{
428
+        else {
429 429
 
430 430
             $recordClassname = $this->getRecordClassName();
431
-            $editorClassname =  $recordClassname . 'Editor';
431
+            $editorClassname = $recordClassname.'Editor';
432 432
             $editor = $Ui->$editorClassname();
433 433
         }
434 434
 
435 435
         if (!isset($itemId)) {
436
-            $itemId = $this->getClass() . '_' . __FUNCTION__;
436
+            $itemId = $this->getClass().'_'.__FUNCTION__;
437 437
         }
438 438
         $editor->setId($itemId);
439 439
         $editor->setHiddenValue('tg', $App->controllerTg);
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
                     $W->Link(
479 479
                         '',
480 480
                         $proxy->setFilteredViewType($tableView->getId(), $viewTypeId)
481
-                    )->addClass('icon', $viewType['icon'] . ($filteredViewType=== $viewTypeId ? ' active' : ''))
481
+                    )->addClass('icon', $viewType['icon'].($filteredViewType === $viewTypeId ? ' active' : ''))
482 482
 //                    ->setSizePolicy('btn btn-xs btn-default ' . ($filteredViewType === $viewTypeId ? 'active' : ''))
483 483
                     ->setTitle($viewType['label'])
484 484
                     ->setAjaxAction()
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 
523 523
         $filterVisibility = $this->getFilterVisibility($itemId);
524 524
         $filterVisibility = !$filterVisibility;
525
-        $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility);
525
+        $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility);
526 526
 
527 527
         return true;
528 528
     }
@@ -535,10 +535,10 @@  discard block
 block discarded – undo
535 535
     protected function getFilterVisibility($itemId)
536 536
     {
537 537
         $W = bab_Widgets();
538
-        $filterVisibility = $W->getUserConfiguration($itemId . '/filterVisibility');
538
+        $filterVisibility = $W->getUserConfiguration($itemId.'/filterVisibility');
539 539
         if (!isset($filterVisibility)) {
540 540
             $filterVisibility = false;
541
-            $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility);
541
+            $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility);
542 542
         }
543 543
         return $filterVisibility;
544 544
     }
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
     protected function getFilteredViewType($itemId)
553 553
     {
554 554
         $W = bab_Widgets();
555
-        $type = $W->getUserConfiguration($itemId . '/viewType');
555
+        $type = $W->getUserConfiguration($itemId.'/viewType');
556 556
         if (!isset($type)) {
557 557
             $type = 'table';
558 558
         }
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
     public function setFilteredViewType($itemId, $type = null)
569 569
     {
570 570
         $W = bab_Widgets();
571
-        $W->setUserConfiguration($itemId . '/viewType', $type);
571
+        $W->setUserConfiguration($itemId.'/viewType', $type);
572 572
 
573 573
         return true;
574 574
     }
@@ -716,17 +716,17 @@  discard block
 block discarded – undo
716 716
 
717 717
         switch ($format) {
718 718
             case 'xlsx':
719
-                $tableview->downloadXlsx($filename . '.xlsx');
719
+                $tableview->downloadXlsx($filename.'.xlsx');
720 720
                 break;
721 721
             case 'xls':
722
-                $tableview->downloadExcel($filename . '.xls');
722
+                $tableview->downloadExcel($filename.'.xls');
723 723
                 break;
724 724
             case 'ssv':
725
-                $tableview->downloadCsv($filename . '.csv', ';', $inline, 'Windows-1252');
725
+                $tableview->downloadCsv($filename.'.csv', ';', $inline, 'Windows-1252');
726 726
                 break;
727 727
             case 'csv':
728 728
             default:
729
-                $tableview->downloadCsv($filename . '.csv', ',', $inline, bab_charset::getIso());
729
+                $tableview->downloadCsv($filename.'.csv', ',', $inline, bab_charset::getIso());
730 730
                 break;
731 731
         }
732 732
     }
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
         $Ui = $App->Ui();
756 756
 
757 757
         $recordClassname = $this->getRecordClassName();
758
-        $fullFrameClassname =  $recordClassname . 'FullFrame';
758
+        $fullFrameClassname = $recordClassname.'FullFrame';
759 759
         $fullFrame = $Ui->$fullFrameClassname($record, $view);
760 760
 
761 761
 
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 
919 919
         $recordTitle = $record->getRecordTitle();
920 920
 
921
-        $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"');
921
+        $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"');
922 922
         return $message;
923 923
     }
924 924
 
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
                 $this->addMessage($message);
1017 1017
             }
1018 1018
 
1019
-            $this->addReloadSelector('.depends-' . $this->getRecordClassName());
1019
+            $this->addReloadSelector('.depends-'.$this->getRecordClassName());
1020 1020
             return true;
1021 1021
         }
1022 1022
 
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
             $this->addMessage($deletedMessage);
1049 1049
         }
1050 1050
 
1051
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1051
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1052 1052
 
1053 1053
         return true;
1054 1054
     }
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 
1089 1089
         $recordTitle = $record->getRecordTitle();
1090 1090
 
1091
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1091
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1092 1092
         $form->addItem($W->Title($subTitle, 5));
1093 1093
 
1094 1094
         $form->addItem($W->Title($App->translate('Confirm delete?'), 6));
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
             }
1148 1148
         }
1149 1149
 
1150
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1150
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1151 1151
 
1152 1152
         return true;
1153 1153
     }
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 
1177 1177
         $recordTitle = $record->getRecordTitle();
1178 1178
 
1179
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1179
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1180 1180
         $form->addItem($W->Title($subTitle, 5));
1181 1181
 
1182 1182
         $form->addItem($W->Title($App->translate('Confirm delete?'), 6));
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
         $record = null;
1221 1221
         foreach ($records as $record) {
1222 1222
         }
1223
-        if (! isset($record)) {
1223
+        if (!isset($record)) {
1224 1224
             throw new app_AccessException('Sorry, You are not allowed to perform this operation');
1225 1225
         }
1226 1226
         if (!$record->isRestorable()) {
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
         $record->save();
1235 1235
         $this->addMessage($deletedMessage);
1236 1236
 
1237
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1237
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1238 1238
 
1239 1239
         return true;
1240 1240
     }
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
         $record = null;
1257 1257
         foreach ($records as $record) {
1258 1258
         }
1259
-        if (! isset($record)) {
1259
+        if (!isset($record)) {
1260 1260
             throw new app_AccessException('Sorry, You are not allowed to perform this operation');
1261 1261
         }
1262 1262
 
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
 
1270 1270
         $recordTitle = $record->getRecordTitle();
1271 1271
 
1272
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1272
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1273 1273
         $form->addItem($W->Title($subTitle, 5));
1274 1274
 
1275 1275
         $confirmedAction = $this->proxy()->restore($id);
@@ -1385,14 +1385,14 @@  discard block
 block discarded – undo
1385 1385
         $registry = bab_getRegistryInstance();
1386 1386
 
1387 1387
         $userId = '0';
1388
-        $registry->changeDirectory('/widgets/user/' . $userId . '/' . $id. '/filters');
1388
+        $registry->changeDirectory('/widgets/user/'.$userId.'/'.$id.'/filters');
1389 1389
 
1390 1390
         while ($filterName = $registry->fetchChildKey()) {
1391 1391
             $filters[] = $filterName;
1392 1392
         }
1393 1393
 
1394 1394
         $userId = bab_getUserId();
1395
-        $registry->changeDirectory('/widgets/user/' . $userId . '/' . $id. '/filters');
1395
+        $registry->changeDirectory('/widgets/user/'.$userId.'/'.$id.'/filters');
1396 1396
 
1397 1397
         while ($filterName = $registry->fetchChildKey()) {
1398 1398
             $filters[] = $filterName;
@@ -1413,15 +1413,15 @@  discard block
 block discarded – undo
1413 1413
     {
1414 1414
         $W = bab_Widgets();
1415 1415
         $tableview = $this->modelView(null, 'table');
1416
-        $W->setUserConfiguration($tableview->getId(). '/currentFilterName', $filterName, 'widgets', false);
1416
+        $W->setUserConfiguration($tableview->getId().'/currentFilterName', $filterName, 'widgets', false);
1417 1417
 
1418 1418
         $registry = bab_getRegistryInstance();
1419 1419
         $userId = '0';
1420
-        $registry->changeDirectory('/widgets/user/' . $userId . '/' . $tableview->getId() . '/filters');
1420
+        $registry->changeDirectory('/widgets/user/'.$userId.'/'.$tableview->getId().'/filters');
1421 1421
         $filterValues = $registry->getValue($filterName);
1422 1422
 
1423 1423
         if (!$filterValues) {
1424
-            $filterValues = $W->getUserConfiguration($tableview->getId() . '/filters/' . $filterName, 'widgets', false);
1424
+            $filterValues = $W->getUserConfiguration($tableview->getId().'/filters/'.$filterName, 'widgets', false);
1425 1425
         }
1426 1426
 
1427 1427
         $tableview = $this->modelView($filterValues, 'table');
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
     {
1441 1441
         $W = bab_Widgets();
1442 1442
         $id = $this->getModelViewDefaultId();
1443
-        $filter = $W->getUserConfiguration($id. '/currentFilterName', 'widgets', false);
1443
+        $filter = $W->getUserConfiguration($id.'/currentFilterName', 'widgets', false);
1444 1444
 
1445 1445
         return $filter;
1446 1446
     }
@@ -1454,7 +1454,7 @@  discard block
 block discarded – undo
1454 1454
     {
1455 1455
         if (isset($name)) {
1456 1456
             $W = bab_Widgets();
1457
-            $filter = $W->getUserConfiguration($tableview->getId(). '/filters/' . $name, 'widgets', false);
1457
+            $filter = $W->getUserConfiguration($tableview->getId().'/filters/'.$name, 'widgets', false);
1458 1458
             $filterValues = $filter['values'];
1459 1459
         } else {
1460 1460
             $filterValues = null;
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
             'values' => $filterValues,
1486 1486
         );
1487 1487
 
1488
-        $W->setUserConfiguration($tableview->getId(). '/filters/' . $name, $data, 'widgets', false);
1488
+        $W->setUserConfiguration($tableview->getId().'/filters/'.$name, $data, 'widgets', false);
1489 1489
 
1490 1490
         return true;
1491 1491
     }
@@ -1503,7 +1503,7 @@  discard block
 block discarded – undo
1503 1503
         $Ui = $App->Ui();
1504 1504
 
1505 1505
         $currentFilterName = $this->getCurrentFilterName();
1506
-        $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $currentFilterName, 'widgets', false);
1506
+        $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$currentFilterName, 'widgets', false);
1507 1507
 
1508 1508
         $page = $Ui->Page();
1509 1509
 
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
         $App = $this->App();
1557 1557
         $Ui = $App->Ui();
1558 1558
 
1559
-        $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false);
1559
+        $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false);
1560 1560
 
1561 1561
         $page = $Ui->Page();
1562 1562
 
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 
1609 1609
         $filterNames = $this->getFilterNames();
1610 1610
         foreach ($filterNames as $filterName) {
1611
-            $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $filterName, 'widgets', false);
1611
+            $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$filterName, 'widgets', false);
1612 1612
 
1613 1613
             $filterBox = $W->FlowItems()
1614 1614
                 ->setVerticalAlign('top')
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
         $App = $this->App();
1654 1654
         $Ui = $App->Ui();
1655 1655
 
1656
-        $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false);
1656
+        $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false);
1657 1657
 
1658 1658
         $page = $Ui->Page();
1659 1659
 
@@ -1690,7 +1690,7 @@  discard block
 block discarded – undo
1690 1690
         $this->requireDeleteMethod();
1691 1691
 
1692 1692
         $W = bab_Widgets();
1693
-        $W->deleteUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false);
1693
+        $W->deleteUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false);
1694 1694
 
1695 1695
         return true;
1696 1696
     }
Please login to merge, or discard this patch.
programs/traceablerecord.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             return parent::delete($criteria);
244 244
         }
245 245
 
246
-        require_once $GLOBALS['babInstallPath'] . '/utilit/dateTime.php';
246
+        require_once $GLOBALS['babInstallPath'].'/utilit/dateTime.php';
247 247
         $now = BAB_DateTime::now()->getIsoDateTime();
248 248
 
249 249
         $records = $this->select($criteria);
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             return parent::save($record);
280 280
         }
281 281
 
282
-        require_once $GLOBALS['babInstallPath'] . '/utilit/dateTime.php';
282
+        require_once $GLOBALS['babInstallPath'].'/utilit/dateTime.php';
283 283
 
284 284
         $now = BAB_DateTime::now()->getIsoDateTime();
285 285
 
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
      */
310 310
     private function uuid()
311 311
     {
312
-        return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
313
-            mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
314
-            mt_rand( 0, 0x0fff ) | 0x4000,
315
-            mt_rand( 0, 0x3fff ) | 0x8000,
316
-            mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
312
+        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
313
+            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
314
+            mt_rand(0, 0x0fff) | 0x4000,
315
+            mt_rand(0, 0x3fff) | 0x8000,
316
+            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
317 317
     }
318 318
 
319 319
     /**
@@ -384,10 +384,10 @@  discard block
 block discarded – undo
384 384
  */
385 385
 class app_TraceableRecord extends app_Record
386 386
 {
387
-    const DELETED_STATUS_EXISTING = 0;      // Normal status of a record
388
-    const DELETED_STATUS_DELETED = 1;       // Record is deleted by retrievable by admin
389
-    const DELETED_STATUS_IN_TRASH = 2;      // Record is deleted by retrievable by authorized users
390
-    const DELETED_STATUS_DRAFT = 3;         // Status is in draft (not yet created)
387
+    const DELETED_STATUS_EXISTING = 0; // Normal status of a record
388
+    const DELETED_STATUS_DELETED = 1; // Record is deleted by retrievable by admin
389
+    const DELETED_STATUS_IN_TRASH = 2; // Record is deleted by retrievable by authorized users
390
+    const DELETED_STATUS_DRAFT = 3; // Status is in draft (not yet created)
391 391
 
392 392
     public static function getDeletedStatuses()
393 393
     {
Please login to merge, or discard this patch.