Permalink
Browse files

Update as of 5/05/2012

* Added theme inheritance ability
* Removed @group annotation usage in integration tests
* Introduced keeping of highlighting state while switching between pages in Visual Design Editor
* Fixed some issues:
  * Fixed producing a misleading message by phpcs and phpmd static tests in a case, when no test is failed, but the tools execution failed itself
  * Fixed automatic publication of images in case when image is changed, but CSS file is not
  * Fixed broken "Customer My Account My OAuth Applications" page type in Visual Design Editor
* Fetched updates from Magento 1.x up to April 30 2012. Refer to [Magento 1 release notes](http://www.magentocommerce.com/download/release_notes) for details
  • Loading branch information...
magento-team committed May 5, 2012
1 parent fe7317b commit af7068a198ab2494eab431a8aa08733a075bb89a
Showing 407 changed files with 2,454 additions and 2,440 deletions.
View
@@ -1,3 +1,14 @@
+Update as of 5/05/2012
+======================
+* Added theme inheritance ability
+* Removed @group annotation usage in integration tests
+* Introduced keeping of highlighting state while switching between pages in Visual Design Editor
+* Fixed some issues:
+ * Fixed producing a misleading message by phpcs and phpmd static tests in a case, when no test is failed, but the tools execution failed itself
+ * Fixed automatic publication of images in case when image is changed, but CSS file is not
+ * Fixed broken "Customer My Account My OAuth Applications" page type in Visual Design Editor
+* Fetched updates from Magento 1.x up to April 30 2012. Refer to [Magento 1 release notes](http://www.magentocommerce.com/download/release_notes) for details
+
Update as of 4/26/2012
======================
* Introduced `Mage_Backend` module and relocated backend area routing model there (was `Mage_Core_Controller_Varien_Router_Admin`). The "adminhtml" area is also declared in the `Mage_Backend` module.
@@ -16,7 +27,7 @@ Update as of 4/13/2012
* Containers highlighting
* Dropping of elements
* Fixed some issues:
- * Fixed sorting of elements in Layout in if element is added before its sibling
+ * Fixed sorting of elements in Layout if element is added before its sibling
* Fixed broken Customer Registration page on Front-End and Back-End
* Fixed broken Order Create page on Back-End
* Replaced usages of deprecated Mage_Customer_Model_Address_Abstract::getFormated() to Mage_Customer_Model_Address_Abstract::format()
@@ -32,12 +32,13 @@
* @package Mage_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Block_System_Config_Form_Field_Select_Flatcatalog extends Mage_Adminhtml_Block_System_Config_Form_Field
+class Mage_Adminhtml_Block_System_Config_Form_Field_Select_Flatcatalog
+ extends Mage_Adminhtml_Block_System_Config_Form_Field
{
protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
{
- if (!Mage::helper('Mage_Catalog_Helper_Category_Flat')->isRebuilt()) {
- $element->setDisabled('disabled')
+ if (!Mage::helper('Mage_Catalog_Helper_Category_Flat')->isBuilt()) {
+ $element->setDisabled(true)
->setValue(0);
}
return parent::_getElementHtml($element);
@@ -160,10 +160,6 @@ private function _moveBlockToContainer(Mage_Core_Block_Abstract $block, $contain
public function preDispatch()
{
Mage::app()->setCurrentStore('admin');
- $this->_areaDesign = (string)Mage::getConfig()->getNode(
- $this->_currentArea . '/' . Mage_Core_Model_Design_Package::XML_PATH_THEME
- ) ?: 'default/default/default'; // always override frontend theme
-
Mage::dispatchEvent('adminhtml_controller_action_predispatch_start', array());
parent::preDispatch();
$_isValidFormKey = true;
@@ -396,7 +396,7 @@ public function moveAction()
$this->getResponse()->setBody($e->getMessage());
}
catch (Exception $e){
- $this->getResponse()->setBody(Mage::helper('Mage_Catalog_Helper_Data')->__('Category move error'.$e));
+ $this->getResponse()->setBody(Mage::helper('Mage_Catalog_Helper_Data')->__('Category move error %s', $e));
Mage::logException($e);
}
@@ -339,7 +339,6 @@ public function indexAction()
public function reorderAction()
{
-// $this->_initSession();
$this->_getSession()->clear();
$orderId = $this->getRequest()->getParam('order_id');
$order = Mage::getModel('Mage_Sales_Model_Order')->load($orderId);
@@ -496,7 +495,11 @@ public function saveAction()
$this->_getSession()->clear();
Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess($this->__('The order has been created.'));
- $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
+ if (Mage::getSingleton('Mage_Admin_Model_Session')->isAllowed('sales/order/actions/view')) {
+ $this->_redirect('*/sales_order/view', array('order_id' => $order->getId()));
+ } else {
+ $this->_redirect('*/sales_order/index');
+ }
} catch (Mage_Payment_Model_Info_Exception $e) {
$this->_getOrderCreateModel()->saveQuote();
$message = $e->getMessage();
@@ -527,6 +530,7 @@ protected function _isAllowed()
$action = strtolower($this->getRequest()->getActionName());
switch ($action) {
case 'index':
+ case 'save':
$aclResource = 'sales/order/actions/create';
break;
case 'reorder':
@@ -535,9 +539,6 @@ protected function _isAllowed()
case 'cancel':
$aclResource = 'sales/order/actions/cancel';
break;
- case 'save':
- $aclResource = 'sales/order/actions/edit';
- break;
default:
$aclResource = 'sales/order/actions';
break;
@@ -68,7 +68,7 @@
</reference>
<reference name="js">
<block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Js" template="catalog/product/js.phtml" name="catalog_product_js"></block>
- <block type="Mage_Core_Block_Template" name="catalog.wysiwyg.js" template="MAge_Adminhtml::catalog/wysiwyg/js.phtml"/>
+ <block type="Mage_Core_Block_Template" name="catalog.wysiwyg.js" template="Mage_Adminhtml::catalog/wysiwyg/js.phtml"/>
</reference>
</adminhtml_catalog_product_edit>
@@ -34,7 +34,11 @@
<link rel="icon" href="<?php echo $this->getSkinUrl('Mage_Page::favicon.ico'); ?>" type="image/x-icon" />
<link rel="shortcut icon" href="<?php echo $this->getSkinUrl('Mage_Page::favicon.ico'); ?>" type="image/x-icon" />
- <script type="text/javascript" src="<?php echo $this->getJsUrl() ?>index.php/x.js?f=prototype/prototype.js,prototype/validation.js,mage/adminhtml/events.js,mage/adminhtml/form.js,scriptaculous/effects.js"></script>
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('prototype/prototype.js'); ?>"></script>
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('prototype/validation.js'); ?>"></script>
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/adminhtml/events.js'); ?>"></script>
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('mage/adminhtml/form.js'); ?>"></script>
+ <script type="text/javascript" src="<?php echo $this->getSkinUrl('scriptaculous/effects.js'); ?>"></script>
<!--[if IE]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('iestyles.css'); ?>" type="text/css" media="all" /> <![endif]-->
<!--[if lt IE 7]> <link rel="stylesheet" href="<?php echo $this->getSkinUrl('below_ie7.css'); ?>" type="text/css" media="all" /> <![endif]-->
@@ -287,7 +287,7 @@ public function call($sessionId, $apiPath, $args = array())
throw new Mage_Api_Exception('resource_path_not_callable');
}
- if (method_exists(&$model, $method)) {
+ if (method_exists($model, $method)) {
if (isset($methodInfo->arguments) && ((string)$methodInfo->arguments) == 'array') {
return $model->$method((is_array($args) ? $args : array($args)));
} elseif (!is_array($args)) {
@@ -400,7 +400,7 @@ public function multiCall($sessionId, array $calls = array(), $options = array()
throw new Mage_Api_Exception('resource_path_not_callable');
}
- if (method_exists(&$model, $method)) {
+ if (method_exists($model, $method)) {
if (isset($methodInfo->arguments) && ((string)$methodInfo->arguments) == 'array') {
$result[] = $model->$method((is_array($args) ? $args : array($args)));
} elseif (!is_array($args)) {
@@ -224,9 +224,9 @@ public function getErrors()
$errors = array();
$helper = Mage::helper('Mage_Eav_Helper_Data');
$requiredAttrs = array();
- $isRequiredRE = '/^' . str_replace('%s', '(.+)', preg_quote($helper->__('"%s" is a required value.'))). '$/';
+ $isRequiredRE = '/^' . str_replace('%s', '(.+)', preg_quote(Mage::helper('Mage_Eav_Helper_Data')->__('"%s" is a required value.'))) . '$/';
$greaterThanRE = '/^' . str_replace(
- '%s', '(.+)', preg_quote($helper->__('"%s" length must be equal or greater than %s characters.'))
+ '%s', '(.+)', preg_quote(Mage::helper('Mage_Eav_Helper_Data')->__('"%s" length must be equal or greater than %s characters.'))
) . '$/';
// find all required attributes labels
@@ -536,7 +536,7 @@ protected function _authOrder(Mage_Sales_Model_Order $order)
$payment->addTransaction(Mage_Sales_Model_Order_Payment_Transaction::TYPE_AUTH);
- // Set transaction apporval message
+ // Set transaction approval message
$message = Mage::helper('Mage_Authorizenet_Helper_Data')->__(
'Amount of %s approved by payment gateway. Transaction ID: "%s".',
$order->getBaseCurrency()->formatTxt($payment->getBaseAmountAuthorized()),
@@ -25,25 +25,26 @@
*/
/**
- * @see Mage_Authorizenet_Block_Directpost_Iframe
+ * @var $this Mage_Authorizenet_Block_Directpost_Iframe
*/
?>
<?php
$_params = $this->getParams();
+/* @var $_helper Mage_Authorizenet_Helper_Data */
$_helper = $this->helper('Mage_Authorizenet_Helper_Data');
?>
<html>
<head>
<script type="text/javascript">
//<![CDATA[
<?php if (isset($_params['redirect'])): ?>
-window.location="<?php echo $_params['redirect'] ?>";
+window.location="<?php echo $this->escapeUrl($_params['redirect']) ?>";
<?php endif; ?>
<?php if (isset($_params['redirect_parent'])): ?>
-window.top.location="<?php echo $_params['redirect_parent'] ?>";
+window.top.location="<?php echo $this->escapeUrl($_params['redirect_parent']) ?>";
<?php endif; ?>
<?php if (isset($_params['error_msg'])): ?>
-window.top.directPostModel.showError("<?php echo $_params['error_msg'] ?>");
+window.top.directPostModel.showError(<?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode($_params['error_msg']) ?>);
<?php if (isset($_params['x_invoice_num'])): ?>
window.top.directPostModel.successUrl="<?php echo $_helper->getSuccessOrderUrl($_params) ?>";
<?php endif; ?>
@@ -25,25 +25,26 @@
*/
/**
- * @see Mage_Authorizenet_Block_Directpost_Iframe
+ * @var $this Mage_Authorizenet_Block_Directpost_Iframe
*/
?>
<?php
$_params = $this->getParams();
+/* @var $_helper Mage_Authorizenet_Helper_Data */
$_helper = $this->helper('Mage_Authorizenet_Helper_Data');
?>
<html>
<head>
<script type="text/javascript">
//<![CDATA[
<?php if (isset($_params['redirect'])): ?>
-window.location="<?php echo $_params['redirect'] ?>";
+window.location="<?php echo $this->escapeUrl($_params['redirect']) ?>";
<?php endif; ?>
<?php if (isset($_params['redirect_parent'])): ?>
-window.top.location="<?php echo $_params['redirect_parent'] ?>";
+window.top.location="<?php echo $this->escapeUrl($_params['redirect_parent']) ?>";
<?php endif; ?>
<?php if (isset($_params['error_msg'])): ?>
-window.top.directPostModel.showError("<?php echo $_params['error_msg'] ?>");
+window.top.directPostModel.showError(<?php echo $this->helper('Mage_Core_Helper_Data')->jsonEncode($_params['error_msg']) ?>);
<?php if (isset($_params['x_invoice_num'])): ?>
window.top.directPostModel.successUrl="<?php echo $_helper->getSuccessOrderUrl($_params) ?>";
<?php endif; ?>
@@ -62,10 +62,10 @@ class Mage_Backup_Helper_Data extends Mage_Core_Helper_Abstract
public function getBackupTypes()
{
return array(
- self::TYPE_DB => self::__('Database'),
- self::TYPE_MEDIA => self::__('Database and Media'),
- self::TYPE_SYSTEM_SNAPSHOT => self::__('System'),
- self::TYPE_SNAPSHOT_WITHOUT_MEDIA => self::__('System (excluding Media)')
+ self::TYPE_DB => $this->__('Database'),
+ self::TYPE_MEDIA => $this->__('Database and Media'),
+ self::TYPE_SYSTEM_SNAPSHOT => $this->__('System'),
+ self::TYPE_SNAPSHOT_WITHOUT_MEDIA => $this->__('System (excluding Media)')
);
}
@@ -52,9 +52,10 @@ public function getTierPrices($product = null)
if (is_array($prices)) {
$store = Mage::app()->getStore();
$helper = Mage::helper('Mage_Tax_Helper_Data');
- $specialPrice = $product->getSpecialPrice() ? 100 - $product->getSpecialPrice() : 0;
+ $specialPrice = $product->getSpecialPrice();
+ $defaultDiscount = max($product->getGroupPrice(), $specialPrice ? 100 - $specialPrice : 0);
foreach ($prices as $price) {
- if ($specialPrice < $price['price']) {
+ if ($defaultDiscount < $price['price']) {
$price['price_qty'] += 0;
$price['savePercent'] = ceil(100 - $price['price']);
@@ -227,7 +227,8 @@ protected function _renderCategoryMenuItemHtml($category, $level = 0, $isLast =
$html = array();
// get all children
- if (Mage::helper('Mage_Catalog_Helper_Category_Flat')->isEnabled()) {
+ // If Flat Data enabled then use it but only on frontend
+ if (Mage::helper('Mage_Catalog_Helper_Category_Flat')->isAvailable() && !Mage::app()->getStore()->isAdmin()) {
$children = (array)$category->getChildrenNodes();
$childrenCount = count($children);
} else {
@@ -362,34 +363,33 @@ public function drawOpenCategoryItem($category) {
return $html;
}
- $html.= '<li';
+ $html .= '<li';
if ($this->isCategoryActive($category)) {
- $html.= ' class="active"';
+ $html .= ' class="active"';
}
- $html.= '>'."\n";
- $html.= '<a href="'.$this->getCategoryUrl($category).'">'
- . '<span>'.$this->escapeHtml($category->getName()).'</span></a>'."\n";
+ $html .= '>' . "\n";
+ $html .= '<a href="'.$this->getCategoryUrl($category).'">'
+ . '<span>' . $this->escapeHtml($category->getName()) . '</span></a>' . "\n";
- if (in_array($category->getId(), $this->getCurrentCategoryPath())){
+ if (in_array($category->getId(), $this->getCurrentCategoryPath())) {
$children = $category->getChildren();
$hasChildren = $children && $children->count();
if ($hasChildren) {
$htmlChildren = '';
foreach ($children as $child) {
- $htmlChildren.= $this->drawOpenCategoryItem($child);
+ $htmlChildren .= $this->drawOpenCategoryItem($child);
}
if (!empty($htmlChildren)) {
- $html.= '<ul>'."\n"
- .$htmlChildren
- .'</ul>';
+ $html .= '<ul>' . "\n" . $htmlChildren . '</ul>';
}
}
}
- $html.= '</li>'."\n";
+ $html .= '</li>'."\n";
+
return $html;
}
@@ -31,44 +31,63 @@
* @package Mage_Catalog
* @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Catalog_Helper_Category_Flat extends Mage_Core_Helper_Abstract
+class Mage_Catalog_Helper_Category_Flat extends Mage_Catalog_Helper_Flat_Abstract
{
+ /**
+ * Catalog Category Flat Is Enabled Config
+ */
const XML_PATH_IS_ENABLED_FLAT_CATALOG_CATEGORY = 'catalog/frontend/flat_catalog_category';
/**
- * Return true if flat catalog is enabled, rebuileded and is not Admin
+ * Catalog Flat Category index process code
+ */
+ const CATALOG_CATEGORY_FLAT_PROCESS_CODE = 'catalog_category_flat';
+
+ /**
+ * Catalog Category Flat index process code
+ *
+ * @var string
+ */
+ protected $_indexerCode = self::CATALOG_CATEGORY_FLAT_PROCESS_CODE;
+
+ /**
+ * Store catalog Category Flat index process instance
+ *
+ * @var Mage_Index_Model_Process|null
+ */
+ protected $_process = null;
+
+ /**
+ * Check if Catalog Category Flat Data is enabled
+ *
+ * @param bool $skipAdminCheck this parameter is deprecated and no longer in use
*
- * @param boolean $skipAdmin
- * @return boolean
+ * @return bool
*/
public function isEnabled($skipAdminCheck = false)
{
- $flatFlag = Mage::getStoreConfigFlag(self::XML_PATH_IS_ENABLED_FLAT_CATALOG_CATEGORY);
- $isFront = !Mage::app()->getStore()->isAdmin();
- if ($skipAdminCheck === true) {
- $isFront = true;
- }
-
- return (boolean) $flatFlag && $isFront;
+ return Mage::getStoreConfigFlag(self::XML_PATH_IS_ENABLED_FLAT_CATALOG_CATEGORY);
}
/**
- * Return true if catalog category flat data rebuilt
+ * Check if Catalog Category Flat Data has been initialized
*
- * @return boolean
+ * @return bool
*/
- public function isRebuilt()
+ public function isBuilt()
{
- return Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Category_Flat')->isRebuilt();
+ return Mage::getResourceSingleton('Mage_Catalog_Model_Resource_Category_Flat')->isBuilt();
}
/**
- * Back Flat compatibility: check is built and enabled flat
+ * Check if Catalog Category Flat Data has been initialized
+ *
+ * @deprecated after 1.7.0.0 use Mage_Catalog_Helper_Category_Flat::isBuilt() instead
*
* @return bool
*/
- public function isBuilt()
+ public function isRebuilt()
{
- return $this->isEnabled(true);
+ return $this->isBuilt();
}
}
Oops, something went wrong.

0 comments on commit af7068a

Please sign in to comment.