Passed
Push — scrutinizer-code-quality ( 27193c...09f5a1 )
by Adam
51:28
created
modules/Prospects/ProspectFormBase.php 1 patch
Braces   +53 added lines, -26 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -60,20 +62,20 @@  discard block
 block discarded – undo
60 62
 	$baseQuery = 'select id,first_name, last_name, title, email1, email2  from prospects where deleted!=1 and (';
61 63
 	if(!empty($_POST[$prefix.'first_name']) && !empty($_POST[$prefix.'last_name'])){
62 64
 		$query = $baseQuery ."  (first_name like '". $_POST[$prefix.'first_name'] . "%' and last_name = '". $_POST[$prefix.'last_name'] ."')";
63
-	}else{
65
+	} else{
64 66
 			$query = $baseQuery ."  last_name = '". $_POST[$prefix.'last_name'] ."'";
65 67
 	}
66 68
 	if(!empty($_POST[$prefix.'email1'])){
67 69
 		if(empty($query)){
68 70
 		$query = $baseQuery. "  email1='". $_POST[$prefix.'email1'] . "' or email2 = '". $_POST[$prefix.'email1'] ."'";
69
-		}else {
71
+		} else {
70 72
 			$query .= "or email1='". $_POST[$prefix.'email1'] . "' or email2 = '". $_POST[$prefix.'email1'] ."'";
71 73
 		}
72 74
 	}
73 75
 	if(!empty($_POST[$prefix.'email2'])){
74 76
 		if(empty($query))	{
75 77
 			$query = $baseQuery. "  email1='". $_POST[$prefix.'email2'] . "' or email2 = '". $_POST[$prefix.'email2'] ."'";
76
-		}else{
78
+		} else{
77 79
 			$query .= "or email1='". $_POST[$prefix.'email2'] . "' or email2 = '". $_POST[$prefix.'email2'] ."'";
78 80
 		}
79 81
 
@@ -87,7 +89,9 @@  discard block
 block discarded – undo
87 89
         while($row = $db->fetchByAssoc($result)) {
88 90
             $rows[] = $row;
89 91
 		}
90
-		if(count($rows) > 0) return $rows;
92
+		if(count($rows) > 0) {
93
+		    return $rows;
94
+		}
91 95
 		}
92 96
 	return null;
93 97
 }
@@ -98,15 +102,16 @@  discard block
 block discarded – undo
98 102
 	if(!empty($mod)){
99 103
 	global $current_language;
100 104
 	$mod_strings = return_module_language($current_language, $mod);
101
-	}else global $mod_strings;
105
+	} else {
106
+	    global $mod_strings;
107
+	}
102 108
 	global $app_strings;
103 109
 	$cols = sizeof($rows[0]) * 2 + 1;
104 110
 	if ($action != 'ShowDuplicates') 
105 111
 	{
106 112
 		$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>';
107 113
 		$form .= "<form action='index.php' method='post' name='dupProspects'><input type='hidden' name='selectedProspect' value=''>";
108
-	}
109
-	else 
114
+	} else 
110 115
 	{
111 116
 		$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_SHOW_DUPLICATES']. '</td></tr><tr><td height="20"></td></tr></table>';
112 117
 	}
@@ -132,8 +137,9 @@  discard block
 block discarded – undo
132 137
 	foreach($rows as $row){
133 138
 
134 139
 		$form .= "<tr class='$rowColor'>";
135
-		if ($action != 'ShowDuplicates') 
136
-			$form .= "<td width='1%' nowrap='nowrap' ><a href='#' onClick=\"document.dupProspects.selectedProspect.value='${row['id']}';document.dupProspects.submit() \">[${app_strings['LBL_SELECT_BUTTON_LABEL']}]</a>&nbsp;&nbsp;</td>\n";
140
+		if ($action != 'ShowDuplicates') {
141
+					$form .= "<td width='1%' nowrap='nowrap' ><a href='#' onClick=\"document.dupProspects.selectedProspect.value='${row['id']}';document.dupProspects.submit() \">[${app_strings['LBL_SELECT_BUTTON_LABEL']}]</a>&nbsp;&nbsp;</td>\n";
142
+		}
137 143
 		
138 144
 		$wasSet = false;
139 145
 
@@ -142,8 +148,7 @@  discard block
 block discarded – undo
142 148
                 if(!$wasSet) {
143 149
                     $form .= "<td scope='row' ><a target='_blank' href='index.php?module=Prospects&action=DetailView&record=${row['id']}'>$value</a></td>\n";
144 150
                     $wasSet = true;
145
-                }
146
-                else {
151
+                } else {
147 152
                     $form .= "<td><a target='_blank' href='index.php?module=Prospects&action=DetailView&record=${row['id']}'>$value</a></td>\n";
148 153
                 }
149 154
             }
@@ -151,7 +156,7 @@  discard block
 block discarded – undo
151 156
 
152 157
 		if($rowColor == 'evenListRowS1'){
153 158
 			$rowColor = 'oddListRowS1';
154
-		}else{
159
+		} else{
155 160
 			 $rowColor = 'evenListRowS1';
156 161
 		}
157 162
 		$form .= "</tr>";
@@ -374,7 +379,9 @@  discard block
 block discarded – undo
374 379
 if(!empty($mod)){
375 380
 	global $current_language;
376 381
 	$mod_strings = return_module_language($current_language, $mod);
377
-}else global $mod_strings;
382
+} else {
383
+    global $mod_strings;
384
+}
378 385
 global $app_strings;
379 386
 
380 387
 $lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
@@ -423,10 +430,16 @@  discard block
 block discarded – undo
423 430
 	if(!$focus->ACLAccess('Save')){
424 431
 		return null;
425 432
 	}
426
-	if (!isset($GLOBALS['check_notify'])) $GLOBALS['check_notify']=false;
433
+	if (!isset($GLOBALS['check_notify'])) {
434
+	    $GLOBALS['check_notify']=false;
435
+	}
427 436
 	
428
-	if (!isset($_POST[$prefix.'email_opt_out'])) $focus->email_opt_out = 0;
429
-	if (!isset($_POST[$prefix.'do_not_call'])) $focus->do_not_call = 0;
437
+	if (!isset($_POST[$prefix.'email_opt_out'])) {
438
+	    $focus->email_opt_out = 0;
439
+	}
440
+	if (!isset($_POST[$prefix.'do_not_call'])) {
441
+	    $focus->do_not_call = 0;
442
+	}
430 443
 	
431 444
 	if (empty($_POST['record']) && empty($_POST['dup_checked'])) {
432 445
 		/*
@@ -482,15 +495,29 @@  discard block
 block discarded – undo
482 495
 	$GLOBALS['log']->debug("Saved record with id of ".$return_id);
483 496
     if(isset($_POST['popup']) && $_POST['popup'] == 'true') {
484 497
         $get = '&module=';
485
-        if(!empty($_POST['return_module'])) $get .= $_POST['return_module'];
486
-        else $get .= 'Prospects';
498
+        if(!empty($_POST['return_module'])) {
499
+            $get .= $_POST['return_module'];
500
+        } else {
501
+            $get .= 'Prospects';
502
+        }
487 503
         $get .= '&action=';
488
-        if(!empty($_POST['return_action'])) $get .= $_POST['return_action'];
489
-        else $get .= 'Popup';
490
-        if(!empty($_POST['return_id'])) $get .= '&return_id='.$_POST['return_id'];
491
-        if(!empty($_POST['popup'])) $get .= '&popup='.$_POST['popup'];
492
-        if(!empty($_POST['create'])) $get .= '&create='.$_POST['create'];
493
-        if(!empty($_POST['to_pdf'])) $get .= '&to_pdf='.$_POST['to_pdf'];
504
+        if(!empty($_POST['return_action'])) {
505
+            $get .= $_POST['return_action'];
506
+        } else {
507
+            $get .= 'Popup';
508
+        }
509
+        if(!empty($_POST['return_id'])) {
510
+            $get .= '&return_id='.$_POST['return_id'];
511
+        }
512
+        if(!empty($_POST['popup'])) {
513
+            $get .= '&popup='.$_POST['popup'];
514
+        }
515
+        if(!empty($_POST['create'])) {
516
+            $get .= '&create='.$_POST['create'];
517
+        }
518
+        if(!empty($_POST['to_pdf'])) {
519
+            $get .= '&to_pdf='.$_POST['to_pdf'];
520
+        }
494 521
         $get .= '&first_name=' . $focus->first_name;
495 522
         $get .= '&last_name=' . $focus->last_name;
496 523
         $get .= '&query=true';
@@ -500,7 +527,7 @@  discard block
 block discarded – undo
500 527
 	if($redirect){
501 528
 	    require_once('include/formbase.php');
502 529
 	    handleRedirect($return_id, 'Prospects');
503
-	}else{
530
+	} else{
504 531
 		return $focus;
505 532
 	}
506 533
 }
Please login to merge, or discard this patch.
modules/Prospects/metadata/additionalDetails.php 1 patch
Braces   +51 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -48,42 +50,70 @@  discard block
 block discarded – undo
48 50
 		
49 51
 	$overlib_string = '';
50 52
 	
51
-	if(!empty($fields['ACCOUNT_NAME'])) $overlib_string .= '<b>'. $mod_strings['LBL_EDIT_ACCOUNT_NAME'] . '</b> ' . $fields['ACCOUNT_NAME'] . '<br>';
53
+	if(!empty($fields['ACCOUNT_NAME'])) {
54
+	    $overlib_string .= '<b>'. $mod_strings['LBL_EDIT_ACCOUNT_NAME'] . '</b> ' . $fields['ACCOUNT_NAME'] . '<br>';
55
+	}
52 56
 	if(!empty($fields['PRIMARY_ADDRESS_STREET']) || !empty($fields['PRIMARY_ADDRESS_CITY']) ||
53 57
 		!empty($fields['PRIMARY_ADDRESS_STATE']) || !empty($fields['PRIMARY_ADDRESS_POSTALCODE']) ||
54
-		!empty($fields['PRIMARY_ADDRESS_COUNTRY']))
55
-			$overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>';
56
-	if(!empty($fields['PRIMARY_ADDRESS_STREET'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>';
57
-	if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>';
58
-	if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>';
59
-	if(!empty($fields['PRIMARY_ADDRESS_CITY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', ';
60
-	if(!empty($fields['PRIMARY_ADDRESS_STATE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' ';
61
-	if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' ';
62
-	if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>';
63
-	if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) 
64
-		$overlib_string .= '<br>';  
65
-	if(!empty($fields['PHONE_MOBILE'])) $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>';
66
-	if(!empty($fields['PHONE_HOME'])) $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>';
67
-	if(!empty($fields['PHONE_OTHER'])) $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>';
58
+		!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) {
59
+				$overlib_string .= '<b>' . $mod_strings['LBL_PRIMARY_ADDRESS'] . '</b><br>';
60
+	}
61
+	if(!empty($fields['PRIMARY_ADDRESS_STREET'])) {
62
+	    $overlib_string .= $fields['PRIMARY_ADDRESS_STREET'] . '<br>';
63
+	}
64
+	if(!empty($fields['PRIMARY_ADDRESS_STREET_2'])) {
65
+	    $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_2'] . '<br>';
66
+	}
67
+	if(!empty($fields['PRIMARY_ADDRESS_STREET_3'])) {
68
+	    $overlib_string .= $fields['PRIMARY_ADDRESS_STREET_3'] . '<br>';
69
+	}
70
+	if(!empty($fields['PRIMARY_ADDRESS_CITY'])) {
71
+	    $overlib_string .= $fields['PRIMARY_ADDRESS_CITY'] . ', ';
72
+	}
73
+	if(!empty($fields['PRIMARY_ADDRESS_STATE'])) {
74
+	    $overlib_string .= $fields['PRIMARY_ADDRESS_STATE'] . ' ';
75
+	}
76
+	if(!empty($fields['PRIMARY_ADDRESS_POSTALCODE'])) {
77
+	    $overlib_string .= $fields['PRIMARY_ADDRESS_POSTALCODE'] . ' ';
78
+	}
79
+	if(!empty($fields['PRIMARY_ADDRESS_COUNTRY'])) {
80
+	    $overlib_string .= $fields['PRIMARY_ADDRESS_COUNTRY'] . '<br>';
81
+	}
82
+	if(strlen($overlib_string) > 0 && !(strrpos($overlib_string, '<br>') == strlen($overlib_string) - 4)) {
83
+			$overlib_string .= '<br>';
84
+	}
85
+	if(!empty($fields['PHONE_MOBILE'])) {
86
+	    $overlib_string .= '<b>'. $mod_strings['LBL_MOBILE_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_MOBILE'] . '</span><br>';
87
+	}
88
+	if(!empty($fields['PHONE_HOME'])) {
89
+	    $overlib_string .= '<b>'. $mod_strings['LBL_HOME_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_HOME'] . '</span><br>';
90
+	}
91
+	if(!empty($fields['PHONE_OTHER'])) {
92
+	    $overlib_string .= '<b>'. $mod_strings['LBL_OTHER_PHONE'] . '</b> <span class="phone">' . $fields['PHONE_OTHER'] . '</span><br>';
93
+	}
68 94
 
69
-	if(!empty($fields['EMAIL1'])) 
70
-		$overlib_string .= '<b>'. $mod_strings['LBL_EMAIL_ADDRESS'] . '</b> ' . 
95
+	if(!empty($fields['EMAIL1'])) {
96
+			$overlib_string .= '<b>'. $mod_strings['LBL_EMAIL_ADDRESS'] . '</b> ' . 
71 97
 								 "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" .
72 98
 								 "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" .
73 99
 								 "={$fields['FIRST_NAME']}&nbsp;{$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL1']}&" .
74 100
 								 "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL1']}>") .
75 101
 								 "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL1']}</a><br>";
76
-	if(!empty($fields['EMAIL2'])) 
77
-		$overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . 
102
+	}
103
+	if(!empty($fields['EMAIL2'])) {
104
+			$overlib_string .= '<b>'. $mod_strings['LBL_OTHER_EMAIL_ADDRESS'] . '</b> ' . 
78 105
 								 "<a href=index.php?module=Emails&action=Compose&contact_id={$fields['ID']}&" .
79 106
 								 "parent_type=Contacts&parent_id={$fields['ID']}&to_addrs_ids={$fields['ID']}&to_addrs_names" .
80 107
 								 "={$fields['FIRST_NAME']}&nbsp;{$fields['LAST_NAME']}&to_addrs_emails={$fields['EMAIL2']}&" .
81 108
 								 "to_email_addrs=" . urlencode("{$fields['FIRST_NAME']} {$fields['LAST_NAME']} <{$fields['EMAIL2']}>") .
82 109
 								 "&return_module=Contacts&return_action=ListView'>{$fields['EMAIL2']}</a><br>";
110
+	}
83 111
 	
84 112
 	if(!empty($fields['DESCRIPTION'])) { 
85 113
 		$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
86
-		if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
114
+		if(strlen($fields['DESCRIPTION']) > 300) {
115
+		    $overlib_string .= '...';
116
+		}
87 117
 	}	
88 118
 	
89 119
 	return array('fieldToAddTo' => 'FULL_NAME', 
Please login to merge, or discard this patch.
modules/Documents/DocumentExternalApiDropDown.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry)
2
+if(!defined('sugarEntry') || !sugarEntry) {
3 3
 	die('Not A Valid Entry Point');
4
+}
4 5
 /*********************************************************************************
5 6
  * SugarCRM Community Edition is a customer relationship management program developed by
6 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
Please login to merge, or discard this patch.
modules/Documents/Document.php 1 patch
Braces   +22 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry)
2
+if(!defined('sugarEntry') || !sugarEntry) {
3 3
 	die('Not A Valid Entry Point');
4
+}
4 5
 /*********************************************************************************
5 6
  * SugarCRM Community Edition is a customer relationship management program developed by
6 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -237,9 +238,13 @@  discard block
 block discarded – undo
237 238
             	$this->name = $this->document_name;
238 239
             }
239 240
 
240
-            if(isset($row['filename']))$this->filename = $row['filename'];
241
+            if(isset($row['filename'])) {
242
+                $this->filename = $row['filename'];
243
+            }
241 244
             //$this->latest_revision = $row['revision'];
242
-            if(isset($row['revision']))$this->revision = $row['revision'];
245
+            if(isset($row['revision'])) {
246
+                $this->revision = $row['revision'];
247
+            }
243 248
 
244 249
             //image is selected based on the extension name <ext>_icon_inline, extension is stored in document_revisions.
245 250
             //if file is not found then default image file will be used.
@@ -266,7 +271,7 @@  discard block
 block discarded – undo
266 271
 
267 272
     		$this->file_url = $file_url;
268 273
     		$this->file_url_noimage = "index.php?entryPoint=download&type=Documents&id={$this->document_revision_id}";
269
-		}else{
274
+		} else{
270 275
             $this->file_url = "";
271 276
             $this->file_url_noimage = "";
272 277
 		}
@@ -306,15 +311,17 @@  discard block
 block discarded – undo
306 311
 
307 312
 		$where_auto = " documents.deleted = 0";
308 313
 
309
-		if ($where != "")
310
-			$query .= " WHERE $where AND ".$where_auto;
311
-		else
312
-			$query .= " WHERE ".$where_auto;
314
+		if ($where != "") {
315
+					$query .= " WHERE $where AND ".$where_auto;
316
+		} else {
317
+					$query .= " WHERE ".$where_auto;
318
+		}
313 319
 
314
-		if ($order_by != "")
315
-			$query .= " ORDER BY $order_by";
316
-		else
317
-			$query .= " ORDER BY documents.document_name";
320
+		if ($order_by != "") {
321
+					$query .= " ORDER BY $order_by";
322
+		} else {
323
+					$query .= " ORDER BY documents.document_name";
324
+		}
318 325
 
319 326
 		return $query;
320 327
 	}
@@ -374,7 +381,9 @@  discard block
 block discarded – undo
374 381
 
375 382
 	//static function.
376 383
 	function get_document_name($doc_id){
377
-		if (empty($doc_id)) return null;
384
+		if (empty($doc_id)) {
385
+		    return null;
386
+		}
378 387
 
379 388
 		$db = DBManagerFactory::getInstance();
380 389
 		$query="select document_name from documents where id='$doc_id'  and deleted=0";
Please login to merge, or discard this patch.
modules/Campaigns/PopupCampaignRoi.php 1 patch
Braces   +8 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -108,8 +110,10 @@  discard block
 block discarded – undo
108 110
 	$currency->retrieve($focus->currency_id);
109 111
 	if( $currency->deleted != 1){
110 112
 		$xtpl->assign("CURRENCY", $currency->iso4217 .' '.$currency->symbol );
111
-	}else $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
112
-}else{
113
+	} else {
114
+	    $xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
115
+	}
116
+	} else{
113 117
 
114 118
 	$xtpl->assign("CURRENCY", $currency->getDefaultISO4217() .' '.$currency->getDefaultCurrencySymbol() );
115 119
 
@@ -185,7 +189,7 @@  discard block
 block discarded – undo
185 189
     if(!empty($selected_marketing_id)){$latest_marketing_id = $selected_marketing_id;}
186 190
     if(empty($latest_marketing_id) ||  $latest_marketing_id === 'all'){
187 191
         $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'],$app_list_strings['roi_type_dom'],$campaign_id,sugar_cached("xml/") . $cache_file_name_roi,true));
188
-    }else{
192
+    } else{
189 193
 
190 194
     $xtpl->assign("MY_CHART_ROI", $chart->campaign_response_roi_popup($app_list_strings['roi_type_dom'],$app_list_strings['roi_type_dom'],$campaign_id,sugar_cached("xml/") .$cache_file_name_roi,true));
191 195
     }
Please login to merge, or discard this patch.
modules/Campaigns/WizardEmailSetupSave.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -100,7 +102,7 @@  discard block
 block discarded – undo
100 102
             //an error was found during inbound save.  This means the save was allowed but the inbound box had problems, return user to wizard
101 103
             //and display error message
102 104
             header("Location: index.php?action=WizardEmailSetup&module=Campaigns&error=true");
103
-    }else{
105
+    } else{
104 106
         //set navigation details
105 107
         header("Location: index.php?action=index&module=Campaigns");
106 108
     }
Please login to merge, or discard this patch.
modules/Campaigns/WebToLeadCapture.php 1 patch
Braces   +13 added lines, -17 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -157,8 +159,7 @@  discard block
 block discarded – undo
157 159
 		        $lead->campaigns->add($camplog->id);
158 160
                 if(!empty($GLOBALS['check_notify'])) {
159 161
                     $lead->save($GLOBALS['check_notify']);
160
-                }
161
-                else {
162
+                } else {
162 163
                     $lead->save(FALSE);
163 164
                 }
164 165
             }
@@ -188,14 +189,14 @@  discard block
 block discarded – undo
188 189
 				$get_and_post = array_merge($_GET, $_POST);
189 190
 				foreach($get_and_post as $param => $value) {
190 191
 
191
-					if($param == 'redirect_url' && $param == 'submit')
192
-						continue;
192
+					if($param == 'redirect_url' && $param == 'submit') {
193
+											continue;
194
+					}
193 195
 					
194 196
 					if($first_iteration){
195 197
 						$first_iteration = false;
196 198
 						$query_string .= $first_char;
197
-					}
198
-					else{
199
+					} else{
199 200
 						$query_string .= "&";
200 201
 					}
201 202
 					$query_string .= "{$param}=".urlencode($value);
@@ -203,8 +204,7 @@  discard block
 block discarded – undo
203 204
 				if(empty($lead)) {
204 205
 					if($first_iteration){
205 206
 						$query_string .= $first_char;
206
-					}
207
-					else{
207
+					} else{
208 208
 						$query_string .= "&";
209 209
 					}
210 210
 					$query_string .= "error=1";
@@ -229,20 +229,17 @@  discard block
 block discarded – undo
229 229
     				}
230 230
     				echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
231 231
     				echo '</body></html>';
232
-    			}
233
-				else{
232
+    			} else{
234 233
     				header("Location: {$redirect_url}");
235 234
     				die();
236 235
 			    }
237
-			}
238
-			else{
236
+			} else{
239 237
 				echo $mod_strings['LBL_THANKS_FOR_SUBMITTING_LEAD'];
240 238
 			}
241 239
 			sugar_cleanup();
242 240
 			// die to keep code from running into redirect case below
243 241
 			die();
244
-	    }
245
-	   else{
242
+	    } else{
246 243
 	  	  echo $mod_strings['LBL_SERVER_IS_CURRENTLY_UNAVAILABLE'];
247 244
 	  }
248 245
 }
@@ -253,8 +250,7 @@  discard block
 block discarded – undo
253 250
     	echo '<form name="redirect" action="' .$_POST['redirect']. '" method="GET">';
254 251
     	echo '</form><script language="javascript" type="text/javascript">document.redirect.submit();</script>';
255 252
     	echo '</body></html>';
256
-    }
257
-    else{
253
+    } else{
258 254
     	header("Location: {$_POST['redirect']}");
259 255
     	die();
260 256
     }
Please login to merge, or discard this patch.
modules/Campaigns/WizardEmailSetup.php 1 patch
Braces   +17 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -55,7 +57,9 @@  discard block
 block discarded – undo
55 57
 global $mod_strings,$app_list_strings,$app_strings,$current_user;
56 58
 
57 59
 
58
-if (!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Campaigns')) sugar_die("Unauthorized access to administration.");
60
+if (!is_admin($current_user)&& !is_admin_for_module($GLOBALS['current_user'],'Campaigns')) {
61
+    sugar_die("Unauthorized access to administration.");
62
+}
59 63
 
60 64
 $params = array();
61 65
 $params[] = "<a href='index.php?module=Campaigns&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>";
@@ -78,9 +82,15 @@  discard block
 block discarded – undo
78 82
 $ss = new Sugar_Smarty();
79 83
 $ss->assign("MOD", $mod_strings);
80 84
 $ss->assign("APP", $app_strings);
81
-if (isset($_REQUEST['return_module'])) $ss->assign("RETURN_MODULE", $_REQUEST['return_module']);
82
-if (isset($_REQUEST['return_action'])) $ss->assign("RETURN_ACTION", $_REQUEST['return_action']);
83
-if (isset($_REQUEST['return_id'])) $ss->assign("RETURN_ID", $_REQUEST['return_id']);
85
+if (isset($_REQUEST['return_module'])) {
86
+    $ss->assign("RETURN_MODULE", $_REQUEST['return_module']);
87
+}
88
+if (isset($_REQUEST['return_action'])) {
89
+    $ss->assign("RETURN_ACTION", $_REQUEST['return_action']);
90
+}
91
+if (isset($_REQUEST['return_id'])) {
92
+    $ss->assign("RETURN_ID", $_REQUEST['return_id']);
93
+}
84 94
 
85 95
 
86 96
 
@@ -146,7 +156,7 @@  discard block
 block discarded – undo
146 156
                 
147 157
      if( $colorclass == "class='evenListRowS1'"){
148 158
             $colorclass= "class='oddListRowS1'";
149
-        }else{ 
159
+        } else{ 
150 160
             $colorclass= "class='evenListRowS1'";
151 161
         }           
152 162
         
@@ -159,7 +169,7 @@  discard block
 block discarded – undo
159 169
     }
160 170
 
161 171
 
162
-}else{
172
+} else{
163 173
 $need_mbox = 'checked';
164 174
 $mboxTable .= "<tr><td colspan='5'><b>".$mod_strings['LBL_MAILBOX_CHECK_WIZ_BAD']." </b>.</td></tr>";
165 175
 }        
Please login to merge, or discard this patch.
modules/Campaigns/ProcessBouncedEmails.php 1 patch
Braces   +17 added lines, -19 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -55,8 +57,9 @@  discard block
 block discarded – undo
55 57
     $contents = "";
56 58
     $query = "SELECT description FROM notes WHERE file_mime_type = 'messsage/rfc822' AND parent_type='Emails' AND parent_id = '".$email->id."' AND deleted=0";
57 59
     $rs = $GLOBALS['db']->query($query);
58
-    while ($row = $GLOBALS['db']->fetchByAssoc($rs)) 
59
-		$contents .= $row['description'];
60
+    while ($row = $GLOBALS['db']->fetchByAssoc($rs)) {
61
+    		$contents .= $row['description'];
62
+    }
60 63
 
61 64
     return $contents;
62 65
 }
@@ -89,9 +92,9 @@  discard block
 block discarded – undo
89 92
     {
90 93
         $bounce->activity_type='invalid email';
91 94
         markEmailAddressInvalid($email);
95
+    } else {
96
+            $bounce->activity_type='send error';
92 97
     }
93
-    else 
94
-        $bounce->activity_type='send error';
95 98
         
96 99
     $return_id=$bounce->save();
97 100
     return $return_id;
@@ -104,8 +107,9 @@  discard block
 block discarded – undo
104 107
  */
105 108
 function markEmailAddressInvalid($email_address)
106 109
 {
107
-    if(empty($email_address))
108
-        return;
110
+    if(empty($email_address)) {
111
+            return;
112
+    }
109 113
     $sea = new SugarEmailAddress();
110 114
     $rs = $sea->retrieve_by_string_fields( array('email_address_caps' => trim(strtoupper($email_address))) );
111 115
     if($rs != null)
@@ -149,8 +153,7 @@  discard block
 block discarded – undo
149 153
         $identifiers = preg_split('/X-CampTrackID: /',$matches[0],-1,PREG_SPLIT_NO_EMPTY);
150 154
         $found = TRUE;
151 155
         $GLOBALS['log']->debug("Found campaign identifier in header of email");  
152
-    }
153
-    else if( preg_match('/index.php\?entryPoint=removeme&identifier=[a-z0-9\-]*/',$email_description, $matches) )
156
+    } else if( preg_match('/index.php\?entryPoint=removeme&identifier=[a-z0-9\-]*/',$email_description, $matches) )
154 157
     {
155 158
         $identifiers = preg_split('/index.php\?entryPoint=removeme&identifier=/',$matches[0],-1,PREG_SPLIT_NO_EMPTY);
156 159
         $found = TRUE;
@@ -207,32 +210,27 @@  discard block
 block discarded – undo
207 210
 					{
208 211
 						$return_id = createBouncedCampaignLogEntry($row, $email, $email_description);	
209 212
 						return TRUE;
210
-					}				
211
-					else 
213
+					} else 
212 214
 					{
213 215
 					    $GLOBALS['log']->debug("Warning: campaign log entry already exists for identifier $identifier");
214 216
 					    return FALSE;
215 217
 					}
216
-				} 
217
-				else 
218
+				} else 
218 219
 				{
219 220
 				    $GLOBALS['log']->info("Warning: skipping bounced email with this tracker_key(identifier) in the message body: ".$identifier);
220 221
 					return FALSE;
221 222
 				}			
222
-    		} 
223
-    		else 
223
+    		} else 
224 224
     		{
225 225
     			$GLOBALS['log']->info("Warning: Empty identifier for campaign log.");
226 226
     			return FALSE;
227 227
     		}
228
-    	}  
229
-    	else 
228
+    	} else 
230 229
     	{
231 230
     	    $GLOBALS['log']->info("Warning: skipping bounced email because it does not have the removeme link.");	
232 231
     		return FALSE;	
233 232
       	}
234
-  } 
235
-  else 
233
+  } else 
236 234
   {
237 235
 	$GLOBALS['log']->info("Warning: skipping bounced email because the sender is not MAILER-DAEMON.");
238 236
 	return FALSE;
Please login to merge, or discard this patch.