Completed
Push — developer ( 641180...81429f )
by Błażej
37:39
created
modules/com_vtiger_workflow/VTWorkflowApplication.inc 1 patch
Doc Comments   +6 added lines patch added patch discarded remove patch
@@ -11,6 +11,9 @@  discard block
 block discarded – undo
11 11
 class VTWorkflowApplication
12 12
 {
13 13
 
14
+	/**
15
+	 * @param string $action
16
+	 */
14 17
 	function __construct($action)
15 18
 	{
16 19
 		$this->request;
@@ -36,6 +39,9 @@  discard block
 block discarded – undo
36 39
 		return $_SERVER["REQUEST_URI"];
37 40
 	}
38 41
 
42
+	/**
43
+	 * @return string
44
+	 */
39 45
 	function returnUrl()
40 46
 	{
41 47
 		return $this->returnUrl;
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/VTWorkflowManager.inc 3 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -480,7 +480,7 @@  discard block
 block discarded – undo
480 480
 	/**
481 481
 	 * Function gets the next trigger for the workflows
482 482
 	 * @global <String> $default_timezone
483
-	 * @return type
483
+	 * @return string|null
484 484
 	 */
485 485
 	function getNextTriggerTime()
486 486
 	{
@@ -525,8 +525,8 @@  discard block
 block discarded – undo
525 525
 
526 526
 	/**
527 527
 	 * get next trigger time for daily
528
-	 * @param type $schTime
529
-	 * @return time
528
+	 * @param type $scheduledTime
529
+	 * @return string
530 530
 	 */
531 531
 	function getNextTriggerTimeForDaily($scheduledTime)
532 532
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
 								module_name=?, summary=?, test=?, execution_condition=?, defaultworkflow=?, filtersavedinnew=?,
42 42
 								schtypeid=?, schtime=?, schdayofmonth=?, schdayofweek=?, schannualdates=?, nexttrigger_time=? where workflow_id=?", array($wf->moduleName, $wf->description, $wf->test, $wf->executionCondition, $wf->defaultworkflow, $wf->filtersavedinnew,
43 43
 				$wf->schtypeid, $wf->schtime, $wf->schdayofmonth, $wf->schdayofweek, $wf->schannualdates, $wf->nexttrigger_time, $wf->id));
44
-		}else {
44
+		} else {
45 45
 			$workflowId = $adb->getUniqueID("com_vtiger_workflows");
46 46
 			$workflow->id = $workflowId;
47 47
 			$wf = $workflow;
Please login to merge, or discard this patch.
Braces   +10 added lines, -7 removed lines patch added patch discarded remove patch
@@ -35,18 +35,20 @@  discard block
 block discarded – undo
35 35
 		$adb = $this->adb;
36 36
 		if (isset($workflow->id)) {
37 37
 			$wf = $workflow;
38
-			if ($wf->filtersavedinnew == null)
39
-				$wf->filtersavedinnew = 5;
38
+			if ($wf->filtersavedinnew == null) {
39
+							$wf->filtersavedinnew = 5;
40
+			}
40 41
 			$adb->pquery("update com_vtiger_workflows set
41 42
 								module_name=?, summary=?, test=?, execution_condition=?, defaultworkflow=?, filtersavedinnew=?,
42 43
 								schtypeid=?, schtime=?, schdayofmonth=?, schdayofweek=?, schannualdates=?, nexttrigger_time=? where workflow_id=?", array($wf->moduleName, $wf->description, $wf->test, $wf->executionCondition, $wf->defaultworkflow, $wf->filtersavedinnew,
43 44
 				$wf->schtypeid, $wf->schtime, $wf->schdayofmonth, $wf->schdayofweek, $wf->schannualdates, $wf->nexttrigger_time, $wf->id));
44
-		}else {
45
+		} else {
45 46
 			$workflowId = $adb->getUniqueID("com_vtiger_workflows");
46 47
 			$workflow->id = $workflowId;
47 48
 			$wf = $workflow;
48
-			if ($wf->filtersavedinnew == null)
49
-				$wf->filtersavedinnew = 5;
49
+			if ($wf->filtersavedinnew == null) {
50
+							$wf->filtersavedinnew = 5;
51
+			}
50 52
 
51 53
 			$result = $adb->getColumnNames("com_vtiger_workflows");
52 54
 			if (in_array("type", $result)) {
@@ -155,8 +157,9 @@  discard block
 block discarded – undo
155 157
 			$workflow = $this->getWorkflowInstance($row->type);
156 158
 			$workflow->setup($row->data);
157 159
 
158
-			if (!is_a($workflow, 'Workflow'))
159
-				continue;
160
+			if (!is_a($workflow, 'Workflow')) {
161
+							continue;
162
+			}
160 163
 
161 164
 			$workflows[$i++] = $workflow;
162 165
 		}
Please login to merge, or discard this patch.
modules/com_vtiger_workflow/VTWorkflowTemplateManager.inc 2 patches
Doc Comments   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 	 * Retrieve a template given it's id
42 42
 	 *
43 43
 	 * @param $templateId The id of the template
44
-	 * @return The template object
44
+	 * @return VTWorkflowTemplate template object
45 45
 	 */
46 46
 	public function retrieveTemplate($templateId)
47 47
 	{
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	 *
63 63
 	 * The new workflow will also be added to the database.
64 64
 	 *
65
-	 * @param $template The template to use
65
+	 * @param VTWorkflowTemplate $template The template to use
66 66
 	 * @return A workflow object.
67 67
 	 */
68 68
 	public function createWorkflow($template)
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 * This can be used for exporting templates from one 
146 146
 	 * machine to another
147 147
 	 *
148
-	 * @return The string dump of the templates.
148
+	 * @return string string dump of the templates.
149 149
 	 */
150 150
 	public function dumpAllTemplates()
151 151
 	{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -113,8 +113,7 @@
 block discarded – undo
113 113
 		$adb = $this->adb;
114 114
 		if (is_numeric($template->id)) {//How do I check whether a member exists in php?
115 115
 			$templateId = $template->id;
116
-			$adb->pquery("update com_vtiger_workflowtemplates set title=?," +
117
-				" module_name=?, template=? where template_id=?", array($template->title, $template->moduleName,
116
+			$adb->pquery("update com_vtiger_workflowtemplates set title=?," +" module_name=?, template=? where template_id=?", array($template->title, $template->moduleName,
118 117
 				$template->template, $templateId));
119 118
 			return $templateId;
120 119
 		} else {
Please login to merge, or discard this patch.
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/Contacts/Contacts.php 2 patches
Doc Comments   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,8 +119,6 @@  discard block
 block discarded – undo
119 119
 
120 120
 	// Mike Crowe Mod --------------------------------------------------------Default ordering for us
121 121
 	/** Function to get the number of Contacts assigned to a particular User.
122
-	 *  @param varchar $user name - Assigned to User
123
-	 *  Returns the count of contacts assigned to user.
124 122
 	 */
125 123
 	public function getCount($user_name)
126 124
 	{
@@ -154,7 +152,7 @@  discard block
 block discarded – undo
154 152
 	}
155 153
 
156 154
 	/** Function to process list query for a given query
157
-	 *  @param $query
155
+	 *  @param string $query
158 156
 	 *  Returns the results of query in array format
159 157
 	 */
160 158
 	public function process_list_query1($query)
@@ -195,7 +193,7 @@  discard block
 block discarded – undo
195 193
 	}
196 194
 
197 195
 	/** Function to process list query for Plugin with Security Parameters for a given query
198
-	 *  @param $query
196
+	 *  @param string $query
199 197
 	 *  Returns the results of query in array format
200 198
 	 */
201 199
 	public function plugin_process_list_query($query)
Please login to merge, or discard this patch.
Braces   +55 added lines, -40 removed lines patch added patch discarded remove patch
@@ -276,16 +276,18 @@  discard block
 block discarded – undo
276 276
 		vtlib_setup_modulevars($related_module, $other);
277 277
 		$singular_modname = vtlib_toSingular($related_module);
278 278
 
279
-		if ($singlepane_view == 'true')
280
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
281
-		else
282
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
279
+		if ($singlepane_view == 'true') {
280
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
281
+		} else {
282
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
283
+		}
283 284
 
284 285
 		$button = '';
285 286
 
286 287
 		if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'parent_id', 'readwrite') == '0') {
287
-			if (is_string($actions))
288
-				$actions = explode(',', strtoupper($actions));
288
+			if (is_string($actions)) {
289
+							$actions = explode(',', strtoupper($actions));
290
+			}
289 291
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
290 292
 				$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;";
291 293
 			}
@@ -311,8 +313,9 @@  discard block
 block discarded – undo
311 313
 
312 314
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
313 315
 
314
-		if ($return_value == null)
315
-			$return_value = Array();
316
+		if ($return_value == null) {
317
+					$return_value = Array();
318
+		}
316 319
 		$return_value['CUSTOM_BUTTON'] = $button;
317 320
 
318 321
 		$log->debug("Exiting get_tickets method ...");
@@ -339,16 +342,18 @@  discard block
 block discarded – undo
339 342
 		vtlib_setup_modulevars($related_module, $other);
340 343
 		$singular_modname = vtlib_toSingular($related_module);
341 344
 
342
-		if ($singlepane_view == 'true')
343
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
344
-		else
345
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
345
+		if ($singlepane_view == 'true') {
346
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
347
+		} else {
348
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
349
+		}
346 350
 
347 351
 		$button = '';
348 352
 
349 353
 		if ($actions) {
350
-			if (is_string($actions))
351
-				$actions = explode(',', strtoupper($actions));
354
+			if (is_string($actions)) {
355
+							$actions = explode(',', strtoupper($actions));
356
+			}
352 357
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
353 358
 				$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;";
354 359
 			}
@@ -379,8 +384,9 @@  discard block
 block discarded – undo
379 384
 
380 385
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
381 386
 
382
-		if ($return_value == null)
383
-			$return_value = Array();
387
+		if ($return_value == null) {
388
+					$return_value = Array();
389
+		}
384 390
 		$return_value['CUSTOM_BUTTON'] = $button;
385 391
 
386 392
 		$log->debug("Exiting get_products method ...");
@@ -406,18 +412,20 @@  discard block
 block discarded – undo
406 412
 		vtlib_setup_modulevars($related_module, $other);
407 413
 		$singular_modname = vtlib_toSingular($related_module);
408 414
 
409
-		if ($singlepane_view == 'true')
410
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
411
-		else
412
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
415
+		if ($singlepane_view == 'true') {
416
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
417
+		} else {
418
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
419
+		}
413 420
 
414 421
 		$button = '';
415 422
 
416 423
 		$button .= '<input type="hidden" name="email_directing_module"><input type="hidden" name="record">';
417 424
 
418 425
 		if ($actions) {
419
-			if (is_string($actions))
420
-				$actions = explode(',', strtoupper($actions));
426
+			if (is_string($actions)) {
427
+							$actions = explode(',', strtoupper($actions));
428
+			}
421 429
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
422 430
 				$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;";
423 431
 			}
@@ -441,8 +449,9 @@  discard block
 block discarded – undo
441 449
 
442 450
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
443 451
 
444
-		if ($return_value == null)
445
-			$return_value = Array();
452
+		if ($return_value == null) {
453
+					$return_value = Array();
454
+		}
446 455
 		$return_value['CUSTOM_BUTTON'] = $button;
447 456
 
448 457
 		$log->debug("Exiting get_campaigns method ...");
@@ -469,16 +478,18 @@  discard block
 block discarded – undo
469 478
 		vtlib_setup_modulevars($related_module, $other);
470 479
 		$singular_modname = vtlib_toSingular($related_module);
471 480
 
472
-		if ($singlepane_view == 'true')
473
-			$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
474
-		else
475
-			$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
481
+		if ($singlepane_view == 'true') {
482
+					$returnset = '&return_module=' . $this_module . '&return_action=DetailView&return_id=' . $id;
483
+		} else {
484
+					$returnset = '&return_module=' . $this_module . '&return_action=CallRelatedList&return_id=' . $id;
485
+		}
476 486
 
477 487
 		$button = '';
478 488
 
479 489
 		if ($actions && getFieldVisibilityPermission($related_module, $current_user->id, 'parent_id', 'readwrite') == '0') {
480
-			if (is_string($actions))
481
-				$actions = explode(',', strtoupper($actions));
490
+			if (is_string($actions)) {
491
+							$actions = explode(',', strtoupper($actions));
492
+			}
482 493
 			if (in_array('SELECT', $actions) && isPermitted($related_module, 4, '') == 'yes') {
483 494
 				$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;";
484 495
 			}
@@ -502,8 +513,9 @@  discard block
 block discarded – undo
502 513
 
503 514
 		$return_value = GetRelatedList($this_module, $related_module, $other, $query, $button, $returnset);
504 515
 
505
-		if ($return_value == null)
506
-			$return_value = Array();
516
+		if ($return_value == null) {
517
+					$return_value = Array();
518
+		}
507 519
 		$return_value['CUSTOM_BUTTON'] = $button;
508 520
 
509 521
 		$log->debug("Exiting get_vendors method ...");
@@ -542,10 +554,11 @@  discard block
 block discarded – undo
542 554
 		$query .= getNonAdminAccessControlQuery('Contacts', $current_user);
543 555
 		$where_auto = " vtiger_crmentity.deleted = 0 ";
544 556
 
545
-		if ($where != '')
546
-			$query .= sprintf(' where (%s) && %s', $where, $where_auto);
547
-		else
548
-			$query .= sprintf(' where %s', $where_auto);
557
+		if ($where != '') {
558
+					$query .= sprintf(' where (%s) && %s', $where, $where_auto);
559
+		} else {
560
+					$query .= sprintf(' where %s', $where_auto);
561
+		}
549 562
 
550 563
 		$log->info("Export Query Constructed Successfully");
551 564
 		$log->debug("Exiting create_export_query method ...");
@@ -898,8 +911,9 @@  discard block
 block discarded – undo
898 911
 	public function unlinkRelationship($id, $return_module, $return_id, $relatedName = false)
899 912
 	{
900 913
 		$log = vglobal('log');
901
-		if (empty($return_module) || empty($return_id))
902
-			return;
914
+		if (empty($return_module) || empty($return_id)) {
915
+					return;
916
+		}
903 917
 
904 918
 		if ($return_module == 'Accounts') {
905 919
 			$sql = 'UPDATE vtiger_contactdetails SET parentid = ? WHERE contactid = ?';
@@ -922,8 +936,9 @@  discard block
 block discarded – undo
922 936
 		$adb = PearDatabase::getInstance();
923 937
 		$currentUser = Users_Record_Model::getCurrentUserModel();
924 938
 
925
-		if (!is_array($withCrmid))
926
-			$withCrmid = [$withCrmid];
939
+		if (!is_array($withCrmid)) {
940
+					$withCrmid = [$withCrmid];
941
+		}
927 942
 		if (!in_array($withModule, ['Products', 'Campaigns', 'Vendors'])) {
928 943
 			parent::save_related_module($module, $crmid, $withModule, $withCrmid, $relatedName);
929 944
 		} else {
Please login to merge, or discard this patch.
modules/CustomView/CustomView.php 4 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -550,7 +550,7 @@  discard block
 block discarded – undo
550 550
 
551 551
 	/**
552 552
 	 *  Function which will give condition list for date fields
553
-	 * @return array of std filter conditions
553
+	 * @return string[] of std filter conditions
554 554
 	 */
555 555
 	public function getStdFilterConditions()
556 556
 	{
@@ -991,7 +991,7 @@  discard block
 block discarded – undo
991 991
 	 * @param $tablename :: type string
992 992
 	 * @param $fieldname :: type string
993 993
 	 * @param $comparator :: type string
994
-	 * @param $value :: type string
994
+	 * @param string $value :: type string
995 995
 	 * @returns  $value as a string in the following format
996 996
 	 * 	  $tablename.$fieldname comparator
997 997
 	 */
Please login to merge, or discard this patch.
Indentation   -2 removed lines patch added patch discarded remove patch
@@ -431,8 +431,6 @@
 block discarded – undo
431 431
 	  Array('BlockLabeln' =>
432 432
 	  Array('$fieldtablename:$fieldcolname:$fieldname:$module_$fieldlabel1:$fieldtypeofdata'=>$fieldlabel,
433 433
 	  Array('$fieldtablename1:$fieldcolname1:$fieldname1:$module_$fieldlabel11:$fieldtypeofdata1'=>$fieldlabel1,
434
-
435
-
436 434
 	 */
437 435
 	public function getModuleColumnsList($module)
438 436
 	{
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -339,31 +339,31 @@  discard block
 block discarded – undo
339 339
 		if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
340 340
 			$tab_ids = explode(",", $tabid);
341 341
 			$sql = 'select * from vtiger_field ';
342
-			$sql.= ' where vtiger_field.tabid in (%s) and vtiger_field.block in (%s) and vtiger_field.presence in (0,2) and';
343
-			$sql.= $display_type;
342
+			$sql .= ' where vtiger_field.tabid in (%s) and vtiger_field.block in (%s) and vtiger_field.presence in (0,2) and';
343
+			$sql .= $display_type;
344 344
 			if ($tabid == 9 || $tabid == 16) {
345
-				$sql.= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')";
345
+				$sql .= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')";
346 346
 			}
347
-			$sql.= " order by sequence";
347
+			$sql .= " order by sequence";
348 348
 			$params = array($tab_ids, $block_ids);
349 349
 		} else {
350 350
 			$tab_ids = explode(",", $tabid);
351 351
 			$profileList = getCurrentUserProfileList();
352 352
 			$sql = 'select * from vtiger_field inner join vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid ';
353
-			$sql.= ' where vtiger_field.tabid in (%s) and vtiger_field.block in (%s) and';
354
-			$sql.= $display_type . 'and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)';
353
+			$sql .= ' where vtiger_field.tabid in (%s) and vtiger_field.block in (%s) and';
354
+			$sql .= $display_type . 'and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)';
355 355
 
356 356
 			$params = array($tab_ids, $block_ids);
357 357
 
358 358
 			if (count($profileList) > 0) {
359
-				$sql.= "  and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
359
+				$sql .= "  and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
360 360
 				array_push($params, $profileList);
361 361
 			}
362 362
 			if ($tabid == 9 || $tabid == 16) {
363
-				$sql.= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')";
363
+				$sql .= " and vtiger_field.fieldname not in('notime','duration_minutes','duration_hours')";
364 364
 			}
365 365
 
366
-			$sql.= " group by columnname order by sequence";
366
+			$sql .= " group by columnname order by sequence";
367 367
 		}
368 368
 		if ($tabid == '9,16')
369 369
 			$tabid = "9";
@@ -514,23 +514,23 @@  discard block
 block discarded – undo
514 514
 
515 515
 		if ($is_admin == true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
516 516
 			$sql = 'select * from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid ';
517
-			$sql.= ' where vtiger_field.tabid=? and vtiger_field.block in (%s)
517
+			$sql .= ' where vtiger_field.tabid=? and vtiger_field.block in (%s)
518 518
                         and vtiger_field.uitype in (5,6,23,70)';
519
-			$sql.= ' and vtiger_field.presence in (0,2) order by vtiger_field.sequence';
519
+			$sql .= ' and vtiger_field.presence in (0,2) order by vtiger_field.sequence';
520 520
 			$params = [$tabid, $blockids];
521 521
 		} else {
522 522
 			$profileList = getCurrentUserProfileList();
523 523
 			$sql = 'select * from vtiger_field inner join vtiger_tab on vtiger_tab.tabid = vtiger_field.tabid inner join  vtiger_profile2field on vtiger_profile2field.fieldid=vtiger_field.fieldid inner join vtiger_def_org_field on vtiger_def_org_field.fieldid=vtiger_field.fieldid ';
524
-			$sql.= ' where vtiger_field.tabid=? and vtiger_field.block in (%s) and vtiger_field.uitype in (5,6,23,70)';
525
-			$sql.= " and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
524
+			$sql .= ' where vtiger_field.tabid=? and vtiger_field.block in (%s) and vtiger_field.uitype in (5,6,23,70)';
525
+			$sql .= " and vtiger_profile2field.visible=0 and vtiger_def_org_field.visible=0 and vtiger_field.presence in (0,2)";
526 526
 			$params = [$tabid, $blockids];
527 527
 
528 528
 			if (count($profileList) > 0) {
529
-				$sql.= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
529
+				$sql .= " and vtiger_profile2field.profileid in (" . generateQuestionMarks($profileList) . ")";
530 530
 				array_push($params, $profileList);
531 531
 			}
532 532
 
533
-			$sql.= " order by vtiger_field.sequence";
533
+			$sql .= " order by vtiger_field.sequence";
534 534
 		}
535 535
 		$sql = sprintf($sql, generateQuestionMarks($block_ids));
536 536
 		$result = $adb->pquery($sql, $params);
@@ -642,7 +642,7 @@  discard block
 block discarded – undo
642 642
 						inner join vtiger_cvadvfilter on vtiger_cvadvfilter.cvid = vtiger_customview.cvid
643 643
 						left join vtiger_cvadvfilter_grouping on vtiger_cvadvfilter.cvid = vtiger_cvadvfilter_grouping.cvid
644 644
 								and vtiger_cvadvfilter.groupid = vtiger_cvadvfilter_grouping.groupid';
645
-			$ssql.= " where vtiger_customview.cvid = ? && vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
645
+			$ssql .= " where vtiger_customview.cvid = ? && vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
646 646
 
647 647
 			$result = $adb->pquery($ssql, array($cvid, $groupId));
648 648
 			$noOfColumns = $adb->num_rows($result);
@@ -1033,7 +1033,7 @@  discard block
 block discarded – undo
1033 1033
 			$userNameSql = \vtlib\Deprecated::getSqlForNameInDisplayFormat(array('first_name' =>
1034 1034
 					'vtiger_users' . $tableNameSuffix . '.first_name', 'last_name' => 'vtiger_users' . $tableNameSuffix . '.last_name'), 'Users');
1035 1035
 			$temp_value = '( trim(' . $userNameSql . ')' . $this->getAdvComparator($comparator, $value, $datatype);
1036
-			$temp_value.= " ||  vtiger_groups$tableNameSuffix.groupname" . $this->getAdvComparator($comparator, $value, $datatype) . ')';
1036
+			$temp_value .= " ||  vtiger_groups$tableNameSuffix.groupname" . $this->getAdvComparator($comparator, $value, $datatype) . ')';
1037 1037
 			$value = $temp_value; // Hot fix: removed unbalanced closing bracket ")";
1038 1038
 		} elseif ($fieldname == "inventorymanager") {
1039 1039
 			$value = $tablename . "." . $fieldname . $this->getAdvComparator($comparator, getUserId_Ol($value), $datatype);
Please login to merge, or discard this patch.
Braces   +77 added lines, -57 removed lines patch added patch discarded remove patch
@@ -110,8 +110,9 @@  discard block
 block discarded – undo
110 110
 			} else {
111 111
 				$viewid = $viewname;
112 112
 			}
113
-			if ($this->isPermittedCustomView($viewid, $nowAction, $module) != 'yes')
114
-				$viewid = 0;
113
+			if ($this->isPermittedCustomView($viewid, $nowAction, $module) != 'yes') {
114
+							$viewid = 0;
115
+			}
115 116
 		}
116 117
 		ListViewSession::setCurrentView($module, $viewid);
117 118
 		$log->debug('Exiting ' . __CLASS__ . '::' . __METHOD__ . ' method ...');
@@ -248,8 +249,9 @@  discard block
 block discarded – undo
248 249
 		$shtml_others = '';
249 250
 
250 251
 		$selected = 'selected';
251
-		if ($markselected === false)
252
-			$selected = '';
252
+		if ($markselected === false) {
253
+					$selected = '';
254
+		}
253 255
 
254 256
 		$ssql = "select vtiger_customview.*, vtiger_users.first_name,vtiger_users.last_name from vtiger_customview inner join vtiger_tab on vtiger_tab.name = vtiger_customview.entitytype
255 257
 					left join vtiger_users on vtiger_customview.userid = vtiger_users.id ";
@@ -292,23 +294,27 @@  discard block
 block discarded – undo
292 294
 				if ($cvrow['status'] == CV_STATUS_DEFAULT || $cvrow['userid'] == $current_user->id) {
293 295
 					$shtml_user .= $option;
294 296
 				} elseif ($cvrow['status'] == CV_STATUS_PUBLIC) {
295
-					if ($shtml_public == '')
296
-						$shtml_public = "<option disabled>--- " . \includes\Language::translate('LBL_PUBLIC') . " ---</option>";
297
+					if ($shtml_public == '') {
298
+											$shtml_public = "<option disabled>--- " . \includes\Language::translate('LBL_PUBLIC') . " ---</option>";
299
+					}
297 300
 					$shtml_public .= $option;
298 301
 				} elseif ($cvrow['status'] == CV_STATUS_PENDING) {
299
-					if ($shtml_pending == '')
300
-						$shtml_pending = "<option disabled>--- " . \includes\Language::translate('LBL_PENDING') . " ---</option>";
302
+					if ($shtml_pending == '') {
303
+											$shtml_pending = "<option disabled>--- " . \includes\Language::translate('LBL_PENDING') . " ---</option>";
304
+					}
301 305
 					$shtml_pending .= $option;
302 306
 				} else {
303
-					if ($shtml_others == '')
304
-						$shtml_others = "<option disabled>--- " . \includes\Language::translate('LBL_OTHERS') . " ---</option>";
307
+					if ($shtml_others == '') {
308
+											$shtml_others = "<option disabled>--- " . \includes\Language::translate('LBL_OTHERS') . " ---</option>";
309
+					}
305 310
 					$shtml_others .= $option;
306 311
 				}
307 312
 			}
308 313
 		}
309 314
 		$shtml = $shtml_user;
310
-		if ($is_admin === true)
311
-			$shtml .= $shtml_pending;
315
+		if ($is_admin === true) {
316
+					$shtml .= $shtml_pending;
317
+		}
312 318
 		$shtml = $shtml . $shtml_public . $shtml_others;
313 319
 		return $shtml;
314 320
 	}
@@ -332,8 +338,9 @@  discard block
 block discarded – undo
332 338
 		if (empty($this->meta) && $module != 'Calendar') {
333 339
 			$this->meta = $this->getMeta($module, $current_user);
334 340
 		}
335
-		if ($tabid == 9)
336
-			$tabid = "9,16";
341
+		if ($tabid == 9) {
342
+					$tabid = "9,16";
343
+		}
337 344
 		$display_type = " vtiger_field.displaytype in (1,2,3)";
338 345
 
339 346
 		if ($is_admin === true || $profileGlobalPermission[1] == 0 || $profileGlobalPermission[2] == 0) {
@@ -365,8 +372,9 @@  discard block
 block discarded – undo
365 372
 
366 373
 			$sql.= " group by columnname order by sequence";
367 374
 		}
368
-		if ($tabid == '9,16')
369
-			$tabid = "9";
375
+		if ($tabid == '9,16') {
376
+					$tabid = "9";
377
+		}
370 378
 		$sql = sprintf($sql, generateQuestionMarks($tab_ids), generateQuestionMarks($block_ids));
371 379
 		$result = $adb->pquery($sql, $params);
372 380
 		$noofrows = $adb->num_rows($result);
@@ -405,8 +413,9 @@  discard block
 block discarded – undo
405 413
 				$fieldlabel1 . ":" . $fieldtypeofdata;
406 414
 			//added to escape attachments fields in customview as we have multiple attachments
407 415
 			$fieldlabel = \includes\Language::translate($fieldlabel); //added to support i18n issue
408
-			if ($module != 'HelpDesk' || $fieldname != 'filename')
409
-				$module_columnlist[$optionvalue] = $fieldlabel;
416
+			if ($module != 'HelpDesk' || $fieldname != 'filename') {
417
+							$module_columnlist[$optionvalue] = $fieldlabel;
418
+			}
410 419
 			if ($fieldtype[1] == "M") {
411 420
 				$this->mandatoryvalues[] = "'" . $optionvalue . "'";
412 421
 				$this->showvalues[] = $fieldlabel;
@@ -646,8 +655,9 @@  discard block
 block discarded – undo
646 655
 
647 656
 			$result = $adb->pquery($ssql, array($cvid, $groupId));
648 657
 			$noOfColumns = $adb->num_rows($result);
649
-			if ($noOfColumns <= 0)
650
-				continue;
658
+			if ($noOfColumns <= 0) {
659
+							continue;
660
+			}
651 661
 
652 662
 			while ($relcriteriarow = $adb->fetch_array($result)) {
653 663
 				$criteria = $this->getAdvftCriteria($relcriteriarow);
@@ -677,8 +687,9 @@  discard block
 block discarded – undo
677 687
 		}
678 688
 
679 689
 		// Clear the condition (and/or) for last group, if any.
680
-		if (!empty($advft_criteria[$i - 1]['condition']))
681
-			$advft_criteria[$i - 1]['condition'] = '';
690
+		if (!empty($advft_criteria[$i - 1]['condition'])) {
691
+					$advft_criteria[$i - 1]['condition'] = '';
692
+		}
682 693
 
683 694
 		return $advft_criteria;
684 695
 	}
@@ -794,8 +805,9 @@  discard block
 block discarded – undo
794 805
 								'vtiger_users.first_name', 'last_name' => 'vtiger_users.last_name'), 'Users');
795 806
 						$sqllist_column = "case when (vtiger_users.user_name not like '') then $userNameSql else vtiger_groups.groupname end as user_name";
796 807
 					}
797
-					if ($list[0] == "vtiger_contactdetails" && $list[1] == "lastname")
798
-						$sqllist_column = "vtiger_contactdetails.lastname,vtiger_contactdetails.firstname";
808
+					if ($list[0] == "vtiger_contactdetails" && $list[1] == "lastname") {
809
+											$sqllist_column = "vtiger_contactdetails.lastname,vtiger_contactdetails.firstname";
810
+					}
799 811
 					$sqllist[] = $sqllist_column;
800 812
 					//Ends
801 813
 
@@ -940,13 +952,13 @@  discard block
 block discarded – undo
940 952
 							$advorsql[] = $this->getRealValues($columns[0], $columns[1], $comparator, trim($valuearray[$n]), $datatype);
941 953
 						}
942 954
 						//If negative logic filter ('not equal to', 'does not contain') is used, 'and' condition should be applied instead of 'or'
943
-						if ($comparator == 'n' || $comparator == 'k')
944
-							$advorsqls = implode(" and ", $advorsql);
945
-						else
946
-							$advorsqls = implode(" or ", $advorsql);
955
+						if ($comparator == 'n' || $comparator == 'k') {
956
+													$advorsqls = implode(" and ", $advorsql);
957
+						} else {
958
+													$advorsqls = implode(" or ", $advorsql);
959
+						}
947 960
 						$advfiltersql = " (" . $advorsqls . ") ";
948
-					}
949
-					elseif ($comparator == 'bw' && count($valuearray) == 2) {
961
+					} elseif ($comparator == 'bw' && count($valuearray) == 2) {
950 962
 						$advfiltersql = "(" . $columns[0] . "." . $columns[1] . " between '" . getValidDBInsertDateTimeValue(trim($valuearray[0]), $datatype) . "' and '" . getValidDBInsertDateTimeValue(trim($valuearray[1]), $datatype) . "')";
951 963
 					} elseif ($comparator == 'y') {
952 964
 						$advfiltersql = sprintf("(%s.%s IS NULL || %s.%s = '')", $columns[0], $columns[1], $columns[0], $columns[1]);
@@ -982,8 +994,9 @@  discard block
 block discarded – undo
982 994
 				$advcvsql .= $advfiltergroupsql;
983 995
 			}
984 996
 		}
985
-		if (trim($advcvsql) != "")
986
-			$advcvsql = '(' . $advcvsql . ')';
997
+		if (trim($advcvsql) != "") {
998
+					$advcvsql = '(' . $advcvsql . ')';
999
+		}
987 1000
 		return $advcvsql;
988 1001
 	}
989 1002
 
@@ -1003,8 +1016,9 @@  discard block
 block discarded – undo
1003 1016
 		$currentModule = vglobal('currentModule');
1004 1017
 		$mod_strings = vglobal('mod_strings');
1005 1018
 		//Added for proper check of contact name in advance filter
1006
-		if ($tablename == "vtiger_contactdetails" && $fieldname == "lastname")
1007
-			$fieldname = "contactid";
1019
+		if ($tablename == "vtiger_contactdetails" && $fieldname == "lastname") {
1020
+					$fieldname = "contactid";
1021
+		}
1008 1022
 
1009 1023
 		$contactid = "vtiger_contactdetails.lastname";
1010 1024
 		if ($currentModule != "Contacts" && $currentModule != "Leads" && $currentModule != 'Campaigns') {
@@ -1052,10 +1066,11 @@  discard block
 block discarded – undo
1052 1066
 			//For checkbox type values, we have to convert yes/no as 1/0 to get the values
1053 1067
 			$field_uitype = getUItype($this->customviewmodule, $fieldname);
1054 1068
 			if ($field_uitype == 56) {
1055
-				if (strtolower($value) == 'yes')
1056
-					$value = 1;
1057
-				elseif (strtolower($value) == 'no')
1058
-					$value = 0;
1069
+				if (strtolower($value) == 'yes') {
1070
+									$value = 1;
1071
+				} elseif (strtolower($value) == 'no') {
1072
+									$value = 0;
1073
+				}
1059 1074
 			} else if (is_uitype($field_uitype, '_picklist_')) { /* Fix for tickets 4465 and 4629 */
1060 1075
 				// Get all the keys for the for the Picklist value
1061 1076
 				$mod_keys = array_keys($mod_strings, $value);
@@ -1104,8 +1119,9 @@  discard block
 block discarded – undo
1104 1119
 			if ($modulename == 'Vendors') {
1105 1120
 				continue;
1106 1121
 			}
1107
-			if ($s != 0)
1108
-				$value .= ' or ';
1122
+			if ($s != 0) {
1123
+							$value .= ' or ';
1124
+			}
1109 1125
 			if ($modulename == 'Accounts') {
1110 1126
 				//By Pavani : Related to problem in calender, Ticket: 4284 and 4675
1111 1127
 				if (($comparator == 'e' || $comparator == 's' || $comparator == 'c') && trim($adv_chk_value) == '') {
@@ -1368,16 +1384,18 @@  discard block
 block discarded – undo
1368 1384
 					INNER JOIN vtiger_blocks ON vtiger_blocks.blockid = vtiger_field.block INNER JOIN vtiger_tab ON vtiger_tab.tabid = vtiger_field.tabid 
1369 1385
 				  WHERE vtiger_tab.name IN (%s) && vtiger_field.presence IN (0, 2)', generateQuestionMarks($modulesList));
1370 1386
 		$result = $adb->pquery($sql, [$modulesList]);
1371
-		if ($module == "Calendar','Events")
1372
-			$module = 'Calendar';
1387
+		if ($module == "Calendar','Events") {
1388
+					$module = 'Calendar';
1389
+		}
1373 1390
 
1374 1391
 		$preBlockLabel = '';
1375 1392
 		while ($block = $adb->getRow($result)) {
1376 1393
 			$blockLabel = $block['blocklabel'];
1377 1394
 			$tabid = $block['tabid'];
1378 1395
 			// Skip certain blocks of certain modules
1379
-			if (array_key_exists($tabid, $skipBlocksList) && in_array($blockLabel, $skipBlocksList[$tabid]))
1380
-				continue;
1396
+			if (array_key_exists($tabid, $skipBlocksList) && in_array($blockLabel, $skipBlocksList[$tabid])) {
1397
+							continue;
1398
+			}
1381 1399
 
1382 1400
 			if (trim($blockLabel) == '') {
1383 1401
 				$blockInfo[$preBlockLabel] = $blockInfo[$preBlockLabel] . ',' . $block['block'];
@@ -1450,9 +1468,9 @@  discard block
 block discarded – undo
1450 1468
 						$permission = 'yes';
1451 1469
 					} elseif ($status == CV_STATUS_PRIVATE || $status == CV_STATUS_PENDING) {
1452 1470
 						$log->debug('Entering when status=1 or 2');
1453
-						if ($userid == $current_user->id)
1454
-							$permission = "yes";
1455
-						else {
1471
+						if ($userid == $current_user->id) {
1472
+													$permission = "yes";
1473
+						} else {
1456 1474
 							$log->debug("Entering when status=1 or status=2 & action = ListView or $module.Ajax or index");
1457 1475
 							$sql = sprintf('SELECT 
1458 1476
 										vtiger_users.id 
@@ -1477,17 +1495,19 @@  discard block
 block discarded – undo
1477 1495
 							}
1478 1496
 							$user_array = $temp_result;
1479 1497
 							if (sizeof($user_array) > 0) {
1480
-								if (!in_array($current_user->id, $user_array))
1481
-									$permission = 'no';
1482
-								else
1483
-									$permission = 'yes';
1484
-							} else
1485
-								$permission = 'no';
1498
+								if (!in_array($current_user->id, $user_array)) {
1499
+																	$permission = 'no';
1500
+								} else {
1501
+																	$permission = 'yes';
1502
+								}
1503
+							} else {
1504
+															$permission = 'no';
1505
+							}
1486 1506
 						}
1487
-					} else
1488
-						$permission = 'yes';
1489
-				}
1490
-				else {
1507
+					} else {
1508
+											$permission = 'yes';
1509
+					}
1510
+				} else {
1491 1511
 					$log->debug('Entering else condition............');
1492 1512
 					$permission = 'no';
1493 1513
 				}
Please login to merge, or discard this patch.
modules/CustomView/models/Record.php 3 patches
Doc Comments   +2 added lines, -3 removed lines patch added patch discarded remove patch
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 	/**
68 68
 	 * Function to set the Module to which the record belongs
69 69
 	 * @param <String> $moduleName
70
-	 * @return Vtiger_Record_Model or Module Specific Record Model instance
70
+	 * @return CustomView_Record_Model or Module Specific Record Model instance
71 71
 	 */
72 72
 	public function setModule($moduleName)
73 73
 	{
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 	/**
79 79
 	 * Function to set the Module to which the record belongs from the Module model instance
80 80
 	 * @param <Vtiger_Module_Model> $module
81
-	 * @return Vtiger_Record_Model or Module Specific Record Model instance
81
+	 * @return CustomView_Record_Model or Module Specific Record Model instance
82 82
 	 */
83 83
 	public function setModuleFromInstance($module)
84 84
 	{
@@ -1057,7 +1057,6 @@  discard block
 block discarded – undo
1057 1057
 
1058 1058
 	/**
1059 1059
 	 * function to check duplicates from database
1060
-	 * @param <type> $viewName
1061 1060
 	 * @param <type> module name entity type in database
1062 1061
 	 * @return <boolean> true/false
1063 1062
 	 */
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 			$lockFields = $crmEntityModel->getLockFields();
298 298
 			if (is_array($lockFields)) {
299 299
 				foreach ($lockFields as $fieldName => $fieldValues) {
300
-					$listQuery .=' && ' . $baseTableName . '.' . $fieldName . ' NOT IN (' . generateQuestionMarks($fieldValues) . ')';
300
+					$listQuery .= ' && ' . $baseTableName . '.' . $fieldName . ' NOT IN (' . generateQuestionMarks($fieldValues) . ')';
301 301
 					$params = array_merge($params, $fieldValues);
302 302
 				}
303 303
 			}
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
 					}
452 452
 
453 453
 					$temp_val = explode(",", $advFitlerValue);
454
-					if (($fieldType == 'date' || ($fieldType == 'time' && $fieldName != 'time_start' && $fieldName != 'time_end') || ($fieldType == 'datetime')) && ($fieldType != '' && $advFitlerValue != '' )) {
454
+					if (($fieldType == 'date' || ($fieldType == 'time' && $fieldName != 'time_start' && $fieldName != 'time_end') || ($fieldType == 'datetime')) && ($fieldType != '' && $advFitlerValue != '')) {
455 455
 						$val = Array();
456 456
 						for ($x = 0; $x < count($temp_val); $x++) {
457 457
 							//if date and time given then we have to convert the date and
@@ -672,7 +672,7 @@  discard block
 block discarded – undo
672 672
 						inner join vtiger_cvadvfilter on vtiger_cvadvfilter.cvid = vtiger_customview.cvid
673 673
 						left join vtiger_cvadvfilter_grouping on vtiger_cvadvfilter.cvid = vtiger_cvadvfilter_grouping.cvid
674 674
 								and vtiger_cvadvfilter.groupid = vtiger_cvadvfilter_grouping.groupid';
675
-			$ssql.= " where vtiger_customview.cvid = ? && vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
675
+			$ssql .= " where vtiger_customview.cvid = ? && vtiger_cvadvfilter.groupid = ? order by vtiger_cvadvfilter.columnindex";
676 676
 
677 677
 			$result = $db->pquery($ssql, array($this->getId(), $groupId));
678 678
 			$noOfColumns = $db->num_rows($result);
Please login to merge, or discard this patch.
Braces   +16 added lines, -10 removed lines patch added patch discarded remove patch
@@ -413,15 +413,17 @@  discard block
 block discarded – undo
413 413
 		$advFilterList = $this->get('advfilterlist');
414 414
 		if (!empty($advFilterList)) {
415 415
 			foreach ($advFilterList as $groupIndex => $groupInfo) {
416
-				if (empty($groupInfo))
417
-					continue;
416
+				if (empty($groupInfo)) {
417
+									continue;
418
+				}
418 419
 
419 420
 				$groupColumns = $groupInfo['columns'];
420 421
 				$groupCondition = $groupInfo['condition'];
421 422
 
422 423
 				foreach ($groupColumns as $columnIndex => $columnCondition) {
423
-					if (empty($columnCondition))
424
-						continue;
424
+					if (empty($columnCondition)) {
425
+											continue;
426
+					}
425 427
 
426 428
 					$advFilterColumn = $columnCondition['columnname'];
427 429
 					$advFilterComparator = $columnCondition['comparator'];
@@ -494,8 +496,10 @@  discard block
 block discarded – undo
494 496
 				}
495 497
 
496 498
 				$groupConditionExpression = $advFilterList[$groupIndex]["conditionexpression"];
497
-				if (empty($groupConditionExpression))
498
-					continue; // Case when the group doesn't have any column criteria
499
+				if (empty($groupConditionExpression)) {
500
+									continue;
501
+				}
502
+				// Case when the group doesn't have any column criteria
499 503
 
500 504
 				$db->insert('vtiger_cvadvfilter_grouping', [
501 505
 					'groupid' => $groupIndex,
@@ -676,8 +680,9 @@  discard block
 block discarded – undo
676 680
 
677 681
 			$result = $db->pquery($ssql, array($this->getId(), $groupId));
678 682
 			$noOfColumns = $db->num_rows($result);
679
-			if ($noOfColumns <= 0)
680
-				continue;
683
+			if ($noOfColumns <= 0) {
684
+							continue;
685
+			}
681 686
 
682 687
 			while ($relcriteriarow = $db->fetch_array($result)) {
683 688
 				$criteria = [];
@@ -730,8 +735,9 @@  discard block
 block discarded – undo
730 735
 			$i++;
731 736
 		}
732 737
 		// Clear the condition (and/or) for last group, if any.
733
-		if (!empty($advft_criteria[$i - 1]['condition']))
734
-			$advft_criteria[$i - 1]['condition'] = '';
738
+		if (!empty($advft_criteria[$i - 1]['condition'])) {
739
+					$advft_criteria[$i - 1]['condition'] = '';
740
+		}
735 741
 		return $advft_criteria;
736 742
 	}
737 743
 
Please login to merge, or discard this patch.
modules/Emails/class.phpmailer.php 4 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2758,7 +2758,7 @@
 block discarded – undo
2758 2758
 	 * @link http://www.php.net/manual/en/function.pathinfo.php#107461
2759 2759
 	 * @param string $path A filename or path, does not need to exist as a file
2760 2760
 	 * @param integer|string $options Either a PATHINFO_* constant, or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2
2761
-	 * @return string|array
2761
+	 * @return string
2762 2762
 	 * @static
2763 2763
 	 */
2764 2764
 	public static function mb_pathinfo($path, $options = null)
Please login to merge, or discard this patch.
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1927,7 +1927,7 @@
 block discarded – undo
1927 1927
 				//If a filename contains any of these chars, it should be quoted, but not otherwise: RFC2183 & RFC2045 5.1
1928 1928
 				//Fixes a warning in IETF's msglint MIME checker
1929 1929
 				//
1930
-        // Allow for bypassing the Content-Disposition header totally
1930
+		// Allow for bypassing the Content-Disposition header totally
1931 1931
 				if (!(empty($disposition))) {
1932 1932
 					if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $name)) {
1933 1933
 						$mime[] = sprintf("Content-Disposition: %s; filename=\"%s\"%s", $disposition, $this->EncodeHeader($this->SecureHeader($name)), $this->LE . $this->LE);
Please login to merge, or discard this patch.
Spacing   +3 added lines, -4 removed lines patch added patch discarded remove patch
@@ -530,7 +530,7 @@  discard block
 block discarded – undo
530 530
 	const STOP_MESSAGE = 0; // message only, continue processing
531 531
 	const STOP_CONTINUE = 1; // message?, likely ok to continue processing
532 532
 	const STOP_CRITICAL = 2; // message, plus full stop, critical error reached
533
-	const CRLF = "\r\n";  // SMTP RFC specified EOL
533
+	const CRLF = "\r\n"; // SMTP RFC specified EOL
534 534
 
535 535
 	/////////////////////////////////////////////////
536 536
 	// METHODS, VARIABLES
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 			$message = substr($message, 0, -$lelen);
1302 1302
 		}
1303 1303
 
1304
-		$line = explode($this->LE, $message);   // Magic. We know FixEOL uses $LE
1304
+		$line = explode($this->LE, $message); // Magic. We know FixEOL uses $LE
1305 1305
 		$message = '';
1306 1306
 		for ($i = 0; $i < count($line); $i++) {
1307 1307
 			$line_part = explode(' ', $line[$i]);
@@ -1390,8 +1390,7 @@  discard block
 block discarded – undo
1390 1390
 				if ($dec < 128) { // Single byte character.
1391 1391
 					// If the encoded char was found at pos 0, it will fit
1392 1392
 					// otherwise reduce maxLength to start of the encoded char
1393
-					$maxLength = ($encodedCharPos == 0) ? $maxLength :
1394
-						$maxLength - ($lookBack - $encodedCharPos);
1393
+					$maxLength = ($encodedCharPos == 0) ? $maxLength : $maxLength - ($lookBack - $encodedCharPos);
1395 1394
 					$foundSplitPos = true;
1396 1395
 				} elseif ($dec >= 192) { // First byte of a multi byte character
1397 1396
 					// Reduce maxLength to split at start of character
Please login to merge, or discard this patch.
Braces   +21 added lines, -14 removed lines patch added patch discarded remove patch
@@ -828,8 +828,9 @@  discard block
 block discarded – undo
828 828
 	public function Send()
829 829
 	{
830 830
 		try {
831
-			if (!$this->PreSend())
832
-				return false;
831
+			if (!$this->PreSend()) {
832
+							return false;
833
+			}
833 834
 			return $this->PostSend();
834 835
 		} catch (phpmailerException $e) {
835 836
 			$this->mailHeader = '';
@@ -1773,15 +1774,19 @@  discard block
 block discarded – undo
1773 1774
 	protected function SetMessageType()
1774 1775
 	{
1775 1776
 		$this->message_type = array();
1776
-		if ($this->AlternativeExists())
1777
-			$this->message_type[] = "alt";
1778
-		if ($this->InlineImageExists())
1779
-			$this->message_type[] = "inline";
1780
-		if ($this->AttachmentExists())
1781
-			$this->message_type[] = "attach";
1777
+		if ($this->AlternativeExists()) {
1778
+					$this->message_type[] = "alt";
1779
+		}
1780
+		if ($this->InlineImageExists()) {
1781
+					$this->message_type[] = "inline";
1782
+		}
1783
+		if ($this->AttachmentExists()) {
1784
+					$this->message_type[] = "attach";
1785
+		}
1782 1786
 		$this->message_type = implode("_", $this->message_type);
1783
-		if ($this->message_type == "")
1784
-			$this->message_type = "plain";
1787
+		if ($this->message_type == "") {
1788
+					$this->message_type = "plain";
1789
+		}
1785 1790
 	}
1786 1791
 
1787 1792
 	/**
@@ -2019,8 +2024,9 @@  discard block
 block discarded – undo
2019 2024
 			case '8bit':
2020 2025
 				$encoded = $this->FixEOL($str);
2021 2026
 				//Make sure it ends with a line break
2022
-				if (substr($encoded, -(strlen($this->LE))) != $this->LE)
2023
-					$encoded .= $this->LE;
2027
+				if (substr($encoded, -(strlen($this->LE))) != $this->LE) {
2028
+									$encoded .= $this->LE;
2029
+				}
2024 2030
 				break;
2025 2031
 			case 'binary':
2026 2032
 				$encoded = $str;
@@ -2950,8 +2956,9 @@  discard block
 block discarded – undo
2950 2956
 	 */
2951 2957
 	public function DKIM_BodyC($body)
2952 2958
 	{
2953
-		if ($body == '')
2954
-			return "\r\n";
2959
+		if ($body == '') {
2960
+					return "\r\n";
2961
+		}
2955 2962
 		// stabilize line endings
2956 2963
 		$body = str_replace("\r\n", "\n", $body);
2957 2964
 		$body = str_replace("\n", "\r\n", $body);
Please login to merge, or discard this patch.