Skip to content

Commit

Permalink
1.1.0 PA1
Browse files Browse the repository at this point in the history
  • Loading branch information
d-belousov committed Sep 7, 2016
1 parent 072f015 commit 8331911
Show file tree
Hide file tree
Showing 1,168 changed files with 64,828 additions and 11,695 deletions.
2 changes: 2 additions & 0 deletions Block/Adminhtml/Account/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ protected function _prepareColumns()
'width' => '150px',
'type' => 'datetime',
'format' => \IntlDateFormatter::MEDIUM,
'filter_time' => true,
'index' => 'create_date',
'filter_index' => 'main_table.create_date'
));
Expand All @@ -56,6 +57,7 @@ protected function _prepareColumns()
'width' => '150px',
'type' => 'datetime',
'format' => \IntlDateFormatter::MEDIUM,
'filter_time' => true,
'index' => 'update_date',
'filter_index' => 'main_table.update_date'
));
Expand Down
5 changes: 2 additions & 3 deletions Block/Adminhtml/Amazon/Account.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,9 @@ protected function _prepareLayout()
3rd Party Listings import including options of Mapping them to Magento Products and Moving them to M2E Pro Listings,
etc. can be specified for each Account separately.</p><br>
<p><strong>Note:</strong> Amazon Account can be deleted only if it is not being used
for any of M2E Pro Listings.</p><br>
<p>More detailed information you can find <a href="%url%" target="_blank">here</a>.</p>
for any of M2E Pro Listings.</p>
HTML
, $this->getHelper('Module\Support')->getDocumentationUrl(NULL, NULL, 'x/9gEtAQ'))
)
]);

return parent::_prepareLayout();
Expand Down
4 changes: 2 additions & 2 deletions Block/Adminhtml/Amazon/Account/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public function _construct()
// ---------------------------------------

// ---------------------------------------
if ($this->getHelper('Data\GlobalData')->getValue('temp_data') &&
$this->getHelper('Data\GlobalData')->getValue('temp_data')->getId()
if ($this->getHelper('Data\GlobalData')->getValue('edit_account') &&
$this->getHelper('Data\GlobalData')->getValue('edit_account')->getId()
) {
// ---------------------------------------
$this->addButton('delete', array(
Expand Down
35 changes: 24 additions & 11 deletions Block/Adminhtml/Amazon/Account/Edit/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ protected function _construct()
{
parent::_construct();

$this->setId('amazonAccountEditTabs');
$this->setDestElementId('edit_form');
}

Expand All @@ -33,19 +34,31 @@ protected function _beforeToHtml()
'content' => $this->createBlock('Amazon\Account\Edit\Tabs\Order')->toHtml(),
));

// TODO NOT SUPPORTED FEATURES
// if ($this->getHelper('Component\Amazon')->isRepricingEnabled() &&
// $this->getHelper('Data\GlobalData')->getValue('temp_data')->getId()) {
//
// $this->addTab('repricing', array(
// 'label' => $this->__('Repricing Tool'),
// 'title' => $this->__('Repricing Tool'),
// 'content' => $this->getLayout()
// ->createBlock('M2ePro/adminhtml_common_amazon_account_edit_tabs_repricing')->toHtml(),
// ));
// }
if ($this->getHelper('Component\Amazon\Repricing')->isEnabled() &&
$this->getHelper('Data\GlobalData')->getValue('edit_account')) {

$this->addTab('repricing', array(
'label' => $this->__('Repricing Tool'),
'title' => $this->__('Repricing Tool'),
'content' => $this->createBlock('Amazon\Account\Edit\Tabs\Repricing')->toHtml(),
));
}

$this->setActiveTab($this->getRequest()->getParam('tab', 'general'));

$this->js->addOnReadyJs(<<<JS
var urlHash = location.hash.substr(1);
if (urlHash != '') {
setTimeout(function() {
jQuery('#{$this->getId()}').tabs(
'option', 'active', jQuery('li[aria-labelledby="{$this->getId()}_' + urlHash + '"]').index()
);
location.hash = '';
}, 100);
}
JS
);

return parent::_beforeToHtml();
}
Expand Down
27 changes: 11 additions & 16 deletions Block/Adminhtml/Amazon/Account/Edit/Tabs/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(
protected function _prepareForm()
{
/** @var $account \Ess\M2ePro\Model\Account */
$account = $this->getHelper('Data\GlobalData')->getValue('temp_data');
$account = $this->getHelper('Data\GlobalData')->getValue('edit_account');
$formData = !is_null($account) ? array_merge($account->getData(), $account->getChildObject()->getData()) : [];

if (isset($formData['other_listings_mapping_settings'])) {
Expand All @@ -44,12 +44,6 @@ protected function _prepareForm()

$isEdit = !!$this->getRequest()->getParam('id');

$licenseMessage = '';

if ($isEdit) {
$licenseMessage = (string)$this->getHelper('Data\GlobalData')->getValue('license_message');
}

$marketplacesCollection = $this->getHelper('Component\Amazon')->getMarketplacesAvailableForApiCreation();
$marketplaces = [];
foreach ($marketplacesCollection->getItems() as $item) {
Expand Down Expand Up @@ -84,9 +78,9 @@ protected function _prepareForm()
<li><p>The Merchant ID and MWS Auth Token will be automatically filled in.</p></li>
</ul><br>
<p>More detailed information about how to work with this
Page you can find <a href="%url%" target="_blank">here</a>.</p>
Page you can find <a href="%url%" target="_blank" class="external-link">here</a>.</p>
HTML
, $this->getHelper('Module\Support')->getDocumentationUrl(NULL, NULL, 'x/MgItAQ'))
, $this->getHelper('Module\Support')->getDocumentationArticleUrl('x/MgItAQ'))
]
);

Expand Down Expand Up @@ -200,7 +194,7 @@ protected function _prepareForm()
'onclick' => 'return AmazonAccountObj.getToken('.$marketplace['id'].')',
'target' => '_blank',
'value' => $this->__('Get Access Data'),
'style' => 'text-decoration: underline;' //todo
'style' => 'text-decoration: underline;'
]
)->setFieldExtraAttributes('style="display: none"');
}
Expand Down Expand Up @@ -247,7 +241,7 @@ protected function _prepareForm()
$this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\Ess\M2ePro\Model\Amazon\Account'));
$this->jsPhp->addConstants($this->getHelper('Data')->getClassConstants('\Ess\M2ePro\Helper\Component\Amazon'));

$this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\Account'));
$this->jsUrl->addUrls($this->getHelper('Data')->getControllerActions('Amazon\Account', ['_current' => true]));
$this->jsUrl->addUrls([
'formSubmit' => $this->getUrl(
'*/amazon_account/save', array('_current' => true, 'id' => $this->getRequest()->getParam('id'))
Expand All @@ -257,12 +251,14 @@ protected function _prepareForm()
)
]);

$this->jsTranslator->add('Please enter correct value.', $this->__('Please enter correct value.'));

$this->jsTranslator->add(
'Be attentive! By Deleting Account you delete all information on it from M2E Pro Server.
This will cause inappropriate work of all Accounts\' copies.',
'Be attentive! By Deleting Account you delete all information on it from M2E Pro Server. '
. 'This will cause inappropriate work of all Accounts\' copies.',
$this->__(
'Be attentive! By Deleting Account you delete all information on it from M2E Pro Server.
This will cause inappropriate work of all Accounts\' copies.'));
'Be attentive! By Deleting Account you delete all information on it from M2E Pro Server. '
. 'This will cause inappropriate work of all Accounts\' copies.'));

$id = $this->getRequest()->getParam('id');
$this->js->add("M2ePro.formData.id = '$id';");
Expand All @@ -282,7 +278,6 @@ protected function _prepareForm()
window.AmazonAccountObj = new AmazonAccount();
AmazonAccountObj.initObservers();
jQuery(function(){
{$licenseMessage}
{$marketplaceJs}
});
});
Expand Down
32 changes: 22 additions & 10 deletions Block/Adminhtml/Amazon/Account/Edit/Tabs/ListingOther.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected function _prepareForm()
$attributes = $this->getHelper('Magento\Attribute')->getGeneralFromAllAttributeSets();

/** @var $account \Ess\M2ePro\Model\Account */
$account = $this->getHelper('Data\GlobalData')->getValue('temp_data');
$account = $this->getHelper('Data\GlobalData')->getValue('edit_account');
$formData = !is_null($account) ? array_merge($account->getData(), $account->getChildObject()->getData()) : [];

if (isset($formData['other_listings_mapping_settings'])) {
Expand Down Expand Up @@ -55,10 +55,10 @@ protected function _prepareForm()
You can set preferences whether you would like to import 3rd Party Listings
(Items that were Listed on eBay either directly on the channel or with the help of other than M2E Pro tool),
automatically map them to Magento Product, etc..</p><br>
<p>More detailed information you can find <a href="%url%" target="_blank">here</a>.</p>
<p>More detailed information you can find <a href="%url%" target="_blank" class="external-link">here</a>.</p>
HTML
,
$this->getHelper('Module\Support')->getDocumentationUrl(NULL, NULL, 'x/NAItAQ')
$this->getHelper('Module\Support')->getDocumentationArticleUrl('x/NAItAQ')
)
]
);
Expand Down Expand Up @@ -160,19 +160,23 @@ protected function _prepareForm()
[
'name' => 'mapping_sku_mode',
'label' => $this->__('SKU'),
'class' => 'attribute-mode-select M2ePro-custom-attribute-can-be-created',
'class' => 'attribute-mode-select',
'values' => [
Account::OTHER_LISTINGS_MAPPING_SKU_MODE_NONE => $this->__('None'),
Account::OTHER_LISTINGS_MAPPING_SKU_MODE_DEFAULT => $this->__('Product SKU'),
Account::OTHER_LISTINGS_MAPPING_SKU_MODE_PRODUCT_ID => $this->__('Product ID'),
[
'label' => $this->__('Magento Attributes'),
'value' => $preparedAttributes
'value' => $preparedAttributes,
'attrs' => [
'is_magento_attribute' => true
]
]
],
'value' => isset($mappingSettings['sku']['mode'])
&& $mappingSettings['sku']['mode'] != Account::OTHER_LISTINGS_MAPPING_SKU_MODE_CUSTOM_ATTRIBUTE
? $mappingSettings['sku']['mode'] : '',
'create_magento_attribute' => true,
]
)->setAfterElementHtml(<<<HTML
<div id="mapping_sku_priority_td">
Expand Down Expand Up @@ -222,17 +226,21 @@ class="input-text admin__control-text required-entry _required">
[
'name' => 'mapping_general_id_mode',
'label' => $this->__('ASIN / ISBN'),
'class' => 'attribute-mode-select M2ePro-custom-attribute-can-be-created',
'class' => 'attribute-mode-select',
'values' => [
Account::OTHER_LISTINGS_MAPPING_GENERAL_ID_MODE_NONE => $this->__('None'),
[
'label' => $this->__('Magento Attributes'),
'value' => $preparedAttributes
'value' => $preparedAttributes,
'attrs' => [
'is_magento_attribute' => true
]
]
],
'value' => isset($mappingSettings['general_id']['mode'])
&& $mappingSettings['general_id']['mode'] != $modeCustomAttribute
? $mappingSettings['general_id']['mode'] : ''
? $mappingSettings['general_id']['mode'] : '',
'create_magento_attribute' => true,
]
)->setAfterElementHtml(<<<HTML
<div id="mapping_general_id_priority_td">
Expand Down Expand Up @@ -280,18 +288,22 @@ class="input-text admin__control-text required-entry _required">
[
'name' => 'mapping_title_mode',
'label' => $this->__('Listing Title'),
'class' => 'attribute-mode-select M2ePro-custom-attribute-can-be-created',
'class' => 'attribute-mode-select',
'values' => [
Account::OTHER_LISTINGS_MAPPING_TITLE_MODE_NONE => $this->__('None'),
Account::OTHER_LISTINGS_MAPPING_TITLE_MODE_DEFAULT => $this->__('Product Name'),
[
'label' => $this->__('Magento Attributes'),
'value' => $preparedAttributes
'value' => $preparedAttributes,
'attrs' => [
'is_magento_attribute' => true
]
]
],
'value' => isset($mappingSettings['title']['mode'])
&& $mappingSettings['title']['mode'] != Account::OTHER_LISTINGS_MAPPING_TITLE_MODE_CUSTOM_ATTRIBUTE
? $mappingSettings['title']['mode'] : '',
'create_magento_attribute' => true,
]
)->setAfterElementHtml(<<<HTML
<div id="mapping_title_priority_td">
Expand Down
16 changes: 8 additions & 8 deletions Block/Adminhtml/Amazon/Account/Edit/Tabs/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct(

protected function _prepareForm()
{
$account = $this->getHelper('Data\GlobalData')->getValue('temp_data');
$account = $this->getHelper('Data\GlobalData')->getValue('edit_account');
$magentoOrdersSettings = !is_null($account) ? $account->getData('magento_orders_settings') : [];
$magentoOrdersSettings = !empty($magentoOrdersSettings) ? json_decode($magentoOrdersSettings, true) : array();

Expand Down Expand Up @@ -142,10 +142,11 @@ protected function _prepareForm()
M2E Pro or other tools.</p><br>
<p><strong>Note:</strong> If an Amazon Order is received, Magento Product QTY decreases only if a Magento
Order is created.</p><br>
<p>More detailed information about how to work with this Page you can find <a href="%url%" target="_blank">here</a>.</p>
<p>More detailed information about how to work with this Page you can find
<a href="%url%" target="_blank" class="external-link">here</a>.</p>
HTML
,
$this->getHelper('Module\Support')->getDocumentationUrl(NULL, NULL, 'x/NgItAQ')
$this->getHelper('Module\Support')->getDocumentationArticleUrl('x/NgItAQ')
)
]
);
Expand Down Expand Up @@ -235,7 +236,6 @@ protected function _prepareForm()
'container_id' => 'magento_orders_listings_other_store_id_container',
'name' => 'magento_orders_settings[listing_other][store_id]',
'label' => $this->__('Magento Store View'),
'required' => true,
'value' => !empty($magentoOrdersSettings['listing_other']['store_id'])
? $magentoOrdersSettings['listing_other']['store_id'] : '',
'hasDefaultOption' => false,
Expand Down Expand Up @@ -493,11 +493,11 @@ protected function _prepareForm()
Default Guest Account will be defined as a Customer. <br/>
<b>Note:</b> The Guest Checkout Option must be enabled in Magento.
(<i>Yes</i> must be chosen in the Allow Guest Checkout Option in
Magento > System > Configuration > Sales > Checkout Tab). <br/>
Magento > Stores > Configuration > Sales > Checkout). <br/>
<b>Predefined Customer</b> - the System uses one predefined
Customer for all Amazon Orders related to this Account. You will be required
to provide an ID of the existing Customer, which you can find in
Magento > Customers > Manage Customers Table. <br/>
Magento > Customers > All Customers. <br/>
<b>Create New</b> - a new Customer will be created in Magento,
using Amazon Customer data of Amazon Order. <br/>
<b>Note:</b> A unique Customer Identifier is his e-mail address.
Expand Down Expand Up @@ -533,7 +533,7 @@ protected function _prepareForm()
'label' => $this->__('Associate to Website'),
'values' => $values,
'value' => $formData['magento_orders_settings']['customer']['website_id'],
'required' => true
'required' => false
]
);

Expand All @@ -550,7 +550,7 @@ protected function _prepareForm()
'label' => $this->__('Customer Group'),
'values' => $values,
'value' => $formData['magento_orders_settings']['customer']['group_id'],
'required' => true
'required' => false
]
);

Expand Down
Loading

0 comments on commit 8331911

Please sign in to comment.