Completed
Push — developer ( d7bfd9...1cf1f5 )
by Błażej
520:50 queued 478:32
created
modules/Calendar/actions/DragDropAjax.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -119,6 +119,9 @@
 block discarded – undo
119 119
 	 * Function adds days and minutes to datetime string
120 120
 	 */
121 121
 
122
+	/**
123
+	 * @param string $datetime
124
+	 */
122 125
 	public function changeDateTime($datetime, $daysToAdd, $minutesToAdd)
123 126
 	{
124 127
 		$datetime = strtotime($datetime);
Please login to merge, or discard this patch.
Braces   +11 added lines, -8 removed lines patch added patch discarded remove patch
@@ -51,8 +51,9 @@  discard block
 block discarded – undo
51 51
 			$resultDateTime = $this->changeDateTime($oldDateTime, $dayDelta, $minuteDelta);
52 52
 			$parts = explode(' ', $resultDateTime);
53 53
 			$record->set('due_date', $parts[0]);
54
-			if (activitytype != 'Task')
55
-				$record->set('time_end', $parts[1]);
54
+			if (activitytype != 'Task') {
55
+							$record->set('time_end', $parts[1]);
56
+			}
56 57
 
57 58
 			$startDateTime[] = $record->get('date_start');
58 59
 			$startDateTime[] = $record->get('time_start');
@@ -64,10 +65,11 @@  discard block
 block discarded – undo
64 65
 			$endDateTime = implode(' ', $endDateTime);
65 66
 			$endDateTime = new DateTime($endDateTime);
66 67
 			//Checking if startDateTime is less than or equal to endDateTime
67
-			if ($startDateTime <= $endDateTime)
68
-				$record->save();
69
-			else
70
-				$result['error'] = true;
68
+			if ($startDateTime <= $endDateTime) {
69
+							$record->save();
70
+			} else {
71
+							$result['error'] = true;
72
+			}
71 73
 
72 74
 			$response->setResult($result);
73 75
 			$response->emit();
@@ -107,8 +109,9 @@  discard block
 block discarded – undo
107 109
 			$resultDateTime = $this->changeDateTime($oldEndDateTime, $dayDelta, $minuteDelta);
108 110
 			$parts = explode(' ', $resultDateTime);
109 111
 			$record->set('due_date', $parts[0]);
110
-			if (activitytype != 'Task')
111
-				$record->set('time_end', $parts[1]);
112
+			if (activitytype != 'Task') {
113
+							$record->set('time_end', $parts[1]);
114
+			}
112 115
 			$record->save();
113 116
 
114 117
 			$response->setResult($result);
Please login to merge, or discard this patch.
modules/Calendar/Date.php 2 patches
Doc Comments   +1 added lines, -5 removed lines patch added patch discarded remove patch
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 
385 385
 	/**
386 386
 	 *
387
-	 * @return Date
387
+	 * @return string
388 388
 	 */
389 389
 	public function get_DB_formatted_date()
390 390
 	{
@@ -529,10 +529,6 @@  discard block
 block discarded – undo
529 529
 	 * This should be used whereever possible
530 530
 	 *
531 531
 	 * @param integer       $index - number between 0 to 42
532
-	 * @param string        $day   - date
533
-	 * @param string        $month - month
534
-	 * @param string        $year  - year
535
-	 * return vt_DateTime obj  $datetimevalue
536 532
 	 */
537 533
 	public function getThisMonthsDayByIndex($index)
538 534
 	{
Please login to merge, or discard this patch.
Braces   +37 added lines, -26 removed lines patch added patch discarded remove patch
@@ -87,12 +87,15 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function getTodayDatetimebyIndex($index, $day = '', $month = '', $year = '')
89 89
 	{
90
-		if ($day === '')
91
-			$day = $this->day;
92
-		if ($month === '')
93
-			$month = $this->month;
94
-		if ($year === '')
95
-			$year = $this->year;
90
+		if ($day === '') {
91
+					$day = $this->day;
92
+		}
93
+		if ($month === '') {
94
+					$month = $this->month;
95
+		}
96
+		if ($year === '') {
97
+					$year = $this->year;
98
+		}
96 99
 		$day_array = array();
97 100
 
98 101
 		if ($index < 0 || $index > 23) {
@@ -140,12 +143,15 @@  discard block
 block discarded – undo
140 143
 	 */
141 144
 	public function getThismonthDaysbyIndex($index, $day = '', $month = '', $year = '')
142 145
 	{
143
-		if ($day == '')
144
-			$day = $index + 1;
145
-		if ($month == '')
146
-			$month = $this->month;
147
-		if ($year == '')
148
-			$year = $this->year;
146
+		if ($day == '') {
147
+					$day = $index + 1;
148
+		}
149
+		if ($month == '') {
150
+					$month = $this->month;
151
+		}
152
+		if ($year == '') {
153
+					$year = $this->year;
154
+		}
149 155
 		$month_array = array();
150 156
 		$month_array['day'] = $day;
151 157
 		$month_array['month'] = $month;
@@ -356,8 +362,9 @@  discard block
 block discarded – undo
356 362
 		} else {
357 363
 			throw new \Exception\AppException('year was not set');
358 364
 		}
359
-		if (empty($hour) && $hour !== 0)
360
-			$hour = 0;
365
+		if (empty($hour) && $hour !== 0) {
366
+					$hour = 0;
367
+		}
361 368
 		$this->ts = mktime($hour, $minute, $second, $month, $day, $year);
362 369
 		$this->setDateTime($this->ts);
363 370
 	}
@@ -399,10 +406,12 @@  discard block
 block discarded – undo
399 406
 	{
400 407
 		$hour = $this->z_hour;
401 408
 		$min = $this->minute;
402
-		if (empty($hour))
403
-			$hour = '00';
404
-		if (empty($min))
405
-			$min = '00';
409
+		if (empty($hour)) {
410
+					$hour = '00';
411
+		}
412
+		if (empty($min)) {
413
+					$min = '00';
414
+		}
406 415
 		return $hour . ':' . $min;
407 416
 	}
408 417
 
@@ -413,10 +422,11 @@  discard block
 block discarded – undo
413 422
 	 */
414 423
 	public function get_changed_day($mode)
415 424
 	{
416
-		if ($mode == 'increment')
417
-			$day = $this->day + 1;
418
-		else
419
-			$day = $this->day - 1;
425
+		if ($mode == 'increment') {
426
+					$day = $this->day + 1;
427
+		} else {
428
+					$day = $this->day - 1;
429
+		}
420 430
 		$date_data = array('day' => $day,
421 431
 			'month' => $this->month,
422 432
 			'year' => $this->year
@@ -432,10 +442,11 @@  discard block
 block discarded – undo
432 442
 	public function get_first_day_of_changed_week($mode)
433 443
 	{
434 444
 		$first_day = $this->getThisweekDaysbyIndex(1);
435
-		if ($mode == 'increment')
436
-			$day = $first_day->day + 7;
437
-		else
438
-			$day = $first_day->day - 7;
445
+		if ($mode == 'increment') {
446
+					$day = $first_day->day + 7;
447
+		} else {
448
+					$day = $first_day->day - 7;
449
+		}
439 450
 		$date_data = array('day' => $day,
440 451
 			'month' => $first_day->month,
441 452
 			'year' => $first_day->year
Please login to merge, or discard this patch.
modules/Import/helpers/Utils.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -233,6 +233,9 @@
 block discarded – undo
233 233
 		return false;
234 234
 	}
235 235
 
236
+	/**
237
+	 * @param Vtiger_Request $request
238
+	 */
236 239
 	public static function validateFileUpload($request)
237 240
 	{
238 241
 		$current_user = Users_Record_Model::getCurrentUserModel();
Please login to merge, or discard this patch.
modules/Import/views/Main.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -27,6 +27,9 @@  discard block
 block discarded – undo
27 27
 		$this->user = $user;
28 28
 	}
29 29
 
30
+	/**
31
+	 * @param Vtiger_Request $request
32
+	 */
30 33
 	public static function import($request, $user)
31 34
 	{
32 35
 		$importController = new Import_Main_View($request, $user);
@@ -100,6 +103,9 @@  discard block
 block discarded – undo
100 103
 		}
101 104
 	}
102 105
 
106
+	/**
107
+	 * @param boolean $continueImport
108
+	 */
103 109
 	public static function showCurrentStatus($importInfo, $importStatusCount, $continueImport)
104 110
 	{
105 111
 		$moduleName = $importInfo['module'];
@@ -210,6 +216,9 @@  discard block
 block discarded – undo
210 216
 		Import_Queue_Action::add($this->request, $this->user);
211 217
 	}
212 218
 
219
+	/**
220
+	 * @param Vtiger_Request $request
221
+	 */
213 222
 	public static function deleteMap($request)
214 223
 	{
215 224
 		$moduleName = $request->getModule();
Please login to merge, or discard this patch.
modules/ModComments/ModComments.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 
60 60
 	/**
61 61
 	 * Add widget to other module.
62
-	 * @param unknown_type $moduleNames
62
+	 * @param string[] $moduleNames
63 63
 	 * @return unknown_type
64 64
 	 */
65 65
 	static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,11 +64,13 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
66 66
 	{
67
-		if (empty($moduleNames))
68
-			return;
67
+		if (empty($moduleNames)) {
68
+					return;
69
+		}
69 70
 
70
-		if (is_string($moduleNames))
71
-			$moduleNames = array($moduleNames);
71
+		if (is_string($moduleNames)) {
72
+					$moduleNames = array($moduleNames);
73
+		}
72 74
 
73 75
 		$commentWidgetModules = array();
74 76
 		foreach ($moduleNames as $moduleName) {
@@ -95,11 +97,13 @@  discard block
 block discarded – undo
95 97
 	 */
96 98
 	static function removeWidgetFrom($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
97 99
 	{
98
-		if (empty($moduleNames))
99
-			return;
100
+		if (empty($moduleNames)) {
101
+					return;
102
+		}
100 103
 
101
-		if (is_string($moduleNames))
102
-			$moduleNames = array($moduleNames);
104
+		if (is_string($moduleNames)) {
105
+					$moduleNames = array($moduleNames);
106
+		}
103 107
 
104 108
 		$commentWidgetModules = array();
105 109
 		foreach ($moduleNames as $moduleName) {
Please login to merge, or discard this patch.
modules/OSSEmployees/OSSEmployees.php 2 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -149,6 +149,10 @@  discard block
 block discarded – undo
149 149
 		return $hierarchy;
150 150
 	}
151 151
 
152
+	/**
153
+	 * @param integer $id
154
+	 * @param integer[] $encountered_accounts
155
+	 */
152 156
 	public function __getParentEmployees($id, &$parent_accounts, &$encountered_accounts)
153 157
 	{
154 158
 		$adb = PearDatabase::getInstance();
@@ -200,6 +204,9 @@  discard block
 block discarded – undo
200 204
 		return $parent_accounts;
201 205
 	}
202 206
 
207
+	/**
208
+	 * @param integer $id
209
+	 */
203 210
 	public function __getChildEmployees($id, &$child_accounts, $depth)
204 211
 	{
205 212
 		$adb = PearDatabase::getInstance();
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -257,8 +257,9 @@
 block discarded – undo
257 257
 			$modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
258 258
 			if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
259 259
 				include_once 'modules/ModComments/ModComments.php';
260
-				if (class_exists('ModComments'))
261
-					ModComments::addWidgetTo(array('OSSEmployees'));
260
+				if (class_exists('ModComments')) {
261
+									ModComments::addWidgetTo(array('OSSEmployees'));
262
+				}
262 263
 			}
263 264
 		} else if ($event_type == 'module.disabled') {
264 265
 			
Please login to merge, or discard this patch.
include/Loader.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -124,8 +124,9 @@
 block discarded – undo
124 124
 			$secondFallBackModuleDir = $secondFallBackModuleClassPath = $actualModule;
125 125
 			if ($actualModule != 'Users') {
126 126
 				$baseModule = $moduleHierarchyParts[0];
127
-				if ($baseModule == 'Settings')
128
-					$baseModule = 'Settings:Vtiger';
127
+				if ($baseModule == 'Settings') {
128
+									$baseModule = 'Settings:Vtiger';
129
+				}
129 130
 				$firstFallBackDir = str_replace(':', '.', $baseModule);
130 131
 				$firstFallBackClassPath = str_replace(':', '_', $baseModule);
131 132
 			}
Please login to merge, or discard this patch.
include/utils/EmailTemplate.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 				$moduleTableIndexList = $meta->getEntityTableIndexList();
121 121
 				foreach ($tableList as $index => $tableName) {
122 122
 					if ($tableName != $tableList[0]) {
123
-						$sql .=' INNER JOIN ' . $tableName . ' ON ' . $tableList[0] . '.' .
123
+						$sql .= ' INNER JOIN ' . $tableName . ' ON ' . $tableList[0] . '.' .
124 124
 							$moduleTableIndexList[$tableList[0]] . '=' . $tableName . '.' .
125 125
 							$moduleTableIndexList[$tableName];
126 126
 					}
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 				//If module is Leads and if you are not selected any leads fields then query failure is happening.
129 129
 				//By default we are checking where condition on base table.
130 130
 				if ($module == 'Leads' && !in_array('vtiger_leaddetails', $tableList)) {
131
-					$sql .=' INNER JOIN vtiger_leaddetails ON vtiger_leaddetails.leadid = vtiger_crmentity.crmid';
131
+					$sql .= ' INNER JOIN vtiger_leaddetails ON vtiger_leaddetails.leadid = vtiger_crmentity.crmid';
132 132
 				}
133 133
 
134 134
 				$sql .= ' WHERE';
Please login to merge, or discard this patch.
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -209,8 +209,9 @@  discard block
 block discarded – undo
209 209
 						$needle = '$' . strtolower($this->module) . '-' . $parentFieldColumnMapping[$params['field']] . ':' . $column . '$';
210 210
 						$this->processedDescription = str_replace($needle, $values[array_search($column, $fieldColumnMapping)], $this->processedDescription);
211 211
 					}
212
-					if (!$params['owner'])
213
-						$this->processedmodules[$module] = true;
212
+					if (!$params['owner']) {
213
+											$this->processedmodules[$module] = true;
214
+					}
214 215
 				}
215 216
 			}
216 217
 		}
@@ -253,7 +254,8 @@  discard block
 block discarded – undo
253 254
 		$rows = $adb->num_rows($res);
254 255
 		if ($rows > 0) {
255 256
 			return true;
256
-		} else
257
-			return false;
257
+		} else {
258
+					return false;
259
+		}
258 260
 	}
259 261
 }
Please login to merge, or discard this patch.
include/utils/ConfigReader.php 2 patches
Braces   +6 added lines, -4 removed lines patch added patch discarded remove patch
@@ -37,8 +37,9 @@  discard block
 block discarded – undo
37 37
 
38 38
 	public function setConfig($key, $value)
39 39
 	{
40
-		if (empty($key))
41
-			return;
40
+		if (empty($key)) {
41
+					return;
42
+		}
42 43
 		$this->properties[$key] = $value;
43 44
 		//not neccessary for php5.x versions
44 45
 		self::$propertiesCache[$this->name] = $this->properties;
@@ -46,8 +47,9 @@  discard block
 block discarded – undo
46 47
 
47 48
 	public function getConfig($key)
48 49
 	{
49
-		if (empty($key))
50
-			return '';
50
+		if (empty($key)) {
51
+					return '';
52
+		}
51 53
 		return $this->properties[$key];
52 54
 	}
53 55
 }
Please login to merge, or discard this patch.
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -15,6 +15,10 @@  discard block
 block discarded – undo
15 15
 	protected $name;
16 16
 	static $propertiesCache = [];
17 17
 
18
+	/**
19
+	 * @param string $path
20
+	 * @param string $name
21
+	 */
18 22
 	public function __construct($path, $name, $force = false)
19 23
 	{
20 24
 		$this->load($path, $name, $force);
@@ -41,6 +45,9 @@  discard block
 block discarded – undo
41 45
 		self::$propertiesCache[$this->name] = $this->properties;
42 46
 	}
43 47
 
48
+	/**
49
+	 * @param string $key
50
+	 */
44 51
 	public function getConfig($key)
45 52
 	{
46 53
 		if (empty($key))
Please login to merge, or discard this patch.