Completed
Push — developer ( 23acf8...7cd58d )
by Błażej
110:37 queued 68:14
created
modules/PriceBooks/PriceBooks.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -197,7 +197,7 @@
 block discarded – undo
197 197
 
198 198
 	/** 	function used to get whether the pricebook has related with a product or not
199 199
 	 * 	@param int $id - product id
200
-	 * 	@return true or false - if there are no pricebooks available or associated pricebooks for the product is equal to total number of pricebooks then return false, else return true
200
+	 * 	@return boolean|null or false - if there are no pricebooks available or associated pricebooks for the product is equal to total number of pricebooks then return false, else return true
201 201
 	 */
202 202
 	public function get_pricebook_noproduct($id)
203 203
 	{
Please login to merge, or discard this patch.
modules/Reports/ReportRun.php 3 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -103,6 +103,9 @@  discard block
 block discarded – undo
103 103
 		$this->customTables[] = $table;
104 104
 	}
105 105
 
106
+	/**
107
+	 * @param ReportRunQueryDependencyMatrix $dependencies
108
+	 */
106 109
 	public function requireTable($table, $dependencies = null)
107 110
 	{
108 111
 
@@ -782,6 +785,7 @@  discard block
 block discarded – undo
782 785
 	/** Function to get field that is to be compared in query form for the given Comparator and field
783 786
 	 *  @ param $field : field
784 787
 	 *  returns the value for the comparator
788
+	 * @param string $field
785 789
 	 */
786 790
 	public function getFilterComparedField($field)
787 791
 	{
@@ -2308,6 +2312,11 @@  discard block
 block discarded – undo
2308 2312
 	 * 		HTML strings for
2309 2313
 	 */
2310 2314
 	// Performance Optimization: Added parameter directOutput to avoid building big-string!
2315
+
2316
+	/**
2317
+	 * @param string $outputformat
2318
+	 * @param string $filtersql
2319
+	 */
2311 2320
 	public function GenerateReport($outputformat, $filtersql, $directOutput = false, $startLimit = false, $endLimit = false)
2312 2321
 	{
2313 2322
 		$adb = PearDatabase::getInstance();
Please login to merge, or discard this patch.
Spacing   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
 										$advfiltergroupsql .= "$tableColumnSql BETWEEN $start AND $end";
1005 1005
 									else
1006 1006
 										$advfiltergroupsql .= "$tableColumnSql NOT BETWEEN $start AND $end";
1007
-								}else if ($comparator == 'bw') {
1007
+								} else if ($comparator == 'bw') {
1008 1008
 									$values = explode(',', $value);
1009 1009
 									$startDateTime = explode(' ', $values[0]);
1010 1010
 									$endDateTime = explode(' ', $values[1]);
@@ -1447,7 +1447,7 @@  discard block
 block discarded – undo
1447 1447
 				}
1448 1448
 
1449 1449
 				$temp_val = explode(",", $adv_filter_value);
1450
-				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 != '' )) {
1450
+				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 != '')) {
1451 1451
 					$val = Array();
1452 1452
 					$countTempVal = count($temp_val);
1453 1453
 					for ($x = 0; $x < $countTempVal; $x++) {
@@ -2666,7 +2666,7 @@  discard block
 block discarded – undo
2666 2666
 							else
2667 2667
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2668 2668
 							$totalpdf[$rowcount][$arraykey] = $conv_value;
2669
-						}else {
2669
+						} else {
2670 2670
 							$totalpdf[$rowcount][$arraykey] = '';
2671 2671
 						}
2672 2672
 
@@ -2677,7 +2677,7 @@  discard block
 block discarded – undo
2677 2677
 							else
2678 2678
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2679 2679
 							$totalpdf[$rowcount][$arraykey] = $conv_value;
2680
-						}else {
2680
+						} else {
2681 2681
 							$totalpdf[$rowcount][$arraykey] = '';
2682 2682
 						}
2683 2683
 
@@ -2688,7 +2688,7 @@  discard block
 block discarded – undo
2688 2688
 							else
2689 2689
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2690 2690
 							$totalpdf[$rowcount][$arraykey] = $conv_value;
2691
-						}else {
2691
+						} else {
2692 2692
 							$totalpdf[$rowcount][$arraykey] = '';
2693 2693
 						}
2694 2694
 
@@ -2699,7 +2699,7 @@  discard block
 block discarded – undo
2699 2699
 							else
2700 2700
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2701 2701
 							$totalpdf[$rowcount][$arraykey] = $conv_value;
2702
-						}else {
2702
+						} else {
2703 2703
 							$totalpdf[$rowcount][$arraykey] = '';
2704 2704
 						}
2705 2705
 						$rowcount++;
@@ -2778,7 +2778,7 @@  discard block
 block discarded – undo
2778 2778
 							else
2779 2779
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2780 2780
 							$coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>';
2781
-						}else {
2781
+						} else {
2782 2782
 							$coltotalhtml .= '<td class="rptTotal">&nbsp;</td>';
2783 2783
 						}
2784 2784
 
@@ -2789,7 +2789,7 @@  discard block
 block discarded – undo
2789 2789
 							else
2790 2790
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2791 2791
 							$coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>';
2792
-						}else {
2792
+						} else {
2793 2793
 							$coltotalhtml .= '<td class="rptTotal">&nbsp;</td>';
2794 2794
 						}
2795 2795
 
@@ -2800,7 +2800,7 @@  discard block
 block discarded – undo
2800 2800
 							else
2801 2801
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2802 2802
 							$coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>';
2803
-						}else {
2803
+						} else {
2804 2804
 							$coltotalhtml .= '<td class="rptTotal">&nbsp;</td>';
2805 2805
 						}
2806 2806
 
@@ -2811,7 +2811,7 @@  discard block
 block discarded – undo
2811 2811
 							else
2812 2812
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2813 2813
 							$coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>';
2814
-						}else {
2814
+						} else {
2815 2815
 							$coltotalhtml .= '<td class="rptTotal">&nbsp;</td>';
2816 2816
 						}
2817 2817
 
@@ -2983,7 +2983,7 @@  discard block
 block discarded – undo
2983 2983
 							else
2984 2984
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2985 2985
 							$coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>';
2986
-						}else {
2986
+						} else {
2987 2987
 							$coltotalhtml .= "<td class='rptTotal'>&nbsp;</td>";
2988 2988
 						}
2989 2989
 
@@ -2994,7 +2994,7 @@  discard block
 block discarded – undo
2994 2994
 							else
2995 2995
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2996 2996
 							$coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>';
2997
-						}else {
2997
+						} else {
2998 2998
 							$coltotalhtml .= "<td class='rptTotal'>&nbsp;</td>";
2999 2999
 						}
3000 3000
 
@@ -3005,7 +3005,7 @@  discard block
 block discarded – undo
3005 3005
 							else
3006 3006
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3007 3007
 							$coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>';
3008
-						}else {
3008
+						} else {
3009 3009
 							$coltotalhtml .= "<td class='rptTotal'>&nbsp;</td>";
3010 3010
 						}
3011 3011
 
@@ -3016,7 +3016,7 @@  discard block
 block discarded – undo
3016 3016
 							else
3017 3017
 								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3018 3018
 							$coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>';
3019
-						}else {
3019
+						} else {
3020 3020
 							$coltotalhtml .= "<td class='rptTotal'>&nbsp;</td>";
3021 3021
 						}
3022 3022
 
@@ -3377,7 +3377,7 @@  discard block
 block discarded – undo
3377 3377
 			$rowcount = 1;
3378 3378
 			//copy the first value details
3379 3379
 			$arrayFirstRowValues = $arr_val[0];
3380
-			array_pop($arrayFirstRowValues);   // removed action link in details
3380
+			array_pop($arrayFirstRowValues); // removed action link in details
3381 3381
 			foreach ($arrayFirstRowValues as $key => $value) {
3382 3382
 				$worksheet->setCellValueExplicitByColumnAndRow($count, $rowcount, $key, true);
3383 3383
 				$worksheet->getStyleByColumnAndRow($count, $rowcount)->applyFromArray($header_styles);
@@ -3442,7 +3442,7 @@  discard block
 block discarded – undo
3442 3442
 		if (isset($arr_val)) {
3443 3443
 			// Header
3444 3444
 			$csv_values = array_keys($arr_val[0]);
3445
-			array_pop($csv_values);   //removed header in csv file
3445
+			array_pop($csv_values); //removed header in csv file
3446 3446
 			fputcsv($fp, $csv_values);
3447 3447
 			foreach ($arr_val as $key => $array_value) {
3448 3448
 				array_pop($array_value); //removed action link
Please login to merge, or discard this patch.
Braces   +213 added lines, -161 removed lines patch added patch discarded remove patch
@@ -53,8 +53,9 @@  discard block
 block discarded – undo
53 53
 
54 54
 	protected function computeDependencies()
55 55
 	{
56
-		if ($this->computedMatrix !== null)
57
-			return;
56
+		if ($this->computedMatrix !== null) {
57
+					return;
58
+		}
58 59
 
59 60
 		$this->computedMatrix = array();
60 61
 		foreach ($this->matrix as $key => $values) {
@@ -93,8 +94,9 @@  discard block
 block discarded – undo
93 94
 
94 95
 	public function addTable($table)
95 96
 	{
96
-		if (!empty($table))
97
-			$this->tables[$table] = $table;
97
+		if (!empty($table)) {
98
+					$this->tables[$table] = $table;
99
+		}
98 100
 	}
99 101
 
100 102
 	public function addCustomTable($table)
@@ -613,8 +615,9 @@  discard block
 block discarded – undo
613 615
 			$access_fields[] = $collistrow["fieldname"];
614 616
 		}
615 617
 		//added to include ticketid for Reports module in select columnlist for all users
616
-		if ($module == "HelpDesk")
617
-			$access_fields[] = "ticketid";
618
+		if ($module == "HelpDesk") {
619
+					$access_fields[] = "ticketid";
620
+		}
618 621
 		return $access_fields;
619 622
 	}
620 623
 
@@ -690,8 +693,9 @@  discard block
 block discarded – undo
690 693
 				}
691 694
 				if ($ordercolumnsequal) {
692 695
 					$selectedfields = explode(":", $fieldcolname);
693
-					if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule)
694
-						$selectedfields[0] = "vtiger_crmentity";
696
+					if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) {
697
+											$selectedfields[0] = "vtiger_crmentity";
698
+					}
695 699
 					$sSQLList[] = $selectedfields[0] . "." . $selectedfields[1] . " '" . $selectedfields[2] . "'";
696 700
 				}
697 701
 			}
@@ -743,11 +747,12 @@  discard block
 block discarded – undo
743 747
 			if (trim($value) == 'NULL') {
744 748
 				$rtvalue = ' is NOT NULL';
745 749
 			} elseif (trim($value) != '') {
746
-				if ($columnName)
747
-					$rtvalue = ' <> ' . $adb->quote($value) . ' OR ' . $columnName . " IS NULL ";
748
-				else
749
-					$rtvalue = ' <> ' . $adb->quote($value);
750
-			}elseif (trim($value) == '' && $datatype == 'V') {
750
+				if ($columnName) {
751
+									$rtvalue = ' <> ' . $adb->quote($value) . ' OR ' . $columnName . " IS NULL ";
752
+				} else {
753
+									$rtvalue = ' <> ' . $adb->quote($value);
754
+				}
755
+			} elseif (trim($value) == '' && $datatype == 'V') {
751 756
 				$rtvalue = ' <> ' . $adb->quote($value);
752 757
 			} else {
753 758
 				$rtvalue = ' is NOT NULL';
@@ -878,8 +883,9 @@  discard block
 block discarded – undo
878 883
 
879 884
 			$result = $adb->pquery($ssql, array($reportid, $groupId));
880 885
 			$noOfColumns = $adb->num_rows($result);
881
-			if ($noOfColumns <= 0)
882
-				continue;
886
+			if ($noOfColumns <= 0) {
887
+							continue;
888
+			}
883 889
 
884 890
 			while ($relcriteriarow = $adb->fetch_array($result)) {
885 891
 				$columnIndex = $relcriteriarow["columnindex"];
@@ -903,8 +909,9 @@  discard block
 block discarded – undo
903 909
 			$i++;
904 910
 		}
905 911
 		// Clear the condition (and/or) for last group, if any.
906
-		if (!empty($advft_criteria[$i - 1]['condition']))
907
-			$advft_criteria[$i - 1]['condition'] = '';
912
+		if (!empty($advft_criteria[$i - 1]['condition'])) {
913
+					$advft_criteria[$i - 1]['condition'] = '';
914
+		}
908 915
 		return $advft_criteria;
909 916
 	}
910 917
 
@@ -1011,11 +1018,12 @@  discard block
 block discarded – undo
1011 1018
 									$end = getValidDBInsertDateTimeValue($date2);
1012 1019
 									$start = "'$start'";
1013 1020
 									$end = "'$end'";
1014
-									if ($comparator == 'e')
1015
-										$advfiltergroupsql .= "$tableColumnSql BETWEEN $start AND $end";
1016
-									else
1017
-										$advfiltergroupsql .= "$tableColumnSql NOT BETWEEN $start AND $end";
1018
-								}else if ($comparator == 'bw') {
1021
+									if ($comparator == 'e') {
1022
+																			$advfiltergroupsql .= "$tableColumnSql BETWEEN $start AND $end";
1023
+									} else {
1024
+																			$advfiltergroupsql .= "$tableColumnSql NOT BETWEEN $start AND $end";
1025
+									}
1026
+								} else if ($comparator == 'bw') {
1019 1027
 									$values = explode(',', $value);
1020 1028
 									$startDateTime = explode(' ', $values[0]);
1021 1029
 									$endDateTime = explode(' ', $values[1]);
@@ -1067,10 +1075,12 @@  discard block
 block discarded – undo
1067 1075
 						}
1068 1076
 						//Added to handle yes or no for checkbox  field in reports advance filters. -shahul
1069 1077
 						if ($selectedfields[4] == 'C') {
1070
-							if (strcasecmp(trim($value), "yes") == 0)
1071
-								$value = "1";
1072
-							if (strcasecmp(trim($value), "no") == 0)
1073
-								$value = "0";
1078
+							if (strcasecmp(trim($value), "yes") == 0) {
1079
+															$value = "1";
1080
+							}
1081
+							if (strcasecmp(trim($value), "no") == 0) {
1082
+															$value = "0";
1083
+							}
1074 1084
 						}
1075 1085
 						if (in_array($comparator, \App\CustomView::STD_FILTER_CONDITIONS)) {
1076 1086
 							$columninfo['stdfilter'] = $columninfo['comparator'];
@@ -1115,13 +1125,15 @@  discard block
 block discarded – undo
1115 1125
 										$advcolsql[] = "vtiger_troubletickets.status" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype);
1116 1126
 									} else if ($selectedfields[2] == 'Faq_Status') {
1117 1127
 										$advcolsql[] = "vtiger_faq.status" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype);
1118
-									} else
1119
-										$advcolsql[] = $selectedfields[0] . "." . $selectedfields[1] . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype);
1128
+									} else {
1129
+																			$advcolsql[] = $selectedfields[0] . "." . $selectedfields[1] . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype);
1130
+									}
1120 1131
 								} elseif ($selectedfields[1] == 'description') {//when you use comma seperated values.
1121
-									if ($selectedfields[0] == 'vtiger_crmentity' . $this->primarymodule)
1122
-										$advcolsql[] = "vtiger_crmentity.description" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype);
1123
-									else
1124
-										$advcolsql[] = $selectedfields[0] . "." . $selectedfields[1] . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype);
1132
+									if ($selectedfields[0] == 'vtiger_crmentity' . $this->primarymodule) {
1133
+																			$advcolsql[] = "vtiger_crmentity.description" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype);
1134
+									} else {
1135
+																			$advcolsql[] = $selectedfields[0] . "." . $selectedfields[1] . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype);
1136
+									}
1125 1137
 								} elseif ($selectedfields[2] == 'Quotes_Inventory_Manager') {
1126 1138
 									$advcolsql[] = ("trim($concatSql)" . $this->getAdvComparator($comparator, trim($valuearray[$n]), $datatype));
1127 1139
 								} elseif ($selectedfields[1] == 'modifiedby') {
@@ -1146,10 +1158,11 @@  discard block
 block discarded – undo
1146 1158
 								}
1147 1159
 							}
1148 1160
 							//If negative logic filter ('not equal to', 'does not contain') is used, 'and' condition should be applied instead of 'or'
1149
-							if ($comparator == 'n' || $comparator == 'k')
1150
-								$advcolumnsql = implode(" and ", $advcolsql);
1151
-							else
1152
-								$advcolumnsql = implode(" or ", $advcolsql);
1161
+							if ($comparator == 'n' || $comparator == 'k') {
1162
+															$advcolumnsql = implode(" and ", $advcolsql);
1163
+							} else {
1164
+															$advcolumnsql = implode(" or ", $advcolsql);
1165
+							}
1153 1166
 							$fieldvalue = " (" . $advcolumnsql . ") ";
1154 1167
 						} elseif ($selectedfields[1] == 'user_name') {
1155 1168
 							if ($selectedfields[0] == "vtiger_users" . $this->primarymodule) {
@@ -1229,18 +1242,20 @@  discard block
 block discarded – undo
1229 1242
 								$fieldvalue = "vtiger_activity.status" . $this->getAdvComparator($comparator, trim($value), $datatype);
1230 1243
 							}
1231 1244
 						} else if ($comparator == 'ny') {
1232
-							if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype']))
1233
-								$fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '' && " . $selectedfields[0] . "." . $selectedfields[1] . "  != '0')";
1234
-							else
1235
-								$fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '')";
1236
-						}elseif ($comparator == 'y' || ($comparator == 'e' && (trim($value) == "NULL" || trim($value) == ''))) {
1245
+							if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) {
1246
+															$fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '' && " . $selectedfields[0] . "." . $selectedfields[1] . "  != '0')";
1247
+							} else {
1248
+															$fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NOT NULL && " . $selectedfields[0] . "." . $selectedfields[1] . " != '')";
1249
+							}
1250
+						} elseif ($comparator == 'y' || ($comparator == 'e' && (trim($value) == "NULL" || trim($value) == ''))) {
1237 1251
 							if ($selectedfields[0] == 'vtiger_inventoryproductrel') {
1238 1252
 								$selectedfields[0] = 'vtiger_inventoryproductrel' . $moduleName;
1239 1253
 							}
1240
-							if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype']))
1241
-								$fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '' || " . $selectedfields[0] . "." . $selectedfields[1] . " = '0')";
1242
-							else
1243
-								$fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '')";
1254
+							if ($fieldInfo['uitype'] == '10' || isReferenceUIType($fieldInfo['uitype'])) {
1255
+															$fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '' || " . $selectedfields[0] . "." . $selectedfields[1] . " = '0')";
1256
+							} else {
1257
+															$fieldvalue = "(" . $selectedfields[0] . "." . $selectedfields[1] . " IS NULL || " . $selectedfields[0] . "." . $selectedfields[1] . " = '')";
1258
+							}
1244 1259
 						} elseif ($selectedfields[0] == 'vtiger_inventoryproductrel') {
1245 1260
 							if ($selectedfields[1] == 'productid') {
1246 1261
 								$fieldvalue = "vtiger_products$moduleName.productname " . $this->getAdvComparator($comparator, trim($value), $datatype);
@@ -1286,8 +1301,9 @@  discard block
 block discarded – undo
1286 1301
 				}
1287 1302
 			}
1288 1303
 		}
1289
-		if (trim($advfiltersql) != "")
1290
-			$advfiltersql = '(' . $advfiltersql . ')';
1304
+		if (trim($advfiltersql) != "") {
1305
+					$advfiltersql = '(' . $advfiltersql . ')';
1306
+		}
1291 1307
 
1292 1308
 		return $advfiltersql;
1293 1309
 	}
@@ -1342,8 +1358,9 @@  discard block
 block discarded – undo
1342 1358
 
1343 1359
 			if ($fieldcolname != "none") {
1344 1360
 				$selectedfields = explode(":", $fieldcolname);
1345
-				if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule)
1346
-					$selectedfields[0] = "vtiger_crmentity";
1361
+				if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) {
1362
+									$selectedfields[0] = "vtiger_crmentity";
1363
+				}
1347 1364
 
1348 1365
 				$moduleFieldLabel = $selectedfields[3];
1349 1366
 				list($moduleName, $fieldLabel) = explode('__', $moduleFieldLabel, 2);
@@ -1412,8 +1429,9 @@  discard block
 block discarded – undo
1412 1429
 	{
1413 1430
 		if ($filtercolumn != "none") {
1414 1431
 			$selectedfields = explode(":", $filtercolumn);
1415
-			if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule)
1416
-				$selectedfields[0] = "vtiger_crmentity";
1432
+			if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) {
1433
+							$selectedfields[0] = "vtiger_crmentity";
1434
+			}
1417 1435
 			if ($filter == "custom") {
1418 1436
 				if ($startdate != "0000-00-00" && $enddate != "0000-00-00" && $startdate != "" &&
1419 1437
 					$enddate != "" && $selectedfields[0] != "" && $selectedfields[1] != "") {
@@ -1446,8 +1464,9 @@  discard block
 block discarded – undo
1446 1464
 		if (!empty($advft_criteria)) {
1447 1465
 			foreach ($advft_criteria as $column_index => $column_condition) {
1448 1466
 
1449
-				if (empty($column_condition))
1450
-					continue;
1467
+				if (empty($column_condition)) {
1468
+									continue;
1469
+				}
1451 1470
 
1452 1471
 				$adv_filter_column = $column_condition["columnname"];
1453 1472
 				$adv_filter_comparator = $column_condition["comparator"];
@@ -1504,10 +1523,12 @@  discard block
 block discarded – undo
1504 1523
 			}
1505 1524
 
1506 1525
 			foreach ($advft_criteria_groups as $group_index => $group_condition_info) {
1507
-				if (empty($group_condition_info))
1508
-					continue;
1509
-				if (empty($advfilterlist[$group_index]))
1510
-					continue;
1526
+				if (empty($group_condition_info)) {
1527
+									continue;
1528
+				}
1529
+				if (empty($advfilterlist[$group_index])) {
1530
+									continue;
1531
+				}
1511 1532
 				$advfilterlist[$group_index]['condition'] = $group_condition_info["groupcondition"];
1512 1533
 				$noOfGroupColumns = count($advfilterlist[$group_index]['columns']);
1513 1534
 				if (!empty($advfilterlist[$group_index]['columns'][$noOfGroupColumns - 1]['column_condition'])) {
@@ -1549,8 +1570,9 @@  discard block
 block discarded – undo
1549 1570
 
1550 1571
 			if ($fieldcolname != "none") {
1551 1572
 				$selectedfields = explode(":", $fieldcolname);
1552
-				if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule)
1553
-					$selectedfields[0] = "vtiger_crmentity";
1573
+				if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) {
1574
+									$selectedfields[0] = "vtiger_crmentity";
1575
+				}
1554 1576
 				if ($datefilter == "custom") {
1555 1577
 
1556 1578
 					if ($startdate != "0000-00-00" && $enddate != "0000-00-00" && $selectedfields[0] != "" && $selectedfields[1] != "" && $startdate != '' && $enddate != '') {
@@ -1639,8 +1661,9 @@  discard block
 block discarded – undo
1639 1661
 
1640 1662
 			if ($fieldcolname != "none") {
1641 1663
 				$selectedfields = explode(":", $fieldcolname);
1642
-				if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule)
1643
-					$selectedfields[0] = "vtiger_crmentity";
1664
+				if ($selectedfields[0] == "vtiger_crmentity" . $this->primarymodule) {
1665
+									$selectedfields[0] = "vtiger_crmentity";
1666
+				}
1644 1667
 				if (stripos($selectedfields[1], 'cf_') == 0 && stristr($selectedfields[1], 'cf_') === true) {
1645 1668
 					//In sql queries forward slash(/) is treated as query terminator,so to avoid this problem
1646 1669
 					//the column names are enclosed within ('[]'),which will treat this as part of column name
@@ -1733,8 +1756,9 @@  discard block
 block discarded – undo
1733 1756
 					$sSQL .= ', ';
1734 1757
 					$this->orderbylistsql .= ', ';
1735 1758
 				}
1736
-				if ($selectedfields[0] == 'vtiger_crmentity' . $this->primarymodule)
1737
-					$selectedfields[0] = 'vtiger_crmentity';
1759
+				if ($selectedfields[0] == 'vtiger_crmentity' . $this->primarymodule) {
1760
+									$selectedfields[0] = 'vtiger_crmentity';
1761
+				}
1738 1762
 				$sSQL .= $selectedfields[0] . '.' . $selectedfields[1] . ' ' . $sortorder;
1739 1763
 				$this->orderbylistsql .= $selectedfields[0] . '.' . $selectedfields[1] . ' ' . $selectedfields[2];
1740 1764
 			}
@@ -2357,8 +2381,9 @@  discard block
 block discarded – undo
2357 2381
 		}
2358 2382
 		/* STRING TRANSLATION starts */
2359 2383
 		$moduleLabel = '';
2360
-		if (in_array($module, $modules_selected))
2361
-			$moduleLabel = \App\Language::translate($module, $module);
2384
+		if (in_array($module, $modules_selected)) {
2385
+					$moduleLabel = \App\Language::translate($module, $module);
2386
+		}
2362 2387
 
2363 2388
 		if (empty($translatedLabel)) {
2364 2389
 			$translatedLabel = \App\Language::translate(str_replace('__', " ", $fld->name), $module);
@@ -2438,8 +2463,9 @@  discard block
 block discarded – undo
2438 2463
 			}
2439 2464
 			// END
2440 2465
 
2441
-			if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1)
2442
-				$picklistarray = $this->getAccessPickListValues();
2466
+			if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) {
2467
+							$picklistarray = $this->getAccessPickListValues();
2468
+			}
2443 2469
 			if ($result) {
2444 2470
 				$y = $adb->getFieldsCount($result);
2445 2471
 				$arrayHeaders = Array();
@@ -2473,10 +2499,11 @@  discard block
 block discarded – undo
2473 2499
 							$headerLabel_tmp = \App\Language::translate($mod_name[0] . " " . $mod_name[1]);
2474 2500
 						}
2475 2501
 					}
2476
-					if ($headerLabel == $headerLabel_tmp)
2477
-						$headerLabel = \App\Language::translate($headerLabel_tmp);
2478
-					else
2479
-						$headerLabel = $headerLabel_tmp;
2502
+					if ($headerLabel == $headerLabel_tmp) {
2503
+											$headerLabel = \App\Language::translate($headerLabel_tmp);
2504
+					} else {
2505
+											$headerLabel = $headerLabel_tmp;
2506
+					}
2480 2507
 					/* STRING TRANSLATION ends */
2481 2508
 					$header .= "<td class='rptCellLabel'>" . $headerLabel . "</td>";
2482 2509
 
@@ -2512,14 +2539,17 @@  discard block
 block discarded – undo
2512 2539
 						$snewvalue = $custom_field_values[1];
2513 2540
 						$tnewvalue = $custom_field_values[2];
2514 2541
 					}
2515
-					if ($newvalue == "")
2516
-						$newvalue = "-";
2542
+					if ($newvalue == "") {
2543
+											$newvalue = "-";
2544
+					}
2517 2545
 
2518
-					if ($snewvalue == "")
2519
-						$snewvalue = "-";
2546
+					if ($snewvalue == "") {
2547
+											$snewvalue = "-";
2548
+					}
2520 2549
 
2521
-					if ($tnewvalue == "")
2522
-						$tnewvalue = "-";
2550
+					if ($tnewvalue == "") {
2551
+											$tnewvalue = "-";
2552
+					}
2523 2553
 
2524 2554
 					$valtemplate .= "<tr>";
2525 2555
 
@@ -2645,8 +2675,9 @@  discard block
 block discarded – undo
2645 2675
 		} elseif ($outputformat == "PDF") {
2646 2676
 			$sSQL = $this->sGetSQLforReport($this->reportid, $filtersql, $outputformat, false, $startLimit, $endLimit);
2647 2677
 			$result = $adb->pquery($sSQL, array());
2648
-			if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1)
2649
-				$picklistarray = $this->getAccessPickListValues();
2678
+			if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) {
2679
+							$picklistarray = $this->getAccessPickListValues();
2680
+			}
2650 2681
 
2651 2682
 			if ($result) {
2652 2683
 				$y = $adb->getFieldsCount($result);
@@ -2736,45 +2767,49 @@  discard block
 block discarded – undo
2736 2767
 						$value = trim($key);
2737 2768
 						$arraykey = $value . '__SUM';
2738 2769
 						if (isset($keyhdr[$arraykey])) {
2739
-							if ($convert_price)
2740
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2741
-							else
2742
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2770
+							if ($convert_price) {
2771
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2772
+							} else {
2773
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2774
+							}
2743 2775
 							$totalpdf[$rowcount][$arraykey] = $conv_value;
2744
-						}else {
2776
+						} else {
2745 2777
 							$totalpdf[$rowcount][$arraykey] = '';
2746 2778
 						}
2747 2779
 
2748 2780
 						$arraykey = $value . '__AVG';
2749 2781
 						if (isset($keyhdr[$arraykey])) {
2750
-							if ($convert_price)
2751
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2752
-							else
2753
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2782
+							if ($convert_price) {
2783
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2784
+							} else {
2785
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2786
+							}
2754 2787
 							$totalpdf[$rowcount][$arraykey] = $conv_value;
2755
-						}else {
2788
+						} else {
2756 2789
 							$totalpdf[$rowcount][$arraykey] = '';
2757 2790
 						}
2758 2791
 
2759 2792
 						$arraykey = $value . '__MIN';
2760 2793
 						if (isset($keyhdr[$arraykey])) {
2761
-							if ($convert_price)
2762
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2763
-							else
2764
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2794
+							if ($convert_price) {
2795
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2796
+							} else {
2797
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2798
+							}
2765 2799
 							$totalpdf[$rowcount][$arraykey] = $conv_value;
2766
-						}else {
2800
+						} else {
2767 2801
 							$totalpdf[$rowcount][$arraykey] = '';
2768 2802
 						}
2769 2803
 
2770 2804
 						$arraykey = $value . '__MAX';
2771 2805
 						if (isset($keyhdr[$arraykey])) {
2772
-							if ($convert_price)
2773
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2774
-							else
2775
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2806
+							if ($convert_price) {
2807
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2808
+							} else {
2809
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2810
+							}
2776 2811
 							$totalpdf[$rowcount][$arraykey] = $conv_value;
2777
-						}else {
2812
+						} else {
2778 2813
 							$totalpdf[$rowcount][$arraykey] = '';
2779 2814
 						}
2780 2815
 						$rowcount++;
@@ -2848,45 +2883,49 @@  discard block
 block discarded – undo
2848 2883
 						$value = trim($key);
2849 2884
 						$arraykey = $value . '__SUM';
2850 2885
 						if (isset($keyhdr[$arraykey])) {
2851
-							if ($convert_price)
2852
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2853
-							else
2854
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2886
+							if ($convert_price) {
2887
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2888
+							} else {
2889
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2890
+							}
2855 2891
 							$coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>';
2856
-						}else {
2892
+						} else {
2857 2893
 							$coltotalhtml .= '<td class="rptTotal">&nbsp;</td>';
2858 2894
 						}
2859 2895
 
2860 2896
 						$arraykey = $value . '__AVG';
2861 2897
 						if (isset($keyhdr[$arraykey])) {
2862
-							if ($convert_price)
2863
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2864
-							else
2865
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2898
+							if ($convert_price) {
2899
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2900
+							} else {
2901
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2902
+							}
2866 2903
 							$coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>';
2867
-						}else {
2904
+						} else {
2868 2905
 							$coltotalhtml .= '<td class="rptTotal">&nbsp;</td>';
2869 2906
 						}
2870 2907
 
2871 2908
 						$arraykey = $value . '__MIN';
2872 2909
 						if (isset($keyhdr[$arraykey])) {
2873
-							if ($convert_price)
2874
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2875
-							else
2876
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2910
+							if ($convert_price) {
2911
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2912
+							} else {
2913
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2914
+							}
2877 2915
 							$coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>';
2878
-						}else {
2916
+						} else {
2879 2917
 							$coltotalhtml .= '<td class="rptTotal">&nbsp;</td>';
2880 2918
 						}
2881 2919
 
2882 2920
 						$arraykey = $value . '__MAX';
2883 2921
 						if (isset($keyhdr[$arraykey])) {
2884
-							if ($convert_price)
2885
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2886
-							else
2887
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2922
+							if ($convert_price) {
2923
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
2924
+							} else {
2925
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
2926
+							}
2888 2927
 							$coltotalhtml .= '<td class="rptTotal">' . $conv_value . '</td>';
2889
-						}else {
2928
+						} else {
2890 2929
 							$coltotalhtml .= '<td class="rptTotal">&nbsp;</td>';
2891 2930
 						}
2892 2931
 
@@ -2914,8 +2953,9 @@  discard block
 block discarded – undo
2914 2953
 		} elseif ($outputformat == "PRINT") {
2915 2954
 			$sSQL = $this->sGetSQLforReport($this->reportid, $filtersql, $outputformat);
2916 2955
 			$result = $adb->query($sSQL);
2917
-			if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1)
2918
-				$picklistarray = $this->getAccessPickListValues();
2956
+			if ($is_admin === false && $profileGlobalPermission[1] == 1 && $profileGlobalPermission[2] == 1) {
2957
+							$picklistarray = $this->getAccessPickListValues();
2958
+			}
2919 2959
 
2920 2960
 			if ($result) {
2921 2961
 				$y = $adb->getFieldsCount($result);
@@ -2944,14 +2984,17 @@  discard block
 block discarded – undo
2944 2984
 						$tnewvalue = $custom_field_values[2];
2945 2985
 					}
2946 2986
 
2947
-					if ($newvalue == "")
2948
-						$newvalue = "-";
2987
+					if ($newvalue == "") {
2988
+											$newvalue = "-";
2989
+					}
2949 2990
 
2950
-					if ($snewvalue == "")
2951
-						$snewvalue = "-";
2991
+					if ($snewvalue == "") {
2992
+											$snewvalue = "-";
2993
+					}
2952 2994
 
2953
-					if ($tnewvalue == "")
2954
-						$tnewvalue = "-";
2995
+					if ($tnewvalue == "") {
2996
+											$tnewvalue = "-";
2997
+					}
2955 2998
 
2956 2999
 					$valtemplate .= "<tr>";
2957 3000
 
@@ -3053,45 +3096,49 @@  discard block
 block discarded – undo
3053 3096
 						$value = trim($key);
3054 3097
 						$arraykey = $value . '__SUM';
3055 3098
 						if (isset($keyhdr[$arraykey])) {
3056
-							if ($convert_price)
3057
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
3058
-							else
3059
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3099
+							if ($convert_price) {
3100
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
3101
+							} else {
3102
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3103
+							}
3060 3104
 							$coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>';
3061
-						}else {
3105
+						} else {
3062 3106
 							$coltotalhtml .= "<td class='rptTotal'>&nbsp;</td>";
3063 3107
 						}
3064 3108
 
3065 3109
 						$arraykey = $value . '__AVG';
3066 3110
 						if (isset($keyhdr[$arraykey])) {
3067
-							if ($convert_price)
3068
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
3069
-							else
3070
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3111
+							if ($convert_price) {
3112
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
3113
+							} else {
3114
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3115
+							}
3071 3116
 							$coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>';
3072
-						}else {
3117
+						} else {
3073 3118
 							$coltotalhtml .= "<td class='rptTotal'>&nbsp;</td>";
3074 3119
 						}
3075 3120
 
3076 3121
 						$arraykey = $value . '__MIN';
3077 3122
 						if (isset($keyhdr[$arraykey])) {
3078
-							if ($convert_price)
3079
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
3080
-							else
3081
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3123
+							if ($convert_price) {
3124
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
3125
+							} else {
3126
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3127
+							}
3082 3128
 							$coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>';
3083
-						}else {
3129
+						} else {
3084 3130
 							$coltotalhtml .= "<td class='rptTotal'>&nbsp;</td>";
3085 3131
 						}
3086 3132
 
3087 3133
 						$arraykey = $value . '__MAX';
3088 3134
 						if (isset($keyhdr[$arraykey])) {
3089
-							if ($convert_price)
3090
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
3091
-							else
3092
-								$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3135
+							if ($convert_price) {
3136
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey]);
3137
+							} else {
3138
+															$conv_value = CurrencyField::convertToUserFormat($keyhdr[$arraykey], null, true);
3139
+							}
3093 3140
 							$coltotalhtml .= "<td class='rptTotal'>" . $conv_value . '</td>';
3094
-						}else {
3141
+						} else {
3095 3142
 							$coltotalhtml .= "<td class='rptTotal'>&nbsp;</td>";
3096 3143
 						}
3097 3144
 
@@ -3346,8 +3393,9 @@  discard block
 block discarded – undo
3346 3393
 		$adb = PearDatabase::getInstance();
3347 3394
 		$current_user = vglobal('current_user');
3348 3395
 		$id = array(\App\Module::getModuleId($this->primarymodule));
3349
-		if ($this->secondarymodule != '')
3350
-			array_push($id, \App\Module::getModuleId($this->secondarymodule));
3396
+		if ($this->secondarymodule != '') {
3397
+					array_push($id, \App\Module::getModuleId($this->secondarymodule));
3398
+		}
3351 3399
 
3352 3400
 		$query = sprintf('select fieldname,columnname,fieldid,fieldlabel,tabid,uitype from vtiger_field where tabid in(%s) and uitype in (15,33,55)', generateQuestionMarks($id)); //and columnname in (?)';
3353 3401
 		$result = $adb->pquery($query, $id); //,$select_column));
@@ -3376,13 +3424,15 @@  discard block
 block discarded – undo
3376 3424
 			} else {
3377 3425
 				$mulsel = "select distinct $fieldname from vtiger_$fieldname inner join vtiger_role2picklist on vtiger_role2picklist.picklistvalueid = vtiger_$fieldname.picklist_valueid where roleid ='" . $roleid . "' and picklistid in (select picklistid from vtiger_$fieldname)"; // order by sortid asc - not requried
3378 3426
 			}
3379
-			if ($fieldname != 'firstname')
3380
-				$mulselresult = $adb->query($mulsel);
3427
+			if ($fieldname != 'firstname') {
3428
+							$mulselresult = $adb->query($mulsel);
3429
+			}
3381 3430
 			$countMulSelResult = $adb->num_rows($mulselresult);
3382 3431
 			for ($j = 0; $j < $countMulSelResult; $j++) {
3383 3432
 				$fldvalue = $adb->query_result($mulselresult, $j, $fieldname);
3384
-				if (in_array($fldvalue, $fieldvalues))
3385
-					continue;
3433
+				if (in_array($fldvalue, $fieldvalues)) {
3434
+									continue;
3435
+				}
3386 3436
 				$fieldvalues[] = $fldvalue;
3387 3437
 			}
3388 3438
 			$field_count = count($fieldvalues);
@@ -3393,16 +3443,18 @@  discard block
 block discarded – undo
3393 3443
 						$temp_status[$keyvalue][($temp_count + $t)] = $fieldvalues[$t];
3394 3444
 					}
3395 3445
 					$fieldvalues = $temp_status[$keyvalue];
3396
-				} else
3397
-					$temp_status[$keyvalue] = $fieldvalues;
3446
+				} else {
3447
+									$temp_status[$keyvalue] = $fieldvalues;
3448
+				}
3398 3449
 			}
3399 3450
 
3400
-			if ($uitype == 33)
3401
-				$fieldlists[1][$keyvalue] = $fieldvalues;
3402
-			else if ($uitype == 55 && $fieldname == 'salutationtype')
3403
-				$fieldlists[$keyvalue] = $fieldvalues;
3404
-			else if ($uitype == 15)
3405
-				$fieldlists[$keyvalue] = $fieldvalues;
3451
+			if ($uitype == 33) {
3452
+							$fieldlists[1][$keyvalue] = $fieldvalues;
3453
+			} else if ($uitype == 55 && $fieldname == 'salutationtype') {
3454
+							$fieldlists[$keyvalue] = $fieldvalues;
3455
+			} else if ($uitype == 15) {
3456
+							$fieldlists[$keyvalue] = $fieldvalues;
3457
+			}
3406 3458
 		}
3407 3459
 		return $fieldlists;
3408 3460
 	}
Please login to merge, or discard this patch.
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.