Completed
Push — develop ( 7c1bda...edae1e )
by Adam
18:38 queued 03:14
created
modules/ModuleBuilder/parsers/parser.modifysubpanel.php 1 patch
Braces   +11 added lines, -6 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.
@@ -114,10 +115,12 @@  discard block
 block discarded – undo
114 115
         $this->defaults = array ( ) ;
115 116
         foreach ( $this->listViewDefs as $key => $def )
116 117
         {
117
-            if (! empty ( $def [ 'usage' ] ) && strcmp ( $def [ 'usage' ], 'query_only' ) == 0)
118
-                continue ;
119
-            if (! empty ( $def [ 'vname' ] ))
120
-                $def [ 'label' ] = $def [ 'vname' ] ;
118
+            if (! empty ( $def [ 'usage' ] ) && strcmp ( $def [ 'usage' ], 'query_only' ) == 0) {
119
+                            continue ;
120
+            }
121
+            if (! empty ( $def [ 'vname' ] )) {
122
+                            $def [ 'label' ] = $def [ 'vname' ] ;
123
+            }
121 124
             $this->defaults [ $key ] = $def ;
122 125
         }
123 126
         return $this->defaults ;
@@ -144,11 +147,13 @@  discard block
 block discarded – undo
144 147
             foreach ( $this->subPanelParentModule->field_defs as $key => $fieldDefinition )
145 148
             {
146 149
                 $fieldName = strtolower ( $key ) ;
147
-                if (! isset ( $lowerFieldList [ $fieldName ] )) // bug 16728 - check this first, so that other conditions (e.g., studio == visible) can't override and add duplicate entries
150
+                if (! isset ( $lowerFieldList [ $fieldName ] )) {
151
+                    // bug 16728 - check this first, so that other conditions (e.g., studio == visible) can't override and add duplicate entries
148 152
                 {
149 153
                     if ((empty ( $fieldDefinition [ 'source' ] ) || $fieldDefinition [ 'source' ] == 'db' || $fieldDefinition [ 'source' ] == 'custom_fields') && $fieldDefinition [ 'type' ] != 'id' && strcmp ( $fieldName, 'deleted' ) != 0 || (isset ( $def [ 'name' ] ) && strpos ( $def [ 'name' ], "_name" ) != false) || ! empty ( $def [ 'custom_type' ] ) && (empty ( $fieldDefinition [ 'dbType' ] ) || $fieldDefinition [ 'dbType' ] != 'id') && (empty ( $fieldDefinition [ 'dbtype' ] ) || $fieldDefinition [ 'dbtype' ] != 'id') || (! empty ( $fieldDefinition [ 'studio' ] ) && $fieldDefinition [ 'studio' ] == 'visible'))
150 154
                     {
151 155
                         $label = (isset ( $fieldDefinition [ 'vname' ] )) ? $fieldDefinition [ 'vname' ] : (isset ( $fieldDefinition [ 'label' ] ) ? $fieldDefinition [ 'label' ] : $fieldDefinition [ 'name' ]) ;
156
+                }
152 157
                         $this->availableFields [ $fieldName ] = array ( 'width' => '10' , 'label' => $label ) ;
153 158
                     }
154 159
                 }
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/parser.modifylayoutview.php 1 patch
Braces   +14 added lines, -20 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)
3
-die('Not A Valid Entry Point');
2
+if (! defined('sugarEntry') || ! sugarEntry) {
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.
@@ -80,12 +81,10 @@  discard block
 block discarded – undo
80 81
         {
81 82
             $this->_sourceFile = $this->_workingFile;
82 83
             $this->usingWorkingFile = true;
83
-        }
84
-        else if (is_file($this->_customFile))
84
+        } else if (is_file($this->_customFile))
85 85
         {
86 86
             $this->_sourceFile = $this->_customFile;
87
-        }
88
-        else if (! is_file($this->_sourceFile))
87
+        } else if (! is_file($this->_sourceFile))
89 88
         {
90 89
             // if we don't have ANY defined metadata then improvise as best we can
91 90
             if (strtolower($this->_view) == 'quickcreate')
@@ -97,8 +96,7 @@  discard block
 block discarded – undo
97 96
                     $this->_sourceFile = "custom/" . $this->_sourceFile;
98 97
                 }
99 98
                 $this->_sourceView = 'EditView';
100
-            }
101
-            else
99
+            } else
102 100
             {
103 101
                 $this->_fatalError('parser.modifylayout.php->init(): no metadata for '.$this->_module.' '.$this->_view);
104 102
             }
@@ -171,8 +169,7 @@  discard block
 block discarded – undo
171 169
         {
172 170
         	TemplateHandler::clearCache($this->_module,"form_SubPanelQuickCreate_{$this->_module}.tpl");
173 171
         	TemplateHandler::clearCache($this->_module,"form_DCQuickCreate_{$this->_module}.tpl");
174
-        } 
175
-        else 
172
+        } else 
176 173
         {
177 174
         	TemplateHandler::clearCache($this->_module,"{$this->_view}.tpl");
178 175
         }
@@ -236,8 +233,7 @@  discard block
 block discarded – undo
236 233
                 if ($slotComponents ['3'] == 'name' && isset($origFieldDefs [$value]) && is_array($origFieldDefs [$value]))
237 234
                 {
238 235
                     $this->_viewdefs ['panels'] [$panelID] [$rowID] [$colID] = $origFieldDefs [$value];
239
-                }
240
-                else
236
+                } else
241 237
                 {
242 238
                     $property = $slotComponents ['3'];
243 239
                     if ($value == '(filler)')
@@ -341,8 +337,7 @@  discard block
 block discarded – undo
341 337
                     foreach ($row as $col_id => $col) {
342 338
                         if ($col['name'] == '(filler)') {
343 339
                             $this->_viewdefs['panels'][$loop_panelID][$row_id][$col_id] = NULL;
344
-                        }
345
-                        elseif ($col['name'] == '(empty)') {
340
+                        } elseif ($col['name'] == '(empty)') {
346 341
                             unset($this->_viewdefs['panels'][$loop_panelID][$row_id][$col_id]);
347 342
                         }
348 343
                     }
@@ -401,8 +396,7 @@  discard block
 block discarded – undo
401 396
             {
402 397
                 $label = isset($def['vname']) ? $def['vname'] : $def['name'];
403 398
                 $modelFields [$field] = array('name' => $field, 'label' => $label);
404
-            }
405
-            else
399
+            } else
406 400
             {
407 401
                 $GLOBALS['log']->debug( get_class($this)."->_getModelFields(): skipping $field from modelFields as it fails the test for inclusion");
408 402
             }
@@ -414,8 +408,9 @@  discard block
 block discarded – undo
414 408
     function _parseData ($panels)
415 409
     {
416 410
         $fields = array();
417
-        if (empty($panels))
418
-        return;
411
+        if (empty($panels)) {
412
+                return;
413
+        }
419 414
 
420 415
         // Fix for a flexibility in the format of the panel sections - if only one panel, then we don't have a panel level defined, it goes straight into rows
421 416
         // See EditView2 for similar treatment
@@ -506,8 +501,7 @@  discard block
 block discarded – undo
506 501
                         if (is_array($fieldDef))
507 502
                         {
508 503
                             $fieldName = $fieldDef ['name'];
509
-                        }
510
-                        else
504
+                        } else
511 505
                         {
512 506
                             $fieldName = $fieldDef;
513 507
                         }
Please login to merge, or discard this patch.
modules/Reminders_Invitees/Reminder_Invitee.php 1 patch
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -76,7 +76,9 @@  discard block
 block discarded – undo
76 76
     public static function saveRemindersInviteesData($reminderId, $inviteesData) {
77 77
         $savedInviteeIds = array();
78 78
         foreach($inviteesData as $k => $inviteeData) {
79
-            if(isset($_POST['isDuplicate']) && $_POST['isDuplicate']) $inviteeData->id = '';
79
+            if(isset($_POST['isDuplicate']) && $_POST['isDuplicate']) {
80
+                $inviteeData->id = '';
81
+            }
80 82
             $reminderInviteeBean = BeanFactory::getBean('Reminders_Invitees', $inviteeData->id);
81 83
             $reminderInviteeBean->reminder_id = $reminderId;
82 84
             $reminderInviteeBean->related_invitee_module = $inviteeData->module;
@@ -84,8 +86,7 @@  discard block
 block discarded – undo
84 86
             if(!$inviteeData->id) {
85 87
                 $reminderInviteeBean->save();
86 88
                 $savedInviteeIds[] = $reminderInviteeBean->id;
87
-            }
88
-            else {
89
+            } else {
89 90
                 $addedInvitees = BeanFactory::getBean('Reminders_Invitees')->get_full_list("", "reminders_invitees.id != '{$inviteeData->id}' AND reminders_invitees.reminder_id = '{$reminderInviteeBean->reminder_id}' AND reminders_invitees.related_invitee_module = '{$reminderInviteeBean->related_invitee_module}' AND reminders_invitees.related_invitee_module_id = '{$reminderInviteeBean->related_invitee_module_id}'");
90 91
                 if (!$addedInvitees) {
91 92
                     $reminderInviteeBean->save();
@@ -132,11 +133,9 @@  discard block
 block discarded – undo
132 133
             default:
133 134
                 if(isset($bean->first_name) && isset($bean->last_name)) {
134 135
                     $retValue = "{$bean->first_name} {$bean->last_name}";
135
-                }
136
-                else if(isset($bean->name)) {
136
+                } else if(isset($bean->name)) {
137 137
                     $retValue = $bean->name;
138
-                }
139
-                else if(isset($bean->email)) {
138
+                } else if(isset($bean->email)) {
140 139
                     $retValue = $bean->email;
141 140
                 }
142 141
                 if(!$retValue) {
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.