Passed
Push — master ( 54b258...593da9 )
by Laurent
01:47
created
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/controller.class.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -21,8 +21,8 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2008 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once $GLOBALS['babInstallPath'] . 'utilit/controller.class.php';
25
-require_once dirname(__FILE__). '/functions.php';
24
+require_once $GLOBALS['babInstallPath'].'utilit/controller.class.php';
25
+require_once dirname(__FILE__).'/functions.php';
26 26
 
27 27
 $App = app_App();
28 28
 $App->includeBase();
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 {
33 33
 	public function __construct($action, $code = 0)
34 34
 	{
35
-		$message = 'Unknown method "' . $action->getController() . '::' . $action->getMethod() . '"';
35
+		$message = 'Unknown method "'.$action->getController().'::'.$action->getMethod().'"';
36 36
 		parent::__construct($message, $code);
37 37
 	}
38 38
 }
@@ -215,11 +215,11 @@  discard block
 block discarded – undo
215 215
         // we try to select one according to the classname prefix.
216 216
         list($prefix) = explode('_', __CLASS__);
217 217
         $functionalityName = ucwords($prefix);
218
-        $App = @bab_functionality::get('App/' . $functionalityName);
218
+        $App = @bab_functionality::get('App/'.$functionalityName);
219 219
 
220 220
         if (!$App)
221 221
         {
222
-            throw new app_Exception('Faild to autodetect functionality App/' . $functionalityName.', the getInstance method is deprecated, use $App->ControllerProxy() instead');
222
+            throw new app_Exception('Faild to autodetect functionality App/'.$functionalityName.', the getInstance method is deprecated, use $App->ControllerProxy() instead');
223 223
         }
224 224
 
225 225
         $controller = $App->ControllerProxy($classname, $proxy);
@@ -238,9 +238,9 @@  discard block
 block discarded – undo
238 238
     static function getProxyInstance(Func_App $App, $classname)
239 239
     {
240 240
         $class = new ReflectionClass($classname);
241
-        $proxyClassname = $class->name . self::PROXY_CLASS_SUFFIX;
241
+        $proxyClassname = $class->name.self::PROXY_CLASS_SUFFIX;
242 242
         if (!class_exists($proxyClassname)) {
243
-            $classStr = 'class ' . $proxyClassname . ' extends ' . $class->name . ' {' . "\n";
243
+            $classStr = 'class '.$proxyClassname.' extends '.$class->name.' {'."\n";
244 244
             $methods = $class->getMethods();
245 245
 
246 246
             $classStr .= '	public function __construct(Func_App $App) {
@@ -253,24 +253,24 @@  discard block
 block discarded – undo
253 253
                 }
254 254
 
255 255
 
256
-                $classStr .= '	public function ' . $method->name . '(';
256
+                $classStr .= '	public function '.$method->name.'(';
257 257
                 $parameters = $method->getParameters();
258 258
                 $parametersStr = array();
259 259
                 foreach ($parameters as $parameter) {
260 260
 
261 261
                     if ($parameter->isDefaultValueAvailable()) {
262
-                        $parametersStr[] = '$' . $parameter->name . ' = ' . var_export($parameter->getDefaultValue(), true);
262
+                        $parametersStr[] = '$'.$parameter->name.' = '.var_export($parameter->getDefaultValue(), true);
263 263
                     } else {
264
-                        $parametersStr[] = '$' . $parameter->name;
264
+                        $parametersStr[] = '$'.$parameter->name;
265 265
                     }
266 266
                 }
267 267
                 $classStr .= implode(', ', $parametersStr);
268
-                $classStr .= ') {' . "\n";
269
-                $classStr .= '		$args = func_get_args();' . "\n";
270
-                $classStr .= '		return $this->getMethodAction(__FUNCTION__, $args);' . "\n";
271
-                $classStr .= '	}' . "\n";
268
+                $classStr .= ') {'."\n";
269
+                $classStr .= '		$args = func_get_args();'."\n";
270
+                $classStr .= '		return $this->getMethodAction(__FUNCTION__, $args);'."\n";
271
+                $classStr .= '	}'."\n";
272 272
             }
273
-            $classStr .= '}' . "\n";
273
+            $classStr .= '}'."\n";
274 274
 
275 275
             // We define the proxy class
276 276
             eval($classStr);
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
         $action->setParameters($actionParams);
395 395
 
396 396
 
397
-        list(,,$file) = explode('/', $App->controllerTg);
397
+        list(,, $file) = explode('/', $App->controllerTg);
398 398
 
399 399
         $action->setParameter('addon', $App->getAddonName().'.'.$file);
400 400
         $action->setParameter('idx', $idx);
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
             return false;
419 419
         }
420 420
 
421
-        list($objectName, ) = explode('.', $method);
421
+        list($objectName,) = explode('.', $method);
422 422
 
423 423
         if (!method_exists($this, $objectName)) {
424 424
             header('HTTP/1.0 400 Bad Request');
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         }
427 427
 
428 428
         $objectController = $this->{$objectName}(false);
429
-        if ( ! ($objectController instanceof app_Controller)) {
429
+        if (!($objectController instanceof app_Controller)) {
430 430
             return false;
431 431
         }
432 432
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
             } else {
441 441
                 if ($this->isAjaxRequest()) {
442 442
 
443
-                    header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
443
+                    header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
444 444
 
445 445
                     die(
446 446
                         bab_json_encode(
@@ -461,7 +461,7 @@  discard block
 block discarded – undo
461 461
         } catch (app_SaveException $e) {
462 462
 
463 463
             if ($this->isAjaxRequest()) {
464
-                header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
464
+                header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
465 465
                 header('Cache-Control: no-cache, must-revalidate');
466 466
                 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
467 467
                 header('Content-type: application/json');
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
                         if (method_exists($htmlCanvas, 'sendPageTitle')) {
529 529
                             $htmlCanvas->sendPageTitle($pageTitle);
530 530
                         } else {
531
-                            header('X-Cto-PageTitle: ' . $pageTitle);
531
+                            header('X-Cto-PageTitle: '.$pageTitle);
532 532
                         }
533 533
                     }
534 534
                     $html = $returnedValue->display($htmlCanvas);
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
     private function deletedItemPage(Widget_Action $action, app_DeletedRecordException $e)
589 589
     {
590 590
         if ($this->isAjaxRequest()) {
591
-            header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
591
+            header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
592 592
             header('Cache-Control: no-cache, must-revalidate');
593 593
             header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
594 594
             header('Content-type: application/json');
@@ -605,7 +605,7 @@  discard block
 block discarded – undo
605 605
                 );
606 606
 
607 607
         }
608
-        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404);
608
+        header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
609 609
 
610 610
         $App = $this->App();
611 611
         $W = bab_Widgets();
@@ -639,7 +639,7 @@  discard block
 block discarded – undo
639 639
     private function notFoundPage(Widget_Action $action, app_NotFoundException $e)
640 640
     {
641 641
         if ($this->isAjaxRequest()) {
642
-            $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle() . ' (' . $e->getId() . ')');
642
+            $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle().' ('.$e->getId().')');
643 643
             $json = array(
644 644
                 'messages' => array(
645 645
                     array(
@@ -651,7 +651,7 @@  discard block
 block discarded – undo
651 651
             echo bab_json_encode($json);
652 652
             die;
653 653
         }
654
-        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404);
654
+        header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
655 655
         header('Cache-Control: no-cache, must-revalidate');
656 656
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
657 657
 
@@ -671,14 +671,14 @@  discard block
 block discarded – undo
671 671
 
672 672
     private function errorPage(Exception $e)
673 673
     {
674
-        header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal server error', true, 500);
674
+        header($_SERVER['SERVER_PROTOCOL'].' 500 Internal server error', true, 500);
675 675
 
676
-        require_once $GLOBALS['babInstallPath'] . 'utilit/uiutil.php';
676
+        require_once $GLOBALS['babInstallPath'].'utilit/uiutil.php';
677 677
         $popup = new babBodyPopup();
678 678
         $popup->babEcho(
679
-            '<h1>' . $this->App()->translate('There was a problem when trying to perform this operation') . '</h1>'
680
-            . '<h2 class="error">' . $this->App()->translate('Additional debugging information:') . '</h2>'
681
-            . '<p class="error">' . $e->getMessage() . ' ' .  $e->getFile() . ' ' . $e->getLine()  . ' ' . $e->getTraceAsString() . '</p>'
679
+            '<h1>'.$this->App()->translate('There was a problem when trying to perform this operation').'</h1>'
680
+            . '<h2 class="error">'.$this->App()->translate('Additional debugging information:').'</h2>'
681
+            . '<p class="error">'.$e->getMessage().' '.$e->getFile().' '.$e->getLine().' '.$e->getTraceAsString().'</p>'
682 682
             );
683 683
 
684 684
 
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/functions.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
     if (null === $url) {
113 113
         $script = '<script type="text/javascript">';
114 114
         if (isset($message)) {
115
-            $script .= 'alert("' . bab_toHtml($message, BAB_HTML_JS) . '");';
115
+            $script .= 'alert("'.bab_toHtml($message, BAB_HTML_JS).'");';
116 116
         }
117 117
         $script .= 'history.back();';
118 118
         $script .= '</script>';
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
         $url = $url->url();
125 125
     }
126 126
     if (!empty($babBody->msgerror)) {
127
-        $url .=  '&msgerror=' . urlencode($babBody->msgerror);
127
+        $url .= '&msgerror='.urlencode($babBody->msgerror);
128 128
     }
129 129
     if (isset($message)) {
130 130
         $lines = explode("\n", $message);
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
         }
134 134
     }
135 135
 
136
-    header('Location: ' . $url);
136
+    header('Location: '.$url);
137 137
     die;
138 138
 }
139 139
 
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
  */
166 166
 function app_fileUploadError($error)
167 167
 {
168
-    switch($error) {
168
+    switch ($error) {
169 169
         case UPLOAD_ERR_OK:
170 170
             return null;
171 171
 
Please login to merge, or discard this patch.
programs/record.ctrl.php 1 patch
Spacing   +39 added lines, -39 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
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
     {
53 53
         $App = $this->App();
54 54
         $recordClassname = $this->getRecordClassName();
55
-        $recordSetClassname = $recordClassname . 'Set';
55
+        $recordSetClassname = $recordClassname.'Set';
56 56
 
57 57
         $recordSet = $App->$recordSetClassname();
58 58
         return $recordSet;
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
             if ($showLabel) {
104 104
                 $text = $actions->getTitle();
105 105
             }
106
-            $html = '<li><a class="icon ' . $actions->getIcon() .  '"href="' . $actions->url() . '">' . $text . '</a></li>';
106
+            $html = '<li><a class="icon '.$actions->getIcon().'"href="'.$actions->url().'">'.$text.'</a></li>';
107 107
         } elseif (is_array($actions)) {
108 108
             if (isset($actions['items'])) {
109 109
                 $items = $actions['items'];
@@ -116,10 +116,10 @@  discard block
 block discarded – undo
116 116
             if (isset($actions['icon'])) {
117 117
 
118 118
                 $html = '<li class="dropdown">'
119
-                    . '<a href="#" class="' . $actions['icon'] . ' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'
119
+                    . '<a href="#" class="'.$actions['icon'].' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'
120 120
                     . ($actions['icon'] === 'actions-context-menu'/*Func_Icons::ACTIONS_CONTEXT_MENU*/ ? '' : '<span class="caret"></span>')
121 121
                     . '</a>'
122
-                    . '<ul class="dropdown-menu dropdown-menu-right ' . Func_Icons::ICON_LEFT_SYMBOLIC . '">'
122
+                    . '<ul class="dropdown-menu dropdown-menu-right '.Func_Icons::ICON_LEFT_SYMBOLIC.'">'
123 123
                     . $html
124 124
                     . '</ul>';
125 125
             }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 
143 143
         $recordClassname = $this->getRecordClassName();
144 144
 
145
-        $viewClassname =  $recordClassname . 'TableView';
145
+        $viewClassname = $recordClassname.'TableView';
146 146
         if (method_exists($Ui, $viewClassname)) {
147 147
             $types['table'] = array(
148 148
                 'classname' => $viewClassname,
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
             );
152 152
         }
153 153
 
154
-        $viewClassname =  $recordClassname . 'CardsView';
154
+        $viewClassname = $recordClassname.'CardsView';
155 155
         if (method_exists($Ui, $viewClassname)) {
156 156
             $types['cards'] = array(
157 157
                 'classname' => $viewClassname,
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
             );
161 161
         }
162 162
 
163
-        $viewClassname =  $recordClassname . 'MapView';
163
+        $viewClassname = $recordClassname.'MapView';
164 164
         if (method_exists($Ui, $viewClassname)) {
165 165
             $types['map'] = array(
166 166
                 'classname' => $viewClassname,
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
         foreach ($allViewSections as $viewSection) {
233 233
             $fields = $viewSection->getFields();
234 234
             foreach ($fields as $field) {
235
-                $allViewFieldNames[$field['fieldname']] = $viewSection->view . ',' . $viewSection->rank . ',' . $viewSection->id;
235
+                $allViewFieldNames[$field['fieldname']] = $viewSection->view.','.$viewSection->rank.','.$viewSection->id;
236 236
             }
237 237
         }
238 238
 
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         bab_Sort::asort($availableFields, 'description', bab_Sort::CASE_INSENSITIVE);
257 257
 
258 258
         foreach ($availableFields as $field) {
259
-            $fieldName =  $field['name'];
259
+            $fieldName = $field['name'];
260 260
             $fieldDescription = $field['description'];
261 261
 
262 262
             $used = isset($allViewFieldNames[$fieldName]);
@@ -450,7 +450,7 @@  discard block
 block discarded – undo
450 450
         $nbCol = 0;
451 451
         foreach ($customSections as $customSection) {
452 452
 
453
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
453
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
454 454
 
455 455
 //             if ($currentColumn + $nbCol > 12) {
456 456
 //                 $sectionsSection->addItem($row);
@@ -461,8 +461,8 @@  discard block
 block discarded – undo
461 461
             $currentColumn += $nbCol;
462 462
 
463 463
             $sectionSection = $W->Section(
464
-                $customSection->name . ' (' . $customSection->rank . ')',
465
-                $sectionBox = $W->VBoxItems($W->Hidden()->setName('#' . $customSection->id))
464
+                $customSection->name.' ('.$customSection->rank.')',
465
+                $sectionBox = $W->VBoxItems($W->Hidden()->setName('#'.$customSection->id))
466 466
 //                     ->addClass('widget-dockable-content')
467 467
             );
468 468
             $sectionSection->addClass('crm-custom-section');
@@ -507,16 +507,16 @@  discard block
 block discarded – undo
507 507
                 }
508 508
 
509 509
                 $fieldItem = $W->FlowItems(
510
-                    $W->Label($fieldDescription)->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-80pc' ),
510
+                    $W->Label($fieldDescription)->setSizePolicy(Func_Icons::ICON_LEFT_16.' widget-80pc'),
511 511
                     $W->FlowItems(
512
-                        $W->Hidden()->setName($customSection->id . '.' . $fieldId)->setValue($field['name']),
512
+                        $W->Hidden()->setName($customSection->id.'.'.$fieldId)->setValue($field['name']),
513 513
                         $W->Link('', $this->proxy()->editDisplayField($customSection->id, $field['name']))
514 514
                             ->addClass('icon', Func_Icons::ACTIONS_DOCUMENT_EDIT)
515 515
                             ->setOpenMode(Widget_Link::OPEN_DIALOG),
516 516
                         $W->Link('', $this->proxy()->removeDisplayField($customSection->id, $field['name']))
517 517
                             ->addClass('icon', Func_Icons::ACTIONS_LIST_REMOVE)
518 518
                             ->setAjaxAction()
519
-                    )->setSizePolicy(Func_Icons::ICON_LEFT_16 . ' widget-20pc widget-align-right widget-actions' )
519
+                    )->setSizePolicy(Func_Icons::ICON_LEFT_16.' widget-20pc widget-align-right widget-actions')
520 520
                 )->setSizePolicy('widget-list-element  widget-actions-target');
521 521
 
522 522
                 $sectionBox->addItem($fieldItem);
@@ -589,7 +589,7 @@  discard block
 block discarded – undo
589 589
         }
590 590
 
591 591
         header('Content-type: application/json');
592
-        header('Content-Disposition: attachment; filename="' . $objectName . '.' . ($view === '' ? 'default' : $view) . '.json"'."\n");
592
+        header('Content-Disposition: attachment; filename="'.$objectName.'.'.($view === '' ? 'default' : $view).'.json"'."\n");
593 593
 
594 594
         $json = bab_json_encode($sectionsValues);
595 595
         $json = bab_convertStringFromDatabase($json, bab_charset::UTF_8);
@@ -833,11 +833,11 @@  discard block
 block discarded – undo
833 833
         $recordSet = $this->getEditRecordSet();
834 834
 
835 835
         $recordClassname = $this->getRecordClassName();
836
-        $editorClassname =  $recordClassname . 'SectionEditor';
836
+        $editorClassname = $recordClassname.'SectionEditor';
837 837
         /* @var $editor app_RecordEditor */
838 838
         $editor = $Ui->$editorClassname();
839 839
         if (!isset($itemId)) {
840
-            $itemId = $this->getClass() . '.' . __FUNCTION__;
840
+            $itemId = $this->getClass().'.'.__FUNCTION__;
841 841
         }
842 842
         $editor->setId($itemId);
843 843
         $editor->setHiddenValue('tg', $App->controllerTg);
@@ -880,7 +880,7 @@  discard block
 block discarded – undo
880 880
     public function getModelViewDefaultId($itemId = null)
881 881
     {
882 882
         if (!isset($itemId)) {
883
-            $itemId = $this->getClass() . '.modelView';
883
+            $itemId = $this->getClass().'.modelView';
884 884
         }
885 885
 
886 886
         return $itemId;
@@ -914,16 +914,16 @@  discard block
 block discarded – undo
914 914
 
915 915
         switch ($type) {
916 916
             case 'cards':
917
-                $tableviewClassname =  $recordClassname . 'CardsView';
917
+                $tableviewClassname = $recordClassname.'CardsView';
918 918
                 break;
919 919
 
920 920
             case 'map':
921
-                $tableviewClassname =  $recordClassname . 'MapView';
921
+                $tableviewClassname = $recordClassname.'MapView';
922 922
                 break;
923 923
 
924 924
             case 'table':
925 925
             default:
926
-                $tableviewClassname =  $recordClassname . 'TableView';
926
+                $tableviewClassname = $recordClassname.'TableView';
927 927
                 break;
928 928
         }
929 929
 
@@ -989,10 +989,10 @@  discard block
 block discarded – undo
989 989
         $Ui = $App->Ui();
990 990
 
991 991
         $recordClassname = $this->getRecordClassName();
992
-        $editorClassname =  $recordClassname . 'Editor';
992
+        $editorClassname = $recordClassname.'Editor';
993 993
         $editor = $Ui->$editorClassname();
994 994
         if (!isset($itemId)) {
995
-            $itemId = $this->getClass() . '_' . __FUNCTION__;
995
+            $itemId = $this->getClass().'_'.__FUNCTION__;
996 996
         }
997 997
         $editor->setId($itemId);
998 998
         $editor->setHiddenValue('tg', $App->controllerTg);
@@ -1037,7 +1037,7 @@  discard block
 block discarded – undo
1037 1037
                     $W->Link(
1038 1038
                         '',
1039 1039
                         $proxy->setFilteredViewType($tableView->getId(), $viewTypeId)
1040
-                    )->addClass('icon', $viewType['icon'] . ($filteredViewType=== $viewTypeId ? ' active' : ''))
1040
+                    )->addClass('icon', $viewType['icon'].($filteredViewType === $viewTypeId ? ' active' : ''))
1041 1041
 //                    ->setSizePolicy('btn btn-xs btn-default ' . ($filteredViewType === $viewTypeId ? 'active' : ''))
1042 1042
                     ->setTitle($viewType['label'])
1043 1043
                     ->setAjaxAction()
@@ -1081,7 +1081,7 @@  discard block
 block discarded – undo
1081 1081
 
1082 1082
         $filterVisibility = $this->getFilterVisibility($itemId);
1083 1083
         $filterVisibility = !$filterVisibility;
1084
-        $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility);
1084
+        $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility);
1085 1085
 
1086 1086
         return true;
1087 1087
     }
@@ -1094,10 +1094,10 @@  discard block
 block discarded – undo
1094 1094
     protected function getFilterVisibility($itemId)
1095 1095
     {
1096 1096
         $W = bab_Widgets();
1097
-        $filterVisibility = $W->getUserConfiguration($itemId . '/filterVisibility');
1097
+        $filterVisibility = $W->getUserConfiguration($itemId.'/filterVisibility');
1098 1098
         if (!isset($filterVisibility)) {
1099 1099
             $filterVisibility = false;
1100
-            $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility);
1100
+            $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility);
1101 1101
         }
1102 1102
         return $filterVisibility;
1103 1103
     }
@@ -1111,7 +1111,7 @@  discard block
 block discarded – undo
1111 1111
     protected function getFilteredViewType($itemId)
1112 1112
     {
1113 1113
         $W = bab_Widgets();
1114
-        $type = $W->getUserConfiguration($itemId . '/viewType');
1114
+        $type = $W->getUserConfiguration($itemId.'/viewType');
1115 1115
         if (!isset($type)) {
1116 1116
             $type = 'table';
1117 1117
         }
@@ -1127,7 +1127,7 @@  discard block
 block discarded – undo
1127 1127
     public function setFilteredViewType($itemId, $type = null)
1128 1128
     {
1129 1129
         $W = bab_Widgets();
1130
-        $W->setUserConfiguration($itemId . '/viewType', $type);
1130
+        $W->setUserConfiguration($itemId.'/viewType', $type);
1131 1131
 
1132 1132
         return true;
1133 1133
     }
@@ -1272,14 +1272,14 @@  discard block
 block discarded – undo
1272 1272
 
1273 1273
         switch ($format) {
1274 1274
             case 'xlsx':
1275
-                $tableview->downloadXlsx($filename . '.xlsx');
1275
+                $tableview->downloadXlsx($filename.'.xlsx');
1276 1276
             case 'xls':
1277
-                $tableview->downloadExcel($filename . '.xls');
1277
+                $tableview->downloadExcel($filename.'.xls');
1278 1278
             case 'ssv':
1279
-                $tableview->downloadCsv($filename . '.csv', ';', $inline, 'Windows-1252');
1279
+                $tableview->downloadCsv($filename.'.csv', ';', $inline, 'Windows-1252');
1280 1280
             case 'csv':
1281 1281
             default:
1282
-                $tableview->downloadCsv($filename . '.csv', ',', $inline, bab_charset::getIso());
1282
+                $tableview->downloadCsv($filename.'.csv', ',', $inline, bab_charset::getIso());
1283 1283
         }
1284 1284
     }
1285 1285
 
@@ -1307,7 +1307,7 @@  discard block
 block discarded – undo
1307 1307
         $Ui = $App->Ui();
1308 1308
 
1309 1309
         $recordClassname = $this->getRecordClassName();
1310
-        $fullFrameClassname =  $recordClassname . 'FullFrame';
1310
+        $fullFrameClassname = $recordClassname.'FullFrame';
1311 1311
         $fullFrame = $Ui->$fullFrameClassname($record, $view);
1312 1312
 
1313 1313
 
@@ -1470,7 +1470,7 @@  discard block
 block discarded – undo
1470 1470
 
1471 1471
         $recordTitle = $record->getRecordTitle();
1472 1472
 
1473
-        $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"');
1473
+        $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"');
1474 1474
         return $message;
1475 1475
     }
1476 1476
 
@@ -1597,7 +1597,7 @@  discard block
 block discarded – undo
1597 1597
             $this->addMessage($deletedMessage);
1598 1598
         }
1599 1599
 
1600
-        $this->addReloadSelector('.depends-' . strtolower($record->getClassName()));
1600
+        $this->addReloadSelector('.depends-'.strtolower($record->getClassName()));
1601 1601
 
1602 1602
         return true;
1603 1603
     }
@@ -1628,7 +1628,7 @@  discard block
 block discarded – undo
1628 1628
 
1629 1629
         $recordTitle = $record->getRecordTitle();
1630 1630
 
1631
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1631
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1632 1632
         $form->addItem($W->Title($subTitle, 5));
1633 1633
 
1634 1634
         $form->addItem($W->Title($App->translate('Confirm delete?'), 6));
Please login to merge, or discard this patch.
programs/app.php 1 patch
Spacing   +39 added lines, -39 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
 spl_autoload_register(array(app_App(), 'loadObject'));
@@ -53,14 +53,14 @@  discard block
 block discarded – undo
53 53
         $this->addonName = 'libapp';
54 54
         $this->addonPrefix = 'app';
55 55
 
56
-        $this->classPrefix = $this->addonPrefix . '_';
57
-        $this->controllerTg = 'addon/' . $this->addonName . '/main';
56
+        $this->classPrefix = $this->addonPrefix.'_';
57
+        $this->controllerTg = 'addon/'.$this->addonName.'/main';
58 58
 
59 59
         $addon = bab_getAddonInfosInstance($this->addonName);
60 60
         $this->phpPath = $addon->getPhpPath();
61 61
         $this->recordSetPath = $this->phpPath;
62 62
         $this->ctrlPath = $this->phpPath;
63
-        $this->uiPath = $this->phpPath . 'ui/';
63
+        $this->uiPath = $this->phpPath.'ui/';
64 64
 
65 65
         $babDB = bab_getDB();
66 66
 
@@ -107,8 +107,8 @@  discard block
 block discarded – undo
107 107
     public function getRecordSetPathname($class)
108 108
     {
109 109
         // $App->MyRecordSet() -> myrecord.class.php
110
-        $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php';
111
-        return $this->recordSetPath . $file;
110
+        $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php';
111
+        return $this->recordSetPath.$file;
112 112
     }
113 113
 
114 114
     /**
@@ -120,8 +120,8 @@  discard block
 block discarded – undo
120 120
     public function getRecordPathname($class)
121 121
     {
122 122
         // $App->MyRecord() -> myrecord.class.php
123
-        $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php';
124
-        return $this->recordSetPath . $file;
123
+        $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php';
124
+        return $this->recordSetPath.$file;
125 125
     }
126 126
 
127 127
     /**
@@ -225,7 +225,7 @@  discard block
 block discarded – undo
225 225
 
226 226
             if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') {
227 227
                 $incl = $method;
228
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
228
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
229 229
 
230 230
 
231 231
                 $classname = $this->$classNameMethod();
@@ -247,7 +247,7 @@  discard block
 block discarded – undo
247 247
                                 // We need to revert to multilang fields before synchronizing.
248 248
                                 $set->useLang(false);
249 249
                             }
250
-                            $sql .= $mysqlbackend->setToSql($set) . "\n";
250
+                            $sql .= $mysqlbackend->setToSql($set)."\n";
251 251
                         }
252 252
                     }
253 253
                 }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 
279 279
             if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') {
280 280
                 $incl = $method;
281
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
281
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
282 282
 
283 283
                 $classname = $this->$classNameMethod();
284 284
 
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 
293 293
                             if (class_exists($classname) && method_exists($this, $call)) {
294 294
                                 $set = $this->$call();
295
-                                $sql .= $mysqlbackend->setToSql($set) . "\n";
295
+                                $sql .= $mysqlbackend->setToSql($set)."\n";
296 296
                             }
297 297
                         }
298 298
                     }
@@ -306,7 +306,7 @@  discard block
 block discarded – undo
306 306
 
307 307
     public function includeBase()
308 308
     {
309
-        require_once APP_PHP_PATH . 'base.class.php';
309
+        require_once APP_PHP_PATH.'base.class.php';
310 310
     }
311 311
 
312 312
     /**
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      */
315 315
     public function includeRecordSet()
316 316
     {
317
-        require_once APP_SET_PATH . 'record.class.php';
317
+        require_once APP_SET_PATH.'record.class.php';
318 318
     }
319 319
 
320 320
 
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
      */
324 324
     public function includeTraceableRecordSet()
325 325
     {
326
-        require_once APP_SET_PATH . 'traceablerecord.class.php';
326
+        require_once APP_SET_PATH.'traceablerecord.class.php';
327 327
     }
328 328
 
329 329
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
      */
336 336
     public function includeLinkSet()
337 337
     {
338
-        require_once APP_SET_PATH . 'link.class.php';
338
+        require_once APP_SET_PATH.'link.class.php';
339 339
     }
340 340
 
341 341
     /**
@@ -351,7 +351,7 @@  discard block
 block discarded – undo
351 351
      */
352 352
     public function LinkSetClassName()
353 353
     {
354
-        return $this->LinkClassName() . 'Set';
354
+        return $this->LinkClassName().'Set';
355 355
     }
356 356
 
357 357
     /**
@@ -385,7 +385,7 @@  discard block
 block discarded – undo
385 385
             return null;
386 386
         }
387 387
         list($classname, $id) = $refParts;
388
-        $classSet = $classname . 'Set';
388
+        $classSet = $classname.'Set';
389 389
         $set = $this->$classSet();
390 390
         if (isset($set)) {
391 391
             return $set->get($id);
@@ -404,7 +404,7 @@  discard block
 block discarded – undo
404 404
     {
405 405
         $fullClassName = get_class($record);
406 406
         list(, $className) = explode('_', $fullClassName);
407
-        return $className . ':' . $record->id;
407
+        return $className.':'.$record->id;
408 408
     }
409 409
 
410 410
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
      */
432 432
     public function translate($str, $str_plurals = null, $number = null)
433 433
     {
434
-        require_once APP_PHP_PATH . 'functions.php';
434
+        require_once APP_PHP_PATH.'functions.php';
435 435
         $translation = $str;
436 436
         if ($translate = bab_functionality::get('Translate/Gettext')) {
437 437
             /* @var $translate Func_Translate_Gettext */
@@ -482,16 +482,16 @@  discard block
 block discarded – undo
482 482
      */
483 483
     public function mailTo($addr, $subject = null, $body = null)
484 484
     {
485
-        $mailTo = 'mailto:' . $addr;
485
+        $mailTo = 'mailto:'.$addr;
486 486
         $parameters = array();
487 487
         if (isset($subject)) {
488
-            $parameters[] = 'subject=' . $subject;
488
+            $parameters[] = 'subject='.$subject;
489 489
         }
490 490
         if (isset($body)) {
491
-            $parameters[] = 'body=' . $body;
491
+            $parameters[] = 'body='.$body;
492 492
         }
493 493
         if (!empty($parameters)) {
494
-            $mailTo .= '?' . implode('&', $parameters);
494
+            $mailTo .= '?'.implode('&', $parameters);
495 495
         }
496 496
 
497 497
         return $mailTo;
@@ -542,7 +542,7 @@  discard block
 block discarded – undo
542 542
         }
543 543
 
544 544
         $number = number_format($number, $decimals, ',', ' ');
545
-        return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol);
545
+        return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol);
546 546
     }
547 547
 
548 548
 
@@ -562,7 +562,7 @@  discard block
 block discarded – undo
562 562
         }
563 563
 
564 564
         if (!isset($format)) {
565
-            $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat());
565
+            $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat());
566 566
         }
567 567
         $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil();
568 568
 
@@ -583,7 +583,7 @@  discard block
 block discarded – undo
583 583
      */
584 584
     public function includeController()
585 585
     {
586
-        require_once APP_PHP_PATH . '/controller.class.php';
586
+        require_once APP_PHP_PATH.'/controller.class.php';
587 587
     }
588 588
 
589 589
 
@@ -592,7 +592,7 @@  discard block
 block discarded – undo
592 592
      */
593 593
     public function includeRecordController()
594 594
     {
595
-        require_once APP_CTRL_PATH . '/record.ctrl.php';
595
+        require_once APP_CTRL_PATH.'/record.ctrl.php';
596 596
     }
597 597
 
598 598
 
@@ -632,7 +632,7 @@  discard block
 block discarded – undo
632 632
      */
633 633
     public function includeUi()
634 634
     {
635
-        require_once APP_UI_PATH . 'ui.class.php';
635
+        require_once APP_UI_PATH.'ui.class.php';
636 636
     }
637 637
 
638 638
 
@@ -644,14 +644,14 @@  discard block
 block discarded – undo
644 644
     public function Ui()
645 645
     {
646 646
         $this->includeUi();
647
-        return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this);
647
+        return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this);
648 648
     }
649 649
 
650 650
 
651 651
 
652 652
     protected function includeAccess()
653 653
     {
654
-        require_once WORKSPACE_PHP_PATH . '/access.class.php';
654
+        require_once WORKSPACE_PHP_PATH.'/access.class.php';
655 655
     }
656 656
 
657 657
 
@@ -683,29 +683,29 @@  discard block
 block discarded – undo
683 683
 
684 684
             case substr($name, -strlen('SetClassName')) === 'SetClassName':
685 685
                 $setName = substr($name, 0, strlen($name) - strlen('ClassName'));
686
-                return $this->classPrefix . $setName;
686
+                return $this->classPrefix.$setName;
687 687
 
688 688
             case substr($name, -strlen('ClassName')) === 'ClassName':
689 689
                 $recordName = substr($name, 0, strlen($name) - strlen('ClassName'));
690
-                return $this->classPrefix . $recordName;
690
+                return $this->classPrefix.$recordName;
691 691
 
692 692
             case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set':
693 693
                 $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include')));
694
-                require_once PHP_SET_PATH . $fileNameBase . '.class.php';
694
+                require_once PHP_SET_PATH.$fileNameBase.'.class.php';
695 695
                 return;
696 696
 
697 697
             case substr($name, -strlen('Set')) === 'Set':
698
-                $includeMethod = 'include' . $name;
698
+                $includeMethod = 'include'.$name;
699 699
                 $this->$includeMethod();
700
-                $setClassNameMethod = $name . 'ClassName';
700
+                $setClassNameMethod = $name.'ClassName';
701 701
                 $className = $this->$setClassNameMethod();
702 702
                 $set = new $className($this);
703 703
                 return $set;
704 704
 
705 705
                 //case method_exists($this, $name . 'Set'):
706 706
             default:
707
-                $setName = $name . 'Set';
708
-                $recordClassNameMethod = $name . 'ClassName';
707
+                $setName = $name.'Set';
708
+                $recordClassNameMethod = $name.'ClassName';
709 709
                 $recordClassName = $this->$recordClassNameMethod();
710 710
                 if (isset($arguments[0])) {
711 711
                     if ($arguments[0] instanceof $recordClassName) {
Please login to merge, or discard this patch.