Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into MAGEDOC-1720-Sales
Browse files Browse the repository at this point in the history
Conflicts:
	app/code/Magento/Sales/Api/Data/OrderPaymentInterface.php
  • Loading branch information
difleming committed Dec 16, 2014
2 parents 6da4073 + db526c3 commit adb5818
Show file tree
Hide file tree
Showing 1,603 changed files with 21,944 additions and 14,510 deletions.
8 changes: 8 additions & 0 deletions .php_cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
<?php
/**
* @copyright Copyright (c) 2014 X.commerce, Inc. (http://www.magentocommerce.com)
*/

/**
* Pre-commit hook installation:
* vendor/bin/static-review.php hook:install dev/tools/Magento/Tools/StaticReview/pre-commit .git/hooks/pre-commit
*/
$finder = Symfony\CS\Finder\DefaultFinder::create()
->name('*.phtml')
->exclude('dev/tests/functional/generated')
Expand Down
6 changes: 6 additions & 0 deletions app/autoload.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@

$vendorDir = require BP . '/app/etc/vendor_path.php';
$vendorAutoload = BP . "/{$vendorDir}/autoload.php";

/* 'composer install' validation */
if (file_exists($vendorAutoload)) {
$composerAutoloader = include $vendorAutoload;
} else {
throw new \Exception(
'Vendor autoload is not found. Please run \'composer install\' under application root directory.'
);
}

AutoloaderRegistry::registerAutoloader(new ClassLoaderWrapper($composerAutoloader));
Expand Down
31 changes: 29 additions & 2 deletions app/code/Magento/AdminGws/Model/Containers.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,30 @@ class Containers implements CallbackProcessorInterface
*/
protected $categoryResource;

/**
* @var \Magento\Store\Model\StoreManagerInterface
*/
protected $storeManager;

/**
* @param Role $role
* @param \Magento\Framework\Registry $registry
* @param \Magento\Cms\Model\Resource\Page $cmsPageResource
* @param \Magento\Catalog\Model\Resource\Category $categoryResource
* @param \Magento\Store\Model\StoreManagerInterface $storeManager
*/
public function __construct(
Role $role,
\Magento\Framework\Registry $registry,
\Magento\Cms\Model\Resource\Page $cmsPageResource,
\Magento\Catalog\Model\Resource\Category $categoryResource
\Magento\Catalog\Model\Resource\Category $categoryResource,
\Magento\Store\Model\StoreManagerInterface $storeManager
) {
$this->_role = $role;
$this->registry = $registry;
$this->cmsPageResource = $cmsPageResource;
$this->categoryResource = $categoryResource;
$this->storeManager = $storeManager;
}

/**
Expand Down Expand Up @@ -367,8 +375,27 @@ public function removeRatingEditButtons(ContainerInterface $container)
*/
public function removeCmsHierarchyFormButtons(ContainerInterface $container)
{
$websiteId = null;
$storeId = null;

if ($container->getRequest()->getParam('website')) {
if ($website = $this->storeManager->getWebsite($container->getRequest()->getParam('website'))) {
$websiteId = $website->getId();
}
}
if ($container->getRequest()->getParam('store')) {
if ($store = $this->storeManager->getStore($container->getRequest()->getParam('store'))) {
$storeId = $store->getId();
$websiteId = $store->getWebsite()->getWebsiteId();
}
}

if (!$this->_role->getIsAll()) {
$container->removeButton('save');
if (!$this->_role->hasExclusiveAccess([$websiteId]) || is_null($websiteId)) {
if (!$this->_role->hasExclusiveStoreAccess([$storeId]) || is_null($storeId)) {
$container->removeButton('save');
}
}
}
}

Expand Down
31 changes: 31 additions & 0 deletions app/code/Magento/AdminGws/Model/Controllers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,37 @@ public function blockIndexAction()
return false;
}

/**
* Validates hierarchy actions for all GWS limited users.
*
* @return bool
*/
public function validateCmsHierarchyAction()
{
$websiteId = null;
$storeId = null;
if ($this->_request->getPost('website')) {
if ($website = $this->_storeManager->getWebsite($this->_request->getPost('website'))) {
$websiteId = $website->getId();
}
}
if ($this->_request->getPost('store')) {
if ($store = $this->_storeManager->getStore($this->_request->getPost('store'))) {
$storeId = $store->getId();
$websiteId = $store->getWebsite()->getWebsiteId();
}
}
if (!$this->_role->getIsAll()) {
if (!$this->_role->hasExclusiveAccess([$websiteId]) || is_null($websiteId)) {
if (!$this->_role->hasExclusiveStoreAccess([$storeId]) || is_null($storeId)) {
$this->_forward();
return false;
}
}
}
return true;
}

/**
* Validate misc Manage Currency Rates requests
*
Expand Down
38 changes: 19 additions & 19 deletions app/code/Magento/AdminGws/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
"description": "N/A",
"require": {
"php": "~5.4.11|~5.5.0",
"magento/module-authorization": "0.1.0-alpha107",
"magento/module-store": "0.1.0-alpha107",
"magento/module-sales": "0.1.0-alpha107",
"magento/module-backend": "0.1.0-alpha107",
"magento/module-catalog": "0.1.0-alpha107",
"magento/module-review": "0.1.0-alpha107",
"magento/module-customer": "0.1.0-alpha107",
"magento/module-catalog-event": "0.1.0-alpha107",
"magento/module-checkout-agreements": "0.1.0-alpha107",
"magento/module-gift-registry": "0.1.0-alpha107",
"magento/module-catalog-rule": "0.1.0-alpha107",
"magento/module-sales-rule": "0.1.0-alpha107",
"magento/module-reminder": "0.1.0-alpha107",
"magento/module-customer-segment": "0.1.0-alpha107",
"magento/module-cms": "0.1.0-alpha107",
"magento/module-user": "0.1.0-alpha107",
"magento/module-url-rewrite": "0.1.0-alpha107",
"magento/framework": "0.1.0-alpha107",
"magento/module-authorization": "0.1.0-alpha108",
"magento/module-store": "0.1.0-alpha108",
"magento/module-sales": "0.1.0-alpha108",
"magento/module-backend": "0.1.0-alpha108",
"magento/module-catalog": "0.1.0-alpha108",
"magento/module-review": "0.1.0-alpha108",
"magento/module-customer": "0.1.0-alpha108",
"magento/module-catalog-event": "0.1.0-alpha108",
"magento/module-checkout-agreements": "0.1.0-alpha108",
"magento/module-gift-registry": "0.1.0-alpha108",
"magento/module-catalog-rule": "0.1.0-alpha108",
"magento/module-sales-rule": "0.1.0-alpha108",
"magento/module-reminder": "0.1.0-alpha108",
"magento/module-customer-segment": "0.1.0-alpha108",
"magento/module-cms": "0.1.0-alpha108",
"magento/module-user": "0.1.0-alpha108",
"magento/module-url-rewrite": "0.1.0-alpha108",
"magento/framework": "0.1.0-alpha108",
"magento/magento-composer-installer": "*"
},
"type": "magento2-module",
"version": "0.1.0-alpha107",
"version": "0.1.0-alpha108",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
4 changes: 3 additions & 1 deletion app/code/Magento/AdminGws/etc/adminhtml/admingws.xml
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@
<callback class="adminhtml__process__massReindex" method="blockIndexAction" />
<callback class="adminhtml__process__reindexProcess" method="blockIndexAction" />
<callback class="adminhtml__process__reindexAllAction" method="blockIndexAction" />
<callback class="adminhtml__cms_hierarchy__save" method="blockIndexAction" />
<callback class="adminhtml__cms_hierarchy__save" method="validateCmsHierarchyAction" />
<callback class="adminhtml__cms_hierarchy__delete" method="validateCmsHierarchyAction" />
<callback class="adminhtml__cms_hierarchy__copy" method="validateCmsHierarchyAction" />
<callback class="adminhtml__customer_group__save" method="blockCustomerGroupSave" />
<callback class="adminhtml__tax_rule__save" method="blockTaxChange" />
<callback class="adminhtml__tax_rule__delete" method="blockTaxChange" />
Expand Down
10 changes: 5 additions & 5 deletions app/code/Magento/AdminNotification/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"description": "N/A",
"require": {
"php": "~5.4.11|~5.5.0",
"magento/module-store": "0.1.0-alpha107",
"magento/module-core": "0.1.0-alpha107",
"magento/module-backend": "0.1.0-alpha107",
"magento/framework": "0.1.0-alpha107",
"magento/module-store": "0.1.0-alpha108",
"magento/module-core": "0.1.0-alpha108",
"magento/module-backend": "0.1.0-alpha108",
"magento/framework": "0.1.0-alpha108",
"lib-libxml": "*",
"magento/magento-composer-installer": "*"
},
"type": "magento2-module",
"version": "0.1.0-alpha107",
"version": "0.1.0-alpha108",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
23 changes: 18 additions & 5 deletions app/code/Magento/AdvancedCheckout/Controller/Adminhtml/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,25 @@ class Index extends \Magento\Backend\App\Action
protected $_registry = null;

/**
* @param \Magento\Backend\App\Action\Context $context
* Customer builder
*
* @var \Magento\Customer\Api\Data\CustomerDataBuilder
*/
protected $customerBuilder;

/**
* @param Action\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder
*/
public function __construct(\Magento\Backend\App\Action\Context $context, \Magento\Framework\Registry $registry)
{
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder
) {
parent::__construct($context);
$this->_registry = $registry;
$this->customerBuilder = $customerBuilder;
}

/**
Expand Down Expand Up @@ -81,7 +93,7 @@ protected function _initData($useRedirects = true)
) {
if ($useRedirects) {
$this->messageManager->addError(__('Shopping cart management disabled for this customer.'));
$this->_redirect('customer/index/edit', ['id' => $customer->getId()]);
$this->_redirect('customer/index/edit', ['id' => $customerId]);
$this->_redirectFlag = true;
return $this;
} else {
Expand Down Expand Up @@ -141,7 +153,8 @@ protected function _initData($useRedirects = true)
} else {
// customer and addresses should be set to resolve situation when no quote was saved for customer previously
// otherwise quote would be saved with customer_id = null and zero totals
$quote->setStore($storeManager->getStore($storeId))->setCustomer($customer);
$customerDataObject = $this->customerBuilder->populateWithArray($customer->getData())->create();
$quote->setStore($storeManager->getStore($storeId))->setCustomer($customerDataObject);
$quote->getBillingAddress();
$quote->getShippingAddress();
$this->_objectManager->get('Magento\Sales\Model\QuoteRepository')->save($quote);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ class LoadBlock extends \Magento\AdvancedCheckout\Controller\Adminhtml\Index
/**
* @param \Magento\Backend\App\Action\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder
* @param \Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
*/
public function __construct(
\Magento\Backend\App\Action\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Customer\Api\Data\CustomerDataBuilder $customerBuilder,
\Magento\Framework\View\Result\LayoutFactory $resultLayoutFactory
) {
parent::__construct($context, $registry);
parent::__construct($context, $registry, $customerBuilder);
$this->resultLayoutFactory = $resultLayoutFactory;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,27 @@
*/
namespace Magento\AdvancedCheckout\Controller\Cart;

use Magento\Framework\App\Action\Context;

class RemoveFailed extends \Magento\AdvancedCheckout\Controller\Cart
{
/**
* @var \Magento\Framework\Url\DecoderInterface
*/
protected $urlDecoder;

/**
* @param Context $context
* @param \Magento\Framework\Url\DecoderInterface $urlDecoder
*/
public function __construct(
Context $context,
\Magento\Framework\Url\DecoderInterface $urlDecoder
) {
parent::__construct($context);
$this->urlDecoder = $urlDecoder;
}

/**
* Remove failed items from storage
*
Expand All @@ -15,7 +34,7 @@ class RemoveFailed extends \Magento\AdvancedCheckout\Controller\Cart
public function execute()
{
$removed = $this->_getFailedItemsCart()->removeAffectedItem(
$this->_objectManager->get('Magento\Core\Helper\Url')->urlDecode($this->getRequest()->getParam('sku'))
$this->urlDecoder->decode($this->getRequest()->getParam('sku'))
);

if ($removed) {
Expand Down
40 changes: 20 additions & 20 deletions app/code/Magento/AdvancedCheckout/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,29 @@
"description": "N/A",
"require": {
"php": "~5.4.11|~5.5.0",
"magento/module-store": "0.1.0-alpha107",
"magento/module-sales": "0.1.0-alpha107",
"magento/module-core": "0.1.0-alpha107",
"magento/module-catalog": "0.1.0-alpha107",
"magento/module-checkout": "0.1.0-alpha107",
"magento/module-customer": "0.1.0-alpha107",
"magento/module-directory": "0.1.0-alpha107",
"magento/module-wishlist": "0.1.0-alpha107",
"magento/module-tax": "0.1.0-alpha107",
"magento/module-reports": "0.1.0-alpha107",
"magento/module-catalog-inventory": "0.1.0-alpha107",
"magento/module-backend": "0.1.0-alpha107",
"magento/module-product-alert": "0.1.0-alpha107",
"magento/module-widget": "0.1.0-alpha107",
"magento/module-gift-card": "0.1.0-alpha107",
"magento/module-downloadable": "0.1.0-alpha107",
"magento/module-msrp": "0.1.0-alpha107",
"magento/framework": "0.1.0-alpha107",
"magento/module-ui": "0.1.0-alpha107",
"magento/module-store": "0.1.0-alpha108",
"magento/module-sales": "0.1.0-alpha108",
"magento/module-core": "0.1.0-alpha108",
"magento/module-catalog": "0.1.0-alpha108",
"magento/module-checkout": "0.1.0-alpha108",
"magento/module-customer": "0.1.0-alpha108",
"magento/module-directory": "0.1.0-alpha108",
"magento/module-wishlist": "0.1.0-alpha108",
"magento/module-tax": "0.1.0-alpha108",
"magento/module-reports": "0.1.0-alpha108",
"magento/module-catalog-inventory": "0.1.0-alpha108",
"magento/module-backend": "0.1.0-alpha108",
"magento/module-product-alert": "0.1.0-alpha108",
"magento/module-widget": "0.1.0-alpha108",
"magento/module-gift-card": "0.1.0-alpha108",
"magento/module-downloadable": "0.1.0-alpha108",
"magento/module-msrp": "0.1.0-alpha108",
"magento/framework": "0.1.0-alpha108",
"magento/module-ui": "0.1.0-alpha108",
"magento/magento-composer-installer": "*"
},
"type": "magento2-module",
"version": "0.1.0-alpha107",
"version": "0.1.0-alpha108",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Authorization/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
"description": "Authorization module provides access to Magento ACL functionality.",
"require": {
"php": "~5.4.11|~5.5.0",
"magento/module-backend": "0.1.0-alpha107",
"magento/framework": "0.1.0-alpha107",
"magento/module-backend": "0.1.0-alpha108",
"magento/framework": "0.1.0-alpha108",
"magento/magento-composer-installer": "*"
},
"type": "magento2-module",
"version": "0.1.0-alpha107",
"version": "0.1.0-alpha108",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
Loading

0 comments on commit adb5818

Please sign in to comment.