Skip to content

Commit adb5818

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into MAGEDOC-1720-Sales
Conflicts: app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php
2 parents 6da4073 + db526c3 commit adb5818

File tree

1,603 files changed

+21944
-14510
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,603 files changed

+21944
-14510
lines changed

.php_cs

+8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
<?php
2+
/**
3+
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
4+
*/
5+
6+
/**
7+
* Pre-commit hook installation:
8+
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
9+
*/
210
$finder = Symfony\CS\Finder\DefaultFinder::create()
311
->name('*.phtml')
412
->exclude('dev/tests/functional/generated')

app/autoload.php

+6
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@
1414

1515
$vendorDir = require BP . '/app/etc/vendor_path.php';
1616
$vendorAutoload = BP . "/{$vendorDir}/autoload.php";
17+
18+
/* 'composer install' validation */
1719
if (file_exists($vendorAutoload)) {
1820
$composerAutoloader = include $vendorAutoload;
21+
} else {
22+
throw new \Exception(
23+
'Vendor autoload is not found. Please run \'composer install\' under application root directory.'
24+
);
1925
}
2026

2127
AutoloaderRegistry::registerAutoloader(new ClassLoaderWrapper($composerAutoloader));

app/code/Magento/AdminGws/Model/Containers.php

+29-2
Original file line numberDiff line numberDiff line change
@@ -33,22 +33,30 @@ class Containers implements CallbackProcessorInterface
3333
*/
3434
protected $categoryResource;
3535

36+
/**
37+
* @var \Magento\Store\Model\StoreManagerInterface
38+
*/
39+
protected $storeManager;
40+
3641
/**
3742
* @param Role $role
3843
* @param \Magento\Framework\Registry $registry
3944
* @param \Magento\Cms\Model\Resource\Page $cmsPageResource
4045
* @param \Magento\Catalog\Model\Resource\Category $categoryResource
46+
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
4147
*/
4248
public function __construct(
4349
Role $role,
4450
\Magento\Framework\Registry $registry,
4551
\Magento\Cms\Model\Resource\Page $cmsPageResource,
46-
\Magento\Catalog\Model\Resource\Category $categoryResource
52+
\Magento\Catalog\Model\Resource\Category $categoryResource,
53+
\Magento\Store\Model\StoreManagerInterface $storeManager
4754
) {
4855
$this->_role = $role;
4956
$this->registry = $registry;
5057
$this->cmsPageResource = $cmsPageResource;
5158
$this->categoryResource = $categoryResource;
59+
$this->storeManager = $storeManager;
5260
}
5361

5462
/**
@@ -367,8 +375,27 @@ public function removeRatingEditButtons(ContainerInterface $container)
367375
*/
368376
public function removeCmsHierarchyFormButtons(ContainerInterface $container)
369377
{
378+
$websiteId = null;
379+
$storeId = null;
380+
381+
if ($container->getRequest()->getParam('website')) {
382+
if ($website = $this->storeManager->getWebsite($container->getRequest()->getParam('website'))) {
383+
$websiteId = $website->getId();
384+
}
385+
}
386+
if ($container->getRequest()->getParam('store')) {
387+
if ($store = $this->storeManager->getStore($container->getRequest()->getParam('store'))) {
388+
$storeId = $store->getId();
389+
$websiteId = $store->getWebsite()->getWebsiteId();
390+
}
391+
}
392+
370393
if (!$this->_role->getIsAll()) {
371-
$container->removeButton('save');
394+
if (!$this->_role->hasExclusiveAccess([$websiteId]) || is_null($websiteId)) {
395+
if (!$this->_role->hasExclusiveStoreAccess([$storeId]) || is_null($storeId)) {
396+
$container->removeButton('save');
397+
}
398+
}
372399
}
373400
}
374401

app/code/Magento/AdminGws/Model/Controllers.php

+31
Original file line numberDiff line numberDiff line change
@@ -1110,6 +1110,37 @@ public function blockIndexAction()
11101110
return false;
11111111
}
11121112

1113+
/**
1114+
* Validates hierarchy actions for all GWS limited users.
1115+
*
1116+
* @return bool
1117+
*/
1118+
public function validateCmsHierarchyAction()
1119+
{
1120+
$websiteId = null;
1121+
$storeId = null;
1122+
if ($this->_request->getPost('website')) {
1123+
if ($website = $this->_storeManager->getWebsite($this->_request->getPost('website'))) {
1124+
$websiteId = $website->getId();
1125+
}
1126+
}
1127+
if ($this->_request->getPost('store')) {
1128+
if ($store = $this->_storeManager->getStore($this->_request->getPost('store'))) {
1129+
$storeId = $store->getId();
1130+
$websiteId = $store->getWebsite()->getWebsiteId();
1131+
}
1132+
}
1133+
if (!$this->_role->getIsAll()) {
1134+
if (!$this->_role->hasExclusiveAccess([$websiteId]) || is_null($websiteId)) {
1135+
if (!$this->_role->hasExclusiveStoreAccess([$storeId]) || is_null($storeId)) {
1136+
$this->_forward();
1137+
return false;
1138+
}
1139+
}
1140+
}
1141+
return true;
1142+
}
1143+
11131144
/**
11141145
* Validate misc Manage Currency Rates requests
11151146
*

app/code/Magento/AdminGws/composer.json

+19-19
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.4.11|~5.5.0",
6-
"magento/module-authorization": "0.1.0-alpha107",
7-
"magento/module-store": "0.1.0-alpha107",
8-
"magento/module-sales": "0.1.0-alpha107",
9-
"magento/module-backend": "0.1.0-alpha107",
10-
"magento/module-catalog": "0.1.0-alpha107",
11-
"magento/module-review": "0.1.0-alpha107",
12-
"magento/module-customer": "0.1.0-alpha107",
13-
"magento/module-catalog-event": "0.1.0-alpha107",
14-
"magento/module-checkout-agreements": "0.1.0-alpha107",
15-
"magento/module-gift-registry": "0.1.0-alpha107",
16-
"magento/module-catalog-rule": "0.1.0-alpha107",
17-
"magento/module-sales-rule": "0.1.0-alpha107",
18-
"magento/module-reminder": "0.1.0-alpha107",
19-
"magento/module-customer-segment": "0.1.0-alpha107",
20-
"magento/module-cms": "0.1.0-alpha107",
21-
"magento/module-user": "0.1.0-alpha107",
22-
"magento/module-url-rewrite": "0.1.0-alpha107",
23-
"magento/framework": "0.1.0-alpha107",
6+
"magento/module-authorization": "0.1.0-alpha108",
7+
"magento/module-store": "0.1.0-alpha108",
8+
"magento/module-sales": "0.1.0-alpha108",
9+
"magento/module-backend": "0.1.0-alpha108",
10+
"magento/module-catalog": "0.1.0-alpha108",
11+
"magento/module-review": "0.1.0-alpha108",
12+
"magento/module-customer": "0.1.0-alpha108",
13+
"magento/module-catalog-event": "0.1.0-alpha108",
14+
"magento/module-checkout-agreements": "0.1.0-alpha108",
15+
"magento/module-gift-registry": "0.1.0-alpha108",
16+
"magento/module-catalog-rule": "0.1.0-alpha108",
17+
"magento/module-sales-rule": "0.1.0-alpha108",
18+
"magento/module-reminder": "0.1.0-alpha108",
19+
"magento/module-customer-segment": "0.1.0-alpha108",
20+
"magento/module-cms": "0.1.0-alpha108",
21+
"magento/module-user": "0.1.0-alpha108",
22+
"magento/module-url-rewrite": "0.1.0-alpha108",
23+
"magento/framework": "0.1.0-alpha108",
2424
"magento/magento-composer-installer": "*"
2525
},
2626
"type": "magento2-module",
27-
"version": "0.1.0-alpha107",
27+
"version": "0.1.0-alpha108",
2828
"license": [
2929
"OSL-3.0",
3030
"AFL-3.0"

app/code/Magento/AdminGws/etc/adminhtml/admingws.xml

+3-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@
204204
<callback class="adminhtml__process__massReindex" method="blockIndexAction" />
205205
<callback class="adminhtml__process__reindexProcess" method="blockIndexAction" />
206206
<callback class="adminhtml__process__reindexAllAction" method="blockIndexAction" />
207-
<callback class="adminhtml__cms_hierarchy__save" method="blockIndexAction" />
207+
<callback class="adminhtml__cms_hierarchy__save" method="validateCmsHierarchyAction" />
208+
<callback class="adminhtml__cms_hierarchy__delete" method="validateCmsHierarchyAction" />
209+
<callback class="adminhtml__cms_hierarchy__copy" method="validateCmsHierarchyAction" />
208210
<callback class="adminhtml__customer_group__save" method="blockCustomerGroupSave" />
209211
<callback class="adminhtml__tax_rule__save" method="blockTaxChange" />
210212
<callback class="adminhtml__tax_rule__delete" method="blockTaxChange" />

app/code/Magento/AdminNotification/composer.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.4.11|~5.5.0",
6-
"magento/module-store": "0.1.0-alpha107",
7-
"magento/module-core": "0.1.0-alpha107",
8-
"magento/module-backend": "0.1.0-alpha107",
9-
"magento/framework": "0.1.0-alpha107",
6+
"magento/module-store": "0.1.0-alpha108",
7+
"magento/module-core": "0.1.0-alpha108",
8+
"magento/module-backend": "0.1.0-alpha108",
9+
"magento/framework": "0.1.0-alpha108",
1010
"lib-libxml": "*",
1111
"magento/magento-composer-installer": "*"
1212
},
1313
"type": "magento2-module",
14-
"version": "0.1.0-alpha107",
14+
"version": "0.1.0-alpha108",
1515
"license": [
1616
"OSL-3.0",
1717
"AFL-3.0"

app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index.php

+18-5
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,25 @@ class Index extends \Magento\Backend\App\Action
3030
protected $_registry = null;
3131

3232
/**
33-
* @param \Magento\Backend\App\Action\Context $context
33+
* Customer builder
34+
*
35+
* @var \Magento\Customer\Api\Data\CustomerDataBuilder
36+
*/
37+
protected $customerBuilder;
38+
39+
/**
40+
* @param Action\Context $context
3441
* @param \Magento\Framework\Registry $registry
42+
* @param \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder
3543
*/
36-
public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $registry)
37-
{
44+
public function __construct(
45+
\Magento\Backend\App\Action\Context $context,
46+
\Magento\Framework\Registry $registry,
47+
\Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder
48+
) {
3849
parent::__construct($context);
3950
$this->_registry = $registry;
51+
$this->customerBuilder = $customerBuilder;
4052
}
4153

4254
/**
@@ -81,7 +93,7 @@ protected function _initData($useRedirects = true)
8193
) {
8294
if ($useRedirects) {
8395
$this->messageManager->addError(__('Shopping cart management disabled for this customer.'));
84-
$this->_redirect('customer/index/edit', ['id' => $customer->getId()]);
96+
$this->_redirect('customer/index/edit', ['id' => $customerId]);
8597
$this->_redirectFlag = true;
8698
return $this;
8799
} else {
@@ -141,7 +153,8 @@ protected function _initData($useRedirects = true)
141153
} else {
142154
// customer and addresses should be set to resolve situation when no quote was saved for customer previously
143155
// otherwise quote would be saved with customer_id = null and zero totals
144-
$quote->setStore($storeManager->getStore($storeId))->setCustomer($customer);
156+
$customerDataObject = $this->customerBuilder->populateWithArray($customer->getData())->create();
157+
$quote->setStore($storeManager->getStore($storeId))->setCustomer($customerDataObject);
145158
$quote->getBillingAddress();
146159
$quote->getShippingAddress();
147160
$this->_objectManager->get('Magento\Sales\Model\QuoteRepository')->save($quote);

app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index/LoadBlock.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@ class LoadBlock extends \Magento\AdvancedCheckout\Controller\Adminhtml\Index
1818
/**
1919
* @param \Magento\Backend\App\Action\Context $context
2020
* @param \Magento\Framework\Registry $registry
21+
* @param \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder
2122
* @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
2223
*/
2324
public function __construct(
2425
\Magento\Backend\App\Action\Context $context,
2526
\Magento\Framework\Registry $registry,
27+
\Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder,
2628
\Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
2729
) {
28-
parent::__construct($context, $registry);
30+
parent::__construct($context, $registry, $customerBuilder);
2931
$this->resultLayoutFactory = $resultLayoutFactory;
3032
}
3133

app/code/Magento/AdvancedCheckout/Controller/Cart/RemoveFailed.php

+20-1
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,27 @@
55
*/
66
namespace Magento\AdvancedCheckout\Controller\Cart;
77

8+
use Magento\Framework\App\Action\Context;
9+
810
class RemoveFailed extends \Magento\AdvancedCheckout\Controller\Cart
911
{
12+
/**
13+
* @var \Magento\Framework\Url\DecoderInterface
14+
*/
15+
protected $urlDecoder;
16+
17+
/**
18+
* @param Context $context
19+
* @param \Magento\Framework\Url\DecoderInterface $urlDecoder
20+
*/
21+
public function __construct(
22+
Context $context,
23+
\Magento\Framework\Url\DecoderInterface $urlDecoder
24+
) {
25+
parent::__construct($context);
26+
$this->urlDecoder = $urlDecoder;
27+
}
28+
1029
/**
1130
* Remove failed items from storage
1231
*
@@ -15,7 +34,7 @@ class RemoveFailed extends \Magento\AdvancedCheckout\Controller\Cart
1534
public function execute()
1635
{
1736
$removed = $this->_getFailedItemsCart()->removeAffectedItem(
18-
$this->_objectManager->get('Magento\Core\Helper\Url')->urlDecode($this->getRequest()->getParam('sku'))
37+
$this->urlDecoder->decode($this->getRequest()->getParam('sku'))
1938
);
2039

2140
if ($removed) {

app/code/Magento/AdvancedCheckout/composer.json

+20-20
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,29 @@
33
"description": "N/A",
44
"require": {
55
"php": "~5.4.11|~5.5.0",
6-
"magento/module-store": "0.1.0-alpha107",
7-
"magento/module-sales": "0.1.0-alpha107",
8-
"magento/module-core": "0.1.0-alpha107",
9-
"magento/module-catalog": "0.1.0-alpha107",
10-
"magento/module-checkout": "0.1.0-alpha107",
11-
"magento/module-customer": "0.1.0-alpha107",
12-
"magento/module-directory": "0.1.0-alpha107",
13-
"magento/module-wishlist": "0.1.0-alpha107",
14-
"magento/module-tax": "0.1.0-alpha107",
15-
"magento/module-reports": "0.1.0-alpha107",
16-
"magento/module-catalog-inventory": "0.1.0-alpha107",
17-
"magento/module-backend": "0.1.0-alpha107",
18-
"magento/module-product-alert": "0.1.0-alpha107",
19-
"magento/module-widget": "0.1.0-alpha107",
20-
"magento/module-gift-card": "0.1.0-alpha107",
21-
"magento/module-downloadable": "0.1.0-alpha107",
22-
"magento/module-msrp": "0.1.0-alpha107",
23-
"magento/framework": "0.1.0-alpha107",
24-
"magento/module-ui": "0.1.0-alpha107",
6+
"magento/module-store": "0.1.0-alpha108",
7+
"magento/module-sales": "0.1.0-alpha108",
8+
"magento/module-core": "0.1.0-alpha108",
9+
"magento/module-catalog": "0.1.0-alpha108",
10+
"magento/module-checkout": "0.1.0-alpha108",
11+
"magento/module-customer": "0.1.0-alpha108",
12+
"magento/module-directory": "0.1.0-alpha108",
13+
"magento/module-wishlist": "0.1.0-alpha108",
14+
"magento/module-tax": "0.1.0-alpha108",
15+
"magento/module-reports": "0.1.0-alpha108",
16+
"magento/module-catalog-inventory": "0.1.0-alpha108",
17+
"magento/module-backend": "0.1.0-alpha108",
18+
"magento/module-product-alert": "0.1.0-alpha108",
19+
"magento/module-widget": "0.1.0-alpha108",
20+
"magento/module-gift-card": "0.1.0-alpha108",
21+
"magento/module-downloadable": "0.1.0-alpha108",
22+
"magento/module-msrp": "0.1.0-alpha108",
23+
"magento/framework": "0.1.0-alpha108",
24+
"magento/module-ui": "0.1.0-alpha108",
2525
"magento/magento-composer-installer": "*"
2626
},
2727
"type": "magento2-module",
28-
"version": "0.1.0-alpha107",
28+
"version": "0.1.0-alpha108",
2929
"license": [
3030
"OSL-3.0",
3131
"AFL-3.0"

app/code/Magento/Authorization/composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
"description": "Authorization module provides access to Magento ACL functionality.",
44
"require": {
55
"php": "~5.4.11|~5.5.0",
6-
"magento/module-backend": "0.1.0-alpha107",
7-
"magento/framework": "0.1.0-alpha107",
6+
"magento/module-backend": "0.1.0-alpha108",
7+
"magento/framework": "0.1.0-alpha108",
88
"magento/magento-composer-installer": "*"
99
},
1010
"type": "magento2-module",
11-
"version": "0.1.0-alpha107",
11+
"version": "0.1.0-alpha108",
1212
"license": [
1313
"OSL-3.0",
1414
"AFL-3.0"

0 commit comments

Comments
 (0)