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> ' . $this->getChildHtml('revise_all_confirm_popup_ok_button') . ' </div> </div>'; }