Test Failed
Push — CI ( 0f01dd...c95a04 )
by Adam
55:13
created
modules/Administration/DiagnosticDownload.php 1 patch
Braces   +6 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -42,7 +44,9 @@  discard block
 block discarded – undo
42 44
 global $current_user;
43 45
 
44 46
 
45
-if (!is_admin($current_user)) sugar_die("Unauthorized access to administration.");
47
+if (!is_admin($current_user)) {
48
+    sugar_die("Unauthorized access to administration.");
49
+}
46 50
 if (isset($GLOBALS['sugar_config']['hide_admin_diagnostics']) && $GLOBALS['sugar_config']['hide_admin_diagnostics'])
47 51
 {
48 52
     sugar_die("Unauthorized access to diagnostic tool.");
Please login to merge, or discard this patch.
modules/Administration/expandDatabase.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -157,7 +159,7 @@  discard block
 block discarded – undo
157 159
 			    echo "<b>{$mod_strings['LBL_EXPAND_DATABASE_FINISHED_ERROR']}</b><br>";
158 160
 		} //if-else
159 161
 	} //if
160
-}else{
162
+} else{
161 163
 	sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
162 164
 }
163 165
 
Please login to merge, or discard this patch.
modules/Administration/upgrade_custom_relationships.php 1 patch
Braces   +12 added lines, -7 removed lines patch added patch discarded remove patch
@@ -45,13 +45,16 @@  discard block
 block discarded – undo
45 45
 function upgrade_custom_relationships($modules = array())
46 46
 {
47 47
 	global $current_user, $moduleList;
48
-	if (!is_admin($current_user)) sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']); 
48
+	if (!is_admin($current_user)) {
49
+	    sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
50
+	}
49 51
 	
50 52
 	require_once("modules/ModuleBuilder/parsers/relationships/DeployedRelationships.php");
51 53
 	require_once("modules/ModuleBuilder/parsers/relationships/OneToManyRelationship.php");
52 54
 	
53
-	if (empty($modules))
54
-		$modules = $moduleList;
55
+	if (empty($modules)) {
56
+			$modules = $moduleList;
57
+	}
55 58
 	
56 59
 	foreach($modules as $module)
57 60
 	{
@@ -65,8 +68,9 @@  discard block
 block discarded – undo
65 68
 			if ($def['lhs_module'] == $def['rhs_module'] && $def['is_custom'] && $def['relationship_type'] == "one-to-many")
66 69
 			{
67 70
 				$layout_defs = array();
68
-				if (!is_dir("custom/Extension/modules/$module/Ext/Layoutdefs") || !is_dir("custom/Extension/modules/$module/Ext/Vardefs"))
69
-					continue;
71
+				if (!is_dir("custom/Extension/modules/$module/Ext/Layoutdefs") || !is_dir("custom/Extension/modules/$module/Ext/Vardefs")) {
72
+									continue;
73
+				}
70 74
 				//Find the extension file containing the vardefs for this relationship
71 75
 				foreach(scandir("custom/Extension/modules/$module/Ext/Vardefs") as $file)
72 76
 				{
@@ -121,5 +125,6 @@  discard block
 block discarded – undo
121 125
 	}
122 126
 }
123 127
 
124
-if (isset($_REQUEST['execute']) && $_REQUEST['execute'])
125
-	upgrade_custom_relationships();
126 128
\ No newline at end of file
129
+if (isset($_REQUEST['execute']) && $_REQUEST['execute']) {
130
+	upgrade_custom_relationships();
131
+}
Please login to merge, or discard this patch.
modules/Administration/DiagnosticDelete.php 1 patch
Braces   +7 added lines, -6 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -60,8 +62,7 @@  discard block
 block discarded – undo
60 62
 if(empty($_REQUEST['file']) || empty($_REQUEST['guid']))
61 63
 {
62 64
 	echo $mod_strings['LBL_DIAGNOSTIC_DELETE_ERROR'];
63
-}
64
-else
65
+} else
65 66
 {
66 67
     // Make sure the guid and file are valid file names for security purposes
67 68
     clean_string($_REQUEST['guid'], "ALPHANUM");
@@ -79,10 +80,10 @@  discard block
 block discarded – undo
79 80
   	  unlink($cachedfile);
80 81
   	  rmdir(dirname($cachedfile));
81 82
 	  echo $mod_strings['LBL_DIAGNOSTIC_DELETED']."<br><br>";
83
+	} else {
84
+		  echo $mod_strings['LBL_DIAGNOSTIC_FILE'] . $_REQUEST['file'].$mod_strings['LBL_DIAGNOSTIC_ZIP'];
85
+	}
82 86
 	}
83
-	else
84
-	  echo $mod_strings['LBL_DIAGNOSTIC_FILE'] . $_REQUEST['file'].$mod_strings['LBL_DIAGNOSTIC_ZIP'];
85
-}
86 87
 
87 88
 print "<a href=\"index.php?module=Administration&action=index\">" . $mod_strings['LBL_DIAGNOSTIC_DELETE_RETURN'] . "</a><br>";
88 89
 
Please login to merge, or discard this patch.
modules/Administration/RebuildRelationship.php 1 patch
Braces   +29 added lines, -17 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.
@@ -67,11 +68,13 @@  discard block
 block discarded – undo
67 68
         if ( $focus instanceOf SugarBean ) {
68 69
             $table_name = $focus->table_name ;
69 70
             $empty = array() ;
70
-            if (empty ( $_REQUEST [ 'silent' ] ))
71
-                echo $mod_strings [ 'LBL_REBUILD_REL_PROC_META' ] . $focus->table_name . "..." ;
71
+            if (empty ( $_REQUEST [ 'silent' ] )) {
72
+                            echo $mod_strings [ 'LBL_REBUILD_REL_PROC_META' ] . $focus->table_name . "..." ;
73
+            }
72 74
             SugarBean::createRelationshipMeta ( $focus->getObjectName (), $db, $table_name, $empty, $focus->module_dir ) ;
73
-            if (empty ( $_REQUEST [ 'silent' ] ))
74
-                echo $mod_strings [ 'LBL_DONE' ] . '<br>' ;
75
+            if (empty ( $_REQUEST [ 'silent' ] )) {
76
+                            echo $mod_strings [ 'LBL_DONE' ] . '<br>' ;
77
+            }
75 78
         }
76 79
     }
77 80
 }
@@ -80,7 +83,9 @@  discard block
 block discarded – undo
80 83
 foreach ( $GLOBALS['beanFiles'] as $bean => $file )
81 84
 {
82 85
 	//skip this file if it does not exist
83
-	if(!file_exists($file)) continue;
86
+	if(!file_exists($file)) {
87
+	    continue;
88
+	}
84 89
 
85 90
 	if (! class_exists ( $bean ))
86 91
     {
@@ -90,11 +95,13 @@  discard block
 block discarded – undo
90 95
     if ( $focus instanceOf SugarBean ) {
91 96
         $table_name = $focus->table_name ;
92 97
         $empty = array() ;
93
-        if (empty ( $_REQUEST [ 'silent' ] ))
94
-            echo $mod_strings [ 'LBL_REBUILD_REL_PROC_C_META' ] . $focus->table_name . "..." ;
98
+        if (empty ( $_REQUEST [ 'silent' ] )) {
99
+                    echo $mod_strings [ 'LBL_REBUILD_REL_PROC_C_META' ] . $focus->table_name . "..." ;
100
+        }
95 101
         SugarBean::createRelationshipMeta ( $focus->getObjectName (), $db, $table_name, $empty, $focus->module_dir, true ) ;
96
-        if (empty ( $_REQUEST [ 'silent' ] ))
97
-            echo $mod_strings [ 'LBL_DONE' ] . '<br>' ;
102
+        if (empty ( $_REQUEST [ 'silent' ] )) {
103
+                    echo $mod_strings [ 'LBL_DONE' ] . '<br>' ;
104
+        }
98 105
     }
99 106
 }
100 107
 
@@ -111,24 +118,28 @@  discard block
 block discarded – undo
111 118
     {
112 119
         $table = isset($rel_data [ 'table' ]) ? $rel_data [ 'table' ] : "" ;
113 120
 
114
-        if (empty ( $_REQUEST [ 'silent' ] ))
115
-            echo $mod_strings [ 'LBL_REBUILD_REL_PROC_C_META' ] . $rel_name . "..." ;
121
+        if (empty ( $_REQUEST [ 'silent' ] )) {
122
+                    echo $mod_strings [ 'LBL_REBUILD_REL_PROC_C_META' ] . $rel_name . "..." ;
123
+        }
116 124
         SugarBean::createRelationshipMeta ( $rel_name, $db, $table, $rel_dictionary, '' ) ;
117
-        if (empty ( $_REQUEST [ 'silent' ] ))
118
-            echo $mod_strings [ 'LBL_DONE' ] . '<br>' ;
125
+        if (empty ( $_REQUEST [ 'silent' ] )) {
126
+                    echo $mod_strings [ 'LBL_DONE' ] . '<br>' ;
127
+        }
119 128
     }
120 129
 
121 130
 //clean relationship cache..will be rebuilt upon first access.
122
-if (empty ( $_REQUEST [ 'silent' ] ))
131
+if (empty ( $_REQUEST [ 'silent' ] )) {
123 132
     echo $mod_strings [ 'LBL_REBUILD_REL_DEL_CACHE' ] ;
133
+}
124 134
 Relationship::delete_cache () ;
125 135
 
126 136
 //////////////////////////////////////////////////////////////////////////////
127 137
 // Remove the "Rebuild Relationships" red text message on admin logins
128 138
 
129 139
 
130
-if (empty ( $_REQUEST [ 'silent' ] ))
140
+if (empty ( $_REQUEST [ 'silent' ] )) {
131 141
     echo $mod_strings [ 'LBL_REBUILD_REL_UPD_WARNING' ] ;
142
+}
132 143
 
133 144
 // clear the database row if it exists (just to be sure)
134 145
 $query = "DELETE FROM versions WHERE name='Rebuild Relationships'" ;
@@ -153,6 +164,7 @@  discard block
 block discarded – undo
153 164
     unset ( $_SESSION [ 'rebuild_relationships' ] ) ;
154 165
 }
155 166
 
156
-if (empty ( $_REQUEST [ 'silent' ] ))
167
+if (empty ( $_REQUEST [ 'silent' ] )) {
157 168
     echo $mod_strings [ 'LBL_DONE' ] ;
169
+}
158 170
 ?>
Please login to merge, or discard this patch.
modules/Administration/RepairFieldCasing.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -98,8 +100,7 @@  discard block
 block discarded – undo
98 100
 	       foreach($views as $view) {
99 101
                 try{
100 102
                     $parser = ParserFactory::getParser($view, $module);
101
-                }
102
-                catch(Exception $e){
103
+                } catch(Exception $e){
103 104
                     $GLOBALS['log']->fatal("Caught exception in RepairFieldCasing script: ".$e->getMessage());
104 105
                     continue;
105 106
                 }
Please login to merge, or discard this patch.
modules/Administration/UpgradeAccess.php 1 patch
Braces   +15 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -48,7 +50,9 @@  discard block
 block discarded – undo
48 50
 $htaccess_file   = getcwd() . "/.htaccess";
49 51
 $contents = '';
50 52
 $basePath = parse_url($sugar_config['site_url'], PHP_URL_PATH);
51
-if(empty($basePath)) $basePath = '/';
53
+if(empty($basePath)) {
54
+    $basePath = '/';
55
+}
52 56
 
53 57
 $restrict_str = <<<EOQ
54 58
 # BEGIN SUGARCRM RESTRICTIONS
@@ -74,9 +78,15 @@  discard block
 block discarded – undo
74 78
     $skip = false;
75 79
     while($line = fgets($fp)){
76 80
 
77
-    	if(preg_match('/\s*#\s*BEGIN\s*SUGARCRM\s*RESTRICTIONS/i', $line))$skip = true;
78
-        if(!$skip)$contents .= $line;
79
-        if(preg_match('/\s*#\s*END\s*SUGARCRM\s*RESTRICTIONS/i', $line))$skip = false;
81
+    	if(preg_match('/\s*#\s*BEGIN\s*SUGARCRM\s*RESTRICTIONS/i', $line)) {
82
+    	    $skip = true;
83
+    	}
84
+        if(!$skip) {
85
+            $contents .= $line;
86
+        }
87
+        if(preg_match('/\s*#\s*END\s*SUGARCRM\s*RESTRICTIONS/i', $line)) {
88
+            $skip = false;
89
+        }
80 90
     }
81 91
 }
82 92
 if(substr($contents, -1) != "\n") {
Please login to merge, or discard this patch.
modules/Administration/UpgradeWizard_commit.php 1 patch
Braces   +37 added lines, -33 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -169,14 +171,12 @@  discard block
 block discarded – undo
169 171
 if( $install_type != "module" ){
170 172
     if( !isset($_REQUEST['zip_from_dir']) || ($_REQUEST['zip_from_dir'] == "") ){
171 173
         $zip_from_dir     = ".";
172
-    }
173
-    else{
174
+    } else{
174 175
         $zip_from_dir   = $_REQUEST['zip_from_dir'];
175 176
     }
176 177
     if( !isset($_REQUEST['zip_to_dir']) || ($_REQUEST['zip_to_dir'] == "") ){
177 178
         $zip_to_dir     = ".";
178
-    }
179
-    else{
179
+    } else{
180 180
         $zip_to_dir     = $_REQUEST['zip_to_dir'];
181 181
     }
182 182
 }
@@ -262,10 +262,11 @@  discard block
 block discarded – undo
262 262
 
263 263
         $sugar_home_dir = getCwd();
264 264
         $dest_file  = clean_path( "$sugar_home_dir/$zip_to_dir/$file_to_copy" );
265
-        if($zip_to_dir != '.')
266
-        	$rest_file  = clean_path("$rest_dir/$zip_to_dir/$file_to_copy");
267
-        else
268
-        	$rest_file  = clean_path("$rest_dir/$file_to_copy");
265
+        if($zip_to_dir != '.') {
266
+                	$rest_file  = clean_path("$rest_dir/$zip_to_dir/$file_to_copy");
267
+        } else {
268
+                	$rest_file  = clean_path("$rest_dir/$file_to_copy");
269
+        }
269 270
 
270 271
         switch( $mode ){
271 272
             case "Install":
@@ -273,8 +274,9 @@  discard block
 block discarded – undo
273 274
 
274 275
                 if($install_type=="patch" && is_file($dest_file))
275 276
                 {
276
-	                if(!is_dir(dirname( $rest_file )))
277
-                		mkdir_recursive( dirname( $rest_file ) );
277
+	                if(!is_dir(dirname( $rest_file ))) {
278
+	                                		mkdir_recursive( dirname( $rest_file ) );
279
+	                }
278 280
 
279 281
 	                copy( $dest_file, $rest_file);
280 282
 	                sugar_touch( $rest_file, filemtime($dest_file) );
@@ -290,8 +292,7 @@  discard block
 block discarded – undo
290 292
                 {
291 293
 	                copy( $rest_file, $dest_file);
292 294
 	                sugar_touch( $dest_file, filemtime($rest_file) );
293
-                }
294
-                elseif(file_exists($dest_file) && !unlink($dest_file))
295
+                } elseif(file_exists($dest_file) && !unlink($dest_file))
295 296
                 {
296 297
                     die($mod_strings['ERR_UW_REMOVE_FAILED'].$dest_file);
297 298
                 }
@@ -315,8 +316,7 @@  discard block
 block discarded – undo
315 316
 
316 317
         if( $mode == "Install" || $mode=="Enable" ){
317 318
             $sugar_config['languages'] = $sugar_config['languages'] + array( $_REQUEST['new_lang_name'] => $_REQUEST['new_lang_desc'] );
318
-        }
319
-        else if( $mode == "Uninstall" || $mode=="Disable" ){
319
+        } else if( $mode == "Uninstall" || $mode=="Disable" ){
320 320
             $new_langs = array();
321 321
             $old_langs = $sugar_config['languages'];
322 322
             foreach( $old_langs as $key => $value ){
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
             //here we can determine if this is an upgrade or a new version
354 354
             	if(!empty($previous_version)){
355 355
             		$mi->install( "$unzip_dir", true, $previous_version);
356
-            	}else{
356
+            	} else{
357 357
                 	$mi->install( "$unzip_dir" );
358 358
             	}
359 359
 
@@ -366,24 +366,27 @@  discard block
 block discarded – undo
366 366
 				}
367 367
             	break;
368 368
             case "Uninstall":
369
-                if($remove_tables == 'false')
370
-                	$GLOBALS['mi_remove_tables'] = false;
371
-                else
372
-                	$GLOBALS['mi_remove_tables'] = true;
369
+                if($remove_tables == 'false') {
370
+                                	$GLOBALS['mi_remove_tables'] = false;
371
+                } else {
372
+                                	$GLOBALS['mi_remove_tables'] = true;
373
+                }
373 374
                 $mi->uninstall( "$unzip_dir" );
374 375
                 break;
375 376
              case "Disable":
376
-                if(!$overwrite_files)
377
-                	$GLOBALS['mi_overwrite_files'] = false;
378
-                else
379
-                	$GLOBALS['mi_overwrite_files'] = true;
377
+                if(!$overwrite_files) {
378
+                                	$GLOBALS['mi_overwrite_files'] = false;
379
+                } else {
380
+                                	$GLOBALS['mi_overwrite_files'] = true;
381
+                }
380 382
                 $mi->disable( "$unzip_dir" );
381 383
                 break;
382 384
              case "Enable":
383
-                if(!$overwrite_files)
384
-                	$GLOBALS['mi_overwrite_files'] = false;
385
-                else
386
-                	$GLOBALS['mi_overwrite_files'] = true;
385
+                if(!$overwrite_files) {
386
+                                	$GLOBALS['mi_overwrite_files'] = false;
387
+                } else {
388
+                                	$GLOBALS['mi_overwrite_files'] = true;
389
+                }
387 390
                 $mi->enable( "$unzip_dir" );
388 391
                 break;
389 392
             default:
@@ -473,8 +476,9 @@  discard block
 block discarded – undo
473 476
         	if (!empty($manifest['post_install_url']))
474 477
         	{
475 478
         		$url_conf = $manifest['post_install_url'];
476
-        		if (is_string($url_conf))
477
-        			$url_conf = array('url' => $url_conf);
479
+        		if (is_string($url_conf)) {
480
+        		        			$url_conf = array('url' => $url_conf);
481
+        		}
478 482
         		if (isset($url_conf['type']) && $url_conf['type'] == 'popup')
479 483
         		{
480 484
         			echo '<script type="text/javascript">window.open("' . $url_conf['url']
@@ -543,8 +547,9 @@  discard block
 block discarded – undo
543 547
 print( "<input type=submit value=\"{$mod_strings['LBL_UW_BTN_BACK_TO_MOD_LOADER']}\" /><br>" );
544 548
 echo "</div>";
545 549
 echo "<br>";
546
-if(isset($lang_changed_string))
550
+if(isset($lang_changed_string)) {
547 551
 	print($lang_changed_string);
552
+}
548 553
 if ($install_type != "module" && $install_type != "langpack"){
549 554
     if( sizeof( $files_to_handle ) > 0 ){
550 555
         echo '<div style="text-align: left; cursor: hand; cursor: pointer; text-decoration: underline;" onclick=\'this.style.display="none"; toggleDisplay("more");\' id="all_text">' . SugarThemeRegistry::current()->getImage('advanced_search', '', null, null, ".gif", $mod_strings['LBL_ADVANCED_SEARCH']) . ' Show Details</div><div id=\'more\' style=\'display: none\'>
@@ -556,8 +561,7 @@  discard block
 block discarded – undo
556 561
         }
557 562
         print( "</ul>\n" );
558 563
         echo '</div>';
559
-    }
560
-    else if( $mode != 'Disable' && $mode !='Enable' ){
564
+    } else if( $mode != 'Disable' && $mode !='Enable' ){
561 565
         print( "{$mod_strings['LBL_UW_NO_FILES_SELECTED']} $file_action.<br>\n" );
562 566
     }
563 567
 
Please login to merge, or discard this patch.
modules/Administration/UpgradeWizard_prepare.php 1 patch
Braces   +29 added lines, -28 removed lines patch added patch discarded remove patch
@@ -1,5 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
2
+if(!defined('sugarEntry') || !sugarEntry) {
3
+    die('Not A Valid Entry Point');
4
+}
3 5
 /*********************************************************************************
4 6
  * SugarCRM Community Edition is a customer relationship management program developed by
5 7
  * SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
@@ -178,8 +180,7 @@  discard block
 block discarded – undo
178 180
 		while( $f = $d->read() ){
179 181
 			if( $f == "." || $f == ".." ){
180 182
 				continue;
181
-			}
182
-			else if( preg_match("/(.*)\.lang\.php\$/", $f, $match) ){
183
+			} else if( preg_match("/(.*)\.lang\.php\$/", $f, $match) ){
183 184
 				$new_lang_name = $match[1];
184 185
 			}
185 186
 		}
@@ -200,8 +201,9 @@  discard block
 block discarded – undo
200 201
 		break;
201 202
 	case "module":
202 203
 		$previous_install = array();
203
-		if(!empty($id_name) & !empty($version))
204
-		$previous_install = $uh->determineIfUpgrade($id_name, $version);
204
+		if(!empty($id_name) & !empty($version)) {
205
+				$previous_install = $uh->determineIfUpgrade($id_name, $version);
206
+		}
205 207
 		$previous_version = (empty($previous_install['version'])) ? '' : $previous_install['version'];
206 208
 		$previous_id = (empty($previous_install['id'])) ? '' : $previous_install['id'];
207 209
 		$show_files = false;
@@ -231,15 +233,16 @@  discard block
 block discarded – undo
231 233
 <form action="<?php print( $form_action . "_commit" ); ?>" name="files" method="post"  onSubmit="return validateForm(<?php print($require_license); ?>);">
232 234
 <?php
233 235
 if(empty($new_studio_mod_files)) {
234
-	if(!empty($mode) && $mode == 'Uninstall')
235
-	echo $mod_strings['LBL_UW_UNINSTALL_READY'];
236
-	else if($mode == 'Disable')
237
-	echo $mod_strings['LBL_UW_DISABLE_READY'];
238
-	else if($mode == 'Enable')
239
-	echo $mod_strings['LBL_UW_ENABLE_READY'];
240
-	else
241
-	echo $mod_strings['LBL_UW_PATCH_READY'];
242
-} else {
236
+	if(!empty($mode) && $mode == 'Uninstall') {
237
+		echo $mod_strings['LBL_UW_UNINSTALL_READY'];
238
+	} else if($mode == 'Disable') {
239
+		echo $mod_strings['LBL_UW_DISABLE_READY'];
240
+	} else if($mode == 'Enable') {
241
+		echo $mod_strings['LBL_UW_ENABLE_READY'];
242
+	} else {
243
+		echo $mod_strings['LBL_UW_PATCH_READY'];
244
+	}
245
+	} else {
243 246
 	echo $mod_strings['LBL_UW_PATCH_READY2'];
244 247
 	echo '<input type="checkbox" onclick="toggle_these(0, ' . count($new_studio_mod_files) . ', this)"> '.$mod_strings['LBL_UW_CHECK_ALL'];
245 248
 	foreach($new_studio_mod_files as $the_file) {
@@ -255,7 +258,7 @@  discard block
 block discarded – undo
255 258
 	if($found_readme){
256 259
 		if(file_exists($readme_file) && filesize($readme_file) > 0){
257 260
 			$readme_contents = file_get_contents($readme_file);
258
-		}elseif(!empty($manifest['readme'])){
261
+		} elseif(!empty($manifest['readme'])){
259 262
 			$readme_contents = $manifest['readme'];
260 263
 		}
261 264
 	}
@@ -327,8 +330,7 @@  discard block
 block discarded – undo
327 330
 		if( $install_type == "langpack" ){
328 331
 			print( $mod_strings['LBL_UW_LANGPACK_READY_UNISTALL'] );
329 332
 			echo '<br><br>';
330
-		}
331
-		else if($install_type != "module"){
333
+		} else if($install_type != "module"){
332 334
 			print( $mod_strings['LBL_UW_FILES_REMOVED'] );
333 335
 		}
334 336
 		break;
@@ -369,10 +371,11 @@  discard block
 block discarded – undo
369 371
 	$cache_html_files = findAllFilesRelative( sugar_cached("layout"), array());
370 372
 
371 373
 	foreach($new_files as $the_file) {
372
-		if(substr(strtolower($the_file), -5, 5) == '.html' && in_array($the_file, $cache_html_files))
373
-		array_push($new_studio_mod_files, $the_file);
374
-		else
375
-		array_push($new_sugar_mod_files, $the_file);
374
+		if(substr(strtolower($the_file), -5, 5) == '.html' && in_array($the_file, $cache_html_files)) {
375
+				array_push($new_studio_mod_files, $the_file);
376
+		} else {
377
+				array_push($new_sugar_mod_files, $the_file);
378
+		}
376 379
 	}
377 380
 
378 381
 	echo '<script>
@@ -427,12 +430,10 @@  discard block
 block discarded – undo
427 430
 				print( " (no changes)" );
428 431
 			}
429 432
 			print( "<br>\n" );
430
-		}
431
-		else if( $mode == "Uninstall" && file_exists( $new_file ) ){
433
+		} else if( $mode == "Uninstall" && file_exists( $new_file ) ){
432 434
 			if( md5_file( $unzip_file ) == md5_file( $new_file ) ){
433 435
 				$checked = "checked=\"true\"";
434
-			}
435
-			else{
436
+			} else{
436 437
 				$highlight_start    = "<font color=red>";
437 438
 				$highlight_end      = "</font>";
438 439
 			}
@@ -458,7 +459,7 @@  discard block
 block discarded – undo
458 459
                 			}
459 460
             			}
460 461
         				return true;';
461
-		}else{
462
+		} else{
462 463
 			echo 'return true;';
463 464
 		}
464 465
 		echo '}</script>';
@@ -472,13 +473,13 @@  discard block
 block discarded – undo
472 473
 			print('<li>'.$modified_file.'</li>');
473 474
 		}
474 475
 		print('</ul>');
475
-	}else{
476
+	} else{
476 477
 		echo '<script>' .
477 478
 	        'function handleFileChange(){';
478 479
 		echo 'return true;';
479 480
 		echo '}</script>';
480 481
 	}
481
-}else{
482
+} else{
482 483
 	echo '<script>' .
483 484
         'function handleFileChange(){';
484 485
 	echo 'return true;';
Please login to merge, or discard this patch.