Completed
Push — develop ( 7c1bda...edae1e )
by Adam
18:38 queued 03:14
created
modules/ModuleBuilder/parsers/parser.modifysubpanel.php 1 patch
Spacing   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  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
  * SugarCRM Community Edition is a customer relationship management program developed by
6 6
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -50,141 +50,141 @@  discard block
 block discarded – undo
50 50
  * There are two relevant modules for every subpanel - the module whose detailview this subpanel will appear in ($module_name), and the module that is the source of the data for the subpanel ($subPanelParentModule)
51 51
  */
52 52
 
53
-require_once ('modules/ModuleBuilder/parsers/parser.modifylistview.php') ;
53
+require_once ('modules/ModuleBuilder/parsers/parser.modifylistview.php');
54 54
 
55 55
 class ParserModifySubPanel extends ParserModifyListView
56 56
 {
57 57
     
58
-    var $listViewDefs = false ;
59
-    var $defaults = array ( ) ;
60
-    var $additional = array ( ) ;
61
-    var $available = array ( ) ;
62
-    var $columns = array ( 'LBL_DEFAULT' => 'getDefaultFields' , 'LBL_HIDDEN' => 'getAvailableFields' ) ;
58
+    var $listViewDefs = false;
59
+    var $defaults = array( );
60
+    var $additional = array( );
61
+    var $available = array( );
62
+    var $columns = array('LBL_DEFAULT' => 'getDefaultFields', 'LBL_HIDDEN' => 'getAvailableFields');
63 63
     
64
-    function init ($module_name , $subPanelName)
64
+    function init($module_name, $subPanelName)
65 65
     {
66
-        $GLOBALS [ 'log' ]->debug ( "in ParserModifySubPanel: module_name={$module_name} child_module={$subPanelName}" ) ;
67
-        $this->moduleName = $module_name ;
68
-        $this->subPanelName = $subPanelName ;
69
-        global $beanList, $beanFiles ;
66
+        $GLOBALS ['log']->debug("in ParserModifySubPanel: module_name={$module_name} child_module={$subPanelName}");
67
+        $this->moduleName = $module_name;
68
+        $this->subPanelName = $subPanelName;
69
+        global $beanList, $beanFiles;
70 70
         
71 71
         // Sometimes we receive a module name which is not in the correct CamelCase, so shift to lower case for all beanList lookups
72
-        $beanListLower = array_change_key_case ( $beanList ) ;
72
+        $beanListLower = array_change_key_case($beanList);
73 73
         
74 74
         // Retrieve the definitions for all the available subpanels for this module
75
-        $class = $beanListLower [ strtolower ( $this->moduleName ) ] ;
76
-        require_once ($beanFiles [ $class ]) ;
77
-        $module = new $class ( ) ;
78
-        require_once ('include/SubPanel/SubPanelDefinitions.php') ;
79
-        $spd = new SubPanelDefinitions ( $module ) ;
75
+        $class = $beanListLower [strtolower($this->moduleName)];
76
+        require_once ($beanFiles [$class]);
77
+        $module = new $class( );
78
+        require_once ('include/SubPanel/SubPanelDefinitions.php');
79
+        $spd = new SubPanelDefinitions($module);
80 80
         
81 81
         // Get the lists of fields already in the subpanel and those that can be added in
82 82
         // Get the fields lists from an aSubPanel object describing this subpanel from the SubPanelDefinitions object
83
-        $this->originalListViewDefs = array ( ) ;
84
-        if (array_key_exists ( strtolower ( $this->subPanelName ), $spd->layout_defs [ 'subpanel_setup' ] ))
83
+        $this->originalListViewDefs = array( );
84
+        if (array_key_exists(strtolower($this->subPanelName), $spd->layout_defs ['subpanel_setup']))
85 85
         {
86
-            $originalPanel = $spd->load_subpanel ( $this->subPanelName, true ) ;
87
-            $this->originalListViewDefs = $originalPanel->get_list_fields () ;
88
-            $this->panel = $spd->load_subpanel ( $subPanelName, false ) ;
89
-            $this->listViewDefs = $this->panel->get_list_fields () ;
86
+            $originalPanel = $spd->load_subpanel($this->subPanelName, true);
87
+            $this->originalListViewDefs = $originalPanel->get_list_fields();
88
+            $this->panel = $spd->load_subpanel($subPanelName, false);
89
+            $this->listViewDefs = $this->panel->get_list_fields();
90 90
             
91 91
             // Retrieve a copy of the bean for the parent module of this subpanel - so we can find additional fields for the layout
92
-            $subPanelParentModuleName = $this->panel->get_module_name () ;
93
-            $this->subPanelParentModule = null ;
92
+            $subPanelParentModuleName = $this->panel->get_module_name();
93
+            $this->subPanelParentModule = null;
94 94
 
95
-            if (! empty ( $subPanelParentModuleName ) && isset($beanListLower[strtolower($subPanelParentModuleName)]))
95
+            if (!empty ($subPanelParentModuleName) && isset($beanListLower[strtolower($subPanelParentModuleName)]))
96 96
             {
97 97
                 $class = $beanListLower[strtolower($subPanelParentModuleName)];
98
-                if (isset($beanFiles [ $class ]))
98
+                if (isset($beanFiles [$class]))
99 99
                 {
100
-                    require_once ($beanFiles [ $class ]) ;
101
-                    $this->subPanelParentModule = new $class ( ) ;
100
+                    require_once ($beanFiles [$class]);
101
+                    $this->subPanelParentModule = new $class( );
102 102
                 }
103 103
             }
104 104
         }
105 105
         
106
-        $this->language_module = $this->panel->template_instance->module_dir ;
106
+        $this->language_module = $this->panel->template_instance->module_dir;
107 107
     }
108 108
     
109 109
     /**
110 110
      * Return a list of the fields that will be displayed in the subpanel
111 111
      */
112
-    function getDefaultFields ()
112
+    function getDefaultFields()
113 113
     {
114
-        $this->defaults = array ( ) ;
115
-        foreach ( $this->listViewDefs as $key => $def )
114
+        $this->defaults = array( );
115
+        foreach ($this->listViewDefs as $key => $def)
116 116
         {
117
-            if (! empty ( $def [ 'usage' ] ) && strcmp ( $def [ 'usage' ], 'query_only' ) == 0)
118
-                continue ;
119
-            if (! empty ( $def [ 'vname' ] ))
120
-                $def [ 'label' ] = $def [ 'vname' ] ;
121
-            $this->defaults [ $key ] = $def ;
117
+            if (!empty ($def ['usage']) && strcmp($def ['usage'], 'query_only') == 0)
118
+                continue;
119
+            if (!empty ($def ['vname']))
120
+                $def ['label'] = $def ['vname'];
121
+            $this->defaults [$key] = $def;
122 122
         }
123
-        return $this->defaults ;
123
+        return $this->defaults;
124 124
     }
125 125
     
126 126
     /**
127 127
      * Return a list of fields that are not currently included in the subpanel but that are available for use
128 128
      */
129
-    function getAvailableFields ()
129
+    function getAvailableFields()
130 130
     {
131
-        $this->availableFields = array ( ) ;
131
+        $this->availableFields = array( );
132 132
         if ($this->subPanelParentModule != null)
133 133
         {
134
-            $lowerFieldList = array_change_key_case ( $this->listViewDefs ) ;
135
-            foreach ( $this->originalListViewDefs as $key => $def )
134
+            $lowerFieldList = array_change_key_case($this->listViewDefs);
135
+            foreach ($this->originalListViewDefs as $key => $def)
136 136
             {
137
-                $key = strtolower ( $key ) ;
138
-                if (! isset ( $lowerFieldList [ $key ] ))
137
+                $key = strtolower($key);
138
+                if (!isset ($lowerFieldList [$key]))
139 139
                 {
140
-                    $this->availableFields [ $key ] = $def ;
140
+                    $this->availableFields [$key] = $def;
141 141
                 }
142 142
             }
143
-            $GLOBALS [ 'log' ]->debug ( 'parser.modifylistview.php->getAvailableFields(): field_defs=' . print_r ( $this->availableFields, true ) ) ;
144
-            foreach ( $this->subPanelParentModule->field_defs as $key => $fieldDefinition )
143
+            $GLOBALS ['log']->debug('parser.modifylistview.php->getAvailableFields(): field_defs='.print_r($this->availableFields, true));
144
+            foreach ($this->subPanelParentModule->field_defs as $key => $fieldDefinition)
145 145
             {
146
-                $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
146
+                $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
148 148
                 {
149
-                    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'))
149
+                    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 150
                     {
151
-                        $label = (isset ( $fieldDefinition [ 'vname' ] )) ? $fieldDefinition [ 'vname' ] : (isset ( $fieldDefinition [ 'label' ] ) ? $fieldDefinition [ 'label' ] : $fieldDefinition [ 'name' ]) ;
152
-                        $this->availableFields [ $fieldName ] = array ( 'width' => '10' , 'label' => $label ) ;
151
+                        $label = (isset ($fieldDefinition ['vname'])) ? $fieldDefinition ['vname'] : (isset ($fieldDefinition ['label']) ? $fieldDefinition ['label'] : $fieldDefinition ['name']);
152
+                        $this->availableFields [$fieldName] = array('width' => '10', 'label' => $label);
153 153
                     }
154 154
                 }
155 155
             }
156 156
         }
157 157
         
158
-        return $this->availableFields ;
158
+        return $this->availableFields;
159 159
     }
160 160
     
161
-    function getField ($fieldName)
161
+    function getField($fieldName)
162 162
     {
163
-        foreach ( $this->listViewDefs as $key => $def )
163
+        foreach ($this->listViewDefs as $key => $def)
164 164
         {
165
-            $key = strtolower ( $key ) ;
165
+            $key = strtolower($key);
166 166
             if ($key == $fieldName)
167 167
             {
168
-                return $def ;
168
+                return $def;
169 169
             }
170 170
         }
171
-        foreach ( $this->originalListViewDefs as $key => $def )
171
+        foreach ($this->originalListViewDefs as $key => $def)
172 172
         {
173
-            $key = strtolower ( $key ) ;
173
+            $key = strtolower($key);
174 174
             if ($key == $fieldName)
175 175
             {
176
-                return $def ;
176
+                return $def;
177 177
             }
178 178
         }
179
-        foreach ( $this->panel->template_instance->field_defs as $key => $def )
179
+        foreach ($this->panel->template_instance->field_defs as $key => $def)
180 180
         {
181
-            $key = strtolower ( $key ) ;
181
+            $key = strtolower($key);
182 182
             if ($key == $fieldName)
183 183
             {
184
-                return $def ;
184
+                return $def;
185 185
             }
186 186
         }
187
-        return array ( ) ;
187
+        return array( );
188 188
     }
189 189
     
190 190
     /*
@@ -192,67 +192,67 @@  discard block
 block discarded – undo
192 192
      * Obtains the field definitions from a _REQUEST array, and merges them with the other fields from the original definitions
193 193
      * Uses the subpanel override mechanism from SubPanel to save them 
194 194
      */
195
-    function handleSave ()
195
+    function handleSave()
196 196
     {
197
-        $GLOBALS [ 'log' ]->debug ( "in ParserModifySubPanel->handleSave()" ) ;
198
-        require_once ('include/SubPanel/SubPanel.php') ;
199
-        $subpanel = new SubPanel ( $this->moduleName, 'fab4', $this->subPanelName, $this->panel ) ;
197
+        $GLOBALS ['log']->debug("in ParserModifySubPanel->handleSave()");
198
+        require_once ('include/SubPanel/SubPanel.php');
199
+        $subpanel = new SubPanel($this->moduleName, 'fab4', $this->subPanelName, $this->panel);
200 200
         
201
-        $newFields = array ( ) ;
202
-        foreach ( $this->listViewDefs as $name => $field )
201
+        $newFields = array( );
202
+        foreach ($this->listViewDefs as $name => $field)
203 203
         {
204
-            if (! isset ( $field [ 'usage' ] ) || $field [ 'usage' ] != 'query_only')
204
+            if (!isset ($field ['usage']) || $field ['usage'] != 'query_only')
205 205
             {
206
-                $existingFields [ $name ] = $field ;
206
+                $existingFields [$name] = $field;
207 207
             
208 208
             } else
209 209
             {
210
-                $newFields [ $name ] = $field ;
210
+                $newFields [$name] = $field;
211 211
             }
212 212
         }
213 213
         
214 214
         // Loop through all of the fields defined in the 'Default' group of the ListView data in $_REQUEST
215 215
         // Replace the field specification in the originalListViewDef with this new updated specification
216
-        foreach ( $_REQUEST [ 'group_0' ] as $field )
216
+        foreach ($_REQUEST ['group_0'] as $field)
217 217
         {
218
-            if (! empty ( $this->originalListViewDefs [ $field ] ))
218
+            if (!empty ($this->originalListViewDefs [$field]))
219 219
             {
220
-                $newFields [ $field ] = $this->originalListViewDefs [ $field ] ;
220
+                $newFields [$field] = $this->originalListViewDefs [$field];
221 221
             } else
222 222
             {
223 223
                 
224
-                $vname = '' ;
225
-                if (isset ( $this->panel->template_instance->field_defs [ $field ] ))
224
+                $vname = '';
225
+                if (isset ($this->panel->template_instance->field_defs [$field]))
226 226
                 {
227
-                    $vname = $this->panel->template_instance->field_defs [ $field ] [ 'vname' ] ;
227
+                    $vname = $this->panel->template_instance->field_defs [$field] ['vname'];
228 228
                 }
229
-                if (($this->subPanelParentModule != null) && (isset ( $this->subPanelParentModule->field_name_map [ $field ] ) && ($this->subPanelParentModule->field_name_map [ $field ] [ 'type' ] == 'bool' || (isset ( $this->subPanelParentModule->field_name_map [ $field ] [ 'custom_type' ] ) && $this->subPanelParentModule->field_name_map [ $field ] [ 'custom_type' ] == 'bool'))))
229
+                if (($this->subPanelParentModule != null) && (isset ($this->subPanelParentModule->field_name_map [$field]) && ($this->subPanelParentModule->field_name_map [$field] ['type'] == 'bool' || (isset ($this->subPanelParentModule->field_name_map [$field] ['custom_type']) && $this->subPanelParentModule->field_name_map [$field] ['custom_type'] == 'bool'))))
230 230
                 {
231
-                    $newFields [ $field ] = array ( 'name' => $field , 'vname' => $vname , 'widget_type' => 'checkbox' ) ;
231
+                    $newFields [$field] = array('name' => $field, 'vname' => $vname, 'widget_type' => 'checkbox');
232 232
                 } else
233 233
                 {
234
-                    $newFields [ $field ] = array ( 'name' => $field , 'vname' => $vname ) ;
234
+                    $newFields [$field] = array('name' => $field, 'vname' => $vname);
235 235
                 }
236 236
             }
237 237
             
238 238
             // Now set the field width if specified in the $_REQUEST data
239
-            if (isset ( $_REQUEST [ strtolower ( $field ) . 'width' ] ))
239
+            if (isset ($_REQUEST [strtolower($field).'width']))
240 240
             {
241
-                $width = substr ( $_REQUEST [ strtolower ( $field ) . 'width' ], 6, 3 ) ;
242
-                if (strpos ( $width, "%" ) != false)
241
+                $width = substr($_REQUEST [strtolower($field).'width'], 6, 3);
242
+                if (strpos($width, "%") != false)
243 243
                 {
244
-                    $width = substr ( $width, 0, 2 ) ;
244
+                    $width = substr($width, 0, 2);
245 245
                 }
246 246
                 if ($width < 101 && $width > 0)
247 247
                 {
248
-                    $newFields [ $field ] [ 'width' ] = $width ;
248
+                    $newFields [$field] ['width'] = $width;
249 249
                 }
250
-            } else if (isset ( $this->listViewDefs [ $field ] [ 'width' ] ))
250
+            } else if (isset ($this->listViewDefs [$field] ['width']))
251 251
             {
252
-                $newFields [ $field ] [ 'width' ] = $this->listViewDefs [ $field ] [ 'width' ] ;
252
+                $newFields [$field] ['width'] = $this->listViewDefs [$field] ['width'];
253 253
             }
254 254
         }
255
-        $subpanel->saveSubPanelDefOverride ( $this->panel, 'list_fields', $newFields ) ;
255
+        $subpanel->saveSubPanelDefOverride($this->panel, 'list_fields', $newFields);
256 256
     
257 257
     }
258 258
 
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/parser.modifylayoutview.php 1 patch
Spacing   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
  * SugarCRM Community Edition is a customer relationship management program developed by
@@ -62,19 +62,19 @@  discard block
 block discarded – undo
62 62
     /**
63 63
      * Constructor
64 64
      */
65
-    function init ($module, $view, $submittedLayout = false)
65
+    function init($module, $view, $submittedLayout = false)
66 66
     {
67 67
         $this->_view = ucfirst($view);
68 68
         $this->_module = $module;
69 69
         $this->language_module = $module;
70 70
 
71 71
         $this->_baseDirectory = "modules/{$module}/metadata/";
72
-        $file =  $this->_baseDirectory . strtolower($view) . "defs.php";
73
-        $this->_customFile = "custom/" . $file;
74
-        $this->_workingFile = "custom/working/" . $file;
72
+        $file = $this->_baseDirectory.strtolower($view)."defs.php";
73
+        $this->_customFile = "custom/".$file;
74
+        $this->_workingFile = "custom/working/".$file;
75 75
 
76 76
         $this->_sourceView = $this->_view;
77
-        $this->_originalFile = $file ;
77
+        $this->_originalFile = $file;
78 78
         $this->_sourceFile = $file;
79 79
         if (is_file($this->_workingFile))
80 80
         {
@@ -85,16 +85,16 @@  discard block
 block discarded – undo
85 85
         {
86 86
             $this->_sourceFile = $this->_customFile;
87 87
         }
88
-        else if (! is_file($this->_sourceFile))
88
+        else if (!is_file($this->_sourceFile))
89 89
         {
90 90
             // if we don't have ANY defined metadata then improvise as best we can
91 91
             if (strtolower($this->_view) == 'quickcreate')
92 92
             {
93 93
                 // special handling for quickcreates - base the quickcreate on the editview if no quickcreatedef exists
94 94
                 $this->_sourceFile = $this->_baseDirectory."editviewdefs.php";
95
-                if (is_file("custom/" . $this->_sourceFile))
95
+                if (is_file("custom/".$this->_sourceFile))
96 96
                 {
97
-                    $this->_sourceFile = "custom/" . $this->_sourceFile;
97
+                    $this->_sourceFile = "custom/".$this->_sourceFile;
98 98
                 }
99 99
                 $this->_sourceView = 'EditView';
100 100
             }
@@ -126,13 +126,13 @@  discard block
 block discarded – undo
126 126
 
127 127
     }
128 128
 
129
-    function getAvailableFields ()
129
+    function getAvailableFields()
130 130
     {
131 131
         // Available fields are those that are in the Model and the original layout definition, but not already shown in the View
132 132
         // So, because the formats of the two are different we brute force loop through View and unset the fields we find in a copy of Model
133 133
         $availableFields = $this->_getModelFields();
134
-        $GLOBALS['log']->debug( get_class($this)."->getAvailableFields(): _getModelFields returns: ".implode(",",array_keys($availableFields)));
135
-        if (! empty($this->_viewdefs))
134
+        $GLOBALS['log']->debug(get_class($this)."->getAvailableFields(): _getModelFields returns: ".implode(",", array_keys($availableFields)));
135
+        if (!empty($this->_viewdefs))
136 136
         {
137 137
             foreach ($this->_viewdefs ['panels'] as $panel)
138 138
             {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
                         if (isset($fieldArray ['name']))
144 144
                         {
145 145
                             unset($availableFields [$fieldArray ['name']]);
146
-                            $GLOBALS['log']->debug( get_class($this)."->getAvailableFields(): removing ".$fieldArray ['name'] );
146
+                            $GLOBALS['log']->debug(get_class($this)."->getAvailableFields(): removing ".$fieldArray ['name']);
147 147
                         }
148 148
                     }
149 149
                 }
@@ -152,39 +152,39 @@  discard block
 block discarded – undo
152 152
         return $availableFields;
153 153
     }
154 154
 
155
-    function getLayout ()
155
+    function getLayout()
156 156
     {
157 157
         return $this->_viewdefs ['panels'];
158 158
     }
159 159
 
160
-    function writeWorkingFile ()
160
+    function writeWorkingFile()
161 161
     {
162
-        $this->_writeToFile($this->_workingFile,$this->_view,$this->_module,$this->_viewdefs,$this->_variables);
162
+        $this->_writeToFile($this->_workingFile, $this->_view, $this->_module, $this->_viewdefs, $this->_variables);
163 163
     }
164 164
 
165
-    function handleSave ()
165
+    function handleSave()
166 166
     {
167
-        $this->_writeToFile($this->_customFile,$this->_view,$this->_module,$this->_viewdefs,$this->_variables);
167
+        $this->_writeToFile($this->_customFile, $this->_view, $this->_module, $this->_viewdefs, $this->_variables);
168 168
         // now clear the cache so that the results are immediately visible
169 169
         include_once('include/TemplateHandler/TemplateHandler.php');
170 170
         if (strtolower($this->_view) == 'quickcreate')
171 171
         {
172
-        	TemplateHandler::clearCache($this->_module,"form_SubPanelQuickCreate_{$this->_module}.tpl");
173
-        	TemplateHandler::clearCache($this->_module,"form_DCQuickCreate_{$this->_module}.tpl");
172
+        	TemplateHandler::clearCache($this->_module, "form_SubPanelQuickCreate_{$this->_module}.tpl");
173
+        	TemplateHandler::clearCache($this->_module, "form_DCQuickCreate_{$this->_module}.tpl");
174 174
         } 
175 175
         else 
176 176
         {
177
-        	TemplateHandler::clearCache($this->_module,"{$this->_view}.tpl");
177
+        	TemplateHandler::clearCache($this->_module, "{$this->_view}.tpl");
178 178
         }
179 179
 
180 180
     }
181 181
 
182
-    function loadModule ($module, $view)
182
+    function loadModule($module, $view)
183 183
     {
184 184
         $this->_viewdefs = array();
185 185
         $viewdefs = null;
186 186
 
187
-        $loaded = $this->_loadFromFile($view,$this->_sourceFile,$module);
187
+        $loaded = $this->_loadFromFile($view, $this->_sourceFile, $module);
188 188
         $this->_viewdefs = $loaded['viewdefs'][$module][$view];
189 189
         $this->_variables = $loaded['variables'];
190 190
     }
@@ -193,14 +193,14 @@  discard block
 block discarded – undo
193 193
      * Load the canonical panel layout from the submitted form
194 194
      *
195 195
      */
196
-    function _loadLayoutFromRequest ()
196
+    function _loadLayoutFromRequest()
197 197
     {
198 198
 
199 199
         $i = 1;
200 200
         // set up the map of panel# (as provided in the _REQUEST) to panel ID (as used in $this->_viewdefs['panels'])
201 201
         foreach ($this->_viewdefs ['panels'] as $panelID => $panel)
202 202
         {
203
-            $panelMap [$i ++] = $panelID;
203
+            $panelMap [$i++] = $panelID;
204 204
         }
205 205
         // replace any old values with new panel labels from the request
206 206
         foreach ($_REQUEST as $key => $value)
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
 
221 221
         if ($this->maxColumns < 1)
222 222
         {
223
-            $this->_fatalError("EditDetailViewParser:invalid maxColumns=" . $this->maxColumns);
223
+            $this->_fatalError("EditDetailViewParser:invalid maxColumns=".$this->maxColumns);
224 224
         }
225 225
 
226 226
         foreach ($_REQUEST as $slot => $value)
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
                         // if a leading (empty) then remove (by noting that remaining fields need to be shuffled along)
268 268
                         if ($startOfRow)
269 269
                         {
270
-                            $offset ++;
270
+                            $offset++;
271 271
                         }
272 272
                         unset($row [$colID]);
273 273
                     } else
@@ -287,9 +287,9 @@  discard block
 block discarded – undo
287 287
         //          _pp($this->_viewdefs);
288 288
     }
289 289
 
290
-    function _padFields ()
290
+    function _padFields()
291 291
     {
292
-        if (! empty($this->_viewdefs))
292
+        if (!empty($this->_viewdefs))
293 293
         {
294 294
             foreach ($this->_viewdefs ['panels'] as $panelID => $panel)
295 295
             {
@@ -299,7 +299,7 @@  discard block
 block discarded – undo
299 299
                     // pad between fields on a row
300 300
                     foreach ($row as $colID => $col)
301 301
                     {
302
-                        for ($i = $column + 1 ; $i < $colID ; $i ++ )
302
+                        for ($i = $column + 1; $i < $colID; $i++)
303 303
                         {
304 304
                             $row [$i] = array('name' => '(empty)', 'label' => '(empty)');
305 305
                         }
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                     // now pad out to the end of the row
309 309
                     if (($column + 1) < $this->maxColumns)
310 310
                     { // last column is maxColumns-1
311
-                        for ($i = $column + 1 ; $i < $this->maxColumns ; $i ++ )
311
+                        for ($i = $column + 1; $i < $this->maxColumns; $i++)
312 312
                         {
313 313
                             $row [$i] = array('name' => '(empty)', 'label' => '(empty)');
314 314
                         }
@@ -323,7 +323,7 @@  discard block
 block discarded – undo
323 323
 
324 324
     // add a new field to the end of a panel
325 325
     // don't write out (caller should call handleSave() when ready)
326
-    function _addField ($properties, $panelID = FALSE)
326
+    function _addField($properties, $panelID = FALSE)
327 327
     {
328 328
 
329 329
         // if a panelID was not passed, use the first available panel in the list
@@ -357,7 +357,7 @@  discard block
 block discarded – undo
357 357
             //          print "lastrow=$lastrow lastcol=$lastcol";
358 358
             if ($lastcol >= $this->maxColumns)
359 359
             {
360
-                $lastrow ++;
360
+                $lastrow++;
361 361
                 $this->_viewdefs ['panels'] [$panelID] [$lastrow] = array();
362 362
                 $lastcol = 0;
363 363
             }
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
     }
368 368
 
369 369
     /* getModelFields returns an array of all fields stored in the database for this module plus those fields in the original layout definition (so we get fields such as Team ID)*/
370
-    function _getModelFields ()
370
+    function _getModelFields()
371 371
     {
372 372
         $modelFields = array();
373 373
         $origViewDefs = $this->_getOrigFieldViewDefs();
@@ -376,13 +376,13 @@  discard block
 block discarded – undo
376 376
         {
377 377
             if (!empty($field))
378 378
             {
379
-                if (! is_array($def)) {
379
+                if (!is_array($def)) {
380 380
                     $def = array('name' => $field);
381 381
                 }
382 382
                 // get this field's label - if it has not been explicitly provided, see if the fieldDefs has a label for this field, and if not fallback to the field name
383
-                if (! isset($def ['label']))
383
+                if (!isset($def ['label']))
384 384
                         {
385
-                            if (! empty($this->_fieldDefs [$field] ['vname']))
385
+                            if (!empty($this->_fieldDefs [$field] ['vname']))
386 386
                             {
387 387
                                 $def ['label'] = $this->_fieldDefs [$field] ['vname'];
388 388
                             } else
@@ -393,25 +393,25 @@  discard block
 block discarded – undo
393 393
                 $modelFields[$field] = array('name' => $field, 'label' => $def ['label']);
394 394
             }
395 395
         }
396
-        $GLOBALS['log']->debug(print_r($modelFields,true));
396
+        $GLOBALS['log']->debug(print_r($modelFields, true));
397 397
         foreach ($this->_fieldDefs as $field => $def)
398 398
         {
399 399
             if ((!empty($def['studio']) && $def['studio'] == 'visible')
400
-            || (empty($def['studio']) &&  (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields') && $def ['type'] != 'id' && strcmp($field, 'deleted') != 0 && (empty($def ['dbType']) || $def ['dbType'] != 'id') && (empty($def ['dbtype']) || $def ['dbtype'] != 'id')))
400
+            || (empty($def['studio']) && (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields') && $def ['type'] != 'id' && strcmp($field, 'deleted') != 0 && (empty($def ['dbType']) || $def ['dbType'] != 'id') && (empty($def ['dbtype']) || $def ['dbtype'] != 'id')))
401 401
             {
402 402
                 $label = isset($def['vname']) ? $def['vname'] : $def['name'];
403 403
                 $modelFields [$field] = array('name' => $field, 'label' => $label);
404 404
             }
405 405
             else
406 406
             {
407
-                $GLOBALS['log']->debug( get_class($this)."->_getModelFields(): skipping $field from modelFields as it fails the test for inclusion");
407
+                $GLOBALS['log']->debug(get_class($this)."->_getModelFields(): skipping $field from modelFields as it fails the test for inclusion");
408 408
             }
409 409
         }
410
-        $GLOBALS['log']->debug( get_class($this)."->_getModelFields(): remaining entries in modelFields are: ".implode(",",array_keys($modelFields)));
410
+        $GLOBALS['log']->debug(get_class($this)."->_getModelFields(): remaining entries in modelFields are: ".implode(",", array_keys($modelFields)));
411 411
         return $modelFields;
412 412
     }
413 413
 
414
-    function _parseData ($panels)
414
+    function _parseData($panels)
415 415
     {
416 416
         $fields = array();
417 417
         if (empty($panels))
@@ -419,7 +419,7 @@  discard block
 block discarded – undo
419 419
 
420 420
         // 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 421
         // See EditView2 for similar treatment
422
-        if (! empty($panels) && count($panels) > 0)
422
+        if (!empty($panels) && count($panels) > 0)
423 423
         {
424 424
             $keys = array_keys($panels);
425 425
             if (is_numeric($keys [0]))
@@ -438,12 +438,12 @@  discard block
 block discarded – undo
438 438
                 {
439 439
                     $properties = array();
440 440
 
441
-                    if (! empty($col))
441
+                    if (!empty($col))
442 442
                     {
443 443
                         if (is_string($col))
444 444
                         {
445 445
                             $properties ['name'] = $col;
446
-                        } else if (! empty($col ['name']))
446
+                        } else if (!empty($col ['name']))
447 447
                         {
448 448
                             $properties = $col;
449 449
                         }
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
                         $properties ['name'] = translate('LBL_FILLER');
453 453
                     }
454 454
 
455
-                    if (! empty($properties ['name']))
455
+                    if (!empty($properties ['name']))
456 456
                     {
457 457
 
458 458
                         // get this field's label - if it has not been explicity provided, see if the fieldDefs has a label for this field, and if not fallback to the field name
459
-                        if (! isset($properties ['label']))
459
+                        if (!isset($properties ['label']))
460 460
                         {
461
-                            if (! empty($this->_fieldDefs [$properties ['name']] ['vname']))
461
+                            if (!empty($this->_fieldDefs [$properties ['name']] ['vname']))
462 462
                             {
463 463
                                 $properties ['label'] = $this->_fieldDefs [$properties ['name']] ['vname'];
464 464
                             } else
@@ -476,7 +476,7 @@  discard block
 block discarded – undo
476 476
         return $displayData;
477 477
     }
478 478
 
479
-    function _getOrigFieldViewDefs ()
479
+    function _getOrigFieldViewDefs()
480 480
     {
481 481
         $origFieldDefs = array();
482 482
         $GLOBALS['log']->debug("Original File = ".$this->_originalFile);
@@ -487,7 +487,7 @@  discard block
 block discarded – undo
487 487
 //          $GLOBALS['log']->debug($origdefs);
488 488
             // 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
489 489
             // See EditView2 for similar treatment
490
-            if (! empty($origdefs) && count($origdefs) > 0)
490
+            if (!empty($origdefs) && count($origdefs) > 0)
491 491
             {
492 492
                 $keys = array_keys($origdefs);
493 493
                 if (is_numeric($keys [0]))
Please login to merge, or discard this patch.
modules/SchedulersJobs/field_arrays.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -39,8 +39,8 @@  discard block
 block discarded – undo
39 39
  ********************************************************************************/
40 40
 
41 41
 
42
-$fields_array['Schedulers_jobs'] = array (
43
-	'column_fields' => array (
42
+$fields_array['Schedulers_jobs'] = array(
43
+	'column_fields' => array(
44 44
 		'id',
45 45
 		'deleted',
46 46
 		'date_entered',
@@ -49,12 +49,12 @@  discard block
 block discarded – undo
49 49
 		'execute_time',
50 50
 		'status',
51 51
 	),
52
-	'list_fields' => array (
52
+	'list_fields' => array(
53 53
 		'id',
54 54
 		'job_id',
55 55
 		'execute_time'
56 56
 	),
57
-	'required_fields' => array (
57
+	'required_fields' => array(
58 58
 		'job_id' => 1,
59 59
 		'execute_time' => 1
60 60
 	)
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapGoogle.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -86,13 +86,13 @@  discard block
 block discarded – undo
86 86
              'email2' => array('sugar_key' => 'email2', 'sugar_label' => 'LBL_OTHER_EMAIL_ADDRESS', 'default_label' => 'Other Email'),
87 87
 
88 88
              'assigned_user_name' => array('sugar_key' => 'assigned_user_name', 'sugar_help_key' => 'LBL_EXTERNAL_ASSIGNED_TOOLTIP', 'sugar_label' => 'LBL_ASSIGNED_TO_NAME', 'default_label' => 'Assigned To'),
89
-             'team_name' => array('sugar_key' => 'team_name', 'sugar_help_key' => 'LBL_EXTERNAL_TEAM_TOOLTIP','sugar_label' => 'LBL_TEAMS', 'default_label' => 'Teams'),
89
+             'team_name' => array('sugar_key' => 'team_name', 'sugar_help_key' => 'LBL_EXTERNAL_TEAM_TOOLTIP', 'sugar_label' => 'LBL_TEAMS', 'default_label' => 'Teams'),
90 90
             );
91 91
 
92
-        if($module == 'Users')
92
+        if ($module == 'Users')
93 93
         {
94
-            $return_array['status'] =  array('sugar_key' => 'status', 'sugar_label' => '', 'default_label' => 'Status');
95
-            $return_array['full_name'] =  array('sugar_key' => 'user_name', 'sugar_label' => '', 'default_label' => 'Full Name');
94
+            $return_array['status'] = array('sugar_key' => 'status', 'sugar_label' => '', 'default_label' => 'Status');
95
+            $return_array['full_name'] = array('sugar_key' => 'user_name', 'sugar_label' => '', 'default_label' => 'Full Name');
96 96
         }
97 97
         return $return_array;
98 98
     }
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapSalesforce.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 		$module
159 159
 		)
160 160
 	{
161
-		return array_merge(parent::getIgnoredFields($module),array('id'));
161
+		return array_merge(parent::getIgnoredFields($module), array('id'));
162 162
 	}
163 163
 }
164 164
 
Please login to merge, or discard this patch.
modules/Import/maps/ImportMapOther.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
             break;
127 127
         case 'Opportunities':
128 128
             return array(
129
-                "Opportunity Name"=>"name" ,
129
+                "Opportunity Name"=>"name",
130 130
                 "Type"=>"opportunity_type",
131 131
                 "Lead Source"=>"lead_source",
132 132
                 "Amount"=>"amount",
Please login to merge, or discard this patch.
modules/Import/maps/ImportMap.php 1 patch
Spacing   +38 added lines, -38 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -107,11 +107,11 @@  discard block
 block discarded – undo
107 107
     public function getMapping()
108 108
     {
109 109
         $mapping_arr = array();
110
-        if ( !empty($this->content) )
110
+        if (!empty($this->content))
111 111
         {
112
-            $pairs = explode("&",$this->content);
113
-            foreach ($pairs as $pair){
114
-                list($name,$value) = explode("=",$pair);
112
+            $pairs = explode("&", $this->content);
113
+            foreach ($pairs as $pair) {
114
+                list($name, $value) = explode("=", $pair);
115 115
                 $mapping_arr[trim($name)] = $value;
116 116
             }
117 117
         }
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
         $mapping_arr
129 129
         )
130 130
     {
131
-        $output = array ();
131
+        $output = array();
132 132
         foreach ($mapping_arr as $key => $item) {
133 133
             $output[] = "$key=$item";
134 134
         }
@@ -143,11 +143,11 @@  discard block
 block discarded – undo
143 143
     public function getDefaultValues()
144 144
     {
145 145
         $defa_arr = array();
146
-        if ( !empty($this->default_values) )
146
+        if (!empty($this->default_values))
147 147
         {
148
-            $pairs = explode("&",$this->default_values);
149
-            foreach ($pairs as $pair){
150
-                list($name,$value) = explode("=",$pair);
148
+            $pairs = explode("&", $this->default_values);
149
+            foreach ($pairs as $pair) {
150
+                list($name, $value) = explode("=", $pair);
151 151
                 $defa_arr[trim($name)] = $value;
152 152
             }
153 153
         }
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
         $defa_arr
165 165
         )
166 166
     {
167
-        $output = array ();
167
+        $output = array();
168 168
         foreach ($defa_arr as $key => $item) {
169 169
             $output[] = "$key=$item";
170 170
         }
@@ -174,15 +174,15 @@  discard block
 block discarded – undo
174 174
     /**
175 175
      * @see SugarBean::retrieve()
176 176
      */
177
-    public function retrieve($id = -1, $encode=true,$deleted=true)
177
+    public function retrieve($id = -1, $encode = true, $deleted = true)
178 178
 	{
179
-	    $returnVal = parent::retrieve($id,$encode,$deleted);
179
+	    $returnVal = parent::retrieve($id, $encode, $deleted);
180 180
 
181
-	    if ( !($returnVal instanceOf $this) ) {
181
+	    if (!($returnVal instanceOf $this)) {
182 182
 	        return $returnVal;
183 183
 	    }
184 184
 
185
-	    if ( $this->source == 'tab' && $this->delimiter == '' ) {
185
+	    if ($this->source == 'tab' && $this->delimiter == '') {
186 186
 	        $this->delimiter = "\t";
187 187
 	    }
188 188
 
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
 
228 228
         // Bug 23354 - Make sure enclosure gets saved as an empty string if
229 229
         // it is an empty string, instead of as a null
230
-        if ( strlen($enclosure) <= 0 ) $enclosure = ' ';
230
+        if (strlen($enclosure) <= 0) $enclosure = ' ';
231 231
 
232 232
         $this->assigned_user_id = $owner_id;
233 233
         $this->name             = $name;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
         parent::save();
243 243
 
244 244
         // Bug 29365 - The enclosure character isn't saved correctly if it's a tab using MssqlManager, so resave it
245
-        if ( $enclosure == '\\t' && $this->db instanceOf MssqlManager ) {
245
+        if ($enclosure == '\\t' && $this->db instanceOf MssqlManager) {
246 246
             $this->enclosure = $enclosure;
247 247
             parent::save();
248 248
         }
@@ -262,11 +262,11 @@  discard block
 block discarded – undo
262 262
     {
263 263
         global $current_user;
264 264
 
265
-        if ( !is_admin($current_user) ) {
265
+        if (!is_admin($current_user)) {
266 266
             $other_map = new ImportMap();
267 267
             $other_map->retrieve_by_string_fields(array('id'=> $id), false);
268 268
 
269
-            if ( $other_map->assigned_user_id != $current_user->id )
269
+            if ($other_map->assigned_user_id != $current_user->id)
270 270
                 return false;
271 271
         }
272 272
 
@@ -287,7 +287,7 @@  discard block
 block discarded – undo
287 287
     {
288 288
         global $current_user;
289 289
 
290
-        if ( !is_admin($current_user) )
290
+        if (!is_admin($current_user))
291 291
             return false;
292 292
 
293 293
         // check for problems
@@ -313,16 +313,16 @@  discard block
 block discarded – undo
313 313
         $other_map->retrieve_by_string_fields($query_arr, false);
314 314
 
315 315
         // if we find this other map, quit
316
-        if ( isset($other_map->id) )
316
+        if (isset($other_map->id))
317 317
             return false;
318 318
 
319 319
         // otherwise update the is_published flag
320 320
         $query = "UPDATE $this->table_name
321
-                    SET is_published = '". ($flag?'yes':'no') . "',
321
+                    SET is_published = '".($flag ? 'yes' : 'no')."',
322 322
                         assigned_user_id = '$user_id'
323 323
                     WHERE id = '{$this->id}'";
324 324
 
325
-        $this->db->query($query,true,"Error marking import map published: ");
325
+        $this->db->query($query, true, "Error marking import map published: ");
326 326
 
327 327
         return true;
328 328
     }
@@ -339,21 +339,21 @@  discard block
 block discarded – undo
339 339
     {
340 340
         $query = "SELECT *
341 341
                     FROM {$this->table_name}
342
-                    " . $this->get_where($fields_array);
342
+                    ".$this->get_where($fields_array);
343 343
 
344
-        $result = $this->db->query($query,true," Error: ");
344
+        $result = $this->db->query($query, true, " Error: ");
345 345
         $obj_arr = array();
346 346
 
347
-        while ($row = $this->db->fetchByAssoc($result,FALSE) ) {
347
+        while ($row = $this->db->fetchByAssoc($result, FALSE)) {
348 348
             $focus = new ImportMap();
349 349
 
350
-            foreach($this->column_fields as $field) {
351
-                if(isset($row[$field])) {
350
+            foreach ($this->column_fields as $field) {
351
+                if (isset($row[$field])) {
352 352
                     $focus->$field = $row[$field];
353 353
                 }
354 354
             }
355 355
             $focus->fill_in_additional_detail_fields();
356
-            $obj_arr[]=$focus;
356
+            $obj_arr[] = $focus;
357 357
         }
358 358
 
359 359
         return $obj_arr;
@@ -376,37 +376,37 @@  discard block
 block discarded – undo
376 376
         //step2
377 377
            // 'custom_delimiter', 'custom_enclosure', 'type', 'source', 'source_id', 'import_module', 'has_header',
378 378
          //step3
379
-            'display_tabs_def','custom_delimiter', 'custom_enclosure', 'import_type', 'source', 'source_id', 'import_module', 'has_header', 'importlocale_charset',
379
+            'display_tabs_def', 'custom_delimiter', 'custom_enclosure', 'import_type', 'source', 'source_id', 'import_module', 'has_header', 'importlocale_charset',
380 380
             'importlocale_dateformat', 'importlocale_timeformat', 'importlocale_timezone', 'importlocale_currency',
381 381
             'importlocale_default_currency_significant_digits', 'importlocale_num_grp_sep', 'importlocale_dec_sep',
382 382
         '   importlocale_default_locale_name_format');
383 383
 
384 384
         //retrieve user preferences and populate preference array
385 385
         $preference_values_str = $current_user->getPreference('field_values', 'import');
386
-        $preference_values = json_decode($preference_values_str,true);
386
+        $preference_values = json_decode($preference_values_str, true);
387 387
 
388
-        foreach ($import_step_fields as $val){
388
+        foreach ($import_step_fields as $val) {
389 389
             //overwrite preference array with new values from request if the value is different or new
390
-            if((isset($_REQUEST[$val]) && !isset($preference_values[$val])) || (isset($_REQUEST[$val]) && $preference_values[$val] != $_REQUEST[$val])){
390
+            if ((isset($_REQUEST[$val]) && !isset($preference_values[$val])) || (isset($_REQUEST[$val]) && $preference_values[$val] != $_REQUEST[$val])) {
391 391
                 $preference_values[$val] = $_REQUEST[$val];
392 392
                 $set = true;
393 393
             }
394 394
         }
395 395
 
396 396
         //force the values to passed in array if array is set
397
-        if(!empty($ForceValsArr) && is_array($ForceValsArr)){
398
-            foreach ($ForceValsArr as $forceKey=>$forceVal){
397
+        if (!empty($ForceValsArr) && is_array($ForceValsArr)) {
398
+            foreach ($ForceValsArr as $forceKey=>$forceVal) {
399 399
                 $preference_values[$forceKey] = $forceVal;
400 400
                 $set = true;
401 401
             }
402 402
         }
403 403
 
404 404
         //set preferences if any changes were made and return the new array
405
-        if($set){
406
-            $preference_values_str =  json_encode($preference_values);
405
+        if ($set) {
406
+            $preference_values_str = json_encode($preference_values);
407 407
             $current_user->setPreference('field_values', $preference_values_str, 0, 'import');
408 408
         }
409
-        if(empty($preference_values)){
409
+        if (empty($preference_values)) {
410 410
             return array();
411 411
         }
412 412
 
Please login to merge, or discard this patch.
modules/Cases/metadata/accountsquickcreatedefs.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -39,9 +39,9 @@  discard block
 block discarded – undo
39 39
 
40 40
 $viewdefs['Cases']['AccountsQuickCreate'] = array(
41 41
 'templateMeta' => array('form' => 
42
-                            array (
42
+                            array(
43 43
                               'hidden' => 
44
-                              array (
44
+                              array(
45 45
                                 0 => '<input type="hidden" name="account_id" value="{$smarty.request.account_id}">',
46 46
                                 1 => '<input type="hidden" name="account_name" value="{$smarty.request.account_name}">',
47 47
                               ),
@@ -54,22 +54,22 @@  discard block
 block discarded – undo
54 54
                        ),
55 55
 'panels' =>
56 56
 
57
-array (
57
+array(
58 58
   
59
-  array (
60
-    array ('name'=>'name', 'displayParams'=>array('size'=>65, 'required'=>true)),
59
+  array(
60
+    array('name'=>'name', 'displayParams'=>array('size'=>65, 'required'=>true)),
61 61
     'priority'
62 62
   ),
63 63
   
64
-  array (
64
+  array(
65 65
     'status',
66 66
     array('name'=>'account_name', 'type'=>'readonly'),
67 67
   ),
68 68
   
69
-  array (
70
-    array (
69
+  array(
70
+    array(
71 71
       'name' => 'description',
72
-      'displayParams' => array ('rows' => '4','cols' => '60'),
72
+      'displayParams' => array('rows' => '4', 'cols' => '60'),
73 73
       'nl2br' => true,
74 74
     ),
75 75
   ),
Please login to merge, or discard this patch.
modules/Cases/metadata/additionalDetails.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if (!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
3 3
 /*********************************************************************************
4 4
  * SugarCRM Community Edition is a customer relationship management program developed by
5 5
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -43,21 +43,21 @@  discard block
 block discarded – undo
43 43
 }
44 44
 function additionalDetailsaCase($fields) {
45 45
 	static $mod_strings;
46
-	if(empty($mod_strings)) {
46
+	if (empty($mod_strings)) {
47 47
 		global $current_language;
48 48
 		$mod_strings = return_module_language($current_language, 'Cases');
49 49
 	}
50 50
 		
51 51
 	$overlib_string = '';
52 52
 		
53
-	if(!empty($fields['DESCRIPTION'])) { 
54
-		$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
55
-		if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
53
+	if (!empty($fields['DESCRIPTION'])) { 
54
+		$overlib_string .= '<b>'.$mod_strings['LBL_DESCRIPTION'].'</b> '.substr($fields['DESCRIPTION'], 0, 300);
55
+		if (strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
56 56
 		$overlib_string .= '<br>';
57 57
 	}
58
-	if(!empty($fields['RESOLUTION'])) { 
59
-		$overlib_string .= '<b>'. $mod_strings['LBL_RESOLUTION'] . '</b> ' . substr($fields['RESOLUTION'], 0, 300);
60
-		if(strlen($fields['RESOLUTION']) > 300) $overlib_string .= '...';
58
+	if (!empty($fields['RESOLUTION'])) { 
59
+		$overlib_string .= '<b>'.$mod_strings['LBL_RESOLUTION'].'</b> '.substr($fields['RESOLUTION'], 0, 300);
60
+		if (strlen($fields['RESOLUTION']) > 300) $overlib_string .= '...';
61 61
 	}		
62 62
 	
63 63
 	return array('fieldToAddTo' => 'NAME', 
Please login to merge, or discard this patch.