Completed
Push — developer ( 51f696...681523 )
by Błażej
549:36 queued 490:16
created
modules/com_vtiger_workflow/VTWorkflowUtils.php 1 patch
Doc Comments   +4 added lines patch added patch discarded remove patch
@@ -108,6 +108,7 @@  discard block
 block discarded – undo
108 108
 
109 109
 	/**
110 110
 	 * Insert redirection script
111
+	 * @param string $to
111 112
 	 */
112 113
 	public function redirectTo($to, $message)
113 114
 	{
@@ -132,6 +133,9 @@  discard block
 block discarded – undo
132 133
 	 * @params :: $modulename - name of the module
133 134
 	 */
134 135
 
136
+	/**
137
+	 * @param boolean $modulename
138
+	 */
135 139
 	public static function checkModuleWorkflow($modulename)
136 140
 	{
137 141
 		$adb = PearDatabase::getInstance();
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/WorkFlowScheduler.php 2 patches
Doc Comments   +4 added lines, -1 removed lines patch added patch discarded remove patch
@@ -126,6 +126,9 @@  discard block
 block discarded – undo
126 126
 		$scheduledWorkflows = null;
127 127
 	}
128 128
 
129
+	/**
130
+	 * @param QueryGenerator $queryGenerator
131
+	 */
129 132
 	public function addWorkflowConditionsToQueryGenerator($queryGenerator, $conditions)
130 133
 	{
131 134
 		$conditionMapping = array(
@@ -232,7 +235,7 @@  discard block
 block discarded – undo
232 235
 	/**
233 236
 	 * Function parse the value based on the condition
234 237
 	 * @param <Array> $condition
235
-	 * @return <String>
238
+	 * @return string
236 239
 	 */
237 240
 	public function _parseValueForDate($condition)
238 241
 	{
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -175,8 +175,9 @@
 block discarded – undo
175 175
 				$operation = $condition['operation'];
176 176
 
177 177
 				//Cannot handle this condition for scheduled workflows
178
-				if ($operation == 'has changed')
179
-					continue;
178
+				if ($operation == 'has changed') {
179
+									continue;
180
+				}
180 181
 
181 182
 				$value = $condition['value'];
182 183
 				if (in_array($operation, $this->_specialDateTimeOperator())) {
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.