Пример #1
0
// Remove the MigrationStep0.tpl file from Smarty cache
$migration_tpl_file = get_smarty_compiled_file('MigrationStep0.tpl');
if ($migration_tpl_file != null) {
    unlink($migration_tpl_file);
}
global $adb, $default_charset, $theme;
$theme_path = "themes/" . $theme . "/";
$image_path = $theme_path . "images/";
$smarty = new vtigerCRM_Smarty();
$smarty->assign("MOD", $mod_strings);
$smarty->assign("APP", $app_strings);
$smarty->assign("MODULE", "Migration");
$smarty->assign("THEME", $theme);
$smarty->assign("IMAGE_PATH", $image_path);
if ($adb->isPostgres()) {
    $db_status = '1';
} else {
    $db_status = check_db_utf8_support($adb);
}
$config_status = get_config_status();
$smarty->assign("DB_CHARSET", get_db_charset($adb));
$smarty->assign("DB_STATUS", $db_status);
$smarty->assign("CONFIG_CHARSET", $default_charset);
$smarty->assign("CONFIG_STATUS", $config_status);
$data_conversion_msg = array('1' => array('msg1' => '', 'msg2' => '', 'checked' => 'true'), '2' => array('msg1' => "To have complete UTF-8 support:- <ol><li>Set \$default_charset='UTF-8'; in config.inc.php </li><li>Select the check box below for database charset handling and data conversion.</li></ol>", 'msg2' => 'To continue without UTF-8 support, keep the above option unchecked.', 'checked' => 'false'), '3' => array('msg1' => "To have complete UTF-8 support, we recommend you to set \$default_charset='UTF-8'; in config.inc.php.", 'msg2' => "Select the above check box after changing the config file, if you need UTF-8 data conversion (Unicode support).", 'checked' => 'false'), '4' => array('msg1' => "UTF-8 should be enabled for database to have complete unicode support. This will be handled in data conversion to UTF-8.", 'msg2' => "De-select the above check box, if you do not need UTF-8 data conversion (Unicode support will be inconsistent).", 'checked' => 'true'));
$db_migration_status = getMigrationCharsetFlag();
if ($db_migration_status == MIG_CHARSET_PHP_UTF8_DB_UTF8) {
    header("Location: index.php?module=Migration&action=index&parenttab=Settings");
}
$smarty->assign("CONVERSION_MSG", $data_conversion_msg[$db_migration_status]);
$smarty->display("MigrationStep0.tpl");
Пример #2
0
        include $filename;
        //include the file which contains the corresponding db changes
        echo $start_tag . $temp[$patch_count] . " ==> " . $temp[$patch_count + 1] . " Database changes -- Ends." . $end_tag;
    } elseif (isset($temp[$patch_count + 1])) {
        echo $empty_tag . $start_tag . "There is no Database Changes from " . $temp[$patch_count] . " ==> " . $temp[$patch_count + 1] . $end_tag;
    } else {
        //No file available or Migration not provided for this release
        //echo '<br>No Migration / No File ==> '.$filename;
    }
    if ($adb->isMySQL()) {
        @(include_once 'modules/Migration/Performance/' . $temp[$patch_count + 1] . '_mysql.php');
    } elseif ($adb->isPostgres()) {
        @(include_once 'modules/Migration/Performance/' . $temp[$patch_count + 1] . '_postgres.php');
    }
}
if (getMigrationCharsetFlag() == MIG_CHARSET_PHP_UTF8_DB_UTF8) {
    echo '</table><br><br>';
    include "modules/Migration/HTMLtoUTF8Conversion.php";
}
if (!isset($continue_42P2)) {
    echo '</table>';
    echo '<br><br><b style="color:#FF0000">Failed Queries Log</b>
		<div id="failedLog" style="border:1px solid #666666;width:90%;position:relative;height:200px;overflow:auto;left:5%;top:10px;">';
    if (is_array($failure_query_array)) {
        foreach ($failure_query_array as $failed_query) {
            echo '<br><font color="red">' . $failed_query . ';</font>';
        }
    } else {
        echo '<br> No queries failed during Patch Update.';
    }
    echo '<br></div>';
Пример #3
0
 * The Original Code is:  vtiger CRM Open Source
 * The Initial Developer of the Original Code is vtiger.
 * Portions created by vtiger are Copyright (C) vtiger.
 * All Rights Reserved.
 *
********************************************************************************/
global $current_user;
if ($current_user->is_admin != 'on') {
    die("<br><br><center>" . $app_strings['LBL_PERMISSION'] . " <a href='javascript:window.history.back()'>" . $app_strings['LBL_GO_BACK'] . ".</a></center>");
}
// Remove the Migration.tpl file from Smarty cache
$migration_tpl_file = get_smarty_compiled_file('Migration.tpl');
if ($migration_tpl_file != null) {
    unlink($migration_tpl_file);
}
if (getMigrationCharsetFlag() != MIG_CHARSET_PHP_UTF8_DB_UTF8 && !isset($_REQUEST['migration_charstcheck'])) {
    include 'modules/Migration/MigrationStep0.php';
    exit;
}
include "modules/Migration/versions.php";
require_once 'Smarty_setup.php';
global $app_strings, $app_list_strings, $mod_strings, $theme, $currentModule;
include "vtigerversion.php";
//Check the current version before starting migration. If the current versin is latest, then we wont allow to do 5.x migration. But here we must allow for 4.x migration. Because 4.x migration can be done with out changing the current database. -Shahul
$status = true;
$exists = $adb->query("show create table vtiger_version");
if ($exists) {
    $result = $adb->query("select * from vtiger_version");
    $dbversion = $adb->query_result($result, 0, 'current_version');
    if ($dbversion == $vtiger_current_version) {
        $status = false;