Пример #1
0
        }
        return array(CONTROLLER_STATUS_REDIRECT, 'store_import.index.step_5');
    } elseif ($action == 'step_6') {
        $step = 6;
        $si_data['store_data'] = $store_data;
        $si_data['step'] = $step;
        $si_data['import_date'] = time();
        General::updateStoreimportSetting($si_data);
    } elseif ($action == 'step_7') {
        //Click to Start new store import. We should reset si data to default.
        Settings::instance()->updateValue('si_data', 'a:1:{s:11:"import_date";s:0:"";}', 'store_import');
        return array(CONTROLLER_STATUS_REDIRECT, 'store_import.index.step_1');
    }
}
if ($step == '2') {
    if (!General::testDatabaseConnection($store_data)) {
        fn_set_notification('E', __('error'), __('store_import.cannot_connect_to_database_server'));
    } else {
        Registry::get('view')->assign('companies_count_from', count(General::getCompanies($store_data)));
    }
    General::connectToOriginalDB();
}
if ($step == '3') {
    $import_result = General::import($store_data);
    if ($import_result) {
        $si_data['store_data'] = $store_data;
        $si_data['step'] = $step;
        $si_data['import_date'] = time();
        General::updateStoreimportSetting($si_data);
        if (defined('AJAX_REQUEST')) {
            Registry::get('ajax')->assign('non_ajax_notifications', true);