protected function _beforeToHtml()
    {
        $this->jsUrl->add($this->getUrl('*/settings_magentoInventory/save'), \Ess\M2ePro\Block\Adminhtml\Ebay\Settings\Tabs::TAB_ID_MAGENTO_INVENTORY);
        $this->js->addRequireJs([], <<<JS

        \$('force_qty_mode').observe('change', function() {
            if(\$('force_qty_mode').value == 1) {
                \$('force_qty_value_tr').show();
            } else {
                \$('force_qty_value_tr').hide();
            }
        }).simulate('change');
JS
);
        return parent::_beforeToHtml();
    }
    protected function _toHtml()
    {
        $reviseAllInProcessingState = $this->modelFactory->getObject('Config\\Manager\\Synchronization')->getGroupValue('/ebay/templates/synchronization/revise/total/', 'last_listing_product_id');
        $js = "require([\n                'M2ePro/Plugin/ProgressBar',\n                'M2ePro/Plugin/AreaWrapper',\n                'M2ePro/SynchProgress',\n                'M2ePro/Synchronization'\n            ], function() {\n\n            window.SynchProgressBarObj = new ProgressBar('synchronization_progress_bar');\n            window.SynchWrapperObj = new AreaWrapper('synchronization_content_container');\n\n            window.SynchronizationProgressObj = new SynchProgress(SynchProgressBarObj, SynchWrapperObj );\n            window.SynchronizationObj = new Synchronization(SynchronizationProgressObj);";
        if ($this->isShowReviseAll()) {
            $js .= 'SynchronizationObj.initReviseAllInfo(' . json_encode(!is_null($reviseAllInProcessingState)) . ',\'' . $this->reviseAllStartDate . '\',\'' . $this->reviseAllEndDate . '\',\'' . \Ess\M2ePro\Helper\Component\Ebay::NICK . '\'
                );';
        }
        $js .= '})';
        $this->js->addOnReadyJs($js);
        $this->jsTranslator->addTranslations(['Synchronization Settings have been saved.' => 'Synchronization Settings have been saved.', 'Running All Enabled Tasks' => 'Running All Enabled Tasks', 'Another Synchronization Is Already Running.' => 'Another Synchronization Is Already Running.', 'Getting information. Please wait ...' => 'Getting information. Please wait ...', 'Preparing to start. Please wait ...' => 'Preparing to start. Please wait ...', 'Synchronization has successfully ended.' => 'Synchronization has successfully ended.', 'Synchronization ended with warnings. <a target="_blank" href="%url%">View Log</a> for details.' => '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.' => 'Synchronization ended with errors. <a target="_blank" href="%url%">View Log</a> for details.', 'Revise All' => 'Revise All']);
        $this->jsUrl->addUrls([\Ess\M2ePro\Block\Adminhtml\Ebay\Settings\Tabs::TAB_ID_SYNCHRONIZATION => $this->getUrl('*/ebay_synchronization/save'), 'synch_formSubmit' => $this->getUrl('*/ebay_synchronization/save'), 'logViewUrl' => $this->getUrl('*/ebay_synchronization_log/index', array('back' => $this->getHelper('Data')->makeBackUrlParam('*/ebay_synchronization/index'))), 'runReviseAll' => $this->getUrl('*/ebay_synchronization/runReviseAll'), 'runAllEnabledNow' => $this->getUrl('*/ebay_synchronization/runAllEnabledNow'), 'synchCheckProcessingNow' => $this->getUrl('*/ebay_synchronization/synchCheckProcessingNow')]);
        return '<div id="synchronization_progress_bar"></div>
            <div id="synchronization_content_container">' . parent::_toHtml() . '
            </div>
            <div id="ebay_revise_all_confirm_popup" style="display: none;">
                <div style="margin: 17px 0">' . $this->__('Click \'Confirm\' and Revise will be performed by the Inventory Synchronization, 100
                         Items per a cycle.') . '
            </div>

            <div style="padding-bottom: 20px; text-align: right">
                <a onclick="ReviseAllConfirmPopup.closeModal();">' . $this->__('Cancel') . '</a>
                &nbsp;&nbsp;&nbsp;&nbsp;' . $this->getChildHtml('revise_all_confirm_popup_ok_button') . '
            </div>

            </div>';
    }
Example #3
0
 protected function _beforeToHtml()
 {
     $this->jsUrl->add($this->getUrl('*/ebay_settings/save'), \Ess\M2ePro\Block\Adminhtml\Ebay\Settings\Tabs::TAB_ID_MAIN);
     return parent::_beforeToHtml();
 }
Example #4
0
    protected function _beforeToHtml()
    {
        $this->jsUrl->add($this->getUrl('*/settings_logsClearing/save'), \Ess\M2ePro\Block\Adminhtml\Ebay\Settings\Tabs::TAB_ID_LOGS_CLEARING);
        $this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Settings\\LogsClearing'));
        $this->jsUrl->add($this->getUrl('*/settings_logsClearing/save'), 'formSubmit');
        $this->jsTranslator->add('Please enter a valid value greater than 14 days.', $this->__('Please enter a valid value greater than 14 days.'));
        $logData = [LogClearing::LOG_LISTINGS, LogClearing::LOG_OTHER_LISTINGS, LogClearing::LOG_SYNCHRONIZATIONS, LogClearing::LOG_ORDERS];
        $this->js->addRequireJs(['s' => 'M2ePro/Settings/LogClearing'], <<<JS
        window.LogClearingObj = new SettingsLogClearing();

        LogClearingObj.changeModeLog('{$logData[0]}');
        LogClearingObj.changeModeLog('{$logData[1]}');
        LogClearingObj.changeModeLog('{$logData[2]}');
        LogClearingObj.changeModeLog('{$logData[3]}');
JS
);
        return parent::_beforeToHtml();
    }