Completed
Push — developer ( f9e515...68a04b )
by Błażej
506:11 queued 468:51
created
modules/Reports/Reports.php 3 patches
Doc Comments   +1 added lines patch added patch discarded remove patch
@@ -387,6 +387,7 @@
 block discarded – undo
387 387
 	 *  This function accepts the folderid
388 388
 	 *  This Generates the Reports under each Reports module
389 389
 	 *  This Returns a HTML sring
390
+	 * @param boolean $rpt_fldr_id
390 391
 	 */
391 392
 	public function sgetRptsforFldr($rpt_fldr_id, $paramsList = false)
392 393
 	{
Please login to merge, or discard this patch.
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -188,9 +188,9 @@  discard block
 block discarded – undo
188 188
 			if ($modulerows) {
189 189
 				foreach ($modulerows as $resultrow) {
190 190
 					if ($resultrow['presence'] == '1')
191
-						continue;   // skip disabled modules
191
+						continue; // skip disabled modules
192 192
 					if ($resultrow['isentitytype'] != '1')
193
-						continue;  // skip extension modules
193
+						continue; // skip extension modules
194 194
 					if (in_array($resultrow['name'], $restricted_modules)) { // skip restricted modules
195 195
 						continue;
196 196
 					}
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
 					$details = [];
308 308
 					$details['state'] = $reportfldrow["state"];
309 309
 					$details['id'] = $reportfldrow["folderid"];
310
-					$details['name'] = ($mod_strings[$reportfldrow["foldername"]] == '' ) ? $reportfldrow["foldername"] : $mod_strings[$reportfldrow["foldername"]];
310
+					$details['name'] = ($mod_strings[$reportfldrow["foldername"]] == '') ? $reportfldrow["foldername"] : $mod_strings[$reportfldrow["foldername"]];
311 311
 					$details['description'] = $reportfldrow["description"];
312 312
 					$details['fname'] = popup_decode_html($details['name']);
313 313
 					$details['fdescription'] = popup_decode_html($reportfldrow["description"]);
@@ -320,7 +320,7 @@  discard block
 block discarded – undo
320 320
 				$details = [];
321 321
 				$details['state'] = $reportfldrow["state"];
322 322
 				$details['id'] = $reportfldrow["folderid"];
323
-				$details['name'] = ($mod_strings[$reportfldrow["foldername"]] == '' ) ? $reportfldrow["foldername"] : $mod_strings[$reportfldrow["foldername"]];
323
+				$details['name'] = ($mod_strings[$reportfldrow["foldername"]] == '') ? $reportfldrow["foldername"] : $mod_strings[$reportfldrow["foldername"]];
324 324
 				$details['description'] = $reportfldrow["description"];
325 325
 				$details['fname'] = popup_decode_html($details['name']);
326 326
 				$details['fdescription'] = popup_decode_html($reportfldrow["description"]);
@@ -375,7 +375,7 @@  discard block
 block discarded – undo
375 375
 
376 376
 				if (isPermitted($report["primarymodule"], 'index') == "yes")
377 377
 					$returndata[] = $report_details;
378
-			}while ($report = $adb->fetch_array($result));
378
+			} while ($report = $adb->fetch_array($result));
379 379
 		}
380 380
 		\App\Log::trace("Reports :: ListView->Successfully returned vtiger_report details HTML");
381 381
 		return $returndata;
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 
463 463
 				if (isPermitted($report["primarymodule"], 'index') == "yes")
464 464
 					$returndata [$report["folderid"]][] = $report_details;
465
-			}while ($report = $adb->fetch_array($result));
465
+			} while ($report = $adb->fetch_array($result));
466 466
 		}
467 467
 
468 468
 		if ($rpt_fldr_id !== false) {
@@ -1264,7 +1264,7 @@  discard block
 block discarded – undo
1264 1264
 		}
1265 1265
 
1266 1266
 		$temp_val = explode(",", $adv_filter_value);
1267
-		if (($column_info[4] == 'D' || ($column_info[4] == 'T' && $column_info[1] != 'time_start' && $column_info[1] != 'time_end') || ($column_info[4] == 'DT')) && ($column_info[4] != '' && $adv_filter_value != '' )) {
1267
+		if (($column_info[4] == 'D' || ($column_info[4] == 'T' && $column_info[1] != 'time_start' && $column_info[1] != 'time_end') || ($column_info[4] == 'DT')) && ($column_info[4] != '' && $adv_filter_value != '')) {
1268 1268
 			$val = [];
1269 1269
 			$countTempVal = count($temp_val);
1270 1270
 			for ($x = 0; $x < $countTempVal; $x++) {
Please login to merge, or discard this patch.
Braces   +73 added lines, -50 removed lines patch added patch discarded remove patch
@@ -127,10 +127,11 @@  discard block
 block discarded – undo
127 127
 				$this->reportname = decode_html($cachedInfo["reportname"]);
128 128
 				$this->reportdescription = decode_html($cachedInfo["description"]);
129 129
 				$this->folderid = $cachedInfo["folderid"];
130
-				if ($is_admin === true || in_array($cachedInfo["owner"], $subordinate_users) || $cachedInfo["owner"] == $current_user->id)
131
-					$this->is_editable = 'true';
132
-				else
133
-					$this->is_editable = 'false';
130
+				if ($is_admin === true || in_array($cachedInfo["owner"], $subordinate_users) || $cachedInfo["owner"] == $current_user->id) {
131
+									$this->is_editable = 'true';
132
+				} else {
133
+									$this->is_editable = 'false';
134
+				}
134 135
 			} else {
135 136
 				throw new \Exception\NoPermitted('LBL_PERMISSION_DENIED');
136 137
 			}
@@ -141,8 +142,9 @@  discard block
 block discarded – undo
141 142
 	public function updateModuleList($module)
142 143
 	{
143 144
 		$adb = PearDatabase::getInstance();
144
-		if (!isset($module))
145
-			return;
145
+		if (!isset($module)) {
146
+					return;
147
+		}
146 148
 		require_once('include/utils/utils.php');
147 149
 		$tabid = \App\Module::getModuleId($module);
148 150
 		if ($module == 'Calendar') {
@@ -151,12 +153,14 @@  discard block
 block discarded – undo
151 153
 		$sql = sprintf('SELECT blockid, blocklabel FROM vtiger_blocks WHERE tabid IN (%s)', generateQuestionMarks($tabid));
152 154
 		$res = $adb->pquery($sql, [$tabid]);
153 155
 		$noOfRows = $adb->num_rows($res);
154
-		if ($noOfRows <= 0)
155
-			return;
156
+		if ($noOfRows <= 0) {
157
+					return;
158
+		}
156 159
 		for ($index = 0; $index < $noOfRows; ++$index) {
157 160
 			$blockid = $adb->query_result($res, $index, 'blockid');
158
-			if (in_array($blockid, $this->module_list[$module]))
159
-				continue;
161
+			if (in_array($blockid, $this->module_list[$module])) {
162
+							continue;
163
+			}
160 164
 			$blockid_list[] = $blockid;
161 165
 			$blocklabel = $adb->query_result($res, $index, 'blocklabel');
162 166
 			$this->module_list[$module][$blocklabel] = $blockid;
@@ -187,10 +191,14 @@  discard block
 block discarded – undo
187 191
 
188 192
 			if ($modulerows) {
189 193
 				foreach ($modulerows as $resultrow) {
190
-					if ($resultrow['presence'] == '1')
191
-						continue;   // skip disabled modules
192
-					if ($resultrow['isentitytype'] != '1')
193
-						continue;  // skip extension modules
194
+					if ($resultrow['presence'] == '1') {
195
+											continue;
196
+					}
197
+					// skip disabled modules
198
+					if ($resultrow['isentitytype'] != '1') {
199
+											continue;
200
+					}
201
+					// skip extension modules
194 202
 					if (in_array($resultrow['name'], $restricted_modules)) { // skip restricted modules
195 203
 						continue;
196 204
 					}
@@ -221,10 +229,11 @@  discard block
 block discarded – undo
221 229
 						}
222 230
 
223 231
 						if (!empty($blocklabel)) {
224
-							if ($module == 'Calendar' && $blocklabel == 'LBL_CUSTOM_INFORMATION')
225
-								$this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module);
226
-							else
227
-								$this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module);
232
+							if ($module == 'Calendar' && $blocklabel == 'LBL_CUSTOM_INFORMATION') {
233
+															$this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module);
234
+							} else {
235
+															$this->module_list[$module][$blockid] = \App\Language::translate($blocklabel, $module);
236
+							}
228 237
 							$prev_block_label = $blocklabel;
229 238
 						} else {
230 239
 							$this->module_list[$module][$blockid] = \App\Language::translate($prev_block_label, $module);
@@ -368,13 +377,15 @@  discard block
 block discarded – undo
368 377
 				$report_details ['reportname'] = $report["reportname"];
369 378
 				$report_details ['sharingtype'] = $report["sharingtype"];
370 379
 				$report_details['folderid'] = $report["folderid"];
371
-				if ($is_admin === true)
372
-					$report_details ['editable'] = 'true';
373
-				else
374
-					$report_details['editable'] = 'false';
380
+				if ($is_admin === true) {
381
+									$report_details ['editable'] = 'true';
382
+				} else {
383
+									$report_details['editable'] = 'false';
384
+				}
375 385
 
376
-				if (isPermitted($report["primarymodule"], 'index') == "yes")
377
-					$returndata[] = $report_details;
386
+				if (isPermitted($report["primarymodule"], 'index') == "yes") {
387
+									$returndata[] = $report_details;
388
+				}
378 389
 			}while ($report = $adb->fetch_array($result));
379 390
 		}
380 391
 		\App\Log::trace("Reports :: ListView->Successfully returned vtiger_report details HTML");
@@ -455,13 +466,15 @@  discard block
 block discarded – undo
455 466
 				$report_details['reportname'] = $report["reportname"];
456 467
 				$report_details['reporttype'] = $report["reporttype"];
457 468
 				$report_details['sharingtype'] = $report["sharingtype"];
458
-				if ($is_admin === true || in_array($report["owner"], $subordinate_users) || $report["owner"] == $currentUser->getId())
459
-					$report_details['editable'] = 'true';
460
-				else
461
-					$report_details['editable'] = 'false';
469
+				if ($is_admin === true || in_array($report["owner"], $subordinate_users) || $report["owner"] == $currentUser->getId()) {
470
+									$report_details['editable'] = 'true';
471
+				} else {
472
+									$report_details['editable'] = 'false';
473
+				}
462 474
 
463
-				if (isPermitted($report["primarymodule"], 'index') == "yes")
464
-					$returndata [$report["folderid"]][] = $report_details;
475
+				if (isPermitted($report["primarymodule"], 'index') == "yes") {
476
+									$returndata [$report["folderid"]][] = $report_details;
477
+				}
465 478
 			}while ($report = $adb->fetch_array($result));
466 479
 		}
467 480
 
@@ -594,8 +607,9 @@  discard block
 block discarded – undo
594 607
 		$adb = PearDatabase::getInstance();
595 608
 		$currentUser = Users_Privileges_Model::getCurrentUserPrivilegesModel();
596 609
 
597
-		if (is_string($block))
598
-			$block = explode(",", $block);
610
+		if (is_string($block)) {
611
+					$block = explode(",", $block);
612
+		}
599 613
 		$skipTalbes = array('vtiger_emaildetails', 'vtiger_attachments');
600 614
 
601 615
 		$tabid = \App\Module::getModuleId($module);
@@ -613,10 +627,11 @@  discard block
 block discarded – undo
613 627
 		$sql .= ' and tablename NOT IN (' . generateQuestionMarks($skipTalbes) . ') ';
614 628
 
615 629
 		//fix for Ticket #4016
616
-		if ($module == "Calendar")
617
-			$sql .= " group by vtiger_field.fieldlabel order by sequence";
618
-		else
619
-			$sql .= " group by vtiger_field.fieldid order by sequence";
630
+		if ($module == "Calendar") {
631
+					$sql .= " group by vtiger_field.fieldlabel order by sequence";
632
+		} else {
633
+					$sql .= " group by vtiger_field.fieldid order by sequence";
634
+		}
620 635
 		array_push($params, $skipTalbes);
621 636
 
622 637
 		$result = $adb->pquery($sql, $params);
@@ -663,8 +678,9 @@  discard block
 block discarded – undo
663 678
 				$this->adv_rel_fields[$fieldtypeofdata][] = $adv_rel_field_tod_value;
664 679
 			}
665 680
 			//added to escape attachments fields in Reports as we have multiple attachments
666
-			if ($module == 'HelpDesk' && $fieldname == 'filename')
667
-				continue;
681
+			if ($module == 'HelpDesk' && $fieldname == 'filename') {
682
+							continue;
683
+			}
668 684
 
669 685
 			if (is_string($block) || $group_res_by_block === false) {
670 686
 				$module_columnlist[$optionvalue] = $fieldlabel;
@@ -905,8 +921,9 @@  discard block
 block discarded – undo
905 921
 
906 922
 			$result = $adb->pquery($ssql, array($reportid, $groupId));
907 923
 			$noOfColumns = $adb->num_rows($result);
908
-			if ($noOfColumns <= 0)
909
-				continue;
924
+			if ($noOfColumns <= 0) {
925
+							continue;
926
+			}
910 927
 
911 928
 			while ($relcriteriarow = $adb->fetch_array($result)) {
912 929
 				$columnIndex = $relcriteriarow["columnindex"];
@@ -964,8 +981,9 @@  discard block
 block discarded – undo
964 981
 			$i++;
965 982
 		}
966 983
 		// Clear the condition (and/or) for last group, if any.
967
-		if (!empty($advft_criteria[$i - 1]['condition']))
968
-			$advft_criteria[$i - 1]['condition'] = '';
984
+		if (!empty($advft_criteria[$i - 1]['condition'])) {
985
+					$advft_criteria[$i - 1]['condition'] = '';
986
+		}
969 987
 		$this->advft_criteria = $advft_criteria;
970 988
 		\App\Log::trace("Reports :: Successfully returned getAdvancedFilterList");
971 989
 		return true;
@@ -1214,13 +1232,15 @@  discard block
 block discarded – undo
1214 1232
 	$idelrelcriteriagroupsql = "delete from vtiger_relcriteria_grouping where queryid=?";
1215 1233
 	$idelrelcriteriagroupsqlresult = $adb->pquery($idelrelcriteriagroupsql, array($reportid));
1216 1234
 
1217
-	if (empty($advft_criteria))
1218
-		return;
1235
+	if (empty($advft_criteria)) {
1236
+			return;
1237
+	}
1219 1238
 
1220 1239
 	foreach ($advft_criteria as $column_index => $column_condition) {
1221 1240
 
1222
-		if (empty($column_condition))
1223
-			continue;
1241
+		if (empty($column_condition)) {
1242
+					continue;
1243
+		}
1224 1244
 
1225 1245
 		$adv_filter_column = $column_condition["columnname"];
1226 1246
 		$adv_filter_comparator = $column_condition["comparator"];
@@ -1282,10 +1302,13 @@  discard block
 block discarded – undo
1282 1302
 
1283 1303
 	foreach ($advft_criteria_groups as $group_index => $group_condition_info) {
1284 1304
 
1285
-		if (empty($group_condition_info))
1286
-			continue;
1287
-		if (empty($group_condition_info["conditionexpression"]))
1288
-			continue; // Case when the group doesn't have any column criteria
1305
+		if (empty($group_condition_info)) {
1306
+					continue;
1307
+		}
1308
+		if (empty($group_condition_info["conditionexpression"])) {
1309
+					continue;
1310
+		}
1311
+		// Case when the group doesn't have any column criteria
1289 1312
 
1290 1313
 		$irelcriteriagroupsql = "insert into vtiger_relcriteria_grouping(GROUPID,QUERYID,GROUP_CONDITION,CONDITION_EXPRESSION) values (?,?,?,?)";
1291 1314
 		$irelcriteriagroupresult = $adb->pquery($irelcriteriagroupsql, array($group_index, $reportid, $group_condition_info["groupcondition"], $group_condition_info["conditionexpression"]));
Please login to merge, or discard this patch.
modules/Reports/ScheduledReports.php 2 patches
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -340,6 +340,9 @@
 block discarded – undo
340 340
 		return $rolesAndSubHTML;
341 341
 	}
342 342
 
343
+	/**
344
+	 * @param Users $user
345
+	 */
343 346
 	public static function getScheduledReports($adb, $user)
344 347
 	{
345 348
 
Please login to merge, or discard this patch.
Braces   +15 added lines, -10 removed lines patch added patch discarded remove patch
@@ -258,8 +258,9 @@  discard block
 block discarded – undo
258 258
 	public static function generateRecipientOption($type, $value, $name = '')
259 259
 	{
260 260
 		switch ($type) {
261
-			case 'users' : if (empty($name))
262
-					$name = \App\Fields\Owner::getUserLabel($value);
261
+			case 'users' : if (empty($name)) {
262
+								$name = \App\Fields\Owner::getUserLabel($value);
263
+			}
263 264
 				$optionName = 'User::' . addslashes(decode_html($name));
264 265
 				$optionValue = 'users::' . $value;
265 266
 				break;
@@ -269,13 +270,15 @@  discard block
 block discarded – undo
269 270
 				$optionName = 'Group::' . addslashes(decode_html($name));
270 271
 				$optionValue = 'groups::' . $value;
271 272
 				break;
272
-			case 'roles' : if (empty($name))
273
-					$name = \App\PrivilegeUtil::getRoleName($value);
273
+			case 'roles' : if (empty($name)) {
274
+								$name = \App\PrivilegeUtil::getRoleName($value);
275
+			}
274 276
 				$optionName = 'Roles::' . addslashes(decode_html($name));
275 277
 				$optionValue = 'roles::' . $value;
276 278
 				break;
277
-			case 'rs' : if (empty($name))
278
-					$name = \App\PrivilegeUtil::getRoleName($value);
279
+			case 'rs' : if (empty($name)) {
280
+								$name = \App\PrivilegeUtil::getRoleName($value);
281
+			}
279 282
 				$optionName = 'RoleAndSubordinates::' . addslashes(decode_html($name));
280 283
 				$optionValue = 'rs::' . $value;
281 284
 				break;
@@ -375,10 +378,12 @@  discard block
 block discarded – undo
375 378
 
376 379
 		$currentModule = vglobal('currentModule');
377 380
 		$current_language = vglobal('current_language');
378
-		if (empty($currentModule))
379
-			$currentModule = 'Reports';
380
-		if (empty($current_language))
381
-			vglobal('current_language', 'en_us');
381
+		if (empty($currentModule)) {
382
+					$currentModule = 'Reports';
383
+		}
384
+		if (empty($current_language)) {
385
+					vglobal('current_language', 'en_us');
386
+		}
382 387
 
383 388
 		$scheduledReports = self::getScheduledReports($adb, $adminUser);
384 389
 		foreach ($scheduledReports as $scheduledReport) {
Please login to merge, or discard this patch.
modules/Reservations/actions/Calendar.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -82,6 +82,9 @@
 block discarded – undo
82 82
 		$response->emit();
83 83
 	}
84 84
 
85
+	/**
86
+	 * @param string $datetime
87
+	 */
85 88
 	public function changeDateTime($datetime, $delta)
86 89
 	{
87 90
 		$date = new DateTime($datetime);
Please login to merge, or discard this patch.
modules/Settings/ConfReport/models/Module.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -318,6 +318,9 @@  discard block
 block discarded – undo
318 318
 		return $permissions;
319 319
 	}
320 320
 
321
+	/**
322
+	 * @param string $val
323
+	 */
321 324
 	public static function getFlag($val)
322 325
 	{
323 326
 		if ($val == 'On' || $val == 1 || stripos($val, 'On') !== false) {
@@ -326,6 +329,9 @@  discard block
 block discarded – undo
326 329
 		return 'Off';
327 330
 	}
328 331
 
332
+	/**
333
+	 * @param string $value
334
+	 */
329 335
 	public function error2string($value)
330 336
 	{
331 337
 		$level_names = array(
Please login to merge, or discard this patch.
Braces   +66 added lines, -44 removed lines patch added patch discarded remove patch
@@ -120,56 +120,68 @@  discard block
 block discarded – undo
120 120
 			$directiveValues['suhosin.post.max_value_length'] = array('prefer' => '1500000');
121 121
 		}
122 122
 
123
-		if (ini_get('display_errors') == '1' || stripos(ini_get('display_errors'), 'On') !== false)
124
-			$directiveValues['display_errors']['status'] = true;
123
+		if (ini_get('display_errors') == '1' || stripos(ini_get('display_errors'), 'On') !== false) {
124
+					$directiveValues['display_errors']['status'] = true;
125
+		}
125 126
 		$directiveValues['display_errors']['current'] = self::getFlag(ini_get('display_errors'));
126 127
 
127
-		if (ini_get('file_uploads') != '1' || stripos(ini_get('file_uploads'), 'Off') !== false)
128
-			$directiveValues['file_uploads']['status'] = true;
128
+		if (ini_get('file_uploads') != '1' || stripos(ini_get('file_uploads'), 'Off') !== false) {
129
+					$directiveValues['file_uploads']['status'] = true;
130
+		}
129 131
 		$directiveValues['file_uploads']['current'] = self::getFlag(ini_get('file_uploads'));
130 132
 
131
-		if ((ini_get('output_buffering') <= '4096' && ini_get('output_buffering') != '1') || stripos(ini_get('output_buffering'), 'Off') !== false)
132
-			$directiveValues['output_buffering']['status'] = true;
133
+		if ((ini_get('output_buffering') <= '4096' && ini_get('output_buffering') != '1') || stripos(ini_get('output_buffering'), 'Off') !== false) {
134
+					$directiveValues['output_buffering']['status'] = true;
135
+		}
133 136
 		if (!in_array(ini_get('output_buffering'), ['On', 1, 0, 'Off'])) {
134 137
 			$directiveValues['output_buffering']['current'] = ini_get('output_buffering');
135 138
 		} else {
136 139
 			$directiveValues['output_buffering']['current'] = self::getFlag(ini_get('output_buffering'));
137 140
 		}
138 141
 
139
-		if (ini_get('max_execution_time') != 0 && ini_get('max_execution_time') < 600)
140
-			$directiveValues['max_execution_time']['status'] = true;
142
+		if (ini_get('max_execution_time') != 0 && ini_get('max_execution_time') < 600) {
143
+					$directiveValues['max_execution_time']['status'] = true;
144
+		}
141 145
 		$directiveValues['max_execution_time']['current'] = ini_get('max_execution_time');
142 146
 
143
-		if (ini_get('max_input_time') != 0 && ini_get('max_input_time') < 600)
144
-			$directiveValues['max_input_time']['status'] = true;
147
+		if (ini_get('max_input_time') != 0 && ini_get('max_input_time') < 600) {
148
+					$directiveValues['max_input_time']['status'] = true;
149
+		}
145 150
 		$directiveValues['max_input_time']['current'] = ini_get('max_input_time');
146 151
 
147
-		if (ini_get('default_socket_timeout') != 0 && ini_get('default_socket_timeout') < 600)
148
-			$directiveValues['default_socket_timeout']['status'] = true;
152
+		if (ini_get('default_socket_timeout') != 0 && ini_get('default_socket_timeout') < 600) {
153
+					$directiveValues['default_socket_timeout']['status'] = true;
154
+		}
149 155
 		$directiveValues['default_socket_timeout']['current'] = ini_get('default_socket_timeout');
150 156
 
151
-		if (vtlib\Functions::parseBytes(ini_get('memory_limit')) < 33554432)
152
-			$directiveValues['memory_limit']['status'] = true;
157
+		if (vtlib\Functions::parseBytes(ini_get('memory_limit')) < 33554432) {
158
+					$directiveValues['memory_limit']['status'] = true;
159
+		}
153 160
 		$directiveValues['memory_limit']['current'] = vtlib\Functions::showBytes(ini_get('memory_limit'));
154 161
 
155
-		if (vtlib\Functions::parseBytes(ini_get('post_max_size')) < 10485760)
156
-			$directiveValues['post_max_size']['status'] = true;
162
+		if (vtlib\Functions::parseBytes(ini_get('post_max_size')) < 10485760) {
163
+					$directiveValues['post_max_size']['status'] = true;
164
+		}
157 165
 		$directiveValues['post_max_size']['current'] = vtlib\Functions::showBytes(ini_get('post_max_size'));
158 166
 
159
-		if (vtlib\Functions::parseBytes(ini_get('upload_max_filesize')) < 10485760)
160
-			$directiveValues['upload_max_filesize']['status'] = true;
167
+		if (vtlib\Functions::parseBytes(ini_get('upload_max_filesize')) < 10485760) {
168
+					$directiveValues['upload_max_filesize']['status'] = true;
169
+		}
161 170
 		$directiveValues['upload_max_filesize']['current'] = vtlib\Functions::showBytes(ini_get('upload_max_filesize'));
162 171
 
163
-		if (ini_get('zlib.output_compression') == '1' || stripos(ini_get('zlib.output_compression'), 'On') !== false)
164
-			$directiveValues['zlib.output_compression']['status'] = true;
172
+		if (ini_get('zlib.output_compression') == '1' || stripos(ini_get('zlib.output_compression'), 'On') !== false) {
173
+					$directiveValues['zlib.output_compression']['status'] = true;
174
+		}
165 175
 		$directiveValues['zlib.output_compression']['current'] = self::getFlag((ini_get('zlib.output_compression')));
166 176
 
167
-		if (ini_get('session.auto_start') == '1' || stripos(ini_get('session.auto_start'), 'On') !== false)
168
-			$directiveValues['session.auto_start']['status'] = true;
177
+		if (ini_get('session.auto_start') == '1' || stripos(ini_get('session.auto_start'), 'On') !== false) {
178
+					$directiveValues['session.auto_start']['status'] = true;
179
+		}
169 180
 		$directiveValues['session.auto_start']['current'] = self::getFlag(ini_get('session.auto_start'));
170 181
 
171
-		if (ini_get('session.cookie_httponly') != '1' || stripos(ini_get('session.cookie_httponly'), 'On') !== false)
172
-			$directiveValues['session.cookie_httponly']['status'] = true;
182
+		if (ini_get('session.cookie_httponly') != '1' || stripos(ini_get('session.cookie_httponly'), 'On') !== false) {
183
+					$directiveValues['session.cookie_httponly']['status'] = true;
184
+		}
173 185
 		$directiveValues['session.cookie_httponly']['current'] = self::getFlag(ini_get('session.cookie_httponly'));
174 186
 
175 187
 		/*
@@ -183,24 +195,29 @@  discard block
 block discarded – undo
183 195
 		}
184 196
 		$directiveValues['mbstring.func_overload']['current'] = self::getFlag(ini_get('mbstring.func_overload'));
185 197
 
186
-		if (ini_get('log_errors') == '1' || stripos(ini_get('log_errors'), 'On') !== false)
187
-			$directiveValues['log_errors']['status'] = true;
198
+		if (ini_get('log_errors') == '1' || stripos(ini_get('log_errors'), 'On') !== false) {
199
+					$directiveValues['log_errors']['status'] = true;
200
+		}
188 201
 		$directiveValues['log_errors']['current'] = self::getFlag(ini_get('log_errors'));
189 202
 
190
-		if (ini_get('short_open_tag') != '1' || stripos(ini_get('short_open_tag'), 'Off') !== false)
191
-			$directiveValues['short_open_tag']['status'] = true;
203
+		if (ini_get('short_open_tag') != '1' || stripos(ini_get('short_open_tag'), 'Off') !== false) {
204
+					$directiveValues['short_open_tag']['status'] = true;
205
+		}
192 206
 		$directiveValues['short_open_tag']['current'] = self::getFlag(ini_get('short_open_tag'));
193 207
 
194
-		if (ini_get('session.gc_maxlifetime') < 21600)
195
-			$directiveValues['session.gc_maxlifetime']['status'] = true;
208
+		if (ini_get('session.gc_maxlifetime') < 21600) {
209
+					$directiveValues['session.gc_maxlifetime']['status'] = true;
210
+		}
196 211
 		$directiveValues['session.gc_maxlifetime']['current'] = ini_get('session.gc_maxlifetime');
197 212
 
198
-		if (ini_get('session.gc_divisor') < 500)
199
-			$directiveValues['session.gc_divisor']['status'] = true;
213
+		if (ini_get('session.gc_divisor') < 500) {
214
+					$directiveValues['session.gc_divisor']['status'] = true;
215
+		}
200 216
 		$directiveValues['session.gc_divisor']['current'] = ini_get('session.gc_divisor');
201 217
 
202
-		if (ini_get('session.gc_probability') < 1)
203
-			$directiveValues['session.gc_probability']['status'] = true;
218
+		if (ini_get('session.gc_probability') < 1) {
219
+					$directiveValues['session.gc_probability']['status'] = true;
220
+		}
204 221
 		$directiveValues['session.gc_probability']['current'] = ini_get('session.gc_probability');
205 222
 
206 223
 		if (ini_get('max_input_vars') < 5000) {
@@ -219,8 +236,9 @@  discard block
 block discarded – undo
219 236
 
220 237
 
221 238
 		if (extension_loaded('suhosin')) {
222
-			if (ini_get('suhosin.session.encrypt') == '1' || stripos(ini_get('suhosin.session.encrypt'), 'On') !== false)
223
-				$directiveValues['suhosin.session.encrypt']['status'] = true;
239
+			if (ini_get('suhosin.session.encrypt') == '1' || stripos(ini_get('suhosin.session.encrypt'), 'On') !== false) {
240
+							$directiveValues['suhosin.session.encrypt']['status'] = true;
241
+			}
224 242
 			$directiveValues['suhosin.session.encrypt']['current'] = self::getFlag(ini_get('suhosin.session.encrypt'));
225 243
 
226 244
 			if (ini_get('suhosin.request.max_vars') < 5000) {
@@ -239,8 +257,9 @@  discard block
 block discarded – undo
239 257
 			$directiveValues['suhosin.post.max_value_length']['current'] = ini_get('suhosin.post.max_value_length');
240 258
 		}
241 259
 		if (!$instalMode && App\Db::getInstance()->getDriverName() === 'mysql') {
242
-			if (ini_get('mysql.connect_timeout') != 0 && ini_get('mysql.connect_timeout') < 600)
243
-				$directiveValues['mysql.connect_timeout']['status'] = true;
260
+			if (ini_get('mysql.connect_timeout') != 0 && ini_get('mysql.connect_timeout') < 600) {
261
+							$directiveValues['mysql.connect_timeout']['status'] = true;
262
+			}
244 263
 			$directiveValues['mysql.connect_timeout']['current'] = ini_get('mysql.connect_timeout');
245 264
 
246 265
 			$db = PearDatabase::getInstance();
@@ -277,8 +296,9 @@  discard block
 block discarded – undo
277 296
 		}
278 297
 
279 298
 		$errorReporting = stripos(ini_get('error_reporting'), '_') === false ? self::error2string(ini_get('error_reporting')) : ini_get('error_reporting');
280
-		if (in_array('E_NOTICE', $errorReporting) || in_array('E_DEPRECATED', $errorReporting) || in_array('E_STRICT', $errorReporting))
281
-			$directiveValues['error_reporting']['status'] = true;
299
+		if (in_array('E_NOTICE', $errorReporting) || in_array('E_DEPRECATED', $errorReporting) || in_array('E_STRICT', $errorReporting)) {
300
+					$directiveValues['error_reporting']['status'] = true;
301
+		}
282 302
 		$directiveValues['error_reporting']['current'] = implode(' | ', $errorReporting);
283 303
 
284 304
 		return $directiveValues;
@@ -333,16 +353,18 @@  discard block
 block discarded – undo
333 353
 			E_COMPILE_ERROR => 'E_COMPILE_ERROR', E_COMPILE_WARNING => 'E_COMPILE_WARNING',
334 354
 			E_USER_ERROR => 'E_USER_ERROR', E_USER_WARNING => 'E_USER_WARNING',
335 355
 			E_USER_NOTICE => 'E_USER_NOTICE');
336
-		if (defined('E_STRICT'))
337
-			$level_names[E_STRICT] = 'E_STRICT';
356
+		if (defined('E_STRICT')) {
357
+					$level_names[E_STRICT] = 'E_STRICT';
358
+		}
338 359
 		$levels = array();
339 360
 		if (($value & E_ALL) == E_ALL) {
340 361
 			$levels[] = 'E_ALL';
341 362
 			$value &= ~E_ALL;
342 363
 		}
343
-		foreach ($level_names as $level => $name)
344
-			if (($value & $level) == $level)
364
+		foreach ($level_names as $level => $name) {
365
+					if (($value & $level) == $level)
345 366
 				$levels[] = $name;
367
+		}
346 368
 		return $levels;
347 369
 	}
348 370
 }
Please login to merge, or discard this patch.
modules/Users/CreateUserPrivilegeFile.php 3 patches
Doc Comments   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -938,8 +938,8 @@  discard block
 block discarded – undo
938 938
 
939 939
 /** Gives an array which contains the information for what all roles, groups and user's related module data that is to be shared  for the specified parent module and shared module 
940 940
 
941
- * @param $par_mod -- parent module name:: Type varchar
942
- * @param $share_mod -- shared module name:: Type varchar
941
+ * @param string $par_mod -- parent module name:: Type varchar
942
+ * @param string $share_mod -- shared module name:: Type varchar
943 943
  * @param $userid -- user id:: Type integer
944 944
  * @param $def_org_share -- default organization sharing permission array:: Type array
945 945
  * @param $mod_sharingrule_members -- Sharing Rule Members array:: Type array
@@ -1355,9 +1355,9 @@  discard block
 block discarded – undo
1355 1355
 
1356 1356
 /** Function to populate the read/wirte Sharing permissions data for the specified user into the database 
1357 1357
  * @param $userid -- user id:: Type integer
1358
- * @param $enttype -- can have the value of User or Group:: Type varchar
1358
+ * @param string $enttype -- can have the value of User or Group:: Type varchar
1359 1359
  * @param $module -- module name:: Type varchar
1360
- * @param $pertype -- can have the value of read or write:: Type varchar
1360
+ * @param string $pertype -- can have the value of read or write:: Type varchar
1361 1361
  * @param $var_name_arr - Variable to use instead of including the sharing access again
1362 1362
  */
1363 1363
 function populateSharingPrivileges($enttype, $userid, $module, $pertype, $var_name_arr = false)
@@ -1432,10 +1432,10 @@  discard block
 block discarded – undo
1432 1432
 
1433 1433
 /** Function to populate the read/wirte Sharing permissions related module data for the specified user into the database 
1434 1434
  * @param $userid -- user id:: Type integer
1435
- * @param $enttype -- can have the value of User or Group:: Type varchar
1435
+ * @param string $enttype -- can have the value of User or Group:: Type varchar
1436 1436
  * @param $module -- module name:: Type varchar
1437 1437
  * @param $relmodule -- related module name:: Type varchar
1438
- * @param $pertype -- can have the value of read or write:: Type varchar
1438
+ * @param string $pertype -- can have the value of read or write:: Type varchar
1439 1439
  * @param $var_name_arr - Variable to use instead of including the sharing access again
1440 1440
  */
1441 1441
 function populateRelatedSharingPrivileges($enttype, $userid, $module, $relmodule, $pertype, $var_name_arr = false)
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -592,8 +592,9 @@  discard block
 block discarded – undo
592 592
 			$var_name = $module . '_share_write_permission';
593 593
 		}
594 594
 		// Lookup for the variable if not set through function argument		
595
-		if (!$var_name_arr)
596
-			$var_name_arr = $$var_name;
595
+		if (!$var_name_arr) {
596
+					$var_name_arr = $$var_name;
597
+		}
597 598
 		$user_arr = [];
598 599
 		if (sizeof($var_name_arr['ROLE']) > 0) {
599 600
 			foreach ($var_name_arr['ROLE'] as $roleid => $roleusers) {
@@ -627,8 +628,9 @@  discard block
 block discarded – undo
627 628
 			$var_name = $module . '_share_write_permission';
628 629
 		}
629 630
 		// Lookup for the variable if not set through function argument
630
-		if (!$var_name_arr)
631
-			$var_name_arr = $$var_name;
631
+		if (!$var_name_arr) {
632
+					$var_name_arr = $$var_name;
633
+		}
632 634
 		$grp_arr = [];
633 635
 		if (sizeof($var_name_arr['GROUP']) > 0) {
634 636
 
@@ -671,8 +673,9 @@  discard block
 block discarded – undo
671 673
 			$var_name = $module . '_' . $relmodule . '_share_write_permission';
672 674
 		}
673 675
 		// Lookup for the variable if not set through function argument
674
-		if (!$var_name_arr)
675
-			$var_name_arr = $$var_name;
676
+		if (!$var_name_arr) {
677
+					$var_name_arr = $$var_name;
678
+		}
676 679
 		$user_arr = [];
677 680
 		if (sizeof($var_name_arr['ROLE']) > 0) {
678 681
 			foreach ($var_name_arr['ROLE'] as $roleid => $roleusers) {
@@ -706,8 +709,9 @@  discard block
 block discarded – undo
706 709
 			$var_name = $module . '_' . $relmodule . '_share_write_permission';
707 710
 		}
708 711
 		// Lookup for the variable if not set through function argument
709
-		if (!$var_name_arr)
710
-			$var_name_arr = $$var_name;
712
+		if (!$var_name_arr) {
713
+					$var_name_arr = $$var_name;
714
+		}
711 715
 		$grp_arr = [];
712 716
 		if (sizeof($var_name_arr['GROUP']) > 0) {
713 717
 
Please login to merge, or discard this patch.
Indentation   -10 removed lines patch added patch discarded remove patch
@@ -150,7 +150,6 @@  discard block
 block discarded – undo
150 150
 }
151 151
 
152 152
 /** Gives an array which contains the information for what all roles, groups and user's related module data that is to be shared  for the specified parent module and shared module 
153
-
154 153
  * @param $par_mod -- parent module name:: Type varchar
155 154
  * @param $share_mod -- shared module name:: Type varchar
156 155
  * @param $userid -- user id:: Type integer
@@ -310,7 +309,6 @@  discard block
 block discarded – undo
310 309
 }
311 310
 
312 311
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
313
-
314 312
  * @param $var -- input array:: Type array
315 313
  * @returns $code -- contains the whole array in a single string:: Type array 
316 314
  */
@@ -327,7 +325,6 @@  discard block
 block discarded – undo
327 325
 }
328 326
 
329 327
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
330
-
331 328
  * @param $var -- input array:: Type array
332 329
  * @returns $code -- contains the whole array in a single string:: Type array 
333 330
  */
@@ -352,7 +349,6 @@  discard block
 block discarded – undo
352 349
 }
353 350
 
354 351
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
355
-
356 352
  * @param $var -- input array:: Type array
357 353
  * @returns $code -- contains the whole array in a single string:: Type array 
358 354
  */
@@ -377,7 +373,6 @@  discard block
 block discarded – undo
377 373
 }
378 374
 
379 375
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
380
-
381 376
  * @param $var -- input array:: Type array
382 377
  * @returns $code -- contains the whole array in a single string:: Type array 
383 378
  */
@@ -394,7 +389,6 @@  discard block
 block discarded – undo
394 389
 }
395 390
 
396 391
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
397
-
398 392
  * @param $var -- input array:: Type array
399 393
  * @returns $code -- contains the whole array in a single string:: Type array 
400 394
  */
@@ -411,7 +405,6 @@  discard block
 block discarded – undo
411 405
 }
412 406
 
413 407
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
414
-
415 408
  * @param $var -- input array:: Type array
416 409
  * @returns $code -- contains the whole array in a single string:: Type array 
417 410
  */
@@ -432,7 +425,6 @@  discard block
 block discarded – undo
432 425
 }
433 426
 
434 427
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
435
-
436 428
  * @param $var -- input array:: Type array
437 429
  * @returns $code -- contains the whole array in a single string:: Type array 
438 430
  */
@@ -453,7 +445,6 @@  discard block
 block discarded – undo
453 445
 }
454 446
 
455 447
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
456
-
457 448
  * @param $var -- input array:: Type array
458 449
  * @returns $code -- contains the whole array in a single string:: Type array 
459 450
  */
@@ -474,7 +465,6 @@  discard block
 block discarded – undo
474 465
 }
475 466
 
476 467
 /** Converts the input array  to a single string to facilitate the writing of the input array in a flat file 
477
-
478 468
  * @param $var -- input array:: Type array
479 469
  * @returns $code -- contains the whole array in a single string:: Type array 
480 470
  */
Please login to merge, or discard this patch.
modules/Vtiger/actions/GenerateRecords.php 1 patch
Doc Comments   +3 added lines patch added patch discarded remove patch
@@ -17,6 +17,9 @@
 block discarded – undo
17 17
 		}
18 18
 	}
19 19
 
20
+	/**
21
+	 * @param Vtiger_Record_Model $recordModel
22
+	 */
20 23
 	public function checkMandatoryFields($recordModel)
21 24
 	{
22 25
 		$mandatoryFields = $recordModel->getModule()->getMandatoryFieldModels();
Please login to merge, or discard this patch.
modules/Vtiger/actions/PDF.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -221,7 +221,7 @@
 block discarded – undo
221 221
 	/**
222 222
 	 * Checks if given record has valid pdf template
223 223
 	 * @param Vtiger_Request $request
224
-	 * @return boolean true if valid template exists for this record
224
+	 * @return boolean|null true if valid template exists for this record
225 225
 	 */
226 226
 	public function hasValidTemplate(Vtiger_Request $request)
227 227
 	{
Please login to merge, or discard this patch.
modules/Vtiger/models/ChartFilter.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -113,6 +113,9 @@  discard block
 block discarded – undo
113 113
 		return [];
114 114
 	}
115 115
 
116
+	/**
117
+	 * @param Vtiger_Widget_Model $widgetModel
118
+	 */
116 119
 	public function setWidgetModel($widgetModel)
117 120
 	{
118 121
 		$this->widgetModel = $widgetModel;
@@ -127,6 +130,9 @@  discard block
 block discarded – undo
127 130
 		}
128 131
 	}
129 132
 
133
+	/**
134
+	 * @return string
135
+	 */
130 136
 	public function getType()
131 137
 	{
132 138
 		return $this->extraData['chartType'];
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -110,7 +110,7 @@  discard block
 block discarded – undo
110 110
 					if (!isset($groupData[$displayValue]['count'])) {
111 111
 						$groupData[$displayValue]['count'] = 1;
112 112
 					} else {
113
-						$groupData[$displayValue]['count'] ++;
113
+						$groupData[$displayValue]['count']++;
114 114
 					}
115 115
 					if (!isset($groupData[$displayValue]['link'])) {
116 116
 						$moduleModel = $this->getTargetModuleModel();
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 					if (!isset($count[$sectorId])) {
128 128
 						$count[$sectorId] = 1;
129 129
 					} else {
130
-						$count[$sectorId] ++;
130
+						$count[$sectorId]++;
131 131
 					}
132 132
 				}
133 133
 			}
Please login to merge, or discard this patch.
modules/Vtiger/models/ExportToXml.php 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -122,6 +122,9 @@  discard block
 block discarded – undo
122 122
 		return html_entity_decode($value);
123 123
 	}
124 124
 
125
+	/**
126
+	 * @param string $fileName
127
+	 */
125 128
 	public function outputFile($fileName)
126 129
 	{
127 130
 		header("Content-Disposition:attachment;filename=$fileName.xml");
@@ -133,6 +136,9 @@  discard block
 block discarded – undo
133 136
 		readfile($this->tmpXmlPath);
134 137
 	}
135 138
 
139
+	/**
140
+	 * @param string $fileName
141
+	 */
136 142
 	protected function outputZipFile($fileName)
137 143
 	{
138 144
 
Please login to merge, or discard this patch.