Completed
Push — developer ( 17749e...f48bb9 )
by Błażej
246:54 queued 202:57
created
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
@@ -180,16 +180,18 @@  discard block
 block discarded – undo
180 180
 		$filepart = $file_details['part'];
181 181
 		$transfer = $file_details['transfer'];
182 182
 		$file = imap_fetchbody($mail, $_REQUEST['mailid'], $filepart);
183
-		if ($transfer == 'BASE64')
184
-			$file = imap_base64($file);
185
-		elseif ($transfer == 'QUOTED-PRINTABLE')
186
-			$file = imap_qprint($file);
183
+		if ($transfer == 'BASE64') {
184
+					$file = imap_base64($file);
185
+		} elseif ($transfer == 'QUOTED-PRINTABLE') {
186
+					$file = imap_qprint($file);
187
+		}
187 188
 		$current_id = $adb->getUniqueID("vtiger_crmentity");
188 189
 		$date_var = date('Y-m-d H:i:s');
189 190
 		//to get the owner id
190 191
 		$ownerid = $this->column_fields['assigned_user_id'];
191
-		if (!isset($ownerid) || $ownerid == '')
192
-			$ownerid = $current_user->id;
192
+		if (!isset($ownerid) || $ownerid == '') {
193
+					$ownerid = $current_user->id;
194
+		}
193 195
 		$upload_file_path = \vtlib\Functions::initStorageFileDirectory();
194 196
 		file_put_contents($upload_file_path . $current_id . "_" . $filename, $file);
195 197
 
@@ -239,8 +241,9 @@  discard block
 block discarded – undo
239 241
 		$button = '';
240 242
 
241 243
 		if ($actions) {
242
-			if (is_string($actions))
243
-				$actions = explode(',', strtoupper($actions));
244
+			if (is_string($actions)) {
245
+							$actions = explode(',', strtoupper($actions));
246
+			}
244 247
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
245 248
 				$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;";
246 249
 			}
@@ -277,8 +280,9 @@  discard block
 block discarded – undo
277 280
 
278 281
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
279 282
 
280
-		if ($return_value == null)
281
-			$return_value = Array();
283
+		if ($return_value == null) {
284
+					$return_value = Array();
285
+		}
282 286
 		$return_value['CUSTOM_BUTTON'] = $button;
283 287
 
284 288
 		$log->debug("Exiting get_contacts method ...");
@@ -294,10 +298,11 @@  discard block
 block discarded – undo
294 298
 	{
295 299
 		$log = vglobal('log');
296 300
 		$log->debug("Entering getSortOrder() method ...");
297
-		if (isset($_REQUEST['sorder']))
298
-			$sorder = $this->db->sql_escape_string($_REQUEST['sorder']);
299
-		else
300
-			$sorder = (($_SESSION['EMAILS_SORT_ORDER'] != '') ? ($_SESSION['EMAILS_SORT_ORDER']) : ($this->default_sort_order));
301
+		if (isset($_REQUEST['sorder'])) {
302
+					$sorder = $this->db->sql_escape_string($_REQUEST['sorder']);
303
+		} else {
304
+					$sorder = (($_SESSION['EMAILS_SORT_ORDER'] != '') ? ($_SESSION['EMAILS_SORT_ORDER']) : ($this->default_sort_order));
305
+		}
301 306
 
302 307
 		$log->debug("Exiting getSortOrder method ...");
303 308
 		return $sorder;
@@ -318,10 +323,11 @@  discard block
 block discarded – undo
318 323
 			$use_default_order_by = $this->default_order_by;
319 324
 		}
320 325
 
321
-		if (isset($_REQUEST['order_by']))
322
-			$order_by = $this->db->sql_escape_string($_REQUEST['order_by']);
323
-		else
324
-			$order_by = (($_SESSION['EMAILS_ORDER_BY'] != '') ? ($_SESSION['EMAILS_ORDER_BY']) : ($use_default_order_by));
326
+		if (isset($_REQUEST['order_by'])) {
327
+					$order_by = $this->db->sql_escape_string($_REQUEST['order_by']);
328
+		} else {
329
+					$order_by = (($_SESSION['EMAILS_ORDER_BY'] != '') ? ($_SESSION['EMAILS_ORDER_BY']) : ($use_default_order_by));
330
+		}
325 331
 
326 332
 		$log->debug("Exiting getOrderBy method ...");
327 333
 		return $order_by;
@@ -376,25 +382,31 @@  discard block
 block discarded – undo
376 382
 			$entries[] = $row['user_name'];
377 383
 			$entries[] = $row['email1'];
378 384
 			$entries[] = $row['phone_home'];
379
-			if ($phone == '')
380
-				$phone = $row['phone_work'];
381
-			if ($phone == '')
382
-				$phone = $row['phone_mobile'];
383
-			if ($phone == '')
384
-				$phone = $row['phone_other'];
385
-			if ($phone == '')
386
-				$phone = $row['phone_fax'];
385
+			if ($phone == '') {
386
+							$phone = $row['phone_work'];
387
+			}
388
+			if ($phone == '') {
389
+							$phone = $row['phone_mobile'];
390
+			}
391
+			if ($phone == '') {
392
+							$phone = $row['phone_other'];
393
+			}
394
+			if ($phone == '') {
395
+							$phone = $row['phone_fax'];
396
+			}
387 397
 
388 398
 			//Adding Security Check for User
389 399
 
390 400
 			$entries_list[] = $entries;
391 401
 		}
392 402
 
393
-		if ($entries_list != '')
394
-			$return_data = array("header" => $header, "entries" => $entries);
403
+		if ($entries_list != '') {
404
+					$return_data = array("header" => $header, "entries" => $entries);
405
+		}
395 406
 
396
-		if ($return_data == null)
397
-			$return_data = Array();
407
+		if ($return_data == null) {
408
+					$return_data = Array();
409
+		}
398 410
 		$return_data['CUSTOM_BUTTON'] = $button;
399 411
 
400 412
 		$log->debug("Exiting get_users method ...");
@@ -630,8 +642,9 @@  discard block
 block discarded – undo
630 642
 	$date_var = date('Y-m-d H:i:s');
631 643
 
632 644
 	$ownerid = $obj->column_fields['assigned_user_id'];
633
-	if (!isset($ownerid) || $ownerid == '')
634
-		$ownerid = $current_user->id;
645
+	if (!isset($ownerid) || $ownerid == '') {
646
+			$ownerid = $current_user->id;
647
+	}
635 648
 
636 649
 	$current_id = $adb->getUniqueID("vtiger_crmentity");
637 650
 
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 2 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   +17 added lines, -12 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
 	}
@@ -62,8 +63,9 @@  discard block
 block discarded – undo
62 63
 			$sql .= " && vtiger_troubletickets.status NOT IN ('$ticketStatusSearch')";
63 64
 			$this->conditions = ['vtiger_troubletickets.status', "'$ticketStatusSearch'", 'nin', QueryGenerator::$AND];
64 65
 		}
65
-		if (!empty($securityParameter))
66
-			$sql .= $securityParameter;
66
+		if (!empty($securityParameter)) {
67
+					$sql .= $securityParameter;
68
+		}
67 69
 
68 70
 
69 71
 		$sql .= ' GROUP BY statusvalue, priority ORDER BY vtiger_ticketstatus.sortorderid';
@@ -78,8 +80,9 @@  discard block
 block discarded – undo
78 80
 				$priorities[$row['priority']] = $counter++;
79 81
 				$colors[$row['priority']] = $row['color'];
80 82
 			}
81
-			if (!in_array($row['statusvalue'], $status))
82
-				$status[] = $row['statusvalue'];
83
+			if (!in_array($row['statusvalue'], $status)) {
84
+							$status[] = $row['statusvalue'];
85
+			}
83 86
 		}
84 87
 		if (!empty($tickets)) {
85 88
 			$counter = 0;
@@ -123,13 +126,15 @@  discard block
 block discarded – undo
123 126
 		$data = $request->get('data');
124 127
 		$createdTime = $request->get('createdtime');
125 128
 		$widget = Vtiger_Widget_Model::getInstance($linkId, $currentUser->getId());
126
-		if (!$request->has('owner'))
127
-			$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, $moduleName);
128
-		else
129
-			$owner = $request->get('owner');
129
+		if (!$request->has('owner')) {
130
+					$owner = Settings_WidgetsManagement_Module_Model::getDefaultUserId($widget, $moduleName);
131
+		} else {
132
+					$owner = $request->get('owner');
133
+		}
130 134
 		$ownerForwarded = $owner;
131
-		if ($owner == 'all')
132
-			$owner = '';
135
+		if ($owner == 'all') {
136
+					$owner = '';
137
+		}
133 138
 
134 139
 		//Date conversion from user to database format
135 140
 		if (!empty($createdTime)) {
Please login to merge, or discard this patch.
modules/Import/views/Main.php 1 patch
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -27,6 +27,9 @@  discard block
 block discarded – undo
27 27
 		$this->user = $user;
28 28
 	}
29 29
 
30
+	/**
31
+	 * @param Vtiger_Request $request
32
+	 */
30 33
 	public static function import($request, $user)
31 34
 	{
32 35
 		$importController = new Import_Main_View($request, $user);
@@ -100,6 +103,9 @@  discard block
 block discarded – undo
100 103
 		}
101 104
 	}
102 105
 
106
+	/**
107
+	 * @param boolean $continueImport
108
+	 */
103 109
 	public static function showCurrentStatus($importInfo, $importStatusCount, $continueImport)
104 110
 	{
105 111
 		$moduleName = $importInfo['module'];
@@ -210,6 +216,9 @@  discard block
 block discarded – undo
210 216
 		Import_Queue_Action::add($this->request, $this->user);
211 217
 	}
212 218
 
219
+	/**
220
+	 * @param Vtiger_Request $request
221
+	 */
213 222
 	public static function deleteMap($request)
214 223
 	{
215 224
 		$moduleName = $request->getModule();
Please login to merge, or discard this patch.
modules/ModComments/ModComments.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@
 block discarded – undo
59 59
 
60 60
 	/**
61 61
 	 * Add widget to other module.
62
-	 * @param unknown_type $moduleNames
62
+	 * @param string[] $moduleNames
63 63
 	 * @return unknown_type
64 64
 	 */
65 65
 	static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
Please login to merge, or discard this patch.
Braces   +12 added lines, -8 removed lines patch added patch discarded remove patch
@@ -64,11 +64,13 @@  discard block
 block discarded – undo
64 64
 	 */
65 65
 	static function addWidgetTo($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
66 66
 	{
67
-		if (empty($moduleNames))
68
-			return;
67
+		if (empty($moduleNames)) {
68
+					return;
69
+		}
69 70
 
70
-		if (is_string($moduleNames))
71
-			$moduleNames = array($moduleNames);
71
+		if (is_string($moduleNames)) {
72
+					$moduleNames = array($moduleNames);
73
+		}
72 74
 
73 75
 		$commentWidgetModules = array();
74 76
 		foreach ($moduleNames as $moduleName) {
@@ -95,11 +97,13 @@  discard block
 block discarded – undo
95 97
 	 */
96 98
 	static function removeWidgetFrom($moduleNames, $widgetType = 'DETAILVIEWWIDGET', $widgetName = 'DetailViewBlockCommentWidget')
97 99
 	{
98
-		if (empty($moduleNames))
99
-			return;
100
+		if (empty($moduleNames)) {
101
+					return;
102
+		}
100 103
 
101
-		if (is_string($moduleNames))
102
-			$moduleNames = array($moduleNames);
104
+		if (is_string($moduleNames)) {
105
+					$moduleNames = array($moduleNames);
106
+		}
103 107
 
104 108
 		$commentWidgetModules = array();
105 109
 		foreach ($moduleNames as $moduleName) {
Please login to merge, or discard this patch.
modules/OSSEmployees/OSSEmployees.php 2 patches
Doc Comments   +7 added lines patch added patch discarded remove patch
@@ -149,6 +149,10 @@  discard block
 block discarded – undo
149 149
 		return $hierarchy;
150 150
 	}
151 151
 
152
+	/**
153
+	 * @param integer $id
154
+	 * @param integer[] $encountered_accounts
155
+	 */
152 156
 	public function __getParentEmployees($id, &$parent_accounts, &$encountered_accounts)
153 157
 	{
154 158
 		$adb = PearDatabase::getInstance();
@@ -200,6 +204,9 @@  discard block
 block discarded – undo
200 204
 		return $parent_accounts;
201 205
 	}
202 206
 
207
+	/**
208
+	 * @param integer $id
209
+	 */
203 210
 	public function __getChildEmployees($id, &$child_accounts, $depth)
204 211
 	{
205 212
 		$adb = PearDatabase::getInstance();
Please login to merge, or discard this patch.
Braces   +14 added lines, -10 removed lines patch added patch discarded remove patch
@@ -284,16 +284,18 @@  discard block
 block discarded – undo
284 284
 
285 285
 
286 286
 
287
-		if ($singlepane_view == 'true')
288
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
289
-		else
290
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
287
+		if ($singlepane_view == 'true') {
288
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
289
+		} else {
290
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
291
+		}
291 292
 
292 293
 		$button = '';
293 294
 
294 295
 		if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'parent_id', 'readwrite') == '0') {
295
-			if (is_string($actions))
296
-				$actions = explode(',', strtoupper($actions));
296
+			if (is_string($actions)) {
297
+							$actions = explode(',', strtoupper($actions));
298
+			}
297 299
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
298 300
 				$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;";
299 301
 			}
@@ -316,8 +318,9 @@  discard block
 block discarded – undo
316 318
 				WHERE  vtiger_crmentity.deleted = 0 && vtiger_crmentity.`smownerid`= " . $userId;
317 319
 
318 320
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
319
-		if ($return_value == null)
320
-			$return_value = Array();
321
+		if ($return_value == null) {
322
+					$return_value = Array();
323
+		}
321 324
 		$return_value['CUSTOM_BUTTON'] = $button;
322 325
 		$log->debug("Exiting get_osstimecontrol method ...");
323 326
 		return $return_value;
@@ -336,8 +339,9 @@  discard block
 block discarded – undo
336 339
 			$modcommentsModuleInstance = vtlib\Module::getInstance('ModComments');
337 340
 			if ($modcommentsModuleInstance && file_exists('modules/ModComments/ModComments.php')) {
338 341
 				include_once 'modules/ModComments/ModComments.php';
339
-				if (class_exists('ModComments'))
340
-					ModComments::addWidgetTo(array('OSSEmployees'));
342
+				if (class_exists('ModComments')) {
343
+									ModComments::addWidgetTo(array('OSSEmployees'));
344
+				}
341 345
 			}
342 346
 			// blok EH
343 347
 		} else if ($event_type == 'module.disabled') {
Please login to merge, or discard this patch.
modules/PaymentsIn/helpers/mt940.php 2 patches
Doc Comments   +15 added lines patch added patch discarded remove patch
@@ -50,6 +50,9 @@  discard block
 block discarded – undo
50 50
 		return $xml;
51 51
 	}
52 52
 
53
+	/**
54
+	 * @param integer $level
55
+	 */
53 56
 	protected function createXML($key, $value, $level)
54 57
 	{
55 58
 		$indent = '';
@@ -69,6 +72,9 @@  discard block
 block discarded – undo
69 72
 		return $xml;
70 73
 	}
71 74
 
75
+	/**
76
+	 * @param string $line
77
+	 */
72 78
 	protected function parseLine($line)
73 79
 	{
74 80
 		$tag = substr($line, 1, strpos($line, ':', 1) - 1);
@@ -114,6 +120,9 @@  discard block
 block discarded – undo
114 120
 		$this->_lastTag = $tag;
115 121
 	}
116 122
 
123
+	/**
124
+	 * @param string $value
125
+	 */
117 126
 	protected function parseOperation($value)
118 127
 	{
119 128
 		$this->operations[] = array(
@@ -124,6 +133,9 @@  discard block
 block discarded – undo
124 133
 		);
125 134
 	}
126 135
 
136
+	/**
137
+	 * @param string $value
138
+	 */
127 139
 	protected function parseBalance($value)
128 140
 	{
129 141
 		return array(
@@ -134,6 +146,9 @@  discard block
 block discarded – undo
134 146
 		);
135 147
 	}
136 148
 
149
+	/**
150
+	 * @param string $value
151
+	 */
137 152
 	protected function parseTransaction($value)
138 153
 	{
139 154
 		$transaction = array(
Please login to merge, or discard this patch.
Braces   +19 added lines, -14 removed lines patch added patch discarded remove patch
@@ -34,8 +34,9 @@  discard block
 block discarded – undo
34 34
 	public function parse()
35 35
 	{
36 36
 		$tab = $this->prepareFile();
37
-		foreach ($tab as $line)
38
-			$this->parseLine($line);
37
+		foreach ($tab as $line) {
38
+					$this->parseLine($line);
39
+		}
39 40
 	}
40 41
 
41 42
 	public function getXML()
@@ -53,13 +54,15 @@  discard block
 block discarded – undo
53 54
 	protected function createXML($key, $value, $level)
54 55
 	{
55 56
 		$indent = '';
56
-		for ($i = 0; $i <= $level; $i++)
57
-			$indent .= "\t";
57
+		for ($i = 0; $i <= $level; $i++) {
58
+					$indent .= "\t";
59
+		}
58 60
 		if (is_array($value)) {
59 61
 			$xml = "$indent<$key>\n";
60 62
 			foreach ($value as $subKey => $subVal) {
61
-				if (is_numeric($subKey))
62
-					$subKey = substr($key, 0, -1);
63
+				if (is_numeric($subKey)) {
64
+									$subKey = substr($key, 0, -1);
65
+				}
63 66
 				$xml .= $this->createXML($subKey, $subVal, $level + 1);
64 67
 			}
65 68
 			$xml .= "$indent</$key>\n";
@@ -85,10 +88,11 @@  discard block
 block discarded – undo
85 88
 				break;
86 89
 			case 'NS':
87 90
 				$code = substr($value, 0, 2);
88
-				if ($code == '22')
89
-					$this->ownerName = substr($value, 2);
90
-				else if ($code == '23')
91
-					$this->accountName = substr($value, 2);
91
+				if ($code == '22') {
92
+									$this->ownerName = substr($value, 2);
93
+				} else if ($code == '23') {
94
+									$this->accountName = substr($value, 2);
95
+				}
92 96
 				break;
93 97
 			case '60F':
94 98
 				$this->openBalance = $this->parseBalance($value);
@@ -103,10 +107,11 @@  discard block
 block discarded – undo
103 107
 				self::parseOperation($value);
104 108
 				break;
105 109
 			case '86':
106
-				if ($this->_lastTag == '61')
107
-					$this->parseTransaction($value);
108
-				else
109
-					$this->info .= $value;
110
+				if ($this->_lastTag == '61') {
111
+									$this->parseTransaction($value);
112
+				} else {
113
+									$this->info .= $value;
114
+				}
110 115
 				break;
111 116
 			default:
112 117
 				break;
Please login to merge, or discard this patch.
modules/PaymentsIn/helpers/subclass/mt940_Milenium.php 2 patches
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@  discard block
 block discarded – undo
20 20
 			$this->parseLine($line);
21 21
 	}
22 22
 
23
+	/**
24
+	 * @param string $line
25
+	 */
23 26
 	protected function parseLine($line)
24 27
 	{
25 28
 		$tag = substr($line, 1, strpos($line, ':', 1) - 1);
@@ -65,6 +68,9 @@  discard block
 block discarded – undo
65 68
 		$this->_lastTag = $tag;
66 69
 	}
67 70
 
71
+	/**
72
+	 * @param string $value
73
+	 */
68 74
 	protected function parseOperation($value)
69 75
 	{
70 76
 		$this->operations[] = array(
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
 	public function parse()
17 17
 	{
18 18
 		$tab = $this->prepareFile();
19
-		foreach ($tab as $line)
20
-			$this->parseLine($line);
19
+		foreach ($tab as $line) {
20
+					$this->parseLine($line);
21
+		}
21 22
 	}
22 23
 
23 24
 	protected function parseLine($line)
@@ -36,10 +37,11 @@  discard block
 block discarded – undo
36 37
 				break;
37 38
 			case 'NS':
38 39
 				$code = substr($value, 0, 2);
39
-				if ($code == '22')
40
-					$this->ownerName = substr($value, 2);
41
-				else if ($code == '23')
42
-					$this->accountName = substr($value, 2);
40
+				if ($code == '22') {
41
+									$this->ownerName = substr($value, 2);
42
+				} else if ($code == '23') {
43
+									$this->accountName = substr($value, 2);
44
+				}
43 45
 				break;
44 46
 			case '60F':
45 47
 				$this->openBalance = $this->parseBalance($value);
@@ -54,10 +56,11 @@  discard block
 block discarded – undo
54 56
 				self::parseOperation($value);
55 57
 				break;
56 58
 			case '86':
57
-				if ($this->_lastTag == '61')
58
-					$this->parseTransaction($value);
59
-				else
60
-					$this->info .= $value;
59
+				if ($this->_lastTag == '61') {
60
+									$this->parseTransaction($value);
61
+				} else {
62
+									$this->info .= $value;
63
+				}
61 64
 				break;
62 65
 			default:
63 66
 				break;
Please login to merge, or discard this patch.
modules/PaymentsIn/helpers/subclass/mt940_WBK.php 2 patches
Doc Comments   +9 added lines patch added patch discarded remove patch
@@ -20,6 +20,9 @@  discard block
 block discarded – undo
20 20
 			$this->parseLine($line);
21 21
 	}
22 22
 
23
+	/**
24
+	 * @param string $line
25
+	 */
23 26
 	protected function parseLine($line)
24 27
 	{
25 28
 		$tag = substr($line, 1, strpos($line, ':', 1) - 1);
@@ -65,6 +68,9 @@  discard block
 block discarded – undo
65 68
 		$this->_lastTag = $tag;
66 69
 	}
67 70
 
71
+	/**
72
+	 * @param string $value
73
+	 */
68 74
 	protected function parseTransaction($value)
69 75
 	{
70 76
 		$transaction = array(
@@ -109,6 +115,9 @@  discard block
 block discarded – undo
109 115
 		$this->operations[count($this->operations) - 1]['details'] = $transaction;
110 116
 	}
111 117
 
118
+	/**
119
+	 * @param string $value
120
+	 */
112 121
 	protected function parseOperation($value)
113 122
 	{
114 123
 		$this->operations[] = array(
Please login to merge, or discard this patch.
Braces   +13 added lines, -10 removed lines patch added patch discarded remove patch
@@ -16,8 +16,9 @@  discard block
 block discarded – undo
16 16
 	public function parse()
17 17
 	{
18 18
 		$tab = $this->prepareFile();
19
-		foreach ($tab as $line)
20
-			$this->parseLine($line);
19
+		foreach ($tab as $line) {
20
+					$this->parseLine($line);
21
+		}
21 22
 	}
22 23
 
23 24
 	protected function parseLine($line)
@@ -36,10 +37,11 @@  discard block
 block discarded – undo
36 37
 				break;
37 38
 			case 'NS':
38 39
 				$code = substr($value, 0, 2);
39
-				if ($code == '22')
40
-					$this->ownerName = substr($value, 2);
41
-				else if ($code == '23')
42
-					$this->accountName = substr($value, 2);
40
+				if ($code == '22') {
41
+									$this->ownerName = substr($value, 2);
42
+				} else if ($code == '23') {
43
+									$this->accountName = substr($value, 2);
44
+				}
43 45
 				break;
44 46
 			case '60F':
45 47
 				$this->openBalance = $this->parseBalance($value);
@@ -54,10 +56,11 @@  discard block
 block discarded – undo
54 56
 				self::parseOperation($value);
55 57
 				break;
56 58
 			case '86':
57
-				if ($this->_lastTag == '61')
58
-					$this->parseTransaction($value);
59
-				else
60
-					$this->info .= $value;
59
+				if ($this->_lastTag == '61') {
60
+									$this->parseTransaction($value);
61
+				} else {
62
+									$this->info .= $value;
63
+				}
61 64
 				break;
62 65
 			default:
63 66
 				break;
Please login to merge, or discard this patch.