Permalink
Browse files

Merge remote branch 'upstream/master'

  • Loading branch information...
2 parents e0a4fd5 + 3330e25 commit 2f473934e7fa31914743a602553f6cfa61a389c7 Alexander Menk committed Jul 18, 2012
Showing 1,074 changed files with 84,691 additions and 4,505 deletions.
View
@@ -1,12 +1,52 @@
+Update as of 7/3/2012
+=====================
+* Refactored backend (admin) menu generation:
+ * Menu is separated from `adminhtml.xml` files into `menu.xml` files
+ * Rendering menu became responsibility of `Mage_Backend` instead of `Mage_Adminhtml` module
+ * Implemented XML-Schema for `menu.xml`
+ * Actions with menu items defined in schema: add, remove, move, update, change parent and position
+* Refactored customers import feature. New ability to provide import data in 3 files: master file (key customer information) + address file (customer id + address info) + financial file (customer id + reward points & store credit)
+* Optimized memory consumption in integration tests:
+ * Found and eliminated memory leaks in `Mage_Core_Model_App_Area`, `Mage_Core_Model_Layout`
+ * Manually unset objects from PHPUnit test case object in `tearDown()` in integration tests. Garbage collector didn't purge them because of these references
+ * Disabled running `integrity` test suite by default in integration tests
+* Improvements in visual design editor JavaScript:
+ * eliminated dependency of code on HTML-literals, reduced code coupling between templates and JavaScript files
+ * implemented blocking unwanted JavaScript activity in visual design editor mode
+* Various fixes in UX, code stability, modularity
+* GitHub requests:
+ * [#23](https://github.com/magento/magento2/pull/23) -- added `Mage_Customer_Block_Account_Navigation::removeLink()`
+
+Update as of 6/20/2012
+=====================
+* Implemented locale translation inheritance
+* Implemented new format for exporting customer data
+* Added initial Javascript code for globalization and localization
+* Added initial Javascript unit tests
+* Implemented file signature for urls of static files - better CDN support
+* Implemented optional tracking of changes in view files fallback - cached by default, tracked in developer mode
+* Introduced `@magentoDbIsolation` annotation in integration tests - isolates DB modifications made by tests
+* Started refactoring of Visual Design Editor Javascript architecture
+* GitHub requests:
+ * [#25](https://github.com/magento/magento2/issues/25) Removed unused `Mage_Core_Block_Abstract::getHelper()` method
+* Fixed:
+ * "$_FILES array is empty" messages in exception log upon installation
+ * Long attribute table aliases, that were producing errors at DB with lower identifier limitation than MySQL
+ * Watermark opacity function did not work with ImageMagick
+ * `Magento_Test_TestCase_ControllerAbstract::assertRedirect` was used in a wrong way
+ * Inability to reorder a downloadable product
+ * ACL tables aliases interference with other table aliases
+* Several tests are made incomplete temporary, appropriate bugs to be fixed in the nearest future
+
Update as of 6/7/2012
=====================
* Fixed various crashes of visual design editor
* Fixed some layouts that caused visual design editor toolbar disappearing, also fixed some confusing page type labels
* Eliminated "after commit callback" workaround from integration tests by implementing "transparent transactions" capability in integration testing framework
* Refactored admin authentication/authorization in RSS module. Removed program termination and covered the controllers with tests
* Removed HTML-report feature of copy-paste detector which never worked anyway (`dev/tests/static/framework/Inspection/CopyPasteDetector/html_report.xslt` and all related code)
-* Github requests:
-** [#19](https://github.com/magento/magento2/pull/19) Implemented "soft" dependency between modules and performed several improvements in the related code, covered with tests
+* GitHub requests:
+ * [#19](https://github.com/magento/magento2/pull/19) Implemented "soft" dependency between modules and performed several improvements in the related code, covered with tests
Update as of 5/31/2012
======================
@@ -54,7 +54,7 @@ public function activateEmail()
$translate->setTranslateInline(false);
Mage::getModel('Mage_Core_Model_Email_Template')
- ->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
+ ->setDesignConfig(array('area' => Mage_Core_Model_App_Area::AREA_FRONTEND, 'store' => $storeId))
->sendTransactional(
'moneybookers_activateemail',
Mage::getStoreConfig(Mage_Sales_Model_Order::XML_PATH_EMAIL_IDENTITY, $storeId),
@@ -333,20 +333,4 @@ public function getAdminhtmlConfig()
{
return $this->_adminhtmlConfig;
}
-
- /**
- * Get menu item label by item path
- *
- * @param string $path
- * @return string
- */
- public function getMenuItemLabel($path)
- {
- $moduleName = 'Mage_Adminhtml_Helper_Data';
- $menuNode = $this->getAdminhtmlConfig()->getNode('menu/' . str_replace('/', '/children/', trim($path, '/')));
- if ($menuNode->getAttribute('module')) {
- $moduleName = (string)$menuNode->getAttribute('module');
- }
- return $this->_getHelper($moduleName)->__((string)$menuNode->title);
- }
}
@@ -60,15 +60,4 @@
</admin>
</resources>
</acl>
- <menu>
- <system>
- <children>
- <adminnotification translate="title" module="Mage_AdminNotification">
- <title>Notifications</title>
- <action>adminhtml/notification</action>
- <sort_order>15</sort_order>
- </adminnotification>
- </children>
- </system>
- </menu>
</config>
@@ -0,0 +1,32 @@
+<?xml version="1.0"?>
+<!--
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Academic Free License (AFL 3.0)
+ * that is bundled with this package in the file LICENSE_AFL.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/afl-3.0.php
+ * If you did not receive a copy of the license and are unable to
+ * obtain it through the world-wide-web, please send an email
+ * to license@magentocommerce.com so we can send you a copy immediately.
+ *
+ * DISCLAIMER
+ *
+ * Do not edit or add to this file if you wish to upgrade Magento to newer
+ * versions in the future. If you wish to customize Magento for your
+ * needs please refer to http://www.magentocommerce.com for more information.
+ *
+ * @category Mage
+ * @package Mage_AdminNotification
+ * @copyright Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+ */
+-->
+<config>
+ <menu>
+ <add id="Mage_AdminNotification::system_adminnotification" title="Notifications" module="Mage_AdminNotification" sortOrder="15" parent="Mage_Adminhtml::system" action="adminhtml/notification" />
+ </menu>
+</config>
@@ -45,7 +45,7 @@ class Mage_Adminhtml_Block_Report_Product_Viewed_Grid extends Mage_Adminhtml_Blo
*
* @var string
*/
- protected $_resourceCollectionName = 'Mage_Reports_Model_Resource_Product_Viewed_Collection';
+ protected $_resourceCollectionName = 'Mage_Reports_Model_Resource_Report_Product_Viewed_Collection';
/**
* Init grid parameters
@@ -350,12 +350,16 @@ protected function _getSystemConfigPathsParts($paths)
$result = $urlParams = $prefixParts = array();
$scopeLabel = Mage::helper('Mage_Adminhtml_Helper_Data')->__('GLOBAL');
if ($paths) {
+ /** @var $menu Mage_Backend_Model_Menu */
+ $menu = Mage::getSingleton('Mage_Backend_Model_Menu_Config')->getMenu();
+ $item = $menu->get('Mage_Adminhtml::system');
// create prefix path parts
$prefixParts[] = array(
- 'title' => Mage::getSingleton('Mage_Admin_Model_Config')->getMenuItemLabel('system'),
+ 'title' => $item->getModuleHelper()->__($item->getTitle()),
);
+ $item = $menu->get('Mage_Adminhtml::system_config');
$prefixParts[] = array(
- 'title' => Mage::getSingleton('Mage_Admin_Model_Config')->getMenuItemLabel('system/config'),
+ 'title' => $item->getModuleHelper()->__($item->getTitle()),
'url' => $this->getUrl('adminhtml/system_config/'),
);
@@ -48,7 +48,7 @@ protected function _construct()
protected function _initAction()
{
$this->loadLayout()
- ->_setActiveMenu('sales/order')
+ ->_setActiveMenu('Mage_Sales::sales_order')
->_addBreadcrumb($this->__('Sales'), $this->__('Sales'))
->_addBreadcrumb($this->__('Credit Memos'),$this->__('Credit Memos'));
return $this;
@@ -48,7 +48,7 @@ protected function _construct()
protected function _initAction()
{
$this->loadLayout()
- ->_setActiveMenu('sales/order')
+ ->_setActiveMenu('Mage_Sales::sales_order')
->_addBreadcrumb($this->__('Sales'), $this->__('Sales'))
->_addBreadcrumb($this->__('Invoices'),$this->__('Invoices'));
return $this;
@@ -48,7 +48,7 @@ protected function _construct()
protected function _initAction()
{
$this->loadLayout()
- ->_setActiveMenu('sales/order')
+ ->_setActiveMenu('Mage_Sales::sales_order')
->_addBreadcrumb($this->__('Sales'), $this->__('Sales'))
->_addBreadcrumb($this->__('Shipments'),$this->__('Shipments'));
return $this;
@@ -262,42 +262,28 @@ public function setQuote(Mage_Sales_Model_Quote $quote)
* Initialize creation data from existing order
*
* @param Mage_Sales_Model_Order $order
- * @return unknown
+ * @return Mage_Adminhtml_Model_Sales_Order_Create
*/
public function initFromOrder(Mage_Sales_Model_Order $order)
{
- if (!$order->getReordered()) {
- $this->getSession()->setOrderId($order->getId());
- } else {
- $this->getSession()->setReordered($order->getId());
- }
-
- /**
- * Check if we edit quest order
- */
- $this->getSession()->setCurrencyId($order->getOrderCurrencyCode());
- if ($order->getCustomerId()) {
- $this->getSession()->setCustomerId($order->getCustomerId());
- } else {
- $this->getSession()->setCustomerId(false);
- }
-
- $this->getSession()->setStoreId($order->getStoreId());
-
- /**
- * Initialize catalog rule data with new session values
- */
+ $session = $this->getSession();
+ $session->setData($order->getReordered() ? 'reordered' : 'order_id', $order->getId());
+ $session->setCurrencyId($order->getOrderCurrencyCode());
+ /* Check if we edit guest order */
+ $session->setCustomerId($order->getCustomerId() ?: false);
+ $session->setStoreId($order->getStoreId());
+
+ /* Initialize catalog rule data with new session values */
$this->initRuleData();
foreach ($order->getItemsCollection(
array_keys(Mage::getConfig()->getNode('adminhtml/sales/order/create/available_product_types')->asArray()),
true
- ) as $orderItem) {
+ ) as $orderItem) {
/* @var $orderItem Mage_Sales_Model_Order_Item */
if (!$orderItem->getParentItem()) {
- if ($order->getReordered()) {
- $qty = $orderItem->getQtyOrdered();
- } else {
- $qty = $orderItem->getQtyOrdered() - $orderItem->getQtyShipped() - $orderItem->getQtyInvoiced();
+ $qty = $orderItem->getQtyOrdered();
+ if (!$order->getReordered()) {
+ $qty -= $orderItem->getQtyShipped() + $orderItem->getQtyInvoiced();
}
if ($qty > 0) {
@@ -309,52 +295,44 @@ public function initFromOrder(Mage_Sales_Model_Order $order)
}
}
- $addressDiff = array_diff_assoc(
- $order->getShippingAddress()->getData(),
- $order->getBillingAddress()->getData()
- );
- unset($addressDiff['address_type'], $addressDiff['entity_id']);
- $order->getShippingAddress()->setSameAsBilling(empty($addressDiff));
+ $shippingAddress = $order->getShippingAddress();
+ if ($shippingAddress) {
+ $addressDiff = array_diff_assoc($shippingAddress->getData(), $order->getBillingAddress()->getData());
+ unset($addressDiff['address_type'], $addressDiff['entity_id']);
+ $shippingAddress->setSameAsBilling(empty($addressDiff));
+ }
$this->_initBillingAddressFromOrder($order);
$this->_initShippingAddressFromOrder($order);
- if (!$this->getQuote()->isVirtual() && $this->getShippingAddress()->getSameAsBilling()) {
+ $quote = $this->getQuote();
+ if (!$quote->isVirtual() && $this->getShippingAddress()->getSameAsBilling()) {
$this->setShippingAsBilling(1);
}
$this->setShippingMethod($order->getShippingMethod());
- $this->getQuote()->getShippingAddress()->setShippingDescription($order->getShippingDescription());
-
- $this->getQuote()->getPayment()->addData($order->getPayment()->getData());
+ $quote->getShippingAddress()->setShippingDescription($order->getShippingDescription());
+ $quote->getPayment()->addData($order->getPayment()->getData());
$orderCouponCode = $order->getCouponCode();
if ($orderCouponCode) {
- $this->getQuote()->setCouponCode($orderCouponCode);
+ $quote->setCouponCode($orderCouponCode);
}
- if ($this->getQuote()->getCouponCode()) {
- $this->getQuote()->collectTotals();
+ if ($quote->getCouponCode()) {
+ $quote->collectTotals();
}
- Mage::helper('Mage_Core_Helper_Data')->copyFieldset(
- 'sales_copy_order',
- 'to_edit',
- $order,
- $this->getQuote()
- );
+ Mage::helper('Mage_Core_Helper_Data')->copyFieldset('sales_copy_order', 'to_edit', $order, $quote);
- Mage::dispatchEvent('sales_convert_order_to_quote', array(
- 'order' => $order,
- 'quote' => $this->getQuote()
- ));
+ Mage::dispatchEvent('sales_convert_order_to_quote', array('order' => $order, 'quote' => $quote));
if (!$order->getCustomerId()) {
- $this->getQuote()->setCustomerIsGuest(true);
+ $quote->setCustomerIsGuest(true);
}
- if ($this->getSession()->getUseOldShippingMethod(true)) {
+ if ($session->getUseOldShippingMethod(true)) {
/*
* if we are making reorder or editing old order
* we need to show old shipping as preselected
@@ -369,11 +347,7 @@ public function initFromOrder(Mage_Sales_Model_Order $order)
$this->collectRates();
}
- // Make collect rates when user click "Get shipping methods and rates" in order creating
- // $this->getQuote()->getShippingAddress()->setCollectShippingRates(true);
- // $this->getQuote()->getShippingAddress()->collectShippingRates();
-
- $this->getQuote()->save();
+ $quote->save();
return $this;
}
@@ -391,14 +365,15 @@ protected function _initBillingAddressFromOrder(Mage_Sales_Model_Order $order)
protected function _initShippingAddressFromOrder(Mage_Sales_Model_Order $order)
{
- $this->getQuote()->getShippingAddress()
+ $orderShippingAddress = $order->getShippingAddress();
+ $quoteShippingAddress = $this->getQuote()->getShippingAddress()
->setCustomerAddressId('')
- ->setSameAsBilling($order->getShippingAddress()->getSameAsBilling());
+ ->setSameAsBilling($orderShippingAddress && $orderShippingAddress->getSameAsBilling());
Mage::helper('Mage_Core_Helper_Data')->copyFieldset(
'sales_copy_order_shipping_address',
'to_order',
- $order->getShippingAddress(),
- $this->getQuote()->getShippingAddress()
+ $orderShippingAddress,
+ $quoteShippingAddress
);
}
Oops, something went wrong.

0 comments on commit 2f47393

Please sign in to comment.