@@ -1,5 +1,7 @@ discard block |
||
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. |
@@ -66,11 +68,13 @@ discard block |
||
66 | 68 | { |
67 | 69 | global $timedate; |
68 | 70 | |
69 | - if(empty($options['obm_date_start'])) |
|
70 | - $options['obm_date_start'] = $timedate->nowDbDate(); |
|
71 | + if(empty($options['obm_date_start'])) { |
|
72 | + $options['obm_date_start'] = $timedate->nowDbDate(); |
|
73 | + } |
|
71 | 74 | |
72 | - if(empty($options['obm_date_end'])) |
|
73 | - $options['obm_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
|
75 | + if(empty($options['obm_date_end'])) { |
|
76 | + $options['obm_date_end'] = $timedate->asDbDate($timedate->getNow()->modify("+6 months")); |
|
77 | + } |
|
74 | 78 | |
75 | 79 | parent::__construct($id,$options); |
76 | 80 | } |
@@ -80,8 +84,9 @@ discard block |
||
80 | 84 | */ |
81 | 85 | public function displayOptions() |
82 | 86 | { |
83 | - if (!isset($this->obm_ids) || count($this->obm_ids) == 0) |
|
84 | - $this->_searchFields['obm_ids']['input_name0'] = array_keys(get_user_array(false)); |
|
87 | + if (!isset($this->obm_ids) || count($this->obm_ids) == 0) { |
|
88 | + $this->_searchFields['obm_ids']['input_name0'] = array_keys(get_user_array(false)); |
|
89 | + } |
|
85 | 90 | |
86 | 91 | return parent::displayOptions(); |
87 | 92 | } |
@@ -247,8 +252,9 @@ discard block |
||
247 | 252 | $query .= " WHERE opportunities.date_closed >= ".db_convert("'".$this->obm_date_start."'",'date') . |
248 | 253 | " AND opportunities.date_closed <= ".db_convert("'".$this->obm_date_end."'",'date') . |
249 | 254 | " AND opportunities.deleted=0"; |
250 | - if (count($this->obm_ids) > 0) |
|
251 | - $query .= " AND opportunities.assigned_user_id IN ('" . implode("','",$this->obm_ids) . "')"; |
|
255 | + if (count($this->obm_ids) > 0) { |
|
256 | + $query .= " AND opportunities.assigned_user_id IN ('" . implode("','",$this->obm_ids) . "')"; |
|
257 | + } |
|
252 | 258 | $query .= " GROUP BY sales_stage,". |
253 | 259 | db_convert('opportunities.date_closed','date_format',array("'%Y-%m'"),array("'YYYY-MM'")) . |
254 | 260 | " ORDER BY m"; |
@@ -274,8 +280,9 @@ discard block |
||
274 | 280 | $chart['labels'][] = $key; |
275 | 281 | $chart['data'][] = array(); |
276 | 282 | } |
277 | - if(!in_array($stage,$chart['key'])) |
|
278 | - $chart['key'][] = $stage; |
|
283 | + if(!in_array($stage,$chart['key'])) { |
|
284 | + $chart['key'][] = $stage; |
|
285 | + } |
|
279 | 286 | |
280 | 287 | $formattedFloat = (float)number_format((float)$i["total"], 2, '.', ''); |
281 | 288 | $chart['data'][count($chart['data'])-1][] = $formattedFloat; |
@@ -1,5 +1,7 @@ discard block |
||
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 |
||
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 |
||
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; |
@@ -1,5 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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; |
@@ -1,5 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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']; |
@@ -1,5 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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> |
@@ -1,5 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 |
@@ -1,5 +1,7 @@ discard block |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 |
||
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 | } |
@@ -1,5 +1,7 @@ discard block |
||
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. |
@@ -42,7 +44,9 @@ discard block |
||
42 | 44 | global $current_user; |
43 | 45 | |
44 | 46 | |
45 | -if (!is_admin($current_user)) sugar_die("Unauthorized access to administration."); |
|
47 | +if (!is_admin($current_user)) { |
|
48 | + sugar_die("Unauthorized access to administration."); |
|
49 | +} |
|
46 | 50 | if (isset($GLOBALS['sugar_config']['hide_admin_diagnostics']) && $GLOBALS['sugar_config']['hide_admin_diagnostics']) |
47 | 51 | { |
48 | 52 | sugar_die("Unauthorized access to diagnostic tool."); |
@@ -1,5 +1,7 @@ discard block |
||
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,7 +159,7 @@ discard block |
||
157 | 159 | echo "<b>{$mod_strings['LBL_EXPAND_DATABASE_FINISHED_ERROR']}</b><br>"; |
158 | 160 | } //if-else |
159 | 161 | } //if |
160 | -}else{ |
|
162 | +} else{ |
|
161 | 163 | sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); |
162 | 164 | } |
163 | 165 |