Skip to content

Commit

Permalink
Update as of 10/09/2012
Browse files Browse the repository at this point in the history
* Performance Testing Framework improvements:
  * Added ability to specify fixtures per scenario
  * Implemented Magento application cleanup between scenarios
  * Implemented support of PHP scenarios. The framework distinguishes type of the scenario by its extension: `jmx` or `php`
  * Added ability to skip warm-up for a certain scenario
  * JMeter scenarios are run with `jmeter` command instead of `java -jar ApacheJmeter.jar`. It's impossible to specify path to JMeter tool now, it should be accessible from command line as `jmeter`
* Implemented fixture for Performance Tests with 80k products distributed among 200 categories
* Tax rule management UI simplified:
  * Added `Jeditable` jQuery library
  * Added multiselect fields for customer tax class, product tax class and tax rate
  * Added ability to add/edit Tax Rate directly from Tax Rule page
* Simplified product creation workflow:
  * Added product types dropdown to "Add Product" button. Default attribute set is used for product creation
  * "Add Product" button opens form for Simple product with Default attribute set
  * Attribute set can be changed from product creation form
* Implemented auto-generation of product SKU and meta fields. The templates can be configured in `System -> Configuration -> Catalog -> Catalog -> Product Fields Auto-Generation`
* Added ability to unassign system attribute from an attribute set, if it's not "Minimal" one
* Specified UI IDs for base Backend elements. UI ID is represented as HTML "id" attribute intended to identify certain HTML element
* Refactored `Catalog_Model_Product_Indexer_Flat::matchEvent()` method - reduced cyclomatic complexity
* Updated DB structure to make possible to store Themes' and Widgets' layout updates
* Migration to jQuery:
  * Replaced Ajax, Dialog and Template mechanisms with jQuery analogs
  * Added jQuery loader for translation process
  * Migrated Inline-Translator to jQuery
* JavaScript improvements:
  * Implemented `editTrigger` jQuery widget intended to display "Edit" button for elements it is attached to
* Fixes:
  * Incorrect title for "Currency Symbols" page on Backend
  * References to website, store and store view aren't displayed on Backend, if Single Store mode is disabled
  * "Store" column and dropdown are displayed on `System -> Import/Export -> DataFlow-Profiles` page, when Single Store mode is enabled
  * Options are absent for `'tax_class_id'` product attribute
  * No exception/error message is produced, when attempting to commit/rollback asymmetric DB transaction
  * Links are not copied during downloadable product duplication
  * PayPal tab is absent in `System -> Configuration -> Sales` section
  * "Edit" link in wishlist opens Product View page instead of "Configure Product" page
  * Default value for a product attribute is not saved
  * Escaped HTML blocks with `Mage_Core_Helper_Data::jsonEncode`, where necessary
  * Impossible to add new Dataflow profile
  * Impossible to specify default option for new product attribute with "dropdown" type
  * Unable to send the email when creating new invoice/shipment/credit memo
  * "Segmentation Fault" in Integration tests
* GitHub requests:
  * [#36](#36) -- added ability to force set of "Include Tax" option for catalog prices
  * [#63](#63) -- removed obsolete "args" node in event subscribers
  * [#64](#64) -- fixed EAV text attribute validation for "0" value
  * [#72](#72) -- fixed collecting shipping totals for case, when previous invoice value is 0
  • Loading branch information
magento-team committed Oct 9, 2012
1 parent 215c077 commit 72f1ee6
Show file tree
Hide file tree
Showing 803 changed files with 81,551 additions and 73,699 deletions.
49 changes: 49 additions & 0 deletions CHANGELOG.markdown
Original file line number Diff line number Diff line change
@@ -1,3 +1,52 @@
Update as of 10/09/2012
======================
* Performance Testing Framework improvements:
* Added ability to specify fixtures per scenario
* Implemented Magento application cleanup between scenarios
* Implemented support of PHP scenarios. The framework distinguishes type of the scenario by its extension: `jmx` or `php`
* Added ability to skip warm-up for a certain scenario
* JMeter scenarios are run with `jmeter` command instead of `java -jar ApacheJmeter.jar`. It's impossible to specify path to JMeter tool now, it should be accessible from command line as `jmeter`
* Implemented fixture for Performance Tests with 80k products distributed among 200 categories
* Tax rule management UI simplified:
* Added `Jeditable` jQuery library
* Added multiselect fields for customer tax class, product tax class and tax rate
* Added ability to add/edit Tax Rate directly from Tax Rule page
* Simplified product creation workflow:
* Added product types dropdown to "Add Product" button. Default attribute set is used for product creation
* "Add Product" button opens form for Simple product with Default attribute set
* Attribute set can be changed from product creation form
* Implemented auto-generation of product SKU and meta fields. The templates can be configured in `System -> Configuration -> Catalog -> Catalog -> Product Fields Auto-Generation`
* Added ability to unassign system attribute from an attribute set, if it's not "Minimal" one
* Specified UI IDs for base Backend elements. UI ID is represented as HTML "id" attribute intended to identify certain HTML element
* Refactored `Catalog_Model_Product_Indexer_Flat::matchEvent()` method - reduced cyclomatic complexity
* Updated DB structure to make possible to store Themes' and Widgets' layout updates
* Migration to jQuery:
* Replaced Ajax, Dialog and Template mechanisms with jQuery analogs
* Added jQuery loader for translation process
* Migrated Inline-Translator to jQuery
* JavaScript improvements:
* Implemented `editTrigger` jQuery widget intended to display "Edit" button for elements it is attached to
* Fixes:
* Incorrect title for "Currency Symbols" page on Backend
* References to website, store and store view aren't displayed on Backend, if Single Store mode is disabled
* "Store" column and dropdown are displayed on `System -> Import/Export -> DataFlow-Profiles` page, when Single Store mode is enabled
* Options are absent for `'tax_class_id'` product attribute
* No exception/error message is produced, when attempting to commit/rollback asymmetric DB transaction
* Links are not copied during downloadable product duplication
* PayPal tab is absent in `System -> Configuration -> Sales` section
* "Edit" link in wishlist opens Product View page instead of "Configure Product" page
* Default value for a product attribute is not saved
* Escaped HTML blocks with `Mage_Core_Helper_Data::jsonEncode`, where necessary
* Impossible to add new Dataflow profile
* Impossible to specify default option for new product attribute with "dropdown" type
* Unable to send the email when creating new invoice/shipment/credit memo
* "Segmentation Fault" in Integration tests
* GitHub requests:
* [#36](https://github.com/magento/magento2/pull/36) -- added ability to force set of "Include Tax" option for catalog prices
* [#63](https://github.com/magento/magento2/pull/63) -- removed obsolete "args" node in event subscribers
* [#64](https://github.com/magento/magento2/pull/64) -- fixed EAV text attribute validation for "0" value
* [#72](https://github.com/magento/magento2/pull/72) -- fixed collecting shipping totals for case, when previous invoice value is 0

Update as of 9/27/2012
======================
* Refactoring Magento 2 to use jQuery instead of Prototype:
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @package Mage_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
* @deprecated Moved to module Mage_Backend
*/
*/
class Mage_Adminhtml_Block_Abstract extends Mage_Backend_Block_Abstract
{

Expand Down
50 changes: 19 additions & 31 deletions app/code/core/Mage/Adminhtml/Block/Api/Buttons.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,40 +35,28 @@ public function __construct()

protected function _prepareLayout()
{
$this->setChild('backButton',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Back'),
'onclick' => 'window.location.href=\''.$this->getUrl('*/*/').'\'',
'class' => 'back'
))
);
$this->addChild('backButton', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Back'),
'onclick' => 'window.location.href=\''.$this->getUrl('*/*/').'\'',
'class' => 'back'
));

$this->setChild('resetButton',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Reset'),
'onclick' => 'window.location.reload()'
))
);
$this->addChild('resetButton', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Reset'),
'onclick' => 'window.location.reload()'
));

$this->setChild('saveButton',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save Role'),
'onclick' => 'roleForm.submit();return false;',
'class' => 'save'
))
);
$this->addChild('saveButton', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Save Role'),
'onclick' => 'roleForm.submit();return false;',
'class' => 'save'
));

$this->setChild('deleteButton',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete Role'),
'onclick' => 'deleteConfirm(\'' . Mage::helper('Mage_Adminhtml_Helper_Data')->__('Are you sure you want to do this?') . '\', \'' . $this->getUrl('*/*/delete', array('rid' => $this->getRequest()->getParam('rid'))) . '\')',
'class' => 'delete'
))
);
$this->addChild('deleteButton', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Adminhtml_Helper_Data')->__('Delete Role'),
'onclick' => 'deleteConfirm(\'' . Mage::helper('Mage_Adminhtml_Helper_Data')->__('Are you sure you want to do this?') . '\', \'' . $this->getUrl('*/*/delete', array('rid' => $this->getRequest()->getParam('rid'))) . '\')',
'class' => 'delete'
));
return parent::_prepareLayout();
}

Expand Down
45 changes: 17 additions & 28 deletions app/code/core/Mage/Adminhtml/Block/Backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,35 +43,24 @@ class Mage_Adminhtml_Block_Backup extends Mage_Adminhtml_Block_Template
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->setChild('createButton',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Database Backup'),
'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_DB . "')",
'class' => 'task'
))
);
$this->setChild('createSnapshotButton',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Backup_Helper_Data')->__('System Backup'),
'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT . "')",
'class' => ''
))
);
$this->setChild('createMediaBackupButton',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Database and Media Backup'),
'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_MEDIA . "')",
'class' => ''
))
);
$this->setChild('backupsGrid',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Backup_Grid')
);
$this->addChild('createButton', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Database Backup'),
'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_DB . "')",
'class' => 'task'
));
$this->addChild('createSnapshotButton', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Backup_Helper_Data')->__('System Backup'),
'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_SYSTEM_SNAPSHOT . "')",
'class' => ''
));
$this->addChild('createMediaBackupButton', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Backup_Helper_Data')->__('Database and Media Backup'),
'onclick' => "return backup.backup('" . Mage_Backup_Helper_Data::TYPE_MEDIA . "')",
'class' => ''
));
$this->addChild('backupsGrid', 'Mage_Adminhtml_Block_Backup_Grid');

$this->setChild('dialogs', $this->getLayout()->createBlock('Mage_Adminhtml_Block_Backup_Dialogs'));
$this->addChild('dialogs', 'Mage_Adminhtml_Block_Backup_Dialogs');
}

public function getCreateButtonHtml()
Expand Down
37 changes: 14 additions & 23 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Category/Edit/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,38 +57,29 @@ protected function _prepareLayout()

// Save button
if (!$category->isReadonly()) {
$this->setChild('save_button',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save Category'),
'onclick' => "categorySubmit('" . $this->getSaveUrl() . "', true)",
'class' => 'save'
))
);
$this->addChild('save_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Save Category'),
'onclick' => "categorySubmit('" . $this->getSaveUrl() . "', true)",
'class' => 'save'
));
}

// Delete button
if (!in_array($categoryId, $this->getRootIds()) && $category->isDeleteable()) {
$this->setChild('delete_button',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Delete Category'),
'onclick' => "categoryDelete('" . $this->getUrl('*/*/delete', array('_current' => true)) . "', true, {$categoryId})",
'class' => 'delete'
))
);
$this->addChild('delete_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Delete Category'),
'onclick' => "categoryDelete('" . $this->getUrl('*/*/delete', array('_current' => true)) . "', true, {$categoryId})",
'class' => 'delete'
));
}

// Reset button
if (!$category->isReadonly()) {
$resetPath = $categoryId ? '*/*/edit' : '*/*/add';
$this->setChild('reset_button',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Reset'),
'onclick' => "categoryReset('".$this->getUrl($resetPath, array('_current'=>true))."',true)"
))
);
$this->addChild('reset_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Reset'),
'onclick' => "categoryReset('".$this->getUrl($resetPath, array('_current'=>true))."',true)"
));
}

return parent::_prepareLayout();
Expand Down
3 changes: 2 additions & 1 deletion app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tabs.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ protected function _prepareLayout()
}

$active = $defaultGroupId == $group->getId();
$block = $this->getLayout()->createBlock($this->getAttributeTabBlock(), '')
$block = $this->getLayout()->createBlock($this->getAttributeTabBlock(), $this->getNameInLayout() . '_tab_'
. $group->getAttributeGroupName())
->setGroup($group)
->setAttributes($attributes)
->setAddHiddenFields($active)
Expand Down
32 changes: 13 additions & 19 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,27 +53,21 @@ protected function _prepareLayout()
'_query' => false
));

$this->setChild('add_sub_button',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Subcategory'),
'onclick' => "addNew('".$addUrl."', false)",
'class' => 'add',
'id' => 'add_subcategory_button',
'style' => $this->canAddSubCategory() ? '' : 'display: none;'
))
);
$this->addChild('add_sub_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Subcategory'),
'onclick' => "addNew('".$addUrl."', false)",
'class' => 'add',
'id' => 'add_subcategory_button',
'style' => $this->canAddSubCategory() ? '' : 'display: none;'
));

if ($this->canAddRootCategory()) {
$this->setChild('add_root_button',
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Button')
->setData(array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Root Category'),
'onclick' => "addNew('".$addUrl."', true)",
'class' => 'add',
'id' => 'add_root_category_button'
))
);
$this->addChild('add_root_button', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Root Category'),
'onclick' => "addNew('".$addUrl."', true)",
'class' => 'add',
'id' => 'add_root_category_button'
));
}

$this->setChild('store_switcher',
Expand Down
15 changes: 12 additions & 3 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,22 @@ class Mage_Adminhtml_Block_Catalog_Form extends Mage_Adminhtml_Block_Widget_Form
protected function _prepareLayout()
{
Varien_Data_Form::setElementRenderer(
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Form_Renderer_Element')
$this->getLayout()->createBlock(
'Mage_Adminhtml_Block_Widget_Form_Renderer_Element',
$this->getNameInLayout() . '_element'
)
);
Varien_Data_Form::setFieldsetRenderer(
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset')
$this->getLayout()->createBlock(
'Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset',
$this->getNameInLayout() . '_fieldset'
)
);
Varien_Data_Form::setFieldsetElementRenderer(
$this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element')
$this->getLayout()->createBlock(
'Mage_Adminhtml_Block_Catalog_Form_Renderer_Fieldset_Element',
$this->getNameInLayout() . '_fieldset_element'
)
);
}
}
47 changes: 40 additions & 7 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ public function __construct()
protected function _prepareLayout()
{
$this->_addButton('add_new', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Product'),
'onclick' => "setLocation('{$this->getUrl('*/*/new')}')",
'class' => 'add'
'id' => 'add_new_product',
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Add Product'),
'class' => 'btn-add',
'class_name' => 'Mage_Backend_Block_Widget_Button_Split',
'options' => $this->_getAddProductButtonOptions()
));

$this->setChild(
Expand All @@ -62,6 +64,40 @@ protected function _prepareLayout()
return parent::_prepareLayout();
}

/**
* Retrieve options for 'Add Product' split button
*
* @return array
*/
protected function _getAddProductButtonOptions()
{
$splitButtonOptions = array();

foreach (Mage::getModel('Mage_Catalog_Model_Product_Type')->getOptionArray() as $key => $label) {
$splitButtonOptions[$key] = array(
'label' => $label,
'onclick' => "setLocation('" . $this->_getProductCreateUrl($key) . "')",
'default' => Mage_Catalog_Model_Product_Type::DEFAULT_TYPE == $key
);
}

return $splitButtonOptions;
}

/**
* Retrieve product create url by specified product type
*
* @param string $type
* @return string
*/
protected function _getProductCreateUrl($type)
{
return $this->getUrl('*/*/new', array(
'set' => Mage::getModel('Mage_Catalog_Model_Product')->getDefaultAttributeSetId(),
'type' => $type
));
}

/**
* Render grid
*
Expand All @@ -79,9 +115,6 @@ public function getGridHtml()
*/
public function isSingleStoreMode()
{
if (!Mage::app()->isSingleStoreMode()) {
return false;
}
return true;
return Mage::app()->isSingleStoreMode();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,22 @@
class Mage_Adminhtml_Block_Catalog_Product_Attribute_Edit_Tab_Options
extends Mage_Eav_Block_Adminhtml_Attribute_Edit_Options_Abstract
{
/**
* Retrieve option values collection
* It is represented by an array in case of system attribute
*
* @param Mage_Eav_Model_Entity_Attribute_Abstract $attribute
* @return array|Mage_Eav_Model_Resource_Entity_Attribute_Option_Collection
*/
protected function _getOptionValuesCollection(Mage_Eav_Model_Entity_Attribute_Abstract $attribute)
{
if ($this->canManageOptionDefaultOnly()) {
$options = Mage::getModel($attribute->getSourceModel())
->setAttribute($attribute)
->getAllOptions(true);
return array_reverse($options);
} else {
return parent::_getOptionValuesCollection($attribute);
}
}
}
Loading

0 comments on commit 72f1ee6

Please sign in to comment.