Completed
Push — console-installer ( 3d54e5...e2b50d )
by Adam
69:10 queued 48:24
created
modules/Administration/DiagnosticDelete.php 1 patch
Indentation   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -51,15 +51,15 @@  discard block
 block discarded – undo
51 51
         "Administration",
52 52
         array(
53 53
             "<a href='index.php?module=Administration&action=index'>{$mod_strings['LBL_MODULE_NAME']}</a>",
54
-           translate('LBL_DIAGNOSTIC_TITLE')
55
-           ),
54
+            translate('LBL_DIAGNOSTIC_TITLE')
55
+            ),
56 56
         true
57 57
         );
58 58
 
59 59
 
60 60
 if(empty($_REQUEST['file']) || empty($_REQUEST['guid']))
61 61
 {
62
-	echo $mod_strings['LBL_DIAGNOSTIC_DELETE_ERROR'];
62
+    echo $mod_strings['LBL_DIAGNOSTIC_DELETE_ERROR'];
63 63
 }
64 64
 else
65 65
 {
@@ -67,21 +67,21 @@  discard block
 block discarded – undo
67 67
     clean_string($_REQUEST['guid'], "ALPHANUM");
68 68
     clean_string($_REQUEST['file'], "FILE");
69 69
 
70
-	//Making sure someone doesn't pass a variable name as a false reference
71
-	//  to delete a file
72
-	if(strcmp(substr($_REQUEST['file'], 0, 10), "diagnostic") != 0)
73
-	{
74
-		die($mod_strings['LBL_DIAGNOSTIC_DELETE_DIE']);
75
-	}
70
+    //Making sure someone doesn't pass a variable name as a false reference
71
+    //  to delete a file
72
+    if(strcmp(substr($_REQUEST['file'], 0, 10), "diagnostic") != 0)
73
+    {
74
+        die($mod_strings['LBL_DIAGNOSTIC_DELETE_DIE']);
75
+    }
76 76
 
77
-	if(file_exists($cachedfile = sugar_cached("diagnostic/".$_REQUEST['guid']."/".$_REQUEST['file'].".zip")))
78
-	{
79
-  	  unlink($cachedfile);
80
-  	  rmdir(dirname($cachedfile));
81
-	  echo $mod_strings['LBL_DIAGNOSTIC_DELETED']."<br><br>";
82
-	}
83
-	else
84
-	  echo $mod_strings['LBL_DIAGNOSTIC_FILE'] . $_REQUEST['file'].$mod_strings['LBL_DIAGNOSTIC_ZIP'];
77
+    if(file_exists($cachedfile = sugar_cached("diagnostic/".$_REQUEST['guid']."/".$_REQUEST['file'].".zip")))
78
+    {
79
+        unlink($cachedfile);
80
+        rmdir(dirname($cachedfile));
81
+        echo $mod_strings['LBL_DIAGNOSTIC_DELETED']."<br><br>";
82
+    }
83
+    else
84
+        echo $mod_strings['LBL_DIAGNOSTIC_FILE'] . $_REQUEST['file'].$mod_strings['LBL_DIAGNOSTIC_ZIP'];
85 85
 }
86 86
 
87 87
 print "<a href=\"index.php?module=Administration&action=index\">" . $mod_strings['LBL_DIAGNOSTIC_DELETE_RETURN'] . "</a><br>";
Please login to merge, or discard this patch.
modules/Administration/RebuildRelationship.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -79,10 +79,10 @@
 block discarded – undo
79 79
 // do the same for custom relationships (true in the last parameter to SugarBean::createRelationshipMeta) - that is, relationships defined in the custom/modules/<modulename>/Ext/vardefs/ area
80 80
 foreach ( $GLOBALS['beanFiles'] as $bean => $file )
81 81
 {
82
-	//skip this file if it does not exist
83
-	if(!file_exists($file)) continue;
82
+    //skip this file if it does not exist
83
+    if(!file_exists($file)) continue;
84 84
 
85
-	if (! class_exists ( $bean ))
85
+    if (! class_exists ( $bean ))
86 86
     {
87 87
         require ($file) ;
88 88
     }
Please login to merge, or discard this patch.
modules/Administration/RepairJSFile.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
     echo'<div id="msgDiv"></div>';        
48 48
 
49 49
     //echo out script that will make an ajax call to process the files via callJSRepair.php
50
-     echo "<script>
50
+        echo "<script>
51 51
         var ajxProgress;
52 52
         var showMSG = 'true';
53 53
         //when called, this function will make ajax call to rebuild/repair js files
Please login to merge, or discard this patch.
modules/Administration/RepairFieldCasing.php 1 patch
Indentation   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -52,50 +52,50 @@  discard block
 block discarded – undo
52 52
     $query = "SELECT * FROM fields_meta_data";
53 53
     $result = $GLOBALS['db']->query($query);
54 54
     while($row = $GLOBALS['db']->fetchByAssoc($result)) {
55
-    	  $name = $row['name'];
56
-    	  $id = $row['id'];
57
-    	  $module_entries[$row['custom_module']] = true;
58
-
59
-    	  //Only run database SQL where the name or id casing does is not lowercased
60
-    	  if($name != strtolower($row['name'])) {
61
-    	  	 $database_entries[$row['custom_module']][$name] = $row;
62
-    	  }
55
+            $name = $row['name'];
56
+            $id = $row['id'];
57
+            $module_entries[$row['custom_module']] = true;
58
+
59
+            //Only run database SQL where the name or id casing does is not lowercased
60
+            if($name != strtolower($row['name'])) {
61
+                $database_entries[$row['custom_module']][$name] = $row;
62
+            }
63 63
     }
64 64
 
65 65
     //If we have database entries to process
66 66
     if(!empty($database_entries)) {
67 67
 
68
-       foreach($database_entries as $module=>$entries) {
69
-       	   $table_name = strtolower($module) . '_cstm';
68
+        foreach($database_entries as $module=>$entries) {
69
+                $table_name = strtolower($module) . '_cstm';
70 70
 
71
-           foreach($entries as $original_col_name=>$entry) {
72
-               echo '<br>'. string_format($mod_strings['LBL_REPAIR_FIELD_CASING_SQL_FIELD_META_DATA'], array($entry['name']));
73
-           	   $update_sql = "UPDATE fields_meta_data SET id = '" . $entry['custom_module'] . strtolower($entry['name']) . "', name = '" . strtolower($entry['name']) . "' WHERE id = '" . $entry['id'] . "'";
74
-           	   $GLOBALS['db']->query($update_sql);
71
+            foreach($entries as $original_col_name=>$entry) {
72
+                echo '<br>'. string_format($mod_strings['LBL_REPAIR_FIELD_CASING_SQL_FIELD_META_DATA'], array($entry['name']));
73
+                    $update_sql = "UPDATE fields_meta_data SET id = '" . $entry['custom_module'] . strtolower($entry['name']) . "', name = '" . strtolower($entry['name']) . "' WHERE id = '" . $entry['id'] . "'";
74
+                    $GLOBALS['db']->query($update_sql);
75 75
 
76
-           	   echo '<br>'. string_format($mod_strings['LBL_REPAIR_FIELD_CASING_SQL_CUSTOM_TABLE'], array($entry['name'], $table_name));
76
+                    echo '<br>'. string_format($mod_strings['LBL_REPAIR_FIELD_CASING_SQL_CUSTOM_TABLE'], array($entry['name'], $table_name));
77 77
 
78
-      		   $GLOBALS['db']->query($GLOBALS['db']->renameColumnSQL($table_name, $entry['name'], strtolower($entry['name'])));
79
-           }
80
-       }
78
+                    $GLOBALS['db']->query($GLOBALS['db']->renameColumnSQL($table_name, $entry['name'], strtolower($entry['name'])));
79
+            }
80
+        }
81 81
     }
82 82
 
83 83
     //If we have metadata files to alter
84 84
     if(!empty($module_entries)) {
85
-	    $modules = array_keys($module_entries);
86
-	    $views = array('basic_search', 'advanced_search', 'detailview', 'editview', 'quickcreate');
87
-	    $class_names = array();
85
+        $modules = array_keys($module_entries);
86
+        $views = array('basic_search', 'advanced_search', 'detailview', 'editview', 'quickcreate');
87
+        $class_names = array();
88 88
 
89 89
         require_once ('include/TemplateHandler/TemplateHandler.php') ;
90
-	    require_once('modules/ModuleBuilder/parsers/ParserFactory.php');
90
+        require_once('modules/ModuleBuilder/parsers/ParserFactory.php');
91 91
 
92
-	    foreach($modules as $module) {
93
-	       if(isset($GLOBALS['beanList'][$module])) {
94
-	       	  $class_names[] = $GLOBALS['beanList'][$module];
95
-	       }
92
+        foreach($modules as $module) {
93
+            if(isset($GLOBALS['beanList'][$module])) {
94
+                    $class_names[] = $GLOBALS['beanList'][$module];
95
+            }
96 96
 
97
-	       $repairClass->module_list[] = $module;
98
-	       foreach($views as $view) {
97
+            $repairClass->module_list[] = $module;
98
+            foreach($views as $view) {
99 99
                 try{
100 100
                     $parser = ParserFactory::getParser($view, $module);
101 101
                 }
@@ -103,37 +103,37 @@  discard block
 block discarded – undo
103 103
                     $GLOBALS['log']->fatal("Caught exception in RepairFieldCasing script: ".$e->getMessage());
104 104
                     continue;
105 105
                 }
106
-	       		if(isset($parser->_viewdefs['panels'])) {
107
-	       		   foreach($parser->_viewdefs['panels'] as $panel_id=>$panel) {
108
-	       		   	  foreach($panel as $row_id=>$row) {
109
-	       		   	  	 foreach($row as $entry_id=>$entry) {
110
-	       		   	  	 	if(is_array($entry) && isset($entry['name'])) {
111
-	       		   	  	 	   $parser->_viewdefs['panels'][$panel_id][$row_id][$entry_id]['name'] = strtolower($entry['name']);
112
-	       		   	  	 	}
113
-	       		   	  	 }
114
-	       		   	  }
115
-	       		   }
116
-	       		} else {
117
-	       		  //For basic_search and advanced_search views, just process the fields
118
-       		   	  foreach($parser->_viewdefs as $entry_id=>$entry) {
119
-       		   	  	 if(is_array($entry) && isset($entry['name'])) {
120
-       		   	  	 	$parser->_viewdefs[$entry_id]['name'] = strtolower($entry['name']);
121
-       		   	  	 }
122
-       		   	  }
123
-	       		}
124
-
125
-	       		//Save the changes
126
-	       		$parser->handleSave(false);
127
-	       } //foreach
128
-
129
-	       //Now clear the cache of the .tpl files
130
-	       TemplateHandler::clearCache($module);
131
-
132
-
133
-	    } //foreach
134
-
135
-	    echo '<br>'.$mod_strings['LBL_CLEAR_VARDEFS_DATA_CACHE_TITLE'];
136
-	    require_once('modules/Administration/QuickRepairAndRebuild.php');
106
+                    if(isset($parser->_viewdefs['panels'])) {
107
+                        foreach($parser->_viewdefs['panels'] as $panel_id=>$panel) {
108
+                            foreach($panel as $row_id=>$row) {
109
+                                    foreach($row as $entry_id=>$entry) {
110
+                                        if(is_array($entry) && isset($entry['name'])) {
111
+                                        $parser->_viewdefs['panels'][$panel_id][$row_id][$entry_id]['name'] = strtolower($entry['name']);
112
+                                        }
113
+                                    }
114
+                            }
115
+                        }
116
+                    } else {
117
+                        //For basic_search and advanced_search views, just process the fields
118
+                        foreach($parser->_viewdefs as $entry_id=>$entry) {
119
+                                if(is_array($entry) && isset($entry['name'])) {
120
+                                    $parser->_viewdefs[$entry_id]['name'] = strtolower($entry['name']);
121
+                                }
122
+                        }
123
+                    }
124
+
125
+                    //Save the changes
126
+                    $parser->handleSave(false);
127
+            } //foreach
128
+
129
+            //Now clear the cache of the .tpl files
130
+            TemplateHandler::clearCache($module);
131
+
132
+
133
+        } //foreach
134
+
135
+        echo '<br>'.$mod_strings['LBL_CLEAR_VARDEFS_DATA_CACHE_TITLE'];
136
+        require_once('modules/Administration/QuickRepairAndRebuild.php');
137 137
         $repair = new RepairAndClear();
138 138
         $repair->show_output = false;
139 139
         $repair->module_list = array($class_names);
Please login to merge, or discard this patch.
modules/Administration/UpgradeAccess.php 1 patch
Indentation   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
     $skip = false;
75 75
     while($line = fgets($fp)){
76 76
 
77
-    	if(preg_match('/\s*#\s*BEGIN\s*SUGARCRM\s*RESTRICTIONS/i', $line))$skip = true;
77
+        if(preg_match('/\s*#\s*BEGIN\s*SUGARCRM\s*RESTRICTIONS/i', $line))$skip = true;
78 78
         if(!$skip)$contents .= $line;
79 79
         if(preg_match('/\s*#\s*END\s*SUGARCRM\s*RESTRICTIONS/i', $line))$skip = false;
80 80
     }
@@ -106,25 +106,25 @@  discard block
 block discarded – undo
106 106
 eoq;
107 107
 
108 108
 if(file_exists($uploadHta) && filesize($uploadHta)) {
109
-	// file exists, parse to make sure it is current
110
-	if(is_writable($uploadHta)) {
111
-		$oldHtaccess = file_get_contents($uploadHta);
112
-		// use a different regex boundary b/c .htaccess uses the typicals
113
-		if(strstr($oldHtaccess, $denyAll) === false) {
114
-		    $oldHtaccess .= "\n";
115
-			$oldHtaccess .= $denyAll;
116
-		}
117
-		if(!file_put_contents($uploadHta, $oldHtaccess)) {
118
-		    $htaccess_failed = true;
119
-		}
120
-	} else {
121
-		$htaccess_failed = true;
122
-	}
109
+    // file exists, parse to make sure it is current
110
+    if(is_writable($uploadHta)) {
111
+        $oldHtaccess = file_get_contents($uploadHta);
112
+        // use a different regex boundary b/c .htaccess uses the typicals
113
+        if(strstr($oldHtaccess, $denyAll) === false) {
114
+            $oldHtaccess .= "\n";
115
+            $oldHtaccess .= $denyAll;
116
+        }
117
+        if(!file_put_contents($uploadHta, $oldHtaccess)) {
118
+            $htaccess_failed = true;
119
+        }
120
+    } else {
121
+        $htaccess_failed = true;
122
+    }
123 123
 } else {
124
-	// no .htaccess yet, create a fill
125
-	if(!file_put_contents($uploadHta, $denyAll)) {
126
-		$htaccess_failed = true;
127
-	}
124
+    // no .htaccess yet, create a fill
125
+    if(!file_put_contents($uploadHta, $denyAll)) {
126
+        $htaccess_failed = true;
127
+    }
128 128
 }
129 129
 
130 130
 include('modules/Versions/ExpectedVersions.php');
Please login to merge, or discard this patch.
modules/Administration/UpgradeWizard_prepare.php 1 patch
Indentation   +212 added lines, -212 removed lines patch added patch discarded remove patch
@@ -92,22 +92,22 @@  discard block
 block discarded – undo
92 92
 
93 93
 unzip( $install_file, $unzip_dir );
94 94
 if($install_type == 'module' && $mode != 'Uninstall'){
95
-   if(file_exists($license_file)){
95
+    if(file_exists($license_file)){
96 96
         $require_license = true;
97
-   }
97
+    }
98 98
 }
99 99
 
100 100
 //Scan the unzip dir for unsafe files
101 101
 if (((defined('MODULE_INSTALLER_PACKAGE_SCAN') && MODULE_INSTALLER_PACKAGE_SCAN)
102 102
     || !empty($GLOBALS['sugar_config']['moduleInstaller']['packageScan'])) && $install_type != 'patch') {
103
-	require_once('ModuleInstall/ModuleScanner.php');
104
-	$ms = new ModuleScanner();
105
-	$ms->scanPackage($unzip_dir);
106
-	if($ms->hasIssues()){
107
-	    rmdir_recursive($unzip_dir);
108
-		$ms->displayIssues();
109
-		sugar_cleanup(true);
110
-	}
103
+    require_once('ModuleInstall/ModuleScanner.php');
104
+    $ms = new ModuleScanner();
105
+    $ms->scanPackage($unzip_dir);
106
+    if($ms->hasIssues()){
107
+        rmdir_recursive($unzip_dir);
108
+        $ms->displayIssues();
109
+        sugar_cleanup(true);
110
+    }
111 111
 }
112 112
 
113 113
 // assumption -- already validated manifest.php at time of upload
@@ -150,72 +150,72 @@  discard block
 block discarded – undo
150 150
 }
151 151
 
152 152
 if($remove_tables != 'prompt'){
153
-	$hidden_fields .= "<input type=hidden name=\"remove_tables\" value='".$remove_tables."'>";
153
+    $hidden_fields .= "<input type=hidden name=\"remove_tables\" value='".$remove_tables."'>";
154 154
 }
155 155
 if(file_exists($readme_file) || !empty($manifest['readme'])){
156 156
         $found_readme = true;
157
-   }
157
+    }
158 158
 $uh = new UpgradeHistory();
159 159
 //check dependencies first
160 160
 if(!empty($dependencies)){
161
-	$not_found = $uh->checkDependencies($dependencies);
162
-	if(!empty($not_found) && count($not_found) > 0){
163
-			die( $mod_strings['ERR_UW_NO_DEPENDENCY']."[".implode(',', $not_found)."]");
164
-	}//fi
161
+    $not_found = $uh->checkDependencies($dependencies);
162
+    if(!empty($not_found) && count($not_found) > 0){
163
+            die( $mod_strings['ERR_UW_NO_DEPENDENCY']."[".implode(',', $not_found)."]");
164
+    }//fi
165 165
 }
166 166
 switch( $install_type ){
167
-	case "full":
168
-	case "patch":
169
-		if( !is_writable( "config.php" ) ){
170
-			die( $mod_strings['ERR_UW_CONFIG'] );
171
-		}
172
-		break;
173
-	case "theme":
174
-		break;
175
-	case "langpack":
176
-		// find name of language pack: find single file in include/language/xx_xx.lang.php
177
-		$d = dir( "$unzip_dir/$zip_from_dir/include/language" );
178
-		while( $f = $d->read() ){
179
-			if( $f == "." || $f == ".." ){
180
-				continue;
181
-			}
182
-			else if( preg_match("/(.*)\.lang\.php\$/", $f, $match) ){
183
-				$new_lang_name = $match[1];
184
-			}
185
-		}
186
-		if( $new_lang_name == "" ){
187
-			die( $mod_strings['ERR_UW_NO_LANGPACK'].$install_file );
188
-		}
189
-		$hidden_fields .= "<input type=hidden name=\"new_lang_name\" value=\"$new_lang_name\"/>";
190
-
191
-		$new_lang_desc = getLanguagePackName( "$unzip_dir/$zip_from_dir/include/language/$new_lang_name.lang.php" );
192
-		if( $new_lang_desc == "" ){
193
-			die( $mod_strings['ERR_UW_NO_LANG_DESC_1']."include/language/$new_lang_name.lang.php".$mod_strings['ERR_UW_NO_LANG_DESC_2']."$install_file." );
194
-		}
195
-		$hidden_fields .= "<input type=hidden name=\"new_lang_desc\" value=\"$new_lang_desc\"/>";
196
-
197
-		if( !is_writable( "config.php" ) ){
198
-			die( $mod_strings['ERR_UW_CONFIG'] );
199
-		}
200
-		break;
201
-	case "module":
202
-		$previous_install = array();
203
-		if(!empty($id_name) & !empty($version))
204
-		$previous_install = $uh->determineIfUpgrade($id_name, $version);
205
-		$previous_version = (empty($previous_install['version'])) ? '' : $previous_install['version'];
206
-		$previous_id = (empty($previous_install['id'])) ? '' : $previous_install['id'];
207
-		$show_files = false;
208
-		//rrs pull out unique_key
209
-		$hidden_fields .= "<input type=hidden name=\"author\" value=\"$author\"/>";
210
-		$hidden_fields .= "<input type=hidden name=\"name\" value=\"$name\"/>";
211
-		$hidden_fields .= "<input type=hidden name=\"description\" value=\"$description\"/>";
212
-		$hidden_fields .= "<input type=hidden name=\"is_uninstallable\" value=\"$is_uninstallable\"/>";
213
-		$hidden_fields .= "<input type=hidden name=\"id_name\" value=\"$id_name\"/>";
214
-		$hidden_fields .= "<input type=hidden name=\"previous_version\" value=\"$previous_version\"/>";
215
-		$hidden_fields .= "<input type=hidden name=\"previous_id\" value=\"$previous_id\"/>";
216
-		break;
217
-	default:
218
-		die( $mod_strings['ERR_UW_WRONG_TYPE'].$install_type );
167
+    case "full":
168
+    case "patch":
169
+        if( !is_writable( "config.php" ) ){
170
+            die( $mod_strings['ERR_UW_CONFIG'] );
171
+        }
172
+        break;
173
+    case "theme":
174
+        break;
175
+    case "langpack":
176
+        // find name of language pack: find single file in include/language/xx_xx.lang.php
177
+        $d = dir( "$unzip_dir/$zip_from_dir/include/language" );
178
+        while( $f = $d->read() ){
179
+            if( $f == "." || $f == ".." ){
180
+                continue;
181
+            }
182
+            else if( preg_match("/(.*)\.lang\.php\$/", $f, $match) ){
183
+                $new_lang_name = $match[1];
184
+            }
185
+        }
186
+        if( $new_lang_name == "" ){
187
+            die( $mod_strings['ERR_UW_NO_LANGPACK'].$install_file );
188
+        }
189
+        $hidden_fields .= "<input type=hidden name=\"new_lang_name\" value=\"$new_lang_name\"/>";
190
+
191
+        $new_lang_desc = getLanguagePackName( "$unzip_dir/$zip_from_dir/include/language/$new_lang_name.lang.php" );
192
+        if( $new_lang_desc == "" ){
193
+            die( $mod_strings['ERR_UW_NO_LANG_DESC_1']."include/language/$new_lang_name.lang.php".$mod_strings['ERR_UW_NO_LANG_DESC_2']."$install_file." );
194
+        }
195
+        $hidden_fields .= "<input type=hidden name=\"new_lang_desc\" value=\"$new_lang_desc\"/>";
196
+
197
+        if( !is_writable( "config.php" ) ){
198
+            die( $mod_strings['ERR_UW_CONFIG'] );
199
+        }
200
+        break;
201
+    case "module":
202
+        $previous_install = array();
203
+        if(!empty($id_name) & !empty($version))
204
+        $previous_install = $uh->determineIfUpgrade($id_name, $version);
205
+        $previous_version = (empty($previous_install['version'])) ? '' : $previous_install['version'];
206
+        $previous_id = (empty($previous_install['id'])) ? '' : $previous_install['id'];
207
+        $show_files = false;
208
+        //rrs pull out unique_key
209
+        $hidden_fields .= "<input type=hidden name=\"author\" value=\"$author\"/>";
210
+        $hidden_fields .= "<input type=hidden name=\"name\" value=\"$name\"/>";
211
+        $hidden_fields .= "<input type=hidden name=\"description\" value=\"$description\"/>";
212
+        $hidden_fields .= "<input type=hidden name=\"is_uninstallable\" value=\"$is_uninstallable\"/>";
213
+        $hidden_fields .= "<input type=hidden name=\"id_name\" value=\"$id_name\"/>";
214
+        $hidden_fields .= "<input type=hidden name=\"previous_version\" value=\"$previous_version\"/>";
215
+        $hidden_fields .= "<input type=hidden name=\"previous_id\" value=\"$previous_id\"/>";
216
+        break;
217
+    default:
218
+        die( $mod_strings['ERR_UW_WRONG_TYPE'].$install_type );
219 219
 }
220 220
 
221 221
 
@@ -231,35 +231,35 @@  discard block
 block discarded – undo
231 231
 <form action="<?php print( $form_action . "_commit" ); ?>" name="files" method="post"  onSubmit="return validateForm(<?php print($require_license); ?>);">
232 232
 <?php
233 233
 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'];
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 242
 } else {
243
-	echo $mod_strings['LBL_UW_PATCH_READY2'];
244
-	echo '<input type="checkbox" onclick="toggle_these(0, ' . count($new_studio_mod_files) . ', this)"> '.$mod_strings['LBL_UW_CHECK_ALL'];
245
-	foreach($new_studio_mod_files as $the_file) {
246
-		$new_file   = clean_path( "$zip_to_dir/$the_file" );
247
-		print( "<li><input id=\"copy_$count\" name=\"copy_$count\" type=\"checkbox\" value=\"" . $the_file . "\"> " . $new_file . "</li>");
248
-		$count++;
249
-	}
243
+    echo $mod_strings['LBL_UW_PATCH_READY2'];
244
+    echo '<input type="checkbox" onclick="toggle_these(0, ' . count($new_studio_mod_files) . ', this)"> '.$mod_strings['LBL_UW_CHECK_ALL'];
245
+    foreach($new_studio_mod_files as $the_file) {
246
+        $new_file   = clean_path( "$zip_to_dir/$the_file" );
247
+        print( "<li><input id=\"copy_$count\" name=\"copy_$count\" type=\"checkbox\" value=\"" . $the_file . "\"> " . $new_file . "</li>");
248
+        $count++;
249
+    }
250 250
 }
251 251
 echo '<br>';
252 252
 if($require_license){
253 253
     $contents = sugar_file_get_contents($license_file);
254
-	$readme_contents = '';
255
-	if($found_readme){
256
-		if(file_exists($readme_file) && filesize($readme_file) > 0){
257
-			$readme_contents = file_get_contents($readme_file);
258
-		}elseif(!empty($manifest['readme'])){
259
-			$readme_contents = $manifest['readme'];
260
-		}
261
-	}
262
-	$license_final =<<<eoq2
254
+    $readme_contents = '';
255
+    if($found_readme){
256
+        if(file_exists($readme_file) && filesize($readme_file) > 0){
257
+            $readme_contents = file_get_contents($readme_file);
258
+        }elseif(!empty($manifest['readme'])){
259
+            $readme_contents = $manifest['readme'];
260
+        }
261
+    }
262
+    $license_final =<<<eoq2
263 263
 	<table width='100%'>
264 264
 	<tr>
265 265
 	<td colspan="3"><ul class="tablist">
@@ -312,38 +312,38 @@  discard block
 block discarded – undo
312 312
 </div>
313 313
 
314 314
 eoq2;
315
-	echo $license_final;
316
-	echo "<br>";
315
+    echo $license_final;
316
+    echo "<br>";
317 317
 }
318 318
 
319 319
 switch( $mode ){
320
-	case "Install":
321
-		if( $install_type == "langpack") {
322
-			print( $mod_strings['LBL_UW_LANGPACK_READY'] );
323
-			echo '<br><br>';
324
-		}
325
-		break;
326
-	case "Uninstall":
327
-		if( $install_type == "langpack" ){
328
-			print( $mod_strings['LBL_UW_LANGPACK_READY_UNISTALL'] );
329
-			echo '<br><br>';
330
-		}
331
-		else if($install_type != "module"){
332
-			print( $mod_strings['LBL_UW_FILES_REMOVED'] );
333
-		}
334
-		break;
335
-	case "Disable":
336
-		if( $install_type == "langpack" ){
337
-			print( $mod_strings['LBL_UW_LANGPACK_READY_DISABLE'] );
338
-			echo '<br><br>';
339
-		}
340
-		break;
341
-	case "Enable":
342
-		if( $install_type == "langpack" ){
343
-			print( $mod_strings['LBL_UW_LANGPACK_READY_ENABLE'] );
344
-			echo '<br><br>';
345
-		}
346
-		break;
320
+    case "Install":
321
+        if( $install_type == "langpack") {
322
+            print( $mod_strings['LBL_UW_LANGPACK_READY'] );
323
+            echo '<br><br>';
324
+        }
325
+        break;
326
+    case "Uninstall":
327
+        if( $install_type == "langpack" ){
328
+            print( $mod_strings['LBL_UW_LANGPACK_READY_UNISTALL'] );
329
+            echo '<br><br>';
330
+        }
331
+        else if($install_type != "module"){
332
+            print( $mod_strings['LBL_UW_FILES_REMOVED'] );
333
+        }
334
+        break;
335
+    case "Disable":
336
+        if( $install_type == "langpack" ){
337
+            print( $mod_strings['LBL_UW_LANGPACK_READY_DISABLE'] );
338
+            echo '<br><br>';
339
+        }
340
+        break;
341
+    case "Enable":
342
+        if( $install_type == "langpack" ){
343
+            print( $mod_strings['LBL_UW_LANGPACK_READY_ENABLE'] );
344
+            echo '<br><br>';
345
+        }
346
+        break;
347 347
 }
348 348
 
349 349
 
@@ -355,27 +355,27 @@  discard block
 block discarded – undo
355 355
 
356 356
 if($remove_tables == 'prompt' && $mode == 'Uninstall'){
357 357
     print ("<br/><br/>");
358
-	print ("<input type='radio' id='remove_tables_true' name='remove_tables' value='true' checked>".$mod_strings['ML_LBL_REMOVE_TABLES']."&nbsp;");
358
+    print ("<input type='radio' id='remove_tables_true' name='remove_tables' value='true' checked>".$mod_strings['ML_LBL_REMOVE_TABLES']."&nbsp;");
359 359
     print ("<input type='radio' id='remove_tables_false' name='remove_tables' value='false'>".$mod_strings['ML_LBL_DO_NOT_REMOVE_TABLES']."<br>");
360 360
 }
361 361
 $count = 0;
362 362
 
363 363
 if( $show_files == true ){
364
-	$count = 0;
364
+    $count = 0;
365 365
 
366
-	$new_studio_mod_files = array();
367
-	$new_sugar_mod_files = array();
366
+    $new_studio_mod_files = array();
367
+    $new_sugar_mod_files = array();
368 368
 
369
-	$cache_html_files = findAllFilesRelative( sugar_cached("layout"), array());
369
+    $cache_html_files = findAllFilesRelative( sugar_cached("layout"), array());
370 370
 
371
-	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);
376
-	}
371
+    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);
376
+    }
377 377
 
378
-	echo '<script>
378
+    echo '<script>
379 379
             function toggle_these(start, end, ca) {
380 380
               while(start < end) {
381 381
                 elem = eval("document.forms.files.copy_" + start);
@@ -388,106 +388,106 @@  discard block
 block discarded – undo
388 388
 
389 389
 
390 390
 
391
-	global $theme;
391
+    global $theme;
392 392
 
393
-	echo '<br/><br/>';
393
+    echo '<br/><br/>';
394 394
 
395 395
     echo '<div style="text-align: left; cursor: hand; cursor: pointer; text-decoration: underline;'.(($mode == 'Enable' || $mode == 'Disable')?'display:none;':'').'" onclick=\'this.style.display="none"; toggleDisplay("more");\'id="all_text">
396 396
         '.SugarThemeRegistry::current()->getImage('advanced_search', '', null, null, ".gif", $mod_strings['LBL_ADVANCED_SEARCH']).$mod_strings['LBL_UW_SHOW_DETAILS'].'</div><div id=\'more\' style=\'display: none\'>
397 397
               <div style="text-align: left; cursor: hand; cursor: pointer; text-decoration: underline;" onclick=\'document.getElementById("all_text").style.display=""; toggleDisplay("more");\'>'
398
-         .SugarThemeRegistry::current()->getImage('basic_search', '', null, null, ".gif", $mod_strings['LBL_BASIC_SEARCH']).$mod_strings['LBL_UW_HIDE_DETAILS'].'</div><br>';
398
+            .SugarThemeRegistry::current()->getImage('basic_search', '', null, null, ".gif", $mod_strings['LBL_BASIC_SEARCH']).$mod_strings['LBL_UW_HIDE_DETAILS'].'</div><br>';
399 399
     echo '<input type="checkbox" checked onclick="toggle_these(' . count($new_studio_mod_files) . ',' . count($new_files) . ', this)"> '.$mod_strings['LBL_UW_CHECK_ALL'];
400
-	echo '<ul>';
401
-	foreach( $new_sugar_mod_files as $the_file ){
402
-		$highlight_start    = "";
403
-		$highlight_end      = "";
404
-		$checked            = "";
405
-		$disabled           = "";
406
-		$unzip_file = "$unzip_dir/$zip_from_dir/$the_file";
407
-		$new_file   = clean_path( "$zip_to_dir/$the_file" );
408
-		$forced_copy    = false;
409
-
410
-		if( $mode == "Install" ){
411
-			$checked = "checked";
412
-			foreach( $zip_force_copy as $pattern ){
413
-				if( preg_match("#" . $pattern . "#", $unzip_file) ){
414
-					$disabled = "disabled=\"true\"";
415
-					$forced_copy = true;
416
-				}
417
-			}
418
-			if( !$forced_copy && is_file( $new_file ) && (md5_file( $unzip_file ) == md5_file( $new_file )) ){
419
-				$disabled = "disabled=\"true\"";
420
-				//$checked = "";
421
-			}
422
-			if( $checked != "" && $disabled != "" ){    // need to put a hidden field
423
-				print( "<input name=\"copy_$count\" type=\"hidden\" value=\"" . $the_file . "\">\n" );
424
-			}
425
-			print( "<li><input id=\"copy_$count\" name=\"copy_$count\" type=\"checkbox\" value=\"" . $the_file . "\" $checked $disabled > " . $highlight_start . $new_file . $highlight_end );
426
-			if( $checked == "" && $disabled != "" ){    // need to explain this file hasn't changed
427
-				print( " (no changes)" );
428
-			}
429
-			print( "<br>\n" );
430
-		}
431
-		else if( $mode == "Uninstall" && file_exists( $new_file ) ){
432
-			if( md5_file( $unzip_file ) == md5_file( $new_file ) ){
433
-				$checked = "checked=\"true\"";
434
-			}
435
-			else{
436
-				$highlight_start    = "<font color=red>";
437
-				$highlight_end      = "</font>";
438
-			}
439
-			print( "<li><input name=\"copy_$count\" type=\"checkbox\" value=\"" . $the_file . "\" $checked $disabled > " . $highlight_start . $new_file . $highlight_end . "<br>\n" );
440
-		}
441
-		$count++;
442
-	}
400
+    echo '<ul>';
401
+    foreach( $new_sugar_mod_files as $the_file ){
402
+        $highlight_start    = "";
403
+        $highlight_end      = "";
404
+        $checked            = "";
405
+        $disabled           = "";
406
+        $unzip_file = "$unzip_dir/$zip_from_dir/$the_file";
407
+        $new_file   = clean_path( "$zip_to_dir/$the_file" );
408
+        $forced_copy    = false;
409
+
410
+        if( $mode == "Install" ){
411
+            $checked = "checked";
412
+            foreach( $zip_force_copy as $pattern ){
413
+                if( preg_match("#" . $pattern . "#", $unzip_file) ){
414
+                    $disabled = "disabled=\"true\"";
415
+                    $forced_copy = true;
416
+                }
417
+            }
418
+            if( !$forced_copy && is_file( $new_file ) && (md5_file( $unzip_file ) == md5_file( $new_file )) ){
419
+                $disabled = "disabled=\"true\"";
420
+                //$checked = "";
421
+            }
422
+            if( $checked != "" && $disabled != "" ){    // need to put a hidden field
423
+                print( "<input name=\"copy_$count\" type=\"hidden\" value=\"" . $the_file . "\">\n" );
424
+            }
425
+            print( "<li><input id=\"copy_$count\" name=\"copy_$count\" type=\"checkbox\" value=\"" . $the_file . "\" $checked $disabled > " . $highlight_start . $new_file . $highlight_end );
426
+            if( $checked == "" && $disabled != "" ){    // need to explain this file hasn't changed
427
+                print( " (no changes)" );
428
+            }
429
+            print( "<br>\n" );
430
+        }
431
+        else if( $mode == "Uninstall" && file_exists( $new_file ) ){
432
+            if( md5_file( $unzip_file ) == md5_file( $new_file ) ){
433
+                $checked = "checked=\"true\"";
434
+            }
435
+            else{
436
+                $highlight_start    = "<font color=red>";
437
+                $highlight_end      = "</font>";
438
+            }
439
+            print( "<li><input name=\"copy_$count\" type=\"checkbox\" value=\"" . $the_file . "\" $checked $disabled > " . $highlight_start . $new_file . $highlight_end . "<br>\n" );
440
+        }
441
+        $count++;
442
+    }
443 443
         print( "</ul>\n" );
444 444
 }
445 445
 //    echo '</div>';
446 446
 if($mode == "Disable" || $mode == "Enable"){
447
-	//check to see if any files have been modified
448
-	$modified_files = getDiffFiles($unzip_dir, $install_file, ($mode == 'Enable'), $previous_version);
449
-	if(count($modified_files) > 0){
450
-		//we need to tell the user that some files have been modified since they last did an install
451
-		echo '<script>' .
447
+    //check to see if any files have been modified
448
+    $modified_files = getDiffFiles($unzip_dir, $install_file, ($mode == 'Enable'), $previous_version);
449
+    if(count($modified_files) > 0){
450
+        //we need to tell the user that some files have been modified since they last did an install
451
+        echo '<script>' .
452 452
                 'function handleFileChange(){';
453
-		if(count($modified_files) > 0){
454
-			echo 'if(document.getElementById("radio_overwrite_files") != null && document.getElementById("radio_do_not_overwrite_files") != null){
453
+        if(count($modified_files) > 0){
454
+            echo 'if(document.getElementById("radio_overwrite_files") != null && document.getElementById("radio_do_not_overwrite_files") != null){
455 455
                 			var overwrite = false;
456 456
                 			if(document.getElementById("radio_overwrite_files").checked){
457 457
                    			 overwrite = true
458 458
                 			}
459 459
             			}
460 460
         				return true;';
461
-		}else{
462
-			echo 'return true;';
463
-		}
464
-		echo '}</script>';
465
-		print('<b>'.$mod_strings['ML_LBL_OVERWRITE_FILES'].'</b>');
466
-		print('<table><td align="left" valign="top" colspan=2>');
467
-		print("<input type='radio' id='radio_overwrite_files' name='radio_overwrite' value='overwrite'>{$mod_strings['LBL_OVERWRITE_FILES']}&nbsp;");
468
-		print("<input type='radio' id='radio_do_not_overwrite_files' name='radio_overwrite' value='do_not_overwrite' checked>{$mod_strings['LBL_DO_OVERWRITE_FILES']}");
469
-		print("</td></tr></table>");
470
-		print('<ul>');
471
-		foreach($modified_files as $modified_file){
472
-			print('<li>'.$modified_file.'</li>');
473
-		}
474
-		print('</ul>');
475
-	}else{
476
-		echo '<script>' .
477
-	        'function handleFileChange(){';
478
-		echo 'return true;';
479
-		echo '}</script>';
480
-	}
461
+        }else{
462
+            echo 'return true;';
463
+        }
464
+        echo '}</script>';
465
+        print('<b>'.$mod_strings['ML_LBL_OVERWRITE_FILES'].'</b>');
466
+        print('<table><td align="left" valign="top" colspan=2>');
467
+        print("<input type='radio' id='radio_overwrite_files' name='radio_overwrite' value='overwrite'>{$mod_strings['LBL_OVERWRITE_FILES']}&nbsp;");
468
+        print("<input type='radio' id='radio_do_not_overwrite_files' name='radio_overwrite' value='do_not_overwrite' checked>{$mod_strings['LBL_DO_OVERWRITE_FILES']}");
469
+        print("</td></tr></table>");
470
+        print('<ul>');
471
+        foreach($modified_files as $modified_file){
472
+            print('<li>'.$modified_file.'</li>');
473
+        }
474
+        print('</ul>');
475
+    }else{
476
+        echo '<script>' .
477
+            'function handleFileChange(){';
478
+        echo 'return true;';
479
+        echo '}</script>';
480
+    }
481 481
 }else{
482
-	echo '<script>' .
482
+    echo '<script>' .
483 483
         'function handleFileChange(){';
484
-	echo 'return true;';
485
-	echo '}</script>';
484
+    echo 'return true;';
485
+    echo '}</script>';
486 486
 }
487 487
 echo '<script>' .
488
-         		'function validateForm(process){'.
489
-         			'return (handleCommit(process) && handleFileChange());'.
490
-         		'}'.
488
+                    'function validateForm(process){'.
489
+                        'return (handleCommit(process) && handleFileChange());'.
490
+                    '}'.
491 491
                 'function handleCommit(process){
492 492
         if(process == 1) {
493 493
             if(document.getElementById("radio_license_agreement_reject") != null && document.getElementById("radio_license_agreement_accept") != null){
Please login to merge, or discard this patch.
modules/Administration/RebuildJSLang.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -50,6 +50,6 @@
 block discarded – undo
50 50
     LanguageManager::clearLanguageCache();
51 51
 }
52 52
 else{
53
-	sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
53
+    sugar_die($GLOBALS['app_strings']['ERR_NOT_ADMIN']);
54 54
 }
55 55
 ?>
Please login to merge, or discard this patch.
modules/Administration/RepairActivities.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 while ($row != null) {
51 51
     $date_end = $timedate->fromDb($row['date_start'])->modify("+{$row['duration_hours']} hours {$row['duration_minutes']} mins")->asDb();
52 52
     $updateQuery = "UPDATE calls set calls.date_end='{$date_end}' where calls.id='{$row['id']}'";
53
-	$call = new Call();
53
+    $call = new Call();
54 54
     $call->db->query($updateQuery);
55 55
     $row = $callBean->db->fetchByAssoc($result);
56 56
 }
@@ -62,8 +62,8 @@  discard block
 block discarded – undo
62 62
 $row = $meetingBean->db->fetchByAssoc($result);
63 63
 while ($row != null) {
64 64
     $date_end = $timedate->fromDb($row['date_start'])->modify("+{$row['duration_hours']} hours {$row['duration_minutes']} mins")->asDb();
65
-	$updateQuery = "UPDATE meetings set meetings.date_end='{$date_end}' where meetings.id='{$row['id']}'";
66
-	$call = new Call();
65
+    $updateQuery = "UPDATE meetings set meetings.date_end='{$date_end}' where meetings.id='{$row['id']}'";
66
+    $call = new Call();
67 67
     $call->db->query($updateQuery);
68 68
     $row = $callBean->db->fetchByAssoc($result);
69 69
 }
Please login to merge, or discard this patch.
modules/Administration/ExportCustomFieldStructure.php 1 patch
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -44,10 +44,10 @@
 block discarded – undo
44 44
 $fields = array();
45 45
 $str = '';
46 46
 while($row = $db->fetchByAssoc($result)){
47
-	foreach($row as $name=>$value){
48
-		$str.= "$name:::$value\n";
49
-	}
50
-	$str .= "DONE\n";
47
+    foreach($row as $name=>$value){
48
+        $str.= "$name:::$value\n";
49
+    }
50
+    $str .= "DONE\n";
51 51
 }
52 52
 ob_get_clean();
53 53
 
Please login to merge, or discard this patch.