Completed
Push — develop ( 7c1bda...edae1e )
by Adam
18:38 queued 03:14
created
modules/ModuleBuilder/views/view.package.php 1 patch
Braces   +7 added lines, -5 removed lines patch added patch discarded remove patch
@@ -73,8 +73,7 @@  discard block
 block discarded – undo
73 73
 			$ajax->addCrumb($GLOBALS['mod_strings']['LBL_PACKAGE_LIST'],'');
74 74
  			$ajax->addSection('center', $GLOBALS['mod_strings']['LBL_PACKAGE_LIST'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
75 75
 			echo $ajax->getJavascript();
76
- 		}
77
- 		else {
76
+ 		} else {
78 77
  			
79 78
  			$name = (!empty($_REQUEST['package']))?$_REQUEST['package']:'';
80 79
 			$mb->getPackage($name);
@@ -114,11 +113,14 @@  discard block
 block discarded – undo
114 113
 
115 114
 	 		$ajax = new AjaxCompose();
116 115
 	 		$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package")');
117
-			if(empty($name))$name = $mod_strings['LBL_NEW_PACKAGE'];
116
+			if(empty($name)) {
117
+			    $name = $mod_strings['LBL_NEW_PACKAGE'];
118
+			}
118 119
 	 		$ajax->addCrumb($name,'');
119 120
 	 		$html=$smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/package.tpl');
120
-	 		if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage')
121
-	 			$html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
121
+	 		if(!empty($_REQUEST['action']) && $_REQUEST['action']=='SavePackage') {
122
+	 			 			$html.="<script>ModuleBuilder.treeRefresh('ModuleBuilder')</script>";
123
+	 		}
122 124
 	 		$ajax->addSection('center', translate('LBL_SECTION_PACKAGE', 'ModuleBuilder'), $html);
123 125
 			echo $ajax->getJavascript();
124 126
  		}
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.wizard.php 1 patch
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -54,8 +54,9 @@  discard block
 block discarded – undo
54 54
 
55 55
 	function __construct()
56 56
 	{
57
-		if ( isset ( $_REQUEST [ 'view' ] ) )
58
-			$this->view = $_REQUEST [ 'view' ] ;
57
+		if ( isset ( $_REQUEST [ 'view' ] ) ) {
58
+					$this->view = $_REQUEST [ 'view' ] ;
59
+		}
59 60
 
60 61
 		$this->editModule = (! empty ( $_REQUEST [ 'view_module' ] ) ) ? $_REQUEST [ 'view_module' ] : null ;
61 62
 		$this->buttons = array(); // initialize so that modules without subpanels for example don't result in this being unset and causing problems in the smarty->assign
@@ -114,8 +115,9 @@  discard block
 block discarded – undo
114 115
 			$this->question = translate('LBL_QUESTION_EDIT') ;
115 116
 			$this->title = translate( 'LBL_STUDIO' );
116 117
 			global $current_user;
117
-			if (is_admin($current_user))
118
-				$this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"" . translate ( 'LBL_BTN_EXPORT' ) . '">' ;
118
+			if (is_admin($current_user)) {
119
+							$this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=exportcustomizations');\" value=\"" . translate ( 'LBL_BTN_EXPORT' ) . '">' ;
120
+			}
119 121
 
120 122
 			$this->help = 'studioHelp' ;
121 123
 		} else
@@ -177,10 +179,11 @@  discard block
 block discarded – undo
177 179
 					$this->title = translate( 'LBL_EDIT' ) . " " . $module->name ;
178 180
 					$this->help = 'moduleHelp' ;
179 181
 					global $current_user;
180
-					if (is_admin($current_user))
181
-                        $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " 
182
+					if (is_admin($current_user)) {
183
+					                        $this->actions = "<input class=\"button\" type=\"button\" id=\"exportBtn\" name=\"exportBtn\" " 
182 184
                         . "onclick=\"ModuleBuilder.getContent('module=ModuleBuilder&action=resetmodule&view_module=$this->editModule');\" value=\"" 
183 185
                         . translate( 'LBL_RESET_MODULE' ) . '">' ;
186
+					}
184 187
 			}
185 188
 		}
186 189
 	}
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.dropdown.php 1 patch
Braces   +12 added lines, -9 removed lines patch added patch discarded remove patch
@@ -134,27 +134,30 @@
 block discarded – undo
134 134
 			
135 135
 			// handle the case where we've saved a dropdown in one language, and now attempt to edit it for another language. The $name exists, but $my_list_strings[$name] doesn't
136 136
             // for now, we just treat it as if it was new. A better approach might be to use the first language version as a template for future languages
137
-            if (!isset($my_list_strings[$name]))
138
-                $my_list_strings[$name] = array () ;
137
+            if (!isset($my_list_strings[$name])) {
138
+                            $my_list_strings[$name] = array () ;
139
+            }
139 140
  
140 141
 			$selected_dropdown = (!empty($vardef['options']) && !empty($my_list_strings[$vardef['options']])) ? $my_list_strings[$vardef['options']] : $my_list_strings[$name];
141 142
 			$smarty->assign('ul_list', 'list = '.$json->encode(array_keys($selected_dropdown)));
142 143
 			$smarty->assign('dropdown_name', (!empty($vardef['options']) ? $vardef['options'] : $_REQUEST['dropdown_name']));
143 144
 			$smarty->assign('name', $_REQUEST['dropdown_name']);
144 145
 			$smarty->assign('options', $selected_dropdown);
145
-		}else{
146
+		} else{
146 147
 			$smarty->assign('ul_list', 'list = {}');
147 148
 			//we should try to find a name for this dropdown based on the field name.
148 149
 			$pre_pop_name = '';
149
-			if(!empty($_REQUEST['field']))
150
-				$pre_pop_name = $_REQUEST['field'];
150
+			if(!empty($_REQUEST['field'])) {
151
+							$pre_pop_name = $_REQUEST['field'];
152
+			}
151 153
 			//ensure this dropdown name does not already exist
152 154
 			$use_name = $pre_pop_name.'_list';
153 155
 			for($i = 0; $i < 100; $i++){
154
-				if(empty($my_list_strings[$use_name]))
155
-					break;
156
-				else
157
-					$use_name = $pre_pop_name.'_'.$i;
156
+				if(empty($my_list_strings[$use_name])) {
157
+									break;
158
+				} else {
159
+									$use_name = $pre_pop_name.'_'.$i;
160
+				}
158 161
 			}
159 162
 			$smarty->assign('prepopulated_name', $use_name);
160 163
 		}
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.listview.php 1 patch
Braces   +17 added lines, -11 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.
@@ -115,8 +116,9 @@  discard block
 block discarded – undo
115 116
         			MB_LISTVIEW => 'LBL_LISTVIEW' ,
116 117
         			) ;
117 118
         $translatedViewType = '' ;
118
-		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) )
119
-			$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
119
+		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) {
120
+					$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
121
+		}
120 122
 		$this->translatedViewType = $translatedViewType;
121 123
 
122 124
         if ($this->fromModuleBuilder)
@@ -131,8 +133,9 @@  discard block
 block discarded – undo
131 133
                 {
132 134
                     $subpanelLabel = $this->subpanelLabel;
133 135
                     // If the subpanel title has changed, use that for the label instead
134
-                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] )
135
-                        $subpanelLabel = $_REQUEST['subpanel_title'];
136
+                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] ) {
137
+                                            $subpanelLabel = $_REQUEST['subpanel_title'];
138
+                    }
136 139
 
137 140
                     $ajax->addCrumb( $subpanelLabel, '' );
138 141
                     $this->translatedViewType = $subpanelLabel . "&nbsp;" . translate("LBL_SUBPANEL", "ModuleBuilder");
@@ -158,8 +161,9 @@  discard block
 block discarded – undo
158 161
                 {
159 162
                     $subpanelLabel = $this->subpanelLabel;
160 163
                     // If the subpanel title has changed, use that for the label instead
161
-                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] )
162
-                        $subpanelLabel = $_REQUEST['subpanel_title'];
164
+                    if( !empty($_REQUEST['subpanel_title'] ) && $_REQUEST['subpanelLabel'] != $_REQUEST['subpanel_title'] ) {
165
+                                            $subpanelLabel = $_REQUEST['subpanel_title'];
166
+                    }
163 167
 
164 168
                     $ajax->addCrumb( $subpanelLabel, '' );
165 169
                     $this->translatedViewType = $subpanelLabel . "&nbsp;" . translate("LBL_SUBPANEL", "ModuleBuilder");
@@ -241,12 +245,14 @@  discard block
 block discarded – undo
241 245
         $history = $parser->getHistory () ;
242 246
 
243 247
         $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ;
244
-        if ($this->subpanel)
245
-            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->subpanel}\")" ;
248
+        if ($this->subpanel) {
249
+                    $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->subpanel}\")" ;
250
+        }
246 251
 
247 252
         $restoreAction = "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"\")'";
248
-        if ($this->subpanel)
249
-            $restoreAction = "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"{$this->subpanel}\")'";
253
+        if ($this->subpanel) {
254
+                    $restoreAction = "onclick='ModuleBuilder.history.revert(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$history->getLast()}\", \"{$this->subpanel}\")'";
255
+        }
250 256
 
251 257
         $buttons = array ( ) ;
252 258
         $buttons [] = array ( 'id' =>'savebtn', 'name' => 'savebtn' , 'image' => $imageSave , 'text' => (! $this->fromModuleBuilder)?$GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVEPUBLISH' ]: $GLOBALS [ 'mod_strings' ] [ 'LBL_BTN_SAVE' ], 'actionScript' => "onclick='studiotabs.generateGroupForm(\"edittabs\");if (countListFields()==0) ModuleBuilder.layoutValidation.popup() ; else ModuleBuilder.handleSave(\"edittabs\" )'" ) ;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.dashlet.php 1 patch
Braces   +16 added lines, -12 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.
@@ -52,10 +53,11 @@  discard block
 block discarded – undo
52 53
     {
53 54
         $this->editModule = $_REQUEST [ 'view_module' ] ;
54 55
         $this->editLayout = $_REQUEST [ 'view' ] ;
55
-        if(isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] ))
56
-            $this->editPackage = $_REQUEST [ 'view_package' ];
57
-        else
58
-            $this->editPackage = null;
56
+        if(isset ( $_REQUEST [ 'view_package' ] ) && ! empty ( $_REQUEST [ 'view_package' ] )) {
57
+                    $this->editPackage = $_REQUEST [ 'view_package' ];
58
+        } else {
59
+                    $this->editPackage = null;
60
+        }
59 61
 
60 62
         $this->fromModuleBuilder = isset ( $_REQUEST [ 'MB' ] ) || (isset($_REQUEST['view_package']) && $_REQUEST['view_package'] && $_REQUEST['view_package'] != 'studio') ;
61 63
 
@@ -121,7 +123,7 @@  discard block
 block discarded – undo
121 123
 
122 124
             $ViewLabel = ($this->editLayout == MB_DASHLET) ? 'LBL_DASHLETLISTVIEW' : 'LBL_DASHLETSEARCHVIEW';
123 125
             $ajax->addCrumb ( translate ($ViewLabel, 'ModuleBuilder' ), '' ) ;
124
-        }else{
126
+        } else{
125 127
             $ajax->addCrumb ( translate($this->editModule), 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_module=' . $this->editModule . '")' ) ;
126 128
             $ajax->addCrumb ( translate('LBL_LAYOUTS', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&layouts=1&view_module=' . $this->editModule . '")');
127 129
             $ajax->addCrumb ( translate('LBL_DASHLET', 'ModuleBuilder'), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view=dashlet&view_module=' . $this->editModule . '")' );
@@ -182,8 +184,9 @@  discard block
 block discarded – undo
182 184
 
183 185
 
184 186
         $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\")" ;
185
-        if (isset($this->searchlayout))
186
-            $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ;
187
+        if (isset($this->searchlayout)) {
188
+                    $histaction = "ModuleBuilder.history.browse(\"{$this->editModule}\", \"{$this->editLayout}\", \"{$this->searchlayout}\")" ;
189
+        }
187 190
 
188 191
         $buttons = array ( ) ;
189 192
         if (! $this->fromModuleBuilder)
@@ -221,10 +224,11 @@  discard block
 block discarded – undo
221 224
     {
222 225
         global $app_list_strings ;
223 226
 
224
-        if ($this->fromModuleBuilder)
225
-            $title = $this->editModule ;
226
-        else
227
-            $title =  $app_list_strings [ 'moduleList' ] [ $this->editModule ] ;
227
+        if ($this->fromModuleBuilder) {
228
+                    $title = $this->editModule ;
229
+        } else {
230
+                    $title =  $app_list_strings [ 'moduleList' ] [ $this->editModule ] ;
231
+        }
228 232
         
229 233
         return $GLOBALS [ 'mod_strings' ] [ 'LBL_LISTVIEW_EDIT' ] . ':&nbsp;' . $title ;
230 234
     }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.history.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -103,8 +103,9 @@  discard block
 block discarded – undo
103 103
         {
104 104
             $dbDate = $timedate->fromTimestamp($ts)->asDb();
105 105
             $displayTS = $timedate->to_display_date_time ( $dbDate ) ;
106
-            if ($page * $this->pageSize + $i + 1 == $count)
107
-                $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
106
+            if ($page * $this->pageSize + $i + 1 == $count) {
107
+                            $displayTS = translate("LBL_MB_DEFAULT_LAYOUT");
108
+            }
108 109
             $snapshots [ $ts ] = $displayTS ;
109 110
             $ts = $this->history->getNext () ;
110 111
         }
@@ -151,7 +152,7 @@  discard block
 block discarded – undo
151 152
         {
152 153
         	require_once ("modules/ModuleBuilder/views/view.dashlet.php") ;
153 154
         	$view = new ViewDashlet ( ) ;
154
-        }  else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155
+        } else if ($this->layout == 'popuplist' || $this->layout == 'popupsearch')
155 156
         {
156 157
         	require_once ("modules/ModuleBuilder/views/view.popupview.php") ;
157 158
         	$view = new ViewPopupview ( ) ;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulefields.php 1 patch
Braces   +26 added lines, -18 removed lines patch added patch discarded remove patch
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
             {
144 144
                 include($this->mbModule->path .'/language/'.$current_language.'.lang.php');
145 145
                 $this->mbModule->setModStrings($current_language,$mod_strings);
146
-            }elseif(file_exists($this->mbModule->path. '/language/en_us.lang.php')){
146
+            } elseif(file_exists($this->mbModule->path. '/language/en_us.lang.php')){
147 147
                 include($this->mbModule->path .'/language/en_us.lang.php');
148 148
                 $this->mbModule->setModStrings('en_us',$mod_strings);
149 149
             }
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
                 if($k != $module_name)
170 170
                 {
171 171
                     $titleLBL[$k]=translate("LBL_".strtoupper($k),'ModuleBuilder');
172
-                }else{
172
+                } else{
173 173
                     $titleLBL[$k]=$k;
174 174
                 }
175 175
                 foreach($v as $field => $def)
@@ -229,12 +229,15 @@  discard block
 block discarded – undo
229 229
         $def
230 230
         )
231 231
     {
232
-        if(!empty($def['parent_id']))
233
-            unset($def['parent_id']);
234
-        if(!empty($def['parent_type']))
235
-            unset($def['parent_type']);
236
-        if(!empty($def['currency_id']))
237
-            unset($def['currency_id']);
232
+        if(!empty($def['parent_id'])) {
233
+                    unset($def['parent_id']);
234
+        }
235
+        if(!empty($def['parent_type'])) {
236
+                    unset($def['parent_type']);
237
+        }
238
+        if(!empty($def['currency_id'])) {
239
+                    unset($def['currency_id']);
240
+        }
238 241
         return $def;
239 242
     }
240 243
 	
@@ -245,23 +248,28 @@  discard block
 block discarded – undo
245 248
     	if (isset($def['studio'])) {
246 249
             if (is_array($def [ 'studio' ]))
247 250
             {
248
-    			if (isset($def['studio']['editField']) && $def['studio']['editField'] == true)
249
-                    return true;
250
-    			if (isset($def['studio']['required']) && $def['studio']['required'])
251
-                    return true;
251
+    			if (isset($def['studio']['editField']) && $def['studio']['editField'] == true) {
252
+    			                    return true;
253
+    			}
254
+    			if (isset($def['studio']['required']) && $def['studio']['required']) {
255
+    			                    return true;
256
+    			}
252 257
                     
253 258
     		} else
254 259
     		{
255
-    			if ($def['studio'] == 'visible')
256
-                    return true;
257
-                if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] )
258
-                    return false;
260
+    			if ($def['studio'] == 'visible') {
261
+    			                    return true;
262
+    			}
263
+                if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] ) {
264
+                                    return false;
265
+                }
259 266
             }
260 267
         }
261 268
     	if (empty($def ['source']) || $def ['source'] == 'db' || $def ['source'] == 'custom_fields')
262 269
 		{
263
-    		if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id'))
264
-		  return true;
270
+    		if ($def ['type'] != 'id' && (empty($def ['dbType']) || $def ['dbType'] != 'id')) {
271
+    				  return true;
272
+    		}
265 273
 		}
266 274
 		
267 275
 		return false;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulefield.php 1 patch
Braces   +49 added lines, -31 removed lines patch added patch discarded remove patch
@@ -66,14 +66,17 @@  discard block
 block discarded – undo
66 66
         )
67 67
     {
68 68
         $fv = new FieldViewer();
69
-        if(empty($_REQUEST['field'])&& !empty($_REQUEST['name']))$_REQUEST['field'] = $_REQUEST['name'];
69
+        if(empty($_REQUEST['field'])&& !empty($_REQUEST['name'])) {
70
+            $_REQUEST['field'] = $_REQUEST['name'];
71
+        }
70 72
         $field_name = '';
71
-        if(!empty($this->view_object_map['field_name']))
72
-            $field_name = $this->view_object_map['field_name'];
73
-        elseif(!empty($_REQUEST['field']))
74
-            $field_name = $_REQUEST['field'];
75
-        else
76
-            $field_name = '';
73
+        if(!empty($this->view_object_map['field_name'])) {
74
+                    $field_name = $this->view_object_map['field_name'];
75
+        } elseif(!empty($_REQUEST['field'])) {
76
+                    $field_name = $_REQUEST['field'];
77
+        } else {
78
+                    $field_name = '';
79
+        }
77 80
 
78 81
         $action = 'saveField'; // tyoung bug 17606: default action is to save as a dynamic field; but for standard OOB
79 82
                                // fields we override this so don't create a new dynamic field instead of updating the existing field
@@ -81,16 +84,18 @@  discard block
 block discarded – undo
81 84
         $isClone = false;
82 85
         if(!empty($this->view_object_map['is_clone']) && $this->view_object_map['is_clone']
83 86
             && (strcmp($field_name, "name") != 0)   // bug #35767, do not allow cloning of name field
84
-            )
85
-            $isClone = true;
87
+            ) {
88
+                    $isClone = true;
89
+        }
86 90
 		/*
87 91
 		$field_types =  array('varchar'=>'YourField', 'int'=>'Integer', 'float'=>'Decimal','bool'=>'Checkbox','enum'=>'DropDown',
88 92
 				'date'=>'Date', 'phone' => 'Phone', 'currency' => 'Currency', 'html' => 'HTML', 'radioenum' => 'Radio',
89 93
 				'relate' => 'Relate', 'address' => 'Address', 'text' => 'TextArea', 'url' => 'Link');
90 94
 		*/
91 95
 		$field_types = $GLOBALS['mod_strings']['fieldTypes'];
92
-		if (isset($field_types['encrypt']))
93
-		  unset($field_types['encrypt']);
96
+		if (isset($field_types['encrypt'])) {
97
+				  unset($field_types['encrypt']);
98
+		}
94 99
         $field_name_exceptions = array(
95 100
             //bug 22264: Field name must not be an SQL keyword.
96 101
             //Taken from SQL Server's list of reserved keywords; http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx
@@ -163,12 +168,13 @@  discard block
 block discarded – undo
163 168
             }
164 169
           
165 170
             if(empty($vardef['name'])){
166
-                if(!empty($_REQUEST['type']))
167
-                    $vardef['type'] = $_REQUEST['type'];
171
+                if(!empty($_REQUEST['type'])) {
172
+                                    $vardef['type'] = $_REQUEST['type'];
173
+                }
168 174
                     $fv->ss->assign('hideLevel', 0);
169
-            }elseif(isset($vardef['custom_module'])){
175
+            } elseif(isset($vardef['custom_module'])){
170 176
                 $fv->ss->assign('hideLevel', 2);
171
-            }else{
177
+            } else{
172 178
                 $action = 'saveSugarField'; // tyoung - for OOB fields we currently only support modifying the label
173 179
                 $fv->ss->assign('hideLevel', 3);
174 180
             }
@@ -196,10 +202,14 @@  discard block
 block discarded – undo
196 202
             	}
197 203
                 if (!empty($def['type']) && $def['type'] == "enum" && $field != $vardef['name'])
198 204
                 {
199
-                    if(!empty($def['studio']) && $def['studio'] == "false") continue; //bug51866 
205
+                    if(!empty($def['studio']) && $def['studio'] == "false") {
206
+                        continue;
207
+                    }
208
+                    //bug51866 
200 209
                     $enumFields[$field] = translate($def['vname'], $moduleName);
201
-                    if (substr($enumFields[$field], -1) == ":")
202
-                        $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) - 1);
210
+                    if (substr($enumFields[$field], -1) == ":") {
211
+                                            $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) - 1);
212
+                    }
203 213
                 }
204 214
             }
205 215
             $fv->ss->assign( 'allowAutoInc', $allowAutoInc);   
@@ -209,8 +219,9 @@  discard block
 block discarded – undo
209 219
                 $fv->ss->assign('lbl_value', htmlentities(translate($vardef['vname'], $moduleName), ENT_QUOTES, 'UTF-8'));
210 220
             }
211 221
             $fv->ss->assign('module', $module);
212
-            if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
213
-				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
222
+            if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent')) {
223
+            				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
224
+            }
214 225
 
215 226
             $edit_or_add = 'editField' ;
216 227
 
@@ -232,14 +243,16 @@  discard block
 block discarded – undo
232 243
             }
233 244
 
234 245
             if(empty($vardef['name'])){
235
-                if(!empty($_REQUEST['type']))$vardef['type'] = $_REQUEST['type'];
246
+                if(!empty($_REQUEST['type'])) {
247
+                    $vardef['type'] = $_REQUEST['type'];
248
+                }
236 249
                     $fv->ss->assign('hideLevel', 0);
237
-            }else{
250
+            } else{
238 251
                 if(!empty($module->mbvardefs->vardef['fields'][$vardef['name']])){
239 252
                     $fv->ss->assign('hideLevel', 1);
240
-                }elseif(isset($vardef['custom_module'])){
253
+                } elseif(isset($vardef['custom_module'])){
241 254
                     $fv->ss->assign('hideLevel', 2);
242
-                }else{
255
+                } else{
243 256
                     $fv->ss->assign('hideLevel', 3); // tyoung bug 17350 - effectively mark template derived fields as readonly
244 257
                 }
245 258
             }
@@ -256,10 +269,12 @@  discard block
 block discarded – undo
256 269
             $fv->ss->assign('package', $package);
257 270
             $fv->ss->assign('MB','1');
258 271
 
259
-            if(isset($vardef['vname']))
260
-                $fv->ss->assign('lbl_value', htmlentities($module->getLabel('en_us',$vardef['vname']), ENT_QUOTES, 'UTF-8'));
261
-			if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
262
-				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
272
+            if(isset($vardef['vname'])) {
273
+                            $fv->ss->assign('lbl_value', htmlentities($module->getLabel('en_us',$vardef['vname']), ENT_QUOTES, 'UTF-8'));
274
+            }
275
+			if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent')) {
276
+							$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
277
+			}
263 278
 
264 279
             $enumFields = array();
265 280
             if (!empty($module->mbvardefs->vardefs['fields']))
@@ -270,8 +285,9 @@  discard block
 block discarded – undo
270 285
                     {
271 286
                         $enumFields[$field] = isset($module->mblanguage->strings[$current_language][$def['vname']]) ?
272 287
                             $this->mbModule->mblanguage->strings[$current_language][$def['vname']] : translate($field);
273
-                        if (substr($enumFields[$field], -1) == ":")
274
-                            $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) -1);
288
+                        if (substr($enumFields[$field], -1) == ":") {
289
+                                                    $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) -1);
290
+                        }
275 291
                     }
276 292
                 }
277 293
             }
@@ -296,9 +312,11 @@  discard block
 block discarded – undo
296 312
 		}
297 313
 		
298 314
         if((!empty($vardef['studio']) && is_array($vardef['studio']) && !empty($vardef['studio']['no_duplicate']) && $vardef['studio']['no_duplicate'] == true)
299
-           || (strcmp($field_name, "name") == 0) || (isset($vardef['type']) && $vardef['type'] == 'name')) // bug #35767, do not allow cloning of name field
315
+           || (strcmp($field_name, "name") == 0) || (isset($vardef['type']) && $vardef['type'] == 'name')) {
316
+            // bug #35767, do not allow cloning of name field
300 317
             {
301 318
                $fv->ss->assign('no_duplicate', true);
319
+        }
302 320
             }
303 321
 
304 322
         $fv->ss->assign('action',$action);
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.home.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -67,7 +67,9 @@
 block discarded – undo
67 67
 		$smarty->assign('assistant',$assistant);
68 68
 		//initialize Assistant's display property.
69 69
 		$userPref = $current_user->getPreference('mb_assist', 'Assistant');
70
-		if(!$userPref) $userPref="na";
70
+		if(!$userPref) {
71
+		    $userPref="na";
72
+		}
71 73
 		$smarty->assign('userPref',$userPref);
72 74
 		$ajax = new AjaxCompose();
73 75
 		$ajax->addSection('center', $mod_strings['LBL_HOME'],$smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
Please login to merge, or discard this patch.