Example #1
0
 /**
  * processes the grid block, checks gridcontrol configuration for updates on this block and calls column actions
  *
  * @param Mage_Adminhtml_Block_Widget $block
  */
 public function processBlock($block)
 {
     $config = Mage::getSingleton('hackathon_gridcontrol/config')->getConfig();
     $blockConfig = $config->getNode('grids/' . $block->getId());
     // process columns
     foreach ($blockConfig->children() as $column) {
         // process column actions
         foreach ($column->children() as $action) {
             // create method name
             $func = '_' . $action->getName() . 'Action';
             $funcArr = array($this, $func);
             if (!is_callable($funcArr)) {
                 continue;
             }
             // call function and give a reference to the actual block, column and action
             call_user_func($funcArr, new Varien_Object(array('block' => $block, 'action' => $action, 'column' => $column)));
         }
     }
     // resort columns
     $block->sortColumnsByOrder();
     // register current block, needed to extend the collection in Hackathon_GridControl_Model_Observer
     Mage::register('hackathon_gridcontrol_current_block', $block);
     // call _prepareCollection to reload the collection and apply column filters
     $this->_callProtectedMethod($block, '_prepareCollection');
     // remove current block to prevent race conditions in later collection loads
     Mage::unregister('hackathon_gridcontrol_current_block');
 }
Example #2
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     if ($this->isCharity()) {
         $this->getCharityDictionary();
     }
 }
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     // ---------------------------------------
     $groupGrid = $this->prepareGroupsGrid();
     // ---------------------------------------
     // ---------------------------------------
     $data = array('id' => 'confirm_button', 'class' => 'confirm_button', 'label' => Mage::helper('M2ePro')->__('Save'), 'onclick' => 'ListingAutoActionHandlerObj.confirm();', 'style' => 'display: none;');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('confirm_button', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $data = array('id' => 'close_button', 'class' => 'close_button', 'label' => Mage::helper('M2ePro')->__('Close'), 'onclick' => 'Windows.getFocusedWindow().close();');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('close_button', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $data = array('id' => 'continue_button', 'class' => 'continue_button next', 'label' => Mage::helper('M2ePro')->__('Continue'), 'style' => 'display: none;', 'onclick' => '');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('continue_button', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $data = array('id' => 'add_button', 'class' => 'add_button add', 'label' => Mage::helper('M2ePro')->__('Add New Rule'), 'onclick' => 'ListingAutoActionHandlerObj.categoryStepOne();', 'style' => $groupGrid->getCollection()->getSize() == 0 ? 'display: none;' : '');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('add_button', $buttonBlock);
     // ---------------------------------------
     // ---------------------------------------
     $data = array('id' => 'add_first_button', 'class' => 'add_first_button add', 'label' => Mage::helper('M2ePro')->__('Add New Rule'), 'onclick' => 'ListingAutoActionHandlerObj.categoryStepOne();');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('add_first_button', $buttonBlock);
     // ---------------------------------------
 }
 /**
  * Render block HTML
  *
  * @return string
  */
 protected function _toHtml()
 {
     $accordion = $this->getLayout()->createBlock('adminhtml/widget_accordion')->setId('aitattachmentInfo');
     $accordion->addItem('aitattachment', array('title' => Mage::helper('adminhtml')->__('Attachments'), 'content' => $this->getLayout()->createBlock('aitemails/email_template_edit_attachments')->toHtml(), 'open' => true));
     $this->setChild('accordion', $accordion);
     return parent::_toHtml();
 }
 protected function _beforeToHtml()
 {
     if ($this->getParentBlock() && ($order = $this->getOrder())) {
         $this->setEntity($order);
     }
     parent::_beforeToHtml();
 }
Example #6
0
 /**
  * Prepare layout
  */
 protected function _prepareLayout()
 {
     $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/', array('store' => $this->getRequest()->getParam('store', 0))) . '\')', 'class' => 'back')));
     $this->setChild('reset_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Reset'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/*', array('_current' => true)) . '\')')));
     if ($this->getStaging()->canMerge()) {
         $this->setChild('merge_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Merge...'), 'onclick' => 'setLocation(\'' . $this->getMergeUrl() . '\')', 'class' => 'add')));
     } elseif ($this->getStaging()->getId()) {
         $this->setChild('merge_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Merge'), 'class' => 'disabled')));
     }
     if ($this->getStaging()->canSave()) {
         $this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Save'), 'onclick' => $this->getEditFormJsObject() . '.submit()', 'class' => 'save')));
     } else {
         if ($this->getRequest()->getParam('type')) {
             $this->setChild('create_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Create'), 'onclick' => $this->getEditFormJsObject() . '.runCreate()', 'class' => 'add')));
         }
     }
     if ($this->getStaging()->canResetStatus()) {
         $this->setChild('reset_status_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Reset Status'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/resetStatus', array('_current' => true)) . '\')', 'class' => 'reset')));
     }
     $stagingId = $this->getStagingId();
     if ($stagingId && $this->getStaging()->isScheduled()) {
         $this->setChild('unschedule_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('enterprise_staging')->__('Unschedule Merge'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/unschedule', array('id' => $stagingId)) . '\')', 'class' => 'reset')));
     }
     return parent::_prepareLayout();
 }
Example #7
0
 protected function _beforeToHtml()
 {
     $tableName = $this->getData('table_name');
     $actionIdsString = $this->getData('action_ids');
     $countField = 'product_id';
     if ($this->getData('type_log') == 'listing') {
         $countField = 'product_id';
     } else {
         if ($this->getData('type_log') == 'listing_other') {
             $countField = 'listing_other_id';
         }
     }
     /** @var $connRead Varien_Db_Adapter_Pdo_Mysql */
     $connRead = Mage::getSingleton('core/resource')->getConnection('core_read');
     $fields = new Zend_Db_Expr('COUNT(`' . $countField . '`) as `count_products`, `description`');
     $dbSelect = $connRead->select()->from($tableName, $fields)->where('`action_id` IN (' . $actionIdsString . ')')->where('`type` = ?', Ess_M2ePro_Model_Log_Abstract::TYPE_ERROR)->group('description')->order(array('count_products DESC'))->limit(100);
     $newErrors = array();
     $tempErrors = $connRead->fetchAll($dbSelect);
     foreach ($tempErrors as $row) {
         $row['description'] = Mage::helper('M2ePro/View')->getModifiedLogMessage($row['description']);
         $newErrors[] = $row;
     }
     $this->errors = $newErrors;
     return parent::_beforeToHtml();
 }
Example #8
0
 protected function _beforeToHtml()
 {
     $this->isMagentoDevelopmentModeEnabled = Mage::helper('M2ePro/Magento')->isDeveloper();
     $this->isDevelopmentModeEnabled = Mage::helper('M2ePro/Module')->isDevelopmentMode();
     $this->isMaintenanceEnabled = Mage::helper('M2ePro/Module_Maintenance')->isEnabled();
     $this->commands = Mage::helper('M2ePro/View_Development_Command')->parseDebugCommandsData(Ess_M2ePro_Helper_View_Development_Command::CONTROLLER_DEBUG);
     //-------------------------------
     $url = $this->getUrl('*/adminhtml_development/enableMaintenanceMode/');
     $data = array('label' => Mage::helper('M2ePro')->__('Enable'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'enable_maintenance');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('enable_maintenance', $buttonBlock);
     $url = $this->getUrl('*/adminhtml_development/disableMaintenanceMode/');
     $data = array('label' => Mage::helper('M2ePro')->__('Disable'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'disable_maintenance');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('disable_maintenance', $buttonBlock);
     //-------------------------------
     //------------------------------
     $url = $this->getUrl('*/adminhtml_development/enableDevelopmentMode/');
     $data = array('label' => Mage::helper('M2ePro')->__('Enable'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'enable_development_mode');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('enable_development_mode', $buttonBlock);
     $url = $this->getUrl('*/adminhtml_development/disableDevelopmentMode/');
     $data = array('label' => Mage::helper('M2ePro')->__('Disable'), 'onclick' => 'setLocation(\'' . $url . '\');', 'class' => 'disable_development_mode');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('disable_development_mode', $buttonBlock);
     //-------------------------------
     return parent::_beforeToHtml();
 }
 /**
  * Preparing layout, adding buttons
  *
  * @return Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
  */
 protected function _prepareLayout()
 {
     $this->setChild('trainevent_form', $this->getLayout()->createBlock('wage_trainevent/adminhtml_trainevent_edit_tab_form'));
     $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('wage_trainevent')->__('Delete'), 'class' => 'delete delete-option')));
     $this->setChild('add_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('wage_trainevent')->__('Add Schedules'), 'class' => 'add', 'id' => 'add_new_option_button')));
     return parent::_prepareLayout();
 }
 public function _prepareLayout()
 {
     $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Add Price'), 'onclick' => 'return customerPriceControl.showCustomerGrid();', 'class' => 'add'));
     $button->setName('add_customer_price_item_button');
     $this->setChild('add_button', $button);
     return parent::_prepareLayout();
 }
Example #11
0
 /**
  * Preparing the layout
  * 
  * @return Mage_Core_Block_Abstract
  */
 protected function _prepareLayout()
 {
     $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('adminhtml')->__('Back'), 'onclick' => "window.location.href = '" . $this->getUrl('*/*') . "'", 'class' => 'back')));
     $this->setChild('select_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('adminhtml')->__('Continue To PDF Template Type'), 'onclick' => "getSelectedItem()", 'type' => 'button', 'class' => 'select')));
     $this->setChild('form', $this->getLayout()->createBlock('pdfgenerator/adminhtml_template_pdf_edit_tabs'));
     return parent::_prepareLayout();
 }
Example #12
0
 protected function _beforeToHtml()
 {
     $this->phpVersion = Mage::helper('M2ePro/Client')->getPhpVersion();
     $this->phpApi = Mage::helper('M2ePro/Client')->getPhpApiName();
     $this->phpSettings = Mage::helper('M2ePro/Client')->getPhpSettings();
     return parent::_beforeToHtml();
 }
Example #13
0
 protected function _beforeToHtml()
 {
     $this->setChild('actual_info', $this->getLayout()->createBlock('M2ePro/adminhtml_development_info_actual'));
     $this->setChild('database_module', $this->getLayout()->createBlock('M2ePro/adminhtml_development_info_mysql_module'));
     $this->setChild('database_integration', $this->getLayout()->createBlock('M2ePro/adminhtml_development_info_mysql_integration'));
     return parent::_beforeToHtml();
 }
 protected function _beforeToHtml()
 {
     $this->platformMode = Mage::helper('M2ePro')->__(ucwords(Mage::helper('M2ePro/Magento')->getEditionName()));
     $this->platformVersion = Mage::helper('M2ePro/Magento')->getVersion();
     $this->platformIsSecretKey = Mage::helper('M2ePro/Magento')->isSecretKeyToUrl();
     return parent::_beforeToHtml();
 }
 protected function _prepareLayout()
 {
     $this->setChild('browse_button', $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array('id' => $this->_getButtonId('browse'), 'label' => Mage::helper('adminhtml')->__('Browse Files...'), 'type' => 'button', 'onclick' => $this->getJsObjectName() . '.browse()')));
     $this->setChild('upload_button', $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array('id' => $this->_getButtonId('upload'), 'label' => Mage::helper('adminhtml')->__('Upload Files'), 'type' => 'button', 'onclick' => $this->getJsObjectName() . '.upload()')));
     $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->addData(array('id' => '{{id}}-delete', 'class' => 'delete', 'type' => 'button', 'label' => Mage::helper('adminhtml')->__('Remove'), 'onclick' => $this->getJsObjectName() . '.removeFile(\'{{fileId}}\')')));
     return parent::_prepareLayout();
 }
Example #16
0
 protected function _beforeToHtml()
 {
     $this->setChild('development_module_module', $this->getLayout()->createBlock('M2ePro/adminhtml_development_tabs_command_group', '', array('controller_name' => Ess_M2ePro_Helper_View_Development_Command::CONTROLLER_MODULE_MODULE)));
     $this->setChild('development_module_synchronization', $this->getLayout()->createBlock('M2ePro/adminhtml_development_tabs_command_group', '', array('controller_name' => Ess_M2ePro_Helper_View_Development_Command::CONTROLLER_MODULE_SYNCHRONIZATION)));
     $this->setChild('development_module_integration', $this->getLayout()->createBlock('M2ePro/adminhtml_development_tabs_command_group', '', array('controller_name' => Ess_M2ePro_Helper_View_Development_Command::CONTROLLER_MODULE_INTEGRATION)));
     return parent::_beforeToHtml();
 }
Example #17
0
 protected function _beforeToHtml()
 {
     $categoryData = Mage::helper('M2ePro/Data_Global')->getValue('chooser_data');
     $specificBlocks = array();
     $templates = array();
     $uniqueIdCounter = 0;
     if (!empty($categoryData['templates'])) {
         foreach ($categoryData['templates'] as $template) {
             $uniqueId = 'sb' . $uniqueIdCounter;
             $specificBlocks[] = array('create_date' => $template['date'], 'template_id' => $template['id'], 'unique_id' => $uniqueId, 'block' => $this->createSpecificsBlock(array(), $uniqueId));
             $uniqueIdCounter++;
         }
     } else {
         $specificsSets = $this->getSpecificsSets();
         uasort($specificsSets, array($this, 'specificsSetsSortCallback'));
         foreach ($specificsSets as $templateId => $specificsSet) {
             $uniqueId = 'sb' . $uniqueIdCounter;
             $date = $specificsSet['create_date']->format('Y-m-d h:i');
             $templates[] = array('id' => $templateId, 'date' => $date);
             $specificBlocks[] = array('create_date' => $date, 'template_id' => $templateId, 'unique_id' => $uniqueId, 'block' => $this->createSpecificsBlock($specificsSet['specifics'], $uniqueId));
             $uniqueIdCounter++;
         }
     }
     $this->templates = $templates;
     $this->specificsBlocks = $specificBlocks;
     return parent::_beforeToHtml();
 }
 protected function _beforeToHtml()
 {
     //-------------------------------
     $this->attributes = Mage::helper('M2ePro/Magento_Attribute')->getGeneralFromAllAttributeSets();
     //-------------------------------
     //-------------------------------
     $back = Mage::helper('M2ePro')->makeBackUrlParam('*/adminhtml_ebay_account/edit', array('id' => $this->getRequest()->getParam('id'), 'tab' => 'listingOther'));
     $url = $this->getUrl('*/adminhtml_ebay_listing_other_synchronization/edit', array('back' => $back));
     $data = array('label' => Mage::helper('M2ePro')->__('Synchronization Settings'), 'onclick' => 'window.open(\'' . $url . '\', \'_blank\')', 'class' => 'button_link');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('ebay_other_listings_synchronization_settings', $buttonBlock);
     //-------------------------------
     //-------------------------------
     $account = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
     $marketplacesData = $account->getData('marketplaces_data');
     $marketplacesData = !empty($marketplacesData) ? json_decode($marketplacesData, true) : array();
     $marketplaces = Mage::helper('M2ePro/Component_Ebay')->getCollection('Marketplace')->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE)->setOrder('sorder', 'ASC')->setOrder('title', 'ASC')->toArray();
     $marketplaces = $marketplaces['items'];
     foreach ($marketplaces as &$marketplace) {
         $marketplaceId = $marketplace['id'];
         $marketplace['related_store_id'] = isset($marketplacesData[$marketplaceId]['related_store_id']) ? $marketplacesData[$marketplaceId]['related_store_id'] : Mage_Core_Model_App::ADMIN_STORE_ID;
     }
     $this->marketplaces = $marketplaces;
     //-------------------------------
     return parent::_beforeToHtml();
 }
Example #19
0
 /**
  * Prepare global layout
  * Add "Add tier" button to layout
  *
  * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Price_Tier
  */
 protected function _prepareLayout()
 {
     $button = $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('catalog')->__('Add Product SKU'), 'onclick' => 'return productSkuControl.addItem()', 'class' => 'add'));
     $button->setName('add_product_sku_button');
     $this->setChild('add_button', $button);
     return parent::_prepareLayout();
 }
 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('downloads/files_edit_tab_attachments.phtml');
     $this->_withFilesCount = true;
     $this->_productId = (int) $this->getRequest()->getParam('id');
 }
 protected function _prepareLayout()
 {
     $this->setChild('back_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('core')->__('Back'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/*/') . '\')', 'class' => 'back')));
     $this->setChild('save_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('core')->__('Save'), 'onclick' => 'designForm.submit()', 'class' => 'save')));
     $this->setChild('delete_button', $this->getLayout()->createBlock('adminhtml/widget_button')->setData(array('label' => Mage::helper('core')->__('Delete'), 'onclick' => 'confirmSetLocation(\'' . Mage::helper('core')->__('Are you sure?') . '\', \'' . $this->getDeleteUrl() . '\')', 'class' => 'delete')));
     return parent::_prepareLayout();
 }
Example #22
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     //------------------------------
     $breadcrumb = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_breadcrumb')->setData('step', 'none');
     $this->setChild('breadcrumb', $breadcrumb);
     //------------------------------
     //------------------------------
     $tutorial = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_step_tutorial')->setData('is_allowed', !$this->isShownTutorial());
     $this->setChild('tutorial', $tutorial);
     //------------------------------
     //------------------------------
     $destination = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_step_destination')->setData('listing_id', $this->getData('listing_id'))->setData('products_ids', $this->getData('products_ids'))->setData('is_allowed', true);
     $this->setChild('destination', $destination);
     //------------------------------
     //------------------------------
     $policy = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_step_policy')->setData('is_allowed', false);
     $this->setChild('policy', $policy);
     //------------------------------
     //------------------------------
     $translation = $this->getLayout()->createBlock('M2ePro/adminhtml_ebay_listing_transferring_step_translation')->setData('is_allowed', false);
     $this->setChild('translation', $translation);
     //------------------------------
     //------------------------------
     $categories = $this->getLayout()->createBlock('M2ePro/adminhtml_Ebay_Listing_Transferring_step_categories')->setData('is_allowed', true);
     $this->setChild('categories', $categories);
     //------------------------------
 }
Example #23
0
 protected function _prepareLayout()
 {
     $this->setChild('uploader', $this->getLayout()->createBlock('adminhtml/media_uploader'));
     $this->getUploader()->getConfig()->setUrl(Mage::getModel('adminhtml/url')->addSessionParam()->getUrl('*/catalog_product_gallery/upload'))->setFileField('image')->setFilters(array('images' => array('label' => Mage::helper('adminhtml')->__('Images (.gif, .jpg, .png)'), 'files' => array('*.gif', '*.jpg', '*.jpeg', '*.png'))));
     Mage::dispatchEvent('catalog_product_gallery_prepare_layout', array('block' => $this));
     return parent::_prepareLayout();
 }
Example #24
0
 protected function _prepareLayout()
 {
     $this->addChild('add_button', 'Mage_Adminhtml_Block_Widget_Button', array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add New Option'), 'class' => 'add', 'id' => 'add_new_defined_option'));
     $this->addChild('options_box', 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Options_Option');
     $this->addChild('import_button', 'Mage_Adminhtml_Block_Widget_Button', array('label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Import Options'), 'class' => 'add', 'id' => 'import_new_defined_option'));
     return parent::_prepareLayout();
 }
Example #25
0
 protected function _beforeToHtml()
 {
     if (Mage::helper('M2ePro/Data_Global')->getValue('temp_data') && Mage::helper('M2ePro/Data_Global')->getValue('temp_data')->getId()) {
         /** @var $accountObj Ess_M2ePro_Model_Account */
         $accountObj = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
         $this->synchronizeProcessing = $accountObj->isLockedObject('server_synchronize');
         if (!$this->synchronizeProcessing) {
             $accountId = $accountObj->getId();
             Mage::helper('M2ePro/Data_Global')->unsetValue('temp_data');
             Mage::helper('M2ePro/Data_Global')->setValue('temp_data', Mage::helper('M2ePro/Component_Play')->getCachedObject('Account', $accountId));
         }
     } else {
         $this->synchronizeProcessing = false;
     }
     $marketplaces = Mage::helper('M2ePro/Component_Play')->getCollection('Marketplace')->addFieldToFilter('status', Ess_M2ePro_Model_Marketplace::STATUS_ENABLE);
     $this->marketplace = true;
     if ($marketplaces->getSize() <= 0) {
         $this->marketplace = false;
     }
     //------------------------------
     $data = array('label' => Mage::helper('M2ePro')->__('Update Password'), 'onclick' => 'PlayAccountHandlerObj.update_password()', 'class' => 'scalable');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('play_update_password', $buttonBlock);
     //------------------------------
     return parent::_beforeToHtml();
 }
Example #26
0
 protected function _beforeToHtml()
 {
     if ($tabsBlock = $this->getChild('custom_grid_tabs')) {
         $tabsBlock->setActiveTab($this->getSelectedTabId());
     }
     return parent::_beforeToHtml();
 }
 protected function _beforeToHtml()
 {
     $account = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
     $magentoOrdersSettings = $account->getData('magento_orders_settings');
     $magentoOrdersSettings = !empty($magentoOrdersSettings) ? json_decode($magentoOrdersSettings, true) : array();
     // ---------------------------------------
     $temp = Mage::getModel('core/website')->getCollection()->setOrder('sort_order', 'ASC')->toArray();
     $this->websites = $temp['items'];
     // ---------------------------------------
     // ---------------------------------------
     $temp = Mage::getModel('customer/group')->getCollection()->toArray();
     $this->groups = $temp['items'];
     // ---------------------------------------
     // ---------------------------------------
     $selectedStore = !empty($magentoOrdersSettings['listing']['store_id']) ? $magentoOrdersSettings['listing']['store_id'] : '';
     $blockStoreSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_storeSwitcher', '', array('id' => 'magento_orders_listings_store_id', 'name' => 'magento_orders_settings[listing][store_id]', 'selected' => $selectedStore));
     $blockStoreSwitcher->hasDefaultOption(false);
     $this->setChild('magento_orders_listings_store_id', $blockStoreSwitcher);
     // ---------------------------------------
     // ---------------------------------------
     $selectedStore = !empty($magentoOrdersSettings['listing_other']['store_id']) ? $magentoOrdersSettings['listing_other']['store_id'] : '';
     $blockStoreSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_storeSwitcher', '', array('id' => 'magento_orders_listings_other_store_id', 'name' => 'magento_orders_settings[listing_other][store_id]', 'selected' => $selectedStore));
     $blockStoreSwitcher->hasDefaultOption(false);
     $this->setChild('magento_orders_listings_other_store_id', $blockStoreSwitcher);
     // ---------------------------------------
     // ---------------------------------------
     $productTaxClasses = Mage::getModel('tax/class')->getCollection()->addFieldToFilter('class_type', Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT)->toOptionArray();
     $none = array('value' => Ess_M2ePro_Model_Magento_Product::TAX_CLASS_ID_NONE, 'label' => 'None');
     array_unshift($productTaxClasses, $none);
     $this->productTaxClasses = $productTaxClasses;
     // ---------------------------------------
     return parent::_beforeToHtml();
 }
Example #28
0
 protected function _beforeToHtml()
 {
     parent::_beforeToHtml();
     //------------------------------
     $this->setChild('confirm', $this->getLayout()->createBlock('M2ePro/adminhtml_widget_dialog_confirm'));
     //------------------------------
 }
Example #29
0
 protected function _beforeToHtml()
 {
     $this->moduleName = Mage::helper('M2ePro/Module')->getName();
     $this->moduleVersion = Mage::helper('M2ePro/Module')->getVersion();
     $this->moduleRevision = Mage::helper('M2ePro/Module')->getRevision();
     return parent::_beforeToHtml();
 }
Example #30
0
 protected function _beforeToHtml()
 {
     //------------------------------
     $data = array('label' => Mage::helper('M2ePro')->__('Insert'), 'onclick' => "AttributeSetHandlerObj.appendToText('select_attributes_for_title', 'title_template');", 'class' => 'select_attributes_for_title_button');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('select_attributes_for_title_button', $buttonBlock);
     //------------------------------
     //------------------------------
     $data = array('label' => Mage::helper('M2ePro')->__('Insert'), 'onclick' => "AttributeSetHandlerObj.appendToText(" . "'select_attributes_for_mfg_name'," . " 'manufacturer_template'" . ");", 'class' => 'select_attributes_for_mfg_name_template_button');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('select_attributes_for_mfg_name_template_button', $buttonBlock);
     //------------------------------
     //------------------------------
     $data = array('label' => Mage::helper('M2ePro')->__('Insert'), 'onclick' => "AttributeSetHandlerObj.appendToTextarea('#' + \$('select_attributes').value + '#');", 'class' => 'add_product_attribute_button');
     $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
     $this->setChild('add_product_attribute_button', $buttonBlock);
     //------------------------------
     //------------------------------
     for ($i = 0; $i < Ess_M2ePro_Model_Buy_Template_NewProduct_Core::FEATURES_COUNT; $i++) {
         $data = array('label' => Mage::helper('M2ePro')->__('Insert'), 'onclick' => "AttributeSetHandlerObj.appendToText('select_attributes_for_features_{$i}'," . " 'features_{$i}');BuyTemplateNewProductHandlerObj.allowAddFeature(this);", 'class' => "select_attributes_for_features_{$i}_button");
         $buttonBlock = $this->getLayout()->createBlock('adminhtml/widget_button')->setData($data);
         $this->setChild("select_attributes_for_features_{$i}_button", $buttonBlock);
     }
     //------------------------------
     return parent::_beforeToHtml();
 }