Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/ModuleBuilder/views/view.property.php 1 patch
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -126,8 +126,9 @@
 block discarded – undo
126 126
         $smarty->assign('APP', $GLOBALS['app_strings']);
127 127
         $smarty->assign("view_module", $this->editModule);
128 128
         $smarty->assign("subpanel", $this->subpanel);
129
-        if (isset($this->editPackage))
130
-            $smarty->assign("view_package", $this->editPackage);       
129
+        if (isset($this->editPackage)) {
130
+                    $smarty->assign("view_package", $this->editPackage);
131
+        }
131 132
 
132 133
         $ajax->addSection('east', translate('LBL_SECTION_PROPERTIES', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/editProperty.tpl'));
133 134
         echo $ajax->getJavascript();
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.resetmodule.php 1 patch
Braces   +21 added lines, -13 removed lines patch added patch discarded remove patch
@@ -95,20 +95,25 @@  discard block
 block discarded – undo
95 95
     {
96 96
         $out = "<script>ajaxStatus.flashStatus(SUGAR.language.get('app_strings', 'LBL_REQUEST_PROCESSED'), 2000);</script>";
97 97
         
98
-        if (!empty($_REQUEST['relationships']))
99
-            $out .= $this->removeCustomRelationships();
98
+        if (!empty($_REQUEST['relationships'])) {
99
+                    $out .= $this->removeCustomRelationships();
100
+        }
100 101
             
101
-        if (!empty($_REQUEST['fields']))
102
-            $out .= $this->removeCustomFields();
102
+        if (!empty($_REQUEST['fields'])) {
103
+                    $out .= $this->removeCustomFields();
104
+        }
103 105
             
104
-        if (!empty($_REQUEST['layouts']))
105
-            $out .= $this->removeCustomLayouts();
106
+        if (!empty($_REQUEST['layouts'])) {
107
+                    $out .= $this->removeCustomLayouts();
108
+        }
106 109
 			
107
-		if (!empty($_REQUEST['labels']))
108
-            $out .= $this->removeCustomLabels();
110
+		if (!empty($_REQUEST['labels'])) {
111
+		            $out .= $this->removeCustomLabels();
112
+		}
109 113
 			
110
-		if (!empty($_REQUEST['extensions']))
111
-            $out .= $this->removeCustomExtensions();	
114
+		if (!empty($_REQUEST['extensions'])) {
115
+		            $out .= $this->removeCustomExtensions();
116
+		}
112 117
 			
113 118
         
114 119
         $out .= "Complete!";
@@ -209,8 +214,9 @@  discard block
 block discarded – undo
209 214
                 $out .= "Removed relationship $relationshipName<br/>";
210 215
             }
211 216
         }
212
-        if ($madeChanges)
213
-           $relationships->save () ;
217
+        if ($madeChanges) {
218
+                   $relationships->save () ;
219
+        }
214 220
         
215 221
         return $out;
216 222
     }
@@ -222,7 +228,9 @@  discard block
 block discarded – undo
222 228
         if (is_dir($languageDir)) {
223 229
             $files = scandir($languageDir);
224 230
             foreach ($files as $langFile) {
225
-                if (substr($langFile, 0 ,1) == '.') continue;
231
+                if (substr($langFile, 0 ,1) == '.') {
232
+                    continue;
233
+                }
226 234
 				$language = substr($langFile, 0, strlen($langFile) - 9);
227 235
 				unlink($languageDir . "/" . $langFile);
228 236
 				
Please login to merge, or discard this patch.
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.main.php 1 patch
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -101,7 +101,9 @@
 block discarded – undo
101 101
 			$smarty->assign('TREElabel', $mbt->getName());
102 102
 		}
103 103
 		$userPref = $current_user->getPreference('mb_assist', 'Assistant');
104
-		if(!$userPref) $userPref="na"; 
104
+		if(!$userPref) {
105
+		    $userPref="na";
106
+		}
105 107
 		$smarty->assign('userPref',$userPref);
106 108
 		
107 109
 		///////////////////////////////////
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.layoutview.php 1 patch
Braces   +8 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
 /*********************************************************************************
6 7
  * SugarCRM Community Edition is a customer relationship management program developed by
@@ -255,9 +256,9 @@  discard block
 block discarded – undo
255 256
         $ajax = new AjaxCompose ( ) ;
256 257
 
257 258
         $translatedViewType = '' ;
258
-		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) )
259
-			$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
260
-        else if (isset($this->sm))
259
+		if ( isset ( $labels [ strtolower ( $this->editLayout ) ] ) ) {
260
+					$translatedViewType = translate ( $labels [ strtolower( $this->editLayout ) ] , 'ModuleBuilder' ) ;
261
+		} else if (isset($this->sm))
261 262
         {
262 263
             foreach($this->sm->sources as $file => $def)
263 264
             {
@@ -270,8 +271,9 @@  discard block
 block discarded – undo
270 271
             {
271 272
                 $label = "LBL_" . strtoupper($this->editLayout);
272 273
                 $translated = translate($label, $this->editModule);
273
-                if ($translated != $label)
274
-                    $translatedViewType =  $translated;
274
+                if ($translated != $label) {
275
+                                    $translatedViewType =  $translated;
276
+                }
275 277
             }
276 278
         }
277 279
 
Please login to merge, or discard this patch.