Example #1
0
*                                                                          *
* This  is  commercial  software,  only  users  who have purchased a valid *
* license  and  accept  to the terms of the  License Agreement can install *
* and use this program.                                                    *
*                                                                          *
****************************************************************************
* PLEASE READ THE FULL TEXT  OF THE SOFTWARE  LICENSE   AGREEMENT  IN  THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION PACKAGE.            *
****************************************************************************/
use Tygh\Registry;
if (!defined('BOOTSTRAP')) {
    die('Access denied');
}
if ($mode == 'update') {
    $params = array('product_id' => $_REQUEST['product_id']);
    list($templates, $search) = fn_get_ebay_templates($params, 0, DESCR_SL);
    Tygh::$app['view']->assign('ebay_templates', $templates);
} elseif ($mode == 'm_update') {
    $field_groups = Tygh::$app['view']->getTemplateVars('field_groups');
    $filled_groups = Tygh::$app['view']->getTemplateVars('filled_groups');
    $field_names = Tygh::$app['view']->getTemplateVars('field_names');
    if (!empty($field_names['ebay_template_id'])) {
        $params = array();
        unset($field_names['ebay_template_id']);
        $field_groups['S']['ebay_template_id'] = array('name' => 'products_data', 'variants' => fn_get_ebay_templates($params, 0, DESCR_SL, true));
        $filled_groups['S']['ebay_template_id'] = __('ebay_templates');
    }
    Tygh::$app['view']->assign('field_groups', $field_groups);
    Tygh::$app['view']->assign('filled_groups', $filled_groups);
    Tygh::$app['view']->assign('field_names', $field_names);
}
Example #2
0
        }
        if (!$result) {
            fn_set_notification('E', __('error'), __('ebay_export_error'));
        }
        return array(CONTROLLER_STATUS_OK, 'products.manage');
    }
    if ($mode == 'delete_template') {
        if (!empty($_REQUEST['template_id'])) {
            fn_delete_ebay_template($_REQUEST['template_id']);
        }
    }
    return array(CONTROLLER_STATUS_OK, 'ebay.manage');
}
if ($mode == 'manage') {
    $params = $_REQUEST;
    list($templates, $search) = fn_get_ebay_templates($params, Registry::get('settings.Appearance.admin_items_per_page'), DESCR_SL);
    Tygh::$app['view']->assign('templates', $templates);
    Tygh::$app['view']->assign('search', $search);
} elseif ($mode == 'add') {
    $template_data = fn_restore_post_data('template_data');
    if (isset($_REQUEST['site_id'])) {
        $template_data['site_id'] = $_REQUEST['site_id'];
    }
    if (isset($template_data['site_id'])) {
        Ebay::instance()->site_id = $template_data['site_id'];
    }
    // [Page sections]
    Registry::set('navigation.tabs', array('detailed' => array('title' => __('general'), 'js' => true), 'shippings' => array('title' => __('shippings'), 'js' => true), 'payments' => array('title' => __('payments'), 'js' => true), 'returnPolicy' => array('title' => __('return_policy'), 'js' => true)));
    // [/Page sections]
    $ebay_root_categories = fn_get_ebay_categories(0);
    Tygh::$app['view']->assign('ebay_root_categories', $ebay_root_categories);
Example #3
0
        } else {
            fn_set_notification('W', __('warning'), 'no orders found');
        }
    }
    return array(CONTROLLER_STATUS_REDIRECT, 'orders.manage');
} elseif ($mode == 'product_logs') {
    $params = $_REQUEST;
    if (isset($params['product_ids'])) {
        $params['product_ids'] = array_filter(explode(',', $params['product_ids']));
    }
    // Init filter
    $params = \Tygh\Navigation\LastView::instance()->update('ebay_product_logs', $params);
    list($logs, $search) = \Ebay\ProductLogger::getList($params, Registry::get('settings.Appearance.admin_elements_per_page'));
    $types = \Ebay\ProductLogger::getTypes();
    $actions = \Ebay\ProductLogger::getActions();
    $templates = fn_get_ebay_templates(array(), 0, DESCR_SL, true);
    Tygh::$app['view']->assign('logs', $logs);
    Tygh::$app['view']->assign('ebay_types', $types);
    Tygh::$app['view']->assign('ebay_actions', $actions);
    Tygh::$app['view']->assign('ebay_templates', $templates);
    Tygh::$app['view']->assign('search', $search);
} elseif ($mode == 'categories_picker') {
    $company_id = !empty($_REQUEST['company_id']) ? $_REQUEST['company_id'] : null;
    $used_site_ids = \Ebay\Template::getUsedSiteIds($company_id);
    if (isset($_REQUEST['site_id']) && in_array($_REQUEST['site_id'], $used_site_ids)) {
        $current_site_id = $_REQUEST['site_id'];
    } else {
        $current_site_id = reset($used_site_ids);
    }
    $category_id = empty($_REQUEST['category_id']) ? 0 : $_REQUEST['category_id'];
    $category_count = db_get_field("SELECT COUNT(*) FROM ?:ebay_categories WHERE site_id = ?i", $current_site_id);