Exemplo n.º 1
0
 public function getGridHtml()
 {
     $needMigrate = (bool) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/ebay/order/migration_to_v611/', 'is_need_migrate');
     $isMigrationFinished = (bool) Mage::helper('M2ePro/Module')->getConfig()->getGroupValue('/ebay/order/migration_to_v611/', 'is_migration_finished');
     if ($needMigrate && !$isMigrationFinished) {
         /** @var Ess_M2ePro_Model_Upgrade_Migration_ToVersion611_OrdersData $migrationModel */
         $migrationModel = Mage::getModel('M2ePro/Upgrade_Migration_ToVersion611_OrdersData');
         $notMigratedOrdersCount = $migrationModel->getNotMigratedOrdersCount();
         if ($notMigratedOrdersCount > 0) {
             /** @var Ess_M2ePro_Block_Adminhtml_Ebay_Order_MigrationToV611 $migrationBlock */
             $migrationBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_order_migrationToV611');
             $migrationBlock->setNotMigratedOrdersCount($notMigratedOrdersCount);
             return $migrationBlock->toHtml();
         } else {
             $migrationModel->finishMigration();
         }
     }
     //------------------------------
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_order_help');
     $editItemBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_order_item_edit');
     //------------------------------
     //------------------------------
     $marketplaceFilterBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_marketplace_switcher', '', array('component_mode' => Ess_M2ePro_Helper_Component_Ebay::NICK, 'controller_name' => 'adminhtml_ebay_order'));
     $marketplaceFilterBlock->setUseConfirm(false);
     //------------------------------
     //------------------------------
     $accountFilterBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_account_switcher', '', array('component_mode' => Ess_M2ePro_Helper_Component_Ebay::NICK, 'controller_name' => 'adminhtml_ebay_order'));
     $accountFilterBlock->setUseConfirm(false);
     //------------------------------
     //------------------------------
     $orderStateSwitcherBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_order_notCreatedFilter', '', array('component_mode' => Ess_M2ePro_Helper_Component_Ebay::NICK, 'controller' => 'adminhtml_ebay_order'));
     //------------------------------
     return $helpBlock->toHtml() . '<div class="filter_block">' . $marketplaceFilterBlock->toHtml() . $accountFilterBlock->toHtml() . $orderStateSwitcherBlock->toHtml() . '</div>' . $editItemBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 2
0
 public function getGridHtml()
 {
     $listingId = (int) $this->getRequest()->getParam('listing_id');
     $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => Mage::helper('M2ePro/Component_Ebay')->getCachedObject('Listing', $listingId)));
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_settings_help');
     return $viewHeaderBlock->toHtml() . $helpBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 3
0
 public function getGridHtml()
 {
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_message_help');
     $filtersBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_account_switcher', '', array('component_mode' => Ess_M2ePro_Helper_Component_Ebay::NICK, 'controller_name' => 'adminhtml_ebay_message'));
     $filtersBlock->setUseConfirm(false);
     $formBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_message_form');
     return $helpBlock->toHtml() . $filtersBlock->toHtml() . $formBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 4
0
 public function getGridHtml()
 {
     $listing = Mage::helper('M2ePro/Component')->getCachedUnknownObject('Listing', $this->getRequest()->getParam('id'));
     $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => $listing));
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_add_searchAsin_help');
     $productSearchBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_productSearch_main');
     return $helpBlock->toHtml() . $viewHeaderBlock->toHtml() . $productSearchBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 5
0
 public function getGridHtml()
 {
     //------------------------------
     $listing = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
     $header = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => $listing));
     //------------------------------
     return $header->toHtml() . parent::getGridHtml();
 }
 public function getGridHtml()
 {
     if ($this->getRequest()->isXmlHttpRequest()) {
         return parent::getGridHtml();
     }
     $listing = Mage::helper('M2ePro/Component_Ebay')->getCachedObject('Listing', $this->getRequest()->getParam('listing_id'));
     $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => $listing));
     return $viewHeaderBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 7
0
 public function getGridHtml()
 {
     $accountId = $this->getRequest()->getParam('account');
     //------------------------------
     $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_other_view_header', '', array('account' => Mage::helper('M2ePro/Component_Buy')->getCachedObject('Account', $accountId), 'marketplace' => Mage::helper('M2ePro/Component_Buy')->getMarketplace()));
     //------------------------------
     $mapToProductBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_other_mapping');
     return $viewHeaderBlock->toHtml() . $mapToProductBlock->toHtml() . parent::getGridHtml();
 }
 public function getGridHtml()
 {
     $listing = Mage::helper('M2ePro/Component')->getCachedUnknownObject('Listing', $this->getRequest()->getParam('id'));
     $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => $listing));
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_add_searchAsin_help');
     $productSearchBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_productSearch_main');
     // ---------------------------------------
     $data = array('id' => 'productSearch_cleanSuggest_button', 'label' => Mage::helper('M2ePro')->__('Search ASIN/ISBN Manually'), 'class' => 'productSearch_cleanSuggest_button', 'onclick' => 'ListingGridHandlerObj.productSearchHandler.clearSearchResultsAndManualSearch()');
     $buttonResetBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $productSearchBlock->setChild('productSearch_cleanSuggest_button', $buttonResetBlock);
     // ---------------------------------------
     return $helpBlock->toHtml() . $viewHeaderBlock->toHtml() . $productSearchBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 9
0
 public function getGridHtml()
 {
     //------------------------------
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_order_help');
     $editItemBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_order_item_edit');
     //------------------------------
     //------------------------------
     $marketplaceFilterBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_marketplace_switcher', '', array('component_mode' => Ess_M2ePro_Helper_Component_Ebay::NICK, 'controller_name' => 'adminhtml_ebay_order'));
     $marketplaceFilterBlock->setUseConfirm(false);
     //------------------------------
     //------------------------------
     $accountFilterBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_account_switcher', '', array('component_mode' => Ess_M2ePro_Helper_Component_Ebay::NICK, 'controller_name' => 'adminhtml_ebay_order'));
     $accountFilterBlock->setUseConfirm(false);
     //------------------------------
     //------------------------------
     $orderStateSwitcherBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_order_notCreatedFilter', '', array('component_mode' => Ess_M2ePro_Helper_Component_Ebay::NICK, 'controller' => 'adminhtml_ebay_order'));
     //------------------------------
     return $helpBlock->toHtml() . '<div class="filter_block">' . $marketplaceFilterBlock->toHtml() . $accountFilterBlock->toHtml() . $orderStateSwitcherBlock->toHtml() . '</div>' . $editItemBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 10
0
    public function getGridHtml()
    {
        $listing = Mage::helper('M2ePro/Component')->getCachedUnknownObject('Listing', $this->getRequest()->getParam('id'));
        $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => $listing));
        $urls = Mage::helper('M2ePro')->getControllerActions('adminhtml_common_listing_autoAction', array('listing_id' => $this->getRequest()->getParam('id'), 'component' => $this->getData('component')));
        $urls = json_encode($urls);
        /** @var $helper Ess_M2ePro_Helper_Data */
        $helper = Mage::helper('M2ePro');
        $translations = json_encode(array('Auto Add/Remove Rules' => $helper->__('Auto Add/Remove Rules'), 'Based on Magento Categories' => $helper->__('Based on Magento Categories'), 'You must select at least 1 Category.' => $helper->__('You must select at least 1 Category.'), 'Rule with the same Title already exists.' => $helper->__('Rule with the same Title already exists.')));
        $js = <<<HTML
<script type="text/javascript">

    M2ePro.url.add({$urls});
    M2ePro.translator.add({$translations});

    ListingAutoActionHandlerObj = new ListingAutoActionHandler();

</script>
HTML;
        return $viewHeaderBlock->toHtml() . parent::getGridHtml() . $js;
    }
Exemplo n.º 11
0
    public function getGridHtml()
    {
        /** @var $helper Ess_M2ePro_Helper_Data */
        $helper = Mage::helper('M2ePro');
        $component = Ess_M2ePro_Helper_Component_Buy::NICK;
        $temp = $helper->getSessionValue('products_ids_for_list', true);
        $productsIdsForList = empty($temp) ? '' : $temp;
        $listingData = $helper->getGlobalValue('temp_data');
        $gridId = 'buyListingViewGrid' . $listingData['id'];
        $ignoreListings = json_encode(array($listingData['id']));
        $logViewUrl = $this->getUrl('*/adminhtml_log/listing', array('id' => $listingData['id'], 'back' => $helper->makeBackUrlParam('*/adminhtml_buy_listing/view', array('id' => $listingData['id']))));
        $checkLockListing = $this->getUrl('*/adminhtml_listing/checkLockListing', array('component' => $component));
        $lockListingNow = $this->getUrl('*/adminhtml_listing/lockListingNow', array('component' => $component));
        $unlockListingNow = $this->getUrl('*/adminhtml_listing/unlockListingNow', array('component' => $component));
        $getErrorsSummary = $this->getUrl('*/adminhtml_listing/getErrorsSummary');
        $runListProducts = $this->getUrl('*/adminhtml_buy_listing/runListProducts');
        $runReviseProducts = $this->getUrl('*/adminhtml_buy_listing/runReviseProducts');
        $runRelistProducts = $this->getUrl('*/adminhtml_buy_listing/runRelistProducts');
        $runStopProducts = $this->getUrl('*/adminhtml_buy_listing/runStopProducts');
        $runStopAndRemoveProducts = $this->getUrl('*/adminhtml_buy_listing/runStopAndRemoveProducts');
        $prepareData = $this->getUrl('*/adminhtml_listing/prepareMoveToListing');
        $getMoveToListingGridHtml = $this->getUrl('*/adminhtml_listing/moveToListingGrid');
        $getFailedProductsGridHtml = $this->getUrl('*/adminhtml_listing/getFailedProductsGrid');
        $tryToMoveToListing = $this->getUrl('*/adminhtml_buy_listing/tryToMoveToListing');
        $moveToListing = $this->getUrl('*/adminhtml_buy_listing/moveToListing');
        $tempDropDownHtml = $helper->escapeJs($this->getEditTemplateDropDownHtml());
        $tempAddProductsDropDownHtml = $helper->escapeJs($this->getAddProductsDropDownHtml());
        $popupTitle = $helper->escapeJs($helper->__('Moving Rakuten.com Items.'));
        $failedProductsPopupTitle = $helper->escapeJs($helper->__('Products failed to move'));
        $taskCompletedMessage = $helper->escapeJs($helper->__('Task completed. Please wait ...'));
        $taskCompletedSuccessMessage = $helper->escapeJs($helper->__('"%s" task has successfully submitted to be processed.'));
        $taskCompletedWarningMessage = $helper->escapeJs($helper->__('"%s" task has completed with warnings. <a href="%s">View log</a> for details.'));
        $taskCompletedErrorMessage = $helper->escapeJs($helper->__('"%s" task has completed with errors. <a href="%s">View log</a> for details.'));
        $lockedObjNoticeMessage = $helper->escapeJs($helper->__('Some Rakuten.com request(s) are being processed now.'));
        $sendingDataToBuyMessage = $helper->escapeJs($helper->__('Sending %s product(s) data on Rakuten.com.'));
        $viewAllProductLogMessage = $helper->escapeJs($helper->__('View All Product Log.'));
        $listingLockedMessage = $helper->escapeJs($helper->__('The listing was locked by another process. Please try again later.'));
        $listingEmptyMessage = $helper->escapeJs($helper->__('Listing is empty.'));
        $listingAllItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing All Items On Rakuten.com'));
        $listingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing Selected Items On Rakuten.com'));
        $revisingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Revising Selected Items On Rakuten.com'));
        $relistingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Relisting Selected Items On Rakuten.com'));
        $stoppingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping Selected Items On Rakuten.com'));
        $stoppingAndRemovingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping On Rakuten.com And Removing From Listing Selected Items'));
        $addNewSkuSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Adding New SKU On Rakuten.com'));
        $successfullyMovedMessage = $helper->escapeJs($helper->__('Product(s) was successfully moved.'));
        $productsWereNotMovedMessage = $helper->escapeJs($helper->__('Product(s) was not moved. <a href="%s">View log</a> for details.'));
        $someProductsWereNotMovedMessage = $helper->escapeJs($helper->__('Some product(s) was not moved. <a href="%s">View log</a> for details.'));
        $selectItemsMessage = $helper->escapeJs($helper->__('Please select items.'));
        $selectActionMessage = $helper->escapeJs($helper->__('Please select action.'));
        $successWord = $helper->escapeJs($helper->__('Success'));
        $noticeWord = $helper->escapeJs($helper->__('Notice'));
        $warningWord = $helper->escapeJs($helper->__('Warning'));
        $errorWord = $helper->escapeJs($helper->__('Error'));
        $closeWord = $helper->escapeJs($helper->__('Close'));
        $naString = Mage::helper('M2ePro')->__('N/A');
        $assignString = Mage::helper('M2ePro')->__('Assign Rakuten.com SKU');
        $textConfirm = $helper->escapeJs($helper->__('Are you sure?'));
        $searchBuyComSkuManual = $this->getUrl('*/adminhtml_buy_listing/searchBuyComSkuManual');
        $suggestedBuyComSkuGridHmtl = $this->getUrl('*/adminhtml_buy_listing/getSuggestedBuyComSkuGrid');
        $searchBuyComSkuAuto = $this->getUrl('*/adminhtml_buy_listing/searchBuyComSkuAuto');
        $mapToBuyComSku = $this->getUrl('*/adminhtml_buy_listing/mapToBuyComSku');
        $unmapFromBuyComSku = $this->getUrl('*/adminhtml_buy_listing/unmapFromBuyComSku');
        $newGeneralId = $this->getUrl('*/adminhtml_buy_template_newProduct');
        $marketplaceId = Mage::helper('M2ePro')->getGlobalValue('marketplace_id');
        $marketplaceInstance = Mage::helper('M2ePro/Component_Buy')->getMarketplace($marketplaceId);
        $marketplace = json_encode($marketplaceInstance->getData());
        $isMarketplaceSynchronized = json_encode($marketplaceInstance->getChildObject()->isSynchronized());
        $marketplaceSynchUrl = $this->getUrl('*/adminhtml_marketplace/index', array('tab' => Ess_M2ePro_Block_Adminhtml_Marketplace::TAB_ID_RAKUTEN));
        $notSynchronizedMarketplace = $helper->escapeJs($helper->__('In order to use New SKU functionality, please re-synchronize marketplace data.') . ' ' . $helper->__('Press "Save And Update" button after redirect on marketplace page.'));
        $enterProductSearchQueryMessage = $helper->escapeJs($helper->__('Please enter product name or Rakuten.com SKU/Seller SKU/ISBN/UPC.'));
        $autoMapBuyComSkuProgressTitle = $helper->escapeJs($helper->__('Assign Rakuten.com SKU to Item(s)'));
        $autoMapBuyComSkuErrorMessage = $helper->escapeJs($helper->__('Server is currently unavailable. Please try again later.'));
        $javascriptsMain = <<<JAVASCRIPT
<script type="text/javascript">

    if (typeof M2ePro == 'undefined') {
        M2ePro = {};
        M2ePro.url = {};
        M2ePro.formData = {};
        M2ePro.customData = {};
        M2ePro.text = {};
    }

    M2ePro.productsIdsForList = '{$productsIdsForList}';

    M2ePro.url.logViewUrl = '{$logViewUrl}';
    M2ePro.url.checkLockListing = '{$checkLockListing}';
    M2ePro.url.lockListingNow = '{$lockListingNow}';
    M2ePro.url.unlockListingNow = '{$unlockListingNow}';
    M2ePro.url.getErrorsSummary = '{$getErrorsSummary}';

    M2ePro.url.runListProducts = '{$runListProducts}';
    M2ePro.url.runReviseProducts = '{$runReviseProducts}';
    M2ePro.url.runRelistProducts = '{$runRelistProducts}';
    M2ePro.url.runStopProducts = '{$runStopProducts}';
    M2ePro.url.runStopAndRemoveProducts = '{$runStopAndRemoveProducts}';

    M2ePro.url.searchBuyComSkuManual = '{$searchBuyComSkuManual}';
    M2ePro.url.searchBuyComSkuAuto = '{$searchBuyComSkuAuto}';
    M2ePro.url.suggestedBuyComSkuGrid = '{$suggestedBuyComSkuGridHmtl}';
    M2ePro.url.mapToBuyComSku = '{$mapToBuyComSku}';
    M2ePro.url.unmapFromBuyComSku = '{$unmapFromBuyComSku}';

    M2ePro.url.prepareData = '{$prepareData}';
    M2ePro.url.getGridHtml = '{$getMoveToListingGridHtml}';
    M2ePro.url.getFailedProductsGridHtml = '{$getFailedProductsGridHtml}';
    M2ePro.url.tryToMoveToListing = '{$tryToMoveToListing}';
    M2ePro.url.moveToListing = '{$moveToListing}';

    M2ePro.url.newGeneralId = '{$newGeneralId}';
    M2ePro.url.marketplace_synch = '{$marketplaceSynchUrl}';

    M2ePro.text.popup_title = '{$popupTitle}';
    M2ePro.text.failed_products_popup_title = '{$failedProductsPopupTitle}';

    M2ePro.text.task_completed_message = '{$taskCompletedMessage}';
    M2ePro.text.task_completed_success_message = '{$taskCompletedSuccessMessage}';
    M2ePro.text.task_completed_warning_message = '{$taskCompletedWarningMessage}';
    M2ePro.text.task_completed_error_message = '{$taskCompletedErrorMessage}';

    M2ePro.text.locked_obj_notice = '{$lockedObjNoticeMessage}';
    M2ePro.text.sending_data_message = '{$sendingDataToBuyMessage}';
    M2ePro.text.view_all_product_log_message = '{$viewAllProductLogMessage}';

    M2ePro.text.listing_locked_message = '{$listingLockedMessage}';
    M2ePro.text.listing_empty_message = '{$listingEmptyMessage}';

    M2ePro.text.listing_all_items_message = '{$listingAllItemsMessage}';
    M2ePro.text.listing_selected_items_message = '{$listingSelectedItemsMessage}';
    M2ePro.text.revising_selected_items_message = '{$revisingSelectedItemsMessage}';
    M2ePro.text.relisting_selected_items_message = '{$relistingSelectedItemsMessage}';
    M2ePro.text.stopping_selected_items_message = '{$stoppingSelectedItemsMessage}';
    M2ePro.text.stopping_and_removing_selected_items_message = '{$stoppingAndRemovingSelectedItemsMessage}';
    M2ePro.text.add_new_sku_selected_items_message = '{$addNewSkuSelectedItemsMessage}';

    M2ePro.text.successfully_moved = '{$successfullyMovedMessage}';
    M2ePro.text.products_were_not_moved = '{$productsWereNotMovedMessage}';
    M2ePro.text.some_products_were_not_moved = '{$someProductsWereNotMovedMessage}';

    M2ePro.text.select_items_message = '{$selectItemsMessage}';
    M2ePro.text.select_action_message = '{$selectActionMessage}';

    M2ePro.text.success_word = '{$successWord}';
    M2ePro.text.notice_word = '{$noticeWord}';
    M2ePro.text.warning_word = '{$warningWord}';
    M2ePro.text.error_word = '{$errorWord}';
    M2ePro.text.close_word = '{$closeWord}';

    M2ePro.text.na = '{$naString}';
    M2ePro.text.assign = '{$assignString}';

    M2ePro.text.confirm = '{$textConfirm}';

    M2ePro.text.enter_productSearch_query = '{$enterProductSearchQueryMessage}';
    M2ePro.text.automap_buy_com_sku_progress_title = '{$autoMapBuyComSkuProgressTitle}';
    M2ePro.text.automap_error_message = '{$autoMapBuyComSkuErrorMessage}';

    M2ePro.text.not_synchronized_marketplace = '{$notSynchronizedMarketplace}';

    M2ePro.customData.componentMode = '{$component}';
    M2ePro.customData.gridId = '{$gridId}';
    M2ePro.customData.ignoreListings = '{$ignoreListings}';

    M2ePro.customData.marketplace = {$marketplace};
    M2ePro.customData.isMarketplaceSynchronized = {$isMarketplaceSynchronized};

    Event.observe(window, 'load', function() {
        ListingActionHandlerObj = new ListingActionHandler(M2ePro,{$listingData['id']});
        BuyListingMoveToListingHandlerObj = new ListingMoveToListingHandler(M2ePro);
        BuyListingProductSearchHandlerObj = new BuyListingProductSearchHandler(M2ePro);
        ListingItemGridHandlerObj = new ListingItemGridHandler( M2ePro,
                                                                'buyListingViewGrid{$listingData['id']}',
                                                                1,
                                                                2,
                                                                ListingActionHandlerObj,
                                                                BuyListingMoveToListingHandlerObj,
                                                                BuyListingProductSearchHandlerObj,
                                                                undefined);
        ListingItemGridHandlerObj.setMaxProductsInPart(10,0);
        ListingProgressBarObj = new ProgressBar('listing_view_progress_bar');
        GridWrapperObj = new AreaWrapper('listing_view_content_container');

        \$\$('.edit_template_drop_down')[0].innerHTML += '{$tempDropDownHtml}';
        \$\$('.add_products_drop_down')[0].innerHTML += '{$tempAddProductsDropDownHtml}';

        DropDownObj = new DropDown();
        DropDownObj.prepare(\$\$('.edit_template_drop_down')[0]);
        DropDownObj.prepare(\$\$('.add_products_drop_down')[0]);

        if (M2ePro.productsIdsForList) {
            eval(ListingItemGridHandlerObj.gridId+'_massactionJsObject.checkedString = M2ePro.productsIdsForList;');
            \$\$('select#'+ListingItemGridHandlerObj.gridId+'_massaction-select option')[1].selected = 'selected';
            ListingItemGridHandlerObj.massactionSubmitClick(true);
        }
    });

</script>
JAVASCRIPT;
        $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_buy_listing_view_help');
        $productSearchMenuBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_buy_listing_productSearch_menu');
        $productSearchBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_buy_listing_productSearch_main');
        return $javascriptsMain . $helpBlock->toHtml() . $productSearchMenuBlock->toHtml() . $productSearchBlock->toHtml() . parent::getGridHtml();
    }
Exemplo n.º 12
0
 public function getGridHtml()
 {
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_listing_search_help');
     return $helpBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 13
0
 public function getGridHtml()
 {
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_template_newProduct_help');
     return $helpBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 14
0
    public function getGridHtml()
    {
        if ($this->getRequest()->isXmlHttpRequest()) {
            return parent::getGridHtml();
        }
        $listingData = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
        /** @var $helper Ess_M2ePro_Helper_Data */
        $helper = Mage::helper('M2ePro');
        //------------------------------
        $urls = $helper->getControllerActions('adminhtml_common_listing_autoAction', array('listing_id' => $this->getRequest()->getParam('id'), 'component' => Ess_M2ePro_Helper_Component_Amazon::NICK));
        $showAutoAction = json_encode((bool) $this->getRequest()->getParam('auto_actions'));
        $path = 'adminhtml_common_log/listingProduct';
        $urls[$path] = $this->getUrl('*/' . $path, array('channel' => Ess_M2ePro_Helper_Component_Amazon::NICK, 'back' => $helper->makeBackUrlParam('*/adminhtml_common_amazon_listing/view', array('id' => $listingData['id']))));
        $path = 'adminhtml_common_listing/duplicateProducts';
        $urls[$path] = $this->getUrl('*/' . $path);
        $urls = json_encode($urls);
        //------------------------------
        // todo next (change)
        $component = Ess_M2ePro_Helper_Component_Amazon::NICK;
        $temp = Mage::helper('M2ePro/Data_Session')->getValue('products_ids_for_list', true);
        $productsIdsForList = empty($temp) ? '' : $temp;
        $gridId = $this->getChild('grid')->getId();
        $ignoreListings = json_encode(array($listingData['id']));
        $marketplaceId = Mage::helper('M2ePro/Data_Global')->getValue('marketplace_id');
        $marketplaceInstance = Mage::helper('M2ePro/Component_Amazon')->getCachedObject('Marketplace', $marketplaceId);
        $marketplace = json_encode($marketplaceInstance->getData());
        $isNewAsinAvailable = json_encode($marketplaceInstance->getChildObject()->isNewAsinAvailable());
        $isMarketplaceSynchronized = json_encode($marketplaceInstance->getChildObject()->isSynchronized());
        $logViewUrl = $this->getUrl('*/adminhtml_common_log/listing', array('id' => $listingData['id'], 'channel' => Ess_M2ePro_Block_Adminhtml_Common_Log_Tabs::TAB_ID_AMAZON, 'back' => $helper->makeBackUrlParam('*/adminhtml_common_amazon_listing/view', array('id' => $listingData['id']))));
        $getErrorsSummary = $this->getUrl('*/adminhtml_listing/getErrorsSummary');
        $runListProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runListProducts');
        $runReviseProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runReviseProducts');
        $runRelistProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runRelistProducts');
        $runStopProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runStopProducts');
        $runStopAndRemoveProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runStopAndRemoveProducts');
        $runDeleteAndRemoveProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runDeleteAndRemoveProducts');
        $prepareData = $this->getUrl('*/adminhtml_listing_moving/prepareMoveToListing');
        $getMoveToListingGridHtml = $this->getUrl('*/adminhtml_listing_moving/moveToListingGrid');
        $getFailedProductsGridHtml = $this->getUrl('*/adminhtml_listing_moving/getFailedProductsGrid');
        $tryToMoveToListing = $this->getUrl('*/adminhtml_listing_moving/tryToMoveToListing');
        $moveToListing = $this->getUrl('*/adminhtml_listing_moving/moveToListing');
        $marketplaceSynchUrl = $this->getUrl('*/adminhtml_common_marketplace/index', array('tab' => Ess_M2ePro_Block_Adminhtml_Common_Component_Abstract::TAB_ID_AMAZON));
        $getVariationEditPopupUrl = $this->getUrl('*/adminhtml_common_listing/getVariationEditPopup');
        $getVariationManagePopupUrl = $this->getUrl('*/adminhtml_common_listing/getVariationManagePopup');
        $variationEditActionUrl = $this->getUrl('*/adminhtml_common_listing/variationEdit');
        $variationManageActionUrl = $this->getUrl('*/adminhtml_common_listing/variationManage');
        $variationManageGenerateActionUrl = $this->getUrl('*/adminhtml_common_listing/variationManageGenerate');
        $variationResetActionUrl = $this->getUrl('*/adminhtml_common_listing/variationReset');
        $saveListingAdditionalDataActionUrl = $this->getUrl('*/adminhtml_listing/saveListingAdditionalData', array('id' => $listingData['id']));
        $popupTitle = $helper->escapeJs($helper->__('Moving Amazon Items'));
        $popupTitleSingle = $helper->escapeJs($helper->__('Moving Amazon Item'));
        $failedProductsPopupTitle = $helper->escapeJs($helper->__('Products failed to move'));
        $taskCompletedMessage = $helper->escapeJs($helper->__('Task completed. Please wait ...'));
        $taskCompletedSuccessMessage = $helper->escapeJs($helper->__('"%task_title%" Task has successfully submitted to be processed.'));
        $taskCompletedWarningMessage = $helper->escapeJs($helper->__('"%task_title%" Task has completed with warnings. <a target="_blank" href="%url%">View Log</a> for details.'));
        $taskCompletedErrorMessage = $helper->escapeJs($helper->__('"%task_title%" Task has completed with errors. <a target="_blank" href="%url%">View Log</a> for details.'));
        $lockedObjNoticeMessage = $helper->escapeJs($helper->__('Some Amazon request(s) are being processed now.'));
        $sendingDataToAmazonMessage = $helper->escapeJs($helper->__('Sending %product_title% Product(s) data on Amazon.'));
        $viewAllProductLogMessage = $helper->escapeJs($helper->__('View All Product Log.'));
        $listingLockedMessage = $helper->escapeJs($helper->__('The Listing was locked by another process. Please try again later.'));
        $listingEmptyMessage = $helper->escapeJs($helper->__('Listing is empty.'));
        $listingAllItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing All Items On Amazon'));
        $listingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing Selected Items On Amazon'));
        $revisingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Revising Selected Items On Amazon'));
        $relistingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Relisting Selected Items On Amazon'));
        $stoppingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping Selected Items On Amazon'));
        $stoppingAndRemovingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping On Amazon And Removing From Listing Selected Items'));
        $deletingAndRemovingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Removing From Amazon And Listing Selected Items'));
        $successfullyMovedMessage = $helper->escapeJs($helper->__('Product(s) was successfully Moved.'));
        $productsWereNotMovedMessage = $helper->escapeJs($helper->__('Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.'));
        $someProductsWereNotMovedMessage = $helper->escapeJs($helper->__('Some Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.'));
        $selectItemsMessage = $helper->escapeJs($helper->__('Please select the Products you want to perform the Action on.'));
        $selectActionMessage = $helper->escapeJs($helper->__('Please select Action.'));
        $successWord = $helper->escapeJs($helper->__('Success'));
        $noticeWord = $helper->escapeJs($helper->__('Notice'));
        $warningWord = $helper->escapeJs($helper->__('Warning'));
        $errorWord = $helper->escapeJs($helper->__('Error'));
        $closeWord = $helper->escapeJs($helper->__('Close'));
        $assignString = Mage::helper('M2ePro')->__('Assign');
        $textConfirm = $helper->escapeJs($helper->__('Are you sure?'));
        $searchAsinManual = $this->getUrl('*/adminhtml_common_amazon_listing/searchAsinManual');
        $getSearchAsinMenu = $this->getUrl('*/adminhtml_common_amazon_listing/getSearchAsinMenu');
        $suggestedAsinGridHmtl = $this->getUrl('*/adminhtml_common_amazon_listing/getSuggestedAsinGrid');
        $getCategoriesByAsin = $this->getUrl('*/adminhtml_common_amazon_listing/getCategoriesByAsin');
        $searchAsinAuto = $this->getUrl('*/adminhtml_common_amazon_listing/searchAsinAuto');
        $getProductsSearchStatus = $this->getUrl('*/adminhtml_common_amazon_listing/getProductsSearchStatus');
        $mapToAsin = $this->getUrl('*/adminhtml_common_amazon_listing/mapToAsin');
        $unmapFromAsin = $this->getUrl('*/adminhtml_common_amazon_listing/unmapFromAsin');
        $mapToNewAsin = $this->getUrl('*/adminhtml_common_amazon_listing/mapToNewAsin');
        $variationProductManage = $this->getUrl('*/adminhtml_common_amazon_listing_variation_product_manage/index');
        $variationProductSetGeneralIdOwner = $this->getUrl('*/adminhtml_common_amazon_listing_variation_product_manage/setGeneralIdOwner');
        $variationProductSetVariationTheme = $this->getUrl('*/adminhtml_common_amazon_listing_variation_product_manage/setVariationTheme');
        $variationProductSetMatchedAttributes = $this->getUrl('*/adminhtml_common_amazon_listing_variation_product_manage/setMatchedAttributes');
        $variationProductSetListingProductSku = $this->getUrl('*/adminhtml_common_amazon_listing_variation_product_manage/setListingProductSku');
        $manageVariationViewTemplateDescriptionsGrid = $this->getUrl('*/adminhtml_common_amazon_listing_variation_product_manage/viewTemplateDescriptionsGrid');
        $manageVariationMapToTemplateDescription = $this->getUrl('*/adminhtml_common_amazon_listing_variation_product_manage/mapToTemplateDescription');
        $viewVariationsSettingsAjax = $this->getUrl('*/adminhtml_common_amazon_listing_variation_product_manage/viewVariationsSettingsAjax');
        $newAsinUrl = $this->getUrl('*/adminhtml_common_amazon_template_newProduct', array('marketplace_id' => Mage::helper('M2ePro/Data_Global')->getValue('marketplace_id')));
        $mapToTemplateDescription = $this->getUrl('*/adminhtml_common_amazon_listing/mapToTemplateDescription');
        $unmapFromTemplateDescription = $this->getUrl('*/adminhtml_common_amazon_listing/unmapFromTemplateDescription');
        $validateProductsForTemplateDescriptionAssign = $this->getUrl('*/adminhtml_common_amazon_listing/validateProductsForTemplateDescriptionAssign');
        $viewTemplateDescriptionsGrid = $this->getUrl('*/adminhtml_common_amazon_listing/viewTemplateDescriptionsGrid');
        $templateDescriptionPopupTitle = $helper->escapeJs($helper->__('Assign Description Policy'));
        $enterProductSearchQueryMessage = $helper->escapeJs($helper->__('Please enter Product Title or ASIN/ISBN/UPC/EAN.'));
        $autoMapAsinSearchProducts = $helper->escapeJs($helper->__('Search %product_title% Product(s) on Amazon.'));
        $autoMapAsinProgressTitle = $helper->escapeJs($helper->__('Automatic Assigning ASIN/ISBN to Item(s)'));
        $autoMapAsinErrorMessage = $helper->escapeJs($helper->__('Server is currently unavailable. Please try again later.'));
        $newAsinNotAvailable = $helper->escapeJs($helper->__('The new ASIN/ISBN creation functionality is not available in %code% Marketplace yet.'));
        $notSynchronizedMarketplace = $helper->escapeJs($helper->__('In order to use New ASIN/ISBN functionality, please re-synchronize Marketplace data.') . ' ' . $helper->__('Press "Save And Update" Button after redirect on Marketplace Page.'));
        $noVariationsLeftText = $helper->__('All variations are already added.');
        $variationManageMatchedAttributesError = $helper->__('Please choose valid Attributes.');
        $variationManageMatchedAttributesErrorDuplicateSelection = $helper->__('You can not choose the same Attribute twice.');
        $variationManageSkuPopUpTitle = $helper->__('Enter Amazon Parent Product SKU');
        $switchToIndividualModePopUpTitle = $helper->__('Change "Manage Variations" Mode');
        $switchToParentModePopUpTitle = $helper->__('Change "Manage Variations" Mode');
        $emptySkuError = $helper->escapeJs($helper->__('Please enter Amazon Parent Product SKU.'));
        $translations = json_encode(array('Auto Add/Remove Rules' => $helper->__('Auto Add/Remove Rules'), 'Based on Magento Categories' => $helper->__('Based on Magento Categories'), 'You must select at least 1 Category.' => $helper->__('You must select at least 1 Category.'), 'Rule with the same Title already exists.' => $helper->__('Rule with the same Title already exists.')));
        $javascriptsMain = <<<JAVASCRIPT
<script type="text/javascript">

    if (typeof M2ePro == 'undefined') {
        M2ePro = {};
        M2ePro.url = {};
        M2ePro.formData = {};
        M2ePro.customData = {};
        M2ePro.text = {};
    }

    M2ePro.url.add({$urls});
    M2ePro.translator.add({$translations});

    M2ePro.productsIdsForList = '{$productsIdsForList}';

    M2ePro.url.logViewUrl = '{$logViewUrl}';
    M2ePro.url.getErrorsSummary = '{$getErrorsSummary}';

    M2ePro.url.runListProducts = '{$runListProducts}';
    M2ePro.url.runReviseProducts = '{$runReviseProducts}';
    M2ePro.url.runRelistProducts = '{$runRelistProducts}';
    M2ePro.url.runStopProducts = '{$runStopProducts}';
    M2ePro.url.runStopAndRemoveProducts = '{$runStopAndRemoveProducts}';
    M2ePro.url.runDeleteAndRemoveProducts = '{$runDeleteAndRemoveProducts}';

    M2ePro.url.searchAsinManual = '{$searchAsinManual}';
    M2ePro.url.getSearchAsinMenu = '{$getSearchAsinMenu}';
    M2ePro.url.searchAsinAuto = '{$searchAsinAuto}';
    M2ePro.url.getProductsSearchStatus = '{$getProductsSearchStatus}';
    M2ePro.url.suggestedAsinGrid = '{$suggestedAsinGridHmtl}';
    M2ePro.url.getCategoriesByAsin = '{$getCategoriesByAsin}';
    M2ePro.url.mapToAsin = '{$mapToAsin}';
    M2ePro.url.unmapFromAsin = '{$unmapFromAsin}';
    M2ePro.url.mapToNewAsin = '{$mapToNewAsin}';

    M2ePro.url.variationProductManage = '{$variationProductManage}';
    M2ePro.url.variationProductSetGeneralIdOwner = '{$variationProductSetGeneralIdOwner}';
    M2ePro.url.variationProductSetVariationTheme = '{$variationProductSetVariationTheme}';
    M2ePro.url.variationProductSetMatchedAttributes = '{$variationProductSetMatchedAttributes}';
    M2ePro.url.variationProductSetListingProductSku = '{$variationProductSetListingProductSku}';
    M2ePro.url.variationProductSetListingProductSku = '{$variationProductSetListingProductSku}';
    M2ePro.url.manageVariationViewTemplateDescriptionsGrid = '{$manageVariationViewTemplateDescriptionsGrid}';
    M2ePro.url.manageVariationMapToTemplateDescription = '{$manageVariationMapToTemplateDescription}';
    M2ePro.url.viewVariationsSettingsAjax = '{$viewVariationsSettingsAjax}';

    M2ePro.url.newAsin = '{$newAsinUrl}';

    M2ePro.url.mapToTemplateDescription = '{$mapToTemplateDescription}';
    M2ePro.url.unmapFromTemplateDescription = '{$unmapFromTemplateDescription}';
    M2ePro.url.validateProductsForTemplateDescriptionAssign = '{$validateProductsForTemplateDescriptionAssign}';
    M2ePro.url.viewTemplateDescriptionsGrid = '{$viewTemplateDescriptionsGrid}';

    M2ePro.url.prepareData = '{$prepareData}';
    M2ePro.url.getGridHtml = '{$getMoveToListingGridHtml}';
    M2ePro.url.getFailedProductsGridHtml = '{$getFailedProductsGridHtml}';
    M2ePro.url.tryToMoveToListing = '{$tryToMoveToListing}';
    M2ePro.url.moveToListing = '{$moveToListing}';

    M2ePro.url.marketplace_synch = '{$marketplaceSynchUrl}';

    M2ePro.url.get_variation_edit_popup = '{$getVariationEditPopupUrl}';
    M2ePro.url.get_variation_manage_popup = '{$getVariationManagePopupUrl}';

    M2ePro.url.variation_edit_action = '{$variationEditActionUrl}';
    M2ePro.url.variation_manage_action = '{$variationManageActionUrl}';
    M2ePro.url.variation_manage_generate_action = '{$variationManageGenerateActionUrl}';
    M2ePro.url.variation_reset_action = '{$variationResetActionUrl}';

    M2ePro.url.save_listing_additional_data = '{$saveListingAdditionalDataActionUrl}';

    M2ePro.text.popup_title = '{$popupTitle}';
    M2ePro.text.popup_title_single = '{$popupTitleSingle}';
    M2ePro.text.failed_products_popup_title = '{$failedProductsPopupTitle}';

    M2ePro.text.task_completed_message = '{$taskCompletedMessage}';
    M2ePro.text.task_completed_success_message = '{$taskCompletedSuccessMessage}';
    M2ePro.text.task_completed_warning_message = '{$taskCompletedWarningMessage}';
    M2ePro.text.task_completed_error_message = '{$taskCompletedErrorMessage}';

    M2ePro.text.locked_obj_notice = '{$lockedObjNoticeMessage}';
    M2ePro.text.sending_data_message = '{$sendingDataToAmazonMessage}';
    M2ePro.text.view_all_product_log_message = '{$viewAllProductLogMessage}';

    M2ePro.text.listing_locked_message = '{$listingLockedMessage}';
    M2ePro.text.listing_empty_message = '{$listingEmptyMessage}';

    M2ePro.text.listing_all_items_message = '{$listingAllItemsMessage}';
    M2ePro.text.listing_selected_items_message = '{$listingSelectedItemsMessage}';
    M2ePro.text.revising_selected_items_message = '{$revisingSelectedItemsMessage}';
    M2ePro.text.relisting_selected_items_message = '{$relistingSelectedItemsMessage}';
    M2ePro.text.stopping_selected_items_message = '{$stoppingSelectedItemsMessage}';
    M2ePro.text.stopping_and_removing_selected_items_message = '{$stoppingAndRemovingSelectedItemsMessage}';
    M2ePro.text.deleting_and_removing_selected_items_message = '{$deletingAndRemovingSelectedItemsMessage}';

    M2ePro.text.successfully_moved = '{$successfullyMovedMessage}';
    M2ePro.text.products_were_not_moved = '{$productsWereNotMovedMessage}';
    M2ePro.text.some_products_were_not_moved = '{$someProductsWereNotMovedMessage}';

    M2ePro.text.select_items_message = '{$selectItemsMessage}';
    M2ePro.text.select_action_message = '{$selectActionMessage}';

    M2ePro.text.success_word = '{$successWord}';
    M2ePro.text.notice_word = '{$noticeWord}';
    M2ePro.text.warning_word = '{$warningWord}';
    M2ePro.text.error_word = '{$errorWord}';
    M2ePro.text.close_word = '{$closeWord}';

    M2ePro.text.templateDescriptionPopupTitle = '{$templateDescriptionPopupTitle}';

    M2ePro.text.assign = '{$assignString}';
    M2ePro.text.confirm = '{$textConfirm}';

    M2ePro.text.enter_productSearch_query = '{$enterProductSearchQueryMessage}';
    M2ePro.text.automap_asin_search_products = '{$autoMapAsinSearchProducts}';
    M2ePro.text.automap_asin_progress_title = '{$autoMapAsinProgressTitle}';
    M2ePro.text.automap_error_message = '{$autoMapAsinErrorMessage}';

    M2ePro.text.new_asin_not_available = '{$newAsinNotAvailable}';
    M2ePro.text.not_synchronized_marketplace = '{$notSynchronizedMarketplace}';

    M2ePro.text.no_variations_left = '{$noVariationsLeftText}';

    M2ePro.text.variation_manage_matched_attributes_error = '{$variationManageMatchedAttributesError}';
    M2ePro.text.variation_manage_matched_attributes_error_duplicate =
        '{$variationManageMatchedAttributesErrorDuplicateSelection}';

    M2ePro.text.variation_manage_matched_sku_popup_title = '{$variationManageSkuPopUpTitle}';
    M2ePro.text.empty_sku_error = '{$emptySkuError}';

    M2ePro.text.switch_to_individual_mode_popup_title = '{$switchToIndividualModePopUpTitle}';
    M2ePro.text.switch_to_parent_mode_popup_title = '{$switchToParentModePopUpTitle}';

    M2ePro.customData.componentMode = '{$component}';
    M2ePro.customData.gridId = '{$gridId}';
    M2ePro.customData.ignoreListings = '{$ignoreListings}';

    M2ePro.customData.marketplace = {$marketplace};
    M2ePro.customData.isNewAsinAvailable = {$isNewAsinAvailable};
    M2ePro.customData.isMarketplaceSynchronized = {$isMarketplaceSynchronized};

    Event.observe(window, 'load', function() {

        ListingGridHandlerObj = new AmazonListingGridHandler(
            '{$gridId}',
            {$listingData['id']}
        );

        // todo next
        ListingGridHandlerObj.actionHandler.setOptions(M2ePro);
        ListingGridHandlerObj.movingHandler.setOptions(M2ePro);
        ListingGridHandlerObj.productSearchHandler.setOptions(M2ePro);
        ListingGridHandlerObj.templateDescriptionHandler.setOptions(M2ePro);
        ListingGridHandlerObj.variationProductManageHandler.setOptions(M2ePro);

        ListingProgressBarObj = new ProgressBar('listing_view_progress_bar');
        GridWrapperObj = new AreaWrapper('listing_view_content_container');

        ListingProductVariationHandlerObj = new ListingProductVariationHandler(M2ePro,
                                                                               ListingGridHandlerObj);

        if (M2ePro.productsIdsForList) {
            ListingGridHandlerObj.getGridMassActionObj().checkedString = M2ePro.productsIdsForList;
            ListingGridHandlerObj.actionHandler.listAction();
        }

        ListingAutoActionHandlerObj = new ListingAutoActionHandler();
        if ({$showAutoAction}) {
            ListingAutoActionHandlerObj.loadAutoActionHtml();
        }

    });

</script>
JAVASCRIPT;
        $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_view_help');
        $productSearchBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_productSearch_main');
        //------------------------------
        $data = array('target_css_class' => 'edit_settings_drop_down', 'items' => $this->getTemplatesButtonDropDownItems());
        $templatesDropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $templatesDropDownBlock->setData($data);
        //------------------------------
        //------------------------------
        $data = array('target_css_class' => 'add_products_drop_down', 'items' => $this->getAddProductsDropDownItems());
        $addProductsDropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $addProductsDropDownBlock->setData($data);
        //------------------------------
        //------------------------------
        $listingSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_view_listingSwitcher');
        //------------------------------
        //------------------------------
        $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => Mage::helper('M2ePro/Component_Amazon')->getCachedObject('Listing', $listingData['id'])));
        //------------------------------
        //------------------------------
        $switchToIndividualPopup = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_variation_product_switchToIndividualPopup');
        //------------------------------
        //------------------------------
        $switchToParentPopup = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_variation_product_switchToParentPopup');
        //------------------------------
        return $javascriptsMain . $templatesDropDownBlock->toHtml() . $listingSwitcher->toHtml() . $addProductsDropDownBlock->toHtml() . $helpBlock->toHtml() . $viewHeaderBlock->toHtml() . $productSearchBlock->toHtml() . $switchToIndividualPopup->toHtml() . $switchToParentPopup->toHtml() . parent::getGridHtml();
    }
Exemplo n.º 15
0
 public function getGridHtml()
 {
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_synchronization_log_help');
     return $helpBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 16
0
 public function getGridHtml()
 {
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_product_help');
     return $helpBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 17
0
    public function getGridHtml()
    {
        if ($this->getRequest()->isXmlHttpRequest()) {
            return parent::getGridHtml();
        }
        $html = '';
        //------------------------------
        $data = array('target_css_class' => 'edit_default_settings_drop_down', 'items' => $this->getDefaultSettingsButtonDropDownItems());
        $templatesDropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $templatesDropDownBlock->setData($data);
        $html .= $templatesDropDownBlock->toHtml();
        //------------------------------
        //------------------------------
        $listingSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_listingSwitcher');
        $html .= $listingSwitcher->toHtml();
        //------------------------------
        //------------------------------
        $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_help');
        $html .= $helpBlock->toHtml();
        //------------------------------
        //------------------------------
        $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => Mage::helper('M2ePro/Data_Global')->getValue('temp_data')));
        $html .= $viewHeaderBlock->toHtml();
        //------------------------------
        //------------------------------
        if (Mage::helper('M2ePro/View_Ebay')->isSimpleMode()) {
            if ($this->listing->getChildObject()->isEstimatedFeesObtainRequired()) {
                $obtain = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_fee_obtain');
                $obtain->setData('listing_id', $this->listing->getId());
                $html .= $obtain->toHtml();
            } elseif ($this->listing->getChildObject()->getEstimatedFees()) {
                $preview = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_fee_preview');
                $preview->setData('fees', $this->listing->getChildObject()->getEstimatedFees());
                $preview->setData('product_name', $this->listing->getChildObject()->getEstimatedFeesSourceProductName());
                $html .= $preview->toHtml();
            }
        }
        //------------------------------
        //------------------------------
        $data = array('target_css_class' => 'add_products_drop_down', 'items' => $this->getAddProductsDropDownItems());
        $addProductsDropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $addProductsDropDownBlock->setData($data);
        //------------------------------
        /** @var $helper Ess_M2ePro_Helper_Data */
        $helper = Mage::helper('M2ePro');
        //------------------------------
        $urls = json_encode(array_merge($helper->getControllerActions('adminhtml_ebay_listing', array('_current' => true)), $helper->getControllerActions('adminhtml_ebay_listing_autoAction', array('listing_id' => $this->getRequest()->getParam('id'))), $helper->getControllerActions('adminhtml_ebay_listing_transferring', array('listing_id' => $this->getRequest()->getParam('id'))), $helper->getControllerActions('adminhtml_ebay_account'), $helper->getControllerActions('adminhtml_ebay_listing_categorySettings'), $helper->getControllerActions('adminhtml_ebay_marketplace'), array('adminhtml_system_store/index' => Mage::helper('adminhtml')->getUrl('adminhtml/system_store/')), array('logViewUrl' => $this->getUrl('M2ePro/adminhtml_common_log/synchronization', array('back' => $helper->makeBackUrlParam('*/adminhtml_common_synchronization/index')))), array('runSynchNow' => $this->getUrl('M2ePro/adminhtml_common_marketplace/runSynchNow')), array('synchCheckProcessingNow' => $this->getUrl('M2ePro/adminhtml_common_synchronization/synchCheckProcessingNow'))));
        //------------------------------
        //------------------------------
        $translations = json_encode(array('Auto Add/Remove Rules' => $helper->__('Auto Add/Remove Rules'), 'Based on Magento Categories' => $helper->__('Based on Magento Categories'), 'You must select at least 1 Category.' => $helper->__('You must select at least 1 Category.'), 'Rule with the same Title already exists.' => $helper->__('Rule with the same Title already exists.'), 'Compatibility Attribute' => $helper->__('Compatibility Attribute'), 'Sell on Another eBay Site' => $helper->__('Sell on Another eBay Site'), 'Product' => $helper->__('Product'), 'Translation Service' => $helper->__('Translation Service'), 'You must select at least 1 Listing.' => $helper->__('You must select at least 1 Listing.'), 'Data migration.' => $helper->__('Data migration...'), 'Creating Policies in process. Please wait...' => $helper->__('Creating Policies in process. Please wait...'), 'Creating Translation Account in process. Please wait...' => $helper->__('Creating Translation Account in process. Please wait...'), 'Creating Listing in process. Please wait...' => $helper->__('Creating Listing in process. Please wait...'), 'Adding Products in process. Please wait...' => $helper->__('Adding Products in process. Please wait...'), 'Products failed to add' => $helper->__('Failed Products'), 'Migration success.' => $helper->__('The Products have been successfully added into Destination Listing.'), 'Migration error.' => $helper->__('The Products have not been added into Destination Listing' . ' because Products with the same Magento Product IDs already exist there.'), 'Some Products Categories Settings are not set or Attributes for Title or Description are empty.' => $helper->__('Some Products Categories Settings are not set' . ' or Attributes for Title or Description are empty.'), 'Another Synchronization Is Already Running.' => $helper->__('Another Synchronization Is Already Running.'), 'Getting information. Please wait ...' => $helper->__('Getting information. Please wait ...'), 'Preparing to start. Please wait ...' => $helper->__('Preparing to start. Please wait ...'), 'Synchronization has successfully ended.' => $helper->__('Synchronization has successfully ended.'), 'Synchronization ended with warnings. <a target="_blank" href="%url%">View Log</a> for details.' => $helper->__('Synchronization ended with warnings. <a target="_blank" href="%url%">View Log</a> for details.'), 'Synchronization ended with errors. <a target="_blank" href="%url%">View Log</a> for details.' => $helper->__('Synchronization ended with errors. <a target="_blank" href="%url%">View Log</a> for details.')));
        //------------------------------
        $html .= <<<HTML
<script type="text/javascript">
    M2ePro.url.add({$urls});
    M2ePro.translator.add({$translations});
</script>
HTML;
        $javascript = '';
        if (!$this->getRequest()->isXmlHttpRequest()) {
            $html .= <<<HTML
<script type="text/javascript">
    ListingAutoActionHandlerObj = new EbayListingAutoActionHandler();
</script>
HTML;
        }
        //------------------------------
        return $html . $addProductsDropDownBlock->toHtml() . parent::getGridHtml() . $javascript;
    }
Exemplo n.º 18
0
 public function getGridHtml()
 {
     return $this->getStoreSwitcherHtml() . parent::getGridHtml();
 }
Exemplo n.º 19
0
    public function getGridHtml()
    {
        if ($this->getRequest()->isXmlHttpRequest()) {
            return parent::getGridHtml();
        }
        $html = '';
        //------------------------------
        $data = array('target_css_class' => 'edit_default_settings_drop_down', 'items' => $this->getDefaultSettingsButtonDropDownItems());
        $templatesDropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $templatesDropDownBlock->setData($data);
        $html .= $templatesDropDownBlock->toHtml();
        //------------------------------
        //------------------------------
        $listingSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_listingSwitcher');
        $html .= $listingSwitcher->toHtml();
        //------------------------------
        //------------------------------
        $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_help');
        $html .= $helpBlock->toHtml();
        //------------------------------
        //------------------------------
        $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => Mage::helper('M2ePro/Data_Global')->getValue('temp_data')));
        $html .= $viewHeaderBlock->toHtml();
        //------------------------------
        //------------------------------
        if (Mage::helper('M2ePro/View_Ebay')->isSimpleMode()) {
            if ($this->listing->getChildObject()->isEstimatedFeesObtainRequired()) {
                $obtain = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_fee_obtain');
                $obtain->setData('listing_id', $this->listing->getId());
                $html .= $obtain->toHtml();
            } elseif ($this->listing->getChildObject()->getEstimatedFees()) {
                $preview = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_fee_preview');
                $preview->setData('fees', $this->listing->getChildObject()->getEstimatedFees());
                $preview->setData('product_name', $this->listing->getChildObject()->getEstimatedFeesSourceProductName());
                $html .= $preview->toHtml();
            }
        }
        //------------------------------
        //------------------------------
        $data = array('target_css_class' => 'add_products_drop_down', 'items' => $this->getAddProductsDropDownItems());
        $addProductsDropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $addProductsDropDownBlock->setData($data);
        //------------------------------
        //------------------------------
        $urls = json_encode(array_merge(Mage::helper('M2ePro')->getControllerActions('adminhtml_ebay_listing', array('_current' => true)), Mage::helper('M2ePro')->getControllerActions('adminhtml_ebay_listing_autoAction', array('listing_id' => $this->getRequest()->getParam('id')))));
        //------------------------------
        //------------------------------
        $translations = json_encode(array('Automatic Actions' => $this->__('Automatic Actions'), 'Based on Magento Categories' => $this->__('Based on Magento Categories'), 'You must select at least 1 category.' => $this->__('You must select at least 1 category.'), 'Rule with the same title already exists.' => $this->__('Rule with the same title already exists.'), 'Compatibility Attribute' => $this->__('Compatibility Attribute')));
        //------------------------------
        $html .= <<<HTML
<script type="text/javascript">
    M2ePro.url.add({$urls});
    M2ePro.translator.add({$translations});
</script>
HTML;
        $javascript = '';
        if (!$this->getRequest()->isXmlHttpRequest()) {
            $html .= <<<HTML
<script type="text/javascript">
    EbayListingAutoActionHandlerObj = new EbayListingAutoActionHandler();
</script>
HTML;
        }
        //------------------------------
        return $html . $addProductsDropDownBlock->toHtml() . parent::getGridHtml() . $javascript;
    }
Exemplo n.º 20
0
    public function getGridHtml()
    {
        $listingData = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
        /** @var $helper Ess_M2ePro_Helper_Data */
        $helper = Mage::helper('M2ePro');
        //------------------------------
        $urls = array();
        $path = 'adminhtml_common_log/listing';
        $urls[$path] = $this->getUrl('*/' . $path, array('id' => $listingData['id'], 'back' => $helper->makeBackUrlParam('*/adminhtml_common_amazon_listing/view', array('id' => $listingData['id']))));
        $path = 'adminhtml_common_listing/duplicateProducts';
        $urls[$path] = $this->getUrl('*/' . $path);
        $urls = json_encode($urls);
        //------------------------------
        // todo next (change)
        $component = Ess_M2ePro_Helper_Component_Amazon::NICK;
        $temp = Mage::helper('M2ePro/Data_Session')->getValue('products_ids_for_list', true);
        $productsIdsForList = empty($temp) ? '' : $temp;
        $gridId = 'amazonListingViewGrid' . $listingData['id'];
        $ignoreListings = json_encode(array($listingData['id']));
        $marketplaceId = Mage::helper('M2ePro/Data_Global')->getValue('marketplace_id');
        $marketplaceInstance = Mage::helper('M2ePro/Component_Amazon')->getCachedObject('Marketplace', $marketplaceId);
        $marketplace = json_encode($marketplaceInstance->getData());
        $isNewAsinAvailable = json_encode($marketplaceInstance->getChildObject()->isNewAsinAvailable());
        $isMarketplaceSynchronized = json_encode($marketplaceInstance->getChildObject()->isSynchronized());
        $logViewUrl = $this->getUrl('*/adminhtml_common_log/listing', array('id' => $listingData['id'], 'back' => $helper->makeBackUrlParam('*/adminhtml_common_amazon_listing/view', array('id' => $listingData['id']))));
        $checkLockListing = $this->getUrl('*/adminhtml_listing/checkLockListing', array('component' => $component));
        $lockListingNow = $this->getUrl('*/adminhtml_listing/lockListingNow', array('component' => $component));
        $unlockListingNow = $this->getUrl('*/adminhtml_listing/unlockListingNow', array('component' => $component));
        $getErrorsSummary = $this->getUrl('*/adminhtml_listing/getErrorsSummary');
        $runListProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runListProducts');
        $runReviseProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runReviseProducts');
        $runRelistProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runRelistProducts');
        $runStopProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runStopProducts');
        $runStopAndRemoveProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runStopAndRemoveProducts');
        $runDeleteAndRemoveProducts = $this->getUrl('*/adminhtml_common_amazon_listing/runDeleteAndRemoveProducts');
        $prepareData = $this->getUrl('*/adminhtml_listing_moving/prepareMoveToListing');
        $getMoveToListingGridHtml = $this->getUrl('*/adminhtml_listing_moving/moveToListingGrid');
        $getFailedProductsGridHtml = $this->getUrl('*/adminhtml_listing_moving/getFailedProductsGrid');
        $tryToMoveToListing = $this->getUrl('*/adminhtml_listing_moving/tryToMoveToListing');
        $moveToListing = $this->getUrl('*/adminhtml_listing_moving/moveToListing');
        $marketplaceSynchUrl = $this->getUrl('*/adminhtml_common_marketplace/index', array('tab' => Ess_M2ePro_Block_Adminhtml_Common_Component_Abstract::TAB_ID_AMAZON));
        $getVariationEditPopupUrl = $this->getUrl('*/adminhtml_common_listing/getVariationEditPopup');
        $getVariationManagePopupUrl = $this->getUrl('*/adminhtml_common_listing/getVariationManagePopup');
        $variationEditActionUrl = $this->getUrl('*/adminhtml_common_listing/variationEdit');
        $variationManageActionUrl = $this->getUrl('*/adminhtml_common_listing/variationManage');
        $variationManageGenerateActionUrl = $this->getUrl('*/adminhtml_common_listing/variationManageGenerate');
        $popupTitle = $helper->escapeJs($helper->__('Moving Amazon Items.'));
        $failedProductsPopupTitle = $helper->escapeJs($helper->__('Products failed to move'));
        $taskCompletedMessage = $helper->escapeJs($helper->__('Task completed. Please wait ...'));
        $taskCompletedSuccessMessage = $helper->escapeJs($helper->__('"%task_title%" task has successfully submitted to be processed.'));
        $taskCompletedWarningMessage = $helper->escapeJs($helper->__('"%task_title%" task has completed with warnings. <a target="_blank" href="%url%">View log</a> for details.'));
        $taskCompletedErrorMessage = $helper->escapeJs($helper->__('"%task_title%" task has completed with errors. <a target="_blank" href="%url%">View log</a> for details.'));
        $lockedObjNoticeMessage = $helper->escapeJs($helper->__('Some Amazon request(s) are being processed now.'));
        $sendingDataToAmazonMessage = $helper->escapeJs($helper->__('Sending %product_title% product(s) data on Amazon.'));
        $viewAllProductLogMessage = $helper->escapeJs($helper->__('View All Product Log.'));
        $listingLockedMessage = $helper->escapeJs($helper->__('The listing was locked by another process. Please try again later.'));
        $listingEmptyMessage = $helper->escapeJs($helper->__('Listing is empty.'));
        $listingAllItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing All Items On Amazon'));
        $listingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing Selected Items On Amazon'));
        $revisingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Revising Selected Items On Amazon'));
        $relistingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Relisting Selected Items On Amazon'));
        $stoppingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping Selected Items On Amazon'));
        $stoppingAndRemovingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping On Amazon And Removing From Listing Selected Items'));
        $deletingAndRemovingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Removing From Amazon And Listing Selected Items'));
        $successfullyMovedMessage = $helper->escapeJs($helper->__('Product(s) was successfully moved.'));
        $productsWereNotMovedMessage = $helper->escapeJs($helper->__('Product(s) was not moved. <a target="_blank" href="%url%">View log</a> for details.'));
        $someProductsWereNotMovedMessage = $helper->escapeJs($helper->__('Some product(s) was not moved. <a target="_blank" href="%url%">View log</a> for details.'));
        $selectItemsMessage = $helper->escapeJs($helper->__('Please select the products you want to perform the action on.'));
        $selectActionMessage = $helper->escapeJs($helper->__('Please select action.'));
        $successWord = $helper->escapeJs($helper->__('Success'));
        $noticeWord = $helper->escapeJs($helper->__('Notice'));
        $warningWord = $helper->escapeJs($helper->__('Warning'));
        $errorWord = $helper->escapeJs($helper->__('Error'));
        $closeWord = $helper->escapeJs($helper->__('Close'));
        $assignString = Mage::helper('M2ePro')->__('Assign ASIN/ISBN');
        $textConfirm = $helper->escapeJs($helper->__('Are you sure?'));
        $searchAsinManual = $this->getUrl('*/adminhtml_common_amazon_listing/searchAsinManual');
        $suggestedAsinGridHmtl = $this->getUrl('*/adminhtml_common_amazon_listing/getSuggestedAsinGrid');
        $searchAsinAuto = $this->getUrl('*/adminhtml_common_amazon_listing/searchAsinAuto');
        $mapToAsin = $this->getUrl('*/adminhtml_common_amazon_listing/mapToAsin');
        $unmapFromAsin = $this->getUrl('*/adminhtml_common_amazon_listing/unmapFromAsin');
        $newAsinUrl = $this->getUrl('*/adminhtml_common_amazon_template_newProduct', array('marketplace_id' => Mage::helper('M2ePro/Data_Global')->getValue('marketplace_id')));
        $enterProductSearchQueryMessage = $helper->escapeJs($helper->__('Please enter product name or ASIN/ISBN/UPC/EAN.'));
        $autoMapAsinProgressTitle = $helper->escapeJs($helper->__('Assign ASIN/ISBN to Item(s)'));
        $autoMapAsinErrorMessage = $helper->escapeJs($helper->__('Server is currently unavailable. Please try again later.'));
        $newAsinNotAvailable = $helper->escapeJs($helper->__('The new ASIN creation functionality is not available in %code% marketplace yet.'));
        $notSynchronizedMarketplace = $helper->escapeJs($helper->__('In order to use New ASIN functionality, please re-synchronize marketplace data.') . ' ' . $helper->__('Press "Save And Update" button after redirect on marketplace page.'));
        $noVariationsLeftText = $helper->__('All variations are already added.');
        $javascriptsMain = <<<JAVASCRIPT
<script type="text/javascript">

    if (typeof M2ePro == 'undefined') {
        M2ePro = {};
        M2ePro.url = {};
        M2ePro.formData = {};
        M2ePro.customData = {};
        M2ePro.text = {};
    }

    M2ePro.url.add({$urls});

    M2ePro.productsIdsForList = '{$productsIdsForList}';

    M2ePro.url.logViewUrl = '{$logViewUrl}';
    M2ePro.url.checkLockListing = '{$checkLockListing}';
    M2ePro.url.lockListingNow = '{$lockListingNow}';
    M2ePro.url.unlockListingNow = '{$unlockListingNow}';
    M2ePro.url.getErrorsSummary = '{$getErrorsSummary}';

    M2ePro.url.runListProducts = '{$runListProducts}';
    M2ePro.url.runReviseProducts = '{$runReviseProducts}';
    M2ePro.url.runRelistProducts = '{$runRelistProducts}';
    M2ePro.url.runStopProducts = '{$runStopProducts}';
    M2ePro.url.runStopAndRemoveProducts = '{$runStopAndRemoveProducts}';
    M2ePro.url.runDeleteAndRemoveProducts = '{$runDeleteAndRemoveProducts}';

    M2ePro.url.searchAsinManual = '{$searchAsinManual}';
    M2ePro.url.searchAsinAuto = '{$searchAsinAuto}';
    M2ePro.url.suggestedAsinGrid = '{$suggestedAsinGridHmtl}';
    M2ePro.url.mapToAsin = '{$mapToAsin}';
    M2ePro.url.unmapFromAsin = '{$unmapFromAsin}';

    M2ePro.url.newAsin = '{$newAsinUrl}';

    M2ePro.url.prepareData = '{$prepareData}';
    M2ePro.url.getGridHtml = '{$getMoveToListingGridHtml}';
    M2ePro.url.getFailedProductsGridHtml = '{$getFailedProductsGridHtml}';
    M2ePro.url.tryToMoveToListing = '{$tryToMoveToListing}';
    M2ePro.url.moveToListing = '{$moveToListing}';

    M2ePro.url.marketplace_synch = '{$marketplaceSynchUrl}';

    M2ePro.url.get_variation_edit_popup = '{$getVariationEditPopupUrl}';
    M2ePro.url.get_variation_manage_popup = '{$getVariationManagePopupUrl}';

    M2ePro.url.variation_edit_action = '{$variationEditActionUrl}';
    M2ePro.url.variation_manage_action = '{$variationManageActionUrl}';
    M2ePro.url.variation_manage_generate_action = '{$variationManageGenerateActionUrl}';

    M2ePro.text.popup_title = '{$popupTitle}';
    M2ePro.text.failed_products_popup_title = '{$failedProductsPopupTitle}';

    M2ePro.text.task_completed_message = '{$taskCompletedMessage}';
    M2ePro.text.task_completed_success_message = '{$taskCompletedSuccessMessage}';
    M2ePro.text.task_completed_warning_message = '{$taskCompletedWarningMessage}';
    M2ePro.text.task_completed_error_message = '{$taskCompletedErrorMessage}';

    M2ePro.text.locked_obj_notice = '{$lockedObjNoticeMessage}';
    M2ePro.text.sending_data_message = '{$sendingDataToAmazonMessage}';
    M2ePro.text.view_all_product_log_message = '{$viewAllProductLogMessage}';

    M2ePro.text.listing_locked_message = '{$listingLockedMessage}';
    M2ePro.text.listing_empty_message = '{$listingEmptyMessage}';

    M2ePro.text.listing_all_items_message = '{$listingAllItemsMessage}';
    M2ePro.text.listing_selected_items_message = '{$listingSelectedItemsMessage}';
    M2ePro.text.revising_selected_items_message = '{$revisingSelectedItemsMessage}';
    M2ePro.text.relisting_selected_items_message = '{$relistingSelectedItemsMessage}';
    M2ePro.text.stopping_selected_items_message = '{$stoppingSelectedItemsMessage}';
    M2ePro.text.stopping_and_removing_selected_items_message = '{$stoppingAndRemovingSelectedItemsMessage}';
    M2ePro.text.deleting_and_removing_selected_items_message = '{$deletingAndRemovingSelectedItemsMessage}';

    M2ePro.text.successfully_moved = '{$successfullyMovedMessage}';
    M2ePro.text.products_were_not_moved = '{$productsWereNotMovedMessage}';
    M2ePro.text.some_products_were_not_moved = '{$someProductsWereNotMovedMessage}';

    M2ePro.text.select_items_message = '{$selectItemsMessage}';
    M2ePro.text.select_action_message = '{$selectActionMessage}';

    M2ePro.text.success_word = '{$successWord}';
    M2ePro.text.notice_word = '{$noticeWord}';
    M2ePro.text.warning_word = '{$warningWord}';
    M2ePro.text.error_word = '{$errorWord}';
    M2ePro.text.close_word = '{$closeWord}';

    M2ePro.text.assign = '{$assignString}';
    M2ePro.text.confirm = '{$textConfirm}';

    M2ePro.text.enter_productSearch_query = '{$enterProductSearchQueryMessage}';
    M2ePro.text.automap_asin_progress_title = '{$autoMapAsinProgressTitle}';
    M2ePro.text.automap_error_message = '{$autoMapAsinErrorMessage}';

    M2ePro.text.new_asin_not_available = '{$newAsinNotAvailable}';
    M2ePro.text.not_synchronized_marketplace = '{$notSynchronizedMarketplace}';

    M2ePro.text.no_variations_left = '{$noVariationsLeftText}';

    M2ePro.customData.componentMode = '{$component}';
    M2ePro.customData.gridId = '{$gridId}';
    M2ePro.customData.ignoreListings = '{$ignoreListings}';

    M2ePro.customData.marketplace = {$marketplace};
    M2ePro.customData.isNewAsinAvailable = {$isNewAsinAvailable};
    M2ePro.customData.isMarketplaceSynchronized = {$isMarketplaceSynchronized};

    Event.observe(window, 'load', function() {

        ListingGridHandlerObj = new AmazonListingGridHandler(
            'amazonListingViewGrid{$listingData['id']}',
            {$listingData['id']}
        );

        // todo next
        ListingGridHandlerObj.actionHandler.setOptions(M2ePro);
        ListingGridHandlerObj.movingHandler.setOptions(M2ePro);
        ListingGridHandlerObj.productSearchHandler.setOptions(M2ePro);

        ListingProgressBarObj = new ProgressBar('listing_view_progress_bar');
        GridWrapperObj = new AreaWrapper('listing_view_content_container');

        ListingProductVariationHandlerObj = new ListingProductVariationHandler(M2ePro,
                                                                               ListingGridHandlerObj);

        if (M2ePro.productsIdsForList) {
            ListingGridHandlerObj.getGridMassActionObj().checkedString = M2ePro.productsIdsForList;
            ListingGridHandlerObj.actionHandler.listAction();
        }

    });

</script>
JAVASCRIPT;
        $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_view_help');
        $productSearchMenuBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_productSearch_menu');
        $productSearchBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_common_amazon_listing_productSearch_main');
        //------------------------------
        $data = array('target_css_class' => 'edit_template_drop_down', 'items' => $this->getTemplatesButtonDropDownItems());
        $templatesDropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $templatesDropDownBlock->setData($data);
        //------------------------------
        //------------------------------
        $data = array('target_css_class' => 'add_products_drop_down', 'items' => $this->getAddProductsDropDownItems());
        $addProductsDropDownBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $addProductsDropDownBlock->setData($data);
        //------------------------------
        return $javascriptsMain . $templatesDropDownBlock->toHtml() . $addProductsDropDownBlock->toHtml() . $helpBlock->toHtml() . $productSearchMenuBlock->toHtml() . $productSearchBlock->toHtml() . parent::getGridHtml();
    }
Exemplo n.º 21
0
    public function getGridHtml()
    {
        $listingData = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
        /** @var $helper Ess_M2ePro_Helper_Data */
        $helper = Mage::helper('M2ePro');
        //------------------------------
        $urls = $helper->getControllerActions('adminhtml_common_listing_autoAction', array('listing_id' => $this->getRequest()->getParam('id'), 'component' => Ess_M2ePro_Helper_Component_Play::NICK));
        $showAutoAction = json_encode((bool) $this->getRequest()->getParam('auto_actions'));
        $path = 'adminhtml_common_log/listingProduct';
        $urls[$path] = $this->getUrl('*/' . $path, array('channel' => Ess_M2ePro_Helper_Component_Play::NICK, 'back' => $helper->makeBackUrlParam('*/adminhtml_common_play_listing/view', array('id' => $listingData['id']))));
        $path = 'adminhtml_common_listing/duplicateProducts';
        $urls[$path] = $this->getUrl('*/' . $path);
        $urls = json_encode($urls);
        //------------------------------
        $component = Ess_M2ePro_Helper_Component_Play::NICK;
        $layout = $this->getLayout();
        $temp = Mage::helper('M2ePro/Data_Session')->getValue('products_ids_for_list', true);
        $productsIdsForList = empty($temp) ? '' : $temp;
        $gridId = 'playListingViewGrid' . $listingData['id'];
        $ignoreListings = json_encode(array($listingData['id']));
        $logViewUrl = $this->getUrl('*/adminhtml_common_log/listing', array('id' => $listingData['id'], 'channel' => Ess_M2ePro_Block_Adminhtml_Common_Log_Tabs::TAB_ID_PLAY, 'back' => $helper->makeBackUrlParam('*/adminhtml_common_play_listing/view', array('id' => $listingData['id']))));
        $getErrorsSummary = $this->getUrl('*/adminhtml_listing/getErrorsSummary');
        $runListProducts = $this->getUrl('*/adminhtml_common_play_listing/runListProducts');
        $runReviseProducts = $this->getUrl('*/adminhtml_common_play_listing/runReviseProducts');
        $runRelistProducts = $this->getUrl('*/adminhtml_common_play_listing/runRelistProducts');
        $runStopProducts = $this->getUrl('*/adminhtml_common_play_listing/runStopProducts');
        $runStopAndRemoveProducts = $this->getUrl('*/adminhtml_common_play_listing/runStopAndRemoveProducts');
        $prepareData = $this->getUrl('*/adminhtml_listing_moving/prepareMoveToListing');
        $getMoveToListingGridHtml = $this->getUrl('*/adminhtml_listing_moving/moveToListingGrid');
        $getFailedProductsGridHtml = $this->getUrl('*/adminhtml_listing_moving/getFailedProductsGrid');
        $tryToMoveToListing = $this->getUrl('*/adminhtml_listing_moving/tryToMoveToListing');
        $moveToListing = $this->getUrl('*/adminhtml_listing_moving/moveToListing');
        $getVariationEditPopupUrl = $this->getUrl('*/adminhtml_common_listing/getVariationEditPopup');
        $getVariationManagePopupUrl = $this->getUrl('*/adminhtml_common_listing/getVariationManagePopup');
        $variationEditActionUrl = $this->getUrl('*/adminhtml_common_listing/variationEdit');
        $variationManageActionUrl = $this->getUrl('*/adminhtml_common_listing/variationManage');
        $variationManageGenerateActionUrl = $this->getUrl('*/adminhtml_common_listing/variationManageGenerate');
        $popupTitle = $helper->escapeJs($helper->__('Moving Play.com Items'));
        $popupTitleSingle = $helper->escapeJs($helper->__('Moving Play.com Item'));
        $failedProductsPopupTitle = $helper->escapeJs($helper->__('Products failed to move'));
        $taskCompletedMessage = $helper->escapeJs($helper->__('Task completed. Please wait ...'));
        $taskCompletedSuccessMessage = $helper->escapeJs($helper->__('"%task_title%" Task has successfully submitted to be processed.'));
        $taskCompletedWarningMessage = $helper->escapeJs($helper->__('"%task_title%" Task has completed with warnings. <a target="_blank" href="%url%">View Log</a> for details.'));
        $taskCompletedErrorMessage = $helper->escapeJs($helper->__('"%task_title%" Task has completed with errors. <a target="_blank" href="%url%">View Log</a> for details.'));
        $lockedObjNoticeMessage = $helper->escapeJs($helper->__('Some Play.com request(s) are being processed now.'));
        $sendingDataToPlayMessage = $helper->escapeJs($helper->__('Sending %product_title% Product(s) data on Play.com.'));
        $viewAllProductLogMessage = $helper->escapeJs($helper->__('View All Product Log.'));
        $listingLockedMessage = $helper->escapeJs($helper->__('The Listing was locked by another process. Please try again later.'));
        $listingEmptyMessage = $helper->escapeJs($helper->__('Listing is empty.'));
        $listingAllItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing All Items On Play.com'));
        $listingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing Selected Items On Play.com'));
        $revisingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Revising Selected Items On Play.com'));
        $relistingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Relisting Selected Items On Play.com'));
        $stoppingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping Selected Items On Play.com'));
        $stoppingAndRemovingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping On Play.com And Removing From Listing Selected Items'));
        $successfullyMovedMessage = $helper->escapeJs($helper->__('Product(s) was successfully Moved.'));
        $productsWereNotMovedMessage = $helper->escapeJs($helper->__('Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.'));
        $someProductsWereNotMovedMessage = $helper->escapeJs($helper->__('Some Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.'));
        $selectItemsMessage = $helper->escapeJs($helper->__('Please select the Products you want to perform the Action on.'));
        $selectActionMessage = $helper->escapeJs($helper->__('Please select Action.'));
        $successWord = $helper->escapeJs($helper->__('Success'));
        $noticeWord = $helper->escapeJs($helper->__('Notice'));
        $warningWord = $helper->escapeJs($helper->__('Warning'));
        $errorWord = $helper->escapeJs($helper->__('Error'));
        $closeWord = $helper->escapeJs($helper->__('Close'));
        $naString = Mage::helper('M2ePro')->__('N/A');
        $assignString = Mage::helper('M2ePro')->__('Assign Play.com SKU');
        $textConfirm = $helper->escapeJs($helper->__('Are you sure?'));
        $searchPlayIDManual = $this->getUrl('*/adminhtml_common_play_listing/searchPlayIDManual');
        $suggestedPlayIDGridHmtl = $this->getUrl('*/adminhtml_common_play_listing/getSuggestedPlayIDGrid');
        $searchPlayIDAuto = $this->getUrl('*/adminhtml_common_play_listing/searchPlayIDAuto');
        $mapToPlayID = $this->getUrl('*/adminhtml_common_play_listing/mapToPlayID');
        $unmapFromPlayID = $this->getUrl('*/adminhtml_common_play_listing/unmapFromPlayID');
        $enterProductSearchQueryMessage = $helper->escapeJs($helper->__('Enter Product Name or ISBN/EAN/UPC.'));
        $autoMapPlayIDProgressTitle = $helper->escapeJs($helper->__('Assign Play ID to Item(s)'));
        $autoMapPlayIDErrorMessage = $helper->escapeJs($helper->__('Server is currently unavailable. Please try again later.'));
        $noVariationsLeftText = $helper->__('All Variations are already added.');
        $translations = json_encode(array('Auto Add/Remove Rules' => $helper->__('Auto Add/Remove Rules'), 'Based on Magento Categories' => $helper->__('Based on Magento Categories'), 'You must select at least 1 Category.' => $helper->__('You must select at least 1 Category.'), 'Rule with the same Title already exists.' => $helper->__('Rule with the same Title already exists.')));
        $javascriptsMain = <<<JAVASCRIPT
<script type="text/javascript">

    if (typeof M2ePro == 'undefined') {
        M2ePro = {};
        M2ePro.url = {};
        M2ePro.formData = {};
        M2ePro.customData = {};
        M2ePro.text = {};
    }

    M2ePro.url.add({$urls});
    M2ePro.translator.add({$translations});

    M2ePro.productsIdsForList = '{$productsIdsForList}';

    M2ePro.url.logViewUrl = '{$logViewUrl}';
    M2ePro.url.getErrorsSummary = '{$getErrorsSummary}';

    M2ePro.url.runListProducts = '{$runListProducts}';
    M2ePro.url.runReviseProducts = '{$runReviseProducts}';
    M2ePro.url.runRelistProducts = '{$runRelistProducts}';
    M2ePro.url.runStopProducts = '{$runStopProducts}';
    M2ePro.url.runStopAndRemoveProducts = '{$runStopAndRemoveProducts}';

    M2ePro.url.searchPlayIDManual = '{$searchPlayIDManual}';
    M2ePro.url.searchPlayIDAuto = '{$searchPlayIDAuto}';
    M2ePro.url.suggestedPlayIDGrid = '{$suggestedPlayIDGridHmtl}';
    M2ePro.url.mapToPlayID = '{$mapToPlayID}';
    M2ePro.url.unmapFromPlayID = '{$unmapFromPlayID}';

    M2ePro.url.prepareData = '{$prepareData}';
    M2ePro.url.getGridHtml = '{$getMoveToListingGridHtml}';
    M2ePro.url.getFailedProductsGridHtml = '{$getFailedProductsGridHtml}';
    M2ePro.url.tryToMoveToListing = '{$tryToMoveToListing}';
    M2ePro.url.moveToListing = '{$moveToListing}';

    M2ePro.url.get_variation_edit_popup = '{$getVariationEditPopupUrl}';
    M2ePro.url.get_variation_manage_popup = '{$getVariationManagePopupUrl}';

    M2ePro.url.variation_edit_action = '{$variationEditActionUrl}';
    M2ePro.url.variation_manage_action = '{$variationManageActionUrl}';
    M2ePro.url.variation_manage_generate_action = '{$variationManageGenerateActionUrl}';

    M2ePro.text.popup_title = '{$popupTitle}';
    M2ePro.text.popup_title_single = '{$popupTitleSingle}';
    M2ePro.text.failed_products_popup_title = '{$failedProductsPopupTitle}';

    M2ePro.text.task_completed_message = '{$taskCompletedMessage}';
    M2ePro.text.task_completed_success_message = '{$taskCompletedSuccessMessage}';
    M2ePro.text.task_completed_warning_message = '{$taskCompletedWarningMessage}';
    M2ePro.text.task_completed_error_message = '{$taskCompletedErrorMessage}';

    M2ePro.text.locked_obj_notice = '{$lockedObjNoticeMessage}';
    M2ePro.text.sending_data_message = '{$sendingDataToPlayMessage}';
    M2ePro.text.view_all_product_log_message = '{$viewAllProductLogMessage}';

    M2ePro.text.listing_locked_message = '{$listingLockedMessage}';
    M2ePro.text.listing_empty_message = '{$listingEmptyMessage}';

    M2ePro.text.listing_all_items_message = '{$listingAllItemsMessage}';
    M2ePro.text.listing_selected_items_message = '{$listingSelectedItemsMessage}';
    M2ePro.text.revising_selected_items_message = '{$revisingSelectedItemsMessage}';
    M2ePro.text.relisting_selected_items_message = '{$relistingSelectedItemsMessage}';
    M2ePro.text.stopping_selected_items_message = '{$stoppingSelectedItemsMessage}';
    M2ePro.text.stopping_and_removing_selected_items_message = '{$stoppingAndRemovingSelectedItemsMessage}';

    M2ePro.text.successfully_moved = '{$successfullyMovedMessage}';
    M2ePro.text.products_were_not_moved = '{$productsWereNotMovedMessage}';
    M2ePro.text.some_products_were_not_moved = '{$someProductsWereNotMovedMessage}';

    M2ePro.text.select_items_message = '{$selectItemsMessage}';
    M2ePro.text.select_action_message = '{$selectActionMessage}';

    M2ePro.text.success_word = '{$successWord}';
    M2ePro.text.notice_word = '{$noticeWord}';
    M2ePro.text.warning_word = '{$warningWord}';
    M2ePro.text.error_word = '{$errorWord}';
    M2ePro.text.close_word = '{$closeWord}';

    M2ePro.text.na = '{$naString}';
    M2ePro.text.assign = '{$assignString}';

    M2ePro.text.confirm = '{$textConfirm}';

    M2ePro.text.enter_productSearch_query = '{$enterProductSearchQueryMessage}';
    M2ePro.text.automap_play_id_progress_title = '{$autoMapPlayIDProgressTitle}';
    M2ePro.text.automap_error_message = '{$autoMapPlayIDErrorMessage}';

    M2ePro.text.no_variations_left = '{$noVariationsLeftText}';

    M2ePro.customData.componentMode = '{$component}';
    M2ePro.customData.gridId = '{$gridId}';
    M2ePro.customData.ignoreListings = '{$ignoreListings}';

    Event.observe(window, 'load', function() {

        ListingGridHandlerObj = new PlayListingGridHandler(
            'playListingViewGrid{$listingData['id']}',
            {$listingData['id']}
        );

        // todo next (temp solution)
        ListingGridHandlerObj.actionHandler.setOptions(M2ePro);
        ListingGridHandlerObj.movingHandler.setOptions(M2ePro);
        ListingGridHandlerObj.productSearchHandler.setOptions(M2ePro);

        ListingProgressBarObj = new ProgressBar('listing_view_progress_bar');
        GridWrapperObj = new AreaWrapper('listing_view_content_container');

        ListingProductVariationHandlerObj = new ListingProductVariationHandler(M2ePro,
                                                                               ListingGridHandlerObj);

        if (M2ePro.productsIdsForList) {
            ListingGridHandlerObj.getGridMassActionObj().checkedString = M2ePro.productsIdsForList;
            ListingGridHandlerObj.actionHandler.listAction();
        }

        ListingAutoActionHandlerObj = new ListingAutoActionHandler();
        if ({$showAutoAction}) {
            ListingAutoActionHandlerObj.loadAutoActionHtml();
        }

    });

</script>
JAVASCRIPT;
        $helpBlock = $layout->createBlock('M2ePro/adminhtml_common_play_listing_view_help');
        $productSearchMenuBlock = $layout->createBlock('M2ePro/adminhtml_common_play_listing_productSearch_menu');
        $productSearchBlock = $layout->createBlock('M2ePro/adminhtml_common_play_listing_productSearch_main');
        //------------------------------
        $data = array('target_css_class' => 'edit_settings_drop_down', 'items' => $this->getTemplatesButtonDropDownItems());
        $templatesDropDownBlock = $layout->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $templatesDropDownBlock->setData($data);
        //------------------------------
        //------------------------------
        $data = array('target_css_class' => 'add_products_drop_down', 'items' => $this->getAddProductsDropDownItems());
        $addProductsDropDownBlock = $layout->createBlock('M2ePro/adminhtml_widget_button_dropDown');
        $addProductsDropDownBlock->setData($data);
        //------------------------------
        //------------------------------
        $listingSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_common_play_listing_view_listingSwitcher');
        //------------------------------
        //------------------------------
        $viewHeaderBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_listing_view_header', '', array('listing' => Mage::helper('M2ePro/Component_Play')->getCachedObject('Listing', $listingData['id'])));
        //------------------------------
        return $javascriptsMain . $templatesDropDownBlock->toHtml() . $listingSwitcher->toHtml() . $addProductsDropDownBlock->toHtml() . $helpBlock->toHtml() . $viewHeaderBlock->toHtml() . $productSearchMenuBlock->toHtml() . $productSearchBlock->toHtml() . parent::getGridHtml();
    }
Exemplo n.º 22
0
 public function getGridHtml()
 {
     $helpBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_feedback_help');
     $formBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_feedback_form');
     return $helpBlock->toHtml() . $formBlock->toHtml() . parent::getGridHtml();
 }
Exemplo n.º 23
0
    public function getGridHtml()
    {
        /** @var $helper Ess_M2ePro_Helper_Data */
        $helper = Mage::helper('M2ePro');
        $component = Ess_M2ePro_Helper_Component_Ebay::NICK;
        $temp = $helper->getSessionValue('products_ids_for_list', true);
        $productsIdsForList = empty($temp) ? '' : $temp;
        $listingData = $helper->getGlobalValue('temp_data');
        $logViewUrl = $this->getUrl('*/adminhtml_log/listing', array('id' => $listingData['id'], 'back' => $helper->makeBackUrlParam('*/adminhtml_ebay_listing/view', array('id' => $listingData['id']))));
        $checkLockListing = $this->getUrl('*/adminhtml_listing/checkLockListing', array('component' => $component));
        $lockListingNow = $this->getUrl('*/adminhtml_listing/lockListingNow', array('component' => $component));
        $unlockListingNow = $this->getUrl('*/adminhtml_listing/unlockListingNow', array('component' => $component));
        $getErrorsSummary = $this->getUrl('*/adminhtml_listing/getErrorsSummary');
        $runListProducts = $this->getUrl('*/adminhtml_ebay_listing/runListProducts');
        $runReviseProducts = $this->getUrl('*/adminhtml_ebay_listing/runReviseProducts');
        $runRelistProducts = $this->getUrl('*/adminhtml_ebay_listing/runRelistProducts');
        $runStopProducts = $this->getUrl('*/adminhtml_ebay_listing/runStopProducts');
        $runStopAndRemoveProducts = $this->getUrl('*/adminhtml_ebay_listing/runStopAndRemoveProducts');
        $tempDropDownHtml = $helper->escapeJs($this->getEditTemplateDropDownHtml());
        $tempAddProductsDropDownHtml = $helper->escapeJs($this->getAddProductsDropDownHtml());
        $taskCompletedMessage = $helper->escapeJs($helper->__('Task completed. Please wait ...'));
        $taskCompletedSuccessMessage = $helper->escapeJs($helper->__('"%s" task has successfully completed.'));
        // ->__('"%s" task has completed with warnings. <a href="%s">View log</a> for details.')
        $tempString = '"%s" task has completed with warnings. <a href="%s">View log</a> for details.';
        $taskCompletedWarningMessage = $helper->escapeJs($helper->__($tempString));
        // ->__('"%s" task has completed with errors. <a href="%s">View log</a> for details.')
        $tempString = '"%s" task has completed with errors. <a href="%s">View log</a> for details.';
        $taskCompletedErrorMessage = $helper->escapeJs($helper->__($tempString));
        $sendingDataToEbayMessage = $helper->escapeJs($helper->__('Sending %s product(s) data on eBay.'));
        $viewAllProductLogMessage = $helper->escapeJs($helper->__('View All Product Log.'));
        $listingLockedMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('The listing was locked by another process. Please try again later.'));
        $listingEmptyMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing is empty.'));
        $listingAllItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing All Items On eBay'));
        $listingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Listing Selected Items On eBay'));
        $revisingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Revising Selected Items On eBay'));
        $relistingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Relisting Selected Items On eBay'));
        $stoppingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping Selected Items On eBay'));
        $stoppingAndRemovingSelectedItemsMessage = Mage::helper('M2ePro')->escapeJs(Mage::helper('M2ePro')->__('Stopping On eBay And Removing From Listing Selected Items'));
        $selectItemsMessage = $helper->escapeJs($helper->__('Please select items.'));
        $selectActionMessage = $helper->escapeJs($helper->__('Please select action.'));
        $successWord = $helper->escapeJs($helper->__('Success'));
        $noticeWord = $helper->escapeJs($helper->__('Notice'));
        $warningWord = $helper->escapeJs($helper->__('Warning'));
        $errorWord = $helper->escapeJs($helper->__('Error'));
        $closeWord = $helper->escapeJs($helper->__('Close'));
        $gridId = $component . 'ListingViewGrid' . $listingData['id'];
        $ignoreListings = json_encode(array($listingData['id']));
        $prepareData = $this->getUrl('*/adminhtml_listing/prepareMoveToListing');
        $getMoveToListingGridHtml = $this->getUrl('*/adminhtml_listing/moveToListingGrid');
        $getFailedProductsGridHtml = $this->getUrl('*/adminhtml_listing/getFailedProductsGrid');
        $tryToMoveToListing = $this->getUrl('*/adminhtml_ebay_listing/tryToMoveToListing');
        $moveToListing = $this->getUrl('*/adminhtml_ebay_listing/moveToListing');
        $successfullyMovedMessage = $helper->escapeJs($helper->__('Product(s) was successfully moved.'));
        $productsWereNotMovedMessage = $helper->escapeJs($helper->__('Product(s) was not moved. <a href="%s">View log</a> for details.'));
        $someProductsWereNotMovedMessage = $helper->escapeJs($helper->__('Some product(s) was not moved. <a href="%s">View log</a> for details.'));
        $popupTitle = $helper->escapeJs($helper->__('Moving eBay Items.'));
        $failedProductsPopupTitle = $helper->escapeJs($helper->__('Products failed to move'));
        $javascriptsMain = <<<JAVASCRIPT
<script type="text/javascript">

    if (typeof M2ePro == 'undefined') {
        M2ePro = {};
        M2ePro.url = {};
        M2ePro.formData = {};
        M2ePro.customData = {};
        M2ePro.text = {};
    }

    M2ePro.productsIdsForList = '{$productsIdsForList}';

    M2ePro.url.logViewUrl = '{$logViewUrl}';
    M2ePro.url.checkLockListing = '{$checkLockListing}';
    M2ePro.url.lockListingNow = '{$lockListingNow}';
    M2ePro.url.unlockListingNow = '{$unlockListingNow}';
    M2ePro.url.getErrorsSummary = '{$getErrorsSummary}';

    M2ePro.url.runListProducts = '{$runListProducts}';
    M2ePro.url.runReviseProducts = '{$runReviseProducts}';
    M2ePro.url.runRelistProducts = '{$runRelistProducts}';
    M2ePro.url.runStopProducts = '{$runStopProducts}';
    M2ePro.url.runStopAndRemoveProducts = '{$runStopAndRemoveProducts}';

    M2ePro.url.prepareData = '{$prepareData}';
    M2ePro.url.getGridHtml = '{$getMoveToListingGridHtml}';
    M2ePro.url.getFailedProductsGridHtml = '{$getFailedProductsGridHtml}';
    M2ePro.url.tryToMoveToListing = '{$tryToMoveToListing}';
    M2ePro.url.moveToListing = '{$moveToListing}';

    M2ePro.text.popup_title = '{$popupTitle}';
    M2ePro.text.failed_products_popup_title = '{$failedProductsPopupTitle}';

    M2ePro.text.task_completed_message = '{$taskCompletedMessage}';
    M2ePro.text.task_completed_success_message = '{$taskCompletedSuccessMessage}';
    M2ePro.text.task_completed_warning_message = '{$taskCompletedWarningMessage}';
    M2ePro.text.task_completed_error_message = '{$taskCompletedErrorMessage}';

    M2ePro.text.sending_data_message = '{$sendingDataToEbayMessage}';
    M2ePro.text.view_all_product_log_message = '{$viewAllProductLogMessage}';

    M2ePro.text.listing_locked_message = '{$listingLockedMessage}';
    M2ePro.text.listing_empty_message = '{$listingEmptyMessage}';

    M2ePro.text.listing_all_items_message = '{$listingAllItemsMessage}';
    M2ePro.text.listing_selected_items_message = '{$listingSelectedItemsMessage}';
    M2ePro.text.revising_selected_items_message = '{$revisingSelectedItemsMessage}';
    M2ePro.text.relisting_selected_items_message = '{$relistingSelectedItemsMessage}';
    M2ePro.text.stopping_selected_items_message = '{$stoppingSelectedItemsMessage}';
    M2ePro.text.stopping_and_removing_selected_items_message = '{$stoppingAndRemovingSelectedItemsMessage}';

    M2ePro.text.select_items_message = '{$selectItemsMessage}';
    M2ePro.text.select_action_message = '{$selectActionMessage}';

    M2ePro.text.success_word = '{$successWord}';
    M2ePro.text.notice_word = '{$noticeWord}';
    M2ePro.text.warning_word = '{$warningWord}';
    M2ePro.text.error_word = '{$errorWord}';
    M2ePro.text.close_word = '{$closeWord}';

    M2ePro.text.successfully_moved = '{$successfullyMovedMessage}';
    M2ePro.text.products_were_not_moved = '{$productsWereNotMovedMessage}';
    M2ePro.text.some_products_were_not_moved = '{$someProductsWereNotMovedMessage}';

    M2ePro.customData.componentMode = '{$component}';
    M2ePro.customData.gridId = '{$gridId}';
    M2ePro.customData.ignoreListings = '{$ignoreListings}';

    Event.observe(window, 'load', function() {
        ListingActionHandlerObj = new ListingActionHandler(M2ePro,{$listingData['id']});
        EbayListingMoveToListingHandlerObj = new ListingMoveToListingHandler(M2ePro);
        ListingItemGridHandlerObj = new ListingItemGridHandler(M2ePro,'ebayListingViewGrid{$listingData['id']}',
                                                               1,2,ListingActionHandlerObj,
                                                               EbayListingMoveToListingHandlerObj,
                                                               undefined,
                                                               undefined);
        ListingProgressBarObj = new ProgressBar('listing_view_progress_bar');
        GridWrapperObj = new AreaWrapper('listing_view_content_container');

        \$\$('.edit_template_drop_down')[0].innerHTML += '{$tempDropDownHtml}';
        \$\$('.add_products_drop_down')[0].innerHTML += '{$tempAddProductsDropDownHtml}';

        DropDownObj = new DropDown();
        DropDownObj.prepare(\$\$('.edit_template_drop_down')[0]);
        DropDownObj.prepare(\$\$('.add_products_drop_down')[0]);

        if (M2ePro.productsIdsForList) {
            eval(ListingItemGridHandlerObj.gridId+'_massactionJsObject.checkedString = M2ePro.productsIdsForList;');
            \$\$('select#'+ListingItemGridHandlerObj.gridId+'_massaction-select option')[1].selected = 'selected';
            ListingItemGridHandlerObj.massactionSubmitClick(true);
        }
    });

</script>
JAVASCRIPT;
        $html = '';
        $html .= $javascriptsMain;
        $html .= $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_view_help')->toHtml();
        $generalTemplate = Mage::helper('M2ePro')->getGlobalValue('temp_data')->getGeneralTemplate();
        if ($generalTemplate->getMarketplaceId() == Ess_M2ePro_Helper_Component_Ebay::MARKETPLACE_MOTORS) {
            $compatibilityAttribute = $generalTemplate->getChildObject()->getMotorsSpecificsAttribute();
            $motorsSpecificsBlock = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_motor_specific_generateAttributeValue', '', array('general_template_id' => $generalTemplate->getId(), 'products_grid_id' => $this->getChild('grid')->getId(), 'motors_specifics_attribute' => $compatibilityAttribute));
            $html .= $motorsSpecificsBlock->toHtml();
        }
        return $html . parent::getGridHtml();
    }