Test Failed
Push — CI ( 02428e...3e0292 )
by Adam
55:43
created
include/generic/SugarWidgets/SugarWidgetSubPanelEditRoleButton.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -68,7 +70,7 @@  discard block
 block discarded – undo
68 70
 		return '<a href="' . $href . '"'
69 71
             . "id=\"$unique_id\""
70 72
 			. 'class="listViewTdToolsS1">' . $app_strings['LNK_EDIT'] .'</a>&nbsp;';
71
-	}else{
73
+	} else{
72 74
 		return '';
73 75
 	}
74 76
 	}
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopSelectContactsButton.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -108,8 +110,7 @@  discard block
 block discarded – undo
108 110
 
109 111
 		if ($subpanel_name == 'Project'){
110 112
 			$link_field_name = 'project_contacts_1';
111
-		}
112
-		else{
113
+		} else{
113 114
 			$link_field_name = $subpanel_definition->get_data_source_name(true);
114 115
 		}
115 116
 
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFielddatetime.php 1 patch
Braces   +11 added lines, -10 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.
@@ -66,7 +68,9 @@  discard block
 block discarded – undo
66 68
 
67 69
 		$report_def_str = $json_obj->decode($this->reporter->report_def_str);
68 70
 
69
-		if(empty($report_def_str['assigned_user_id'])) return null;
71
+		if(empty($report_def_str['assigned_user_id'])) {
72
+		    return null;
73
+		}
70 74
 
71 75
 		$this->assigned_user = new User();
72 76
 		$this->assigned_user->retrieve($report_def_str['assigned_user_id']);
@@ -213,8 +217,7 @@  discard block
 block discarded – undo
213 217
         if ($time=='start') {
214 218
             $begin_parts = explode(' ', $begin);
215 219
             $be = $begin_parts[0] . ' 00:00:00';
216
-        }
217
-        else if ($time=='end') {
220
+        } else if ($time=='end') {
218 221
             $begin_parts = explode(' ', $begin);
219 222
             $be = $begin_parts[0] . ' 23:59:59';
220 223
         } else {
@@ -514,12 +517,12 @@  discard block
 block discarded – undo
514 517
         if (count(explode('-',$content)) == 2){
515 518
             return $content;
516 519
         // if date field
517
-        }elseif(substr_count($layout_def['type'], 'date') > 0){
520
+        } elseif(substr_count($layout_def['type'], 'date') > 0){
518 521
             // if date time field
519 522
             if(substr_count($layout_def['type'], 'time') > 0 && $this->get_time_part($content)!= false){
520 523
                 $td = $timedate->to_display_date_time($content);
521 524
                 return $td;
522
-            }else{// if date only field
525
+            } else{// if date only field
523 526
                 $td = $timedate->to_display_date($content, false); // Avoid PHP notice of returning by reference.
524 527
                 return $td;
525 528
             }
@@ -635,8 +638,7 @@  discard block
 block discarded – undo
635 638
         if (empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a')
636 639
         {
637 640
             return $orderBy . " ASC\n";
638
-        }
639
-        else
641
+        } else
640 642
         {
641 643
             return $orderBy . " DESC\n";
642 644
         }
@@ -752,8 +754,7 @@  discard block
 block discarded – undo
752 754
         if (empty($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a')
753 755
         {
754 756
             return $orderBy . " ASC\n";
755
-        }
756
-        else
757
+        } else
757 758
         {
758 759
             return $orderBy . " DESC\n";
759 760
         }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopButton_c.php 1 patch
Braces   +33 added lines, -28 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.
@@ -66,31 +68,38 @@  discard block
 block discarded – undo
66 68
 			$class_details = $module;
67 69
 
68 70
 			// If keys were passed into the constructor, translate them from keys to values.
69
-			if(!empty($class_details['module']))
70
-				$this->module = $class_details['module'];
71
-			if(!empty($class_details['title']))
72
-				$this->title = $app_strings[$class_details['title']];
73
-			if(!empty($class_details['access_key']))
74
-				$this->access_key = $app_strings[$class_details['access_key']];
75
-			if(!empty($class_details['form_value']))
76
-				$this->form_value = translate($class_details['form_value'], $this->module);
77
-			if(!empty($class_details['additional_form_fields']))
78
-				$this->additional_form_fields = $class_details['additional_form_fields'];
71
+			if(!empty($class_details['module'])) {
72
+							$this->module = $class_details['module'];
73
+			}
74
+			if(!empty($class_details['title'])) {
75
+							$this->title = $app_strings[$class_details['title']];
76
+			}
77
+			if(!empty($class_details['access_key'])) {
78
+							$this->access_key = $app_strings[$class_details['access_key']];
79
+			}
80
+			if(!empty($class_details['form_value'])) {
81
+							$this->form_value = translate($class_details['form_value'], $this->module);
82
+			}
83
+			if(!empty($class_details['additional_form_fields'])) {
84
+							$this->additional_form_fields = $class_details['additional_form_fields'];
85
+			}
79 86
 			if(!empty($class_details['ACL'])){
80 87
 				$this->acl = $class_details['ACL'];
81 88
 			}
82
-		}
83
-		else
89
+		} else
84 90
 		{
85 91
 			$this->module = $module;
86 92
 
87 93
 			// If keys were passed into the constructor, translate them from keys to values.
88
-			if(!empty($title))
89
-				$this->title = $app_strings[$title];
90
-			if(!empty($access_key))
91
-				$this->access_key = $app_strings[$access_key];
92
-			if(!empty($form_value))
93
-				$this->form_value = translate($form_value, $module);
94
+			if(!empty($title)) {
95
+							$this->title = $app_strings[$title];
96
+			}
97
+			if(!empty($access_key)) {
98
+							$this->access_key = $app_strings[$access_key];
99
+			}
100
+			if(!empty($form_value)) {
101
+							$this->form_value = translate($form_value, $module);
102
+			}
94 103
 		}
95 104
 	}
96 105
 
@@ -116,8 +125,7 @@  discard block
 block discarded – undo
116 125
                 if(!empty($defines['focus']->$value))
117 126
                 {
118 127
                     $additionalFormFields[$key] = $defines['focus']->$value;
119
-                }
120
-                else
128
+                } else
121 129
                 {
122 130
                     $additionalFormFields[$key] = '';
123 131
                 }
@@ -128,8 +136,7 @@  discard block
 block discarded – undo
128 136
 		if(!empty($this->module))
129 137
         {
130 138
             $defines['child_module_name'] = $this->module;
131
-        }
132
-        else
139
+        } else
133 140
         {
134 141
             $defines['child_module_name'] = $defines['module'];
135 142
         }
@@ -161,7 +168,7 @@  discard block
 block discarded – undo
161 168
 
162 169
         if($currentModule == 'Campaigns'){
163 170
             $formValues['return_action'] = "DetailView";
164
-        }else{
171
+        } else{
165 172
             $formValues['return_action'] = $defines['action'];
166 173
             if ( $formValues['return_action'] == 'SubPanelViewer' ) {
167 174
                 $formValues['return_action'] = 'DetailView';
@@ -195,8 +202,7 @@  discard block
 block discarded – undo
195 202
         {
196 203
             if($defines['focus']->object_name=='Contact') {
197 204
                 $additionalFormFields['parent_type'] = 'Accounts';
198
-            }
199
-            else {
205
+            } else {
200 206
                 $additionalFormFields['parent_type'] = $defines['focus']->module_dir;
201 207
             }
202 208
         }
@@ -205,8 +211,7 @@  discard block
 block discarded – undo
205 211
             if($defines['focus']->object_name=='Contact') {
206 212
                 $additionalFormFields['parent_name'] = $defines['focus']->account_name;
207 213
                 $additionalFormFields['account_name'] = $defines['focus']->account_name;
208
-            }
209
-            else {
214
+            } else {
210 215
                 $additionalFormFields['parent_name'] = $defines['focus']->name;
211 216
             }
212 217
         }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopComposeEmailButton.php 1 patch
Braces   +4 added lines, -3 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.
@@ -83,8 +85,7 @@  discard block
 block discarded – undo
83 85
 			if (isset($bean->emailAddress)){
84 86
 				$to_addrs = $bean->emailAddress->getPrimaryAddress($bean);
85 87
 				$button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() . "'  name='".preg_replace('[ ]', '', $value)."'   title='$title' onclick=\"location.href='mailto:$to_addrs';return false;\" />";
86
-			}
87
-			else{
88
+			} else{
88 89
 				$button = "<input class='button' type='button'  value='$value'  id='". $this->getWidgetId() ."'  name='".preg_replace('[ ]', '', $value)."'  title='$title' onclick=\"location.href='mailto:';return false;\" />";
89 90
 			}
90 91
 		} else {
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelTopButtonQuickCreate.php 1 patch
Braces   +31 added lines, -21 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -60,8 +62,7 @@  discard block
 block discarded – undo
60 62
 				if(!empty($defines['focus']->$value))
61 63
 				{
62 64
 					$additionalFormFields[$key] = $defines['focus']->$value;
63
-				}
64
-				else
65
+				} else
65 66
 				{
66 67
 					$additionalFormFields[$key] = '';
67 68
 				}
@@ -71,8 +72,7 @@  discard block
 block discarded – undo
71 72
 		if(!empty($this->module))
72 73
 		{
73 74
 			$defines['child_module_name'] = $this->module;
74
-		}
75
-		else
75
+		} else
76 76
 		{
77 77
 			$defines['child_module_name'] = $defines['module'];
78 78
 		}
@@ -104,8 +104,9 @@  discard block
 block discarded – undo
104 104
             $additionalFormFields['return_name'] = $defines['focus']->name;
105 105
 		}
106 106
 		
107
-		if(!empty($defines['view']))
108
-		$button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />';
107
+		if(!empty($defines['view'])) {
108
+				$button .= '<input type="hidden" name="target_view" value="'. $defines['view'] . '" />';
109
+		}
109 110
 		$button .= '<input type="hidden" name="to_pdf" value="true" />';
110 111
         $button .= '<input type="hidden" name="tpl" value="QuickCreate.tpl" />';
111 112
 		$button .= '<input type="hidden" name="return_module" value="' . $currentModule . "\" />\n";
@@ -119,8 +120,7 @@  discard block
 block discarded – undo
119 120
 		{
120 121
 			if($defines['focus']->object_name=='Contact') {
121 122
 				$additionalFormFields['parent_type'] = 'Accounts';
122
-			}
123
-			else {
123
+			} else {
124 124
 				$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
125 125
 			}
126 126
 		}
@@ -129,8 +129,7 @@  discard block
 block discarded – undo
129 129
 			if($defines['focus']->object_name=='Contact') {
130 130
 				$additionalFormFields['parent_name'] = $defines['focus']->account_name;
131 131
 				$additionalFormFields['account_name'] = $defines['focus']->account_name;
132
-			}
133
-			else {
132
+			} else {
134 133
 				$additionalFormFields['parent_name'] = $defines['focus']->name;
135 134
 			}
136 135
 		}
@@ -139,8 +138,7 @@  discard block
 block discarded – undo
139 138
 			if($defines['focus']->object_name=='Contact') {
140 139
 				$additionalFormFields['parent_id'] = $defines['focus']->account_id;
141 140
 				$additionalFormFields['account_id'] = $defines['focus']->account_id;
142
-			}
143
-			else {
141
+			} else {
144 142
 				$additionalFormFields['parent_id'] = $defines['focus']->id;
145 143
 			}
146 144
 		}
@@ -149,15 +147,27 @@  discard block
 block discarded – undo
149 147
             //set variables to account name, or parent account name
150 148
             if(strtolower($defines['parent_bean_name']) == 'account' ){
151 149
                 //if account is parent bean, then get focus id/focus name
152
-                if(isset($defines['focus']->id))$additionalFormFields['account_id'] = $defines['focus']->id;
153
-                if(isset($defines['focus']->name))$additionalFormFields['account_name'] = $defines['focus']->name;
154
-            }elseif(strtolower($defines['parent_bean_name']) == 'quote' ){
150
+                if(isset($defines['focus']->id)) {
151
+                    $additionalFormFields['account_id'] = $defines['focus']->id;
152
+                }
153
+                if(isset($defines['focus']->name)) {
154
+                    $additionalFormFields['account_name'] = $defines['focus']->name;
155
+                }
156
+            } elseif(strtolower($defines['parent_bean_name']) == 'quote' ){
155 157
                 //if quote is parent bean, then get billing_account_id/billing_account_name
156
-                if(isset($defines['focus']->billing_account_id))$additionalFormFields['account_id'] = $defines['focus']->billing_account_id;
157
-                if(isset($defines['focus']->billing_account_name))$additionalFormFields['account_name'] = $defines['focus']->billing_account_name;
158
-            }else{
159
-                if(isset($defines['focus']->account_id))$additionalFormFields['account_id'] = $defines['focus']->account_id;
160
-                if(isset($defines['focus']->account_name))$additionalFormFields['account_name'] = $defines['focus']->account_name;
158
+                if(isset($defines['focus']->billing_account_id)) {
159
+                    $additionalFormFields['account_id'] = $defines['focus']->billing_account_id;
160
+                }
161
+                if(isset($defines['focus']->billing_account_name)) {
162
+                    $additionalFormFields['account_name'] = $defines['focus']->billing_account_name;
163
+                }
164
+            } else{
165
+                if(isset($defines['focus']->account_id)) {
166
+                    $additionalFormFields['account_id'] = $defines['focus']->account_id;
167
+                }
168
+                if(isset($defines['focus']->account_name)) {
169
+                    $additionalFormFields['account_name'] = $defines['focus']->account_name;
170
+                }
161 171
             }
162 172
         }
163 173
 
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetField.php 1 patch
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry)
2
+if(!defined('sugarEntry') || !sugarEntry) {
3 3
 	die('Not A Valid Entry Point');
4
+}
4 5
 /*********************************************************************************
5 6
  * SugarCRM Community Edition is a customer relationship management program developed by
6 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -175,8 +176,7 @@  discard block
 block discarded – undo
175 176
 		$key = '';
176 177
 		if ( isset($layout_def['varname']) ) {
177 178
 		    $key = strtoupper($layout_def['varname']);
178
-		} 
179
-		else {
179
+		} else {
180 180
 			$key = strtoupper($this->_get_column_alias($layout_def));
181 181
 		}
182 182
 
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelEmailLink.php 1 patch
Braces   +18 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -62,14 +64,23 @@  discard block
 block discarded – undo
62 64
 
63 65
 
64 66
 
65
-			if(isset($_REQUEST['action'])) $action = $_REQUEST['action'];
66
-			else $action = '';
67
+			if(isset($_REQUEST['action'])) {
68
+			    $action = $_REQUEST['action'];
69
+			} else {
70
+			    $action = '';
71
+			}
67 72
 
68
-			if(isset($_REQUEST['module'])) $module = $_REQUEST['module'];
69
-			else $module = '';
73
+			if(isset($_REQUEST['module'])) {
74
+			    $module = $_REQUEST['module'];
75
+			} else {
76
+			    $module = '';
77
+			}
70 78
 
71
-			if(isset($_REQUEST['record'])) $record = $_REQUEST['record'];
72
-			else $record = '';
79
+			if(isset($_REQUEST['record'])) {
80
+			    $record = $_REQUEST['record'];
81
+			} else {
82
+			    $record = '';
83
+			}
73 84
 
74 85
 			if (!empty($focus->name)) {
75 86
 				$name = $focus->name;
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldtime.php 1 patch
Braces   +4 added lines, -3 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.
@@ -64,8 +66,7 @@  discard block
 block discarded – undo
64 66
                 if(!empty($date)) { // able to get the date context of the time            	
65 67
                 	$td = explode(' ', $timedate->to_display_date_time($date . ' ' . $content));
66 68
 	                return $td[1];
67
-                }
68
-                else { // assume there is no time context
69
+                } else { // assume there is no time context
69 70
                  	return $timedate->to_display_time($content);
70 71
                 }
71 72
         }
Please login to merge, or discard this patch.