@@ -15,8 +15,7 @@ discard block |
||
15 | 15 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
16 | 16 | if(isset($GLOBALS['log'])) { |
17 | 17 | $GLOBALS['log']->deprecated($deprecatedMessage); |
18 | - } |
|
19 | - else { |
|
18 | + } else { |
|
20 | 19 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
21 | 20 | } |
22 | 21 | self::__construct(); |
@@ -178,7 +177,9 @@ discard block |
||
178 | 177 | $GLOBALS['log']->debug("SecuritySuite: groupHasAccess $query"); |
179 | 178 | $result = $db->query($query); |
180 | 179 | $row = $db->fetchByAssoc($result); |
181 | - if(isset($row) && $row['results']>0) return true; |
|
180 | + if(isset($row) && $row['results']>0) { |
|
181 | + return true; |
|
182 | + } |
|
182 | 183 | |
183 | 184 | return false; |
184 | 185 | } |
@@ -416,7 +417,10 @@ discard block |
||
416 | 417 | } |
417 | 418 | |
418 | 419 | static function inherit_parentQuery(&$focus, $parent_type, $parent_id, $focus_id, $focus_module_dir) { |
419 | - if(empty($parent_type) || empty($parent_id)) return; //no info passed |
|
420 | + if(empty($parent_type) || empty($parent_id)) { |
|
421 | + return; |
|
422 | + } |
|
423 | + //no info passed |
|
420 | 424 | |
421 | 425 | /** can speed this up by doing one query */ |
422 | 426 | //should be just one query but need a unique guid for each insert |
@@ -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 | class SecurityGroupMessage extends Basic { |
5 | 7 | var $new_schema = true; |
@@ -47,8 +49,7 @@ discard block |
||
47 | 49 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
48 | 50 | if(isset($GLOBALS['log'])) { |
49 | 51 | $GLOBALS['log']->deprecated($deprecatedMessage); |
50 | - } |
|
51 | - else { |
|
52 | + } else { |
|
52 | 53 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
53 | 54 | } |
54 | 55 | self::__construct(); |
@@ -106,7 +107,10 @@ discard block |
||
106 | 107 | $securitygroup_id = null; //6.4.0 |
107 | 108 | } |
108 | 109 | $message = new SecurityGroupMessage(); |
109 | - if(empty($text)) return; // || !$feed->ACLAccess('save', true) )return; |
|
110 | + if(empty($text)) { |
|
111 | + return; |
|
112 | + } |
|
113 | + // || !$feed->ACLAccess('save', true) )return; |
|
110 | 114 | |
111 | 115 | $text = strip_tags($text); |
112 | 116 | $message->name = ''; |
@@ -135,18 +139,18 @@ discard block |
||
135 | 139 | if($weeks == 1){ |
136 | 140 | $result = translate('LBL_TIME_LAST_WEEK','SugarFeed').' '; |
137 | 141 | return $result; |
138 | - }else if($weeks > 1){ |
|
142 | + } else if($weeks > 1){ |
|
139 | 143 | $result .= $weeks . ' '.translate('LBL_TIME_WEEKS','SugarFeed').' '; |
140 | 144 | if($days > 0) { |
141 | 145 | $result .= $days . ' '.translate('LBL_TIME_DAYS','SugarFeed').' '; |
142 | 146 | } |
143 | - }else{ |
|
147 | + } else{ |
|
144 | 148 | if($days == 1){ |
145 | 149 | $result = translate('LBL_TIME_YESTERDAY','SugarFeed').' '; |
146 | 150 | return $result; |
147 | - }else if($days > 1){ |
|
151 | + } else if($days > 1){ |
|
148 | 152 | $result .= $days . ' '. translate('LBL_TIME_DAYS','SugarFeed').' '; |
149 | - }else{ |
|
153 | + } else{ |
|
150 | 154 | if($hours == 1) { |
151 | 155 | $result .= $hours . ' '.translate('LBL_TIME_HOUR','SugarFeed').' '; |
152 | 156 | } else { |
@@ -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 | |
5 | 7 | require_once('data/SugarBean.php'); |
@@ -55,8 +57,7 @@ discard block |
||
55 | 57 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
56 | 58 | if(isset($GLOBALS['log'])) { |
57 | 59 | $GLOBALS['log']->deprecated($deprecatedMessage); |
58 | - } |
|
59 | - else { |
|
60 | + } else { |
|
60 | 61 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
61 | 62 | } |
62 | 63 | self::__construct(); |
@@ -98,10 +99,11 @@ discard block |
||
98 | 99 | $query = "SELECT id, first_name, last_name, user_name FROM users "; |
99 | 100 | $where_auto = "deleted=0"; |
100 | 101 | |
101 | - if($where != "") |
|
102 | - $query .= "where $where AND ".$where_auto; |
|
103 | - else |
|
104 | - $query .= "where ".$where_auto; |
|
102 | + if($where != "") { |
|
103 | + $query .= "where $where AND ".$where_auto; |
|
104 | + } else { |
|
105 | + $query .= "where ".$where_auto; |
|
106 | + } |
|
105 | 107 | |
106 | 108 | $query .= " ORDER BY last_name, first_name"; |
107 | 109 |
@@ -63,8 +63,7 @@ discard block |
||
63 | 63 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
64 | 64 | if(isset($GLOBALS['log'])) { |
65 | 65 | $GLOBALS['log']->deprecated($deprecatedMessage); |
66 | - } |
|
67 | - else { |
|
66 | + } else { |
|
68 | 67 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
69 | 68 | } |
70 | 69 | self::__construct(); |
@@ -226,7 +225,7 @@ discard block |
||
226 | 225 | $img = ob_get_clean(); |
227 | 226 | if($asDataURI){ |
228 | 227 | return 'data:image/png;base64,'.base64_encode($img); |
229 | - }else{ |
|
228 | + } else{ |
|
230 | 229 | return $img; |
231 | 230 | } |
232 | 231 | } |
@@ -359,8 +358,9 @@ discard block |
||
359 | 358 | { |
360 | 359 | $dataArray = json_decode($chartDataValues); |
361 | 360 | $grouping = 'grouped'; //$mainGroupField->label; //'grouped'; |
362 | - if(!$grouped) |
|
363 | - $grouping='stacked'; |
|
361 | + if(!$grouped) { |
|
362 | + $grouping='stacked'; |
|
363 | + } |
|
364 | 364 | if(!is_array($dataArray)||count($dataArray) < 1) |
365 | 365 | { |
366 | 366 | return "<h3>$this->noDataMessage</h3>"; |
@@ -639,9 +639,9 @@ discard block |
||
639 | 639 | if(strlen($label) > $maxLabelSize) |
640 | 640 | { |
641 | 641 | return substr($label,0,$maxLabelSize).'...'; |
642 | + } else { |
|
643 | + return $label; |
|
642 | 644 | } |
643 | - else |
|
644 | - return $label; |
|
645 | 645 | } |
646 | 646 | |
647 | 647 |
@@ -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. |
@@ -134,8 +136,9 @@ discard block |
||
134 | 136 | |
135 | 137 | |
136 | 138 | |
137 | - if(!empty($GLOBALS['app_list_strings']['duration_intervals'])) |
|
138 | - $this->minutes_values = $GLOBALS['app_list_strings']['duration_intervals']; |
|
139 | + if(!empty($GLOBALS['app_list_strings']['duration_intervals'])) { |
|
140 | + $this->minutes_values = $GLOBALS['app_list_strings']['duration_intervals']; |
|
141 | + } |
|
139 | 142 | } |
140 | 143 | |
141 | 144 | /** |
@@ -145,8 +148,7 @@ discard block |
||
145 | 148 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
146 | 149 | if(isset($GLOBALS['log'])) { |
147 | 150 | $GLOBALS['log']->deprecated($deprecatedMessage); |
148 | - } |
|
149 | - else { |
|
151 | + } else { |
|
150 | 152 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
151 | 153 | } |
152 | 154 | self::__construct(); |
@@ -298,16 +300,17 @@ discard block |
||
298 | 300 | $where_auto = '1=1'; |
299 | 301 | if($show_deleted == 0){ |
300 | 302 | $where_auto = " $this->table_name.deleted=0 "; |
301 | - }else if($show_deleted == 1){ |
|
303 | + } else if($show_deleted == 1){ |
|
302 | 304 | $where_auto = " $this->table_name.deleted=1 "; |
303 | 305 | } |
304 | 306 | |
305 | 307 | //$where_auto .= " GROUP BY calls.id"; |
306 | 308 | |
307 | - if($where != "") |
|
308 | - $query .= "where $where AND ".$where_auto; |
|
309 | - else |
|
310 | - $query .= "where ".$where_auto; |
|
309 | + if($where != "") { |
|
310 | + $query .= "where $where AND ".$where_auto; |
|
311 | + } else { |
|
312 | + $query .= "where ".$where_auto; |
|
313 | + } |
|
311 | 314 | |
312 | 315 | $order_by = $this->process_order_by($order_by); |
313 | 316 | if (empty($order_by)) { |
@@ -329,8 +332,7 @@ discard block |
||
329 | 332 | $query .= $custom_join['select']; |
330 | 333 | $query .= " FROM contacts, calls, calls_contacts "; |
331 | 334 | $where_auto = "calls_contacts.contact_id = contacts.id AND calls_contacts.call_id = calls.id AND calls.deleted=0 AND contacts.deleted=0"; |
332 | - } |
|
333 | - else |
|
335 | + } else |
|
334 | 336 | { |
335 | 337 | $query = 'SELECT calls.*, users.user_name as assigned_user_name '; |
336 | 338 | $query .= $custom_join['select']; |
@@ -343,10 +345,11 @@ discard block |
||
343 | 345 | |
344 | 346 | $query .= $custom_join['join']; |
345 | 347 | |
346 | - if($where != "") |
|
347 | - $query .= "where $where AND ".$where_auto; |
|
348 | - else |
|
349 | - $query .= "where ".$where_auto; |
|
348 | + if($where != "") { |
|
349 | + $query .= "where $where AND ".$where_auto; |
|
350 | + } else { |
|
351 | + $query .= "where ".$where_auto; |
|
352 | + } |
|
350 | 353 | |
351 | 354 | $order_by = $this->process_order_by($order_by); |
352 | 355 | if (empty($order_by)) { |
@@ -390,10 +393,12 @@ discard block |
||
390 | 393 | $this->date_start = $timedate->now(); |
391 | 394 | } |
392 | 395 | |
393 | - if (is_null($this->duration_hours)) |
|
394 | - $this->duration_hours = "0"; |
|
395 | - if (is_null($this->duration_minutes)) |
|
396 | - $this->duration_minutes = "1"; |
|
396 | + if (is_null($this->duration_hours)) { |
|
397 | + $this->duration_hours = "0"; |
|
398 | + } |
|
399 | + if (is_null($this->duration_minutes)) { |
|
400 | + $this->duration_minutes = "1"; |
|
401 | + } |
|
397 | 402 | |
398 | 403 | $this->fill_in_additional_parent_fields(); |
399 | 404 | |
@@ -414,8 +419,9 @@ discard block |
||
414 | 419 | |
415 | 420 | if ( empty($this->id) ) { |
416 | 421 | $reminder_t = $GLOBALS['current_user']->getPreference('reminder_time'); |
417 | - if ( isset($reminder_t) ) |
|
418 | - $this->reminder_time = $reminder_t; |
|
422 | + if ( isset($reminder_t) ) { |
|
423 | + $this->reminder_time = $reminder_t; |
|
424 | + } |
|
419 | 425 | } |
420 | 426 | $this->reminder_checked = $this->reminder_time == -1 ? false : true; |
421 | 427 | |
@@ -424,8 +430,9 @@ discard block |
||
424 | 430 | } |
425 | 431 | if(empty($this->id)){ |
426 | 432 | $reminder_t = $GLOBALS['current_user']->getPreference('email_reminder_time'); |
427 | - if(isset($reminder_t)) |
|
428 | - $this->email_reminder_time = $reminder_t; |
|
433 | + if(isset($reminder_t)) { |
|
434 | + $this->email_reminder_time = $reminder_t; |
|
435 | + } |
|
429 | 436 | } |
430 | 437 | $this->email_reminder_checked = $this->email_reminder_time == -1 ? false : true; |
431 | 438 | |
@@ -440,16 +447,20 @@ discard block |
||
440 | 447 | function get_list_view_data(){ |
441 | 448 | $call_fields = $this->get_list_view_array(); |
442 | 449 | global $app_list_strings, $focus, $action, $currentModule; |
443 | - if (isset($focus->id)) $id = $focus->id; |
|
444 | - else $id = ''; |
|
450 | + if (isset($focus->id)) { |
|
451 | + $id = $focus->id; |
|
452 | + } else { |
|
453 | + $id = ''; |
|
454 | + } |
|
445 | 455 | if (isset($this->parent_type) && $this->parent_type != null) |
446 | 456 | { |
447 | 457 | $call_fields['PARENT_MODULE'] = $this->parent_type; |
448 | 458 | } |
449 | 459 | if ($this->status == "Planned") { |
450 | 460 | //cn: added this if() to deal with sequential Closes in Meetings. this is a hack to a hack (formbase.php->handleRedirect) |
451 | - if(empty($action)) |
|
452 | - $action = "index"; |
|
461 | + if(empty($action)) { |
|
462 | + $action = "index"; |
|
463 | + } |
|
453 | 464 | |
454 | 465 | $setCompleteUrl = "<a id='{$this->id}' onclick='SUGAR.util.closeActivityPanel.show(\"{$this->module_dir}\",\"{$this->id}\",\"Held\",\"listview\",\"1\");'>"; |
455 | 466 | if ($this->ACLAccess('edit')) { |
@@ -465,9 +476,9 @@ discard block |
||
465 | 476 | $date_db = $timedate->to_db($mergeTime); |
466 | 477 | if( $date_db < $today){ |
467 | 478 | $call_fields['DATE_START']= "<font class='overdueTask'>".$call_fields['DATE_START']."</font>"; |
468 | - }else if($date_db < $nextday){ |
|
479 | + } else if($date_db < $nextday){ |
|
469 | 480 | $call_fields['DATE_START'] = "<font class='todaysTask'>".$call_fields['DATE_START']."</font>"; |
470 | - }else{ |
|
481 | + } else{ |
|
471 | 482 | $call_fields['DATE_START'] = "<font class='futureTask'>".$call_fields['DATE_START']."</font>"; |
472 | 483 | } |
473 | 484 | $this->fill_in_additional_detail_fields(); |
@@ -597,14 +608,12 @@ discard block |
||
597 | 608 | { |
598 | 609 | vCal::cache_sugar_vcal($user); |
599 | 610 | } |
600 | - } |
|
601 | - else if ( $user->object_name == 'Contact') |
|
611 | + } else if ( $user->object_name == 'Contact') |
|
602 | 612 | { |
603 | 613 | $relate_values = array('contact_id'=>$user->id,'call_id'=>$this->id); |
604 | 614 | $data_values = array('accept_status'=>$status); |
605 | 615 | $this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values); |
606 | - } |
|
607 | - else if ( $user->object_name == 'Lead') |
|
616 | + } else if ( $user->object_name == 'Lead') |
|
608 | 617 | { |
609 | 618 | $relate_values = array('lead_id'=>$user->id,'call_id'=>$this->id); |
610 | 619 | $data_values = array('accept_status'=>$status); |
@@ -659,8 +668,9 @@ discard block |
||
659 | 668 | global $sugar_config; |
660 | 669 | if(isset($sugar_config['disable_notify_current_user']) && $sugar_config['disable_notify_current_user']) { |
661 | 670 | global $current_user; |
662 | - if(isset($list[$current_user->id])) |
|
663 | - unset($list[$current_user->id]); |
|
671 | + if(isset($list[$current_user->id])) { |
|
672 | + unset($list[$current_user->id]); |
|
673 | + } |
|
664 | 674 | } |
665 | 675 | // $GLOBALS['log']->debug('Call.php->get_notification_recipients():'.print_r($list,true)); |
666 | 676 | return $list; |
@@ -704,7 +714,7 @@ discard block |
||
704 | 714 | if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)){ |
705 | 715 | /* END - SECURITY GROUPS */ |
706 | 716 | $array_assign['PARENT'] = 'a'; |
707 | - }else{ |
|
717 | + } else{ |
|
708 | 718 | $array_assign['PARENT'] = 'span'; |
709 | 719 | } |
710 | 720 | $is_owner = false; |
@@ -735,7 +745,7 @@ discard block |
||
735 | 745 | if( ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)){ |
736 | 746 | /* END - SECURITY GROUPS */ |
737 | 747 | $array_assign['CONTACT'] = 'a'; |
738 | - }else{ |
|
748 | + } else{ |
|
739 | 749 | $array_assign['CONTACT'] = 'span'; |
740 | 750 | } |
741 | 751 | |
@@ -752,13 +762,11 @@ discard block |
||
752 | 762 | if(!empty($GLOBALS['soap_server_object'])) |
753 | 763 | { |
754 | 764 | $exclude = array('lead_id', 'contact_id', 'user_id'); |
755 | - } |
|
756 | - else |
|
765 | + } else |
|
757 | 766 | { |
758 | 767 | $exclude = array('lead_id', 'contact_id', 'user_id', 'assigned_user_id'); |
759 | 768 | } |
760 | - } |
|
761 | - else |
|
769 | + } else |
|
762 | 770 | { |
763 | 771 | $exclude = array('user_id'); |
764 | 772 | } |
@@ -41,8 +41,7 @@ discard block |
||
41 | 41 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
42 | 42 | if(isset($GLOBALS['log'])) { |
43 | 43 | $GLOBALS['log']->deprecated($deprecatedMessage); |
44 | - } |
|
45 | - else { |
|
44 | + } else { |
|
46 | 45 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
47 | 46 | } |
48 | 47 | self::__construct(); |
@@ -55,12 +54,12 @@ discard block |
||
55 | 54 | parent::save($check_notify); |
56 | 55 | if(file_exists('custom/modules/AOP_Case_Updates/CaseUpdatesHook.php')){ |
57 | 56 | require_once 'custom/modules/AOP_Case_Updates/CaseUpdatesHook.php'; |
58 | - }else{ |
|
57 | + } else{ |
|
59 | 58 | require_once 'modules/AOP_Case_Updates/CaseUpdatesHook.php'; |
60 | 59 | } |
61 | 60 | if(class_exists('CustomCaseUpdatesHook')){ |
62 | 61 | $hook = new CustomCaseUpdatesHook(); |
63 | - }else{ |
|
62 | + } else{ |
|
64 | 63 | $hook = new CaseUpdatesHook(); |
65 | 64 | } |
66 | 65 | $hook->sendCaseUpdate($this); |
@@ -176,7 +175,7 @@ discard block |
||
176 | 175 | $emailObj->created_by = '1'; |
177 | 176 | $emailObj->status = 'sent'; |
178 | 177 | $emailObj->save(); |
179 | - }else{ |
|
178 | + } else{ |
|
180 | 179 | $GLOBALS['log']->info("AOPCaseUpdates: Could not send email: " . $mailer->ErrorInfo); |
181 | 180 | return false; |
182 | 181 | } |
@@ -61,8 +61,7 @@ discard block |
||
61 | 61 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
62 | 62 | if(isset($GLOBALS['log'])) { |
63 | 63 | $GLOBALS['log']->deprecated($deprecatedMessage); |
64 | - } |
|
65 | - else { |
|
64 | + } else { |
|
66 | 65 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
67 | 66 | } |
68 | 67 | self::__construct(); |
@@ -232,8 +231,10 @@ discard block |
||
232 | 231 | $html = '<script src="modules/AOR_Reports/js/Chart.js"></script>'; |
233 | 232 | break; |
234 | 233 | case self::CHART_TYPE_RGRAPH: |
235 | - if($_REQUEST['module']!= 'Home')//Need the require_once for the rgraphincludes as they are only loaded when the home page is hit |
|
234 | + if($_REQUEST['module']!= 'Home') { |
|
235 | + //Need the require_once for the rgraphincludes as they are only loaded when the home page is hit |
|
236 | 236 | require_once('include/SuiteGraphs/RGraphIncludes.php'); |
237 | + } |
|
237 | 238 | |
238 | 239 | break; |
239 | 240 | } |
@@ -256,15 +257,13 @@ discard block |
||
256 | 257 | |
257 | 258 | if(count($rows) > 1) { |
258 | 259 | $GLOBALS['log']->fatal('ambiguous group display for report ' . $this->id); |
259 | - } |
|
260 | - else if(count($rows) == 1){ |
|
260 | + } else if(count($rows) == 1){ |
|
261 | 261 | $rows[0]['module_path'] = unserialize(base64_decode($rows[0]['module_path'])); |
262 | 262 | if(!$rows[0]['module_path'][0]) { |
263 | 263 | $module = new $beanList[$this->report_module](); |
264 | 264 | $rows[0]['field_id_name'] = $module->field_defs[$rows[0]['field']]['id_name'] ? $module->field_defs[$rows[0]['field']]['id_name'] : $module->field_defs[$rows[0]['field']]['name']; |
265 | 265 | $rows[0]['module_path'][0] = $module->table_name; |
266 | - } |
|
267 | - else { |
|
266 | + } else { |
|
268 | 267 | $rows[0]['field_id_name'] = $rows[0]['field']; |
269 | 268 | } |
270 | 269 | $path[] = $rows[0]; |
@@ -276,8 +275,7 @@ discard block |
||
276 | 275 | } |
277 | 276 | |
278 | 277 | return $this->buildMultiGroupReport($offset, $links, $level+1, $path); |
279 | - } |
|
280 | - else if(!$rows) { |
|
278 | + } else if(!$rows) { |
|
281 | 279 | if($path) { |
282 | 280 | $html = ''; |
283 | 281 | foreach ($path as $pth) { |
@@ -295,12 +293,10 @@ discard block |
||
295 | 293 | } |
296 | 294 | } |
297 | 295 | return $html; |
298 | - } |
|
299 | - else { |
|
296 | + } else { |
|
300 | 297 | return $this->build_group_report($offset, $links); |
301 | 298 | } |
302 | - } |
|
303 | - else { |
|
299 | + } else { |
|
304 | 300 | throw new Exception('incorrect results'); |
305 | 301 | } |
306 | 302 | throw new Exception('incorrect state'); |
@@ -436,8 +432,7 @@ discard block |
||
436 | 432 | foreach($extra['select'] as $selectField => $selectAlias) { |
437 | 433 | if($selectAlias) { |
438 | 434 | $query_array['select'][] = $selectField . " AS " . $selectAlias; |
439 | - } |
|
440 | - else { |
|
435 | + } else { |
|
441 | 436 | $query_array['select'][] = $selectField; |
442 | 437 | } |
443 | 438 | } |
@@ -492,14 +487,18 @@ discard block |
||
492 | 487 | $result = $this->db->query($query); |
493 | 488 | |
494 | 489 | while ($row = $this->db->fetchByAssoc($result)) { |
495 | - if($html != '') $html .= '<br />'; |
|
490 | + if($html != '') { |
|
491 | + $html .= '<br />'; |
|
492 | + } |
|
496 | 493 | |
497 | 494 | $html .= $this->build_report_html($offset, $links, $row[$field_label], '', $extra); |
498 | 495 | |
499 | 496 | } |
500 | 497 | } |
501 | 498 | |
502 | - if($html == '') $html = $this->build_report_html($offset, $links); |
|
499 | + if($html == '') { |
|
500 | + $html = $this->build_report_html($offset, $links); |
|
501 | + } |
|
503 | 502 | return $html; |
504 | 503 | |
505 | 504 | } |
@@ -693,7 +692,9 @@ discard block |
||
693 | 692 | if($att['total']){ |
694 | 693 | $totals[$name][] = $row[$name]; |
695 | 694 | } |
696 | - if($att['link'] && $links) $html .= "</a>"; |
|
695 | + if($att['link'] && $links) { |
|
696 | + $html .= "</a>"; |
|
697 | + } |
|
697 | 698 | $html .= "</td>"; |
698 | 699 | } |
699 | 700 | } |
@@ -777,7 +778,7 @@ discard block |
||
777 | 778 | if($field['total']){ |
778 | 779 | $totalLabel = $field['label'] ." ".$app_list_strings['aor_total_options'][$field['total']]; |
779 | 780 | $html .= "<th>{$totalLabel}</th>"; |
780 | - }else{ |
|
781 | + } else{ |
|
781 | 782 | $html .= "<th></th>"; |
782 | 783 | } |
783 | 784 | } |
@@ -789,7 +790,7 @@ discard block |
||
789 | 790 | } |
790 | 791 | if($field['total'] && isset($totals[$label])){ |
791 | 792 | $html .= "<td>".$this->calculateTotal($field['total'],$totals[$label])."</td>"; |
792 | - }else{ |
|
793 | + } else{ |
|
793 | 794 | $html .= "<td></td>"; |
794 | 795 | } |
795 | 796 | } |
@@ -865,10 +866,11 @@ discard block |
||
865 | 866 | $csv .= "\r\n"; |
866 | 867 | foreach($fields as $name => $att){ |
867 | 868 | if($att['display']){ |
868 | - if($att['function'] != '' ) |
|
869 | - $csv .= $this->encloseForCSV($row[$name]); |
|
870 | - else |
|
871 | - $csv .= $this->encloseForCSV(trim(strip_tags(getModuleField($att['module'], $att['field'], $att['field'], 'DetailView',$row[$name])))); |
|
869 | + if($att['function'] != '' ) { |
|
870 | + $csv .= $this->encloseForCSV($row[$name]); |
|
871 | + } else { |
|
872 | + $csv .= $this->encloseForCSV(trim(strip_tags(getModuleField($att['module'], $att['field'], $att['field'], 'DetailView',$row[$name])))); |
|
873 | + } |
|
872 | 874 | $csv .= $delimiter; |
873 | 875 | } |
874 | 876 | } |
@@ -1052,7 +1054,9 @@ discard block |
||
1052 | 1054 | |
1053 | 1055 | $query['select'][] = $select_field ." AS '".$field->label."'"; |
1054 | 1056 | |
1055 | - if($field->group_display == 1 && $group_value) $query['where'][] = $select_field." = '".$group_value."' AND "; |
|
1057 | + if($field->group_display == 1 && $group_value) { |
|
1058 | + $query['where'][] = $select_field." = '".$group_value."' AND "; |
|
1059 | + } |
|
1056 | 1060 | ++$i; |
1057 | 1061 | } |
1058 | 1062 | } |
@@ -1077,13 +1081,13 @@ discard block |
||
1077 | 1081 | $params['right_join_table_alias'] = $this->db->quoteIdentifier($alias); |
1078 | 1082 | $params['join_table_alias'] = $this->db->quoteIdentifier($alias); |
1079 | 1083 | $params['left_join_table_alias'] = $this->db->quoteIdentifier($parentAlias); |
1080 | - }else{ |
|
1084 | + } else{ |
|
1081 | 1085 | $params['right_join_table_alias'] = $this->db->quoteIdentifier($parentAlias); |
1082 | 1086 | $params['join_table_alias'] = $this->db->quoteIdentifier($alias); |
1083 | 1087 | $params['left_join_table_alias'] = $this->db->quoteIdentifier($alias); |
1084 | 1088 | } |
1085 | 1089 | |
1086 | - }else{ |
|
1090 | + } else{ |
|
1087 | 1091 | $params['right_join_table_alias'] = $this->db->quoteIdentifier($parentAlias); |
1088 | 1092 | $params['join_table_alias'] = $this->db->quoteIdentifier($alias); |
1089 | 1093 | $params['left_join_table_alias'] = $this->db->quoteIdentifier($parentAlias); |
@@ -1298,12 +1302,16 @@ discard block |
||
1298 | 1302 | |
1299 | 1303 | case 'Multi': |
1300 | 1304 | $sep = ' AND '; |
1301 | - if ($condition->operator == 'Equal_To') $sep = ' OR '; |
|
1305 | + if ($condition->operator == 'Equal_To') { |
|
1306 | + $sep = ' OR '; |
|
1307 | + } |
|
1302 | 1308 | $multi_values = unencodeMultienum($condition->value); |
1303 | 1309 | if (!empty($multi_values)) { |
1304 | 1310 | $value = '('; |
1305 | 1311 | foreach ($multi_values as $multi_value) { |
1306 | - if ($value != '(') $value .= $sep; |
|
1312 | + if ($value != '(') { |
|
1313 | + $value .= $sep; |
|
1314 | + } |
|
1307 | 1315 | $value .= $field . ' ' . $app_list_strings['aor_sql_operator_list'][$condition->operator] . " '" . $multi_value . "'"; |
1308 | 1316 | } |
1309 | 1317 | $value .= ')'; |
@@ -1376,18 +1384,15 @@ discard block |
||
1376 | 1384 | } |
1377 | 1385 | |
1378 | 1386 | $tiltLogicOp = false; |
1379 | - } |
|
1380 | - else if($condition->parenthesis) { |
|
1387 | + } else if($condition->parenthesis) { |
|
1381 | 1388 | if($condition->parenthesis == 'START') { |
1382 | 1389 | $query['where'][] = ($tiltLogicOp ? '' : ($condition->logic_op ? $condition->logic_op . ' ' : 'AND ')) . '('; |
1383 | 1390 | $tiltLogicOp = true; |
1384 | - } |
|
1385 | - else { |
|
1391 | + } else { |
|
1386 | 1392 | $query['where'][] = ')'; |
1387 | 1393 | $tiltLogicOp = false; |
1388 | 1394 | } |
1389 | - } |
|
1390 | - else { |
|
1395 | + } else { |
|
1391 | 1396 | $GLOBALS['log']->debug('illegal condition'); |
1392 | 1397 | } |
1393 | 1398 |
@@ -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 | |
5 | 7 | require_once('include/Dashlets/Dashlet.php'); |
@@ -48,8 +50,7 @@ discard block |
||
48 | 50 | $deprecatedMessage = 'PHP4 Style Constructors are deprecated and will be remove in 7.8, please update your code'; |
49 | 51 | if(isset($GLOBALS['log'])) { |
50 | 52 | $GLOBALS['log']->deprecated($deprecatedMessage); |
51 | - } |
|
52 | - else { |
|
53 | + } else { |
|
53 | 54 | trigger_error($deprecatedMessage, E_USER_DEPRECATED); |
54 | 55 | } |
55 | 56 | self::__construct($id, $def); |
@@ -77,7 +78,7 @@ discard block |
||
77 | 78 | if(!empty($this->report->id)) { |
78 | 79 | //return $this->report->build_report_chart($this->charts, AOR_Report::CHART_TYPE_CHARTJS); |
79 | 80 | return $this->report->build_report_chart($this->charts, AOR_Report::CHART_TYPE_RGRAPH); |
80 | - }else{ |
|
81 | + } else{ |
|
81 | 82 | return ''; |
82 | 83 | } |
83 | 84 | } |
@@ -43,7 +43,9 @@ discard block |
||
43 | 43 | * Date: 06/03/15 |
44 | 44 | * Comments |
45 | 45 | */ |
46 | -if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point'); |
|
46 | +if(!defined('sugarEntry') || !sugarEntry) { |
|
47 | + die('Not A Valid Entry Point'); |
|
48 | +} |
|
47 | 49 | |
48 | 50 | class CasesController extends SugarController { |
49 | 51 | |
@@ -90,8 +92,7 @@ discard block |
||
90 | 92 | $count++; |
91 | 93 | } |
92 | 94 | echo '</table>'; |
93 | - } |
|
94 | - else { |
|
95 | + } else { |
|
95 | 96 | echo $mod_strings['LBL_NO_SUGGESTIONS']; |
96 | 97 | } |
97 | 98 | die(); |