Passed
Push — master ( 8d3a6f...fda82f )
by Laurent
01:57
created
programs/accessmanager.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
     public function hasNoAccess(app_RecordSet $recordSet, $accessType, $user = null)
95 95
     {
96 96
         $criterion = $this->getAccessCriterion($recordSet, $accessType, $user);
97
-        if (! $criterion instanceof ORM_FalseCriterion) {
97
+        if (!$criterion instanceof ORM_FalseCriterion) {
98 98
             return false;
99 99
         }
100 100
         return true;
Please login to merge, or discard this patch.
programs/init.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -24,7 +24,7 @@
 block discarded – undo
24 24
 
25 25
 
26 26
 
27
-require_once dirname(__FILE__). '/functions.php';
27
+require_once dirname(__FILE__).'/functions.php';
28 28
 
29 29
 
30 30
 function LibApp_upgrade($sVersionBase, $sVersionIni)
Please login to merge, or discard this patch.
programs/app.php 1 patch
Spacing   +40 added lines, -40 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
 
@@ -55,14 +55,14 @@  discard block
 block discarded – undo
55 55
         $this->addonName = 'libapp';
56 56
         $this->addonPrefix = 'app';
57 57
 
58
-        $this->classPrefix = $this->addonPrefix . '_';
59
-        $this->controllerTg = 'addon/' . $this->addonName . '/main';
58
+        $this->classPrefix = $this->addonPrefix.'_';
59
+        $this->controllerTg = 'addon/'.$this->addonName.'/main';
60 60
 
61 61
         $addon = bab_getAddonInfosInstance($this->addonName);
62 62
         $this->phpPath = $addon->getPhpPath();
63 63
         $this->recordSetPath = $this->phpPath;
64 64
         $this->ctrlPath = $this->phpPath;
65
-        $this->uiPath = $this->phpPath . 'ui/';
65
+        $this->uiPath = $this->phpPath.'ui/';
66 66
 
67 67
         $babDB = bab_getDB();
68 68
 
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
109 109
     public function getRecordSetPathname($class)
110 110
     {
111 111
         // $App->MyRecordSet() -> myrecord.class.php
112
-        $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php';
113
-        return $this->recordSetPath . $file;
112
+        $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php';
113
+        return $this->recordSetPath.$file;
114 114
     }
115 115
 
116 116
     /**
@@ -122,8 +122,8 @@  discard block
 block discarded – undo
122 122
     public function getRecordPathname($class)
123 123
     {
124 124
         // $App->MyRecord() -> myrecord.class.php
125
-        $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php';
126
-        return $this->recordSetPath . $file;
125
+        $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php';
126
+        return $this->recordSetPath.$file;
127 127
     }
128 128
 
129 129
     /**
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 
225 225
             if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') {
226 226
                 $incl = $method;
227
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
227
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
228 228
 
229 229
 
230 230
                 $classname = $this->$classNameMethod();
@@ -246,7 +246,7 @@  discard block
 block discarded – undo
246 246
                                 // We need to revert to multilang fields before synchronizing.
247 247
                                 $set->useLang(false);
248 248
                             }
249
-                            $sql .= $mysqlbackend->setToSql($set) . "\n";
249
+                            $sql .= $mysqlbackend->setToSql($set)."\n";
250 250
                         }
251 251
                     }
252 252
                 }
@@ -277,7 +277,7 @@  discard block
 block discarded – undo
277 277
 
278 278
             if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') {
279 279
                 $incl = $method;
280
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
280
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
281 281
 
282 282
                 $classname = $this->$classNameMethod();
283 283
 
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
 
292 292
                             if (class_exists($classname) && method_exists($this, $call)) {
293 293
                                 $set = $this->$call();
294
-                                $sql .= $mysqlbackend->setToSql($set) . "\n";
294
+                                $sql .= $mysqlbackend->setToSql($set)."\n";
295 295
                             }
296 296
                         }
297 297
                     }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 
306 306
     public function includeBase()
307 307
     {
308
-        require_once APP_PHP_PATH . 'base.class.php';
308
+        require_once APP_PHP_PATH.'base.class.php';
309 309
     }
310 310
 
311 311
     /**
@@ -313,7 +313,7 @@  discard block
 block discarded – undo
313 313
      */
314 314
     public function includeRecordSet()
315 315
     {
316
-        require_once APP_SET_PATH . 'record.class.php';
316
+        require_once APP_SET_PATH.'record.class.php';
317 317
     }
318 318
 
319 319
 
@@ -322,7 +322,7 @@  discard block
 block discarded – undo
322 322
      */
323 323
     public function includeTraceableRecordSet()
324 324
     {
325
-        require_once APP_SET_PATH . 'traceablerecord.class.php';
325
+        require_once APP_SET_PATH.'traceablerecord.class.php';
326 326
     }
327 327
 
328 328
 
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
     {
335 335
         static $accessManager = null;
336 336
         if (!isset($accessManager)) {
337
-            require_once APP_SET_PATH . 'accessmanager.class.php';
337
+            require_once APP_SET_PATH.'accessmanager.class.php';
338 338
             $accessManager = new app_AccessManager($this);
339 339
         }
340 340
 
@@ -352,7 +352,7 @@  discard block
 block discarded – undo
352 352
      */
353 353
     public function includeLogSet()
354 354
     {
355
-        require_once APP_SET_PATH . 'log.class.php';
355
+        require_once APP_SET_PATH.'log.class.php';
356 356
     }
357 357
 
358 358
     /**
@@ -368,7 +368,7 @@  discard block
 block discarded – undo
368 368
      */
369 369
     public function LogSetClassName()
370 370
     {
371
-        return $this->LogClassName() . 'Set';
371
+        return $this->LogClassName().'Set';
372 372
     }
373 373
 
374 374
     /**
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
      */
391 391
     public function includeLinkSet()
392 392
     {
393
-        require_once APP_SET_PATH . 'link.class.php';
393
+        require_once APP_SET_PATH.'link.class.php';
394 394
     }
395 395
 
396 396
     /**
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
      */
407 407
     public function LinkSetClassName()
408 408
     {
409
-        return $this->LinkClassName() . 'Set';
409
+        return $this->LinkClassName().'Set';
410 410
     }
411 411
 
412 412
     /**
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
      */
430 430
     public function getRecordSetByRef($recordClassname)
431 431
     {
432
-        $classSet = $recordClassname . 'Set';
432
+        $classSet = $recordClassname.'Set';
433 433
         $set = $this->$classSet();
434 434
         return $set;
435 435
     }
@@ -466,7 +466,7 @@  discard block
 block discarded – undo
466 466
     {
467 467
         $fullClassName = get_class($record);
468 468
         list(, $className) = explode('_', $fullClassName);
469
-        return $className . ':' . $record->id;
469
+        return $className.':'.$record->id;
470 470
     }
471 471
 
472 472
 
@@ -557,16 +557,16 @@  discard block
 block discarded – undo
557 557
      */
558 558
     public function mailTo($addr, $subject = null, $body = null)
559 559
     {
560
-        $mailTo = 'mailto:' . $addr;
560
+        $mailTo = 'mailto:'.$addr;
561 561
         $parameters = array();
562 562
         if (isset($subject)) {
563
-            $parameters[] = 'subject=' . $subject;
563
+            $parameters[] = 'subject='.$subject;
564 564
         }
565 565
         if (isset($body)) {
566
-            $parameters[] = 'body=' . $body;
566
+            $parameters[] = 'body='.$body;
567 567
         }
568 568
         if (!empty($parameters)) {
569
-            $mailTo .= '?' . implode('&', $parameters);
569
+            $mailTo .= '?'.implode('&', $parameters);
570 570
         }
571 571
 
572 572
         return $mailTo;
@@ -617,7 +617,7 @@  discard block
 block discarded – undo
617 617
         }
618 618
 
619 619
         $number = number_format($number, $decimals, ',', ' ');
620
-        return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol);
620
+        return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol);
621 621
     }
622 622
 
623 623
 
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
         }
638 638
 
639 639
         if (!isset($format)) {
640
-            $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat());
640
+            $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat());
641 641
         }
642 642
         $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil();
643 643
 
@@ -658,7 +658,7 @@  discard block
 block discarded – undo
658 658
      */
659 659
     public function includeController()
660 660
     {
661
-        require_once APP_PHP_PATH . '/controller.class.php';
661
+        require_once APP_PHP_PATH.'/controller.class.php';
662 662
     }
663 663
 
664 664
 
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
      */
668 668
     public function includeRecordController()
669 669
     {
670
-        require_once APP_CTRL_PATH . '/record.ctrl.php';
670
+        require_once APP_CTRL_PATH.'/record.ctrl.php';
671 671
     }
672 672
 
673 673
 
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
      */
708 708
     public function includeUi()
709 709
     {
710
-        require_once APP_UI_PATH . 'ui.class.php';
710
+        require_once APP_UI_PATH.'ui.class.php';
711 711
     }
712 712
 
713 713
 
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
     public function Ui()
720 720
     {
721 721
         $this->includeUi();
722
-        return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this);
722
+        return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this);
723 723
     }
724 724
 
725 725
     /**
@@ -747,29 +747,29 @@  discard block
 block discarded – undo
747 747
 
748 748
             case substr($name, -strlen('SetClassName')) === 'SetClassName':
749 749
                 $setName = substr($name, 0, strlen($name) - strlen('ClassName'));
750
-                return $this->classPrefix . $setName;
750
+                return $this->classPrefix.$setName;
751 751
 
752 752
             case substr($name, -strlen('ClassName')) === 'ClassName':
753 753
                 $recordName = substr($name, 0, strlen($name) - strlen('ClassName'));
754
-                return $this->classPrefix . $recordName;
754
+                return $this->classPrefix.$recordName;
755 755
 
756 756
             case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set':
757 757
                 $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include')));
758
-                require_once APP_SET_PATH . $fileNameBase . '.class.php';
758
+                require_once APP_SET_PATH.$fileNameBase.'.class.php';
759 759
                 return;
760 760
 
761 761
             case substr($name, -strlen('Set')) === 'Set':
762
-                $includeMethod = 'include' . $name;
762
+                $includeMethod = 'include'.$name;
763 763
                 $this->$includeMethod();
764
-                $setClassNameMethod = $name . 'ClassName';
764
+                $setClassNameMethod = $name.'ClassName';
765 765
                 $className = $this->$setClassNameMethod();
766 766
                 $set = new $className($this);
767 767
                 return $set;
768 768
 
769 769
                 //case method_exists($this, $name . 'Set'):
770 770
             default:
771
-                $setName = $name . 'Set';
772
-                $recordClassNameMethod = $name . 'ClassName';
771
+                $setName = $name.'Set';
772
+                $recordClassNameMethod = $name.'ClassName';
773 773
                 $recordClassName = $this->$recordClassNameMethod();
774 774
                 if (isset($arguments[0])) {
775 775
                     if ($arguments[0] instanceof $recordClassName) {
Please login to merge, or discard this patch.
programs/link.class.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -77,8 +77,8 @@  discard block
 block discarded – undo
77 77
 	 */
78 78
 	public function joinSource($sourceClass)
79 79
 	{
80
-	    if (get_class($this->sourceId) !== $sourceClass . 'Set') {
81
-    	    $this->hasOne('sourceId', $sourceClass . 'Set');
80
+	    if (get_class($this->sourceId) !== $sourceClass.'Set') {
81
+    	    $this->hasOne('sourceId', $sourceClass.'Set');
82 82
     		$this->join('sourceId');
83 83
 	    }
84 84
 	}
@@ -89,8 +89,8 @@  discard block
 block discarded – undo
89 89
 	 */
90 90
 	public function joinTarget($targetClass = null)
91 91
 	{
92
-	    if (get_class($this->targetId) !== $targetClass . 'Set') {
93
-    		$this->hasOne('targetId', $targetClass . 'Set');
92
+	    if (get_class($this->targetId) !== $targetClass.'Set') {
93
+    		$this->hasOne('targetId', $targetClass.'Set');
94 94
     		$this->join('targetId');
95 95
 	    }
96 96
 	}
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
 		}
257 257
 
258 258
 		if ($deleteTarget) {
259
-			foreach($set->select($criteria) as $link) {
259
+			foreach ($set->select($criteria) as $link) {
260 260
 
261 261
 				$className = $link->targetClass.'Set';
262 262
 
Please login to merge, or discard this patch.
programs/ui/base.ui.php 1 patch
Spacing   +18 added lines, -18 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
@@ -674,7 +674,7 @@  discard block
 block discarded – undo
674 674
                 continue;
675 675
             }
676 676
 
677
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
677
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
678 678
 
679 679
             if ($currentColumn + $nbCol > 12) {
680 680
                 $this->addItem($row);
@@ -702,7 +702,7 @@  discard block
 block discarded – undo
702 702
                 $parameters = $displayField['parameters'];
703 703
                 $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
704 704
                 $label = isset($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : '';
705
-                $displayFieldMethod = '_' . $displayFieldName;
705
+                $displayFieldMethod = '_'.$displayFieldName;
706 706
 
707 707
                 if (method_exists($this, $displayFieldMethod)) {
708 708
                     $widget = $this->$displayFieldMethod($customSection, $label);
@@ -760,7 +760,7 @@  discard block
 block discarded – undo
760 760
             $parameters = $displayField['parameters'];
761 761
             $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
762 762
             $label = isset($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : '';
763
-            $displayFieldMethod = '_' . $displayFieldName;
763
+            $displayFieldMethod = '_'.$displayFieldName;
764 764
 
765 765
             if (method_exists($this, $displayFieldMethod)) {
766 766
                 $widget = $this->$displayFieldMethod($customSection, $label);
@@ -1042,7 +1042,7 @@  discard block
 block discarded – undo
1042 1042
         $row = $W->Items()->setSizePolicy('row');
1043 1043
         foreach ($customSections as $customSection) {
1044 1044
 
1045
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
1045
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
1046 1046
 
1047 1047
             if ($currentColumn + $nbCol > 12) {
1048 1048
                 $this->addItem($row);
@@ -1069,7 +1069,7 @@  discard block
 block discarded – undo
1069 1069
                 $parameters = $displayField['parameters'];
1070 1070
                 $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
1071 1071
                 $label = isset($parameters['label']) ? $parameters['label'] : '';
1072
-                $displayFieldMethod = '_' . $displayFieldName;
1072
+                $displayFieldMethod = '_'.$displayFieldName;
1073 1073
 
1074 1074
                 if (method_exists($this, $displayFieldMethod)) {
1075 1075
                     $value = $this->$displayFieldMethod($customSection, $label);
@@ -1161,7 +1161,7 @@  discard block
 block discarded – undo
1161 1161
             // we try to select one according to the classname prefix.
1162 1162
             list($prefix) = explode('_', get_class($this));
1163 1163
             $functionalityName = ucwords($prefix);
1164
-            $this->app = @bab_functionality::get('App/' . $functionalityName);
1164
+            $this->app = @bab_functionality::get('App/'.$functionalityName);
1165 1165
             if (!$this->app) {
1166 1166
                 $this->app = @bab_functionality::get('App');
1167 1167
             }
@@ -1222,7 +1222,7 @@  discard block
 block discarded – undo
1222 1222
         $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber);
1223 1223
 
1224 1224
         if (isset($name)) {
1225
-            $this->sortParameterName = $name . '[filter][sort]';
1225
+            $this->sortParameterName = $name.'[filter][sort]';
1226 1226
         } else {
1227 1227
             $this->sortParameterName = 'filter[sort]';
1228 1228
         }
@@ -1373,11 +1373,11 @@  discard block
 block discarded – undo
1373 1373
 
1374 1374
         foreach ($columns as $fieldName => $column) {
1375 1375
             $field = $column->getField();
1376
-            if (! $column->isSearchable()) {
1376
+            if (!$column->isSearchable()) {
1377 1377
                 continue;
1378 1378
             }
1379 1379
 
1380
-            if (! ($field instanceof ORM_Field)) {
1380
+            if (!($field instanceof ORM_Field)) {
1381 1381
                 $field = null;
1382 1382
             }
1383 1383
 
@@ -1394,7 +1394,7 @@  discard block
 block discarded – undo
1394 1394
 
1395 1395
                 $formItem = $this->handleFilterLabel($label, $input);
1396 1396
                 $formItem->setSizePolicy('col-lg-2 col-md-3 col-sm-6 col-xs-12');
1397
-                $formItem->addClass('field_' . $fieldName);
1397
+                $formItem->addClass('field_'.$fieldName);
1398 1398
 
1399 1399
                 $mainSearch = (method_exists($column, 'isMainSearch') && $column->isMainSearch());
1400 1400
 
@@ -1407,7 +1407,7 @@  discard block
 block discarded – undo
1407 1407
         }
1408 1408
 
1409 1409
 
1410
-        if (! $this->submit) {
1410
+        if (!$this->submit) {
1411 1411
             $this->submit = $W->SubmitButton();
1412 1412
             $this->submit->setLabel(widget_translate('Filter'));
1413 1413
         }
@@ -1480,7 +1480,7 @@  discard block
 block discarded – undo
1480 1480
 //        $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber);
1481 1481
 
1482 1482
         if (isset($name)) {
1483
-            $this->sortParameterName = $name . '[filter][sort]';
1483
+            $this->sortParameterName = $name.'[filter][sort]';
1484 1484
         } else {
1485 1485
             $this->sortParameterName = 'filter[sort]';
1486 1486
         }
@@ -1545,7 +1545,7 @@  discard block
 block discarded – undo
1545 1545
 
1546 1546
     $tableview->setCurrentPage(isset($filterValues['pageNumber']) ? $filterValues['pageNumber'] : 0);
1547 1547
 
1548
-    $tableview->sortParameterName = $name . '[filter][sort]';
1548
+    $tableview->sortParameterName = $name.'[filter][sort]';
1549 1549
 
1550 1550
     if (isset($filterValues['sort'])) {
1551 1551
         $tableview->setSortField($filterValues['sort']);
@@ -1844,7 +1844,7 @@  discard block
 block discarded – undo
1844 1844
                 continue;
1845 1845
             }
1846 1846
 
1847
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
1847
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
1848 1848
 
1849 1849
             if ($currentColumn + $nbCol > 12) {
1850 1850
                 $this->addItem($row);
@@ -1886,7 +1886,7 @@  discard block
 block discarded – undo
1886 1886
                 $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
1887 1887
                 $label = isset($parameters['label']) ? $parameters['label'] : null;
1888 1888
 
1889
-                $displayFieldMethod = '_' . $displayFieldName;
1889
+                $displayFieldMethod = '_'.$displayFieldName;
1890 1890
                 if (method_exists($this, $displayFieldMethod)) {
1891 1891
                     $item = $this->$displayFieldMethod($customSection, $label);
1892 1892
                 } else {
@@ -1916,7 +1916,7 @@  discard block
 block discarded – undo
1916 1916
             }
1917 1917
         }
1918 1918
 
1919
-        if ($currentColumn + $nbCol> 0) {
1919
+        if ($currentColumn + $nbCol > 0) {
1920 1920
             $this->addItem($row);
1921 1921
         }
1922 1922
     }
@@ -2030,7 +2030,7 @@  discard block
 block discarded – undo
2030 2030
 
2031 2031
         $displayable = $field->output($value);
2032 2032
 
2033
-        switch(true) {
2033
+        switch (true) {
2034 2034
             case ($field instanceof ORM_TextField):
2035 2035
                 $displayable = $W->RichText($displayable)->setRenderingOptions(BAB_HTML_ALL ^ BAB_HTML_P);
2036 2036
                 break;
Please login to merge, or discard this patch.
programs/traceablerecord.class.php 1 patch
Spacing   +17 added lines, -17 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
     /**
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
         $linkSet->hasOne('sourceId', get_class($this));
405 405
 
406
-        $criteria =	$linkSet->targetClass->is(get_class($target))
406
+        $criteria = $linkSet->targetClass->is(get_class($target))
407 407
             ->_AND_($linkSet->targetId->is($target->id))
408 408
             ->_AND_($linkSet->sourceClass->is($this->getRecordClassName()));
409 409
         if (isset($linkType)) {
@@ -433,7 +433,7 @@  discard block
 block discarded – undo
433 433
 
434 434
         $linkSet->hasOne('targetId', get_class($this));
435 435
 
436
-        $criteria =	$linkSet->sourceClass->is(get_class($source))
436
+        $criteria = $linkSet->sourceClass->is(get_class($source))
437 437
             ->_AND_($linkSet->sourceId->is($source->id))
438 438
             ->_AND_($linkSet->targetClass->is($this->getRecordClassName()));
439 439
         if (isset($linkType)) {
@@ -477,7 +477,7 @@  discard block
 block discarded – undo
477 477
             $sourcesCriteria[] = $linkSet->sourceClass->is($sourceClass)->_AND_($linkSet->sourceId->in($sourceIds));
478 478
         }
479 479
 
480
-        $criteria =	$linkSet->all(
480
+        $criteria = $linkSet->all(
481 481
             $linkSet->targetClass->is($this->getRecordClassName()),
482 482
             $linkSet->any($sourcesCriteria)
483 483
         );
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
             $targetsCriteria[] = $linkSet->targetClass->is($targetClass)->_AND_($linkSet->targetId->in($targetIds));
523 523
         }
524 524
 
525
-        $criteria =	$linkSet->all(
525
+        $criteria = $linkSet->all(
526 526
             $linkSet->sourceClass->is($this->getRecordClassName()),
527 527
             $linkSet->any($targetsCriteria)
528 528
         );
@@ -575,10 +575,10 @@  discard block
 block discarded – undo
575 575
  */
576 576
 class app_TraceableRecord extends app_Record
577 577
 {
578
-    const DELETED_STATUS_EXISTING = 0;      // Normal status of a record
579
-    const DELETED_STATUS_DELETED = 1;       // Record is deleted by retrievable by admin
580
-    const DELETED_STATUS_IN_TRASH = 2;      // Record is deleted by retrievable by authorized users
581
-    const DELETED_STATUS_DRAFT = 3;         // Status is in draft (not yet created)
578
+    const DELETED_STATUS_EXISTING = 0; // Normal status of a record
579
+    const DELETED_STATUS_DELETED = 1; // Record is deleted by retrievable by admin
580
+    const DELETED_STATUS_IN_TRASH = 2; // Record is deleted by retrievable by authorized users
581
+    const DELETED_STATUS_DRAFT = 3; // Status is in draft (not yet created)
582 582
 
583 583
     public static function getDeletedStatuses()
584 584
     {
@@ -611,7 +611,7 @@  discard block
 block discarded – undo
611 611
     {
612 612
         $linkSet = $this->App()->LinkSet();
613 613
 
614
-        $criteria =	$linkSet->sourceClass->is(get_class($source))
614
+        $criteria = $linkSet->sourceClass->is(get_class($source))
615 615
             ->_AND_($linkSet->sourceId->is($source->id))
616 616
             ->_AND_($linkSet->targetClass->is(get_class($this)))
617 617
             ->_AND_($linkSet->targetId->is($this->id));
@@ -641,7 +641,7 @@  discard block
 block discarded – undo
641 641
     {
642 642
         $linkSet = $this->App()->LinkSet();
643 643
 
644
-        $criteria =	$linkSet->targetClass->is(get_class($target))
644
+        $criteria = $linkSet->targetClass->is(get_class($target))
645 645
             ->_AND_($linkSet->targetId->is($target->id))
646 646
             ->_AND_($linkSet->sourceClass->is(get_class($this)))
647 647
             ->_AND_($linkSet->sourceId->is($this->id));
Please login to merge, or discard this patch.
programs/record.ctrl.php 1 patch
Spacing   +40 added lines, -40 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;
@@ -104,9 +104,9 @@  discard block
 block discarded – undo
104 104
             if ($showLabel) {
105 105
                 $text = $actions->getTitle();
106 106
             }
107
-            $html = '<li><a class="icon ' . $actions->getIcon() .  '" href="' . $actions->url() . '">' . $text . '</a></li>';
107
+            $html = '<li><a class="icon '.$actions->getIcon().'" href="'.$actions->url().'">'.$text.'</a></li>';
108 108
         } elseif ($actions instanceof Widget_Link) {
109
-            $html = '<li>' . $actions->display($canvas) . '</li>';
109
+            $html = '<li>'.$actions->display($canvas).'</li>';
110 110
         } elseif (is_array($actions)) {
111 111
             if (isset($actions['items'])) {
112 112
                 $items = $actions['items'];
@@ -119,10 +119,10 @@  discard block
 block discarded – undo
119 119
             if (isset($actions['icon'])) {
120 120
 
121 121
                 $html = '<li class="dropdown">'
122
-                    . '<a href="#" class="' . $actions['icon'] . ' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'
122
+                    . '<a href="#" class="'.$actions['icon'].' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'
123 123
                     . ($actions['icon'] === 'actions-context-menu'/*Func_Icons::ACTIONS_CONTEXT_MENU*/ ? '' : '<span class="caret"></span>')
124 124
                     . '</a>'
125
-                    . '<ul class="dropdown-menu dropdown-menu-right ' . Func_Icons::ICON_LEFT_SYMBOLIC . '">'
125
+                    . '<ul class="dropdown-menu dropdown-menu-right '.Func_Icons::ICON_LEFT_SYMBOLIC.'">'
126 126
                     . $html
127 127
                     . '</ul>';
128 128
             }
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 
146 146
         $recordClassname = $this->getRecordClassName();
147 147
 
148
-        $viewClassname =  $recordClassname . 'TableView';
148
+        $viewClassname = $recordClassname.'TableView';
149 149
         if (method_exists($Ui, $viewClassname)) {
150 150
             $types['table'] = array(
151 151
                 'classname' => $viewClassname,
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
             );
155 155
         }
156 156
 
157
-        $viewClassname =  $recordClassname . 'CardsView';
157
+        $viewClassname = $recordClassname.'CardsView';
158 158
         if (method_exists($Ui, $viewClassname)) {
159 159
             $types['cards'] = array(
160 160
                 'classname' => $viewClassname,
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
             );
164 164
         }
165 165
 
166
-        $viewClassname =  $recordClassname . 'MapView';
166
+        $viewClassname = $recordClassname.'MapView';
167 167
         if (method_exists($Ui, $viewClassname)) {
168 168
             $types['map'] = array(
169 169
                 'classname' => $viewClassname,
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
             );
173 173
         }
174 174
 
175
-        $viewClassname =  $recordClassname . 'CalendarView';
175
+        $viewClassname = $recordClassname.'CalendarView';
176 176
         if (method_exists($Ui, $viewClassname)) {
177 177
             $types['calendar'] = array(
178 178
                 'classname' => $viewClassname,
@@ -246,11 +246,11 @@  discard block
 block discarded – undo
246 246
         $recordSet = $this->getEditRecordSet();
247 247
 
248 248
         $recordClassname = $this->getRecordClassName();
249
-        $editorClassname =  $recordClassname . 'SectionEditor';
249
+        $editorClassname = $recordClassname.'SectionEditor';
250 250
         /* @var $editor app_RecordEditor */
251 251
         $editor = $Ui->$editorClassname();
252 252
         if (!isset($itemId)) {
253
-            $itemId = $this->getClass() . '_' . __FUNCTION__;
253
+            $itemId = $this->getClass().'_'.__FUNCTION__;
254 254
         }
255 255
         $editor->setId($itemId);
256 256
         $editor->setHiddenValue('tg', $App->controllerTg);
@@ -293,7 +293,7 @@  discard block
 block discarded – undo
293 293
     public function getModelViewDefaultId($itemId = null)
294 294
     {
295 295
         if (!isset($itemId)) {
296
-            $itemId = $this->getClass() . '_modelView';
296
+            $itemId = $this->getClass().'_modelView';
297 297
         }
298 298
 
299 299
         return $itemId;
@@ -327,20 +327,20 @@  discard block
 block discarded – undo
327 327
 
328 328
         switch ($type) {
329 329
             case 'cards':
330
-                $tableviewClassname =  $recordClassname . 'CardsView';
330
+                $tableviewClassname = $recordClassname.'CardsView';
331 331
                 break;
332 332
 
333 333
             case 'map':
334
-                $tableviewClassname =  $recordClassname . 'MapView';
334
+                $tableviewClassname = $recordClassname.'MapView';
335 335
                 break;
336 336
 
337 337
             case 'calendar':
338
-                $tableviewClassname =  $recordClassname . 'CalendarView';
338
+                $tableviewClassname = $recordClassname.'CalendarView';
339 339
                 break;
340 340
 
341 341
             case 'table':
342 342
             default:
343
-                $tableviewClassname =  $recordClassname . 'TableView';
343
+                $tableviewClassname = $recordClassname.'TableView';
344 344
                 break;
345 345
         }
346 346
 
@@ -406,10 +406,10 @@  discard block
 block discarded – undo
406 406
         $Ui = $App->Ui();
407 407
 
408 408
         $recordClassname = $this->getRecordClassName();
409
-        $editorClassname =  $recordClassname . 'Editor';
409
+        $editorClassname = $recordClassname.'Editor';
410 410
         $editor = $Ui->$editorClassname();
411 411
         if (!isset($itemId)) {
412
-            $itemId = $this->getClass() . '_' . __FUNCTION__;
412
+            $itemId = $this->getClass().'_'.__FUNCTION__;
413 413
         }
414 414
         $editor->setId($itemId);
415 415
         $editor->setHiddenValue('tg', $App->controllerTg);
@@ -454,7 +454,7 @@  discard block
 block discarded – undo
454 454
                     $W->Link(
455 455
                         '',
456 456
                         $proxy->setFilteredViewType($tableView->getId(), $viewTypeId)
457
-                    )->addClass('icon', $viewType['icon'] . ($filteredViewType=== $viewTypeId ? ' active' : ''))
457
+                    )->addClass('icon', $viewType['icon'].($filteredViewType === $viewTypeId ? ' active' : ''))
458 458
 //                    ->setSizePolicy('btn btn-xs btn-default ' . ($filteredViewType === $viewTypeId ? 'active' : ''))
459 459
                     ->setTitle($viewType['label'])
460 460
                     ->setAjaxAction()
@@ -498,7 +498,7 @@  discard block
 block discarded – undo
498 498
 
499 499
         $filterVisibility = $this->getFilterVisibility($itemId);
500 500
         $filterVisibility = !$filterVisibility;
501
-        $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility);
501
+        $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility);
502 502
 
503 503
         return true;
504 504
     }
@@ -511,10 +511,10 @@  discard block
 block discarded – undo
511 511
     protected function getFilterVisibility($itemId)
512 512
     {
513 513
         $W = bab_Widgets();
514
-        $filterVisibility = $W->getUserConfiguration($itemId . '/filterVisibility');
514
+        $filterVisibility = $W->getUserConfiguration($itemId.'/filterVisibility');
515 515
         if (!isset($filterVisibility)) {
516 516
             $filterVisibility = false;
517
-            $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility);
517
+            $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility);
518 518
         }
519 519
         return $filterVisibility;
520 520
     }
@@ -528,7 +528,7 @@  discard block
 block discarded – undo
528 528
     protected function getFilteredViewType($itemId)
529 529
     {
530 530
         $W = bab_Widgets();
531
-        $type = $W->getUserConfiguration($itemId . '/viewType');
531
+        $type = $W->getUserConfiguration($itemId.'/viewType');
532 532
         if (!isset($type)) {
533 533
             $type = 'table';
534 534
         }
@@ -544,7 +544,7 @@  discard block
 block discarded – undo
544 544
     public function setFilteredViewType($itemId, $type = null)
545 545
     {
546 546
         $W = bab_Widgets();
547
-        $W->setUserConfiguration($itemId . '/viewType', $type);
547
+        $W->setUserConfiguration($itemId.'/viewType', $type);
548 548
 
549 549
         return true;
550 550
     }
@@ -686,17 +686,17 @@  discard block
 block discarded – undo
686 686
 
687 687
         switch ($format) {
688 688
             case 'xlsx':
689
-                $tableview->downloadXlsx($filename . '.xlsx');
689
+                $tableview->downloadXlsx($filename.'.xlsx');
690 690
                 break;
691 691
             case 'xls':
692
-                $tableview->downloadExcel($filename . '.xls');
692
+                $tableview->downloadExcel($filename.'.xls');
693 693
                 break;
694 694
             case 'ssv':
695
-                $tableview->downloadCsv($filename . '.csv', ';', $inline, 'Windows-1252');
695
+                $tableview->downloadCsv($filename.'.csv', ';', $inline, 'Windows-1252');
696 696
                 break;
697 697
             case 'csv':
698 698
             default:
699
-                $tableview->downloadCsv($filename . '.csv', ',', $inline, bab_charset::getIso());
699
+                $tableview->downloadCsv($filename.'.csv', ',', $inline, bab_charset::getIso());
700 700
                 break;
701 701
         }
702 702
     }
@@ -725,7 +725,7 @@  discard block
 block discarded – undo
725 725
         $Ui = $App->Ui();
726 726
 
727 727
         $recordClassname = $this->getRecordClassName();
728
-        $fullFrameClassname =  $recordClassname . 'FullFrame';
728
+        $fullFrameClassname = $recordClassname.'FullFrame';
729 729
         $fullFrame = $Ui->$fullFrameClassname($record, $view);
730 730
 
731 731
 
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
 
889 889
         $recordTitle = $record->getRecordTitle();
890 890
 
891
-        $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"');
891
+        $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"');
892 892
         return $message;
893 893
     }
894 894
 
@@ -986,7 +986,7 @@  discard block
 block discarded – undo
986 986
                 $this->addMessage($message);
987 987
             }
988 988
 
989
-            $this->addReloadSelector('.depends-' . $this->getRecordClassName());
989
+            $this->addReloadSelector('.depends-'.$this->getRecordClassName());
990 990
             return true;
991 991
         }
992 992
 
@@ -1018,7 +1018,7 @@  discard block
 block discarded – undo
1018 1018
             $this->addMessage($deletedMessage);
1019 1019
         }
1020 1020
 
1021
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1021
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1022 1022
 
1023 1023
         return true;
1024 1024
     }
@@ -1058,7 +1058,7 @@  discard block
 block discarded – undo
1058 1058
 
1059 1059
         $recordTitle = $record->getRecordTitle();
1060 1060
 
1061
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1061
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1062 1062
         $form->addItem($W->Title($subTitle, 5));
1063 1063
 
1064 1064
         $form->addItem($W->Title($App->translate('Confirm delete?'), 6));
@@ -1117,7 +1117,7 @@  discard block
 block discarded – undo
1117 1117
             }
1118 1118
         }
1119 1119
 
1120
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1120
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1121 1121
 
1122 1122
         return true;
1123 1123
     }
@@ -1146,7 +1146,7 @@  discard block
 block discarded – undo
1146 1146
 
1147 1147
         $recordTitle = $record->getRecordTitle();
1148 1148
 
1149
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1149
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1150 1150
         $form->addItem($W->Title($subTitle, 5));
1151 1151
 
1152 1152
         $form->addItem($W->Title($App->translate('Confirm delete?'), 6));
@@ -1190,7 +1190,7 @@  discard block
 block discarded – undo
1190 1190
         $record = null;
1191 1191
         foreach ($records as $record) {
1192 1192
         }
1193
-        if (! isset($record)) {
1193
+        if (!isset($record)) {
1194 1194
             throw new app_AccessException('Sorry, You are not allowed to perform this operation');
1195 1195
         }
1196 1196
         if (!$record->isRestorable()) {
@@ -1204,7 +1204,7 @@  discard block
 block discarded – undo
1204 1204
         $record->save();
1205 1205
         $this->addMessage($deletedMessage);
1206 1206
 
1207
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1207
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1208 1208
 
1209 1209
         return true;
1210 1210
     }
@@ -1226,7 +1226,7 @@  discard block
 block discarded – undo
1226 1226
         $record = null;
1227 1227
         foreach ($records as $record) {
1228 1228
         }
1229
-        if (! isset($record)) {
1229
+        if (!isset($record)) {
1230 1230
             throw new app_AccessException('Sorry, You are not allowed to perform this operation');
1231 1231
         }
1232 1232
 
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
 
1240 1240
         $recordTitle = $record->getRecordTitle();
1241 1241
 
1242
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1242
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1243 1243
         $form->addItem($W->Title($subTitle, 5));
1244 1244
 
1245 1245
         $confirmedAction = $this->proxy()->restore($id);
Please login to merge, or discard this patch.