Test Failed
Push — CI ( 02428e...3e0292 )
by Adam
55:43
created
generic/SugarWidgets/SugarWidgetSubPanelTopScheduleMeetingButton.php 1 patch
Braces   +8 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.
@@ -61,8 +63,7 @@  discard block
 block discarded – undo
61 63
 				if(!empty($defines['focus']->$value))
62 64
 				{
63 65
 					$additionalFormFields[$key] = $defines['focus']->$value;
64
-				}
65
-				else
66
+				} else
66 67
 				{
67 68
 					$additionalFormFields[$key] = '';
68 69
 				}
@@ -72,8 +73,7 @@  discard block
 block discarded – undo
72 73
 		if(!empty($this->module))
73 74
 		{
74 75
 			$defines['child_module_name'] = $this->module;
75
-		}
76
-		else
76
+		} else
77 77
 		{
78 78
 			$defines['child_module_name'] = $defines['module'];
79 79
 		}
@@ -109,8 +109,7 @@  discard block
 block discarded – undo
109 109
 		{
110 110
 			if($defines['focus']->object_name=='Contact') {
111 111
 				$additionalFormFields['parent_type'] = 'Accounts';
112
-			}
113
-			else {
112
+			} else {
114 113
 				$additionalFormFields['parent_type'] = $defines['focus']->module_dir;
115 114
 			}
116 115
 		}
@@ -119,8 +118,7 @@  discard block
 block discarded – undo
119 118
 			if($defines['focus']->object_name=='Contact') {
120 119
 				$additionalFormFields['parent_name'] = $defines['focus']->account_name;
121 120
 				$additionalFormFields['account_name'] = $defines['focus']->account_name;
122
-			}
123
-			else {
121
+			} else {
124 122
 				$additionalFormFields['parent_name'] = $defines['focus']->name;
125 123
 			}
126 124
 		}
@@ -129,8 +127,7 @@  discard block
 block discarded – undo
129 127
 			if($defines['focus']->object_name=='Contact') {
130 128
 				$additionalFormFields['parent_id'] = $defines['focus']->account_id;
131 129
 				$additionalFormFields['account_id'] = $defines['focus']->account_id;
132
-			}
133
-			else {
130
+			} else {
134 131
 				$additionalFormFields['parent_id'] = $defines['focus']->id;
135 132
 			}
136 133
 		}
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldname.php 1 patch
Braces   +13 added lines, -9 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.
@@ -74,8 +76,9 @@  discard block
 block discarded – undo
74 76
 		$record = $layout_def['fields'][$key];
75 77
 		$layout_def['name'] = $name;
76 78
 		global $current_user;
77
-		if ($module == 'Users' && !is_admin($current_user))
78
-        	$module = 'Employees';
79
+		if ($module == 'Users' && !is_admin($current_user)) {
80
+		        	$module = 'Employees';
81
+		}
79 82
 		$str = "<a target='_blank' href=\"index.php?action=DetailView&module=$module&record=$record\">";
80 83
 		$str .= $this->displayListPlain($layout_def);
81 84
 		$str .= "</a>";
@@ -90,8 +93,9 @@  discard block
 block discarded – undo
90 93
             $field_name = $layout_def['name'];
91 94
             $field_type = $field_def['type'];
92 95
             $str .= "</a>";
93
-            if ($field_name == 'name')
94
-                $str .= "&nbsp;" .SugarThemeRegistry::current()->getImage("edit_inline","border='0' alt='Edit Layout' align='bottom' onClick='SUGAR.reportsInlineEdit.inlineEdit(\"$div_id\",\"$value\",\"$module\",\"$record\",\"$field_name\",\"$field_type\");'");
96
+            if ($field_name == 'name') {
97
+                            $str .= "&nbsp;" .SugarThemeRegistry::current()->getImage("edit_inline","border='0' alt='Edit Layout' align='bottom' onClick='SUGAR.reportsInlineEdit.inlineEdit(\"$div_id\",\"$value\",\"$module\",\"$record\",\"$field_name\",\"$field_type\");'");
98
+            }
95 99
             $str .= "</div>";
96 100
         }
97 101
 		return $str;
@@ -223,9 +227,9 @@  discard block
 block discarded – undo
223 227
 			if ($value == 'Current User') {
224 228
 				global $current_user;
225 229
 				array_push($arr,$this->reporter->db->quoted($current_user->id));
230
+			} else {
231
+							array_push($arr,$this->reporter->db->quoted($value));
226 232
 			}
227
-			else
228
-				array_push($arr,$this->reporter->db->quoted($value));
229 233
 		}
230 234
 
231 235
 		$str = implode(",",$arr);
@@ -247,9 +251,9 @@  discard block
 block discarded – undo
247 251
 			if ($value == 'Current User') {
248 252
 				global $current_user;
249 253
 				array_push($arr,$this->reporter->db->quoted($current_user->id));
254
+			} else {
255
+							array_push($arr,$this->reporter->db->quoted($value));
250 256
 			}
251
-			else
252
-				array_push($arr,$this->reporter->db->quoted($value));
253 257
 		}
254 258
 
255 259
 		$str = implode(",",$arr);
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldcurrency_id.php 1 patch
Braces   +6 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.
@@ -58,8 +60,7 @@  discard block
 block discarded – undo
58 60
             if (is_array($list))
59 61
             {
60 62
                 $list = array_merge(array($currency), $list);
61
-            }
62
-            else
63
+            } else
63 64
             {
64 65
                 $list = array($currency);
65 66
             }
@@ -105,8 +106,7 @@  discard block
 block discarded – undo
105 106
         if (!empty ($field_def['sort_on']))
106 107
         {
107 108
             $order_by = $layout_def['table_alias'].".".$field_def['sort_on'];
108
-        }
109
-        else
109
+        } else
110 110
         {
111 111
             $order_by = $this->_get_column_select($layout_def);
112 112
         }
@@ -114,8 +114,7 @@  discard block
 block discarded – undo
114 114
         if (empty ($layout_def['sort_dir']) || $layout_def['sort_dir'] == 'a')
115 115
         {
116 116
             $order_dir = "ASC";
117
-        }
118
-        else
117
+        } else
119 118
         {
120 119
             $order_dir = "DESC";
121 120
         }
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldbool.php 1 patch
Braces   +6 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.
@@ -69,8 +71,7 @@  discard block
 block discarded – undo
69 71
             global $app_list_strings;
70 72
             if (empty($value)) {
71 73
                 $value = $app_list_strings['dom_switch_bool']['off'];
72
-            }   
73
-            else {
74
+            } else {
74 75
                 $value = $app_list_strings['dom_switch_bool']['on'];
75 76
             } 
76 77
             return $value;
@@ -97,11 +98,9 @@  discard block
 block discarded – undo
97 98
         $yes = $no = $default = '';
98 99
         if (isset($layout_def['input_name0']) && $layout_def['input_name0'] == 1) {
99 100
             $yes = ' selected="selected"';
100
-        }
101
-        elseif (isset($layout_def['input_name0']) && $layout_def['input_name0'] == 'off') {
101
+        } elseif (isset($layout_def['input_name0']) && $layout_def['input_name0'] == 'off') {
102 102
             $no = ' selected="selected"';
103
-        }
104
-        else {
103
+        } else {
105 104
             $default = ' selected="selected"';
106 105
         }
107 106
         
Please login to merge, or discard this patch.
generic/SugarWidgets/SugarWidgetSubPanelTopCreateAccountNameButton.php 1 patch
Braces   +21 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.
@@ -65,18 +67,24 @@  discard block
 block discarded – undo
65 67
 		}
66 68
 		
67 69
 		$additionalFormFields = array();
68
-		if(isset($defines['focus']->billing_address_street)) 
69
-			$additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street;
70
-		if(isset($defines['focus']->billing_address_city)) 
71
-			$additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city;						  		
72
-		if(isset($defines['focus']->billing_address_state)) 
73
-			$additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state;
74
-		if(isset($defines['focus']->billing_address_country)) 
75
-			$additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country;
76
-		if(isset($defines['focus']->billing_address_postalcode)) 
77
-			$additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode;
78
-		if(isset($defines['focus']->phone_office)) 
79
-			$additionalFormFields['phone_work'] = $defines['focus']->phone_office;
70
+		if(isset($defines['focus']->billing_address_street)) {
71
+					$additionalFormFields['primary_address_street'] = $defines['focus']->billing_address_street;
72
+		}
73
+		if(isset($defines['focus']->billing_address_city)) {
74
+					$additionalFormFields['primary_address_city'] = $defines['focus']->billing_address_city;
75
+		}
76
+		if(isset($defines['focus']->billing_address_state)) {
77
+					$additionalFormFields['primary_address_state'] = $defines['focus']->billing_address_state;
78
+		}
79
+		if(isset($defines['focus']->billing_address_country)) {
80
+					$additionalFormFields['primary_address_country'] = $defines['focus']->billing_address_country;
81
+		}
82
+		if(isset($defines['focus']->billing_address_postalcode)) {
83
+					$additionalFormFields['primary_address_postalcode'] = $defines['focus']->billing_address_postalcode;
84
+		}
85
+		if(isset($defines['focus']->phone_office)) {
86
+					$additionalFormFields['phone_work'] = $defines['focus']->phone_office;
87
+		}
80 88
 		
81 89
 		
82 90
 		$button = $this->_get_form($defines, $additionalFormFields);
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelRemoveButtonMeetings.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.
@@ -111,7 +113,7 @@  discard block
 block discarded – undo
111 113
 		if($layout_def['ListView']) {
112 114
             return "<a href=\"javascript:sub_p_rem('$subpanel', '$linked_field'" .", '$record', $refresh_page);\""
113 115
 			        . ' class="listViewTdToolsS1"' . " onclick=\"return sp_rem_conf();\"" . ">$icon_remove_text</a>";
114
-		}else{
116
+		} else{
115 117
 			return '';
116 118
 		}
117 119
 	}
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelIcon.php 1 patch
Braces   +6 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.
@@ -59,8 +61,7 @@  discard block
 block discarded – undo
59 61
 		if(isset($layout_def['varname']))
60 62
 		{
61 63
 			$key = strtoupper($layout_def['varname']);
62
-		}
63
-		else
64
+		} else
64 65
 		{
65 66
 			$key = $this->_get_column_alias($layout_def);
66 67
 			$key = strtoupper($key);
@@ -77,8 +78,7 @@  discard block
 block discarded – undo
77 78
 			if(empty($layout_def['target_module']))
78 79
 			{
79 80
 				$module = $layout_def['module'];
80
-			}
81
-		else
81
+			} else
82 82
 			{
83 83
 				$module = $layout_def['target_module'];
84 84
 			}
@@ -87,8 +87,7 @@  discard block
 block discarded – undo
87 87
 		if(empty($layout_def['target_record_key']))
88 88
 		{
89 89
 			$record = $layout_def['fields']['ID'];
90
-		}
91
-		else
90
+		} else
92 91
 		{
93 92
 			$record_key = strtoupper($layout_def['target_record_key']);
94 93
 			$record = $layout_def['fields'][$record_key];
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetSubPanelRemoveButton.php 1 patch
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -106,8 +108,9 @@  discard block
 block discarded – undo
106 108
 
107 109
 		$icon_remove_text = mb_strtolower($app_strings['LBL_ID_FF_REMOVE'], 'UTF-8');
108 110
 		
109
-         if($linked_field == 'get_emails_by_assign_or_link')
110
-            $linked_field = 'emails';
111
+         if($linked_field == 'get_emails_by_assign_or_link') {
112
+                     $linked_field = 'emails';
113
+         }
111 114
 		//based on listview since that lets you select records
112 115
 		if($layout_def['ListView'] && !$hideremove) {
113 116
             $retStr = "<a href=\"javascript:sub_p_rem('$subpanel', '$linked_field'" 
@@ -118,7 +121,7 @@  discard block
 block discarded – undo
118 121
 			. ">$icon_remove_text</a>";
119 122
         return $retStr;
120 123
             
121
-		}else{
124
+		} else{
122 125
 			return '';
123 126
 		}
124 127
 	}
Please login to merge, or discard this patch.
include/generic/SugarWidgets/SugarWidgetFieldcurrency.php 1 patch
Braces   +16 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.
@@ -57,8 +59,7 @@  discard block
 block discarded – undo
57 59
         if($current_user->getPreference('currency') )
58 60
         {
59 61
                 $global_currency_obj->retrieve($current_user->getPreference('currency'));
60
-        }
61
-        else
62
+        } else
62 63
         {
63 64
                 $global_currency_obj->retrieve('-99');
64 65
         }
@@ -96,13 +97,13 @@  discard block
 block discarded – undo
96 97
             
97 98
         if(!empty($layout_def['column_key'])){
98 99
             $field_def = $this->reporter->all_fields[$layout_def['column_key']];    
99
-        }else if(!empty($layout_def['fields'])){
100
+        } else if(!empty($layout_def['fields'])){
100 101
             $field_def = $layout_def['fields'];
101 102
         }
102 103
         $record = '';
103
-        if ($layout_def['table_key'] == 'self' && isset($layout_def['fields']['PRIMARYID']))
104
-            $record = $layout_def['fields']['PRIMARYID'];
105
-        else if (isset($layout_def['fields'][strtoupper($layout_def['table_alias']."_id")])){ 
104
+        if ($layout_def['table_key'] == 'self' && isset($layout_def['fields']['PRIMARYID'])) {
105
+                    $record = $layout_def['fields']['PRIMARYID'];
106
+        } else if (isset($layout_def['fields'][strtoupper($layout_def['table_alias']."_id")])){ 
106 107
             $record = $layout_def['fields'][strtoupper($layout_def['table_alias']."_id")];
107 108
         }
108 109
         if (!empty($record)) {
@@ -118,9 +119,9 @@  discard block
 block discarded – undo
118 119
             }
119 120
 	        $str .= "</div>";
120 121
 	        return $str;
122
+        } else {
123
+                    return $display;
121 124
         }
122
-        else
123
-            return $display;
124 125
     }
125 126
                              
126 127
     function displayListPlain($layout_def) {
@@ -200,8 +201,9 @@  discard block
 block discarded – undo
200 201
         }
201 202
 
202 203
         $real_table = '';
203
-        if (!empty($this->reporter->all_fields[$layout_def['column_key']]['real_table']))
204
-            $real_table = $this->reporter->all_fields[$layout_def['column_key']]['real_table'];
204
+        if (!empty($this->reporter->all_fields[$layout_def['column_key']]['real_table'])) {
205
+                    $real_table = $this->reporter->all_fields[$layout_def['column_key']]['real_table'];
206
+        }
205 207
 
206 208
         $add_currency_id = false;
207 209
         if(!empty($table)) {
@@ -234,19 +236,16 @@  discard block
 block discarded – undo
234 236
         {
235 237
             $currency_symbol = $layout_def['currency_symbol'];
236 238
             $currency_id = $layout_def['currency_id'];
237
-        }
238
-        else
239
+        } else
239 240
         {
240 241
             $key = strtoupper(isset($layout_def['varname']) ? $layout_def['varname'] : $this->_get_column_alias($layout_def));
241 242
             if ( $this->isSystemCurrency($layout_def) )
242 243
             {
243 244
                 $currency_id = '-99';
244
-            }
245
-            elseif (isset($layout_def['fields'][$key.'_CURRENCY']))
245
+            } elseif (isset($layout_def['fields'][$key.'_CURRENCY']))
246 246
             {
247 247
                 $currency_id = $layout_def['fields'][$key.'_CURRENCY'];
248
-            }
249
-            elseif(isset($layout_def['fields'][$this->getTruncatedColumnAlias($this->_get_column_alias($layout_def)."_currency")]))
248
+            } elseif(isset($layout_def['fields'][$this->getTruncatedColumnAlias($this->_get_column_alias($layout_def)."_currency")]))
250 249
             {
251 250
                 $currency_id = $layout_def['fields'][$this->getTruncatedColumnAlias($this->_get_column_alias($layout_def)."_currency")];
252 251
             }
Please login to merge, or discard this patch.