示例#1
0
 protected function _prepareForm()
 {
     $this->prepareFormData();
     $form = $this->_formFactory->create(['data' => ['method' => 'post', 'action' => $this->getUrl('*/*/save')]]);
     $urlComponents = $this->getHelper('Component')->getEnabledComponents();
     $componentForUrl = count($urlComponents) == 1 ? array_shift($urlComponents) : \Ess\M2ePro\Helper\Component\Ebay::NICK;
     $form->addField('settings_tab_logs_clearing', self::HELP_BLOCK, ['content' => $this->__('Set preferences for automatic clearing of Log data then click <b>Save Config</b>.<br/><br/>
                 To clear a Log completely, click <b>Clear All</b>. To clear a Log of data more than
                 a certain number of days old, choose the number of days then click <b>Run Now</b>.<br/><br/>
                 More detailed information about ability to work with this Page you can find
                 <a href="%url%" target="_blank">here</a>.', $this->getHelper('Module\\Support')->getDocumentationUrl($componentForUrl, 'Global+Settings#GlobalSettings-LogsClearing'))]);
     $fieldSet = $form->addFieldset('magento_block_configuration_logs_clearing_listings', ['legend' => $this->__('M2E Pro Listings Logs & Events Clearing'), 'collapsable' => false]);
     $mode = isset($this->modes[LogClearing::LOG_LISTINGS]) ? $this->modes[LogClearing::LOG_LISTINGS] : 1;
     $tooltip = $this->getTooltipHtml($this->__('Enables automatic clearing of Log data. Can help reduce Database size.'));
     $fieldSet->addField(LogClearing::LOG_LISTINGS . '_log_mode', self::SELECT, ['name' => LogClearing::LOG_LISTINGS . '_log_mode', 'label' => $this->__('Enabled'), 'title' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $mode, 'style' => 'margin-right: 1.5rem', 'onchange' => "LogClearingObj.changeModeLog('" . LogClearing::LOG_LISTINGS . "')", 'field_extra_attributes' => 'id="' . LogClearing::LOG_LISTINGS . '_log_mode_container"', 'after_element_html' => $tooltip . '<span id="' . LogClearing::LOG_LISTINGS . '_log_button_clear_all_container">' . $this->getChildHtml('clear_all_' . LogClearing::LOG_LISTINGS) . '</span>']);
     $fieldSet->addField(LogClearing::LOG_LISTINGS . '_log_days', 'text', ['name' => LogClearing::LOG_LISTINGS . '_log_days', 'label' => $this->__('Keep For (days)'), 'title' => $this->__('Keep For (days)'), 'value' => $this->days[LogClearing::LOG_LISTINGS], 'class' => 'M2ePro-logs-clearing-interval', 'required' => true, 'field_extra_attributes' => 'id="' . LogClearing::LOG_LISTINGS . '_log_days_container"', 'tooltip' => $this->__('Specify for how long you want to keep Log data before it is automatically cleared.')]);
     $fieldSet = $form->addFieldset('magento_block_configuration_logs_clearing_listings_other', ['legend' => $this->__('3rd Party Listings Logs & Events Clearing'), 'collapsable' => false]);
     $mode = isset($this->modes[LogClearing::LOG_OTHER_LISTINGS]) ? $this->modes[LogClearing::LOG_OTHER_LISTINGS] : 1;
     $tooltip = $this->getTooltipHtml($this->__('Enables automatic clearing of Log data. Can help reduce Database size.'));
     $fieldSet->addField(LogClearing::LOG_OTHER_LISTINGS . '_log_mode', self::SELECT, ['name' => LogClearing::LOG_OTHER_LISTINGS . '_log_mode', 'label' => $this->__('Enabled'), 'title' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $mode, 'style' => 'margin-right: 1.5rem', 'onchange' => "LogClearingObj.changeModeLog('" . LogClearing::LOG_OTHER_LISTINGS . "')", 'field_extra_attributes' => 'id="' . LogClearing::LOG_OTHER_LISTINGS . '_log_mode_container"', 'after_element_html' => $tooltip . '<span id="' . LogClearing::LOG_OTHER_LISTINGS . '_log_button_clear_all_container">' . $this->getChildHtml('clear_all_' . LogClearing::LOG_OTHER_LISTINGS) . '</span>']);
     $fieldSet->addField(LogClearing::LOG_OTHER_LISTINGS . '_log_days', 'text', ['name' => LogClearing::LOG_OTHER_LISTINGS . '_log_days', 'label' => $this->__('Keep For (days)'), 'title' => $this->__('Keep For (days)'), 'value' => $this->days[LogClearing::LOG_OTHER_LISTINGS], 'class' => 'M2ePro-logs-clearing-interval', 'required' => true, 'field_extra_attributes' => 'id="' . LogClearing::LOG_OTHER_LISTINGS . '_log_days_container"', 'tooltip' => $this->__('Specify for how long you want to keep Log data before it is automatically cleared.')]);
     $fieldSet = $form->addFieldset('magento_block_configuration_logs_clearing_synch', ['legend' => $this->__('Synchronization Logs & Events Clearing'), 'collapsable' => false]);
     $mode = isset($this->modes[LogClearing::LOG_SYNCHRONIZATIONS]) ? $this->modes[LogClearing::LOG_SYNCHRONIZATIONS] : 1;
     $tooltip = $this->getTooltipHtml($this->__('Enables automatic clearing of Log data. Can help reduce Database size.'));
     $fieldSet->addField(LogClearing::LOG_SYNCHRONIZATIONS . '_log_mode', self::SELECT, ['name' => LogClearing::LOG_SYNCHRONIZATIONS . '_log_mode', 'label' => $this->__('Enabled'), 'title' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $mode, 'style' => 'margin-right: 1.5rem', 'onchange' => "LogClearingObj.changeModeLog('" . LogClearing::LOG_SYNCHRONIZATIONS . "')", 'field_extra_attributes' => 'id="' . LogClearing::LOG_SYNCHRONIZATIONS . '_log_mode_container"', 'after_element_html' => $tooltip . '<span id="' . LogClearing::LOG_SYNCHRONIZATIONS . '_log_button_clear_all_container">' . $this->getChildHtml('clear_all_' . LogClearing::LOG_SYNCHRONIZATIONS) . '</span>']);
     $fieldSet->addField(LogClearing::LOG_SYNCHRONIZATIONS . '_log_days', 'text', ['name' => LogClearing::LOG_SYNCHRONIZATIONS . '_log_days', 'label' => $this->__('Keep For (days)'), 'title' => $this->__('Keep For (days)'), 'value' => $this->days[LogClearing::LOG_SYNCHRONIZATIONS], 'class' => 'M2ePro-logs-clearing-interval', 'required' => true, 'field_extra_attributes' => 'id="' . LogClearing::LOG_SYNCHRONIZATIONS . '_log_days_container"', 'tooltip' => $this->__('Specify for how long you want to keep Log data before it is automatically cleared.')]);
     $fieldSet = $form->addFieldset('magento_block_logs_configuration_clearing_orders', ['legend' => $this->__('Orders Logs & Events Clearing'), 'collapsable' => false]);
     $mode = isset($this->modes[LogClearing::LOG_ORDERS]) ? $this->modes[LogClearing::LOG_ORDERS] : 1;
     $tooltip = $this->getTooltipHtml($this->__('Enables automatic clearing of Log data. Can help reduce Database size.'));
     $fieldSet->addField(LogClearing::LOG_ORDERS . '_log_mode', self::SELECT, ['name' => LogClearing::LOG_ORDERS . '_log_mode', 'label' => $this->__('Enabled'), 'title' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $mode, 'style' => 'margin-right: 1.5rem', 'onchange' => "LogClearingObj.changeModeLog('" . LogClearing::LOG_ORDERS . "')", 'field_extra_attributes' => 'id="' . LogClearing::LOG_ORDERS . '_log_mode_container"', 'after_element_html' => $tooltip . '<span id="' . LogClearing::LOG_ORDERS . '_log_button_clear_all_container">' . $this->getChildHtml('clear_all_' . LogClearing::LOG_ORDERS) . '</span>']);
     $fieldSet->addField(LogClearing::LOG_ORDERS . '_log_days', 'text', ['name' => LogClearing::LOG_ORDERS . '_log_days', 'label' => $this->__('Keep For (days)'), 'title' => $this->__('Keep For (days)'), 'value' => $this->days[LogClearing::LOG_ORDERS], 'class' => 'M2ePro-logs-clearing-interval', 'required' => true, 'field_extra_attributes' => 'id="' . LogClearing::LOG_ORDERS . '_log_days_container"', 'tooltip' => $this->__('Specify for how long you want to keep Log data before it is automatically cleared.'), 'disabled' => true]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
示例#2
0
    protected function _prepareForm()
    {
        $synchronizationConfig = $this->modelFactory->getObject('Config\\Manager\\Synchronization');
        // ---------------------------------------
        $listingsMode = $synchronizationConfig->getGroupValue('/amazon/templates/', 'mode');
        $ordersMode = 1;
        $otherListingsMode = 1;
        // ---------------------------------------
        $form = $this->_formFactory->create(['data' => ['enctype' => 'multipart/form-data', 'method' => 'post']]);
        $fieldset = $form->addFieldset('amazon_synchronization_templates', ['legend' => $this->__('M2E Pro Listings Synchronization'), 'collapsable' => false]);
        $fieldset->addField('templates_mode', self::SELECT, ['name' => 'templates_mode', 'label' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $listingsMode, 'tooltip' => $this->__('<p>This synchronization includes import of changes made on Amazon channel as well 
                    as the ability to enable/disable the data synchronization managed by the 
                    Synchronization Policy Rules.</p><br>
                    <p>However, it does not exclude the ability to manually manage Items in Listings using the 
                    available List, Revise, Relist or Stop Action options.</p>')]);
        if ($this->isShowReviseAll()) {
            $fieldset->addField('block_notice_amazon_synchronization_revise_all', self::MESSAGES, ['messages' => [['type' => MessageInterface::TYPE_NOTICE, 'content' => $this->__('If your Amazon Listings for some reason were asynchronized with the Products in
                                 Magento, <a href="javascript:" onclick="%script_code%">turn on</a> the Revise All
                                 Action to catch data up.
                                 <br/>Revise is performed by the Inventory Synchronization, 100 Items per a cycle.
                                 <br/><br/>', 'SynchronizationObj.showReviseAllConfirmPopup(\'' . \Ess\M2ePro\Helper\Component\Amazon::NICK . '\');') . '<span id="amazon_revise_all_start" style="display: none">

                                        <span style="color: blue">
                                            ' . $this->__('In Progress, start date - ') . '
                                        </span>

                                        <span id="amazon_revise_all_start_date" style="color: blue">
                                            ' . $this->reviseAllStartDate . '
                                        </span>

                                    </span>

                                    <span id="amazon_revise_all_end" style="display: none">

                                        <span style="color: green">
                                            ' . $this->__('Finished, end date - ') . '
                                        </span>

                                        <span id="amazon_revise_all_end_date" style="color: green">
                                            ' . $this->reviseAllEndDate . '
                                        </span>
                                    </span>']]]);
        }
        $fieldset = $form->addFieldset('amazon_synchronization_orders', ['legend' => $this->__('Orders Synchronization'), 'collapsable' => false]);
        $fieldset->addField('templates_orders_mode', self::SELECT, ['name' => 'templates_orders_mode', 'label' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $ordersMode, 'disabled' => true, 'tooltip' => $this->__('<p>This Synchronization cannot be disabled as it is a critically important condition
                    for the proper work of the automatic synchronization rules according to which data 
                    update between Magento and Amazon is performed.</p><br>
                    <p>However, there is an ability to enable/disable the Magento Order creation for each Account in 
                    <strong>Amazon Integration > Configuration > Accounts</strong> section.</p>')]);
        $fieldset = $form->addFieldset('amazon_synchronization_other_listings', ['legend' => $this->__('3rd Party Synchronization '), 'collapsable' => false]);
        $fieldset->addField('templates_other_listings_mode', self::SELECT, ['name' => 'templates_other_listings_mode', 'label' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $otherListingsMode, 'disabled' => true, 'tooltip' => $this->__('<p>This Synchronization performs import and regular updates of the imported 3rd Party Listings.
                    It can be enabled/disabled for each Account separately in 
                    <strong>Amazon Integration > Configuration > Accounts</strong> section.</p>')]);
        $form->setUseContainer(true);
        $this->setForm($form);
        parent::_prepareForm();
    }
 protected function _prepareForm()
 {
     $form = $this->_formFactory->create(['data' => ['method' => 'post', 'action' => $this->getUrl('*/*/save')]]);
     $urlComponents = $this->getHelper('Component')->getEnabledComponents();
     $componentForUrl = count($urlComponents) == 1 ? array_shift($urlComponents) : \Ess\M2ePro\Helper\Component\Ebay::NICK;
     $fieldset = $form->addFieldset('configuration_settings_magento_inventory', ['legend' => '', 'collapsable' => false]);
     $fieldset->addField('force_qty_mode', self::SELECT, ['name' => 'force_qty_mode', 'label' => $this->__('Manage Stock "No", Backorders'), 'values' => [0 => $this->__('Disallow'), 1 => $this->__('Allow')], 'value' => (int) $this->getHelper('Module')->getConfig()->getGroupValue('/product/force_qty/', 'mode'), 'tooltip' => $this->__('Choose whether M2E Pro should List Products on external Channels when Manage Stock is \'No\'
                 or Backorders is enabled.
                 <b>Disallow</b> is the recommended Setting if you are selling on eBay.')]);
     $fieldset->addField('force_qty_value', 'text', ['name' => 'force_qty_value', 'label' => $this->__('Quantity To Be Listed'), 'value' => (int) $this->getHelper('Module')->getConfig()->getGroupValue('/product/force_qty/', 'value'), 'tooltip' => $this->__('Set a number to List, e.g. if you have Manage Stock "No" in Magento Product and set this Value
                 to 10, 10 will be sent as available Quantity to the Channel.'), 'field_extra_attributes' => 'id="force_qty_value_tr"', 'class' => 'validate-greater-than-zero', 'required' => true]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
示例#4
0
 protected function _prepareForm()
 {
     $configModel = $this->getHelper('Module')->getConfig();
     $useLastSpecificsMode = (bool) (int) $configModel->getGroupValue('/view/ebay/template/category/', 'use_last_specifics');
     $checkTheSameProductAlreadyListedMode = (bool) (int) $configModel->getGroupValue('/ebay/connector/listing/', 'check_the_same_product_already_listed');
     $uploadImagesMode = (int) $configModel->getGroupValue('/ebay/description/', 'upload_images_mode');
     $form = $this->_formFactory->create(['data' => ['method' => 'post', 'action' => $this->getUrl('*/*/save')]]);
     $fieldset = $form->addFieldset('selling', ['legend' => $this->__('Listing'), 'collapsable' => false]);
     $fieldset->addField('use_last_specifics_mode', 'select', ['name' => 'use_last_specifics_mode', 'label' => $this->__('Item Specifics Step'), 'values' => [0 => $this->__('Show'), 1 => $this->__('Do Not Show')], 'value' => $useLastSpecificsMode, 'tooltip' => $this->__('Choose <b>Do Not Show</b>
                 if you don\'t need to edit Item specifics details every time you add Products.<br/>')]);
     $fieldset = $form->addFieldset('additional', ['legend' => $this->__('Additional'), 'collapsable' => false]);
     $multiCurrency = $this->getMultiCurrency();
     if (!empty($multiCurrency)) {
         foreach ($multiCurrency as $marketplace => $data) {
             $currencies = explode(',', $data['currency']);
             $preparedValues = [];
             $selectedValue = '';
             foreach ($currencies as $currency) {
                 if ($this->isCurrencyForCode($data['code'], $currency)) {
                     $selectedValue = $currency;
                 }
                 $preparedValues[$currency] = $currency;
             }
             $fieldset->addField('selling_currency' . $data['code'], 'select', ['name' => 'selling_currency' . $data['code'], 'label' => $this->__($marketplace) . ' ' . $this->__('Currency'), 'values' => $preparedValues, 'value' => $selectedValue, 'tooltip' => $this->__('Choose the Currency you want to sell for.')]);
         }
     }
     $fieldset->addField('check_the_same_product_already_listed_mode', 'select', ['name' => 'check_the_same_product_already_listed_mode', 'label' => $this->__('Prevent eBay Item Duplicates'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $checkTheSameProductAlreadyListedMode, 'tooltip' => $this->__('<p>Choose \'Yes\' to prevent M2E Pro from adding a Product if it 
                  <p>Essentially, this option is useful if you have Automatic Add/Remove Rules set up.
                  It will ensure that each Product is listed only once, when Products are added 
                  to the Listing automatically.</p><br/>
                  <p><strong>Note:</strong> Applies only to Products Listed automatically on live Marketplaces 
                  (i.e. not using a Sandbox Account).</p>')]);
     $fieldset->addField('upload_images_mode', 'select', ['name' => 'upload_images_mode', 'label' => $this->__('Upload Images to eBay'), 'values' => [\Ess\M2ePro\Model\Ebay\Listing\Product\Action\Request\Description::UPLOAD_IMAGES_MODE_AUTO => $this->__('Automatic'), \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Request\Description::UPLOAD_IMAGES_MODE_SELF => $this->__('Self-Hosted'), \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Request\Description::UPLOAD_IMAGES_MODE_EPS => $this->__('EPS-Hosted')], 'value' => $uploadImagesMode, 'tooltip' => $this->__('
                 Select the Mode which you would like to use for uploading Images on eBay:<br/><br/>
                 <strong>Automatic</strong> — if you try to upload more then 1 Image for an Item or
                 separate Variational Attribute the EPS-hosted mode will be used automatically.
                 Otherwise, the Self-hosted mode will be used automatically;<br/>
                 <strong>Self-Hosted</strong> — all the Images are provided as a direct Links to the
                 Images saved in your Magento;<br/>
                 <strong>EPS-Hosted</strong> — the Images are uploaded to eBay EPS service.
             ')]);
     $form->setUseContainer(true);
     $this->setForm($form);
     return parent::_prepareForm();
 }
示例#5
0
    protected function _prepareForm()
    {
        $synchronizationConfig = $this->modelFactory->getObject('Config\\Manager\\Synchronization');
        // ---------------------------------------
        $listingsMode = $synchronizationConfig->getGroupValue('/ebay/templates/', 'mode');
        $ordersMode = $synchronizationConfig->getGroupValue('/ebay/orders/', 'mode');
        $otherListingsMode = $synchronizationConfig->getGroupValue('/ebay/other_listings/', 'mode');
        // ---------------------------------------
        // ---------------------------------------
        $this->reviseAllStartDate = $synchronizationConfig->getGroupValue('/ebay/templates/synchronization/revise/total/', 'start_date');
        $this->reviseAllStartDate && ($this->reviseAllStartDate = $this->templateContext->_localeDate->formatDate($this->reviseAllStartDate, \IntlDateFormatter::MEDIUM));
        $this->reviseAllEndDate = $synchronizationConfig->getGroupValue('/ebay/templates/synchronization/revise/total/', 'end_date');
        $this->reviseAllEndDate && ($this->reviseAllEndDate = $this->templateContext->_localeDate->formatDate($this->reviseAllEndDate, \IntlDateFormatter::MEDIUM));
        // ---------------------------------------
        // ---------------------------------------
        $component = \Ess\M2ePro\Helper\Component\Ebay::NICK;
        $data = array('class' => 'ok_button', 'label' => $this->__('Confirm'), 'onclick' => "ReviseAllConfirmPopup.closeModal(); SynchronizationObj.runReviseAll('{$component}');");
        $buttonBlock = $this->createBlock('Magento\\Button')->setData($data);
        $this->setChild('revise_all_confirm_popup_ok_button', $buttonBlock);
        // ---------------------------------------
        // ---------------------------------------
        $this->inspectorMode = (int) $synchronizationConfig->getGroupValue('/global/magento_products/inspector/', 'mode');
        // ---------------------------------------
        $form = $this->_formFactory->create(['data' => ['method' => 'post', 'action' => $this->getUrl('*/*/save')]]);
        $fieldset = $form->addFieldset('ebay_synchronization_templates', ['legend' => $this->__('M2E Pro Listings Synchronization'), 'collapsable' => false]);
        $fieldset->addField('templates_mode', self::SELECT, ['name' => 'templates_mode', 'label' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $listingsMode, 'tooltip' => $this->__('<p>This synchronization includes import of changes made on eBay channel as well as the ability 
                     to enable/disable the data synchronization managed by the Synchronization Policy Rules.</p><br>
                     <p>However, it does not exclude the ability to manually manage 
                     Items in Listings using the available List, Revise, Relist or Stop Action options.</p>')]);
        if ($this->isShowReviseAll()) {
            $fieldset->addField('block_notice_ebay_synchronization_revise_all', self::MESSAGES, ['messages' => [['type' => MessageInterface::TYPE_NOTICE, 'content' => $this->__('If your eBay Listings for some reason were asynchronized with the Products in
                                 Magento, <a href="javascript:" onclick="%script_code%">turn on</a> the Revise All
                                 Action to catch data up.
                                 <br/>Revise is performed by the Inventory Synchronization, 100 Items per a cycle.
                                 <br/><br/>', 'SynchronizationObj.showReviseAllConfirmPopup(\'' . \Ess\M2ePro\Helper\Component\Ebay::NICK . '\');') . '<span id="ebay_revise_all_start" style="display: none">

                                        <span style="color: blue">
                                            ' . $this->__('In Progress, start date - ') . '
                                        </span>

                                        <span id="ebay_revise_all_start_date" style="color: blue">
                                            ' . $this->reviseAllStartDate . '
                                        </span>

                                    </span>

                                    <span id="ebay_revise_all_end" style="display: none">

                                        <span style="color: green">
                                            ' . $this->__('Finished, end date - ') . '
                                        </span>

                                        <span id="ebay_revise_all_end_date" style="color: green">
                                            ' . $this->reviseAllEndDate . '
                                        </span>
                                    </span>']]]);
        }
        $fieldset = $form->addFieldset('ebay_synchronization_orders', ['legend' => $this->__('Orders Synchronization'), 'collapsable' => false]);
        $fieldset->addField('templates_orders_mode', self::SELECT, ['name' => 'templates_orders_mode', 'label' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $ordersMode, 'disabled' => true, 'tooltip' => $this->__('<p>This Synchronization cannot be disabled as it is a critically important 
                    condition for the proper work of the automatic synchronization rules according 
                    to which data update between Magento and eBay is performed.</p>
                    <p>However, there is an ability to enable/disable Magento Order creation for each Account in 
                    <strong>eBay Integration > Configuration > Accounts</strong> section.</p>')]);
        $fieldset = $form->addFieldset('ebay_synchronization_other_listings', ['legend' => $this->__('3rd Party Synchronization '), 'collapsable' => false]);
        $fieldset->addField('templates_other_listings_mode', self::SELECT, ['name' => 'templates_other_listings_mode', 'label' => $this->__('Enabled'), 'values' => [0 => $this->__('No'), 1 => $this->__('Yes')], 'value' => $otherListingsMode, 'disabled' => true, 'tooltip' => $this->__('<p>This Synchronization performs import and regular updates of the imported 
                    3rd Party Listings. It can be enabled/disabled for each Account separately in
                    <strong>eBay Integration > Configuration > Accounts</strong> section.</p>')]);
        $form->setUseContainer(true);
        $this->setForm($form);
        parent::_prepareForm();
    }