Completed
Push — console-installer ( 03fc02...67c42e )
by Adam
72:27 queued 53:14
created
modules/AOP_Case_Updates/AOPAssignManager.php 1 patch
Braces   +5 added lines, -6 removed lines patch added patch discarded remove patch
@@ -10,13 +10,13 @@  discard block
 block discarded – undo
10 10
         $this->ieX = $ieX;
11 11
         if($ieX) {
12 12
             $inboundDistribMethod = $ieX->get_stored_options("distrib_method", "");
13
-        }else{
13
+        } else{
14 14
             $inboundDistribMethod = '';
15 15
         }
16 16
         if($this->isAOPFallback($inboundDistribMethod)){
17 17
             $this->distributionMethod = $sugar_config['aop']['distribution_method'];
18 18
             $this->aopFallback = true;
19
-        }else{
19
+        } else{
20 20
             $this->distributionMethod = $inboundDistribMethod;
21 21
             $this->aopFallback = false;
22 22
         }
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
         global $sugar_config;
32 32
         if($this->aopFallback){
33 33
             return $sugar_config['aop']['distribution_options'];
34
-        }else{
34
+        } else{
35 35
             return $this->ieX->get_stored_options("distribution_options", '');
36 36
         }
37 37
     }
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
         }
98 98
         if($this->aopFallback){
99 99
             $this->singleUser = !empty($sugar_config['aop']['distribution_user_id']) ? $sugar_config['aop']['distribution_user_id'] : '';
100
-        }else{
100
+        } else{
101 101
             $this->singleUser = $this->ieX->get_stored_options("distribution_user_id", "");
102 102
         }
103 103
         return $this->singleUser;
@@ -166,8 +166,7 @@  discard block
 block discarded – undo
166 166
         $file = create_cache_directory('modules/AOP_Case_Updates/Users/') . $id . 'lastUser.cache.php';
167 167
         if(isset($_SESSION['AOPlastuser'][$id]) && $_SESSION['AOPlastuser'][$id] != '') {
168 168
             $lastUserId = $_SESSION['AOPlastuser'][$id];
169
-        }
170
-        else if (is_file($file)){
169
+        } else if (is_file($file)){
171 170
             include $file;
172 171
             if(isset($lastUser['User']) && $lastUser['User'] != '') {
173 172
                 $lastUserId = $lastUser['User'];
Please login to merge, or discard this patch.
modules/Import/ImportFieldSanitize.php 1 patch
Braces   +56 added lines, -39 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
 /*********************************************************************************
5 7
  * SugarCRM Community Edition is a customer relationship management program developed by
@@ -93,14 +95,16 @@  discard block
 block discarded – undo
93 95
         }
94 96
         $value = $params[0];
95 97
         $vardef = $params[1];
96
-        if ( isset($params[2]) )
97
-            $focus = $params[2];
98
-        else
99
-            $focus = null;
100
-        if ( $name == 'relate' && !empty($params[3]) )
101
-            $this->addRelatedBean = true;
102
-        else
103
-            $this->addRelatedBean = false;
98
+        if ( isset($params[2]) ) {
99
+                    $focus = $params[2];
100
+        } else {
101
+                    $focus = null;
102
+        }
103
+        if ( $name == 'relate' && !empty($params[3]) ) {
104
+                    $this->addRelatedBean = true;
105
+        } else {
106
+                    $this->addRelatedBean = false;
107
+        }
104 108
         
105 109
         $field = $sfh->getSugarField(ucfirst($name));
106 110
         if ( $field instanceOf SugarFieldBase ) {
@@ -128,11 +132,13 @@  discard block
 block discarded – undo
128 132
 
129 133
         $format = $this->dateformat;
130 134
 
131
-        if ( !$timedate->check_matching_format($value, $format) )
132
-            return false;
135
+        if ( !$timedate->check_matching_format($value, $format) ) {
136
+                    return false;
137
+        }
133 138
 
134
-        if ( !$this->isValidTimeDate($value, $format) )
135
-            return false;
139
+        if ( !$this->isValidTimeDate($value, $format) ) {
140
+                    return false;
141
+        }
136 142
 
137 143
         $value = $timedate->swap_formats(
138 144
             $value, $format, $timedate->get_date_format());
@@ -199,8 +205,7 @@  discard block
 block discarded – undo
199 205
                         || $focus_user->retrieve($eachItem)
200 206
                 ) {
201 207
                     // all good
202
-                }
203
-                else {
208
+                } else {
204 209
                     $isValid     = false;
205 210
                     $bad_names[] = $eachItem;
206 211
                     continue;
@@ -232,11 +237,13 @@  discard block
 block discarded – undo
232 237
 
233 238
         $format = $this->timeformat;
234 239
 
235
-        if ( !$timedate->check_matching_format($value, $format) )
236
-            return false;
240
+        if ( !$timedate->check_matching_format($value, $format) ) {
241
+                    return false;
242
+        }
237 243
 
238
-        if ( !$this->isValidTimeDate($value, $format) )
239
-            return false;
244
+        if ( !$this->isValidTimeDate($value, $format) ) {
245
+                    return false;
246
+        }
240 247
 
241 248
         $value = $timedate->swap_formats(
242 249
             $value, $format, $timedate->get_time_format());
@@ -266,47 +273,57 @@  discard block
 block discarded – undo
266 273
         $reg = $timedate->get_regular_expression($format);
267 274
         preg_match('@'.$reg['format'].'@', $value, $dateparts);
268 275
 
269
-        if ( empty($dateparts) )
270
-            return false;
276
+        if ( empty($dateparts) ) {
277
+                    return false;
278
+        }
271 279
         if ( isset($reg['positions']['a'])
272
-                && !in_array($dateparts[$reg['positions']['a']], array('am','pm')) )
273
-            return false;
280
+                && !in_array($dateparts[$reg['positions']['a']], array('am','pm')) ) {
281
+                    return false;
282
+        }
274 283
         if ( isset($reg['positions']['A'])
275
-                && !in_array($dateparts[$reg['positions']['A']], array('AM','PM')) )
276
-            return false;
284
+                && !in_array($dateparts[$reg['positions']['A']], array('AM','PM')) ) {
285
+                    return false;
286
+        }
277 287
         if ( isset($reg['positions']['h']) && (
278 288
                 !is_numeric($dateparts[$reg['positions']['h']])
279 289
                 || $dateparts[$reg['positions']['h']] < 1
280
-                || $dateparts[$reg['positions']['h']] > 12 ) )
281
-            return false;
290
+                || $dateparts[$reg['positions']['h']] > 12 ) ) {
291
+                    return false;
292
+        }
282 293
         if ( isset($reg['positions']['H']) && (
283 294
                 !is_numeric($dateparts[$reg['positions']['H']])
284 295
                 || $dateparts[$reg['positions']['H']] < 0
285
-                || $dateparts[$reg['positions']['H']] > 23 ) )
286
-            return false;
296
+                || $dateparts[$reg['positions']['H']] > 23 ) ) {
297
+                    return false;
298
+        }
287 299
         if ( isset($reg['positions']['i']) && (
288 300
                 !is_numeric($dateparts[$reg['positions']['i']])
289 301
                 || $dateparts[$reg['positions']['i']] < 0
290
-                || $dateparts[$reg['positions']['i']] > 59 ) )
291
-            return false;
302
+                || $dateparts[$reg['positions']['i']] > 59 ) ) {
303
+                    return false;
304
+        }
292 305
         if ( isset($reg['positions']['s']) && (
293 306
                 !is_numeric($dateparts[$reg['positions']['s']])
294 307
                 || $dateparts[$reg['positions']['s']] < 0
295
-                || $dateparts[$reg['positions']['s']] > 59 ) )
296
-            return false;
308
+                || $dateparts[$reg['positions']['s']] > 59 ) ) {
309
+                    return false;
310
+        }
297 311
         if ( isset($reg['positions']['d']) && (
298 312
                 !is_numeric($dateparts[$reg['positions']['d']])
299 313
                 || $dateparts[$reg['positions']['d']] < 1
300
-                || $dateparts[$reg['positions']['d']] > 31 ) )
301
-            return false;
314
+                || $dateparts[$reg['positions']['d']] > 31 ) ) {
315
+                    return false;
316
+        }
302 317
         if ( isset($reg['positions']['m']) && (
303 318
                 !is_numeric($dateparts[$reg['positions']['m']])
304 319
                 || $dateparts[$reg['positions']['m']] < 1
305
-                || $dateparts[$reg['positions']['m']] > 12 ) )
306
-            return false;
320
+                || $dateparts[$reg['positions']['m']] > 12 ) ) {
321
+                    return false;
322
+        }
307 323
         if ( isset($reg['positions']['Y']) &&
308
-                !is_numeric($dateparts[$reg['positions']['Y']]) )
309
-            return false;
324
+                !is_numeric($dateparts[$reg['positions']['Y']]) ) {
325
+                    return false;
326
+        }
310 327
 
311 328
         return true;
312 329
     }
Please login to merge, or discard this patch.
modules/Import/maps/ImportMap.php 1 patch
Braces   +16 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.
@@ -227,7 +229,9 @@  discard block
 block discarded – undo
227 229
 
228 230
         // Bug 23354 - Make sure enclosure gets saved as an empty string if
229 231
         // it is an empty string, instead of as a null
230
-        if ( strlen($enclosure) <= 0 ) $enclosure = ' ';
232
+        if ( strlen($enclosure) <= 0 ) {
233
+            $enclosure = ' ';
234
+        }
231 235
 
232 236
         $this->assigned_user_id = $owner_id;
233 237
         $this->name             = $name;
@@ -266,8 +270,9 @@  discard block
 block discarded – undo
266 270
             $other_map = new ImportMap();
267 271
             $other_map->retrieve_by_string_fields(array('id'=> $id), false);
268 272
 
269
-            if ( $other_map->assigned_user_id != $current_user->id )
270
-                return false;
273
+            if ( $other_map->assigned_user_id != $current_user->id ) {
274
+                            return false;
275
+            }
271 276
         }
272 277
 
273 278
         return parent::mark_deleted($id);
@@ -287,8 +292,9 @@  discard block
 block discarded – undo
287 292
     {
288 293
         global $current_user;
289 294
 
290
-        if ( !is_admin($current_user) )
291
-            return false;
295
+        if ( !is_admin($current_user) ) {
296
+                    return false;
297
+        }
292 298
 
293 299
         // check for problems
294 300
         if ($flag) {
@@ -299,8 +305,7 @@  discard block
 block discarded – undo
299 305
                 'name'         =>$this->name,
300 306
                 'is_published' =>'yes'
301 307
                 );
302
-        }
303
-        else {
308
+        } else {
304 309
             // if you are trying to unpublish a map
305 310
             // but you own an unpublished map by the same name
306 311
             $query_arr = array(
@@ -313,8 +318,9 @@  discard block
 block discarded – undo
313 318
         $other_map->retrieve_by_string_fields($query_arr, false);
314 319
 
315 320
         // if we find this other map, quit
316
-        if ( isset($other_map->id) )
317
-            return false;
321
+        if ( isset($other_map->id) ) {
322
+                    return false;
323
+        }
318 324
 
319 325
         // otherwise update the is_published flag
320 326
         $query = "UPDATE $this->table_name
Please login to merge, or discard this patch.
modules/Import/ImportDuplicateCheck.php 1 patch
Braces   +64 added lines, -42 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
 /*********************************************************************************
5 7
  * SugarCRM Community Edition is a customer relationship management program developed by
@@ -83,18 +85,20 @@  discard block
 block discarded – undo
83 85
             $indexes = array_merge($custmIndexes,$indexes);
84 86
         }
85 87
 
86
-        if ( $this->_focus->getFieldDefinition('email1') )
87
-            $indexes[] = array(
88
+        if ( $this->_focus->getFieldDefinition('email1') ) {
89
+                    $indexes[] = array(
88 90
                 'name' => 'special_idx_email1',
89 91
                 'type' => 'index',
90 92
                 'fields' => array('email1')
91 93
                 );
92
-        if ( $this->_focus->getFieldDefinition('email2') )
93
-            $indexes[] = array(
94
+        }
95
+        if ( $this->_focus->getFieldDefinition('email2') ) {
96
+                    $indexes[] = array(
94 97
                 'name' => 'special_idx_email2',
95 98
                 'type' => 'index',
96 99
                 'fields' => array('email2')
97 100
                 );
101
+        }
98 102
 
99 103
         return $indexes;
100 104
     }
@@ -116,12 +120,15 @@  discard block
 block discarded – undo
116 120
             if ($index['type'] == "index"){
117 121
                 $labelsArray = array();
118 122
                 foreach ($index['fields'] as $field){
119
-                    if ($field == 'deleted') continue;
123
+                    if ($field == 'deleted') {
124
+                        continue;
125
+                    }
120 126
                     $fieldDef = $this->_focus->getFieldDefinition($field);
121
-                    if ( isset($fieldDef['vname']) && isset($super_language_pack[$fieldDef['vname']]) )
122
-                        $labelsArray[$fieldDef['name']] = $super_language_pack[$fieldDef['vname']];
123
-                    else
124
-                        $labelsArray[$fieldDef['name']] = $fieldDef['name'];
127
+                    if ( isset($fieldDef['vname']) && isset($super_language_pack[$fieldDef['vname']]) ) {
128
+                                            $labelsArray[$fieldDef['name']] = $super_language_pack[$fieldDef['vname']];
129
+                    } else {
130
+                                            $labelsArray[$fieldDef['name']] = $fieldDef['name'];
131
+                    }
125 132
                 }
126 133
                 $index_array[$index['name']] = str_replace(":", "",implode(", ",$labelsArray));
127 134
             }
@@ -144,33 +151,37 @@  discard block
 block discarded – undo
144 151
             {
145 152
                 $emailAddress = new SugarEmailAddress();
146 153
                 $email = $field;
147
-                if ( $emailAddress->getCountEmailAddressByBean($this->_focus->$email,$this->_focus,($field == 'email1')) > 0 )
148
-                    return true;
149
-            }
150
-            else
154
+                if ( $emailAddress->getCountEmailAddressByBean($this->_focus->$email,$this->_focus,($field == 'email1')) > 0 ) {
155
+                                    return true;
156
+                }
157
+            } else
151 158
             {
152 159
                 $index_fields = array('deleted' => '0');
153 160
                 if( is_array($field) )
154 161
                 {
155 162
                     foreach($field as $tmpField)
156 163
                     {
157
-                        if ($tmpField == 'deleted')
158
-                            continue;
159
-                        if (strlen($this->_focus->$tmpField) > 0)
160
-                            $index_fields[$tmpField] = $this->_focus->$tmpField;
164
+                        if ($tmpField == 'deleted') {
165
+                                                    continue;
166
+                        }
167
+                        if (strlen($this->_focus->$tmpField) > 0) {
168
+                                                    $index_fields[$tmpField] = $this->_focus->$tmpField;
169
+                        }
161 170
                     }
171
+                } elseif($field != 'deleted' && strlen($this->_focus->$field) > 0) {
172
+                                    $index_fields[$field] = $this->_focus->$field;
162 173
                 }
163
-                elseif($field != 'deleted' && strlen($this->_focus->$field) > 0)
164
-                    $index_fields[$field] = $this->_focus->$field;
165 174
 
166
-                if ( count($index_fields) <= 1 )
167
-                    continue;
175
+                if ( count($index_fields) <= 1 ) {
176
+                                    continue;
177
+                }
168 178
 
169 179
                 $newfocus = loadBean($this->_focus->module_dir);
170 180
                 $result = $newfocus->retrieve_by_string_fields($index_fields,true);
171 181
 
172
-                if ( !is_null($result) )
173
-                    return true;
182
+                if ( !is_null($result) ) {
183
+                                    return true;
184
+                }
174 185
             }
175 186
         }
176 187
 
@@ -204,13 +215,15 @@  discard block
 block discarded – undo
204 215
         $fieldlist=array();
205 216
         $customIndexlist=array();
206 217
         foreach($origIndexList as $iv){
207
-            if(empty($iv)) continue;
218
+            if(empty($iv)) {
219
+                continue;
220
+            }
208 221
             $field_index_array = explode('::',$iv);
209 222
             if($field_index_array[0] == 'customfield'){
210 223
                 //this is a custom field, so place in custom array
211 224
                 $customIndexlist[] = $field_index_array[1];
212 225
 
213
-            }else{
226
+            } else{
214 227
                 //this is not a custom field, so place in index list
215 228
                 $indexlist[] = $field_index_array[0];
216 229
                 if(isset($field_index_array[1])) {
@@ -237,8 +250,9 @@  discard block
 block discarded – undo
237 250
         // loop through var def indexes and compare with selected indexes
238 251
         foreach ($this->_getIndexVardefs() as $index){
239 252
             // if we get an index not in the indexlist, loop
240
-            if ( !in_array($index['name'],$indexlist) )
241
-                continue;
253
+            if ( !in_array($index['name'],$indexlist) ) {
254
+                            continue;
255
+            }
242 256
 
243 257
             // This handles the special case of duplicate email checking
244 258
             if ( $index['name'] == 'special_idx_email1' || $index['name'] == 'special_idx_email2' ) {
@@ -249,31 +263,35 @@  discard block
 block discarded – undo
249 263
                         $this->_focus,
250 264
                         ($index['name'] == 'special_idx_email1')
251 265
                         ) > 0 ){ foreach($index['fields'] as $field){
252
-                        if($field !='deleted')
253
-                            $this->_dupedFields[] = $field;
266
+                        if($field !='deleted') {
267
+                                                    $this->_dupedFields[] = $field;
268
+                        }
254 269
                     }
255 270
                 }
256 271
             }
257 272
             // Adds a hook so you can define a method in the bean to handle dupe checking
258 273
             elseif ( isset($index['dupeCheckFunction']) ) {
259 274
                 $functionName = substr_replace($index['dupeCheckFunction'],'',0,9);
260
-                if ( method_exists($this->_focus,$functionName) && $this->_focus->$functionName($index) === true)
261
-                    return $this->_focus->$functionName($index);
262
-            }
263
-            else {
275
+                if ( method_exists($this->_focus,$functionName) && $this->_focus->$functionName($index) === true) {
276
+                                    return $this->_focus->$functionName($index);
277
+                }
278
+            } else {
264 279
                 $index_fields = array('deleted' => '0');
265 280
                 //search only for the field we have selected
266 281
                 foreach($index['fields'] as $field){
267
-                    if ($field == 'deleted' ||  !in_array($field,$fieldlist))
268
-                        continue;
269
-                    if (!in_array($field,$index_fields))
270
-                        if (isset($this->_focus->$field) && strlen($this->_focus->$field) > 0)
282
+                    if ($field == 'deleted' ||  !in_array($field,$fieldlist)) {
283
+                                            continue;
284
+                    }
285
+                    if (!in_array($field,$index_fields)) {
286
+                                            if (isset($this->_focus->$field) && strlen($this->_focus->$field) > 0)
271 287
                             $index_fields[$field] = $this->_focus->$field;
288
+                    }
272 289
                 }
273 290
 
274 291
                 // if there are no valid fields in the index field list, loop
275
-                if ( count($index_fields) <= 1 )
276
-                    continue;
292
+                if ( count($index_fields) <= 1 ) {
293
+                                    continue;
294
+                }
277 295
 
278 296
                 $newfocus = loadBean($this->_focus->module_dir);
279 297
                 $result = $newfocus->retrieve_by_string_fields($index_fields,true);
@@ -320,11 +338,15 @@  discard block
 block discarded – undo
320 338
                     $fieldName='';
321 339
 
322 340
                     //skip this field if it is the deleted field, not in the importable keys array, or a field in the exclude array
323
-                    if (!in_array($field, $importable_keys) || in_array($field, $exclude_array)) continue;
341
+                    if (!in_array($field, $importable_keys) || in_array($field, $exclude_array)) {
342
+                        continue;
343
+                    }
324 344
                     $fieldDef = $this->_focus->getFieldDefinition($field);
325 345
 
326 346
                     //skip if this field is already defined (from another index)
327
-                    if (in_array($fieldDef['name'],$fields_used)) continue;
347
+                    if (in_array($fieldDef['name'],$fields_used)) {
348
+                        continue;
349
+                    }
328 350
 
329 351
                     //get the proper export label
330 352
                     $fieldName = translateForExport($fieldDef['name'],$this->_focus);
Please login to merge, or discard this patch.
modules/Cases/metadata/additionalDetails.php 1 patch
Braces   +9 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.
@@ -52,12 +54,16 @@  discard block
 block discarded – undo
52 54
 		
53 55
 	if(!empty($fields['DESCRIPTION'])) { 
54 56
 		$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
55
-		if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
57
+		if(strlen($fields['DESCRIPTION']) > 300) {
58
+		    $overlib_string .= '...';
59
+		}
56 60
 		$overlib_string .= '<br>';
57 61
 	}
58 62
 	if(!empty($fields['RESOLUTION'])) { 
59 63
 		$overlib_string .= '<b>'. $mod_strings['LBL_RESOLUTION'] . '</b> ' . substr($fields['RESOLUTION'], 0, 300);
60
-		if(strlen($fields['RESOLUTION']) > 300) $overlib_string .= '...';
64
+		if(strlen($fields['RESOLUTION']) > 300) {
65
+		    $overlib_string .= '...';
66
+		}
61 67
 	}		
62 68
 	
63 69
 	return array('fieldToAddTo' => 'NAME', 
Please login to merge, or discard this patch.
modules/Opportunities/SubPanelView.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.
@@ -69,7 +71,9 @@  discard block
 block discarded – undo
69 71
 
70 72
 $button  = "<form action='index.php' method='post' name='form' id='form'>\n";
71 73
 $button .= "<input type='hidden' name='module' value='Opportunities'>\n";
72
-if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value=\"".urlencode($focus->name)."\">\n";
74
+if ($currentModule == 'Accounts') {
75
+    $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value=\"".urlencode($focus->name)."\">\n";
76
+}
73 77
 if ($currentModule == 'Contacts') {
74 78
 	$button .= "<input type='hidden' name='account_id' value='$focus->account_id'>\n<input type='hidden' name='account_name' value=\"".urlencode($focus->account_name)."\">\n";
75 79
 	$button .= "<input type='hidden' name='contact_id' value='$focus->id'>\n";
@@ -105,8 +109,7 @@  discard block
 block discarded – undo
105 109
 		."' type='button' class='button' value='  ".$app_strings['LBL_SELECT_BUTTON_LABEL']
106 110
 		."  ' name='button' onclick='open_popup(\"Opportunities\", 600, 400, \"\", false, true, {$encoded_popup_request_data});'>\n";
107 111
 //		."  ' name='button' onclick='window.open(\"index.php?module=Opportunities&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'>\n";
108
-}
109
-else
112
+} else
110 113
 {
111 114
 	///////////////////////////////////////
112 115
 	///
Please login to merge, or discard this patch.
modules/Opportunities/metadata/additionalDetails.php 1 patch
Braces   +18 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -45,15 +47,25 @@  discard block
 block discarded – undo
45 47
 	$mod_strings = return_module_language($current_language, 'Opportunities');
46 48
 	$overlib_string = '';
47 49
 	
48
-	if(!empty($fields['LEAD_SOURCE'])) $overlib_string .= '<b>'. $mod_strings['LBL_LEAD_SOURCE'] . '</b> ' . $fields['LEAD_SOURCE'] . '<br>';
49
-	if(!empty($fields['PROBABILITY'])) $overlib_string .= '<b>'. $mod_strings['LBL_PROBABILITY'] . '</b> ' . $fields['PROBABILITY'] . '<br>';
50
-	if(!empty($fields['NEXT_STEP'])) $overlib_string .= '<b>'. $mod_strings['LBL_NEXT_STEP'] . '</b> ' . $fields['NEXT_STEP'] . '<br>';
51
-	if(!empty($fields['OPPORTUNITY_TYPE'])) $overlib_string .= '<b>'. $mod_strings['LBL_TYPE'] . '</b> ' . $fields['OPPORTUNITY_TYPE'] . '<br>';
50
+	if(!empty($fields['LEAD_SOURCE'])) {
51
+	    $overlib_string .= '<b>'. $mod_strings['LBL_LEAD_SOURCE'] . '</b> ' . $fields['LEAD_SOURCE'] . '<br>';
52
+	}
53
+	if(!empty($fields['PROBABILITY'])) {
54
+	    $overlib_string .= '<b>'. $mod_strings['LBL_PROBABILITY'] . '</b> ' . $fields['PROBABILITY'] . '<br>';
55
+	}
56
+	if(!empty($fields['NEXT_STEP'])) {
57
+	    $overlib_string .= '<b>'. $mod_strings['LBL_NEXT_STEP'] . '</b> ' . $fields['NEXT_STEP'] . '<br>';
58
+	}
59
+	if(!empty($fields['OPPORTUNITY_TYPE'])) {
60
+	    $overlib_string .= '<b>'. $mod_strings['LBL_TYPE'] . '</b> ' . $fields['OPPORTUNITY_TYPE'] . '<br>';
61
+	}
52 62
 
53 63
 	if(!empty($fields['DESCRIPTION'])) {
54 64
 		$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ';
55 65
 		$overlib_string .= substr($fields['DESCRIPTION'], 0, 300);
56
-		if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
66
+		if(strlen($fields['DESCRIPTION']) > 300) {
67
+		    $overlib_string .= '...';
68
+		}
57 69
 	}	
58 70
 	
59 71
 	return array('fieldToAddTo' => 'NAME', 
Please login to merge, or discard this patch.
modules/Opportunities/OpportunityFormBase.php 1 patch
Braces   +21 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.
@@ -65,7 +67,9 @@  discard block
 block discarded – undo
65 67
 			$i++;
66 68
 			$rows[$i] = $row;
67 69
 		}
68
-		if ($i==-1) return null;
70
+		if ($i==-1) {
71
+		    return null;
72
+		}
69 73
 		
70 74
 		return $rows;		
71 75
 	}
@@ -77,7 +81,9 @@  discard block
 block discarded – undo
77 81
 	if(!empty($mod)){
78 82
 	global $current_language;
79 83
 	$mod_strings = return_module_language($current_language, $mod);
80
-	}else global $mod_strings;
84
+	} else {
85
+	    global $mod_strings;
86
+	}
81 87
 	global $app_strings;
82 88
 	$cols = sizeof($rows[0]) * 2 + 1;
83 89
 	$form = '<table width="100%"><tr><td>'.$mod_strings['MSG_DUPLICATE']. '</td></tr><tr><td height="20"></td></tr></table>';
@@ -108,14 +114,14 @@  discard block
 block discarded – undo
108 114
 					if(!$wasSet){
109 115
 					$form .= "<td scope='row'><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record=${row['id']}'>$value</a></td>";
110 116
 					$wasSet = true;
111
-					}else{
117
+					} else{
112 118
 					$form .= "<td><a target='_blank' href='index.php?module=Opportunities&action=DetailView&record=${row['id']}'>$value</a></td>";
113 119
 					}
114 120
 				}}
115 121
 
116 122
 		if($rowColor == 'evenListRowS1'){
117 123
 			$rowColor = 'oddListRowS1';
118
-		}else{
124
+		} else{
119 125
 			 $rowColor = 'evenListRowS1';
120 126
 		}
121 127
 		$form .= "</tr>";
@@ -136,7 +142,9 @@  discard block
 block discarded – undo
136 142
 if(!empty($mod)){
137 143
 	global $current_language;
138 144
 	$mod_strings = return_module_language($current_language, $mod);
139
-}else global $mod_strings;
145
+} else {
146
+    global $mod_strings;
147
+}
140 148
 global $app_strings;
141 149
 global $sugar_version, $sugar_config;
142 150
 
@@ -286,7 +294,9 @@  discard block
 block discarded – undo
286 294
 EOQ;
287 295
 //carry forward custom lead fields to opportunities during Lead Conversion
288 296
 	$tempOpp = new Opportunity();
289
-	if (method_exists($lead, 'convertCustomFieldsForm')) $lead->convertCustomFieldsForm($the_form, $tempOpp, $prefix);
297
+	if (method_exists($lead, 'convertCustomFieldsForm')) {
298
+	    $lead->convertCustomFieldsForm($the_form, $tempOpp, $prefix);
299
+	}
290 300
 	unset($tempOpp);
291 301
 
292 302
 $the_form .= <<<EOQ
@@ -321,7 +331,9 @@  discard block
 block discarded – undo
321 331
 if(!empty($mod)){
322 332
 	global $current_language;
323 333
 	$mod_strings = return_module_language($current_language, $mod);
324
-}else global $mod_strings;
334
+} else {
335
+    global $mod_strings;
336
+}
325 337
 global $app_strings;
326 338
 global $app_list_strings;
327 339
 global $theme;
@@ -461,7 +473,7 @@  discard block
 block discarded – undo
461 473
 	$GLOBALS['log']->debug("Saved record with id of ".$return_id);
462 474
 	if($redirect){
463 475
 		handleRedirect($return_id,"Opportunities" );
464
-	}else{
476
+	} else{
465 477
 		return $focus;
466 478
 	}
467 479
 }
Please login to merge, or discard this patch.
modules/ProspectLists/ProspectListFormBase.php 1 patch
Braces   +6 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.
@@ -153,8 +155,9 @@  discard block
 block discarded – undo
153 155
 		if(empty($focus->name)){
154 156
 			return null;
155 157
 		}	
156
-        if ( !isset($focus->assigned_user_id) || $focus->assigned_user_id == '' )
157
-            $focus->assigned_user_id = $GLOBALS['current_user']->id;
158
+        if ( !isset($focus->assigned_user_id) || $focus->assigned_user_id == '' ) {
159
+                    $focus->assigned_user_id = $GLOBALS['current_user']->id;
160
+        }
158 161
 	
159 162
 		$return_id = $focus->save();
160 163
 		if($redirect){
Please login to merge, or discard this patch.