Skip to content

Commit a84f4a9

Browse files
author
John Mertic
committed
Release 6.2.0
1 parent 0b03698 commit a84f4a9

File tree

4,094 files changed

+213161
-147264
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,094 files changed

+213161
-147264
lines changed

HandleAjaxCall.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
33
/*********************************************************************************
4-
* SugarCRM is a customer relationship management program developed by
4+
* SugarCRM Community Edition is a customer relationship management program developed by
55
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
66
*
77
* This program is free software; you can redistribute it and/or modify it under

ModuleInstall/ModuleInstaller.php

Lines changed: 22 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
33
/*********************************************************************************
4-
* SugarCRM is a customer relationship management program developed by
4+
* SugarCRM Community Edition is a customer relationship management program developed by
55
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
66
*
77
* This program is free software; you can redistribute it and/or modify it under
@@ -224,10 +224,13 @@ function install($base_dir, $is_upgrade = false, $previous_version = ''){
224224
$rac = new RepairAndClear();
225225
$rac->repairAndClearAll($selectedActions, $installed_modules,true, false);
226226
$this->rebuild_relationships();
227-
$this->log('<br><b>' . translate('LBL_MI_COMPLETE') . '</b>');
228-
229227
UpdateSystemTabs('Add',$tab_modules);
230-
228+
229+
//clear the unified_search_module.php file
230+
require_once('modules/Home/UnifiedSearchAdvanced.php');
231+
UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
232+
233+
$this->log('<br><b>' . translate('LBL_MI_COMPLETE') . '</b>');
231234
}else{
232235
die("No \$installdefs Defined In $this->base_dir/manifest.php");
233236
}
@@ -337,7 +340,9 @@ function uninstall_new_files($cp, $backup_path){
337340
//if it's not a sugar file then we remove it otherwise we can't restor it
338341
if(!$this->ms->sugarFileExists($to)){
339342
$GLOBALS['log']->debug('ModuleInstaller[uninstall_new_file] deleting file ' . $to);
340-
unlink($to);
343+
if(file_exists($to)) {
344+
unlink($to);
345+
}
341346
}else{
342347
$GLOBALS['log']->fatal('ModuleInstaller[uninstall_new_file] Could not remove file ' . $to . ' as no backup file was found to restore to');
343348
}
@@ -1261,6 +1266,10 @@ function uninstall($base_dir){
12611266

12621267
UpdateSystemTabs('Restore',$installed_modules);
12631268

1269+
//clear the unified_search_module.php file
1270+
require_once('modules/Home/UnifiedSearchAdvanced.php');
1271+
UnifiedSearchAdvanced::unlinkUnifiedSearchModulesFile();
1272+
12641273
$this->log('<br><b>' . translate('LBL_MI_COMPLETE') . '</b>');
12651274
if(!$this->silent){
12661275
update_progress_bar('install', $total_steps, $total_steps);
@@ -1289,6 +1298,7 @@ function rebuild_vardefs(){
12891298
$this->merge_files('Ext/Vardefs/', 'vardefs.ext.php');
12901299
sugar_cache_reset();
12911300
}
1301+
12921302
function rebuild_layoutdefs(){
12931303
$this->log(translate('LBL_MI_REBUILDING') . " Layoutdefs...");
12941304
$this->merge_files('Ext/Layoutdefs/', 'layoutdefs.ext.php');
@@ -1302,12 +1312,12 @@ function rebuild_menus(){
13021312

13031313
function rebuild_dashletcontainers(){
13041314
$this->log(translate('LBL_MI_REBUILDING') . " DC Actions...");
1305-
$this->merge_files('Ext/DashletContainer/Containers', 'dcactions.ext.php');
1315+
$this->merge_files('Ext/DashletContainer/Containers/', 'dcactions.ext.php');
13061316
}
13071317

13081318
function rebuild_modules(){
13091319
$this->log(translate('LBL_MI_REBUILDING') . " Modules...");
1310-
$this->merge_files('Ext/Include', 'modules.ext.php', '', true);
1320+
$this->merge_files('Ext/Include/', 'modules.ext.php', '', true);
13111321
}
13121322

13131323
function rebuild_administration(){
@@ -1400,18 +1410,14 @@ function merge_files($path, $name, $filter = '', $application = false){
14001410
if (substr($entry, 0, 9) == '_override') {
14011411
$override[] = $entry;
14021412
} else {
1403-
$fp = sugar_fopen($module_install . '/' . $entry, 'r');
1404-
$file = fread($fp , filesize($module_install . '/' . $entry));
1413+
$file = file_get_contents($module_install . '/' . $entry);
14051414
$GLOBALS['log']->debug(get_class($this)."->merge_files(): found {$module_install}{$entry}") ;
1406-
fclose($fp);
14071415
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
14081416
}
14091417
}
14101418
}
14111419
foreach ($override as $entry) {
1412-
$fp = sugar_fopen($module_install . '/' . $entry, 'r');
1413-
$file = fread($fp , filesize($module_install . '/' . $entry));
1414-
fclose($fp);
1420+
$file = file_get_contents($module_install . '/' . $entry);
14151421
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
14161422
}
14171423
}
@@ -1446,9 +1452,7 @@ function merge_files($path, $name, $filter = '', $application = false){
14461452
if((empty($filter) || substr_count($entry, $filter) > 0) && is_file($module_install.'/'.$entry)
14471453
&& $entry != '.' && $entry != '..' && strtolower(substr($entry, -4)) == ".php")
14481454
{
1449-
$fp = sugar_fopen($module_install . '/' . $entry, 'r');
1450-
$file = fread($fp , filesize($module_install . '/' . $entry));
1451-
fclose($fp);
1455+
$file = file_get_contents($module_install . '/' . $entry);
14521456
$extension .= "\n". str_replace(array('<?php', '?>', '<?PHP', '<?'), array('','', '' ,'') , $file);
14531457
}
14541458
}
@@ -1624,6 +1628,7 @@ private function dir_get_files($path, $base_path){
16241628
private function dir_file_count($path){
16251629
//if its a file then it has at least 1 file in the directory
16261630
if(is_file($path)) return 1;
1631+
if(!is_dir($path)) return 0;
16271632
$d = dir($path);
16281633
$count = 0;
16291634
while ($e = $d->read()){
@@ -1992,7 +1997,7 @@ function disable_relationships($action = 'disable'){
19921997
$path ='custom/Extension/' . $relationship['module']. '/Ext/Layoutdefs';
19931998
}
19941999
}
1995-
2000+
19962001
if(!empty($relationship['module_layoutdefs']) && file_exists($path . '/'. $this->id_name . '.php')){
19972002
mkdir_recursive($path . '/'.DISABLED_PATH, true);
19982003
rename( $path . '/'. $this->id_name . '.php', $path . '/'.DISABLED_PATH.'/'. $this->id_name . '.php');

ModuleInstall/ModuleScanner.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
33
/*********************************************************************************
4-
* SugarCRM is a customer relationship management program developed by
4+
* SugarCRM Community Edition is a customer relationship management program developed by
55
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
66
*
77
* This program is free software; you can redistribute it and/or modify it under
@@ -281,7 +281,8 @@ public function scanFile($file){
281281
*/
282282
public function sugarFileExists($path){
283283
static $md5 = array();
284-
if(empty($md5)){
284+
if(empty($md5) && file_exists('files.md5'))
285+
{
285286
include('files.md5');
286287
$md5 = $md5_string;
287288
}

ModuleInstall/PackageManager/ListViewPackages.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*********************************************************************************
3-
* SugarCRM is a customer relationship management program developed by
3+
* SugarCRM Community Edition is a customer relationship management program developed by
44
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it under

ModuleInstall/PackageManager/PackageController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*********************************************************************************
3-
* SugarCRM is a customer relationship management program developed by
3+
* SugarCRM Community Edition is a customer relationship management program developed by
44
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it under

ModuleInstall/PackageManager/PackageManager.php

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*********************************************************************************
3-
* SugarCRM is a customer relationship management program developed by
3+
* SugarCRM Community Edition is a customer relationship management program developed by
44
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it under
@@ -233,7 +233,7 @@ function authenticate($username, $password, $systemname='', $terms_checked = tru
233233
}
234234

235235
function setCredentials($username, $password, $systemname){
236-
236+
237237
$admin = new Administration();
238238
$admin->retrieveSettings();
239239
$admin->saveSetting(CREDENTIAL_CATEGORY, CREDENTIAL_USERNAME, $username);
@@ -244,7 +244,7 @@ function setCredentials($username, $password, $systemname){
244244
}
245245

246246
function getCredentials(){
247-
247+
248248
$admin = new Administration();
249249
$admin->retrieveSettings(CREDENTIAL_CATEGORY, true);
250250
$credentials = array();
@@ -619,7 +619,7 @@ function getUITextForType( $type ){
619619
}
620620

621621
function getImageForType( $type ){
622-
622+
623623
$icon = "";
624624
switch( $type ){
625625
case "full":
@@ -664,7 +664,7 @@ function getPackagesInStaging($view = 'module'){
664664
$alreadyProcessed["$val"] = true;
665665
}
666666
}
667-
667+
668668
$upgrades_available = 0;
669669
$packages = array();
670670
$mod_strings = return_module_language($current_language, "Administration");
@@ -703,7 +703,7 @@ function getPackagesInStaging($view = 'module'){
703703

704704
//check dependencies first
705705
if(!empty($dependencies)){
706-
706+
707707
$uh = new UpgradeHistory();
708708
$not_found = $uh->checkDependencies($dependencies);
709709
if(!empty($not_found) && count($not_found) > 0){
@@ -736,7 +736,7 @@ function getPackagesInStaging($view = 'module'){
736736
$c = count($fileS);
737737
$fileName = (isset($fileS[$c-1]) && !empty($fileS[$c-1])) ? $fileS[$c-1] : $fileS[$c-2];
738738
$upload_file = $sugar_config['upload_dir'].$fileName;
739-
739+
740740
$upgrade_content = urlencode($upgrade_content);
741741
$upload_content = urlencode($upload_file);
742742
$packages[] = array('name' => $name, 'version' => $version, 'published_date' => $published_date, 'description' => $description, 'uninstallable' =>$uninstallable, 'type' => $type, 'file_install' => fileToHash($file_install), 'file' => fileToHash($upgrade_content), 'upload_file' => $upload_content);
@@ -751,9 +751,7 @@ function getLicenseFromFile($file){
751751
$base_tmp_upgrade_dir = "$base_upgrade_dir/temp";
752752
$license_file = $this->extractFile($file, 'LICENSE.txt', $base_tmp_upgrade_dir);
753753
if(is_file($license_file)){
754-
$fh = sugar_fopen($license_file, 'r');
755-
$contents = fread($fh, filesize($license_file));
756-
fclose($fh);
754+
$contents = file_get_contents($license_file);
757755
return $contents;
758756
}else{
759757
return null;
@@ -856,15 +854,15 @@ function getinstalledPackages($types = array('module', 'langpack')){
856854
} else {
857855
$file_uninstall = fileToHash( $file_uninstall );
858856
}
859-
857+
860858
$packages[] = array(
861-
'name' => $name,
862-
'version' => $version,
863-
'type' => $type,
864-
'published_date' => $date_entered,
865-
'description' => $description,
866-
'uninstallable' =>$uninstallable,
867-
'file_install' => $file_uninstall ,
859+
'name' => $name,
860+
'version' => $version,
861+
'type' => $type,
862+
'published_date' => $date_entered,
863+
'description' => $description,
864+
'uninstallable' =>$uninstallable,
865+
'file_install' => $file_uninstall ,
868866
'file' => fileToHash($filename),
869867
'enabled' => $enabled_string
870868
);

ModuleInstall/PackageManager/PackageManagerComm.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*********************************************************************************
3-
* SugarCRM is a customer relationship management program developed by
3+
* SugarCRM Community Edition is a customer relationship management program developed by
44
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it under

ModuleInstall/PackageManager/PackageManagerDisplay.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*********************************************************************************
3-
* SugarCRM is a customer relationship management program developed by
3+
* SugarCRM Community Edition is a customer relationship management program developed by
44
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it under
@@ -324,9 +324,7 @@ function buildTreeView($div_id, $isAlive = true){
324324
function getLicenseDisplay($license_file, $form_action, $next_step, $zipFile, $type, $manifest, $modify_field){
325325
global $current_language;
326326
$mod_strings = return_module_language($current_language, "Administration");
327-
$fh = sugar_fopen($license_file, 'r');
328-
$contents = fread($fh, filesize($license_file));
329-
fclose($fh);
327+
$contents = sugar_file_get_contents($license_file);
330328
$div_id = urlencode($zipFile);
331329
$display = "<form name='delete{$zipFile}' action='{$form_action}' method='POST'>";
332330
$display .= "<input type='hidden' name='current_step' value='{$next_step}'>";

ModuleInstall/PackageManager/PackageManagerDownloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*********************************************************************************
3-
* SugarCRM is a customer relationship management program developed by
3+
* SugarCRM Community Edition is a customer relationship management program developed by
44
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it under

ModuleInstall/PackageManager/metadata/listviewdefs.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22
/*********************************************************************************
3-
* SugarCRM is a customer relationship management program developed by
3+
* SugarCRM Community Edition is a customer relationship management program developed by
44
* SugarCRM, Inc. Copyright (C) 2004-2011 SugarCRM Inc.
55
*
66
* This program is free software; you can redistribute it and/or modify it under

0 commit comments

Comments
 (0)