Completed
Push — developer ( 02a7a3...2908cf )
by Błażej
84:08 queued 41:50
created
modules/CustomView/CustomView.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 
551 551
 	/**
552 552
 	 *  Function which will give condition list for date fields
553
-	 * @return array of std filter conditions
553
+	 * @return string[] of std filter conditions
554 554
 	 */
555 555
 	public function getStdFilterConditions()
556 556
 	{
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
 	 * @param $tablename :: type string
992 992
 	 * @param $fieldname :: type string
993 993
 	 * @param $comparator :: type string
994
-	 * @param $value :: type string
994
+	 * @param string $value :: type string
995 995
 	 * @returns  $value as a string in the following format
996 996
 	 * 	  $tablename.$fieldname comparator
997 997
 	 */
Please login to merge, or discard this patch.
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -431,8 +431,6 @@
 block discarded – undo
431 431
 	  Array('BlockLabeln' =>
432 432
 	  Array('$fieldtablename:$fieldcolname:$fieldname:$module_$fieldlabel1:$fieldtypeofdata'=>$fieldlabel,
433 433
 	  Array('$fieldtablename1:$fieldcolname1:$fieldname1:$module_$fieldlabel11:$fieldtypeofdata1'=>$fieldlabel1,
434
-
435
-
436 434
 	 */
437 435
 	public function getModuleColumnsList($module)
438 436
 	{
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -339,31 +339,31 @@  discard block
 block discarded – undo
339 339
 		if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
340 340
 			$tab_ids = explode(",", $tabid);
341 341
 			$sql = 'select * from vtiger_field ';
342
-			$sql.= ' where vtiger_field.tabid in (%s) and vtiger_field.block in (%s) and vtiger_field.presence in (0,2) and';
343
-			$sql.= $display_type;
342
+			$sql .= ' where vtiger_field.tabid in (%s) and vtiger_field.block in (%s) and vtiger_field.presence in (0,2) and';
343
+			$sql .= $display_type;
344 344
 			if ($tabid == 9 || $tabid == 16) {
345
-				$sql.= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')";
345
+				$sql .= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')";
346 346
 			}
347
-			$sql.= " order by sequence";
347
+			$sql .= " order by sequence";
348 348
 			$params = array($tab_ids, $block_ids);
349 349
 		} else {
350 350
 			$tab_ids = explode(",", $tabid);
351 351
 			$profileList = getCurrentUserProfileList();
352 352
 			$sql = 'select * from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid ';
353
-			$sql.= ' where vtiger_field.tabid in (%s) and vtiger_field.block in (%s) and';
354
-			$sql.= $display_type . 'and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)';
353
+			$sql .= ' where vtiger_field.tabid in (%s) and vtiger_field.block in (%s) and';
354
+			$sql .= $display_type . 'and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)';
355 355
 
356 356
 			$params = array($tab_ids, $block_ids);
357 357
 
358 358
 			if (count($profileList) > 0) {
359
-				$sql.= "  and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
359
+				$sql .= "  and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
360 360
 				array_push($params, $profileList);
361 361
 			}
362 362
 			if ($tabid == 9 || $tabid == 16) {
363
-				$sql.= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')";
363
+				$sql .= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')";
364 364
 			}
365 365
 
366
-			$sql.= " group by columnname order by sequence";
366
+			$sql .= " group by columnname order by sequence";
367 367
 		}
368 368
 		if ($tabid == '9,16')
369 369
 			$tabid = "9";
@@ -514,23 +514,23 @@  discard block
 block discarded – undo
514 514
 
515 515
 		if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
516 516
 			$sql = 'select * from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid ';
517
-			$sql.= ' where vtiger_field.tabid=? and vtiger_field.block in (%s)
517
+			$sql .= ' where vtiger_field.tabid=? and vtiger_field.block in (%s)
518 518
                         and vtiger_field.uitype in (5,6,23,70)';
519
-			$sql.= ' and vtiger_field.presence in (0,2) order by vtiger_field.sequence';
519
+			$sql .= ' and vtiger_field.presence in (0,2) order by vtiger_field.sequence';
520 520
 			$params = [$tabid, $blockids];
521 521
 		} else {
522 522
 			$profileList = getCurrentUserProfileList();
523 523
 			$sql = 'select * from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid inner join  vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid ';
524
-			$sql.= ' where vtiger_field.tabid=? and vtiger_field.block in (%s) and vtiger_field.uitype in (5,6,23,70)';
525
-			$sql.= " and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
524
+			$sql .= ' where vtiger_field.tabid=? and vtiger_field.block in (%s) and vtiger_field.uitype in (5,6,23,70)';
525
+			$sql .= " and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
526 526
 			$params = [$tabid, $blockids];
527 527
 
528 528
 			if (count($profileList) > 0) {
529
-				$sql.= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
529
+				$sql .= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
530 530
 				array_push($params, $profileList);
531 531
 			}
532 532
 
533
-			$sql.= " order by vtiger_field.sequence";
533
+			$sql .= " order by vtiger_field.sequence";
534 534
 		}
535 535
 		$sql = sprintf($sql, generateQuestionMarks($block_ids));
536 536
 		$result = $adb->pquery($sql, $params);
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 						inner join vtiger_cvadvfilter on vtiger_cvadvfilter.cvid = vtiger_customview.cvid
643 643
 						left join vtiger_cvadvfilter_grouping on vtiger_cvadvfilter.cvid = vtiger_cvadvfilter_grouping.cvid
644 644
 								and vtiger_cvadvfilter.groupid = vtiger_cvadvfilter_grouping.groupid';
645
-			$ssql.= " where vtiger_customview.cvid = ? && vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
645
+			$ssql .= " where vtiger_customview.cvid = ? && vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
646 646
 
647 647
 			$result = $adb->pquery($ssql, array($cvid, $groupId));
648 648
 			$noOfColumns = $adb->num_rows($result);
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 			$userNameSql = \vtlib\Deprecated::getSqlForNameInDisplayFormat(array('first_name' =>
1034 1034
 					'vtiger_users' . $tableNameSuffix . '.first_name', 'last_name' => 'vtiger_users' . $tableNameSuffix . '.last_name'), 'Users');
1035 1035
 			$temp_value = '( trim(' . $userNameSql . ')' . $this->getAdvComparator($comparator, $value, $datatype);
1036
-			$temp_value.= " ||  vtiger_groups$tableNameSuffix.groupname" . $this->getAdvComparator($comparator, $value, $datatype) . ')';
1036
+			$temp_value .= " ||  vtiger_groups$tableNameSuffix.groupname" . $this->getAdvComparator($comparator, $value, $datatype) . ')';
1037 1037
 			$value = $temp_value; // Hot fix: removed unbalanced closing bracket ")";
1038 1038
 		} elseif ($fieldname == "inventorymanager") {
1039 1039
 			$value = $tablename . "." . $fieldname . $this->getAdvComparator($comparator, getUserId_Ol($value), $datatype);
Please login to merge, or discard this patch.
Braces   +77 added lines, -57 removed lines patch added patch discarded remove patch
@@ -110,8 +110,9 @@  discard block
 block discarded – undo
110 110
 			} else {
111 111
 				$viewid = $viewname;
112 112
 			}
113
-			if ($this->isPermittedCustomView($viewid, $nowAction, $module) != 'yes')
114
-				$viewid = 0;
113
+			if ($this->isPermittedCustomView($viewid, $nowAction, $module) != 'yes') {
114
+							$viewid = 0;
115
+			}
115 116
 		}
116 117
 		ListViewSession::setCurrentView($module, $viewid);
117 118
 		$log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__ . ' method ...');
@@ -248,8 +249,9 @@  discard block
 block discarded – undo
248 249
 		$shtml_others = '';
249 250
 
250 251
 		$selected = 'selected';
251
-		if ($markselected === false)
252
-			$selected = '';
252
+		if ($markselected === false) {
253
+					$selected = '';
254
+		}
253 255
 
254 256
 		$ssql = "select vtiger_customview.*, vtiger_users.first_name,vtiger_users.last_name from vtiger_customview inner join vtiger_tab on vtiger_tab.name = vtiger_customview.entitytype
255 257
 					left join vtiger_users on vtiger_customview.userid = vtiger_users.id ";
@@ -292,23 +294,27 @@  discard block
 block discarded – undo
292 294
 				if ($cvrow['status'] == CV_STATUS_DEFAULT || $cvrow['userid'] == $current_user->id) {
293 295
 					$shtml_user .= $option;
294 296
 				} elseif ($cvrow['status'] == CV_STATUS_PUBLIC) {
295
-					if ($shtml_public == '')
296
-						$shtml_public = "<option disabled>--- " . \includes\Language::translate('LBL_PUBLIC') . " ---</option>";
297
+					if ($shtml_public == '') {
298
+											$shtml_public = "<option disabled>--- " . \includes\Language::translate('LBL_PUBLIC') . " ---</option>";
299
+					}
297 300
 					$shtml_public .= $option;
298 301
 				} elseif ($cvrow['status'] == CV_STATUS_PENDING) {
299
-					if ($shtml_pending == '')
300
-						$shtml_pending = "<option disabled>--- " . \includes\Language::translate('LBL_PENDING') . " ---</option>";
302
+					if ($shtml_pending == '') {
303
+											$shtml_pending = "<option disabled>--- " . \includes\Language::translate('LBL_PENDING') . " ---</option>";
304
+					}
301 305
 					$shtml_pending .= $option;
302 306
 				} else {
303
-					if ($shtml_others == '')
304
-						$shtml_others = "<option disabled>--- " . \includes\Language::translate('LBL_OTHERS') . " ---</option>";
307
+					if ($shtml_others == '') {
308
+											$shtml_others = "<option disabled>--- " . \includes\Language::translate('LBL_OTHERS') . " ---</option>";
309
+					}
305 310
 					$shtml_others .= $option;
306 311
 				}
307 312
 			}
308 313
 		}
309 314
 		$shtml = $shtml_user;
310
-		if ($is_admin === true)
311
-			$shtml .= $shtml_pending;
315
+		if ($is_admin === true) {
316
+					$shtml .= $shtml_pending;
317
+		}
312 318
 		$shtml = $shtml . $shtml_public . $shtml_others;
313 319
 		return $shtml;
314 320
 	}
@@ -332,8 +338,9 @@  discard block
 block discarded – undo
332 338
 		if (empty($this->meta) && $module != 'Calendar') {
333 339
 			$this->meta = $this->getMeta($module, $current_user);
334 340
 		}
335
-		if ($tabid == 9)
336
-			$tabid = "9,16";
341
+		if ($tabid == 9) {
342
+					$tabid = "9,16";
343
+		}
337 344
 		$display_type = " vtiger_field.displaytype in (1,2,3)";
338 345
 
339 346
 		if ($is_admin === true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
@@ -365,8 +372,9 @@  discard block
 block discarded – undo
365 372
 
366 373
 			$sql.= " group by columnname order by sequence";
367 374
 		}
368
-		if ($tabid == '9,16')
369
-			$tabid = "9";
375
+		if ($tabid == '9,16') {
376
+					$tabid = "9";
377
+		}
370 378
 		$sql = sprintf($sql, generateQuestionMarks($tab_ids), generateQuestionMarks($block_ids));
371 379
 		$result = $adb->pquery($sql, $params);
372 380
 		$noofrows = $adb->num_rows($result);
@@ -405,8 +413,9 @@  discard block
 block discarded – undo
405 413
 				$fieldlabel1 . ":" . $fieldtypeofdata;
406 414
 			//added to escape attachments fields in customview as we have multiple attachments
407 415
 			$fieldlabel = \includes\Language::translate($fieldlabel); //added to support i18n issue
408
-			if ($module != 'HelpDesk' || $fieldname != 'filename')
409
-				$module_columnlist[$optionvalue] = $fieldlabel;
416
+			if ($module != 'HelpDesk' || $fieldname != 'filename') {
417
+							$module_columnlist[$optionvalue] = $fieldlabel;
418
+			}
410 419
 			if ($fieldtype[1] == "M") {
411 420
 				$this->mandatoryvalues[] = "'" . $optionvalue . "'";
412 421
 				$this->showvalues[] = $fieldlabel;
@@ -646,8 +655,9 @@  discard block
 block discarded – undo
646 655
 
647 656
 			$result = $adb->pquery($ssql, array($cvid, $groupId));
648 657
 			$noOfColumns = $adb->num_rows($result);
649
-			if ($noOfColumns <= 0)
650
-				continue;
658
+			if ($noOfColumns <= 0) {
659
+							continue;
660
+			}
651 661
 
652 662
 			while ($relcriteriarow = $adb->fetch_array($result)) {
653 663
 				$criteria = $this->getAdvftCriteria($relcriteriarow);
@@ -677,8 +687,9 @@  discard block
 block discarded – undo
677 687
 		}
678 688
 
679 689
 		// Clear the condition (and/or) for last group, if any.
680
-		if (!empty($advft_criteria[$i - 1]['condition']))
681
-			$advft_criteria[$i - 1]['condition'] = '';
690
+		if (!empty($advft_criteria[$i - 1]['condition'])) {
691
+					$advft_criteria[$i - 1]['condition'] = '';
692
+		}
682 693
 
683 694
 		return $advft_criteria;
684 695
 	}
@@ -794,8 +805,9 @@  discard block
 block discarded – undo
794 805
 								'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
795 806
 						$sqllist_column = "case when (vtiger_users.user_name not like '') then $userNameSql else vtiger_groups.groupname end as user_name";
796 807
 					}
797
-					if ($list[0] == "vtiger_contactdetails" && $list[1] == "lastname")
798
-						$sqllist_column = "vtiger_contactdetails.lastname,vtiger_contactdetails.firstname";
808
+					if ($list[0] == "vtiger_contactdetails" && $list[1] == "lastname") {
809
+											$sqllist_column = "vtiger_contactdetails.lastname,vtiger_contactdetails.firstname";
810
+					}
799 811
 					$sqllist[] = $sqllist_column;
800 812
 					//Ends
801 813
 
@@ -940,13 +952,13 @@  discard block
 block discarded – undo
940 952
 							$advorsql[] = $this->getRealValues($columns[0], $columns[1], $comparator, trim($valuearray[$n]), $datatype);
941 953
 						}
942 954
 						//If negative logic filter ('not equal to', 'does not contain') is used, 'and' condition should be applied instead of 'or'
943
-						if ($comparator == 'n' || $comparator == 'k')
944
-							$advorsqls = implode(" and ", $advorsql);
945
-						else
946
-							$advorsqls = implode(" or ", $advorsql);
955
+						if ($comparator == 'n' || $comparator == 'k') {
956
+													$advorsqls = implode(" and ", $advorsql);
957
+						} else {
958
+													$advorsqls = implode(" or ", $advorsql);
959
+						}
947 960
 						$advfiltersql = " (" . $advorsqls . ") ";
948
-					}
949
-					elseif ($comparator == 'bw' && count($valuearray) == 2) {
961
+					} elseif ($comparator == 'bw' && count($valuearray) == 2) {
950 962
 						$advfiltersql = "(" . $columns[0] . "." . $columns[1] . " between '" . getValidDBInsertDateTimeValue(trim($valuearray[0]), $datatype) . "' and '" . getValidDBInsertDateTimeValue(trim($valuearray[1]), $datatype) . "')";
951 963
 					} elseif ($comparator == 'y') {
952 964
 						$advfiltersql = sprintf("(%s.%s IS NULL || %s.%s = '')", $columns[0], $columns[1], $columns[0], $columns[1]);
@@ -982,8 +994,9 @@  discard block
 block discarded – undo
982 994
 				$advcvsql .= $advfiltergroupsql;
983 995
 			}
984 996
 		}
985
-		if (trim($advcvsql) != "")
986
-			$advcvsql = '(' . $advcvsql . ')';
997
+		if (trim($advcvsql) != "") {
998
+					$advcvsql = '(' . $advcvsql . ')';
999
+		}
987 1000
 		return $advcvsql;
988 1001
 	}
989 1002
 
@@ -1003,8 +1016,9 @@  discard block
 block discarded – undo
1003 1016
 		$currentModule = vglobal('currentModule');
1004 1017
 		$mod_strings = vglobal('mod_strings');
1005 1018
 		//Added for proper check of contact name in advance filter
1006
-		if ($tablename == "vtiger_contactdetails" && $fieldname == "lastname")
1007
-			$fieldname = "contactid";
1019
+		if ($tablename == "vtiger_contactdetails" && $fieldname == "lastname") {
1020
+					$fieldname = "contactid";
1021
+		}
1008 1022
 
1009 1023
 		$contactid = "vtiger_contactdetails.lastname";
1010 1024
 		if ($currentModule != "Contacts" && $currentModule != "Leads" && $currentModule != 'Campaigns') {
@@ -1052,10 +1066,11 @@  discard block
 block discarded – undo
1052 1066
 			//For checkbox type values, we have to convert yes/no as 1/0 to get the values
1053 1067
 			$field_uitype = getUItype($this->customviewmodule, $fieldname);
1054 1068
 			if ($field_uitype == 56) {
1055
-				if (strtolower($value) == 'yes')
1056
-					$value = 1;
1057
-				elseif (strtolower($value) == 'no')
1058
-					$value = 0;
1069
+				if (strtolower($value) == 'yes') {
1070
+									$value = 1;
1071
+				} elseif (strtolower($value) == 'no') {
1072
+									$value = 0;
1073
+				}
1059 1074
 			} else if (is_uitype($field_uitype, '_picklist_')) { /* Fix for tickets 4465 and 4629 */
1060 1075
 				// Get all the keys for the for the Picklist value
1061 1076
 				$mod_keys = array_keys($mod_strings, $value);
@@ -1104,8 +1119,9 @@  discard block
 block discarded – undo
1104 1119
 			if ($modulename == 'Vendors') {
1105 1120
 				continue;
1106 1121
 			}
1107
-			if ($s != 0)
1108
-				$value .= ' or ';
1122
+			if ($s != 0) {
1123
+							$value .= ' or ';
1124
+			}
1109 1125
 			if ($modulename == 'Accounts') {
1110 1126
 				//By Pavani : Related to problem in calender, Ticket: 4284 and 4675
1111 1127
 				if (($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') {
@@ -1368,16 +1384,18 @@  discard block
 block discarded – undo
1368 1384
 					INNER JOIN vtiger_blocks ON vtiger_blocks.blockid = vtiger_field.block INNER JOIN vtiger_tab ON vtiger_tab.tabid = vtiger_field.tabid 
1369 1385
 				  WHERE vtiger_tab.name IN (%s) && vtiger_field.presence IN (0, 2)', generateQuestionMarks($modulesList));
1370 1386
 		$result = $adb->pquery($sql, [$modulesList]);
1371
-		if ($module == "Calendar','Events")
1372
-			$module = 'Calendar';
1387
+		if ($module == "Calendar','Events") {
1388
+					$module = 'Calendar';
1389
+		}
1373 1390
 
1374 1391
 		$preBlockLabel = '';
1375 1392
 		while ($block = $adb->getRow($result)) {
1376 1393
 			$blockLabel = $block['blocklabel'];
1377 1394
 			$tabid = $block['tabid'];
1378 1395
 			// Skip certain blocks of certain modules
1379
-			if (array_key_exists($tabid, $skipBlocksList) && in_array($blockLabel, $skipBlocksList[$tabid]))
1380
-				continue;
1396
+			if (array_key_exists($tabid, $skipBlocksList) && in_array($blockLabel, $skipBlocksList[$tabid])) {
1397
+							continue;
1398
+			}
1381 1399
 
1382 1400
 			if (trim($blockLabel) == '') {
1383 1401
 				$blockInfo[$preBlockLabel] = $blockInfo[$preBlockLabel] . ',' . $block['block'];
@@ -1450,9 +1468,9 @@  discard block
 block discarded – undo
1450 1468
 						$permission = 'yes';
1451 1469
 					} elseif ($status == CV_STATUS_PRIVATE || $status == CV_STATUS_PENDING) {
1452 1470
 						$log->debug('Entering when status=1 or 2');
1453
-						if ($userid == $current_user->id)
1454
-							$permission = "yes";
1455
-						else {
1471
+						if ($userid == $current_user->id) {
1472
+													$permission = "yes";
1473
+						} else {
1456 1474
 							$log->debug("Entering when status=1 or status=2 & action = ListView or $module.Ajax or index");
1457 1475
 							$sql = sprintf('SELECT 
1458 1476
 										vtiger_users.id 
@@ -1477,17 +1495,19 @@  discard block
 block discarded – undo
1477 1495
 							}
1478 1496
 							$user_array = $temp_result;
1479 1497
 							if (sizeof($user_array) > 0) {
1480
-								if (!in_array($current_user->id, $user_array))
1481
-									$permission = 'no';
1482
-								else
1483
-									$permission = 'yes';
1484
-							} else
1485
-								$permission = 'no';
1498
+								if (!in_array($current_user->id, $user_array)) {
1499
+																	$permission = 'no';
1500
+								} else {
1501
+																	$permission = 'yes';
1502
+								}
1503
+							} else {
1504
+															$permission = 'no';
1505
+							}
1486 1506
 						}
1487
-					} else
1488
-						$permission = 'yes';
1489
-				}
1490
-				else {
1507
+					} else {
1508
+											$permission = 'yes';
1509
+					}
1510
+				} else {
1491 1511
 					$log->debug('Entering else condition............');
1492 1512
 					$permission = 'no';
1493 1513
 				}
Please login to merge, or discard this patch.
modules/CustomView/models/Record.php 3 patches
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	/**
68 68
 	 * Function to set the Module to which the record belongs
69 69
 	 * @param <String> $moduleName
70
-	 * @return Vtiger_Record_Model or Module Specific Record Model instance
70
+	 * @return CustomView_Record_Model or Module Specific Record Model instance
71 71
 	 */
72 72
 	public function setModule($moduleName)
73 73
 	{
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	/**
79 79
 	 * Function to set the Module to which the record belongs from the Module model instance
80 80
 	 * @param <Vtiger_Module_Model> $module
81
-	 * @return Vtiger_Record_Model or Module Specific Record Model instance
81
+	 * @return CustomView_Record_Model or Module Specific Record Model instance
82 82
 	 */
83 83
 	public function setModuleFromInstance($module)
84 84
 	{
@@ -1057,7 +1057,6 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
 	/**
1059 1059
 	 * function to check duplicates from database
1060
-	 * @param <type> $viewName
1061 1060
 	 * @param <type> module name entity type in database
1062 1061
 	 * @return <boolean> true/false
1063 1062
 	 */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 			$lockFields = $crmEntityModel->getLockFields();
298 298
 			if (is_array($lockFields)) {
299 299
 				foreach ($lockFields as $fieldName => $fieldValues) {
300
-					$listQuery .=' && ' . $baseTableName . '.' . $fieldName . ' NOT IN (' . generateQuestionMarks($fieldValues) . ')';
300
+					$listQuery .= ' && ' . $baseTableName . '.' . $fieldName . ' NOT IN (' . generateQuestionMarks($fieldValues) . ')';
301 301
 					$params = array_merge($params, $fieldValues);
302 302
 				}
303 303
 			}
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 					}
452 452
 
453 453
 					$temp_val = explode(",", $advFitlerValue);
454
-					if (($fieldType == 'date' || ($fieldType == 'time' && $fieldName != 'time_start' && $fieldName != 'time_end') || ($fieldType == 'datetime')) && ($fieldType != '' && $advFitlerValue != '' )) {
454
+					if (($fieldType == 'date' || ($fieldType == 'time' && $fieldName != 'time_start' && $fieldName != 'time_end') || ($fieldType == 'datetime')) && ($fieldType != '' && $advFitlerValue != '')) {
455 455
 						$val = Array();
456 456
 						for ($x = 0; $x < count($temp_val); $x++) {
457 457
 							//if date and time given then we have to convert the date and
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 						inner join vtiger_cvadvfilter on vtiger_cvadvfilter.cvid = vtiger_customview.cvid
673 673
 						left join vtiger_cvadvfilter_grouping on vtiger_cvadvfilter.cvid = vtiger_cvadvfilter_grouping.cvid
674 674
 								and vtiger_cvadvfilter.groupid = vtiger_cvadvfilter_grouping.groupid';
675
-			$ssql.= " where vtiger_customview.cvid = ? && vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
675
+			$ssql .= " where vtiger_customview.cvid = ? && vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
676 676
 
677 677
 			$result = $db->pquery($ssql, array($this->getId(), $groupId));
678 678
 			$noOfColumns = $db->num_rows($result);
Please login to merge, or discard this patch.
Braces   +16 added lines, -10 removed lines patch added patch discarded remove patch
@@ -413,15 +413,17 @@  discard block
 block discarded – undo
413 413
 		$advFilterList = $this->get('advfilterlist');
414 414
 		if (!empty($advFilterList)) {
415 415
 			foreach ($advFilterList as $groupIndex => $groupInfo) {
416
-				if (empty($groupInfo))
417
-					continue;
416
+				if (empty($groupInfo)) {
417
+									continue;
418
+				}
418 419
 
419 420
 				$groupColumns = $groupInfo['columns'];
420 421
 				$groupCondition = $groupInfo['condition'];
421 422
 
422 423
 				foreach ($groupColumns as $columnIndex => $columnCondition) {
423
-					if (empty($columnCondition))
424
-						continue;
424
+					if (empty($columnCondition)) {
425
+											continue;
426
+					}
425 427
 
426 428
 					$advFilterColumn = $columnCondition['columnname'];
427 429
 					$advFilterComparator = $columnCondition['comparator'];
@@ -494,8 +496,10 @@  discard block
 block discarded – undo
494 496
 				}
495 497
 
496 498
 				$groupConditionExpression = $advFilterList[$groupIndex]["conditionexpression"];
497
-				if (empty($groupConditionExpression))
498
-					continue; // Case when the group doesn't have any column criteria
499
+				if (empty($groupConditionExpression)) {
500
+									continue;
501
+				}
502
+				// Case when the group doesn't have any column criteria
499 503
 
500 504
 				$db->insert('vtiger_cvadvfilter_grouping', [
501 505
 					'groupid' => $groupIndex,
@@ -676,8 +680,9 @@  discard block
 block discarded – undo
676 680
 
677 681
 			$result = $db->pquery($ssql, array($this->getId(), $groupId));
678 682
 			$noOfColumns = $db->num_rows($result);
679
-			if ($noOfColumns <= 0)
680
-				continue;
683
+			if ($noOfColumns <= 0) {
684
+							continue;
685
+			}
681 686
 
682 687
 			while ($relcriteriarow = $db->fetch_array($result)) {
683 688
 				$criteria = [];
@@ -730,8 +735,9 @@  discard block
 block discarded – undo
730 735
 			$i++;
731 736
 		}
732 737
 		// Clear the condition (and/or) for last group, if any.
733
-		if (!empty($advft_criteria[$i - 1]['condition']))
734
-			$advft_criteria[$i - 1]['condition'] = '';
738
+		if (!empty($advft_criteria[$i - 1]['condition'])) {
739
+					$advft_criteria[$i - 1]['condition'] = '';
740
+		}
735 741
 		return $advft_criteria;
736 742
 	}
737 743
 
Please login to merge, or discard this patch.
modules/Emails/class.phpmailer.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2758,7 +2758,7 @@
 block discarded – undo
2758 2758
 	 * @link http://www.php.net/manual/en/function.pathinfo.php#107461
2759 2759
 	 * @param string $path A filename or path, does not need to exist as a file
2760 2760
 	 * @param integer|string $options Either a PATHINFO_* constant, or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2
2761
-	 * @return string|array
2761
+	 * @return string
2762 2762
 	 * @static
2763 2763
 	 */
2764 2764
 	public static function mb_pathinfo($path, $options = null)
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1927,7 +1927,7 @@
 block discarded – undo
1927 1927
 				//If a filename contains any of these chars, it should be quoted, but not otherwise: RFC2183 & RFC2045 5.1
1928 1928
 				//Fixes a warning in IETF's msglint MIME checker
1929 1929
 				//
1930
-        // Allow for bypassing the Content-Disposition header totally
1930
+		// Allow for bypassing the Content-Disposition header totally
1931 1931
 				if (!(empty($disposition))) {
1932 1932
 					if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $name)) {
1933 1933
 						$mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE . $this->LE);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 	const STOP_MESSAGE = 0; // message only, continue processing
531 531
 	const STOP_CONTINUE = 1; // message?, likely ok to continue processing
532 532
 	const STOP_CRITICAL = 2; // message, plus full stop, critical error reached
533
-	const CRLF = "\r\n";  // SMTP RFC specified EOL
533
+	const CRLF = "\r\n"; // SMTP RFC specified EOL
534 534
 
535 535
 	/////////////////////////////////////////////////
536 536
 	// METHODS, VARIABLES
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 			$message = substr($message, 0, -$lelen);
1302 1302
 		}
1303 1303
 
1304
-		$line = explode($this->LE, $message);   // Magic. We know FixEOL uses $LE
1304
+		$line = explode($this->LE, $message); // Magic. We know FixEOL uses $LE
1305 1305
 		$message = '';
1306 1306
 		for ($i = 0; $i < count($line); $i++) {
1307 1307
 			$line_part = explode(' ', $line[$i]);
@@ -1390,8 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 				if ($dec < 128) { // Single byte character.
1391 1391
 					// If the encoded char was found at pos 0, it will fit
1392 1392
 					// otherwise reduce maxLength to start of the encoded char
1393
-					$maxLength = ($encodedCharPos == 0) ? $maxLength :
1394
-						$maxLength - ($lookBack - $encodedCharPos);
1393
+					$maxLength = ($encodedCharPos == 0) ? $maxLength : $maxLength - ($lookBack - $encodedCharPos);
1395 1394
 					$foundSplitPos = true;
1396 1395
 				} elseif ($dec >= 192) { // First byte of a multi byte character
1397 1396
 					// Reduce maxLength to split at start of character
Please login to merge, or discard this patch.
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -828,8 +828,9 @@  discard block
 block discarded – undo
828 828
 	public function Send()
829 829
 	{
830 830
 		try {
831
-			if (!$this->PreSend())
832
-				return false;
831
+			if (!$this->PreSend()) {
832
+							return false;
833
+			}
833 834
 			return $this->PostSend();
834 835
 		} catch (phpmailerException $e) {
835 836
 			$this->mailHeader = '';
@@ -1773,15 +1774,19 @@  discard block
 block discarded – undo
1773 1774
 	protected function SetMessageType()
1774 1775
 	{
1775 1776
 		$this->message_type = array();
1776
-		if ($this->AlternativeExists())
1777
-			$this->message_type[] = "alt";
1778
-		if ($this->InlineImageExists())
1779
-			$this->message_type[] = "inline";
1780
-		if ($this->AttachmentExists())
1781
-			$this->message_type[] = "attach";
1777
+		if ($this->AlternativeExists()) {
1778
+					$this->message_type[] = "alt";
1779
+		}
1780
+		if ($this->InlineImageExists()) {
1781
+					$this->message_type[] = "inline";
1782
+		}
1783
+		if ($this->AttachmentExists()) {
1784
+					$this->message_type[] = "attach";
1785
+		}
1782 1786
 		$this->message_type = implode("_", $this->message_type);
1783
-		if ($this->message_type == "")
1784
-			$this->message_type = "plain";
1787
+		if ($this->message_type == "") {
1788
+					$this->message_type = "plain";
1789
+		}
1785 1790
 	}
1786 1791
 
1787 1792
 	/**
@@ -2019,8 +2024,9 @@  discard block
 block discarded – undo
2019 2024
 			case '8bit':
2020 2025
 				$encoded = $this->FixEOL($str);
2021 2026
 				//Make sure it ends with a line break
2022
-				if (substr($encoded, -(strlen($this->LE))) != $this->LE)
2023
-					$encoded .= $this->LE;
2027
+				if (substr($encoded, -(strlen($this->LE))) != $this->LE) {
2028
+									$encoded .= $this->LE;
2029
+				}
2024 2030
 				break;
2025 2031
 			case 'binary':
2026 2032
 				$encoded = $str;
@@ -2950,8 +2956,9 @@  discard block
 block discarded – undo
2950 2956
 	 */
2951 2957
 	public function DKIM_BodyC($body)
2952 2958
 	{
2953
-		if ($body == '')
2954
-			return "\r\n";
2959
+		if ($body == '') {
2960
+					return "\r\n";
2961
+		}
2955 2962
 		// stabilize line endings
2956 2963
 		$body = str_replace("\r\n", "\n", $body);
2957 2964
 		$body = str_replace("\n", "\r\n", $body);
Please login to merge, or discard this patch.
modules/Emails/class.smtp.php 3 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -111,6 +111,7 @@  discard block
 block discarded – undo
111 111
 	 * SMTP CODE SUCCESS: 220
112 112
 	 * SMTP CODE FAILURE: 421
113 113
 	 * @access public
114
+	 * @param string $host
114 115
 	 * @return bool
115 116
 	 */
116 117
 	public function Connect($host, $port = 0, $tval = 30)
@@ -210,6 +211,8 @@  discard block
 block discarded – undo
210 211
 	 * Performs SMTP authentication.  Must be run after running the
211 212
 	 * Hello() method.  Returns true if successfully authenticated.
212 213
 	 * @access public
214
+	 * @param string $username
215
+	 * @param string $password
213 216
 	 * @return bool
214 217
 	 */
215 218
 	public function Authenticate($username, $password)
@@ -325,6 +328,7 @@  discard block
 block discarded – undo
325 328
 	 * SMTP CODE FAILURE: 451,554
326 329
 	 * SMTP CODE ERROR  : 500,501,503,421
327 330
 	 * @access public
331
+	 * @param string $msg_data
328 332
 	 * @return bool
329 333
 	 */
330 334
 	public function Data($msg_data)
@@ -491,6 +495,8 @@  discard block
 block discarded – undo
491 495
 	/**
492 496
 	 * Sends a HELO/EHLO command.
493 497
 	 * @access private
498
+	 * @param string $hello
499
+	 * @param string $host
494 500
 	 * @return bool
495 501
 	 */
496 502
 	private function SendHello($hello, $host)
@@ -531,6 +537,7 @@  discard block
 block discarded – undo
531 537
 	 * SMTP CODE SUCCESS: 552,451,452
532 538
 	 * SMTP CODE SUCCESS: 500,501,421
533 539
 	 * @access public
540
+	 * @param string $from
534 541
 	 * @return bool
535 542
 	 */
536 543
 	public function Mail($from)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	/////////////////////////////////////////////////
80 80
 
81 81
 	private $smtp_conn; // the socket to the server
82
-	private $error;  // error if any on the last call
82
+	private $error; // error if any on the last call
83 83
 	private $helo_rply; // the reply the server sent to us for HELO
84 84
 
85 85
 	/**
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 				$port, // the port to use
135 135
 				$errno, // error number if any
136 136
 				$errstr, // error message if any
137
-				$tval);   // give up after ? secs
137
+				$tval); // give up after ? secs
138 138
 		// verify we connected properly
139 139
 		if (empty($this->smtp_conn)) {
140 140
 			$this->error = array("error" => "Failed to connect to server",
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -148,8 +148,9 @@
 block discarded – undo
148 148
 
149 149
 		// SMTP server can take longer to respond, give longer timeout for first read
150 150
 		// Windows does not have support for this timeout function
151
-		if (substr(PHP_OS, 0, 3) != "WIN")
152
-			socket_set_timeout($this->smtp_conn, $tval, 0);
151
+		if (substr(PHP_OS, 0, 3) != "WIN") {
152
+					socket_set_timeout($this->smtp_conn, $tval, 0);
153
+		}
153 154
 
154 155
 		// get any announcement
155 156
 		$announce = $this->get_lines();
Please login to merge, or discard this patch.
modules/Emails/Emails.php 3 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -519,6 +519,9 @@  discard block
 block discarded – undo
519 519
 		return $query;
520 520
 	}
521 521
 
522
+	/**
523
+	 * @param string $tableName
524
+	 */
522 525
 	protected function setupTemporaryTable($tableName, $tabId, $user, $parentRole, $userGroups)
523 526
 	{
524 527
 		$module = null;
@@ -619,6 +622,9 @@  discard block
 block discarded – undo
619 622
 }
620 623
 
621 624
 //added for attach the generated pdf with email
625
+/**
626
+ * @param Emails $obj
627
+ */
622 628
 function pdfAttach($obj, $module, $file_name, $id)
623 629
 {
624 630
 	$log = vglobal('log');
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -85,7 +85,7 @@
 block discarded – undo
85 85
 				$mysql = 'insert into vtiger_seactivityrel values(?,?)';
86 86
 				$adb->pquery($mysql, array($parentid, $actid));
87 87
 			} else {
88
-				$myids = explode("|", $parentid);  //2@71|
88
+				$myids = explode("|", $parentid); //2@71|
89 89
 				for ($i = 0; $i < (count($myids) - 1); $i++) {
90 90
 					$realid = explode("@", $myids[$i]);
91 91
 					$mycrmid = $realid[0];
Please login to merge, or discard this patch.
Braces   +45 added lines, -32 removed lines patch added patch discarded remove patch
@@ -179,16 +179,18 @@  discard block
 block discarded – undo
179 179
 		$filepart = $file_details['part'];
180 180
 		$transfer = $file_details['transfer'];
181 181
 		$file = imap_fetchbody($mail, $_REQUEST['mailid'], $filepart);
182
-		if ($transfer == 'BASE64')
183
-			$file = imap_base64($file);
184
-		elseif ($transfer == 'QUOTED-PRINTABLE')
185
-			$file = imap_qprint($file);
182
+		if ($transfer == 'BASE64') {
183
+					$file = imap_base64($file);
184
+		} elseif ($transfer == 'QUOTED-PRINTABLE') {
185
+					$file = imap_qprint($file);
186
+		}
186 187
 		$current_id = $adb->getUniqueID("vtiger_crmentity");
187 188
 		$date_var = date('Y-m-d H:i:s');
188 189
 		//to get the owner id
189 190
 		$ownerid = $this->column_fields['assigned_user_id'];
190
-		if (!isset($ownerid) || $ownerid == '')
191
-			$ownerid = $current_user->id;
191
+		if (!isset($ownerid) || $ownerid == '') {
192
+					$ownerid = $current_user->id;
193
+		}
192 194
 		$upload_file_path = \vtlib\Functions::initStorageFileDirectory();
193 195
 		file_put_contents($upload_file_path . $current_id . "_" . $filename, $file);
194 196
 
@@ -238,8 +240,9 @@  discard block
 block discarded – undo
238 240
 		$button = '';
239 241
 
240 242
 		if ($actions) {
241
-			if (is_string($actions))
242
-				$actions = explode(',', strtoupper($actions));
243
+			if (is_string($actions)) {
244
+							$actions = explode(',', strtoupper($actions));
245
+			}
243 246
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
244 247
 				$button .= "<input title='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "' class='crmbutton small edit' type='button' onclick=\"return window.open('index.php?module=$related_module&return_module=$currentModule&action=Popup&popuptype=detailview&select=enable&form=EditView&form_submit=false&recordid=$id','test','width=640,height=602,resizable=0,scrollbars=0');\" value='" . \includes\Language::translate('LBL_SELECT') . " " . \includes\Language::translate($related_module) . "'>&nbsp;";
245 248
 			}
@@ -276,8 +279,9 @@  discard block
 block discarded – undo
276 279
 
277 280
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
278 281
 
279
-		if ($return_value === null)
280
-			$return_value = Array();
282
+		if ($return_value === null) {
283
+					$return_value = Array();
284
+		}
281 285
 		$return_value['CUSTOM_BUTTON'] = $button;
282 286
 
283 287
 		$log->debug("Exiting get_contacts method ...");
@@ -293,10 +297,11 @@  discard block
 block discarded – undo
293 297
 	{
294 298
 		$log = vglobal('log');
295 299
 		$log->debug("Entering getSortOrder() method ...");
296
-		if (isset($_REQUEST['sorder']))
297
-			$sorder = $this->db->sql_escape_string($_REQUEST['sorder']);
298
-		else
299
-			$sorder = (($_SESSION['EMAILS_SORT_ORDER'] != '') ? ($_SESSION['EMAILS_SORT_ORDER']) : ($this->default_sort_order));
300
+		if (isset($_REQUEST['sorder'])) {
301
+					$sorder = $this->db->sql_escape_string($_REQUEST['sorder']);
302
+		} else {
303
+					$sorder = (($_SESSION['EMAILS_SORT_ORDER'] != '') ? ($_SESSION['EMAILS_SORT_ORDER']) : ($this->default_sort_order));
304
+		}
300 305
 
301 306
 		$log->debug("Exiting getSortOrder method ...");
302 307
 		return $sorder;
@@ -317,10 +322,11 @@  discard block
 block discarded – undo
317 322
 			$use_default_order_by = $this->default_order_by;
318 323
 		}
319 324
 
320
-		if (isset($_REQUEST['order_by']))
321
-			$order_by = $this->db->sql_escape_string($_REQUEST['order_by']);
322
-		else
323
-			$order_by = (($_SESSION['EMAILS_ORDER_BY'] != '') ? ($_SESSION['EMAILS_ORDER_BY']) : ($use_default_order_by));
325
+		if (isset($_REQUEST['order_by'])) {
326
+					$order_by = $this->db->sql_escape_string($_REQUEST['order_by']);
327
+		} else {
328
+					$order_by = (($_SESSION['EMAILS_ORDER_BY'] != '') ? ($_SESSION['EMAILS_ORDER_BY']) : ($use_default_order_by));
329
+		}
324 330
 
325 331
 		$log->debug("Exiting getOrderBy method ...");
326 332
 		return $order_by;
@@ -375,25 +381,31 @@  discard block
 block discarded – undo
375 381
 			$entries[] = $row['user_name'];
376 382
 			$entries[] = $row['email1'];
377 383
 			$entries[] = $row['phone_home'];
378
-			if ($phone == '')
379
-				$phone = $row['phone_work'];
380
-			if ($phone == '')
381
-				$phone = $row['phone_mobile'];
382
-			if ($phone == '')
383
-				$phone = $row['phone_other'];
384
-			if ($phone == '')
385
-				$phone = $row['phone_fax'];
384
+			if ($phone == '') {
385
+							$phone = $row['phone_work'];
386
+			}
387
+			if ($phone == '') {
388
+							$phone = $row['phone_mobile'];
389
+			}
390
+			if ($phone == '') {
391
+							$phone = $row['phone_other'];
392
+			}
393
+			if ($phone == '') {
394
+							$phone = $row['phone_fax'];
395
+			}
386 396
 
387 397
 			//Adding Security Check for User
388 398
 
389 399
 			$entries_list[] = $entries;
390 400
 		}
391 401
 
392
-		if ($entries_list != '')
393
-			$return_data = array("header" => $header, "entries" => $entries);
402
+		if ($entries_list != '') {
403
+					$return_data = array("header" => $header, "entries" => $entries);
404
+		}
394 405
 
395
-		if ($return_data === null)
396
-			$return_data = Array();
406
+		if ($return_data === null) {
407
+					$return_data = Array();
408
+		}
397 409
 		$return_data['CUSTOM_BUTTON'] = $button;
398 410
 
399 411
 		$log->debug("Exiting get_users method ...");
@@ -629,8 +641,9 @@  discard block
 block discarded – undo
629 641
 	$date_var = date('Y-m-d H:i:s');
630 642
 
631 643
 	$ownerid = $obj->column_fields['assigned_user_id'];
632
-	if (!isset($ownerid) || $ownerid == '')
633
-		$ownerid = $current_user->id;
644
+	if (!isset($ownerid) || $ownerid == '') {
645
+			$ownerid = $current_user->id;
646
+	}
634 647
 
635 648
 	$current_id = $adb->getUniqueID("vtiger_crmentity");
636 649
 
Please login to merge, or discard this patch.
modules/Emails/mail.php 3 patches
Doc Comments   +10 added lines patch added patch discarded remove patch
@@ -103,6 +103,7 @@  discard block
 block discarded – undo
103 103
 /** 	Function to get the user Email id based on column name and column value
104 104
  * 	$name -- column name of the vtiger_users vtiger_table
105 105
  * 	$val  -- column value
106
+ * @param string $name
106 107
  */
107 108
 function getUserEmailId($name, $val)
108 109
 {
@@ -162,6 +163,8 @@  discard block
 block discarded – undo
162 163
  * 	$attachment	-- whether we want to attach the currently selected file or all vtiger_files.
163 164
   [values = current,all] - optional
164 165
  * 	$emailid	-- id of the email object which will be used to get the vtiger_attachments - optional
166
+ * @param PHPMailer $mail
167
+ * @param string $to_email
165 168
  */
166 169
 function setMailerProperties($mail, $subject, $contents, $fromEmail, $fromName, $to_email, $attachment = '', $emailid = '', $module = '', $logo = '')
167 170
 {
@@ -297,6 +300,7 @@  discard block
 block discarded – undo
297 300
  * 	$mail -- reference of the mail object
298 301
  * 	$filename -- filename which is going to added with the mail
299 302
  * 	$record -- id of the record - optional
303
+ * @param string $record
300 304
  */
301 305
 function addAttachment($mail, $filename, $record)
302 306
 {
@@ -313,6 +317,7 @@  discard block
 block discarded – undo
313 317
 /**     Function to add all the vtiger_files as attachment with the mail object
314 318
  *     $mail -- reference of the mail object
315 319
  *     $record -- email id ie., record id which is used to get the all vtiger_attachments from database
320
+ * @param string $record
316 321
  */
317 322
 function addAllAttachments($mail, $record)
318 323
 {
@@ -347,6 +352,9 @@  discard block
 block discarded – undo
347 352
  * 	$mail -- reference of the mail object
348 353
  * 	$cc_mod -- mode to set the address ie., cc or bcc
349 354
  * 	$cc_val -- addresss with comma seperated to set as CC or BCC in the mail
355
+ * @param PHPMailer $mail
356
+ * @param string $cc_mod
357
+ * @param string $cc_val
350 358
  */
351 359
 function setCCAddress($mail, $cc_mod, $cc_val)
352 360
 {
@@ -375,6 +383,7 @@  discard block
 block discarded – undo
375 383
 
376 384
 /** 	Function to send the mail which will be called after set all the mail object values
377 385
  * 	$mail -- reference of the mail object
386
+ * @param PHPMailer $mail
378 387
  */
379 388
 function MailSend($mail)
380 389
 {
@@ -423,6 +432,7 @@  discard block
 block discarded – undo
423 432
  * 	$mail_status -- status of the mail which is sent or not
424 433
  * 	$to -- the email address to whom we sent the mail and failes
425 434
  * 	return -- Mail error occured during the mail sending process
435
+ * @param PHPMailer $mail
426 436
  */
427 437
 function getMailError($mail, $mail_status, $to)
428 438
 {
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
 	$mail->Body = decode_html($contents);
180 180
 	$mail->AltBody = strip_tags(preg_replace(array("/<p>/i", "/<br>/i", "/<br \/>/i"), array("\n", "\n", "\n"), $contents));
181 181
 
182
-	$mail->IsSMTP();  //set mailer to use SMTP
182
+	$mail->IsSMTP(); //set mailer to use SMTP
183 183
 
184 184
 	setMailServerProperties($mail);
185 185
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 		addAllAttachments($mail, $emailid);
231 231
 	}
232 232
 
233
-	$mail->IsHTML(true);  // set email format to HTML
233
+	$mail->IsHTML(true); // set email format to HTML
234 234
 
235 235
 	return;
236 236
 }
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
278 278
 	if ($smtp_auth) {
279 279
 		$mail->SMTPAuth = true; // turn on SMTP authentication
280 280
 	}
281
-	$mail->Host = $server;  // specify main and backup server
281
+	$mail->Host = $server; // specify main and backup server
282 282
 	$mail->Username = $username; // SMTP username
283 283
 	$mail->Password = $password; // SMTP password
284 284
 	// To Support TLS
@@ -525,8 +525,8 @@  discard block
 block discarded – undo
525 525
 
526 526
 function isUserInitiated()
527 527
 {
528
-	return ( AppRequest::get('module') == 'Emails' &&
529
-		( AppRequest::get('action') == 'mailsend' || AppRequest::get('action') == 'Save'));
528
+	return (AppRequest::get('module') == 'Emails' &&
529
+		(AppRequest::get('action') == 'mailsend' || AppRequest::get('action') == 'Save'));
530 530
 }
531 531
 
532 532
 /**
Please login to merge, or discard this patch.
Braces   +31 added lines, -24 removed lines patch added patch discarded remove patch
@@ -245,27 +245,30 @@  discard block
 block discarded – undo
245 245
 	$log->debug('Inside the function setMailServerProperties');
246 246
 
247 247
 	$res = $adb->pquery('select * from vtiger_systems where server_type=?', array('email'));
248
-	if (AppRequest::has('server'))
249
-		$server = AppRequest::get('server');
250
-	else
251
-		$server = $adb->query_result_raw($res, 0, 'server');
252
-	if (AppRequest::has('server_username'))
253
-		$username = AppRequest::get('server_username');
254
-	else
255
-		$username = $adb->query_result_raw($res, 0, 'server_username');
256
-
257
-	if (AppRequest::has('server_password'))
258
-		$password = AppRequest::get('server_password');
259
-	else
260
-		$password = $adb->query_result_raw($res, 0, 'server_password');
248
+	if (AppRequest::has('server')) {
249
+			$server = AppRequest::get('server');
250
+	} else {
251
+			$server = $adb->query_result_raw($res, 0, 'server');
252
+	}
253
+	if (AppRequest::has('server_username')) {
254
+			$username = AppRequest::get('server_username');
255
+	} else {
256
+			$username = $adb->query_result_raw($res, 0, 'server_username');
257
+	}
258
+
259
+	if (AppRequest::has('server_password')) {
260
+			$password = AppRequest::get('server_password');
261
+	} else {
262
+			$password = $adb->query_result_raw($res, 0, 'server_password');
263
+	}
261 264
 
262 265
 	// Define default state
263 266
 	$smtp_auth = false;
264 267
 
265 268
 	// Prasad: First time read smtp_auth from the request
266
-	if (AppRequest::get('smtp_auth') == 'on')
267
-		$smtp_auth = true;
268
-	else if (AppRequest::get('module') == 'Settings' && (!AppRequest::has('smtp_auth'))) {
269
+	if (AppRequest::get('smtp_auth') == 'on') {
270
+			$smtp_auth = true;
271
+	} else if (AppRequest::get('module') == 'Settings' && (!AppRequest::has('smtp_auth'))) {
269 272
 		//added to avoid issue while editing the values in the outgoing mail server.
270 273
 		$smtp_auth = false;
271 274
 	} else {
@@ -353,10 +356,12 @@  discard block
 block discarded – undo
353 356
 	$log = LoggerManager::getInstance();
354 357
 	$log->debug('Inside the functin setCCAddress');
355 358
 
356
-	if ($cc_mod == 'cc')
357
-		$method = 'AddCC';
358
-	if ($cc_mod == 'bcc')
359
-		$method = 'AddBCC';
359
+	if ($cc_mod == 'cc') {
360
+			$method = 'AddCC';
361
+	}
362
+	if ($cc_mod == 'bcc') {
363
+			$method = 'AddBCC';
364
+	}
360 365
 	if ($cc_val != '') {
361 366
 		$ccmail = explode(",", trim($cc_val, ","));
362 367
 		for ($i = 0; $i < count($ccmail); $i++) {
@@ -367,8 +372,9 @@  discard block
 block discarded – undo
367 372
 				$cc_name = $name_addr_pair[0];
368 373
 				$addr = trim($name_addr_pair[1], ">");
369 374
 			}
370
-			if ($ccmail[$i] != '')
371
-				$mail->$method($addr, $cc_name);
375
+			if ($ccmail[$i] != '') {
376
+							$mail->$method($addr, $cc_name);
377
+			}
372 378
 		}
373 379
 	}
374 380
 }
@@ -541,8 +547,9 @@  discard block
 block discarded – undo
541 547
 		$userGroups = new GetGroupUsers();
542 548
 		$userGroups->getAllUsersInGroup($groupId);
543 549
 
544
-		if (count($userGroups->group_users) == 0)
545
-			return [];
550
+		if (count($userGroups->group_users) == 0) {
551
+					return [];
552
+		}
546 553
 
547 554
 		$query = sprintf('SELECT 
548 555
 					email1 
Please login to merge, or discard this patch.
modules/HelpDesk/dashboards/TicketsByStatus.php 3 patches
Doc Comments   -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,6 @@
 block discarded – undo
27 27
 
28 28
 	/**
29 29
 	 * Function returns Tickets grouped by Status
30
-	 * @param type $data
31 30
 	 * @return <Array>
32 31
 	 */
33 32
 	public function getTicketsByStatus($owner)
Please login to merge, or discard this patch.
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -19,8 +19,9 @@  discard block
 block discarded – undo
19 19
 
20 20
 		$listSearchParams = [];
21 21
 		$conditions = array(array('ticketstatus', 'e', $value));
22
-		if (!empty($assignedto))
23
-			array_push($conditions, array('assigned_user_id', 'e', $assignedto));
22
+		if (!empty($assignedto)) {
23
+					array_push($conditions, array('assigned_user_id', 'e', $assignedto));
24
+		}
24 25
 		$listSearchParams[] = $conditions;
25 26
 		return '&viewname=All&search_params=' . json_encode($listSearchParams);
26 27
 	}
@@ -72,8 +73,9 @@  discard block
 block discarded – undo
72 73
 				$priorities[$row['priority']] = $counter++;
73 74
 				$colors[$row['priority']] = $row['color'];
74 75
 			}
75
-			if (!in_array($row['statusvalue'], $status))
76
-				$status[] = $row['statusvalue'];
76
+			if (!in_array($row['statusvalue'], $status)) {
77
+							$status[] = $row['statusvalue'];
78
+			}
77 79
 		}
78 80
 		if (!empty($tickets)) {
79 81
 			$counter = 0;
@@ -117,13 +119,15 @@  discard block
 block discarded – undo
117 119
 		$data = $request->get('data');
118 120
 		$createdTime = $request->get('createdtime');
119 121
 		$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
120
-		if (!$request->has('owner'))
121
-			$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, $moduleName);
122
-		else
123
-			$owner = $request->get('owner');
122
+		if (!$request->has('owner')) {
123
+					$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, $moduleName);
124
+		} else {
125
+					$owner = $request->get('owner');
126
+		}
124 127
 		$ownerForwarded = $owner;
125
-		if ($owner == 'all')
126
-			$owner = '';
128
+		if ($owner == 'all') {
129
+					$owner = '';
130
+		}
127 131
 
128 132
 		//Date conversion from user to database format
129 133
 		if (!empty($createdTime)) {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@
 block discarded – undo
55 55
 		$sql = 'SELECT Year(`saledate`) as y,  Month(`saledate`) as m,sum(`sum_gross`) as s FROM u_yf_finvoice
56 56
 					INNER JOIN vtiger_crmentity ON u_yf_finvoice.finvoiceid = vtiger_crmentity.crmid
57 57
 					WHERE vtiger_crmentity.deleted = ? && saledate > ?';
58
-		$sql.= \App\PrivilegeQuery::getAccessConditions($moduleName);
58
+		$sql .= \App\PrivilegeQuery::getAccessConditions($moduleName);
59 59
 		if ($owner != 'all') {
60 60
 			$sql .= ' && vtiger_crmentity.smownerid = ?';
61 61
 			$param[] = $owner;
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.