Completed
Push — console-installer ( 3d54e5...e2b50d )
by Adam
69:10 queued 48:24
created
modules/ModuleBuilder/parsers/relationships/UndeployedRelationships.php 1 patch
Braces   +10 added lines, -9 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.
@@ -270,8 +271,7 @@  discard block
 block discarded – undo
270 271
             $module->setAppListStrings ( 'en_us', $appStrings ) ;
271 272
             $module->save () ;
272 273
 
273
-        }
274
-        else
274
+        } else
275 275
         {
276 276
             //Bug42170================================
277 277
             $appStrings = $module->getAppListStrings () ;
@@ -333,8 +333,9 @@  discard block
 block discarded – undo
333 333
             $appStrings = $module->getAppListStrings () ;
334 334
             foreach(getTypeDisplayList() as $key)
335 335
             {
336
-                if (isset($appStrings[$key][ $module->key_name ]))
337
-                    unset($appStrings[$key][ $module->key_name ]);
336
+                if (isset($appStrings[$key][ $module->key_name ])) {
337
+                                    unset($appStrings[$key][ $module->key_name ]);
338
+                }
338 339
             }
339 340
             $module->setAppListStrings ( 'en_us', $appStrings ) ;
340 341
             $module->save () ;
@@ -351,8 +352,9 @@  discard block
 block discarded – undo
351 352
     {
352 353
         
353 354
         // many-to-many relationships don't have fields so if we have a many-to-many we can just skip this...
354
-        if ($relationship->getType () == MB_MANYTOMANY)
355
-            return false ;
355
+        if ($relationship->getType () == MB_MANYTOMANY) {
356
+                    return false ;
357
+        }
356 358
         
357 359
         $successful = true ;
358 360
         $layoutAdditions = $relationship->buildFieldsToLayouts () ;
@@ -371,8 +373,7 @@  discard block
 block discarded – undo
371 373
                     if (($actionAdd) ? $parser->addField ( array ( 'name' => $fieldName ) ) : $parser->removeField ( $fieldName ))
372 374
                     {
373 375
                         $parser->handleSave ( false ) ;
374
-                    } 
375
-                    else
376
+                    } else
376 377
                     {
377 378
                         $GLOBALS [ 'log' ]->debug ( get_class ( $this ) . ": couldn't " . (($actionAdd) ? "add" : "remove") . " $fieldName on $view layout for undeployed module $deployedModuleName" ) ;
378 379
                         $successful = false ;
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php 1 patch
Braces   +11 added lines, -7 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.
@@ -243,8 +244,9 @@  discard block
 block discarded – undo
243 244
         
244 245
         foreach ( $module->field_defs as $field )
245 246
         {
246
-            if ($field [ 'type' ] == 'relate' && isset ( $field [ 'module' ] ) && $field [ 'module' ] == $sourceModuleName)
247
-                return $field [ 'name' ] ;
247
+            if ($field [ 'type' ] == 'relate' && isset ( $field [ 'module' ] ) && $field [ 'module' ] == $sourceModuleName) {
248
+                            return $field [ 'name' ] ;
249
+            }
248 250
         }
249 251
         return null ;
250 252
     }
@@ -389,10 +391,11 @@  discard block
 block discarded – undo
389 391
         
390 392
         foreach ( $layoutAdditions as $deployedModuleName => $fieldName )
391 393
         {
392
-            if (! in_array ( strtolower ( $deployedModuleName ), $invalidModules ))
393
-                foreach ( array ( MB_EDITVIEW , MB_DETAILVIEW ) as $view )
394
+            if (! in_array ( strtolower ( $deployedModuleName ), $invalidModules )) {
395
+                            foreach ( array ( MB_EDITVIEW , MB_DETAILVIEW ) as $view )
394 396
                 {
395 397
                     $GLOBALS [ 'log' ]->info ( get_class ( $this ) . ": adding $fieldName to $view layout for module $deployedModuleName" ) ;
398
+            }
396 399
                     $parser = new GridLayoutMetaDataParser ( $view, $deployedModuleName ) ;
397 400
                     $parser->addField ( array ( 'name' => $fieldName ) ) ;
398 401
                     $parser->handleSave ( false ) ;
@@ -411,8 +414,9 @@  discard block
 block discarded – undo
411 414
     {
412 415
         
413 416
         // many-to-many relationships don't have fields so if we have a many-to-many we can just skip this...
414
-        if ($relationship->getType () == MB_MANYTOMANY)
415
-            return false ;
417
+        if ($relationship->getType () == MB_MANYTOMANY) {
418
+                    return false ;
419
+        }
416 420
         
417 421
         $successful = true ;
418 422
         $layoutAdditions = $relationship->buildFieldsToLayouts () ;
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/relationships/RelationshipFactory.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.
@@ -51,8 +53,9 @@  discard block
 block discarded – undo
51 53
     static function newRelationship ($definition = array())
52 54
     {
53 55
         // handle the case where a relationship_type is not provided - set it to Many-To-Many as this was the usual type in ModuleBuilder
54
-        if (! isset ( $definition [ 'relationship_type' ] ))
55
-            $definition [ 'relationship_type' ] = MB_MANYTOMANY ;
56
+        if (! isset ( $definition [ 'relationship_type' ] )) {
57
+                    $definition [ 'relationship_type' ] = MB_MANYTOMANY ;
58
+        }
56 59
             
57 60
     	if (!empty ($definition['for_activities']) && $definition['for_activities'] == true) {
58 61
         	require_once 'modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php';
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/relationships/OneToManyRelationship.php 1 patch
Braces   +9 added lines, -5 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.
@@ -93,8 +95,9 @@  discard block
 block discarded – undo
93 95
      */
94 96
     function buildSubpanelDefinitions ()
95 97
     {        
96
-        if ($this->relationship_only)
97
-            return array () ;
98
+        if ($this->relationship_only) {
99
+                    return array () ;
100
+        }
98 101
         
99 102
         $source = "";
100 103
         if ($this->rhs_module == $this->lhs_module)
@@ -142,8 +145,9 @@  discard block
 block discarded – undo
142 145
      */
143 146
     function buildFieldsToLayouts ()
144 147
     {
145
-        if ($this->relationship_only)
146
-            return array () ;
148
+        if ($this->relationship_only) {
149
+                    return array () ;
150
+        }
147 151
  
148 152
         return array( $this->rhs_module =>$this->getValidDBName($this->relationship_name . "_name")); // this must match the name of the relate field from buildVardefs
149 153
     }
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/relationships/ManyToOneRelationship.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.
@@ -113,8 +115,9 @@  discard block
 block discarded – undo
113 115
      */
114 116
     function buildFieldsToLayouts ()
115 117
     {
116
-        if ($this->relationship_only)
117
-            return array () ;
118
+        if ($this->relationship_only) {
119
+                    return array () ;
120
+        }
118 121
  
119 122
         return array( $this->lhs_module => $this->getValidDBName($this->relationship_name . "_name") ) ; // this must match the name of the relate field from buildVardefs
120 123
     }
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/relationships/ActivitiesRelationship.php 1 patch
Braces   +9 added lines, -5 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.
@@ -173,16 +175,18 @@  discard block
 block discarded – undo
173 175
      */
174 176
     function buildFieldsToLayouts ()
175 177
     {
176
-        if ($this->relationship_only)
177
-            return array () ;
178
+        if ($this->relationship_only) {
179
+                    return array () ;
180
+        }
178 181
 
179 182
         return array( $this->rhs_module => $this->relationship_name . "_name" ) ; // this must match the name of the relate field from buildVardefs
180 183
     }
181 184
 
182 185
  	function buildSubpanelDefinitions ()
183 186
     {
184
-        if ($this->relationship_only || isset(ActivitiesRelationship::$subpanelsAdded[$this->lhs_module]))
185
-            return array () ;
187
+        if ($this->relationship_only || isset(ActivitiesRelationship::$subpanelsAdded[$this->lhs_module])) {
188
+                    return array () ;
189
+        }
186 190
 
187 191
         ActivitiesRelationship::$subpanelsAdded[$this->lhs_module] = true;
188 192
         $relationshipName = substr($this->relationship_name, 0, strrpos($this->relationship_name, '_'));
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/parser.dropdown.php 1 patch
Braces   +16 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,10 +76,11 @@  discard block
 block discarded – undo
74 76
 		if(array_key_exists($emptyMarker, $dropdown)){
75 77
             $output=array();
76 78
             foreach($dropdown as $key => $value){
77
-                if($emptyMarker===$key)
78
-                    $output['']='';
79
-                else
80
-                    $output[$key]=$value;
79
+                if($emptyMarker===$key) {
80
+                                    $output['']='';
81
+                } else {
82
+                                    $output[$key]=$value;
83
+                }
81 84
 		}
82 85
             $dropdown=$output;
83 86
 		}
@@ -89,7 +92,7 @@  discard block
 block discarded – undo
89 92
 			//Can't use synch on selected lang as we want to overwrite values, not just keys
90 93
 			$module->mblanguage->appListStrings[$selected_lang.'.lang.php'][$dropdown_name] = $dropdown;
91 94
 			$module->mblanguage->save($module->key_name); // tyoung - key is required parameter as of
92
-		}else{
95
+		} else{
93 96
 			$contents = return_custom_app_list_strings_file_contents($selected_lang);
94 97
 			$my_list_strings = return_app_list_strings_language($selected_lang);
95 98
 			if($selected_lang == $GLOBALS['current_language']){
@@ -97,7 +100,9 @@  discard block
 block discarded – undo
97 100
 	        }
98 101
 			//write to contents
99 102
 			$contents = str_replace("?>", '', $contents);
100
-			if(empty($contents))$contents = "<?php";
103
+			if(empty($contents)) {
104
+			    $contents = "<?php";
105
+			}
101 106
 	        //add new drop down to the bottom
102 107
 	        if(!empty($params['use_push'])){
103 108
 	        	//this is for handling moduleList and such where nothing should be deleted or anything but they can be renamed
@@ -111,7 +116,7 @@  discard block
 block discarded – undo
111 116
 		        		$contents .= "\n\$GLOBALS['app_list_strings']['$dropdown_name']['$key']=" . var_export_helper($value) . ";";
112 117
 	        		}
113 118
 	        	}
114
-	        }else{
119
+	        } else{
115 120
 	        	//Now synch up the keys in other langauges to ensure that removed/added Drop down values work properly under all langs.
116 121
 	        	$this->synchDropDown($dropdown_name, $dropdown, $selected_lang, $dir);
117 122
 	        	$contents = $this->getNewCustomContents($dropdown_name, $dropdown, $selected_lang);
@@ -207,7 +212,9 @@  discard block
 block discarded – undo
207 212
     function getNewCustomContents($dropdown_name, $dropdown, $lang) {
208 213
     	$contents = return_custom_app_list_strings_file_contents($lang);
209 214
         $contents = str_replace("?>", '', $contents);
210
-		if(empty($contents))$contents = "<?php";
215
+		if(empty($contents)) {
216
+		    $contents = "<?php";
217
+		}
211 218
     	$contents = preg_replace($this->getPatternMatch($dropdown_name), "\n", $contents);
212 219
 	    $contents .= "\n\$GLOBALS['app_list_strings']['$dropdown_name']=" . var_export_helper($dropdown) . ";";
213 220
 	    return $contents;
Please login to merge, or discard this patch.
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.