protected function _construct() { parent::_construct(); $this->_controller = 'adminhtml_ebay_account'; // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); if ((bool) $this->getRequest()->getParam('close_on_save', false)) { if ($this->getRequest()->getParam('id')) { $this->addButton('save', array('label' => $this->__('Save And Close'), 'onclick' => 'EbayAccountObj.saveAndClose()', 'class' => 'primary')); } else { $this->addButton('save_and_continue', array('label' => $this->__('Save And Continue Edit'), 'onclick' => 'EbayAccountObj.saveAndEditClick(\'\',\'ebayAccountEditTabs\')', 'class' => 'primary')); } return; } $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'EbayAccountObj.backClick(\'' . $this->getHelper('Data')->getBackUrl('list') . '\')', 'class' => 'back')); $saveButtonsProps = []; if ($this->getHelper('Data\\GlobalData')->getValue('temp_data') && $this->getHelper('Data\\GlobalData')->getValue('temp_data')->getId()) { $this->addButton('delete', array('label' => $this->__('Delete'), 'onclick' => 'EbayAccountObj.deleteClick()', 'class' => 'delete M2ePro_delete_button primary')); $saveButtonsProps['save'] = ['label' => $this->__('Save And Back'), 'onclick' => 'EbayAccountObj.saveClick()', 'class' => 'save primary']; } // --------------------------------------- if (!empty($saveButtonsProps)) { $saveButtons = ['id' => 'save_and_continue', 'label' => $this->__('Save And Continue Edit'), 'class' => 'add', 'button_class' => '', 'onclick' => 'EbayAccountObj.saveAndEditClick(\'\')', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\SplitButton', 'options' => $saveButtonsProps]; $this->addButton('save_buttons', $saveButtons); } else { $this->addButton('save_and_continue', ['label' => $this->__('Save And Continue Edit'), 'class' => 'add primary', 'onclick' => 'EbayAccountObj.saveAndEditClick(\'\')']); } // --------------------------------------- }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('amazonListingCreateStepOne'); $this->_controller = 'adminhtml_amazon_listing_create'; $this->_mode = 'general'; // --------------------------------------- // Set header text // --------------------------------------- $this->_headerText = $this->__("Creating A New Amazon M2E Pro Listing"); // --------------------------------------- // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- $this->addButton('save_and_next', array('label' => $this->__('Next Step'), 'class' => 'action-primary forward')); // --------------------------------------- }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('ebayListingSourceMode'); $this->_controller = 'adminhtml_ebay_listing_product_add'; $this->_mode = 'sourceMode'; // --------------------------------------- // Set header text // --------------------------------------- $this->_headerText = $this->__('Add Products'); // --------------------------------------- // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- if (!$this->getRequest()->getParam('listing_creation', false)) { $url = $this->getUrl('*/ebay_listing/view', array('id' => $this->getRequest()->getParam('id'))); $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'setLocation(\'' . $url . '\')', 'class' => 'back')); } // --------------------------------------- $url = $this->getUrl('*/*/*', array('_current' => true)); $this->addButton('next', array('label' => $this->__('Continue'), 'onclick' => 'CommonObj.submitForm(\'' . $url . '\');', 'class' => 'action-primary forward')); // --------------------------------------- }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('amazonListingCreateStepThree'); $this->_controller = 'adminhtml_amazon_listing_create'; $this->_mode = 'search'; // --------------------------------------- // Set header text // --------------------------------------- $this->_headerText = $this->__("Creating A New Amazon M2E Pro Listing"); // --------------------------------------- // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- // --------------------------------------- $url = $this->getUrl('*/amazon_listing_create/index', array('_current' => true, 'step' => '2')); $this->addButton('back', array('label' => $this->__('Previous Step'), 'onclick' => 'CommonObj.backClick(\'' . $url . '\')', 'class' => 'action-primary back')); // --------------------------------------- // --------------------------------------- $url = $this->getUrl('*/amazon_listing_create/index', array('_current' => true)); $this->addButton('save_and_next', array('label' => $this->__('Next Step'), 'onclick' => 'CommonObj.saveClick(\'' . $url . '\')', 'class' => 'action-primary forward')); // --------------------------------------- }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('ebayListingAccountMarketplace'); $this->_controller = 'adminhtml_ebay_listing_create'; $this->_mode = 'general'; // --------------------------------------- // Set header text // --------------------------------------- $this->_headerText = $this->__('Creating A New M2E Pro Listing'); // --------------------------------------- // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- // --------------------------------------- $this->addButton('next', array('label' => $this->__('Next Step'), 'class' => 'action-primary next_step_button forward')); // --------------------------------------- }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('amazonAccountEdit'); $this->_controller = 'adminhtml_amazon_account'; // --------------------------------------- // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- /* @var $wizardHelper \Ess\M2ePro\Helper\Module\Wizard */ $wizardHelper = $this->getHelper('Module\\Wizard'); if ($wizardHelper->isActive(\Ess\M2ePro\Helper\View\Amazon::WIZARD_INSTALLATION_NICK)) { // --------------------------------------- $this->addButton('save_and_continue', array('label' => $this->__('Save And Continue Edit'), 'onclick' => 'AmazonAccountObj.saveAndEditClick(\'\',\'amazonAccountEditTabs\')', 'class' => 'action-primary')); // --------------------------------------- if ($this->getRequest()->getParam('id')) { // --------------------------------------- $url = $this->getUrl('*/amazon_account/new', array('wizard' => true)); $this->addButton('add_new_account', array('label' => $this->__('Add New Account'), 'onclick' => 'setLocation(\'' . $url . '\')', 'class' => 'action-primary')); // --------------------------------------- } } else { if ((bool) $this->getRequest()->getParam('close_on_save', false)) { if ($this->getRequest()->getParam('id')) { $this->addButton('save', array('label' => $this->__('Save And Close'), 'onclick' => 'AmazonAccountObj.saveAndClose()', 'class' => 'action-primary')); } else { $this->addButton('save_and_continue', array('label' => $this->__('Save And Continue Edit'), 'onclick' => 'AmazonAccountObj.saveAndEditClick(\'\',\'amazonAccountEditTabs\')', 'class' => 'action-primary')); } return; } // --------------------------------------- $url = $this->getHelper('Data')->getBackUrl('list'); $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'AmazonAccountObj.backClick(\'' . $url . '\')', 'class' => 'back')); // --------------------------------------- // --------------------------------------- if ($this->getHelper('Data\\GlobalData')->getValue('temp_data') && $this->getHelper('Data\\GlobalData')->getValue('temp_data')->getId()) { // --------------------------------------- $this->addButton('delete', array('label' => $this->__('Delete'), 'onclick' => 'AmazonAccountObj.deleteClick()', 'class' => 'delete M2ePro_delete_button primary')); // --------------------------------------- } // --------------------------------------- $saveButtons = ['id' => 'save_and_continue', 'label' => $this->__('Save And Continue Edit'), 'class' => 'add', 'button_class' => '', 'onclick' => 'AmazonAccountObj.saveAndEditClick(\'\',\'amazonAccountEditTabs\')', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\SplitButton', 'options' => ['save' => ['label' => $this->__('Save And Back'), 'onclick' => 'AmazonAccountObj.saveClick()', 'class' => 'action-primary']]]; $this->addButton('save_buttons', $saveButtons); // --------------------------------------- } }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('amazonOrderView'); $this->_controller = 'adminhtml_amazon_order'; $this->_mode = 'view'; // --------------------------------------- $this->order = $this->getHelper('Data\\GlobalData')->getValue('order'); // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- // --------------------------------------- $url = $this->getHelper('Data')->getBackUrl('*/*/index'); $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'CommonObj.backClick(\'' . $url . '\')', 'class' => 'back')); // --------------------------------------- if ($this->order->getChildObject()->canUpdateShippingStatus() && !$this->order->getChildObject()->isPrime()) { // --------------------------------------- $url = $this->getUrl('*/*/updateShippingStatus', array('id' => $this->order->getId())); $this->addButton('update_shipping_status', array('label' => $this->__('Mark as Shipped'), 'onclick' => "setLocation('" . $url . "');", 'class' => 'primary')); // --------------------------------------- } if ($this->order->getReserve()->isPlaced()) { // --------------------------------------- $url = $this->getUrl('*/order/reservationCancel', array('ids' => $this->order->getId())); $this->addButton('reservation_cancel', array('label' => $this->__('Cancel QTY Reserve'), 'onclick' => "confirmSetLocation(M2ePro.translator.translate('Are you sure?'), '" . $url . "');", 'class' => 'primary')); // --------------------------------------- } elseif ($this->order->isReservable()) { // --------------------------------------- $url = $this->getUrl('*/order/reservationPlace', array('ids' => $this->order->getId())); $this->addButton('reservation_place', array('label' => $this->__('Reserve QTY'), 'onclick' => "confirmSetLocation(M2ePro.translator.translate('Are you sure?'), '" . $url . "');", 'class' => 'primary')); // --------------------------------------- } if (is_null($this->order->getMagentoOrderId())) { // --------------------------------------- $url = $this->getUrl('*/*/createMagentoOrder', array('id' => $this->order->getId())); $this->addButton('order', array('label' => $this->__('Create Magento Order'), 'onclick' => "setLocation('" . $url . "');", 'class' => 'primary')); // --------------------------------------- } elseif (is_null($this->order->getMagentoOrder()) || $this->order->getMagentoOrder()->isCanceled()) { // --------------------------------------- $url = $this->getUrl('*/*/createMagentoOrder', array('id' => $this->order->getId(), 'force' => 'yes')); $confirm = $this->getHelper('Data')->escapeJs($this->__('Are you sure that you want to create new Magento Order?')); $this->addButton('order', array('label' => $this->__('Create Magento Order'), 'onclick' => "confirmSetLocation('" . $confirm . "','" . $url . "');", 'class' => 'primary')); // --------------------------------------- } }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->_controller = 'adminhtml_ebay_marketplace'; // --------------------------------------- $this->removeButton('save'); $this->removeButton('reset'); $this->removeButton('back'); $this->addButton('run_update_all', array('label' => $this->__('Update All Now'), 'onclick' => 'MarketplaceObj.updateAction()', 'class' => 'save update_all_marketplaces primary')); $this->addButton('run_save_and_synch', array('label' => $this->__('Save'), 'onclick' => 'MarketplaceObj.saveAction();', 'class' => 'save save_and_update_marketplaces primary')); }
public function _construct() { parent::_construct(); $this->_controller = 'adminhtml_ebay_template'; $this->_mode = 'edit'; // --------------------------------------- $nick = $this->getTemplateNick(); $template = $this->getHelper('Data\\GlobalData')->getValue("ebay_template_{$nick}"); // --------------------------------------- // Set buttons actions // --------------------------------------- $this->buttonList->remove('reset'); $this->buttonList->remove('delete'); $this->buttonList->remove('save'); // --------------------------------------- // --------------------------------------- $isSaveAndClose = (bool) $this->getRequest()->getParam('close_on_save', false); // --------------------------------------- if ($template->getId() && !$isSaveAndClose) { $duplicateHeaderText = $this->getHelper('Data')->escapeJs($this->__('Add %template_name% Policy', $this->getTemplateName())); $onclickHandler = $nick == \Ess\M2ePro\Model\Ebay\Template\Manager::TEMPLATE_DESCRIPTION ? 'EbayTemplateDescriptionObj' : 'EbayTemplateEditObj'; $this->buttonList->add('duplicate', array('label' => $this->__('Duplicate'), 'onclick' => $onclickHandler . '.duplicateClick( \'ebay-template\', \'' . $duplicateHeaderText . '\', \'' . $nick . '\' )', 'class' => 'add M2ePro_duplicate_button primary')); $url = $this->getUrl('*/ebay_template/delete'); $this->buttonList->add('delete', ['label' => $this->__('Delete'), 'onclick' => 'EbayTemplateEditObj.deleteClick(\'' . $url . '\')', 'class' => 'delete M2ePro_delete_button primary']); } // --------------------------------------- $saveConfirmation = ''; if ($template->getId()) { $saveConfirmation = $this->getHelper('Data')->escapeJs($this->__('<br/><b>Note:</b> All changes you have made will be automatically applied to all M2E Pro Listings where this Policy is used.')); } // --------------------------------------- $saveButtonsProps = []; $url = $this->getUrl('*/ebay_template/save'); if (!$isSaveAndClose) { $saveButtonsProps['save'] = ['label' => $this->__('Save And Back'), 'onclick' => 'EbayTemplateEditObj.saveClick(' . '\'' . $url . '\',' . '\'' . $saveConfirmation . '\',' . '\'' . $nick . '\'' . ')']; } if ($isSaveAndClose) { $saveButtonsProps['save'] = ['label' => $this->__('Save And Close'), 'onclick' => "EbayTemplateEditObj.saveAndCloseClick('{$url}')"]; $this->removeButton('back'); } $backUrl = $this->getHelper('Data')->makeBackUrlParam('edit', []); $url = $this->getUrl('*/ebay_template/save', ['back' => $backUrl]); $saveButtons = ['id' => 'save_and_continue', 'label' => $this->__('Save And Continue Edit'), 'class' => 'add', 'button_class' => '', 'onclick' => 'EbayTemplateEditObj.saveAndEditClick(' . '\'' . $url . '\',' . '\'\',' . '\'' . $saveConfirmation . '\',' . '\'' . $nick . '\'' . ')', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\SplitButton', 'options' => $saveButtonsProps]; $this->addButton('save_buttons', $saveButtons); }
public function _construct() { parent::_construct(); $this->_controller = 'adminhtml_ebay_listing_product_category_settings'; $this->_mode = 'mode'; // Initialization block // --------------------------------------- $this->setId('ebayListingCategoryMode'); $this->removeButton('delete'); $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('save'); // --------------------------------------- $this->_headerText = $this->__('Set eBay Categories'); $url = $this->getUrl('*/ebay_listing_product_add/deleteAll', array('_current' => true)); if (!$this->getRequest()->getParam('without_back')) { $this->addButton('back', array('label' => $this->__('Back'), 'class' => 'back', 'onclick' => 'setLocation(\'' . $url . '\');')); } $this->addButton('next', array('label' => $this->__('Continue'), 'class' => 'action-primary forward', 'onclick' => "\$('categories_mode_form').submit();")); }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('amazonListingEdit'); $this->_controller = 'adminhtml_amazon_listing'; $this->_mode = 'edit'; // --------------------------------------- $this->listing = $this->getHelper('Data\\GlobalData')->getValue('edit_listing'); // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- if (!is_null($this->getRequest()->getParam('back'))) { // --------------------------------------- $url = $this->getHelper('Data')->getBackUrl('*/amazon_listing/index'); $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'AmazonListingSettingsObj.backClick(\'' . $url . '\')', 'class' => 'back')); // --------------------------------------- } // --------------------------------------- $this->addButton('auto_action', array('label' => $this->__('Auto Add/Remove Rules'), 'onclick' => 'ListingAutoActionObj.loadAutoActionHtml();', 'class' => 'action-primary')); // --------------------------------------- $backUrl = $this->getHelper('Data')->getBackUrlParam('list'); // --------------------------------------- $url = $this->getUrl('*/amazon_listing/save', array('id' => $this->listing['id'], 'back' => $backUrl)); $saveButtonsProps = ['save' => ['label' => $this->__('Save And Back'), 'onclick' => 'AmazonListingSettingsObj.saveClick(\'' . $url . '\')', 'class' => 'save primary']]; // --------------------------------------- // --------------------------------------- $saveButtons = ['id' => 'save_and_continue', 'label' => $this->__('Save And Continue Edit'), 'class' => 'add', 'button_class' => '', 'onclick' => 'AmazonListingSettingsObj.saveAndEitClick(\'' . $url . '\', 1)', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\SplitButton', 'options' => $saveButtonsProps]; $this->addButton('save_buttons', $saveButtons); // --------------------------------------- }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('amazonListingSourceMode'); $this->_controller = 'adminhtml_amazon_listing_product_add'; $this->_mode = 'sourceMode'; // --------------------------------------- // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- // --------------------------------------- $url = $this->getUrl('*/*/*', array('_current' => true)); $this->addButton('next', array('label' => $this->__('Continue'), 'onclick' => 'CommonObj.submitForm(\'' . $url . '\');', 'class' => 'action-primary forward')); // --------------------------------------- }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('amazonListingAddNewAsin'); $this->_controller = 'adminhtml_amazon_listing_product_add'; $this->_mode = 'newAsin'; // --------------------------------------- // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- $this->listing = $this->getHelper('Data\\GlobalData')->getValue('listing_for_products_add'); $url = $this->getUrl('*/*/index', array('step' => 1, '_current' => true)); $this->addButton('back', array('label' => $this->__('Back'), 'class' => 'back', 'onclick' => 'setLocation(\'' . $url . '\');')); $this->addButton('next', array('label' => $this->__('Continue'), 'class' => 'action-primary forward', 'onclick' => "descriptionTemplateModeFormSubmit()")); }
protected function _construct() { $this->_controller = 'adminhtml_listing'; parent::_construct(); }
public function _construct() { parent::_construct(); // Initialization block // --------------------------------------- $this->setId('ebayListingTemplateEdit'); $this->_controller = 'adminhtml_ebay_listing'; $this->_mode = 'edit'; // --------------------------------------- // --------------------------------------- $listing = $this->getHelper('Data\\GlobalData')->getValue('ebay_listing'); // --------------------------------------- // Set buttons actions // --------------------------------------- $this->removeButton('back'); $this->removeButton('reset'); $this->removeButton('delete'); $this->removeButton('add'); $this->removeButton('save'); $this->removeButton('edit'); // --------------------------------------- if ($listing) { // --------------------------------------- $url = $this->getUrl('*/ebay_listing/view', array('id' => $listing->getId())); if ($this->getRequest()->getParam('back')) { $url = $this->getHelper('Data')->getBackUrl(); } $this->addButton('back', array('label' => $this->__('Back'), 'onclick' => 'CommonObj.backClick(\'' . $url . '\')', 'class' => 'back')); // --------------------------------------- // --------------------------------------- $backUrl = $this->getHelper('Data')->makeBackUrlParam('*/ebay_listing/view', array('id' => $listing->getId())); $url = $this->getUrl('*/ebay_template/saveListing', array('id' => $listing->getId(), 'back' => $backUrl)); $callback = 'function(params) { CommonObj.postForm(\'' . $url . '\', params); }'; $saveButtonsProps = ['save' => ['label' => $this->__('Save And Back'), 'onclick' => 'EbayListingTemplateSwitcherObj.saveSwitchers(' . $callback . ')', 'class' => 'save primary']]; // --------------------------------------- // --------------------------------------- $backUrl = $this->getHelper('Data')->makeBackUrlParam('*/ebay_template/editListing'); $url = $this->getUrl('*/ebay_template/saveListing', array('id' => $listing->getId(), 'back' => $backUrl)); $callback = 'function(params) { CommonObj.postForm(\'' . $url . '\', params); }'; $saveButtons = ['id' => 'save_and_continue', 'label' => $this->__('Save And Continue Edit'), 'class' => 'add', 'button_class' => '', 'onclick' => 'EbayListingTemplateSwitcherObj.saveSwitchers(' . $callback . ')', 'class_name' => 'Ess\\M2ePro\\Block\\Adminhtml\\Magento\\Button\\SplitButton', 'options' => $saveButtonsProps]; $this->addButton('save_buttons', $saveButtons); // --------------------------------------- } if (!$listing) { // --------------------------------------- $currentStep = (int) $this->getRequest()->getParam('step', 2); $prevStep = $currentStep - 1; // --------------------------------------- if ($prevStep >= 1 && $prevStep <= 4) { // --------------------------------------- $url = $this->getUrl('*/ebay_listing_create/index', array('_current' => true, 'step' => $prevStep)); $this->addButton('back', array('label' => $this->__('Previous Step'), 'onclick' => 'CommonObj.backClick(\'' . $url . '\')', 'class' => 'back primary')); // --------------------------------------- } $nextStepBtnText = 'Next Step'; $sessionKey = 'ebay_listing_create'; $sessionData = $this->getHelper('Data\\Session')->getValue($sessionKey); if ($currentStep == 4 && isset($sessionData['creation_mode']) && $sessionData['creation_mode'] === \Ess\M2ePro\Helper\View::LISTING_CREATION_MODE_LISTING_ONLY) { $nextStepBtnText = 'Complete'; } // --------------------------------------- $url = $this->getUrl('*/ebay_listing_create/index', array('_current' => true, 'step' => $currentStep)); $callback = 'function(params) { CommonObj.postForm(\'' . $url . '\', params); }'; $this->addButton('save', array('label' => $this->__($nextStepBtnText), 'onclick' => 'EbayListingTemplateSwitcherObj.saveSwitchers(' . $callback . ')', 'class' => 'action-primary forward')); // --------------------------------------- } $this->css->addFile('ebay/template.css'); }