Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/ModuleBuilder/views/view.labels.php 1 patch
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	    global $mod_strings;
56 56
 
57 57
     	return array(
58
-    	   translate('LBL_MODULE_NAME','Administration'),
58
+    	   translate('LBL_MODULE_NAME', 'Administration'),
59 59
     	   ModuleBuilderController::getModuleTitle(),
60 60
     	   );
61 61
     }
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
  	function display()
66 66
  	{
67 67
 		$editModule = $_REQUEST['view_module'];
68
-		$allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels']== 'all');
68
+		$allLabels = (!empty($_REQUEST['labels']) && $_REQUEST['labels'] == 'all');
69 69
 
70 70
  		if (!isset($_REQUEST['MB']))
71 71
 		{
@@ -73,15 +73,15 @@  discard block
 block discarded – undo
73 73
 		    $moduleNames = array_change_key_case($app_list_strings['moduleList']);
74 74
 		    $translatedEditModule = $moduleNames[strtolower($editModule)];
75 75
 		}
76
-		$selected_lang = (!empty($_REQUEST['selected_lang'])? $_REQUEST['selected_lang']:$_SESSION['authenticated_user_language']);
77
-		if(empty($selected_lang)){
76
+		$selected_lang = (!empty($_REQUEST['selected_lang']) ? $_REQUEST['selected_lang'] : $_SESSION['authenticated_user_language']);
77
+		if (empty($selected_lang)) {
78 78
 		    $selected_lang = $GLOBALS['sugar_config']['default_language'];
79 79
 		}
80 80
 
81 81
 		$smarty = new Sugar_Smarty();
82 82
 		global $mod_strings;
83 83
         $smarty->assign('mod_strings', $mod_strings);
84
-		$smarty->assign('available_languages',get_languages());
84
+		$smarty->assign('available_languages', get_languages());
85 85
 
86 86
 
87 87
         $objectName = BeanFactory::getObjectName($editModule);
@@ -89,28 +89,28 @@  discard block
 block discarded – undo
89 89
         global $dictionary;
90 90
         $vnames = array();
91 91
 		//jchi 24557 . We should list all the lables in viewdefs(list,detail,edit,quickcreate) that the user can edit them.
92
-		require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php' ;
93
-        $parser = new ListLayoutMetaDataParser ( MB_LISTVIEW, $editModule ) ;
94
-        foreach ( $parser->getLayout() as $key => $def )
92
+		require_once 'modules/ModuleBuilder/parsers/views/ListLayoutMetaDataParser.php';
93
+        $parser = new ListLayoutMetaDataParser(MB_LISTVIEW, $editModule);
94
+        foreach ($parser->getLayout() as $key => $def)
95 95
         {
96
-        	if(isset($def['label']) ) {
96
+        	if (isset($def['label'])) {
97 97
                $vnames[$def['label']] = $def['label'];
98 98
         	}
99 99
         }
100 100
 
101
-       require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php' ;
101
+       require_once 'modules/ModuleBuilder/parsers/views/GridLayoutMetaDataParser.php';
102 102
         $variableMap = $this->getVariableMap($editModule);
103
-        foreach($variableMap as $key => $value){
104
-        	$gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser ( $value, $editModule) ;
105
-        	foreach ( $gridLayoutMetaDataParserTemp->getLayout() as $panel)
103
+        foreach ($variableMap as $key => $value) {
104
+        	$gridLayoutMetaDataParserTemp = new GridLayoutMetaDataParser($value, $editModule);
105
+        	foreach ($gridLayoutMetaDataParserTemp->getLayout() as $panel)
106 106
 	        {
107
-	                foreach ( $panel as $row )
107
+	                foreach ($panel as $row)
108 108
 	                {
109
-	                    foreach ( $row as $fieldArray )
109
+	                    foreach ($row as $fieldArray)
110 110
 	                    { // fieldArray is an array('name'=>name,'label'=>label)
111
-	                        if (isset ( $fieldArray [ 'label' ] ))
111
+	                        if (isset ($fieldArray ['label']))
112 112
 	                        {
113
-	                            $vnames[$fieldArray [ 'label' ] ] = $fieldArray [ 'label' ] ;
113
+	                            $vnames[$fieldArray ['label']] = $fieldArray ['label'];
114 114
 	                        }
115 115
 	                    }
116 116
 	                }
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
         //end
120 120
 
121 121
         //Get Subpanel Labels:
122
-        require_once ('include/SubPanel/SubPanel.php') ;
123
-        $subList =  SubPanel::getModuleSubpanels ( $editModule );
124
-        foreach($subList as $subpanel => $titleLabel) {
122
+        require_once ('include/SubPanel/SubPanel.php');
123
+        $subList = SubPanel::getModuleSubpanels($editModule);
124
+        foreach ($subList as $subpanel => $titleLabel) {
125 125
         	$vnames[$titleLabel] = $titleLabel;
126 126
         }
127 127
 
128
-        foreach($dictionary[$objectName]['fields'] as $name=>$def) {
129
-        	if(isset($def['vname'])) {
128
+        foreach ($dictionary[$objectName]['fields'] as $name=>$def) {
129
+        	if (isset($def['vname'])) {
130 130
                $vnames[$def['vname']] = $def['vname'];
131 131
         	}
132 132
 		}
@@ -134,9 +134,9 @@  discard block
 block discarded – undo
134 134
 
135 135
  	    //we shouldn't set the $refresh=true here, or will lost template language mod_strings.
136 136
  	    //return_module_language($selected_lang, $editModule,false) : the mod_strings will be included from cache files here.
137
-        foreach(return_module_language($selected_lang, $editModule,false) as $name=>$label) {
137
+        foreach (return_module_language($selected_lang, $editModule, false) as $name=>$label) {
138 138
         		//#25294
139
-        	 	if($allLabels || isset($vnames[$name]) || preg_match( '/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si' , $name)) {
139
+        	 	if ($allLabels || isset($vnames[$name]) || preg_match('/lbl_city|lbl_country|lbl_billing_address|lbl_alt_address|lbl_shipping_address|lbl_postal_code|lbl_state$/si', $name)) {
140 140
                     $formatted_mod_strings[$name] = htmlentities($label, ENT_QUOTES, 'UTF-8');
141 141
         	 	}
142 142
         }
@@ -146,12 +146,12 @@  discard block
 block discarded – undo
146 146
             "custom/modules/$editModule/language/$selected_lang.lang.php",
147 147
             "custom/modules/$editModule/Ext/Language/$selected_lang.lang.ext.php"
148 148
         );
149
-        foreach($files as $langfile){
149
+        foreach ($files as $langfile) {
150 150
         	$mod_strings = array();
151 151
         	if (is_file($langfile))
152 152
         	{
153 153
         	   include($langfile);
154
-        	   foreach($mod_strings as $key => $label)
154
+        	   foreach ($mod_strings as $key => $label)
155 155
         	   {
156 156
                     $formatted_mod_strings[$key] = htmlentities($label, ENT_QUOTES, 'UTF-8');
157 157
         	   }
@@ -166,7 +166,7 @@  discard block
 block discarded – undo
166 166
 		$smarty->assign('defaultHelp', 'labelsBtn');
167 167
 		$smarty->assign('assistant', array('key'=>'labels', 'group'=>'module'));
168 168
 		$smarty->assign('labels_choice', $mod_strings['labelTypes']);
169
-		$smarty->assign('labels_current', $allLabels?"all":"");
169
+		$smarty->assign('labels_current', $allLabels ? "all" : "");
170 170
 
171 171
 		$ajax = new AjaxCompose();
172 172
 		$ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
@@ -191,17 +191,17 @@  discard block
 block discarded – undo
191 191
                                            'Quotes',
192 192
                                            'ProductTemplates');
193 193
         
194
-        if(in_array($module, $hideQuickCreateForModules))
194
+        if (in_array($module, $hideQuickCreateForModules))
195 195
         {
196
-            if(isset($variableMap['quickcreate']))
196
+            if (isset($variableMap['quickcreate']))
197 197
             {
198 198
                 unset($variableMap['quickcreate']);
199 199
             }
200 200
         }
201 201
         
202
-        if($module == 'KBDocuments')
202
+        if ($module == 'KBDocuments')
203 203
         {
204
-            $variableMap  = array();
204
+            $variableMap = array();
205 205
         }
206 206
         
207 207
         return $variableMap;
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulefields.php 1 patch
Spacing   +30 added lines, -30 removed lines patch added patch discarded remove patch
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 	    global $mod_strings;
53 53
 	    
54 54
     	return array(
55
-    	   translate('LBL_MODULE_NAME','Administration'),
55
+    	   translate('LBL_MODULE_NAME', 'Administration'),
56 56
     	   ModuleBuilderController::getModuleTitle(),
57 57
     	   );
58 58
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
 	{
62 62
         $smarty = new Sugar_Smarty();
63 63
         global $mod_strings;
64
-        $bak_mod_strings=$mod_strings;
64
+        $bak_mod_strings = $mod_strings;
65 65
         $smarty->assign('mod_strings', $mod_strings);
66 66
 
67 67
         $module_name = $_REQUEST['view_module'];
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
         //add datetimecombo type field from the vardef overrides to point to Datetime type
78 78
         $fieldTypes['datetime'] = $fieldTypes['datetimecombo'];
79 79
 
80
-        if(!isset($_REQUEST['view_package']) || $_REQUEST['view_package'] == 'studio') {
80
+        if (!isset($_REQUEST['view_package']) || $_REQUEST['view_package'] == 'studio') {
81 81
             //$this->loadPackageHelp($module_name);
82 82
             $studioClass = new stdClass;
83 83
             $studioClass->name = $module_name;
@@ -88,12 +88,12 @@  discard block
 block discarded – undo
88 88
             global $dictionary;
89 89
             $f = array($mod_strings['LBL_HCUSTOM']=>array(), $mod_strings['LBL_HDEFAULT']=>array());
90 90
 
91
-            foreach($dictionary[$objectName]['fields'] as $def) {
91
+            foreach ($dictionary[$objectName]['fields'] as $def) {
92 92
                 if ($this->isValidStudioField($def))
93 93
                 {
94 94
                     $def['label'] = translate($def['vname'], $module_name);
95 95
 					//Custom relate fields will have a non-db source, but custom_module set
96
-                	if(isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) {
96
+                	if (isset($def['source']) && $def['source'] == 'custom_fields' || isset($def['custom_module'])) {
97 97
                        $f[$mod_strings['LBL_HCUSTOM']][$def['name']] = $def;
98 98
                        $def['custom'] = true;
99 99
                     } else {
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
             $ajax->addCrumb($mod_strings['LBL_STUDIO'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard")');
123 123
             $ajax->addCrumb(translate($module_name), 'ModuleBuilder.getContent("module=ModuleBuilder&action=wizard&view_module='.$module_name.'")');
124 124
             $ajax->addCrumb($mod_strings['LBL_FIELDS'], '');
125
-            $ajax->addSection('center', $mod_strings['LBL_EDIT_FIELDS'],$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/fields.tpl'));
125
+            $ajax->addSection('center', $mod_strings['LBL_EDIT_FIELDS'], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/fields.tpl'));
126 126
             $_REQUEST['field'] = '';
127 127
 
128 128
             echo $ajax->getJavascript();
@@ -139,20 +139,20 @@  discard block
 block discarded – undo
139 139
             $this->mbModule->mbvardefs->vardefs['fields'] = array_reverse($this->mbModule->mbvardefs->vardefs['fields'], true);
140 140
             $loadedFields = array();
141 141
 
142
-            if(file_exists($this->mbModule->path. '/language/'.$current_language.'.lang.php'))
142
+            if (file_exists($this->mbModule->path.'/language/'.$current_language.'.lang.php'))
143 143
             {
144
-                include($this->mbModule->path .'/language/'.$current_language.'.lang.php');
145
-                $this->mbModule->setModStrings($current_language,$mod_strings);
146
-            }elseif(file_exists($this->mbModule->path. '/language/en_us.lang.php')){
147
-                include($this->mbModule->path .'/language/en_us.lang.php');
148
-                $this->mbModule->setModStrings('en_us',$mod_strings);
144
+                include($this->mbModule->path.'/language/'.$current_language.'.lang.php');
145
+                $this->mbModule->setModStrings($current_language, $mod_strings);
146
+            }elseif (file_exists($this->mbModule->path.'/language/en_us.lang.php')) {
147
+                include($this->mbModule->path.'/language/en_us.lang.php');
148
+                $this->mbModule->setModStrings('en_us', $mod_strings);
149 149
             }
150 150
 
151
-            foreach($this->mbModule->mbvardefs->vardefs['fields'] as $k=>$v)
151
+            foreach ($this->mbModule->mbvardefs->vardefs['fields'] as $k=>$v)
152 152
             {
153 153
                 if ($k != $this->mbModule->name)
154 154
                 {
155
-                    foreach($v as $field => $def)
155
+                    foreach ($v as $field => $def)
156 156
                     {
157 157
                         if (in_array($field, array_keys($this->mbModule->mbvardefs->vardefs['fields'][$this->mbModule->name])))
158 158
                         {
@@ -164,15 +164,15 @@  discard block
 block discarded – undo
164 164
                 }
165 165
             }
166 166
 
167
-            foreach($this->mbModule->mbvardefs->vardefs['fields'] as $k=>$v)
167
+            foreach ($this->mbModule->mbvardefs->vardefs['fields'] as $k=>$v)
168 168
             {
169
-                if($k != $module_name)
169
+                if ($k != $module_name)
170 170
                 {
171
-                    $titleLBL[$k]=translate("LBL_".strtoupper($k),'ModuleBuilder');
172
-                }else{
173
-                    $titleLBL[$k]=$k;
171
+                    $titleLBL[$k] = translate("LBL_".strtoupper($k), 'ModuleBuilder');
172
+                } else {
173
+                    $titleLBL[$k] = $k;
174 174
                 }
175
-                foreach($v as $field => $def)
175
+                foreach ($v as $field => $def)
176 176
                 {
177 177
                 	if (isset($loadedFields[$field]))
178 178
                     {
@@ -199,15 +199,15 @@  discard block
 block discarded – undo
199 199
             $smarty->assign('title', $titleLBL);
200 200
             $smarty->assign('package', $package);
201 201
             $smarty->assign('module', $this->mbModule);
202
-            $smarty->assign('editLabelsMb','1');
202
+            $smarty->assign('editLabelsMb', '1');
203 203
             $smarty->assign('studio', false);
204 204
 
205 205
             $ajax = new AjaxCompose();
206 206
             $ajax->addCrumb($bak_mod_strings['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
207
-            $ajax->addCrumb($package->name,'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
208
-            $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='. $module_name . '")');
207
+            $ajax->addCrumb($package->name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$package->name.'")');
208
+            $ajax->addCrumb($module_name, 'ModuleBuilder.getContent("module=ModuleBuilder&action=module&view_package='.$package->name.'&view_module='.$module_name.'")');
209 209
             $ajax->addCrumb($bak_mod_strings['LBL_FIELDS'], '');
210
-            $ajax->addSection('center', $bak_mod_strings["LBL_FIELDS"],$smarty->fetch('modules/ModuleBuilder/tpls/MBModule/fields.tpl'));
210
+            $ajax->addSection('center', $bak_mod_strings["LBL_FIELDS"], $smarty->fetch('modules/ModuleBuilder/tpls/MBModule/fields.tpl'));
211 211
             $_REQUEST['field'] = '';
212 212
 
213 213
             echo $ajax->getJavascript();
@@ -220,7 +220,7 @@  discard block
 block discarded – undo
220 220
         $name
221 221
         )
222 222
     {
223
-        $this->mbModule->help['default'] = (empty($name))?'create':'modify';
223
+        $this->mbModule->help['default'] = (empty($name)) ? 'create' : 'modify';
224 224
         $this->mbModule->help['group'] = 'module';
225 225
         $this->mbModule->help['group'] = 'module';
226 226
     }
@@ -229,11 +229,11 @@  discard block
 block discarded – undo
229 229
         $def
230 230
         )
231 231
     {
232
-        if(!empty($def['parent_id']))
232
+        if (!empty($def['parent_id']))
233 233
             unset($def['parent_id']);
234
-        if(!empty($def['parent_type']))
234
+        if (!empty($def['parent_type']))
235 235
             unset($def['parent_type']);
236
-        if(!empty($def['currency_id']))
236
+        if (!empty($def['currency_id']))
237 237
             unset($def['currency_id']);
238 238
         return $def;
239 239
     }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
         )
244 244
 	{
245 245
     	if (isset($def['studio'])) {
246
-            if (is_array($def [ 'studio' ]))
246
+            if (is_array($def ['studio']))
247 247
             {
248 248
     			if (isset($def['studio']['editField']) && $def['studio']['editField'] == true)
249 249
                     return true;
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
     		{
255 255
     			if ($def['studio'] == 'visible')
256 256
                     return true;
257
-                if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'] )
257
+                if ($def['studio'] == 'hidden' || $def['studio'] == 'false' || !$def['studio'])
258 258
                     return false;
259 259
             }
260 260
         }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.modulefield.php 1 patch
Spacing   +81 added lines, -81 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	    global $mod_strings;
51 51
 	    
52 52
     	return array(
53
-    	   translate('LBL_MODULE_NAME','Administration'),
53
+    	   translate('LBL_MODULE_NAME', 'Administration'),
54 54
     	   ModuleBuilderController::getModuleTitle(),
55 55
     	   );
56 56
     }
@@ -66,11 +66,11 @@  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']))$_REQUEST['field'] = $_REQUEST['name'];
70 70
         $field_name = '';
71
-        if(!empty($this->view_object_map['field_name']))
71
+        if (!empty($this->view_object_map['field_name']))
72 72
             $field_name = $this->view_object_map['field_name'];
73
-        elseif(!empty($_REQUEST['field']))
73
+        elseif (!empty($_REQUEST['field']))
74 74
             $field_name = $_REQUEST['field'];
75 75
         else
76 76
             $field_name = '';
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
                                // fields we override this so don't create a new dynamic field instead of updating the existing field
80 80
 
81 81
         $isClone = false;
82
-        if(!empty($this->view_object_map['is_clone']) && $this->view_object_map['is_clone']
82
+        if (!empty($this->view_object_map['is_clone']) && $this->view_object_map['is_clone']
83 83
             && (strcmp($field_name, "name") != 0)   // bug #35767, do not allow cloning of name field
84 84
             )
85 85
             $isClone = true;
@@ -94,21 +94,21 @@  discard block
 block discarded – undo
94 94
         $field_name_exceptions = array(
95 95
             //bug 22264: Field name must not be an SQL keyword.
96 96
             //Taken from SQL Server's list of reserved keywords; http://msdn.microsoft.com/en-us/library/aa238507(SQL.80).aspx
97
-            'ADD','EXCEPT','PERCENT','ALL','EXEC','PLAN','ALTER','EXECUTE','PRECISION','AND','EXISTS','PRIMARY',
98
-            'ANY','EXIT','PRINT','AS','FETCH','PROC','ASC','FILE','PROCEDURE','AUTHORIZATION','FILLFACTOR','PUBLIC',
99
-            'BACKUP','FOR','RAISERROR','BEGIN','FOREIGN','READ','BETWEEN','FREETEXT','READTEXT','BREAK','FREETEXTTABLE',
100
-            'RECONFIGURE','BROWSE','FROM','REFERENCES','BULK','FULL','REPLICATION','BY','FUNCTION','RESTORE',
101
-            'CASCADE','GOTO','RESTRICT','CASE','GRANT','RETURN','CHECK','GROUP','REVOKE','CHECKPOINT','HAVING','RIGHT','CLOSE',
102
-            'HOLDLOCK','ROLLBACK','CLUSTERED','IDENTITY','ROWCOUNT','COALESCE','IDENTITY_INSERT','ROWGUIDCOL','COLLATE','IDENTITYCOL',
103
-            'RULE','COLUMN','IF','SAVE','COMMIT','IN','SCHEMA','COMPUTE','INDEX','SELECT','CONSTRAINT','INNER','SESSION_USER',
104
-            'CONTAINS','INSERT','SET','CONTAINSTABLE','INTERSECT','SETUSER','CONTINUE','INTO','SHUTDOWN','CONVERT','IS','SOME',
105
-            'CREATE','JOIN','STATISTICS','CROSS','KEY','SYSTEM_USER','CURRENT','KILL','TABLE','CURRENT_DATE','LEFT','TEXTSIZE',
106
-            'CURRENT_TIME','LIKE','THEN','CURRENT_TIMESTAMP','LINENO','TO','CURRENT_USER','LOAD','TOP','CURSOR','NATIONAL','TRAN',
107
-            'DATABASE','NOCHECK','TRANSACTION','DBCC','NONCLUSTERED','TRIGGER','DEALLOCATE','NOT','TRUNCATE','DECLARE','NULL','TSEQUAL',
108
-            'DEFAULT','NULLIF','UNION','DELETE','OF','UNIQUE','DENY','OFF','UPDATE','DESC','OFFSETS','UPDATETEXT',
109
-            'DISK','ON','USE','DISTINCT','OPEN','USER','DISTRIBUTED','OPENCONNECTOR','VALUES','DOUBLE','OPENQUERY','VARYING',
110
-            'DROP','OPENROWSET','VIEW','DUMMY','OPENXML','WAITFOR','DUMP','OPTION','WHEN','ELSE','OR','WHERE',
111
-            'END','ORDER','WHILE','ERRLVL','OUTER','WITH','ESCAPE','OVER','WRITETEXT',
97
+            'ADD', 'EXCEPT', 'PERCENT', 'ALL', 'EXEC', 'PLAN', 'ALTER', 'EXECUTE', 'PRECISION', 'AND', 'EXISTS', 'PRIMARY',
98
+            'ANY', 'EXIT', 'PRINT', 'AS', 'FETCH', 'PROC', 'ASC', 'FILE', 'PROCEDURE', 'AUTHORIZATION', 'FILLFACTOR', 'PUBLIC',
99
+            'BACKUP', 'FOR', 'RAISERROR', 'BEGIN', 'FOREIGN', 'READ', 'BETWEEN', 'FREETEXT', 'READTEXT', 'BREAK', 'FREETEXTTABLE',
100
+            'RECONFIGURE', 'BROWSE', 'FROM', 'REFERENCES', 'BULK', 'FULL', 'REPLICATION', 'BY', 'FUNCTION', 'RESTORE',
101
+            'CASCADE', 'GOTO', 'RESTRICT', 'CASE', 'GRANT', 'RETURN', 'CHECK', 'GROUP', 'REVOKE', 'CHECKPOINT', 'HAVING', 'RIGHT', 'CLOSE',
102
+            'HOLDLOCK', 'ROLLBACK', 'CLUSTERED', 'IDENTITY', 'ROWCOUNT', 'COALESCE', 'IDENTITY_INSERT', 'ROWGUIDCOL', 'COLLATE', 'IDENTITYCOL',
103
+            'RULE', 'COLUMN', 'IF', 'SAVE', 'COMMIT', 'IN', 'SCHEMA', 'COMPUTE', 'INDEX', 'SELECT', 'CONSTRAINT', 'INNER', 'SESSION_USER',
104
+            'CONTAINS', 'INSERT', 'SET', 'CONTAINSTABLE', 'INTERSECT', 'SETUSER', 'CONTINUE', 'INTO', 'SHUTDOWN', 'CONVERT', 'IS', 'SOME',
105
+            'CREATE', 'JOIN', 'STATISTICS', 'CROSS', 'KEY', 'SYSTEM_USER', 'CURRENT', 'KILL', 'TABLE', 'CURRENT_DATE', 'LEFT', 'TEXTSIZE',
106
+            'CURRENT_TIME', 'LIKE', 'THEN', 'CURRENT_TIMESTAMP', 'LINENO', 'TO', 'CURRENT_USER', 'LOAD', 'TOP', 'CURSOR', 'NATIONAL', 'TRAN',
107
+            'DATABASE', 'NOCHECK', 'TRANSACTION', 'DBCC', 'NONCLUSTERED', 'TRIGGER', 'DEALLOCATE', 'NOT', 'TRUNCATE', 'DECLARE', 'NULL', 'TSEQUAL',
108
+            'DEFAULT', 'NULLIF', 'UNION', 'DELETE', 'OF', 'UNIQUE', 'DENY', 'OFF', 'UPDATE', 'DESC', 'OFFSETS', 'UPDATETEXT',
109
+            'DISK', 'ON', 'USE', 'DISTINCT', 'OPEN', 'USER', 'DISTRIBUTED', 'OPENCONNECTOR', 'VALUES', 'DOUBLE', 'OPENQUERY', 'VARYING',
110
+            'DROP', 'OPENROWSET', 'VIEW', 'DUMMY', 'OPENXML', 'WAITFOR', 'DUMP', 'OPTION', 'WHEN', 'ELSE', 'OR', 'WHERE',
111
+            'END', 'ORDER', 'WHILE', 'ERRLVL', 'OUTER', 'WITH', 'ESCAPE', 'OVER', 'WRITETEXT',
112 112
             //Mysql Keywords from http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html (those not in MSSQL's list)
113 113
 			'ANALYZE', 'ASENSITIVE', 'BEFORE', 'BIGINT', 'BINARY', 'BOTH', 'CALL', 'CHANGE', 'CHARACTER',
114 114
 			'CONDITION', 'DATABASES', 'DAY_HOUR', 'DAY_MICROSECOND', 'DAY_MINUTE', 'DAY_SECOND', 'DEC', 'DECIMAL', 'DELAYED',
@@ -125,8 +125,8 @@  discard block
 block discarded – undo
125 125
 			'TRAILING', 'TRUE', 'UNDO', 'UNLOCK', 'UNSIGNED', 'USAGE', 'USING', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP',
126 126
 			'VARBINARY', 'VARCHARACTER', 'WRITE', 'XOR', 'YEAR_MONTH', 'ZEROFILL', 'CONNECTION', 'LABEL', 'UPGRADE',
127 127
 			//Oracle datatypes
128
-            'DATE','VARCHAR','VARCHAR2','NVARCHAR2','CHAR','NCHAR','NUMBER','PLS_INTEGER','BINARY_INTEGER','LONG','TIMESTAMP',
129
-			'INTERVAL','RAW','ROWID','UROWID','MLSLABEL','CLOB','NCLOB','BLOB','BFILE','XMLTYPE',
128
+            'DATE', 'VARCHAR', 'VARCHAR2', 'NVARCHAR2', 'CHAR', 'NCHAR', 'NUMBER', 'PLS_INTEGER', 'BINARY_INTEGER', 'LONG', 'TIMESTAMP',
129
+			'INTERVAL', 'RAW', 'ROWID', 'UROWID', 'MLSLABEL', 'CLOB', 'NCLOB', 'BLOB', 'BFILE', 'XMLTYPE',
130 130
 			//SugarCRM reserved
131 131
         	'ID', 'ID_C', 'PARENT_NAME', 'PARENT_ID',
132 132
 			);
@@ -134,50 +134,50 @@  discard block
 block discarded – undo
134 134
 
135 135
         //C.L. - Add support to mark related module id columns as reserved keywords
136 136
         require_once 'modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php';
137
-        $relatedModules = array_keys(DeployedRelationships::findRelatableModules()) ;
137
+        $relatedModules = array_keys(DeployedRelationships::findRelatableModules());
138 138
         global $beanList, $current_language;
139
-        foreach($relatedModules as $relModule)
139
+        foreach ($relatedModules as $relModule)
140 140
         {
141
-            if(isset($beanList[$relModule]))
141
+            if (isset($beanList[$relModule]))
142 142
             {
143
-                $field_name_exceptions[] = strtoupper($beanList[$relModule]) . '_ID';
143
+                $field_name_exceptions[] = strtoupper($beanList[$relModule]).'_ID';
144 144
             }
145 145
         }
146 146
 
147
-        if(empty($_REQUEST['view_package']) || $_REQUEST['view_package'] == 'studio') {
147
+        if (empty($_REQUEST['view_package']) || $_REQUEST['view_package'] == 'studio') {
148 148
             $moduleName = $_REQUEST['view_module'];
149 149
             $objectName = BeanFactory::getObjectName($moduleName);
150 150
             $module = BeanFactory::getBean($moduleName);
151 151
 
152
-            VardefManager::loadVardef($moduleName, $objectName,true);
152
+            VardefManager::loadVardef($moduleName, $objectName, true);
153 153
             global $dictionary;
154
-            $module->mbvardefs->vardefs =  $dictionary[$objectName];
154
+            $module->mbvardefs->vardefs = $dictionary[$objectName];
155 155
 			
156 156
             $module->name = $moduleName;
157
-            if(!$ac){
157
+            if (!$ac) {
158 158
                 $ac = new AjaxCompose();
159 159
             }
160
-            $vardef = (!empty($module->mbvardefs->vardefs['fields'][$field_name]))? $module->mbvardefs->vardefs['fields'][$field_name]: array();
161
-            if($isClone){
160
+            $vardef = (!empty($module->mbvardefs->vardefs['fields'][$field_name])) ? $module->mbvardefs->vardefs['fields'][$field_name] : array();
161
+            if ($isClone) {
162 162
                 unset($vardef['name']);
163 163
             }
164 164
           
165
-            if(empty($vardef['name'])){
166
-                if(!empty($_REQUEST['type']))
165
+            if (empty($vardef['name'])) {
166
+                if (!empty($_REQUEST['type']))
167 167
                     $vardef['type'] = $_REQUEST['type'];
168 168
                     $fv->ss->assign('hideLevel', 0);
169
-            }elseif(isset($vardef['custom_module'])){
169
+            }elseif (isset($vardef['custom_module'])) {
170 170
                 $fv->ss->assign('hideLevel', 2);
171
-            }else{
171
+            } else {
172 172
                 $action = 'saveSugarField'; // tyoung - for OOB fields we currently only support modifying the label
173 173
                 $fv->ss->assign('hideLevel', 3);
174 174
             }
175
-            if($isClone && isset($vardef['type']) && $vardef['type'] == 'datetime'){
175
+            if ($isClone && isset($vardef['type']) && $vardef['type'] == 'datetime') {
176 176
             	$vardef['type'] = 'datetimecombo';
177 177
             }
178 178
             
179
-			require_once ('modules/DynamicFields/FieldCases.php') ;
180
-            $tf = get_widget ( empty($vardef [ 'type' ]) ?  "" : $vardef [ 'type' ]) ;
179
+			require_once ('modules/DynamicFields/FieldCases.php');
180
+            $tf = get_widget(empty($vardef ['type']) ? "" : $vardef ['type']);
181 181
             $tf->module = $module;
182 182
             $tf->populateFromRow($vardef);
183 183
 			$vardef = array_merge($vardef, $tf->get_field_def());
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
             //Check if autoincrement fields are allowed
189 189
             $allowAutoInc = true;
190 190
             $enumFields = array();
191
-            foreach($module->field_defs as $field => $def)
191
+            foreach ($module->field_defs as $field => $def)
192 192
             {
193 193
             	if (!empty($def['type']) && $def['type'] == "int" && !empty($def['auto_increment'])) {
194 194
             	   $allowAutoInc = false;
@@ -196,56 +196,56 @@  discard block
 block discarded – undo
196 196
             	}
197 197
                 if (!empty($def['type']) && $def['type'] == "enum" && $field != $vardef['name'])
198 198
                 {
199
-                    if(!empty($def['studio']) && $def['studio'] == "false") continue; //bug51866 
199
+                    if (!empty($def['studio']) && $def['studio'] == "false") continue; //bug51866 
200 200
                     $enumFields[$field] = translate($def['vname'], $moduleName);
201 201
                     if (substr($enumFields[$field], -1) == ":")
202 202
                         $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) - 1);
203 203
                 }
204 204
             }
205
-            $fv->ss->assign( 'allowAutoInc', $allowAutoInc);   
205
+            $fv->ss->assign('allowAutoInc', $allowAutoInc);   
206 206
 
207
-            $GLOBALS['log']->warn('view.modulefield: hidelevel '.$fv->ss->get_template_vars('hideLevel')." ".print_r($vardef,true));
208
-            if(!empty($vardef['vname'])){
207
+            $GLOBALS['log']->warn('view.modulefield: hidelevel '.$fv->ss->get_template_vars('hideLevel')." ".print_r($vardef, true));
208
+            if (!empty($vardef['vname'])) {
209 209
                 $fv->ss->assign('lbl_value', htmlentities(translate($vardef['vname'], $moduleName), ENT_QUOTES, 'UTF-8'));
210 210
             }
211 211
             $fv->ss->assign('module', $module);
212
-            if(empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
212
+            if (empty($module->mbvardefs->vardefs['fields']['parent_name']) || (isset($vardef['type']) && $vardef['type'] == 'parent'))
213 213
 				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
214 214
 
215
-            $edit_or_add = 'editField' ;
215
+            $edit_or_add = 'editField';
216 216
 
217 217
         } else
218 218
         {
219 219
             require_once('modules/ModuleBuilder/MB/ModuleBuilder.php');
220 220
             $mb = new ModuleBuilder();
221 221
             $moduleName = $_REQUEST['view_module'];
222
-            $module =& $mb->getPackageModule($_REQUEST['view_package'], $moduleName);
223
-            $package =& $mb->packages[$_REQUEST['view_package']];
222
+            $module = & $mb->getPackageModule($_REQUEST['view_package'], $moduleName);
223
+            $package = & $mb->packages[$_REQUEST['view_package']];
224 224
             $module->getVardefs();
225
-            if(!$ac){
225
+            if (!$ac) {
226 226
                 $ac = new AjaxCompose();
227 227
             }
228
-            $vardef = (!empty($module->mbvardefs->vardefs['fields'][$field_name]))? $module->mbvardefs->vardefs['fields'][$field_name]: array();
228
+            $vardef = (!empty($module->mbvardefs->vardefs['fields'][$field_name])) ? $module->mbvardefs->vardefs['fields'][$field_name] : array();
229 229
 
230
-            if($isClone){
230
+            if ($isClone) {
231 231
                 unset($vardef['name']);
232 232
             }
233 233
 
234
-            if(empty($vardef['name'])){
235
-                if(!empty($_REQUEST['type']))$vardef['type'] = $_REQUEST['type'];
234
+            if (empty($vardef['name'])) {
235
+                if (!empty($_REQUEST['type']))$vardef['type'] = $_REQUEST['type'];
236 236
                     $fv->ss->assign('hideLevel', 0);
237
-            }else{
238
-                if(!empty($module->mbvardefs->vardef['fields'][$vardef['name']])){
237
+            } else {
238
+                if (!empty($module->mbvardefs->vardef['fields'][$vardef['name']])) {
239 239
                     $fv->ss->assign('hideLevel', 1);
240
-                }elseif(isset($vardef['custom_module'])){
240
+                }elseif (isset($vardef['custom_module'])) {
241 241
                     $fv->ss->assign('hideLevel', 2);
242
-                }else{
242
+                } else {
243 243
                     $fv->ss->assign('hideLevel', 3); // tyoung bug 17350 - effectively mark template derived fields as readonly
244 244
                 }
245 245
             }
246 246
 
247
-			require_once ('modules/DynamicFields/FieldCases.php') ;
248
-            $tf = get_widget ( empty($vardef [ 'type' ]) ?  "" : $vardef [ 'type' ]) ;
247
+			require_once ('modules/DynamicFields/FieldCases.php');
248
+            $tf = get_widget(empty($vardef ['type']) ? "" : $vardef ['type']);
249 249
             $tf->module = $module;
250 250
             $tf->populateFromRow($vardef);
251 251
             $vardef = array_merge($vardef, $tf->get_field_def());
@@ -254,24 +254,24 @@  discard block
 block discarded – undo
254 254
 
255 255
             $fv->ss->assign('module', $module);
256 256
             $fv->ss->assign('package', $package);
257
-            $fv->ss->assign('MB','1');
257
+            $fv->ss->assign('MB', '1');
258 258
 
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'))
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 262
 				$field_types['parent'] = $GLOBALS['mod_strings']['parent'];
263 263
 
264 264
             $enumFields = array();
265 265
             if (!empty($module->mbvardefs->vardefs['fields']))
266 266
             {
267
-                foreach($module->mbvardefs->vardefs['fields'] as $field => $def)
267
+                foreach ($module->mbvardefs->vardefs['fields'] as $field => $def)
268 268
                 {
269 269
                     if (!empty($def['type']) && $def['type'] == "enum" && $field != $vardef['name'])
270 270
                     {
271 271
                         $enumFields[$field] = isset($module->mblanguage->strings[$current_language][$def['vname']]) ?
272 272
                             $this->mbModule->mblanguage->strings[$current_language][$def['vname']] : translate($field);
273 273
                         if (substr($enumFields[$field], -1) == ":")
274
-                            $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) -1);
274
+                            $enumFields[$field] = substr($enumFields[$field], 0, strlen($enumFields[$field]) - 1);
275 275
                     }
276 276
                 }
277 277
             }
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             $edit_or_add = 'mbeditField';
280 280
         }
281 281
 
282
-        if($_REQUEST['action'] == 'RefreshField'){
282
+        if ($_REQUEST['action'] == 'RefreshField') {
283 283
         	require_once('modules/DynamicFields/FieldCases.php');
284 284
             $field = get_widget($_POST['type']);
285 285
             $field->populateFromPost();
@@ -288,52 +288,52 @@  discard block
 block discarded – undo
288 288
             $fv->ss->assign('lbl_value', htmlentities($_REQUEST['labelValue'], ENT_QUOTES, 'UTF-8'));
289 289
         }
290 290
 
291
-        foreach(array("formula", "default", "comments", "help", "visiblityGrid") as $toEscape)
291
+        foreach (array("formula", "default", "comments", "help", "visiblityGrid") as $toEscape)
292 292
 		{
293 293
 			if (!empty($vardef[$toEscape]) && is_string($vardef[$toEscape])) {
294 294
 	        	$vardef[$toEscape] = htmlentities($vardef[$toEscape], ENT_QUOTES, 'UTF-8');
295 295
 	        }
296 296
 		}
297 297
 		
298
-        if((!empty($vardef['studio']) && is_array($vardef['studio']) && !empty($vardef['studio']['no_duplicate']) && $vardef['studio']['no_duplicate'] == true)
298
+        if ((!empty($vardef['studio']) && is_array($vardef['studio']) && !empty($vardef['studio']['no_duplicate']) && $vardef['studio']['no_duplicate'] == true)
299 299
            || (strcmp($field_name, "name") == 0) || (isset($vardef['type']) && $vardef['type'] == 'name')) // bug #35767, do not allow cloning of name field
300 300
             {
301 301
                $fv->ss->assign('no_duplicate', true);
302 302
             }
303 303
 
304
-        $fv->ss->assign('action',$action);
304
+        $fv->ss->assign('action', $action);
305 305
         $fv->ss->assign('isClone', ($isClone ? 1 : 0));
306 306
         $fv->ss->assign("module_dd_fields", $enumFields);
307 307
         $json = getJSONobj();
308 308
 
309 309
         $fv->ss->assign('field_name_exceptions', $json->encode($field_name_exceptions));
310 310
         ksort($field_types);
311
-        $fv->ss->assign('field_types',$field_types);
311
+        $fv->ss->assign('field_types', $field_types);
312 312
 
313 313
 
314 314
         $fv->ss->assign('importable_options', $GLOBALS['app_list_strings']['custom_fields_importable_dom']);
315 315
         $fv->ss->assign('duplicate_merge_options', $GLOBALS['app_list_strings']['custom_fields_merge_dup_dom']);
316 316
 
317
-        $triggers = array () ;
318
-        $existing_field_names = array () ;
319
-        foreach ( $module->mbvardefs->vardefs['fields'] as $field )
317
+        $triggers = array();
318
+        $existing_field_names = array();
319
+        foreach ($module->mbvardefs->vardefs['fields'] as $field)
320 320
         {
321
-        	if ($field [ 'type' ] == 'enum' || $field [ 'type'] == 'multienum' )
321
+        	if ($field ['type'] == 'enum' || $field ['type'] == 'multienum')
322 322
         	{
323
-        		$triggers [] = $field [ 'name' ] ;
323
+        		$triggers [] = $field ['name'];
324 324
         	}
325 325
         	
326 326
         	if (!isset($field['source']) || $field['source'] != 'non-db') {
327
-        		if(preg_match('/^(.*?)(_c)?$/', $field['name'], $matches))
327
+        		if (preg_match('/^(.*?)(_c)?$/', $field['name'], $matches))
328 328
         		{
329 329
         			$existing_field_names [] = strtoupper($matches[1]);	
330 330
         		}
331 331
         	}
332 332
         }
333 333
         
334
-        $fv->ss->assign('triggers',$triggers);
334
+        $fv->ss->assign('triggers', $triggers);
335 335
         $fv->ss->assign('existing_field_names', $json->encode($existing_field_names));
336
-        $fv->ss->assign('mod_strings',$GLOBALS['mod_strings']);
336
+        $fv->ss->assign('mod_strings', $GLOBALS['mod_strings']);
337 337
 
338 338
 		// jchi #24880
339 339
 		// end
@@ -342,20 +342,20 @@  discard block
 block discarded – undo
342 342
         $layout = $fv->getLayout($vardef);
343 343
 
344 344
         $fv->ss->assign('fieldLayout', $layout);
345
-        if(empty($vardef['type']))
345
+        if (empty($vardef['type']))
346 346
         {
347 347
             $vardef['type'] = 'varchar';
348 348
         }
349 349
 
350 350
         $fv->ss->assign('vardef', $vardef);
351 351
 
352
-        if(empty($_REQUEST['field'])){
352
+        if (empty($_REQUEST['field'])) {
353 353
             $edit_or_add = 'addField';
354 354
         }
355 355
 
356 356
         $fv->ss->assign('help_group', $edit_or_add);
357 357
         $body = $this->fetchTemplate($fv, 'modules/ModuleBuilder/tpls/MBModule/field.tpl');
358
-        $ac->addSection('east', translate('LBL_SECTION_FIELDEDITOR','ModuleBuilder'), $body );
358
+        $ac->addSection('east', translate('LBL_SECTION_FIELDEDITOR', 'ModuleBuilder'), $body);
359 359
         return $ac;
360 360
     }
361 361
 
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.displaydeploy.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 		$smarty->assign('message', $GLOBALS['mod_strings']['LBL_DEPLOY_IN_PROGRESS']);
49 49
 		$ajax = new AjaxCompose();
50 50
 		$ajax->addCrumb($GLOBALS['mod_strings']['LBL_MODULEBUILDER'], 'ModuleBuilder.main("mb")');
51
-		$ajax->addCrumb($_REQUEST['name'],'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$_REQUEST['name'].'")');
51
+		$ajax->addCrumb($_REQUEST['name'], 'ModuleBuilder.getContent("module=ModuleBuilder&action=package&package='.$_REQUEST['name'].'")');
52 52
 		$ajax->addCrumb(translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), '');
53 53
 		$ajax->addSection('center', translate('LBL_SECTION_DEPLOY', 'ModuleBuilder'), $smarty->fetch('modules/ModuleBuilder/tpls/MBPackage/deploy.tpl'));
54 54
 		echo $ajax->getJavascript();
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 	    global $mod_strings;
63 63
 	    
64 64
     	return array(
65
-    	   translate('LBL_MODULE_NAME','Administration'),
65
+    	   translate('LBL_MODULE_NAME', 'Administration'),
66 66
     	   ModuleBuilderController::getModuleTitle(),
67 67
     	   );
68 68
     }
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.deletepackage.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 	    global $mod_strings;
51 51
 	    
52 52
     	return array(
53
-    	   translate('LBL_MODULE_NAME','Administration'),
53
+    	   translate('LBL_MODULE_NAME', 'Administration'),
54 54
     	   ModuleBuilderController::getModuleTitle(),
55 55
     	   );
56 56
     }
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
         
62 62
         $ajax = new AjaxCompose();
63 63
         $ajax->addSection('center', $mod_strings['LBL_PACKAGE_DELETED'], 
64
-            str_replace('[[package]]',$_REQUEST['package'],$mod_strings['LBL_PACKAGE_WAS_DELETED']));
64
+            str_replace('[[package]]', $_REQUEST['package'], $mod_strings['LBL_PACKAGE_WAS_DELETED']));
65 65
         echo $ajax->getJavascript();
66 66
  	}
67 67
 }
68 68
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ModuleBuilder/views/view.home.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	    global $mod_strings;
49 49
 	    
50 50
     	return array(
51
-    	   translate('LBL_MODULE_NAME','Administration'),
51
+    	   translate('LBL_MODULE_NAME', 'Administration'),
52 52
     	   ModuleBuilderController::getModuleTitle(),
53 53
     	   );
54 54
     }
@@ -58,19 +58,19 @@  discard block
 block discarded – undo
58 58
 		global $current_user;
59 59
 		global $mod_strings;
60 60
 		$smarty = new Sugar_Smarty();
61
-		$smarty->assign('title' , $mod_strings['LBL_DEVELOPER_TOOLS']);
61
+		$smarty->assign('title', $mod_strings['LBL_DEVELOPER_TOOLS']);
62 62
 		$smarty->assign('question', $mod_strings['LBL_QUESTION_EDITOR']);
63 63
 		$smarty->assign('defaultHelp', 'mainHelp');
64 64
 		$this->generateHomeButtons();
65 65
 		$smarty->assign('buttons', $this->buttons);
66
-		$assistant=array('group'=>'main', 'key'=>'welcome');
67
-		$smarty->assign('assistant',$assistant);
66
+		$assistant = array('group'=>'main', 'key'=>'welcome');
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";
71
-		$smarty->assign('userPref',$userPref);
70
+		if (!$userPref) $userPref = "na";
71
+		$smarty->assign('userPref', $userPref);
72 72
 		$ajax = new AjaxCompose();
73
-		$ajax->addSection('center', $mod_strings['LBL_HOME'],$smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
73
+		$ajax->addSection('center', $mod_strings['LBL_HOME'], $smarty->fetch('modules/ModuleBuilder/tpls/wizard.tpl'));
74 74
 		echo $ajax->getJavascript();
75 75
 	}
76 76
 
@@ -78,13 +78,13 @@  discard block
 block discarded – undo
78 78
 	function generateHomeButtons() 
79 79
 	{
80 80
 	    global $current_user;
81
-        if(displayStudioForCurrentUser() == true) {
81
+        if (displayStudioForCurrentUser() == true) {
82 82
 		//$this->buttons['Application'] = array ('action' => '', 'imageTitle' => 'Application', 'size' => '128', 'help'=>'appBtn');
83
-		$this->buttons[$GLOBALS['mod_strings']['LBL_STUDIO']] = array ('action' => 'javascript:ModuleBuilder.main("studio")', 'imageTitle' => 'Studio', 'size' => '128', 'help'=>'studioBtn');
83
+		$this->buttons[$GLOBALS['mod_strings']['LBL_STUDIO']] = array('action' => 'javascript:ModuleBuilder.main("studio")', 'imageTitle' => 'Studio', 'size' => '128', 'help'=>'studioBtn');
84 84
         }
85
-        if(is_admin($current_user)) {
86
-		$this->buttons[$GLOBALS['mod_strings']['LBL_MODULEBUILDER']] = array ('action' => 'javascript:ModuleBuilder.main("mb")', 'imageTitle' => 'ModuleBuilder', 'size' => '128', 'help'=>'mbBtn');
85
+        if (is_admin($current_user)) {
86
+		$this->buttons[$GLOBALS['mod_strings']['LBL_MODULEBUILDER']] = array('action' => 'javascript:ModuleBuilder.main("mb")', 'imageTitle' => 'ModuleBuilder', 'size' => '128', 'help'=>'mbBtn');
87 87
         }
88
-		$this->buttons[$GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR']] = array ('action' => 'javascript:ModuleBuilder.main("dropdowns")', 'imageTitle' => $GLOBALS['mod_strings']['LBL_HOME_EDIT_DROPDOWNS'], 'imageName' => 'DropDownEditor', 'size' => '128', 'help'=>'dropDownEditorBtn');
88
+		$this->buttons[$GLOBALS['mod_strings']['LBL_DROPDOWNEDITOR']] = array('action' => 'javascript:ModuleBuilder.main("dropdowns")', 'imageTitle' => $GLOBALS['mod_strings']['LBL_HOME_EDIT_DROPDOWNS'], 'imageName' => 'DropDownEditor', 'size' => '128', 'help'=>'dropDownEditorBtn');
89 89
 	}
90 90
 }
91 91
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/StandardField.php 1 patch
Spacing   +17 added lines, -17 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.
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
  ********************************************************************************/
41 41
 
42 42
 
43
-require_once ('modules/DynamicFields/DynamicField.php') ;
43
+require_once ('modules/DynamicFields/DynamicField.php');
44 44
 
45 45
 class StandardField extends DynamicField
46 46
 {
@@ -53,7 +53,7 @@  discard block
 block discarded – undo
53 53
         parent::DynamicField($module);
54 54
     }
55 55
     
56
-    protected function loadCustomDef($field){
56
+    protected function loadCustomDef($field) {
57 57
     	global $beanList;
58 58
     	if (!empty($beanList[$this->module]) && is_file("custom/Extension/modules/{$this->module}/Ext/Vardefs/sugarfield_$field.php"))
59 59
     	{
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
     	}
66 66
     }
67 67
 
68
-    protected function loadBaseDef($field){
68
+    protected function loadBaseDef($field) {
69 69
         global $beanList;
70 70
         if (!empty($beanList[$this->module]) && is_file("modules/{$this->module}/vardefs.php"))
71 71
         {
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
      * @param Field Object $field
83 83
      * @return boolean
84 84
      */
85
-    function addFieldObject(&$field){
85
+    function addFieldObject(&$field) {
86 86
         global $dictionary, $beanList;
87 87
         
88 88
         
@@ -98,9 +98,9 @@  discard block
 block discarded – undo
98 98
 
99 99
         // set $field->unified_search=true if field supports unified search
100 100
         // regarding #51427
101
-        if($field->supports_unified_search)
101
+        if ($field->supports_unified_search)
102 102
         {
103
-            if(isset($dictionary[$bean_name]['unified_search_default_enabled']) && isset($dictionary[$bean_name]['unified_search'])
103
+            if (isset($dictionary[$bean_name]['unified_search_default_enabled']) && isset($dictionary[$bean_name]['unified_search'])
104 104
             && $dictionary[$bean_name]['unified_search_default_enabled'] && $dictionary[$bean_name]['unified_search'])
105 105
             {
106 106
                 $currdef['unified_search'] = $field->unified_search = isset($currdef['unified_search'])
@@ -114,21 +114,21 @@  discard block
 block discarded – undo
114 114
         $this->loadBaseDef($field->name);
115 115
         $newDef = $field->get_field_def();
116 116
         
117
-        require_once ('modules/DynamicFields/FieldCases.php') ;
118
-        $this->baseField = get_widget ( $field->type) ;
119
-        foreach ($field->vardef_map as $property => $fmd_col){
117
+        require_once ('modules/DynamicFields/FieldCases.php');
118
+        $this->baseField = get_widget($field->type);
119
+        foreach ($field->vardef_map as $property => $fmd_col) {
120 120
            
121 121
         	if ($property == "action" || $property == "label_value" || $property == "label"
122
-            	|| ((substr($property, 0,3) == 'ext' && strlen($property) == 4))
122
+            	|| ((substr($property, 0, 3) == 'ext' && strlen($property) == 4))
123 123
             ) 
124 124
             	continue;
125 125
        	 		
126 126
             // Bug 37043 - Avoid writing out vardef defintions that are the default value.
127 127
             if (isset($newDef[$property]) &&
128
-            	((!isset($currdef[$property]) && !$this->isDefaultValue($property,$newDef[$property], $this->baseField))
128
+            	((!isset($currdef[$property]) && !$this->isDefaultValue($property, $newDef[$property], $this->baseField))
129 129
             		|| (isset($currdef[$property]) && $currdef[$property] != $newDef[$property])
130 130
             	)
131
-            ){
131
+            ) {
132 132
             	$this->custom_def[$property] =
133 133
                     is_string($newDef[$property]) ? htmlspecialchars_decode($newDef[$property], ENT_QUOTES) : $newDef[$property];
134 134
             }
@@ -141,11 +141,11 @@  discard block
 block discarded – undo
141 141
             if (!empty($this->base_def[$property]) && !isset($newDef[$property]))
142 142
             {
143 143
                 //Switch on type of the property to find what the correct 'empty' is.
144
-                if(is_string($this->base_def[$property]))
144
+                if (is_string($this->base_def[$property]))
145 145
                     $this->custom_def[$property] = "";
146
-                else if(is_array($this->base_def[$property]))
146
+                else if (is_array($this->base_def[$property]))
147 147
                     $this->custom_def[$property] = array();
148
-                else if(is_bool($this->base_def[$property]))
148
+                else if (is_bool($this->base_def[$property]))
149 149
                     $this->custom_def[$property] = false;
150 150
                 else
151 151
                     $this->custom_def[$property] = null;
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/parser.searchfields.php 1 patch
Spacing   +13 added lines, -13 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.
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
  * display the words  "Powered by SugarCRM" and "Supercharged by SuiteCRM".
40 40
  ********************************************************************************/
41 41
 
42
-require_once ('modules/ModuleBuilder/parsers/ModuleBuilderParser.php') ;
42
+require_once ('modules/ModuleBuilder/parsers/ModuleBuilderParser.php');
43 43
 require_once ('modules/ModuleBuilder/MB/MBPackage.php');
44 44
 
45 45
 class ParserSearchFields extends ModuleBuilderParser
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	var $searchFields;
49 49
 	var $packageKey; 
50 50
 	
51
-    function ParserSearchFields ($moduleName, $packageName='')
51
+    function ParserSearchFields($moduleName, $packageName = '')
52 52
     {
53 53
         $this->moduleName = $moduleName;
54 54
         if (!empty($packageName))
@@ -63,21 +63,21 @@  discard block
 block discarded – undo
63 63
     
64 64
     function addSearchField($name, $searchField)
65 65
     {
66
-    	if(empty($name) || empty($searchField) || !is_array($searchField))
66
+    	if (empty($name) || empty($searchField) || !is_array($searchField))
67 67
     	{
68 68
     		return;
69 69
     	}
70 70
     	
71
-    	$key = isset($this->packageKey) ? $this->packageKey . '_' . $this->moduleName : $this->moduleName;
71
+    	$key = isset($this->packageKey) ? $this->packageKey.'_'.$this->moduleName : $this->moduleName;
72 72
         $this->searchFields[$key][$name] = $searchField;
73 73
     }
74 74
     
75 75
     function removeSearchField($name) 
76 76
     {
77 77
 
78
-    	$key = isset($this->packageKey) ? $this->packageKey . '_' . $this->moduleName : $this->moduleName;
78
+    	$key = isset($this->packageKey) ? $this->packageKey.'_'.$this->moduleName : $this->moduleName;
79 79
 
80
-    	if(isset($this->searchFields[$key][$name]))
80
+    	if (isset($this->searchFields[$key][$name]))
81 81
     	{
82 82
     		unset($this->searchFields[$key][$name]);
83 83
     	}
@@ -89,28 +89,28 @@  discard block
 block discarded – undo
89 89
         if (!empty($this->packageName) && file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php")) //we are in Module builder
90 90
         {
91 91
 			include("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php");      	        	
92
-        } else if(file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) {
92
+        } else if (file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php")) {
93 93
 			include("custom/modules/{$this->moduleName}/metadata/SearchFields.php");      	        	
94
-        } else if(file_exists("modules/{$this->moduleName}/metadata/SearchFields.php")) {
94
+        } else if (file_exists("modules/{$this->moduleName}/metadata/SearchFields.php")) {
95 95
 			include("modules/{$this->moduleName}/metadata/SearchFields.php");      	        	        	
96 96
         }
97 97
         
98 98
         return $searchFields;
99 99
     }
100 100
     
101
-    function saveSearchFields ($searchFields)
101
+    function saveSearchFields($searchFields)
102 102
     {
103 103
         if (!empty($this->packageName)) //we are in Module builder
104 104
         {
105 105
 			$header = file_get_contents('modules/ModuleBuilder/MB/header.php');
106
-            if(!file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php"))
106
+            if (!file_exists("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php"))
107 107
             {
108 108
                mkdir_recursive("custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata");
109 109
             }
110 110
 			write_array_to_file("searchFields['{$this->packageKey}_{$this->moduleName}']", $searchFields["{$this->packageKey}_{$this->moduleName}"], "custom/modulebuilder/packages/{$this->packageName}/modules/{$this->moduleName}/metadata/SearchFields.php", 'w', $header);                	        	
111 111
         } else {
112 112
 			$header = file_get_contents('modules/ModuleBuilder/MB/header.php');
113
-            if(!file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php"))
113
+            if (!file_exists("custom/modules/{$this->moduleName}/metadata/SearchFields.php"))
114 114
             {
115 115
                mkdir_recursive("custom/modules/{$this->moduleName}/metadata");
116 116
             }			
Please login to merge, or discard this patch.
modules/ModuleBuilder/parsers/relationships/OneToOneRelationship.php 1 patch
Spacing   +30 added lines, -30 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,7 +39,7 @@  discard block
 block discarded – undo
39 39
  ********************************************************************************/
40 40
 
41 41
 
42
-require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php' ;
42
+require_once 'modules/ModuleBuilder/parsers/relationships/AbstractRelationship.php';
43 43
 
44 44
 /*
45 45
  * Class to manage the metadata for a One-To-One Relationship
@@ -71,9 +71,9 @@  discard block
 block discarded – undo
71 71
      * Constructor
72 72
      * @param array $definition Parameters passed in as array with keys defined in parent::keys
73 73
      */
74
-    function __construct ($definition)
74
+    function __construct($definition)
75 75
     {
76
-        parent::__construct ( $definition ) ;
76
+        parent::__construct($definition);
77 77
     }
78 78
     
79 79
     /*
@@ -83,55 +83,55 @@  discard block
 block discarded – undo
83 83
     /*
84 84
      * @return array    An array of relationship metadata definitions
85 85
      */
86
-    function buildRelationshipMetaData ()
86
+    function buildRelationshipMetaData()
87 87
     {
88
-        return array( $this->lhs_module => $this->getRelationshipMetaData ( MB_ONETOONE ) ) ;
88
+        return array($this->lhs_module => $this->getRelationshipMetaData(MB_ONETOONE));
89 89
     }
90 90
 
91 91
     /* Build a set of Link Field definitions for this relationship
92 92
      * @return array    An array of field definitions, ready for the vardefs, keyed by module
93 93
      */
94
-    function buildVardefs ( )
94
+    function buildVardefs( )
95 95
     {
96
-        $vardefs = array ( ) ;
97
-        $vardefs [ $this->rhs_module ] [] = $this->getLinkFieldDefinition ( $this->lhs_module, $this->relationship_name , false, 
98
-            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getLeftModuleSystemLabel() ) . '_TITLE' ,
99
-            $this->relationship_only ? false : $this->getIDName( $this->lhs_module )
100
-        ) ;
101
-        $vardefs [ $this->lhs_module ] [] = $this->getLinkFieldDefinition ( $this->rhs_module, $this->relationship_name, false, 
102
-            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getRightModuleSystemLabel()   ) . '_TITLE'  ,
103
-            $this->relationship_only ? false : $this->getIDName( $this->rhs_module )
104
-        ) ;
96
+        $vardefs = array( );
97
+        $vardefs [$this->rhs_module] [] = $this->getLinkFieldDefinition($this->lhs_module, $this->relationship_name, false, 
98
+            'LBL_'.strtoupper($this->relationship_name.'_FROM_'.$this->getLeftModuleSystemLabel()).'_TITLE',
99
+            $this->relationship_only ? false : $this->getIDName($this->lhs_module)
100
+        );
101
+        $vardefs [$this->lhs_module] [] = $this->getLinkFieldDefinition($this->rhs_module, $this->relationship_name, false, 
102
+            'LBL_'.strtoupper($this->relationship_name.'_FROM_'.$this->getRightModuleSystemLabel()).'_TITLE',
103
+            $this->relationship_only ? false : $this->getIDName($this->rhs_module)
104
+        );
105 105
         
106 106
         if (!$this->relationship_only)
107 107
         {
108
-            $vardefs [ $this->lhs_module ] [] = $this->getRelateFieldDefinition ( $this->rhs_module, $this->relationship_name, $this->getRightModuleSystemLabel() ) ;
109
-            $vardefs [ $this->rhs_module ] [] = $this->getRelateFieldDefinition ( $this->lhs_module, $this->relationship_name, $this->getLeftModuleSystemLabel() ) ;
110
-            $vardefs [ $this->lhs_module ] [] = $this->getLink2FieldDefinition ( $this->rhs_module, $this->relationship_name , false, 
111
-            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getRightModuleSystemLabel()   ) . '_TITLE' ) ;
112
-            $vardefs [ $this->rhs_module ] [] = $this->getLink2FieldDefinition ( $this->lhs_module, $this->relationship_name , false, 
113
-            'LBL_' . strtoupper ( $this->relationship_name . '_FROM_' . $this->getLeftModuleSystemLabel() ) . '_TITLE' ) ;
108
+            $vardefs [$this->lhs_module] [] = $this->getRelateFieldDefinition($this->rhs_module, $this->relationship_name, $this->getRightModuleSystemLabel());
109
+            $vardefs [$this->rhs_module] [] = $this->getRelateFieldDefinition($this->lhs_module, $this->relationship_name, $this->getLeftModuleSystemLabel());
110
+            $vardefs [$this->lhs_module] [] = $this->getLink2FieldDefinition($this->rhs_module, $this->relationship_name, false, 
111
+            'LBL_'.strtoupper($this->relationship_name.'_FROM_'.$this->getRightModuleSystemLabel()).'_TITLE');
112
+            $vardefs [$this->rhs_module] [] = $this->getLink2FieldDefinition($this->lhs_module, $this->relationship_name, false, 
113
+            'LBL_'.strtoupper($this->relationship_name.'_FROM_'.$this->getLeftModuleSystemLabel()).'_TITLE');
114 114
         }
115 115
         
116
-        return $vardefs ;
116
+        return $vardefs;
117 117
     }
118 118
 
119 119
     /*
120 120
      * Define what fields to add to which modules layouts
121 121
      * @return array    An array of module => fieldname
122 122
      */
123
-    function buildFieldsToLayouts ()
123
+    function buildFieldsToLayouts()
124 124
     {
125 125
         if ($this->relationship_only)
126
-            return array () ;
126
+            return array();
127 127
  
128 128
         if ($this->lhs_module == $this->rhs_module) // don't add in two fields on recursive relationships
129
-            return array ( $this->lhs_module => $this->getValidDBName($this->relationship_name . "_name") );
129
+            return array($this->lhs_module => $this->getValidDBName($this->relationship_name."_name"));
130 130
         else
131
-            return array (
132
-                $this->lhs_module => $this->getValidDBName($this->relationship_name . "_name") ,
133
-                $this->rhs_module => $this->getValidDBName($this->relationship_name . "_name")
134
-            ) ;
131
+            return array(
132
+                $this->lhs_module => $this->getValidDBName($this->relationship_name."_name"),
133
+                $this->rhs_module => $this->getValidDBName($this->relationship_name."_name")
134
+            );
135 135
     }
136 136
 
137 137
 }
Please login to merge, or discard this patch.