示例#1
0
    protected function _toHtml()
    {
        if ($this->getRequest()->isXmlHttpRequest()) {
            $this->js->add(<<<JS
    ListingGridHandlerObj.afterInitPage();
JS
);
        }
        return parent::_toHtml();
    }
示例#2
0
    protected function _toHtml()
    {
        $allIdsStr = implode(',', $this->getCollection()->getAllIds());
        if ($this->getRequest()->isXmlHttpRequest()) {
            $this->js->add(<<<JS
                EbayListingViewEbayGridObj.afterInitPage();
                EbayListingViewEbayGridObj.getGridMassActionObj().setGridIds('{$allIdsStr}');
JS
);
            return parent::_toHtml() . $this->getInitTerapeakWidgetHtml();
        }
        $component = \Ess\M2ePro\Helper\Component\Ebay::NICK;
        $temp = $this->getHelper('Data\\Session')->getValue('products_ids_for_list', true);
        $productsIdsForList = empty($temp) ? '' : $temp;
        $gridId = $component . 'ListingViewGrid' . $this->listing['id'];
        $ignoreListings = json_encode(array($this->listing['id']));
        $this->jsUrl->addUrls(['runListProducts' => $this->getUrl('*/ebay_listing/runListProducts'), 'runRelistProducts' => $this->getUrl('*/ebay_listing/runRelistProducts'), 'runReviseProducts' => $this->getUrl('*/ebay_listing/runReviseProducts'), 'runStopProducts' => $this->getUrl('*/ebay_listing/runStopProducts'), 'runStopAndRemoveProducts' => $this->getUrl('*/ebay_listing/runStopAndRemoveProducts'), 'runRemoveProducts' => $this->getUrl('*/ebay_listing/runRemoveProducts')]);
        $this->jsUrl->add($this->getUrl('*/ebay_listing/getEstimatedFees', array('listing_id' => $this->listing['id'])), 'ebay_listing/getEstimatedFees');
        $this->jsUrl->add($this->getUrl('*/ebay_listing/getCategoryChooserHtml', array('listing_id' => $this->listing['id'])), 'ebay_listing/getCategoryChooserHtml');
        $this->jsUrl->add($this->getUrl('*/ebay_listing/getCategorySpecificHtml', array('listing_id' => $this->listing['id'])), 'ebay_listing/getCategorySpecificHtml');
        $this->jsUrl->add($this->getUrl('*/ebay_listing/saveCategoryTemplate', array('listing_id' => $this->listing['id'])), 'ebay_listing/saveCategoryTemplate');
        $this->jsUrl->add($this->getUrl('*/ebay_listing_product_log/index'), 'ebay_listing_product_log/index');
        $this->jsUrl->add($this->getUrl('*/ebay_listing_log/index', array('id' => $this->listing['id'], 'back' => $this->getHelper('Data')->makeBackUrlParam('*/ebay_listing/view', array('id' => $this->listing['id'])))), 'logViewUrl');
        $this->jsUrl->add($this->getUrl('*/listing/getErrorsSummary'), 'getErrorsSummary');
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Listing\\Moving'));
        $this->jsUrl->add($this->getUrl('*/ebay_listing_moving/moveToListingGrid'), 'ebay_listing_moving/moveToListingGrid');
        // M2ePro_TRANSLATIONS
        // %task_title%" task has completed with warnings. <a target="_blank" href="%url%">View Log</a> for details.
        $taskCompletedWarningMessage = '"%task_title%" task has completed with warnings. ';
        $taskCompletedWarningMessage .= '<a target="_blank" href="%url%">View Log</a> for details.';
        // M2ePro_TRANSLATIONS
        // "%task_title%" task has completed with errors. <a target="_blank" href="%url%">View Log</a> for details.
        $taskCompletedErrorMessage = '"%task_title%" task has completed with errors. ';
        $taskCompletedErrorMessage .= '<a target="_blank" href="%url%">View Log</a> for details.';
        $this->jsTranslator->addTranslations(['task_completed_message' => $this->__('Task completed. Please wait ...'), 'task_completed_success_message' => $this->__('"%task_title%" task has successfully completed.'), 'task_completed_warning_message' => $this->__($taskCompletedWarningMessage), 'task_completed_error_message' => $this->__($taskCompletedErrorMessage), 'sending_data_message' => $this->__('Sending %product_title% Product(s) data on eBay.'), 'View Full Product Log' => $this->__('View Full Product Log.'), 'The Listing was locked by another process. Please try again later.' => $this->__('The Listing was locked by another process. Please try again later.'), 'Listing is empty.' => $this->__('Listing is empty.'), 'listing_all_items_message' => $this->__('Listing All Items On eBay'), 'listing_selected_items_message' => $this->__('Listing Selected Items On eBay'), 'revising_selected_items_message' => $this->__('Revising Selected Items On eBay'), 'relisting_selected_items_message' => $this->__('Relisting Selected Items On eBay'), 'stopping_selected_items_message' => $this->__('Stopping Selected Items On eBay'), 'stopping_and_removing_selected_items_message' => $this->__('Stopping On eBay And Removing From Listing Selected Items'), 'removing_selected_items_message' => $this->__('Removing From Listing Selected Items'), 'Please select the Products you want to perform the Action on.' => $this->__('Please select the Products you want to perform the Action on.'), 'Please select Action.' => $this->__('Please select Action.'), 'Product(s) was successfully Moved.' => $this->__('Product(s) was successfully Moved.'), 'Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.' => $this->__('Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.'), 'Some Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.' => $this->__('Some Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.'), 'Moving eBay Item' => $this->__('Moving eBay Item'), 'Moving eBay Items' => $this->__('Moving eBay Items'), 'Product(s) failed to Move' => $this->__('Product(s) failed to Move'), 'eBay Categories' => $this->__('eBay Categories'), 'of Product' => $this->__('of Product'), 'Specifics' => $this->__('Specifics'), 'Estimated Fee Details' => $this->__('Estimated Fee Details')]);
        $showAutoAction = json_encode((bool) $this->getRequest()->getParam('auto_actions'));
        $showMotorNotification = json_encode((bool) $this->isShowMotorNotification());
        // M2ePro_TRANSLATIONS
        // Please check eBay Motors compatibility attribute.You can find it in %menu_label% > Configuration > <a target="_blank" href="%url%">General</a>.
        $motorNotification = $this->getHelper('Data')->escapeJs($this->__('Please check eBay Motors compatibility attribute.' . 'You can find it in %menu_label% > Configuration > <a target="_blank" href="%url%">General</a>.', $this->getHelper('View\\Ebay')->getMenuRootNodeLabel(), $this->getUrl('*/ebay_configuration')));
        $this->js->add(<<<JS
    M2ePro.productsIdsForList = '{$productsIdsForList}';

    M2ePro.customData.componentMode = '{$component}';
    M2ePro.customData.gridId = '{$gridId}';
    M2ePro.customData.ignoreListings = '{$ignoreListings}';
JS
);
        $this->js->addOnReadyJs(<<<JS
    require([
        'EbayListingAutoActionInstantiation',
        'M2ePro/Ebay/Listing/View/Ebay/Grid',
        'M2ePro/Ebay/Listing/VariationProductManage'
    ], function(){

        window.EbayListingViewEbayGridObj = new EbayListingViewEbayGrid(
            '{$this->getId()}',
            {$this->listing['id']}
        );
        EbayListingViewEbayGridObj.afterInitPage();
        EbayListingViewEbayGridObj.getGridMassActionObj().setGridIds('{$allIdsStr}');

        EbayListingViewEbayGridObj.actionHandler.setOptions(M2ePro);
        EbayListingViewEbayGridObj.variationProductManageHandler.setOptions(M2ePro);
        //TODO Bids popup
        // EbayListingViewEbayGridObj.listingProductBidsHandler.setOptions(M2ePro);
      
        EbayListingViewEbayGridObj.actionHandler.setProgressBar('listing_view_progress_bar');
        EbayListingViewEbayGridObj.actionHandler.setGridWrapper('listing_view_content_container');

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

        if ({$showAutoAction}) {
            wait(
                function() { return typeof ListingAutoActionObj != 'undefined'; },
                function () { ListingAutoActionObj.loadAutoActionHtml(); },
                50
            );
        }

        if ({$showMotorNotification}) {
            ListingEbayGridHandlerObj.showMotorsNotificationPopUp('{$motorNotification}');
        }

    });
JS
);
        return parent::_toHtml() . $this->getInitTerapeakWidgetHtml();
    }
示例#3
0
    protected function _toHtml()
    {
        $this->js->add("require(['EbayListingAutoActionInstantiation']);");
        // ---------------------------------------
        if ($this->getRequest()->getParam('auto_actions')) {
            $this->js->add(<<<JS
require([
    'EbayListingAutoActionInstantiation'
], function() {
    ListingAutoActionObj.loadAutoActionHtml();
});
JS
);
        }
        // ---------------------------------------
        return parent::_toHtml();
    }
示例#4
0
    protected function _toHtml()
    {
        $allIdsStr = implode(',', $this->getCollection()->getAllIds());
        if ($this->getRequest()->isXmlHttpRequest()) {
            $this->js->add(<<<JS
            EbayListingViewSettingsGridObj.afterInitPage();
            EbayListingViewSettingsGridObj.getGridMassActionObj().setGridIds('{$allIdsStr}');
JS
);
            return parent::_toHtml();
        }
        /** @var $helper \Ess\M2ePro\Helper\Data */
        $helper = $this->getHelper('Data');
        // ---------------------------------------
        $this->jsPhp->addConstants($helper->getClassConstants('\\Ess\\M2ePro\\Helper\\Component\\Ebay\\Category'));
        // ---------------------------------------
        // ---------------------------------------
        $this->jsUrl->addUrls($helper->getControllerActions('Ebay\\Listing', array('_current' => true)));
        $this->jsUrl->add($this->getUrl('*/ebay_listing/view'), 'ebay_listing/getTransferringUrl');
        $this->jsUrl->add($this->getUrl('*/ebay_listing_log/index', array('id' => $this->listing->getId())), 'ebay_listing_log/index');
        $this->jsUrl->add($this->getUrl('*/ebay_listing_log/index', array('id' => $this->listing->getId(), 'back' => $helper->makeBackUrlParam('*/ebay_listing/view', array('id' => $this->listing->getId())))), 'logViewUrl');
        $this->jsUrl->add($this->getUrl('*/listing/getErrorsSummary'), 'getErrorsSummary');
        $this->jsUrl->add($this->getUrl('*/ebay_listing_settings_moving/moveToListingGrid', ['listing_view' => true]), 'moveToListingGridHtml');
        $this->jsUrl->add($this->getUrl('*/listing_moving/prepareMoveToListing'), 'prepareData');
        $this->jsUrl->add($this->getUrl('*/listing_moving/getFailedProductsGrid'), 'getFailedProductsGridHtml');
        $this->jsUrl->add($this->getUrl('*/listing_moving/tryToMoveToListing'), 'tryToMoveToListing');
        $this->jsUrl->add($this->getUrl('*/listing_moving/moveToListing'), 'moveToListing');
        $this->jsUrl->add($this->getUrl('*/ebay_template/editListingProduct'), 'ebay_template/editListingProduct');
        $this->jsUrl->add($this->getUrl('*/ebay_template/saveListingProduct'), 'ebay_template/saveListingProduct');
        // ---------------------------------------
        // TODO NOT SUPPORTED FEATURES "ebay motors"
        //        $this->jsUrl->addUrls($helper->getControllerActions('adminhtml_ebay_motor'));
        //        if ($this->getMotorsType() == Ess_M2ePro_Helper_Component_Ebay_Motors::TYPE_EPID) {
        //            $motorsTypeTitle = 'ePID';
        //        } else {
        //            $motorsTypeTitle = 'kType';
        //        }
        // M2ePro_TRANSLATIONS
        // %task_title%" Task has completed with warnings. <a target="_blank" href="%url%">View Log</a> for details.
        $taskCompletedWarningMessage = '"%task_title%" Task has completed with warnings.' . ' <a target="_blank" href="%url%">View Log</a> for details.';
        // M2ePro_TRANSLATIONS
        // "%task_title%" Task has completed with errors. <a target="_blank" href="%url%">View Log</a> for details.
        $taskCompletedErrorMessage = '"%task_title%" Task has completed with errors. ' . ' <a target="_blank" href="%url%">View Log</a> for details.';
        //------------------------------
        $this->jsTranslator->addTranslations(['Edit Payment and Shipping Settings' => $this->__('Edit Payment and Shipping Settings'), 'Edit Selling Settings' => $this->__('Edit Selling Settings'), 'Edit Synchronization Settings' => $this->__('Edit Synchronization Settings'), 'Edit Settings' => $this->__('Edit Settings'), 'for' => $this->__('for'), 'eBay Categories' => $this->__('eBay Categories'), 'of Product' => $this->__('of Product'), 'Specifics' => $this->__('Specifics'), 'Compatibility Attribute ePIDs' => $this->__('Compatibility Attribute ePIDs'), 'Payment for Translation Service' => $this->__('Payment for Translation Service'), 'Payment for Translation Service. Help' => $this->__('Payment for Translation Service'), 'Specify a sum to be credited to an Account.' => $this->__('Specify a sum to be credited to an Account.' . ' If you are planning to order more Items for Translation in future,' . ' you can credit the sum greater than the one needed for current Translation.' . ' Click <a href="%url%" target="_blank">here</a> to find out more.', $this->getHelper('Module\\Support')->getDocumentationUrl(NULL, NULL, 'x/BQAJAQ#SellonanothereBaySite-Account')), 'Amount to Pay.' => $this->__('Amount to Pay'), 'Insert amount to be credited to an Account' => $this->__('Insert amount to be credited to an Account.'), 'Confirm' => $this->__('Confirm'), 'Add Compatible Vehicles' => $this->__('Add Compatible Vehicles'), 'Save Filter' => $this->__('Save Filter'), 'Save as Group' => $this->__('Save as Group'), 'Set Note' => $this->__('Set Note'), 'View Groups' => $this->__('Selected Groups'), 'View Filters' => $this->__('Selected Filters'), 'Selected Filters' => $this->__('Selected Filters'), 'Selected Groups' => $this->__('Selected Groups'), 'Note' => $this->__('Note'), 'Filter' => $this->__('Filter'), 'Group' => $this->__('Group'), 'kType' => $this->__('kType'), 'ePID' => $this->__('ePID'), 'Type' => $this->__('Type'), 'Year From' => $this->__('Year From'), 'Year To' => $this->__('Year To'), 'Body Style' => $this->__('Body Style'), 'task_completed_message' => $this->__('Task completed. Please wait ...'), 'task_completed_success_message' => $this->__('"%task_title%" Task has successfully completed.'), 'sending_data_message' => $this->__('Sending %product_title% Product(s) data on eBay.'), 'View Full Product Log.' => $this->__('View Full Product Log.'), 'The Listing was locked by another process. Please try again later.' => $this->__('The Listing was locked by another process. Please try again later.'), 'Listing is empty.' => $this->__('Listing is empty.'), 'Please select Items.' => $this->__('Please select Items.'), 'Please select Action.' => $this->__('Please select Action.'), 'popup_title' => $this->__('Moving eBay Items'), 'popup_title_single' => $this->__('Moving eBay Item'), 'successfully_moved' => $this->__('Product(s) was successfully Moved.'), 'failed_products_popup_title' => $this->__('Product(s) failed to move'), 'Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.' => $this->__('Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.'), 'Some Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.' => $this->__('Some Product(s) was not Moved. <a target="_blank" href="%url%">View Log</a> for details.'), 'task_completed_warning_message' => $this->__($taskCompletedWarningMessage), $taskCompletedErrorMessage => $this->__($taskCompletedErrorMessage)]);
        // TODO NOT SUPPORTED FEATURES "ebay motors"
        //        $motorsType = '';
        //        if ($this->isMotorsAvailable()) {
        //            $motorsType = $this->getMotorsType();
        //        }
        $temp = $this->getHelper('Data\\Session')->getValue('products_ids_for_list', true);
        $productsIdsForList = empty($temp) ? '' : $temp;
        $component = \Ess\M2ePro\Helper\Component\Ebay::NICK;
        $ignoreListings = json_encode(array($this->listing->getId()));
        $this->js->add(<<<JS
    M2ePro.productsIdsForList = '{$productsIdsForList}';

    M2ePro.customData.componentMode = '{$component}';
    M2ePro.customData.gridId = '{$this->getId()}';
    M2ePro.customData.ignoreListings = '{$ignoreListings}';
JS
);
        // TODO NOT SUPPORTED FEATURES "ebay motors"
        //        EbayMotorsHandlerObj = new EbayMotorsHandler({$this->listing->getId()}, '{$motorsType}');
        $this->js->addOnReadyJs(<<<JS
    require([
        'EbayListingAutoActionInstantiation',
        'M2ePro/Ebay/Listing/View/Settings/Grid'
    ], function(){

        window.EbayListingViewSettingsGridObj = new EbayListingViewSettingsGrid(
            '{$this->getId()}',
            '{$this->listing->getId()}'
        );
        EbayListingViewSettingsGridObj.afterInitPage();
        EbayListingViewSettingsGridObj.getGridMassActionObj().setGridIds('{$allIdsStr}');  
        EbayListingViewSettingsGridObj.movingHandler.setOptions(M2ePro);
        
        // TODO NOT SUPPORTED FEATURES
        // EbayListingTransferringHandlerObj = new EbayListingTransferringHandler();

        // TODO NOT SUPPORTED FEATURES
        // EbayListingTransferringPaymentHandlerObj = new EbayListingTransferringPaymentHandler();
    });
JS
);
        // ---------------------------------------
        if ($this->getRequest()->getParam('auto_actions')) {
            $this->js->add(<<<JS
require([
    'EbayListingAutoActionInstantiation'
], function() {
    ListingAutoActionObj.loadAutoActionHtml();
});
JS
);
        }
        // ---------------------------------------
        return parent::_toHtml();
    }