コード例 #1
0
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to http://www.prestashop.com for more information.
 *
 *  @author    PrestaShop SA <contact@prestashop.com>
 *  @copyright 2007-2015 PrestaShop SA
 *  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 *  International Registered Trademark & Property of PrestaShop SA
 */
include dirname(__FILE__) . '/../../../config/config.inc.php';
require_once dirname(__FILE__) . '/../../../init.php';
include '../ebay.php';
if (!Tools::getValue('token') || Tools::getValue('token') != Configuration::get('EBAY_SECURITY_TOKEN')) {
    die('ERROR: Invalid Token');
}
$ebay = new eBay();
$context = Context::getContext();
$tab = new EbayFormCategoryTab($ebay, $context->smarty);
$tab->postProcess();
コード例 #2
0
ファイル: ebay.php プロジェクト: anantha89/gpprestashop
 /**
  * Form Config Methods
  *
  **/
 private function _displayFormConfig()
 {
     $form_parameters_tab = new EbayFormParametersTab($this, $this->smarty, $this->context);
     $form_advanced_parameters_tab = new EbayFormAdvancedParametersTab($this, $this->smarty, $this->context);
     $form_category_tab = new EbayFormCategoryTab($this, $this->smarty, $this->context, $this->_path);
     $form_items_specifics_tab = new EbayFormItemsSpecificsTab($this, $this->smarty, $this->context, $this->_path);
     $form_shipping_tab = new EbayFormShippingTab($this, $this->smarty, $this->context);
     $form_template_manager_tab = new EbayFormTemplateManagerTab($this, $this->smarty, $this->context);
     $form_ebay_sync_tab = new EbayFormEbaySyncTab($this, $this->smarty, $this->context);
     $form_ebay_order_history_tab = new EbayOrderHistoryTab($this, $this->smarty, $this->context);
     $help_tab = new EbayHelpTab($this, $this->smarty, $this->context);
     $listings_tab = new EbayListingsTab($this, $this->smarty, $this->context);
     $orders_sync = new EbayOrdersSyncTab($this, $this->smarty, $this->context);
     $ps_products = new EbayPrestashopProductsTab($this, $this->smarty, $this->context);
     $orphan_listings = new EbayOrphanListingsTab($this, $this->smarty, $this->context);
     $form_store_category_tab = new EbayFormStoreCategoryTab($this, $this->smarty, $this->context, $this->_path);
     $api_logs = new EbayApiLogsTab($this, $this->smarty, $this->context, $this->_path);
     $order_logs = new EbayOrderLogsTab($this, $this->smarty, $this->context, $this->_path);
     // test if everything is green
     if ($this->ebay_profile && $this->ebay_profile->isAllSettingsConfigured()) {
         if (!$this->ebay_profile->getConfiguration('EBAY_HAS_SYNCED_PRODUCTS')) {
             $green_message = $this->l('Your profile is ready to go, go to Synchronization to list your products');
         } elseif (!empty($_POST) && Tools::isSubmit('submitSave')) {
             // config has changed
             $green_message = $this->l('To implement these changes on active listings you need to resynchronize your items');
         }
     }
     $cron_task = array();
     if ((int) Configuration::get('EBAY_SYNC_PRODUCTS_BY_CRON') == 1) {
         $cron_task['products']['is_active'] = 1;
         if ($last_sync_datetime = Configuration::get('DATE_LAST_SYNC_PRODUCTS')) {
             $warning_date = strtotime(date('Y-m-d') . ' - 2 days');
             $cron_task['products']['last_sync'] = array('date' => date('Y-m-d', strtotime($last_sync_datetime)), 'time' => date('H:i:s', strtotime($last_sync_datetime)), 'warning_long_since' => (bool) (strtotime($last_sync_datetime) < $warning_date));
             $cron_task['products']['last_sync']['nb_products'] = Configuration::get('NB_PRODUCTS_LAST');
         } else {
             $cron_task['products']['last_sync'] = 'none';
         }
     }
     if ((int) Configuration::get('EBAY_SYNC_ORDERS_BY_CRON') == 1) {
         $cron_task['orders']['is_active'] = 1;
         if ($this->ebay_profile->getConfiguration('EBAY_ORDER_LAST_UPDATE') != null) {
             $datetime = new DateTime($this->ebay_profile->getConfiguration('EBAY_ORDER_LAST_UPDATE'));
             $cron_task['orders']['last_sync'] = array('date' => date('Y-m-d', strtotime($datetime->format('Y-m-d H:i:s'))), 'time' => date('H:i:s', strtotime($datetime->format('Y-m-d H:i:s'))));
             $datetime2 = new DateTime();
             $interval = $datetime->diff($datetime2);
             $cron_task['orders']['alert'] = $interval->format('%a') >= 1 ? 'danger' : 'info';
         } else {
             $cron_task['orders']['last_sync'] = 'none';
         }
     }
     $smarty_vars = array('class_general' => version_compare(_PS_VERSION_, '1.5', '>') ? 'uncinq' : 'unquatre', 'form_parameters' => $form_parameters_tab->getContent(), 'form_advanced_parameters' => $form_advanced_parameters_tab->getContent(), 'form_category' => $form_category_tab->getContent(), 'form_items_specifics' => $form_items_specifics_tab->getContent(), 'form_shipping' => $form_shipping_tab->getContent(), 'form_template_manager' => $form_template_manager_tab->getContent(), 'form_ebay_sync' => $form_ebay_sync_tab->getContent(), 'orders_history' => $form_ebay_order_history_tab->getContent(), 'ebay_listings' => $listings_tab->getContent(), 'form_store_category' => $form_store_category_tab->getContent(), 'orders_sync' => $orders_sync->getContent(), 'ps_products' => $ps_products->getContent(), 'orphan_listings' => $orphan_listings->getContent(), 'green_message' => isset($green_message) ? $green_message : null, 'cron_task' => $cron_task, 'api_logs' => $api_logs->getContent(), 'order_logs' => $order_logs->getContent(), 'id_tab' => Tools::getValue('id_tab'));
     $this->smarty->assign($smarty_vars);
     return $this->display(__FILE__, 'views/templates/hook/formConfig.tpl');
 }
コード例 #3
0
ファイル: ebay.php プロジェクト: kevindesousa/ebay
 /**
  * Form Config Methods
  *
  **/
 private function _displayFormConfig()
 {
     $form_parameters_tab = new EbayFormParametersTab($this, $this->smarty, $this->context);
     $form_advanced_parameters_tab = new EbayFormAdvancedParametersTab($this, $this->smarty, $this->context);
     $form_category_tab = new EbayFormCategoryTab($this, $this->smarty, $this->context, $this->_path);
     $form_items_specifics_tab = new EbayFormItemsSpecificsTab($this, $this->smarty, $this->context, $this->_path);
     $form_shipping_tab = new EbayFormShippingTab($this, $this->smarty, $this->context);
     $form_template_manager_tab = new EbayFormTemplateManagerTab($this, $this->smarty, $this->context);
     $form_ebay_sync_tab = new EbayFormEbaySyncTab($this, $this->smarty, $this->context);
     $form_ebay_order_history_tab = new EbayOrderHistoryTab($this, $this->smarty, $this->context);
     $help_tab = new EbayHelpTab($this, $this->smarty, $this->context);
     $listings_tab = new EbayListingsTab($this, $this->smarty, $this->context);
     $orders_sync = new EbayOrdersSyncTab($this, $this->smarty, $this->context);
     $form_store_category_tab = new EbayFormStoreCategoryTab($this, $this->smarty, $this->context, $this->_path);
     $api_logs = new EbayApiLogsTab($this, $this->smarty, $this->context, $this->_path);
     $order_logs = new EbayOrderLogsTab($this, $this->smarty, $this->context, $this->_path);
     // test if everything is green
     if ($this->ebay_profile && $this->ebay_profile->isAllSettingsConfigured()) {
         if (!$this->ebay_profile->getConfiguration('EBAY_HAS_SYNCED_PRODUCTS')) {
             $green_message = $this->l('Your profile is ready to go, go to Synchronization to list your products');
         } elseif (!empty($_POST) && Tools::isSubmit('submitSave')) {
             // config has changed
             $green_message = $this->l('To implement these changes on active listings you need to resynchronize your items');
         }
     }
     $smarty_vars = array('class_general' => version_compare(_PS_VERSION_, '1.5', '>') ? 'uncinq' : 'unquatre', 'form_parameters' => $form_parameters_tab->getContent(), 'form_advanced_parameters' => $form_advanced_parameters_tab->getContent(), 'form_category' => $form_category_tab->getContent(), 'form_items_specifics' => $form_items_specifics_tab->getContent(), 'form_shipping' => $form_shipping_tab->getContent(), 'form_template_manager' => $form_template_manager_tab->getContent(), 'form_ebay_sync' => $form_ebay_sync_tab->getContent(), 'orders_history' => $form_ebay_order_history_tab->getContent(), 'ebay_listings' => $listings_tab->getContent(), 'form_store_category' => $form_store_category_tab->getContent(), 'orders_sync' => $orders_sync->getContent(), 'green_message' => isset($green_message) ? $green_message : null, 'api_logs' => $api_logs->getContent(), 'order_logs' => $order_logs->getContent(), 'id_tab' => Tools::getValue('id_tab'));
     $this->smarty->assign($smarty_vars);
     return $this->display(__FILE__, 'views/templates/hook/formConfig.tpl');
 }