Пример #1
0
 private function addAmazonMarketplacesNotUpdatedNotificationMessage(Ess_M2ePro_Controller_Adminhtml_BaseController $controller)
 {
     $outdatedMarketplaces = Mage::helper('M2ePro/Data_Cache_Permanent')->getValue('amazon_outdated_marketplaces');
     if ($outdatedMarketplaces === false) {
         $resource = Mage::getSingleton('core/resource');
         $readConn = $resource->getConnection('core_read');
         $dictionaryTable = $resource->getTableName('m2epro_amazon_dictionary_marketplace');
         $rows = $readConn->select()->from($dictionaryTable, 'marketplace_id')->where('client_details_last_update_date IS NOT NULL')->where('server_details_last_update_date IS NOT NULL')->where('client_details_last_update_date < server_details_last_update_date')->query();
         $ids = array();
         foreach ($rows as $row) {
             $ids[] = $row['marketplace_id'];
         }
         $marketplacesCollection = Mage::helper('M2ePro/Component_Amazon')->getCollection('Marketplace')->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE)->addFieldToFilter('id', array('in' => $ids))->setOrder('sorder', 'ASC');
         $outdatedMarketplaces = array();
         /* @var $marketplace Ess_M2ePro_Model_Marketplace */
         foreach ($marketplacesCollection as $marketplace) {
             $outdatedMarketplaces[] = $marketplace->getTitle();
         }
         Mage::helper('M2ePro/Data_Cache_Permanent')->setValue('amazon_outdated_marketplaces', $outdatedMarketplaces, array('amazon', 'marketplace'), 60 * 60 * 24);
     }
     if (count($outdatedMarketplaces) <= 0) {
         return;
     }
     // M2ePro_TRANSLATIONS
     // %marketplace_title% data was changed on Amazon. You need to synchronize it the Extension works properly. Please, go to %menu_label% > <a href="%url%" target="_blank">Marketplaces</a> and click the Update All Button.
     $message = '%marketplace_title% data was changed on Amazon. You need to synchronize it ' . 'the Extension works properly. Please, go to %menu_path% > ' . '<a href="%url%" target="_blank">Marketplaces</a> and click the Update All Button.';
     $controller->getSession()->addNotice(Mage::helper('M2ePro')->__($message, implode(', ', $outdatedMarketplaces), Mage::helper('M2ePro/View_Common')->getMenuPath('configuration'), $controller->getUrl('*/adminhtml_common_marketplace', array('tab' => Ess_M2ePro_Helper_Component_Amazon::NICK))));
 }
Пример #2
0
 private function addCronErrorMessage(Ess_M2ePro_Controller_Adminhtml_BaseController $controller)
 {
     $url = 'http://support.m2epro.com/knowledgebase/articles/';
     $url .= '162927-why-cron-job-is-required-for-amazon-and-rakuten-co';
     // M2ePro_TRANSLATIONS
     // Attention! AUTOMATIC synchronization is not running at the moment.<br/>Please check this <a href="%url% target="_blank">article</a> to learn why it is required.
     $message = 'Attention! AUTOMATIC synchronization is not running at the moment.';
     $message .= '<br/>Please check this <a href="%url% target="_blank">article</a> ';
     $message .= 'to learn why it is required.';
     $message = Mage::helper('M2ePro')->__($message, $url);
     $controller->getSession()->addError($message);
 }
Пример #3
0
 private function addCronErrorMessage(Ess_M2ePro_Controller_Adminhtml_BaseController $controller)
 {
     if (Mage::getModel('M2ePro/Cron')->isShowError()) {
         $url = 'http://support.m2epro.com/knowledgebase/articles/';
         $url .= '162927-why-cron-job-is-required-for-amazon-and-rakuten-co';
         $startLinkArticle = '<a href="' . $url . '" target="_blank">';
         $endLink = '</a>';
         $message = 'Attention! The Cron job is not running at the moment. ';
         $message .= 'The Amazon/Rakuten.com/Play.com Integration DOES NOT WORK ';
         $message .= 'without automatic task scheduled by cron job. <br/>You can check this %sarticle%s ';
         $message .= 'to get better idea why cron job is mandatory.';
         $message = Mage::helper('M2ePro')->__($message, $startLinkArticle, $endLink);
         $controller->getSession()->addError($message);
         return true;
     }
     return false;
 }
Пример #4
0
 protected function addContent(Mage_Core_Block_Abstract $block)
 {
     if ($this->getRequest()->isGet() && !$this->getRequest()->isPost() && !$this->getRequest()->isXmlHttpRequest()) {
         if ($this->isContentLocked()) {
             return $this;
         }
     }
     return parent::addContent($block);
 }
 protected function _addContent(Mage_Core_Block_Abstract $block)
 {
     if ($this->getRequest()->isGet() && !$this->getRequest()->isPost() && !$this->getRequest()->isXmlHttpRequest() && Mage::getModel('M2ePro/License_Model')->isLock()) {
         return $this;
     }
     $blockGeneral = $this->getLayout()->createBlock('M2ePro/adminhtml_general');
     $this->getLayout()->getBlock('content')->append($blockGeneral);
     return parent::_addContent($block);
 }
 public function loadLayout($ids = null, $generateBlocks = true, $generateXml = true)
 {
     if ($this->getRequest()->isGet() && !$this->getRequest()->isPost() && !$this->getRequest()->isXmlHttpRequest()) {
         $this->addDevelopmentNotification();
         $this->addMaintenanceNotification();
     }
     $tempResult = parent::loadLayout($ids, $generateBlocks, $generateXml);
     $tempResult->_title(Mage::helper('M2ePro/View_Development')->getTitle());
     return $tempResult;
 }
Пример #7
0
 protected function _addContent(Mage_Core_Block_Abstract $block)
 {
     if ($this->getRequest()->isGet() && !$this->getRequest()->isPost() && !$this->getRequest()->isXmlHttpRequest() && Mage::helper('M2ePro/Module')->isLockedByServer()) {
         return $this;
     }
     $blockGeneral = $this->getLayout()->createBlock('M2ePro/adminhtml_general');
     $this->getLayout()->getBlock('content')->append($blockGeneral);
     $this->addWizardUpgradeNotification();
     return parent::_addContent($block);
 }
 public function loadLayout($ids = null, $generateBlocks = true, $generateXml = true)
 {
     $tempResult = parent::loadLayout($ids, $generateBlocks, $generateXml);
     if ($this->getRequest()->getParam('referrer') == Ess_M2ePro_Helper_View_Ebay::NICK) {
         $tempResult->_setActiveMenu(Ess_M2ePro_Helper_View_Ebay::MENU_ROOT_NODE_NICK);
         $tempResult->_title(Mage::helper('M2ePro/View_Ebay')->getMenuRootNodeLabel());
     }
     if ($this->getRequest()->getParam('referrer') == Ess_M2ePro_Helper_View_Common::NICK) {
         $tempResult->_setActiveMenu(Ess_M2ePro_Helper_View_Common::MENU_ROOT_NODE_NICK);
         $tempResult->_title(Mage::helper('M2ePro/View_Common')->getMenuRootNodeLabel());
     }
     return $tempResult;
 }
Пример #9
0
 public function preDispatch()
 {
     parent::preDispatch();
     Mage::getSingleton('M2ePro/Order_Log_Manager')->setInitiator(Ess_M2ePro_Helper_Data::INITIATOR_USER);
 }
Пример #10
0
 private function addMarketplacesCategoriesVersionNotificationMessage(Ess_M2ePro_Controller_Adminhtml_BaseController $controller)
 {
     $outdatedMarketplaces = Mage::helper('M2ePro/Data_Cache')->getValue('outdated_marketplaces');
     if ($outdatedMarketplaces === false) {
         $readConn = Mage::getSingleton('core/resource')->getConnection('core_read');
         $dictionaryTable = Mage::getSingleton('core/resource')->getTableName('m2epro_ebay_dictionary_marketplace');
         $rows = $readConn->select()->from($dictionaryTable, 'marketplace_id')->where('client_categories_version IS NOT NULL')->where('server_categories_version IS NOT NULL')->where('client_categories_version < server_categories_version')->query();
         $ids = array();
         foreach ($rows as $row) {
             $ids[] = $row['marketplace_id'];
         }
         $marketplacesCollection = Mage::helper('M2ePro/Component_Ebay')->getCollection('Marketplace')->addFieldToFilter('id', array('in' => $ids));
         $outdatedMarketplaces = array();
         /* @var $marketplace Ess_M2ePro_Model_Marketplace */
         foreach ($marketplacesCollection as $marketplace) {
             $outdatedMarketplaces[] = $marketplace->getTitle();
         }
         Mage::helper('M2ePro/Data_Cache')->setValue('outdated_marketplaces', $outdatedMarketplaces, array('ebay', 'marketplace'), 60 * 60 * 24);
     }
     if (count($outdatedMarketplaces) <= 0) {
         return;
     }
     $message = '%s data was changed on eBay. You need to synchronize it the extension works properly.
                 Please, go to %s > Configuration >
                 <a href="%s" target="_blank">eBay Sites</a> and click the Save And Update button.';
     $controller->getSession()->addNotice(Mage::helper('M2ePro')->__($message, implode(', ', $outdatedMarketplaces), Mage::helper('M2ePro/View_Ebay')->getMenuRootNodeLabel(), $controller->getUrl('*/adminhtml_ebay_marketplace', array('tab' => Ess_M2ePro_Block_Adminhtml_Ebay_Configuration_Tabs::TAB_ID_MARKETPLACE))));
 }
Пример #11
0
 public function postDispatch()
 {
     parent::postDispatch();
     $block = $this->loadLayout()->getLayout()->createBlock('M2ePro/adminhtml_cmd_footer');
     $this->getResponse()->appendBody($block->toHtml());
 }