Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
Charts/Dashlets/PipelineBySalesStageDashlet/PipelineBySalesStageDashlet.php 1 patch
Braces   +21 added lines, -15 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.
@@ -65,14 +67,17 @@  discard block
 block discarded – undo
65 67
     {
66 68
         global $timedate;
67 69
 
68
-        if(empty($options['pbss_date_start']))
69
-            $options['pbss_date_start'] = $timedate->nowDbDate();
70
+        if(empty($options['pbss_date_start'])) {
71
+                    $options['pbss_date_start'] = $timedate->nowDbDate();
72
+        }
70 73
 
71
-        if(empty($options['pbss_date_end']))
72
-            $options['pbss_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months"));
74
+        if(empty($options['pbss_date_end'])) {
75
+                    $options['pbss_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months"));
76
+        }
73 77
 
74
-        if(empty($options['title']))
75
-            $options['title'] = translate('LBL_RGraph_PIPELINE_FORM_TITLE', 'Home');
78
+        if(empty($options['title'])) {
79
+                    $options['title'] = translate('LBL_RGraph_PIPELINE_FORM_TITLE', 'Home');
80
+        }
76 81
 
77 82
         parent::__construct($id,$options);
78 83
     }
@@ -84,11 +89,12 @@  discard block
 block discarded – undo
84 89
     {
85 90
         global $app_list_strings;
86 91
 
87
-        if (!empty($this->pbss_sales_stages) && count($this->pbss_sales_stages) > 0)
88
-            foreach ($this->pbss_sales_stages as $key)
92
+        if (!empty($this->pbss_sales_stages) && count($this->pbss_sales_stages) > 0) {
93
+                    foreach ($this->pbss_sales_stages as $key)
89 94
                 $selected_datax[] = $key;
90
-        else
91
-            $selected_datax = array_keys($app_list_strings['sales_stage_dom']);
95
+        } else {
96
+                    $selected_datax = array_keys($app_list_strings['sales_stage_dom']);
97
+        }
92 98
 
93 99
         $this->_searchFields['pbss_sales_stages']['options'] = $app_list_strings['sales_stage_dom'];
94 100
         $this->_searchFields['pbss_sales_stages']['input_name0'] = $selected_datax;
@@ -263,15 +269,15 @@  discard block
 block discarded – undo
263 269
                 $datax[$key] = $app_list_strings['sales_stage_dom'][$key];
264 270
                 $selected_datax[] = $key;
265 271
             }
266
-        }
267
-        else {
272
+        } else {
268 273
             $datax = $app_list_strings['sales_stage_dom'];
269 274
             $selected_datax = array_keys($app_list_strings['sales_stage_dom']);
270 275
         }
271 276
 
272 277
         $result = $db->query($query);
273
-        while($row = $db->fetchByAssoc($result, false))
274
-            $temp_data[] = $row;
278
+        while($row = $db->fetchByAssoc($result, false)) {
279
+                    $temp_data[] = $row;
280
+        }
275 281
 
276 282
         // reorder and set the array based on the order of selected_datax
277 283
         foreach($selected_datax as $sales_stage){
Please login to merge, or discard this patch.
OpportunitiesByLeadSourceDashlet/OpportunitiesByLeadSourceDashlet.php 1 patch
Braces   +19 added lines, -13 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.
@@ -62,17 +64,19 @@  discard block
 block discarded – undo
62 64
         global $app_list_strings;
63 65
 
64 66
         $selected_datax = array();
65
-        if (!empty($this->pbls_lead_sources) && sizeof($this->pbls_lead_sources) > 0)
66
-            foreach ($this->pbls_lead_sources as $key)
67
+        if (!empty($this->pbls_lead_sources) && sizeof($this->pbls_lead_sources) > 0) {
68
+                    foreach ($this->pbls_lead_sources as $key)
67 69
                 $selected_datax[] = $key;
68
-        else
69
-            $selected_datax = array_keys($app_list_strings['lead_source_dom']);
70
+        } else {
71
+                    $selected_datax = array_keys($app_list_strings['lead_source_dom']);
72
+        }
70 73
 
71 74
         $this->_searchFields['pbls_lead_sources']['options'] = array_filter($app_list_strings['lead_source_dom']);
72 75
         $this->_searchFields['pbls_lead_sources']['input_name0'] = $selected_datax;
73 76
 
74
-        if (!isset($this->pbls_ids) || count($this->pbls_ids) == 0)
75
-            $this->_searchFields['pbls_ids']['input_name0'] = array_keys(get_user_array(false));
77
+        if (!isset($this->pbls_ids) || count($this->pbls_ids) == 0) {
78
+                    $this->_searchFields['pbls_ids']['input_name0'] = array_keys(get_user_array(false));
79
+        }
76 80
 
77 81
         return parent::displayOptions();
78 82
     }
@@ -241,12 +245,14 @@  discard block
 block discarded – undo
241 245
         $query = "SELECT lead_source,sum(amount_usdollar/1000) as total,count(*) as opp_count ".
242 246
             "FROM opportunities ";
243 247
         $query .= "WHERE opportunities.deleted=0 ";
244
-        if ( count($this->pbls_ids) > 0 )
245
-            $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->pbls_ids)."') ";
246
-        if ( count($this->pbls_lead_sources) > 0 )
247
-            $query .= "AND opportunities.lead_source IN ('".implode("','",$this->pbls_lead_sources)."') ";
248
-        else
249
-            $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') ";
248
+        if ( count($this->pbls_ids) > 0 ) {
249
+                    $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->pbls_ids)."') ";
250
+        }
251
+        if ( count($this->pbls_lead_sources) > 0 ) {
252
+                    $query .= "AND opportunities.lead_source IN ('".implode("','",$this->pbls_lead_sources)."') ";
253
+        } else {
254
+                    $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') ";
255
+        }
250 256
         $query .= "GROUP BY lead_source ORDER BY total DESC";
251 257
 
252 258
         return $query;
Please login to merge, or discard this patch.
OpportunitiesByLeadSourceByOutcomeDashlet.php 1 patch
Braces   +25 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.
@@ -61,17 +63,19 @@  discard block
 block discarded – undo
61 63
         global $app_list_strings;
62 64
 
63 65
         $selected_datax = array();
64
-        if (!empty($this->lsbo_lead_sources) && sizeof($this->lsbo_lead_sources) > 0)
65
-            foreach ($this->lsbo_lead_sources as $key)
66
+        if (!empty($this->lsbo_lead_sources) && sizeof($this->lsbo_lead_sources) > 0) {
67
+                    foreach ($this->lsbo_lead_sources as $key)
66 68
                 $selected_datax[] = $key;
67
-        else
68
-            $selected_datax = array_keys($app_list_strings['lead_source_dom']);
69
+        } else {
70
+                    $selected_datax = array_keys($app_list_strings['lead_source_dom']);
71
+        }
69 72
 
70 73
         $this->_searchFields['lsbo_lead_sources']['options'] = array_filter($app_list_strings['lead_source_dom']);
71 74
         $this->_searchFields['lsbo_lead_sources']['input_name0'] = $selected_datax;
72 75
 
73
-        if (!isset($this->lsbo_ids) || count($this->lsbo_ids) == 0)
74
-            $this->_searchFields['lsbo_ids']['input_name0'] = array_keys(get_user_array(false));
76
+        if (!isset($this->lsbo_ids) || count($this->lsbo_ids) == 0) {
77
+                    $this->_searchFields['lsbo_ids']['input_name0'] = array_keys(get_user_array(false));
78
+        }
75 79
 
76 80
         return parent::displayOptions();
77 81
     }
@@ -131,8 +135,9 @@  discard block
 block discarded – undo
131 135
 
132 136
 
133 137
         $url_params = array();
134
-        if ( count($this->lsbo_ids) > 0 )
135
-            $url_params['assigned_user_id'] = array_values($this->lsbo_ids);
138
+        if ( count($this->lsbo_ids) > 0 ) {
139
+                    $url_params['assigned_user_id'] = array_values($this->lsbo_ids);
140
+        }
136 141
 
137 142
 
138 143
         $data = $this->getChartData($this->constructQuery());
@@ -253,12 +258,14 @@  discard block
 block discarded – undo
253 258
         $query = "SELECT lead_source,sales_stage,sum(amount_usdollar/1000) as total, ".
254 259
             "count(*) as opp_count FROM opportunities ";
255 260
         $query .= " WHERE opportunities.deleted=0 ";
256
-        if ( count($this->lsbo_ids) > 0 )
257
-            $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->lsbo_ids)."') ";
258
-        if ( count($this->lsbo_lead_sources) > 0 )
259
-            $query .= "AND opportunities.lead_source IN ('".implode("','",$this->lsbo_lead_sources)."') ";
260
-        else
261
-            $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') ";
261
+        if ( count($this->lsbo_ids) > 0 ) {
262
+                    $query .= "AND opportunities.assigned_user_id IN ('".implode("','",$this->lsbo_ids)."') ";
263
+        }
264
+        if ( count($this->lsbo_lead_sources) > 0 ) {
265
+                    $query .= "AND opportunities.lead_source IN ('".implode("','",$this->lsbo_lead_sources)."') ";
266
+        } else {
267
+                    $query .= "AND opportunities.lead_source IN ('".implode("','",array_keys($GLOBALS['app_list_strings']['lead_source_dom']))."') ";
268
+        }
262 269
         $query .= " GROUP BY sales_stage,lead_source ORDER BY lead_source,sales_stage";
263 270
 
264 271
         return $query;
@@ -282,8 +289,9 @@  discard block
 block discarded – undo
282 289
                 $chart['labels'][] = $key;
283 290
                 $chart['data'][] = array();
284 291
             }
285
-            if(!in_array($stage,$chart['key']))
286
-                $chart['key'][] = $stage;
292
+            if(!in_array($stage,$chart['key'])) {
293
+                            $chart['key'][] = $stage;
294
+            }
287 295
 
288 296
             $formattedFloat = (float)number_format((float)$i["total"], 2, '.', '');
289 297
             $chart['data'][count($chart['data'])-1][] = $formattedFloat;
Please login to merge, or discard this patch.
modules/Charts/Dashlets/CampaignROIChartDashlet/CampaignROIChartDashlet.php 1 patch
Braces   +27 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.
@@ -60,11 +62,12 @@  discard block
 block discarded – undo
60 62
         $this->getSeedBean()->disable_row_level_security = false;
61 63
 
62 64
         $campaigns = $this->getSeedBean()->get_full_list("","");
63
-        if ( $campaigns != null )
64
-            foreach ($campaigns as $c)
65
+        if ( $campaigns != null ) {
66
+                    foreach ($campaigns as $c)
65 67
                 $this->_searchFields['campaign_id']['options'][$c->id] = $c->name;
66
-        else
67
-            $this->_searchFields['campaign_id']['options'] = array();
68
+        } else {
69
+                    $this->_searchFields['campaign_id']['options'] = array();
70
+        }
68 71
 
69 72
         return parent::displayOptions();
70 73
     }
@@ -234,7 +237,9 @@  discard block
 block discarded – undo
234 237
 
235 238
         $opp_result=$focus->db->query($opp_query);
236 239
         $opp_data=$focus->db->fetchByAssoc($opp_result);
237
-        if (empty($opp_data['total_value'])) $opp_data['total_value']=0;
240
+        if (empty($opp_data['total_value'])) {
241
+            $opp_data['total_value']=0;
242
+        }
238 243
 
239 244
         $chartData['Total Value']= $opp_data['total_value'];
240 245
 
@@ -252,7 +257,7 @@  discard block
 block discarded – undo
252 257
         if (empty($opp_data1['revenue'])){
253 258
             $opp_data1[$mod_strings['LBL_ROI_CHART_REVENUE']] = 0;
254 259
             unset($opp_data1['revenue']);
255
-        }else{
260
+        } else{
256 261
             $opp_data1[$mod_strings['LBL_ROI_CHART_REVENUE']] = $opp_data1['revenue'];
257 262
             unset($opp_data1['revenue']);
258 263
             $not_empty = true;
@@ -269,18 +274,21 @@  discard block
 block discarded – undo
269 274
         $camp_data1=$focus->db->fetchByAssoc($camp_result1);
270 275
 
271 276
 
272
-        if (empty($camp_data1['investment']))
273
-            $camp_data1['investment'] = 0;
274
-        else
275
-            $not_empty = true;
276
-        if (empty($camp_data1['budget']))
277
-            $camp_data1['budget'] = 0;
278
-        else
279
-            $not_empty = true;
280
-        if (empty($camp_data1['expected_revenue']))
281
-            $camp_data1['expected_revenue'] = 0;
282
-        else
283
-            $not_empty = true;
277
+        if (empty($camp_data1['investment'])) {
278
+                    $camp_data1['investment'] = 0;
279
+        } else {
280
+                    $not_empty = true;
281
+        }
282
+        if (empty($camp_data1['budget'])) {
283
+                    $camp_data1['budget'] = 0;
284
+        } else {
285
+                    $not_empty = true;
286
+        }
287
+        if (empty($camp_data1['expected_revenue'])) {
288
+                    $camp_data1['expected_revenue'] = 0;
289
+        } else {
290
+                    $not_empty = true;
291
+        }
284 292
 
285 293
         $chartData['Investment']= $camp_data1['investment'];
286 294
         $chartData['Budget']= $camp_data1['budget'];
Please login to merge, or discard this patch.
modules/Administration/SupportPortal.php 1 patch
Braces   +19 added lines, -11 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.
@@ -53,7 +55,9 @@  discard block
 block discarded – undo
53 55
 
54 56
 switch ($_REQUEST['view']) {
55 57
 	case "support_portal":
56
-		if (!is_admin($current_user)) sugar_die("Unauthorized access to administration.");
58
+		if (!is_admin($current_user)) {
59
+		    sugar_die("Unauthorized access to administration.");
60
+		}
57 61
 		$GLOBALS['log']->info("Administration SupportPortal");
58 62
 
59 63
 		$iframe_url = add_http("www.sugarcrm.com/network/redirect.php?tmpl=network");
@@ -83,14 +87,18 @@  discard block
 block discarded – undo
83 87
 		$send_key = isset($_REQUEST['key']) ? $_REQUEST['key'] : "";
84 88
 		$send_anchor = '';
85 89
 		// awu: Fixes the ProjectTasks pluralization issue -- must fix in later versions.
86
-		if ($send_module == 'ProjectTasks')
87
-			$send_module = 'ProjectTask';
88
-        if ($send_module == 'ProductCatalog')
89
-                $send_module = 'ProductTemplates';
90
-        if ($send_module == 'TargetLists')
91
-                $send_module = 'ProspectLists';
92
-        if ($send_module == 'Targets')
93
-                $send_module = 'Prospects';                            
90
+		if ($send_module == 'ProjectTasks') {
91
+					$send_module = 'ProjectTask';
92
+		}
93
+        if ($send_module == 'ProductCatalog') {
94
+                        $send_module = 'ProductTemplates';
95
+        }
96
+        if ($send_module == 'TargetLists') {
97
+                        $send_module = 'ProspectLists';
98
+        }
99
+        if ($send_module == 'Targets') {
100
+                        $send_module = 'Prospects';
101
+        }
94 102
 		// FG - Bug 39819 - Check for custom help files
95 103
 		$helpPath = 'modules/'.$send_module.'/language/'.$send_lang.'.help.'.$send_action.'.html';
96 104
 		if (sugar_is_file("custom/" . $helpPath)) {
@@ -205,7 +213,7 @@  discard block
 block discarded – undo
205 213
 								$send_anchor = $map['anchor'];
206 214
 							}
207 215
 						}
208
-					}else{
216
+					} else{
209 217
 						$send_module = $map['name'];
210 218
 						if(!empty($map['anchor'])){
211 219
 								$send_anchor = $map['anchor'];
Please login to merge, or discard this patch.
modules/Administration/DiagnosticRun.php 1 patch
Braces   +74 added lines, -50 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.
@@ -47,7 +49,9 @@  discard block
 block discarded – undo
47 49
 global $current_user;
48 50
 
49 51
 
50
-if (!is_admin($current_user)) sugar_die("Unauthorized access to administration.");
52
+if (!is_admin($current_user)) {
53
+    sugar_die("Unauthorized access to administration.");
54
+}
51 55
 if (isset($GLOBALS['sugar_config']['hide_admin_diagnostics']) && $GLOBALS['sugar_config']['hide_admin_diagnostics'])
52 56
 {
53 57
     sugar_die("Unauthorized access to diagnostic tool.");
@@ -131,9 +135,9 @@  discard block
 block discarded – undo
131 135
     global $currentitems;
132 136
 
133 137
     $currentitems++;
134
-    if($currentitems == $totalitems)
135
-      update_progress_bar("diagnostic", 100, 100);
136
-    else
138
+    if($currentitems == $totalitems) {
139
+          update_progress_bar("diagnostic", 100, 100);
140
+    } else
137 141
     {
138 142
       $progress_bar_percent += ($itemweight / $GLOBALS['totalweight'] * 100);
139 143
       update_progress_bar("diagnostic", $progress_bar_percent, 100);
@@ -214,18 +218,21 @@  discard block
 block discarded – undo
214 218
 			//perform this check when counter is set to two, which means it is on the 'value' column
215 219
 			if($counter == 2) {
216 220
 				//if the previous "name" column value was set to smtppass, set replace_val to true
217
-				if(strcmp($row[$counter - 1], "smtppass") == 0  )
218
-					$replace_val = true;
221
+				if(strcmp($row[$counter - 1], "smtppass") == 0  ) {
222
+									$replace_val = true;
223
+				}
219 224
 
220 225
 				//if the previous "name" column value was set to smtppass,
221 226
 				//and the "category" value set to ldap, set replace_val to true
222
-				if (strcmp($row[$counter - 2], "ldap") == 0 && strcmp($row[$counter - 1], "admin_password") == 0)
223
-					$replace_val = true;
227
+				if (strcmp($row[$counter - 2], "ldap") == 0 && strcmp($row[$counter - 1], "admin_password") == 0) {
228
+									$replace_val = true;
229
+				}
224 230
 
225 231
 				//if the previous "name" column value was set to password,
226 232
 				//and the "category" value set to proxy, set replace_val to true
227
-				if(strcmp($row[$counter - 2], "proxy") == 0 && strcmp($row[$counter - 1], "password") == 0 )
228
-					$replace_val = true;
233
+				if(strcmp($row[$counter - 2], "proxy") == 0 && strcmp($row[$counter - 1], "password") == 0 ) {
234
+									$replace_val = true;
235
+				}
229 236
 			}
230 237
 
231 238
 			if($replace_val) {
@@ -245,8 +252,9 @@  discard block
 block discarded – undo
245 252
 // Deletes the directory recursively
246 253
 function deleteDir($dir)
247 254
 {
248
-   if (substr($dir, strlen($dir)-1, 1) != '/')
249
-       $dir .= '/';
255
+   if (substr($dir, strlen($dir)-1, 1) != '/') {
256
+          $dir .= '/';
257
+   }
250 258
 
251 259
    if ($handle = opendir($dir))
252 260
    {
@@ -256,21 +264,23 @@  discard block
 block discarded – undo
256 264
            {
257 265
                if (is_dir($dir.$obj))
258 266
                {
259
-                   if (!deleteDir($dir.$obj))
260
-                       return false;
261
-               }
262
-               elseif (is_file($dir.$obj))
267
+                   if (!deleteDir($dir.$obj)) {
268
+                                          return false;
269
+                   }
270
+               } elseif (is_file($dir.$obj))
263 271
                {
264
-                   if (!unlink($dir.$obj))
265
-                       return false;
272
+                   if (!unlink($dir.$obj)) {
273
+                                          return false;
274
+                   }
266 275
                }
267 276
            }
268 277
        }
269 278
 
270 279
        closedir($handle);
271 280
 
272
-       if (!@rmdir($dir))
273
-           return false;
281
+       if (!@rmdir($dir)) {
282
+                  return false;
283
+       }
274 284
        return true;
275 285
    }
276 286
    return false;
@@ -301,10 +311,11 @@  discard block
 block discarded – undo
301 311
 
302 312
 
303 313
 	//determine if files.md5 exists or not
304
-	if(file_exists('files.md5'))
305
-		$skip_md5_diff = false;
306
-	else
307
-		$skip_md5_diff = true;
314
+	if(file_exists('files.md5')) {
315
+			$skip_md5_diff = false;
316
+	} else {
317
+			$skip_md5_diff = true;
318
+	}
308 319
 
309 320
 	// array of all tables that we need to pull rows from below
310 321
 	$getDumpsFrom = array('config' => 'config',
@@ -392,8 +403,9 @@  discard block
 block discarded – undo
392 403
 
393 404
 
394 405
     //create directory for table definitions
395
-    if($getschema)
396
-      $tablesSchemaDir = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/{$db->dbName}/TableSchema/");
406
+    if($getschema) {
407
+          $tablesSchemaDir = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/{$db->dbName}/TableSchema/");
408
+    }
397 409
 
398 410
     //make sure they checked the box to get basic info
399 411
     if($getinfo)
@@ -547,13 +559,13 @@  discard block
 block discarded – undo
547 559
 		if(!isset($beanFiles[$beanz]))
548 560
 		{
549 561
 			echo "<font color=orange>NO! --- ".$beanz." is not an index in \$beanFiles</font><br>";
550
-		}
551
-		else
562
+		} else
552 563
 		{
553
-			if(file_exists($beanFiles[$beanz]))
554
-				echo "<font color=green>YES --- ".$beanz." file \"".$beanFiles[$beanz]."\" exists</font><br>";
555
-			else
556
-				echo "<font color=red>NO! --- ".$beanz." file \"".$beanFiles[$beanz]."\" does NOT exist</font><br>";
564
+			if(file_exists($beanFiles[$beanz])) {
565
+							echo "<font color=green>YES --- ".$beanz." file \"".$beanFiles[$beanz]."\" exists</font><br>";
566
+			} else {
567
+							echo "<font color=red>NO! --- ".$beanz." file \"".$beanFiles[$beanz]."\" does NOT exist</font><br>";
568
+			}
557 569
 		}
558 570
 	}
559 571
 
@@ -589,8 +601,9 @@  discard block
 block discarded – undo
589 601
 	global $curdatetime;
590 602
 	global $skip_md5_diff;
591 603
 	global $sod_guid;
592
-	if(file_exists('files.md5'))
593
-        include( 'files.md5');
604
+	if(file_exists('files.md5')) {
605
+	        include( 'files.md5');
606
+	}
594 607
 	//create dir for md5s
595 608
 	$md5_directory = create_cache_directory("diagnostic/".$sod_guid."/diagnostic".$curdatetime."/md5/");
596 609
 
@@ -598,15 +611,17 @@  discard block
 block discarded – undo
598 611
 	if(!$skip_md5_diff)
599 612
 	{
600 613
 		//make sure the files.md5
601
-		if($filesmd5)
602
-			if(!copy('files.md5', $md5_directory."files.md5"))
614
+		if($filesmd5) {
615
+					if(!copy('files.md5', $md5_directory."files.md5"))
603 616
 				echo "Couldn't copy files.md5 to ".$md5_directory."<br>Skipping md5 checks.<br>";
617
+		}
604 618
 	}
605 619
 
606 620
 	$md5_string_calculated = generateMD5array('./');
607 621
 
608
-	if($md5calculated)
609
-		write_array_to_file('md5_string_calculated', $md5_string_calculated, $md5_directory."md5_array_calculated.php");
622
+	if($md5calculated) {
623
+			write_array_to_file('md5_string_calculated', $md5_string_calculated, $md5_directory."md5_array_calculated.php");
624
+	}
610 625
 
611 626
 
612 627
 	//if the files.md5 didn't exist, we can't do this
@@ -668,8 +683,9 @@  discard block
 block discarded – undo
668 683
 
669 684
     foreach($tables as $t) {
670 685
 	$name = $t;
671
-	if ( $name == "does_not_exist" )
672
-	  continue;
686
+	if ( $name == "does_not_exist" ) {
687
+		  continue;
688
+	}
673 689
 	$comment = $comments[$t];
674 690
 	echo "<h2>Table: $t</h2>
675 691
 		<p><i>{$comment}</i></p>";
@@ -686,8 +702,9 @@  discard block
 block discarded – undo
686 702
 
687 703
 	foreach($fields[$t] as $k => $v) {
688 704
 	  // we only care about physical tables ('source' can be 'non-db' or 'nondb' or 'function' )
689
-	  if ( isset( $v[ 'source' ] ))
690
-	    continue;
705
+	  if ( isset( $v[ 'source' ] )) {
706
+	  	    continue;
707
+	  }
691 708
 	  $columnname = $v[ 'name' ];
692 709
 	  $columntype = $v[ 'type' ];
693 710
 	  $columndbtype = $v[ 'dbType' ];
@@ -695,13 +712,20 @@  discard block
 block discarded – undo
695 712
 	  $columncomment = $v[ 'comment' ];
696 713
 	  $columnrequired = $v[ 'required' ];
697 714
 
698
-	  if ( empty( $columnlen ) ) $columnlen = '<i>n/a</i>';
699
-	  if ( empty( $columncomment ) ) $columncomment = '<i>(none)</i>';
700
-	  if ( !empty( $columndbtype ) ) $columntype = $columndbtype;
701
-	  if ( empty( $columnrequired ) || ( $columnrequired == false ))
702
-	    $columndisplayrequired = 'no';
703
-	  else
704
-	    $columndisplayrequired = 'yes';
715
+	  if ( empty( $columnlen ) ) {
716
+	      $columnlen = '<i>n/a</i>';
717
+	  }
718
+	  if ( empty( $columncomment ) ) {
719
+	      $columncomment = '<i>(none)</i>';
720
+	  }
721
+	  if ( !empty( $columndbtype ) ) {
722
+	      $columntype = $columndbtype;
723
+	  }
724
+	  if ( empty( $columnrequired ) || ( $columnrequired == false )) {
725
+	  	    $columndisplayrequired = 'no';
726
+	  } else {
727
+	  	    $columndisplayrequired = 'yes';
728
+	  }
705 729
 
706 730
 	  echo '<TR BGCOLOR="#FFFFFF" ALIGN=left>
707 731
 			<TD ALIGN=left class=\"tabDetailViewDF\">'.$columnname.'</TD>
Please login to merge, or discard this patch.
modules/Administration/RepairSeedUsers.php 1 patch
Braces   +7 added lines, -6 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.
@@ -47,7 +49,7 @@  discard block
 block discarded – undo
47 49
     		$status = '';
48 50
     		if($_POST['activate'] == 'false'){
49 51
     			$status = 'Inactive';
50
-    		}else{
52
+    		} else{
51 53
     			$status = 'Active';
52 54
     		}
53 55
     	}
@@ -73,18 +75,17 @@  discard block
 block discarded – undo
73 75
 				<table cellspacing="{CELLSPACING}" class="otherview">
74 76
 					<tr>
75 77
 					    <td scope="row" width="30%"><?php echo $mod_strings['LBL_REPAIR_SEED_USERS_TITLE']; ?></td>
76
-					    <td><input type="submit" name="button" value="<?php if($row['status'] == 'Inactive'){echo $mod_strings['LBL_REPAIR_SEED_USERS_ACTIVATE'];}else{echo $mod_strings['LBL_REPAIR_SEED_USERS_DECACTIVATE'];} ?>"></td>
78
+					    <td><input type="submit" name="button" value="<?php if($row['status'] == 'Inactive'){echo $mod_strings['LBL_REPAIR_SEED_USERS_ACTIVATE'];} else{echo $mod_strings['LBL_REPAIR_SEED_USERS_DECACTIVATE'];} ?>"></td>
77 79
 					</tr>
78 80
 				</table>
79 81
 				</form>
80 82
 				</p>
81 83
 			<?php
82 84
 
83
-		}else{
85
+		} else{
84 86
 			echo 'No seed Users';
85 87
 		}
86
-}
87
-else{
88
+} else{
88 89
 	sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
89 90
 }
90 91
 ?>
91 92
\ No newline at end of file
Please login to merge, or discard this patch.
modules/Administration/Administration.php 1 patch
Braces   +15 added lines, -11 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.
@@ -106,10 +108,11 @@  discard block
 block discarded – undo
106 108
         }
107 109
 
108 110
         while($row = $this->db->fetchByAssoc($result)) {
109
-            if($row['category']."_".$row['name'] == 'ldap_admin_password' || $row['category']."_".$row['name'] == 'proxy_password')
110
-                $this->settings[$row['category']."_".$row['name']] = $this->decrypt_after_retrieve($row['value']);
111
-            else
112
-                $this->settings[$row['category']."_".$row['name']] = $row['value'];
111
+            if($row['category']."_".$row['name'] == 'ldap_admin_password' || $row['category']."_".$row['name'] == 'proxy_password') {
112
+                            $this->settings[$row['category']."_".$row['name']] = $this->decrypt_after_retrieve($row['value']);
113
+            } else {
114
+                            $this->settings[$row['category']."_".$row['name']] = $row['value'];
115
+            }
113 116
         }
114 117
         $this->settings[$category] = true;
115 118
 
@@ -118,8 +121,9 @@  discard block
 block discarded – undo
118 121
         $oe->getSystemMailerSettings();
119 122
 
120 123
         foreach($oe->field_defs as $def) {
121
-            if(strpos($def, "mail_") !== false)
122
-                $this->settings[$def] = $oe->$def;
124
+            if(strpos($def, "mail_") !== false) {
125
+                            $this->settings[$def] = $oe->$def;
126
+            }
123 127
         }
124 128
 
125 129
         // At this point, we have built a new array that should be cached.
@@ -162,13 +166,13 @@  discard block
 block discarded – undo
162 166
         $row = $this->db->fetchByAssoc($result);
163 167
         $row_count = $row['the_count'];
164 168
 
165
-        if($category."_".$key == 'ldap_admin_password' || $category."_".$key == 'proxy_password')
166
-            $value = $this->encrpyt_before_save($value);
169
+        if($category."_".$key == 'ldap_admin_password' || $category."_".$key == 'proxy_password') {
170
+                    $value = $this->encrpyt_before_save($value);
171
+        }
167 172
 
168 173
         if( $row_count == 0){
169 174
             $result = $this->db->query("INSERT INTO config (value, category, name) VALUES ('$value','$category', '$key')");
170
-        }
171
-        else{
175
+        } else{
172 176
             $result = $this->db->query("UPDATE config SET value = '{$value}' WHERE category = '{$category}' AND name = '{$key}'");
173 177
         }
174 178
         sugar_cache_clear('admin_settings_cache');
Please login to merge, or discard this patch.
modules/Administration/updater_utils.php 1 patch
Braces   +21 added lines, -15 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.
@@ -94,10 +96,11 @@  discard block
 block discarded – undo
94 96
 
95 97
 		if(!$send_usage_info){
96 98
 			$info['latest_tracker_id'] = -1;
97
-		}else{
99
+		} else{
98 100
 			$id=$db->getOne("select id from tracker order by date_modified desc", false, 'fetching most recent tracker entry');
99
-			if ( $id !== false )
100
-			    $info['latest_tracker_id'] = $id;
101
+			if ( $id !== false ) {
102
+						    $info['latest_tracker_id'] = $id;
103
+			}
101 104
 		}
102 105
 
103 106
 		$info['db_type']=$sugar_config['dbconfig']['db_type'];
@@ -105,7 +108,9 @@  discard block
 block discarded – undo
105 108
 	}
106 109
 	if(file_exists('distro.php')){
107 110
 		include('distro.php');
108
-		if(!empty($distro_name))$info['distro_name'] = $distro_name;
111
+		if(!empty($distro_name)) {
112
+		    $info['distro_name'] = $distro_name;
113
+		}
109 114
 	}
110 115
 	$info['os'] = php_uname('s');
111 116
 	$info['os_version'] = php_uname('r');
@@ -143,14 +148,16 @@  discard block
 block discarded – undo
143 148
 
144 149
 
145 150
 	$return_array=array();
146
-    if(!$from_install && empty($license))loadLicense(true);
151
+    if(!$from_install && empty($license)) {
152
+        loadLicense(true);
153
+    }
147 154
 
148 155
 	if(!$response_data){
149 156
 
150 157
         if($from_install){
151 158
     		$info = getBaseSystemInfo(false);
152 159
 
153
-        }else{
160
+        } else{
154 161
             $info = getSystemInfo($send_usage_info);
155 162
         }
156 163
 
@@ -183,7 +190,7 @@  discard block
 block discarded – undo
183 190
 		}
184 191
 		$encodedResult = $sclient->call('sugarHome', array('key'=>$key, 'data'=>$encoded));
185 192
 
186
-	}else{
193
+	} else{
187 194
 		$encodedResult = 	$response_data['data'];
188 195
 		$key = $response_data['key'];
189 196
 
@@ -197,7 +204,7 @@  discard block
 block discarded – undo
197 204
 			$resultData = array();
198 205
 			$resultData['validation'] = 'invalid validation key';
199 206
 		}
200
-	}else
207
+	} else
201 208
 	{
202 209
 		$resultData = array();
203 210
 		$resultData['versions'] = array();
@@ -209,22 +216,21 @@  discard block
 block discarded – undo
209 216
 		if(!empty($resultData['msg'])){
210 217
 			if(!empty($resultData['msg']['admin'])){
211 218
 				$license->saveSetting('license', 'msg_admin', base64_encode($resultData['msg']['admin']));
212
-			}else{
219
+			} else{
213 220
 				$license->saveSetting('license', 'msg_admin','');
214 221
 			}
215 222
 			if(!empty($resultData['msg']['all'])){
216 223
 				$license->saveSetting('license', 'msg_all', base64_encode($resultData['msg']['all']));
217
-			}else{
224
+			} else{
218 225
 				$license->saveSetting('license', 'msg_all','');
219 226
 			}
220
-		}else{
227
+		} else{
221 228
 			$license->saveSetting('license', 'msg_admin','');
222 229
 			$license->saveSetting('license', 'msg_all','');
223 230
 		}
224 231
 		$license->saveSetting('license', 'last_validation', 'success');
225 232
 		unset($_SESSION['COULD_NOT_CONNECT']);
226
-	}
227
-	else
233
+	} else
228 234
 	{
229 235
 		$resultData = array();
230 236
 		$resultData['versions'] = array();
@@ -243,7 +249,7 @@  discard block
 block discarded – undo
243 249
 	if(!empty($resultData['versions'])){
244 250
 
245 251
 		$license->saveSetting('license', 'latest_versions',base64_encode(serialize($resultData['versions'])));
246
-	}else{
252
+	} else{
247 253
 		$resultData['versions'] = array();
248 254
 		$license->saveSetting('license', 'latest_versions','')	;
249 255
 	}
Please login to merge, or discard this patch.