Skip to content
Browse files

2.0.0.0-dev34

* Test Framework:
  * Created `CodingStandard_ToolInterface` - new interface for coding standard static tests. Refactored `CodeSniffer` class as an implementation of the interface
  * Fixed DB isolation in integration tests after themes refactoring
  * Minor test fixes
* Changes in product creation process
  * Added ability to change product type "on the fly" depending on selected options
  * Added ability of new category creation on "General" tab
  * Moved "Associated Products" tab contents to collapsible block on "General" tab for configurable products
  * Visual enhancement made for base image and Virtual/Downloadable checkbox
  * Refactored implementation of associated products in backend (admin) to make them configurable through grid layout, rather than hard-coded.
  * Enhanced product variation matrix for configurable products
  * Changed "Apply To" feature in product attributes management due to changes in product creation process
* Fixed XSS vulnerabilities in `Mage_Wishlist_IndexController`, `Mage_Adminhtml_Block_Review_Edit_Form`, `Mage_Catalog_Product_CompareController`
* Bug fixes
  * Fixed error on `Catalog -> Google Content -> Manage Items page`
  * Fixed bug with "Update Attributes" mass action for products on backend caused by setting incorrect inheritance of `Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute`
  * Added additional validation of "quantity" field to fix issues with inventory during product saving
  * Added additional validation into `EAV` models to forbid creation of two products with the same unique multi-select attribute
  • Loading branch information...
1 parent 71f6961 commit 975952e5466659bd685c7a1d1af08b2752485ff3 @magento-team magento-team committed Dec 6, 2012
Showing with 4,999 additions and 1,421 deletions.
  1. +21 −0 CHANGELOG.markdown
  2. +4 −3 app/Mage.php
  3. +3 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php
  4. +2 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php
  5. +34 −3 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
  6. +9 −1 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php
  7. +85 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/NewCategory.php
  8. +75 −40 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
  9. +0 −312 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php
  10. +20 −36 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php
  11. +2 −7 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php
  12. +9 −28 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Category.php
  13. +88 −0 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight/Renderer.php
  14. +3 −1 app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php
  15. +1 −1 app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php
  16. +28 −15 app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php
  17. +4 −0 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php
  18. +39 −24 app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
  19. +141 −30 app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml
  20. +61 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/base-image-uploader.css
  21. +2 −2 ...re/Mage/Adminhtml/view/adminhtml/catalog/{jquery.base-image-uploader.js → base-image-uploader.js}
  22. +4 −3 ...core/Mage/Adminhtml/view/adminhtml/catalog/{jquery.category-selector.css → category-selector.css}
  23. +44 −26 ...e/core/Mage/Adminhtml/view/adminhtml/catalog/{jquery.category-selector.js → category-selector.js}
  24. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/category/edit.js
  25. +6 −6 ...Mage/Adminhtml/view/adminhtml/catalog/{jquery.base-image-uploader.css → configurable-product.css}
  26. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/form/renderer/fieldset/element.phtml
  27. +2 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product.js
  28. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/change_attribute_set_widget.phtml
  29. +11 −2 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit.phtml
  30. +31 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/category/new/form.phtml
  31. +210 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/category/new/js.phtml
  32. +2 −2 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/options/option.phtml
  33. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/group.phtml
  34. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/price/tier.phtml
  35. +189 −41 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/edit/super/config.phtml
  36. +4 −3 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/product/tab/inventory.phtml
  37. +112 −0 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/type-switcher.js
  38. +1 −1 app/code/core/Mage/Adminhtml/view/adminhtml/cms/browser/content/uploader.phtml
  39. +3 −3 app/code/core/Mage/Adminhtml/view/adminhtml/css/ui-lightness/jquery-ui-1.8.21.custom.css
  40. +2 −0 app/code/core/Mage/Backend/Block/Widget/Grid/ColumnSet.php
  41. +1 −0 app/code/core/Mage/Backend/view/adminhtml/widget/form.phtml
  42. +9 −0 app/code/core/Mage/Bundle/Model/Product/Type.php
  43. +157 −0 app/code/core/Mage/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php
  44. +11 −1 app/code/core/Mage/Catalog/Helper/Product.php
  45. +31 −6 app/code/core/Mage/Catalog/Model/Observer.php
  46. +6 −2 app/code/core/Mage/Catalog/Model/Product.php
  47. +5 −3 app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Stock.php
  48. +28 −8 app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php
  49. +47 −38 app/code/core/Mage/Catalog/Model/Product/Type/Configurable.php
  50. +27 −0 app/code/core/Mage/Catalog/Model/Product/Type/Configurable/Attribute.php
  51. +19 −0 app/code/core/Mage/Catalog/Model/Product/Type/Grouped.php
  52. +8 −0 app/code/core/Mage/Catalog/Model/Product/Type/Simple.php
  53. +19 −0 app/code/core/Mage/Catalog/Model/Product/Type/Virtual.php
  54. +128 −0 app/code/core/Mage/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php
  55. +71 −0 app/code/core/Mage/Catalog/Model/Resource/Product/Collection/AssociatedProductUpdater.php
  56. +1 −3 app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable.php
  57. +31 −0 app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php
  58. +13 −3 app/code/core/Mage/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php
  59. +5 −4 app/code/core/Mage/Catalog/controllers/Product/CompareController.php
  60. +39 −0 app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.19-1.6.0.0.20.php
  61. +17 −1 app/code/core/Mage/Catalog/etc/config.xml
  62. +16 −10 app/code/core/Mage/CatalogInventory/Block/Adminhtml/Form/Field/Stock.php
  63. +14 −9 app/code/core/Mage/CatalogInventory/Model/Resource/Stock/Item.php
  64. +8 −1 app/code/core/Mage/CatalogInventory/etc/config.xml
  65. +42 −0 app/code/core/Mage/CatalogInventory/sql/cataloginventory_setup/upgrade-1.6.0.0.2-1.6.0.0.3.php
  66. +62 −0 app/code/core/Mage/CatalogInventory/view/adminhtml/layout.xml
  67. +1 −6 app/code/core/Mage/Cms/Model/Wysiwyg/Config.php
  68. +6 −6 app/code/core/Mage/Core/Block/Messages.php
  69. +53 −48 app/code/core/Mage/Core/Model/App.php
  70. +20 −15 app/code/core/Mage/Core/Model/Email/Template.php
  71. +1 −1 app/code/core/Mage/Core/Model/Layout/Merge.php
  72. +3 −0 app/code/core/Mage/Core/Model/Template.php
  73. +17 −0 app/code/core/Mage/Core/Model/Theme.php
  74. +6 −1 app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php
  75. +6 −1 app/code/core/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php
  76. +28 −0 app/code/core/Mage/Downloadable/Model/Observer.php
  77. +40 −2 app/code/core/Mage/Downloadable/Model/Product/Type.php
  78. +32 −0 app/code/core/Mage/Downloadable/data/downloadable_setup/data-upgrade-1.6.0.0.2-1.6.0.0.3.php
  79. +16 −1 app/code/core/Mage/Downloadable/etc/config.xml
  80. +5 −0 app/code/core/Mage/Downloadable/view/adminhtml/layout.xml
  81. +1 −1 app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/links.phtml
  82. +1 −1 app/code/core/Mage/Downloadable/view/adminhtml/product/edit/downloadable/samples.phtml
  83. +16 −0 app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Array.php
  84. +3 −1 app/code/core/Mage/GoogleShopping/Model/Resource/Item/Collection.php
  85. +6 −4 app/code/core/Mage/GoogleShopping/controllers/Adminhtml/Googleshopping/ItemsController.php
  86. +3 −3 app/code/core/Mage/Wishlist/controllers/IndexController.php
  87. +1 −0 app/design/adminhtml/default/basic/boxes.css
  88. +53 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Category/TreeTest.php
  89. +70 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/MainTest.php
  90. +43 −18 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/ConfigTest.php
  91. +8 −4 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/SettingsTest.php
  92. +51 −0 dev/tests/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/EditTest.php
  93. +89 −0 ...ts/integration/testsuite/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight/RendererTest.php
  94. +74 −0 dev/tests/integration/testsuite/Mage/Adminhtml/controllers/Catalog/CategoryControllerTest.php
  95. +53 −0 ...tegration/testsuite/Mage/Adminhtml/controllers/Catalog/Product/Action/AttributeControllerTest.php
  96. +117 −0 ...ests/integration/testsuite/Mage/Adminhtml/controllers/Catalog/Product/AttributeControllerTest.php
  97. +41 −0 dev/tests/integration/testsuite/Mage/Adminhtml/controllers/Catalog/Product/ReviewControllerTest.php
  98. +92 −0 dev/tests/integration/testsuite/Mage/Adminhtml/controllers/Catalog/ProductControllerTest.php
  99. +19 −22 dev/tests/integration/testsuite/Mage/Backend/Block/Widget/Grid/MassactionTest.php
  100. +39 −0 dev/tests/integration/testsuite/Mage/Backend/Block/_files/theme_registration.php
  101. +55 −0 ...stsuite/Mage/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSetTest.php
  102. +1 −1 dev/tests/integration/testsuite/Mage/Catalog/Block/Product/NewTest.php
  103. +6 −0 dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/AbstractTest.php
  104. +34 −18 dev/tests/integration/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php
  105. +62 −0 ...ts/integration/testsuite/Mage/Catalog/Model/Resource/Product/Collection/AssociatedProductTest.php
  106. +50 −0 dev/tests/integration/testsuite/Mage/Catalog/_files/product_associated.php
  107. +54 −67 dev/tests/integration/testsuite/Mage/Catalog/_files/product_configurable.php
  108. +46 −0 dev/tests/integration/testsuite/Mage/Catalog/_files/product_simple_xss.php
  109. +93 −62 dev/tests/integration/testsuite/Mage/Catalog/controllers/Product/CompareControllerTest.php
  110. +36 −0 dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/attribute_system.php
  111. +37 −0 ...ests/integration/testsuite/Mage/Catalog/controllers/_files/attribute_system_with_applyto_data.php
  112. +36 −0 dev/tests/integration/testsuite/Mage/Catalog/controllers/_files/attribute_user_defined.php
  113. +3 −7 dev/tests/integration/testsuite/Mage/Core/Model/Email/Template/FilterTest.php
  114. +7 −6 dev/tests/integration/testsuite/Mage/Core/Model/Email/TemplateTest.php
  115. +40 −0 dev/tests/integration/testsuite/Mage/Core/Model/Email/_files/theme_registration.php
  116. +5 −1 dev/tests/integration/testsuite/Mage/Core/Model/Layout/MergeTest.php
  117. +15 −0 dev/tests/integration/testsuite/Mage/Core/Model/LayoutArgumentTest.php
  118. +11 −3 dev/tests/integration/testsuite/Mage/Core/Model/LayoutTest.php
  119. +1 −0 dev/tests/integration/testsuite/Mage/Core/Model/ObserverTest.php
  120. +1 −1 dev/tests/integration/testsuite/Mage/Core/Utility/Theme.php
  121. +51 −0 ...n/testsuite/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinksTest.php
  122. +51 −0 ...testsuite/Mage/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/SamplesTest.php
  123. +75 −0 dev/tests/integration/testsuite/Mage/Downloadable/Model/Product/TypeTest.php
  124. +36 −0 ...ration/testsuite/Mage/GoogleShopping/controllers/Adminhtml/GoogleShopping/ItemsControllerTest.php
  125. +39 −0 dev/tests/integration/testsuite/Mage/Review/_files/review_xss.php
  126. +37 −2 dev/tests/integration/testsuite/Mage/Wishlist/controllers/IndexControllerTest.php
  127. +114 −0 dev/tests/static/framework/CodingStandard/Tool/CodeSniffer.php
  128. +44 −0 dev/tests/static/framework/CodingStandard/Tool/CodeSniffer/Wrapper.php
  129. +50 −0 dev/tests/static/framework/CodingStandard/ToolInterface.php
  130. +0 −107 dev/tests/static/framework/Inspection/CodeSniffer/Command.php
  131. +37 −0 dev/tests/static/framework/tests/unit/testsuite/CodingStandard/Tool/CodeSniffer/WrapperTest.php
  132. +85 −0 dev/tests/static/framework/tests/unit/testsuite/CodingStandard/Tool/CodeSnifferTest.php
  133. +0 −121 dev/tests/static/framework/tests/unit/testsuite/Inspection/CodeSniffer/CommandTest.php
  134. +1 −0 dev/tests/static/testsuite/Legacy/_files/obsolete_classes.php
  135. +4 −0 dev/tests/static/testsuite/Legacy/_files/obsolete_methods.php
  136. +8 −5 dev/tests/static/testsuite/Php/LiveCodeTest.php
  137. +5 −1 dev/tests/static/testsuite/Php/_files/whitelist/common.txt
  138. +79 −0 dev/tests/unit/testsuite/Mage/Adminhtml/Block/Catalog/Product/Edit/NewCategoryTest.php
  139. +70 −0 dev/tests/unit/testsuite/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight/RendererTest.php
  140. +0 −176 dev/tests/unit/testsuite/Mage/Adminhtml/controllers/Catalog/ProductControllerTest.php
  141. +44 −0 dev/tests/unit/testsuite/Mage/Bundle/Model/Product/TypeTest.php
  142. +80 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/ObserverTest.php
  143. +26 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Product/Attribute/Backend/StockTest.php
  144. +44 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Product/Type/ConfigurableTest.php
  145. +44 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Product/Type/GroupedTest.php
  146. +44 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Product/Type/SimpleTest.php
  147. +44 −0 dev/tests/unit/testsuite/Mage/Catalog/Model/Product/Type/VirtualTest.php
  148. +53 −0 ...ts/unit/testsuite/Mage/Catalog/Model/Resource/Product/Collection/AssociatedProductUpdaterTest.php
  149. +26 −0 dev/tests/unit/testsuite/Mage/Downloadable/Model/ObserverTest.php
  150. +44 −0 dev/tests/unit/testsuite/Mage/Downloadable/Model/Product/TypeTest.php
  151. +71 −0 dev/tests/unit/testsuite/Mage/Eav/Model/Entity/Attribute/Backend/ArrayTest.php
  152. +1 −18 dev/tools/migration/themes_view.php
  153. +1 −1 pub/lib/mage/adminhtml/grid.js
  154. +8 −2 pub/lib/mage/adminhtml/tabs.js
  155. +3 −0 pub/lib/prototype/validation.js
View
21 CHANGELOG.markdown
@@ -1,3 +1,24 @@
+2.0.0.0-dev34
+=============
+* Test Framework:
+ * Created `CodingStandard_ToolInterface` - new interface for coding standard static tests. Refactored `CodeSniffer` class as an implementation of the interface
+ * Fixed DB isolation in integration tests after themes refactoring
+ * Minor test fixes
+* Changes in product creation process
+ * Added ability to change product type "on the fly" depending on selected options
+ * Added ability of new category creation on "General" tab
+ * Moved "Associated Products" tab contents to collapsible block on "General" tab for configurable products
+ * Visual enhancement made for base image and Virtual/Downloadable checkbox
+ * Refactored implementation of associated products in backend (admin) to make them configurable through grid layout, rather than hard-coded.
+ * Enhanced product variation matrix for configurable products
+ * Changed "Apply To" feature in product attributes management due to changes in product creation process
+* Fixed XSS vulnerabilities in `Mage_Wishlist_IndexController`, `Mage_Adminhtml_Block_Review_Edit_Form`, `Mage_Catalog_Product_CompareController`
+* Bug fixes
+ * Fixed error on `Catalog -> Google Content -> Manage Items page`
+ * Fixed bug with "Update Attributes" mass action for products on backend caused by setting incorrect inheritance of `Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute`
+ * Added additional validation of "quantity" field to fix issues with inventory during product saving
+ * Added additional validation into `EAV` models to forbid creation of two products with the same unique multi-select attribute
+
2.0.0.0-dev33
=============
* Improved Themes functionality to meet the following requirements:
View
7 app/Mage.php
@@ -153,7 +153,7 @@ public static function getVersion()
{
$i = self::getVersionInfo();
return trim("{$i['major']}.{$i['minor']}.{$i['revision']}" . ($i['patch'] != '' ? ".{$i['patch']}" : "")
- . "-{$i['stability']}{$i['number']}", '.-');
+ . "-{$i['stability']}{$i['number']}", '.-');
}
/**
@@ -170,7 +170,7 @@ public static function getVersionInfo()
'revision' => '0',
'patch' => '0',
'stability' => 'dev',
- 'number' => '33',
+ 'number' => '34',
);
}
@@ -280,7 +280,7 @@ public static function setRoot($appRoot = '')
}
if ('' === $appRoot) {
- // automagically find application root by dirname of Mage.php
+ // automatically find application root by dirname of Mage.php
$appRoot = dirname(__FILE__);
}
@@ -896,6 +896,7 @@ public static function getIsDeveloperMode()
* Display exception
*
* @param Exception $e
+ * @param string $extra
*/
public static function printException(Exception $e, $extra = '')
{
View
3 app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php
@@ -34,6 +34,7 @@
*/
class Mage_Adminhtml_Block_Catalog_Category_Tree extends Mage_Adminhtml_Block_Catalog_Category_Abstract
{
+ const XML_PATH_SUGGESTED_CATEGORIES_LIMIT = 'global/catalog/suggested_categories/limit';
protected $_withProductCount;
@@ -119,7 +120,9 @@ public function getSuggestedCategoriesJson($namePart)
$matchingNamesCollection = clone $collection;
$matchingNamesCollection->addAttributeToFilter('name', array('like' => "%{$namePart}%"))
+ ->addAttributeToFilter('entity_id', array('neq' => Mage_Catalog_Model_Category::TREE_ROOT_ID))
->addAttributeToSelect('path')
+ ->setPageSize((string)Mage::getConfig()->getNode(self::XML_PATH_SUGGESTED_CATEGORIES_LIMIT))
->setStoreId($storeId);
$shownCategoriesIds = array();
View
3 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php
@@ -114,7 +114,8 @@ protected function _prepareForm()
'all' => Mage::helper('Mage_Catalog_Helper_Data')->__('All Product Types'),
'custom' => Mage::helper('Mage_Catalog_Helper_Data')->__('Selected Product Types')
),
- 'required' => true
+ 'required' => true,
+ 'disabled' => !$attributeObject->getIsUserDefined() && $attributeObject->getId(),
), 'frontend_class');
$fieldset->addField('is_configurable', 'select', array(
View
37 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit.php
@@ -217,11 +217,9 @@ public function getDuplicateUrl()
public function getHeader()
{
- $header = '';
if ($this->getProduct()->getId()) {
$header = $this->escapeHtml($this->getProduct()->getName());
- }
- else {
+ } else {
$header = Mage::helper('Mage_Catalog_Helper_Data')->__('New Product');
}
if ($setName = $this->getAttributeSetName()) {
@@ -277,4 +275,37 @@ public function getAttributesAllowedForAutogeneration()
{
return $this->helper('Mage_Catalog_Helper_Product')->getAttributesAllowedForAutogeneration();
}
+
+ /**
+ * Get data for JS (product type transition)
+ *
+ * @return string
+ */
+ public function getTypeSwitcherData()
+ {
+ return Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array(
+ 'tab_id' => 'product_info_tabs_downloadable_items',
+ 'is_virtual_id' => Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight_Renderer::VIRTUAL_FIELD_HTML_ID,
+ 'weight_id' => 'weight',
+ 'current_type' => $this->getProduct()->getTypeId(),
+ 'attributes' => $this->_getAttributes(),
+ ));
+ }
+
+ /**
+ * Get formed array with attribute codes and Apply To property
+ *
+ * @return array
+ */
+ protected function _getAttributes()
+ {
+ /** @var $product Mage_Catalog_Model_Product */
+ $product = $this->getProduct();
+ $attributes = array();
+
+ foreach ($product->getAttributes() as $key => $attribute) {
+ $attributes[$key] = $attribute->getApplyTo();
+ }
+ return $attributes;
+ }
}
View
10 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/AttributeSet.php
@@ -31,7 +31,7 @@
* @package Mage_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet extends Mage_Adminhtml_Block_Widget_Form
+class Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet extends Mage_Backend_Block_Widget_Form
{
protected function _prepareForm()
{
@@ -54,6 +54,14 @@ protected function _prepareForm()
->toOptionArray()
));
+ $fieldset->addField(
+ 'type_id',
+ 'hidden',
+ array(
+ 'name' => 'type_id',
+ 'value' => Mage::registry('product')->getTypeId(),
+ )
+ );
$this->setForm($form);
}
}
View
85 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/NewCategory.php
@@ -0,0 +1,85 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-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_Adminhtml
+ * @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * New category creation form
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Catalog_Product_Edit_NewCategory extends Mage_Backend_Block_Widget_Form
+{
+ /**
+ * Form preparation
+ */
+ protected function _prepareForm()
+ {
+ $form = new Varien_Data_Form();
+
+ $form->addField('new_category_messages', 'note', array());
+
+ $fieldset = $form->addFieldset('new_category_form', array());
+
+ $fieldset->addField('new_category_name', 'text', array(
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Category Name'),
+ 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Category Name'),
+ 'required' => true,
+ ));
+
+ $fieldset->addField('new_category_parent', 'text', array(
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Parent Category'),
+ 'title' => Mage::helper('Mage_Catalog_Helper_Data')->__('Parent Category'),
+ 'autocomplete' => 'off',
+ 'required' => true,
+ 'class' => 'validate-parent-category',
+ ));
+
+ $fieldset->addField('new_category_parent_id', 'hidden', array());
+
+ $this->setForm($form);
+ }
+
+ /**
+ * Category save action URL
+ *
+ * @return string
+ */
+ public function getSaveCategoryUrl()
+ {
+ return $this->getUrl('*/catalog_category/save');
+ }
+
+ /**
+ * Category suggestion action URL
+ *
+ * @return string
+ */
+ public function getSuggestCategoryUrl()
+ {
+ return $this->getUrl('*/catalog_category/suggestCategories');
+ }
+}
View
115 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config.php
@@ -83,6 +83,16 @@ public function isAttributesConfigurationReadonly()
}
/**
+ * Get configurable product type
+ *
+ * @return Mage_Catalog_Model_Product_Type_Configurable
+ */
+ protected function _getProductType()
+ {
+ return Mage::getModel('Mage_Catalog_Model_Product_Type_Configurable');
+ }
+
+ /**
* Check whether prices of configurable products can be editable
*
* @return boolean
@@ -100,11 +110,6 @@ public function isAttributesPricesReadonly()
*/
protected function _prepareLayout()
{
- $this->setChild('grid',
- $this->getLayout()->createBlock('Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid',
- 'admin.product.edit.tab.super.config.grid')
- );
-
$this->addChild('create_empty', 'Mage_Adminhtml_Block_Widget_Button', array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Create Empty'),
'class' => 'add',
@@ -139,32 +144,26 @@ protected function _getProduct()
}
/**
- * Retrieve attributes data in JSON format
+ * Retrieve attributes data
*
- * @return string
+ * @return array
*/
- public function getAttributesJson()
+ public function getAttributes()
{
- $attributes = $this->_getProduct()->getTypeInstance()
- ->getConfigurableAttributesAsArray($this->_getProduct());
- if(!$attributes) {
- return '[]';
- } else {
- // Hide price if needed
- foreach ($attributes as &$attribute) {
- if (isset($attribute['values']) && is_array($attribute['values'])) {
- foreach ($attribute['values'] as &$attributeValue) {
- if (!$this->getCanReadPrice()) {
- $attributeValue['pricing_value'] = '';
- $attributeValue['is_percent'] = 0;
- }
- $attributeValue['can_edit_price'] = $this->getCanEditPrice();
- $attributeValue['can_read_price'] = $this->getCanReadPrice();
+ $attributes = (array)$this->_getProductType()->getConfigurableAttributesAsArray($this->_getProduct());
+ foreach ($attributes as &$attribute) {
+ if (isset($attribute['values']) && is_array($attribute['values'])) {
+ foreach ($attribute['values'] as &$attributeValue) {
+ if (!$this->getCanReadPrice()) {
+ $attributeValue['pricing_value'] = '';
+ $attributeValue['is_percent'] = 0;
}
+ $attributeValue['can_edit_price'] = $this->getCanEditPrice();
+ $attributeValue['can_read_price'] = $this->getCanReadPrice();
}
}
}
- return Mage::helper('Mage_Core_Helper_Data')->jsonEncode($attributes);
+ return $attributes;
}
/**
@@ -174,7 +173,7 @@ public function getAttributesJson()
*/
public function getLinksJson()
{
- $products = $this->_getProduct()->getTypeInstance()
+ $products = $this->_getProductType()
->getUsedProducts($this->_getProduct());
if(!$products) {
return '{}';
@@ -194,7 +193,7 @@ public function getLinksJson()
*/
public function getConfigurableSettings($product) {
$data = array();
- $attributes = $this->_getProduct()->getTypeInstance()
+ $attributes = $this->_getProductType()
->getUsedProductAttributes($this->_getProduct());
foreach ($attributes as $attribute) {
$data[] = array(
@@ -297,17 +296,6 @@ protected function _getRequiredAttributesIds()
}
/**
- * Escape JavaScript string
- *
- * @param string $string
- * @return string
- */
- public function escapeJs($string)
- {
- return addcslashes($string, "'\r\n\\");
- }
-
- /**
* Retrieve Tab label
*
* @return string
@@ -365,8 +353,55 @@ public function getShowUseDefaultPrice()
*/
public function getSelectedAttributes()
{
- return array_filter(
- $this->_getProduct()->getTypeInstance()->getUsedProductAttributes($this->_getProduct())
- );
+ return $this->_getProduct()->isConfigurable()
+ ? array_filter($this->_getProductType()->getUsedProductAttributes($this->_getProduct()))
+ : array();
+ }
+
+ /**
+ * Retrieve all possible attribute values combinations
+ *
+ * @return array
+ */
+ public function getVariations()
+ {
+ $attributesCount = 0;
+ $variationalAttributes = array();
+ $usedProductAttributes = $this->getSelectedAttributes();
+ foreach ($usedProductAttributes as $attribute) {
+ /** @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
+ $variationalAttributes[] = array(
+ 'id' => $attribute->getId(),
+ 'values' => $attribute->getSource()->getAllOptions(false),
+ );
+ $attributesCount++;
+ }
+
+ $variations = array();
+ $currentVariation = array_fill(0, $attributesCount, 0);
+ $variationalAttributes = array_reverse($variationalAttributes);
+ $lastAttribute = $attributesCount - 1;
+ do {
+ for ($attributeIndex = 0; $attributeIndex < $attributesCount - 1; ++$attributeIndex) {
+ if ($currentVariation[$attributeIndex] >= count($variationalAttributes[$attributeIndex]['values'])) {
+ $currentVariation[$attributeIndex] = 0;
+ ++$currentVariation[$attributeIndex + 1];
+ }
+ }
+ if ($currentVariation[$lastAttribute] >= count($variationalAttributes[$lastAttribute]['values'])) {
+ break;
+ }
+
+ $filledVariation = array();
+ for ($attributeIndex = $attributesCount; $attributeIndex--;) {
+ $currentAttribute = $variationalAttributes[$attributeIndex];
+ $filledVariation[$currentAttribute['id']] =
+ $currentAttribute['values'][$currentVariation[$attributeIndex]];
+ }
+
+ $variations[] = $filledVariation;
+ $currentVariation[0]++;
+ } while (1);
+ return $variations;
}
}
View
312 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Config/Grid.php
@@ -1,312 +0,0 @@
-<?php
-/**
- * Magento
- *
- * NOTICE OF LICENSE
- *
- * This source file is subject to the Open Software License (OSL 3.0)
- * that is bundled with this package in the file LICENSE.txt.
- * It is also available through the world-wide-web at this URL:
- * http://opensource.org/licenses/osl-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_Adminhtml
- * @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
- */
-
-/**
- * Adminhtml super product links grid
- *
- * @category Mage
- * @package Mage_Adminhtml
- * @author Magento Core Team <core@magentocommerce.com>
- */
-class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid extends Mage_Adminhtml_Block_Widget_Grid
-{
-
- protected function _construct()
- {
- parent::_construct();
- $this->setUseAjax(true);
- $this->setId('super_product_links');
-
- if ($this->_getProduct() && $this->_getProduct()->getId()) {
- $this->setDefaultFilter(array('in_products'=>1));
- }
- }
-
- /**
- * Retrieve currently edited product object
- *
- * @return Mage_Catalog_Model_Product
- */
- protected function _getProduct()
- {
- return Mage::registry('current_product');
- }
-
- protected function _addColumnFilterToCollection($column)
- {
- // Set custom filter for in product flag
- if ($column->getId() == 'in_products') {
- $productIds = $this->_getSelectedProducts();
-
- if (empty($productIds)) {
- $productIds = 0;
- }
-
- $createdProducts = $this->_getCreatedProducts();
-
- $existsProducts = $productIds; // Only for "Yes" Filter we will add created products
-
- if(count($createdProducts)>0) {
- if(!is_array($existsProducts)) {
- $existsProducts = $createdProducts;
- } else {
- $existsProducts = array_merge($createdProducts);
- }
- }
-
- if ($column->getFilter()->getValue()) {
- $this->getCollection()->addFieldToFilter('entity_id', array('in'=>$existsProducts));
- }
- else {
- if($productIds) {
- $this->getCollection()->addFieldToFilter('entity_id', array('nin'=>$productIds));
- }
- }
- }
- else {
- parent::_addColumnFilterToCollection($column);
- }
- return $this;
- }
-
- protected function _getCreatedProducts()
- {
- $products = $this->getRequest()->getPost('new_products', null);
- if (!is_array($products)) {
- $products = array();
- }
-
- return $products;
- }
-
- /**
- * Prepare collection
- *
- * @return Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid
- */
- protected function _prepareCollection()
- {
- $allowProductTypes = array();
- foreach (Mage::helper('Mage_Catalog_Helper_Product_Configuration')->getConfigurableAllowedTypes() as $type) {
- $allowProductTypes[] = $type->getName();
- }
-
- $product = $this->_getProduct();
- $collection = $product->getCollection()
- ->addAttributeToSelect('name')
- ->addAttributeToSelect('sku')
- ->addAttributeToSelect('attribute_set_id')
- ->addAttributeToSelect('type_id')
- ->addAttributeToSelect('price')
- ->addFieldToFilter('attribute_set_id',$product->getAttributeSetId())
- ->addFieldToFilter('type_id', $allowProductTypes)
- ->addFilterByRequiredOptions()
- ->joinAttribute('name', 'catalog_product/name', 'entity_id', null, 'inner');
-
- if (Mage::helper('Mage_Catalog_Helper_Data')->isModuleEnabled('Mage_CatalogInventory')) {
- Mage::getModel('Mage_CatalogInventory_Model_Stock_Item')->addCatalogInventoryToProductCollection($collection);
- }
-
- foreach ($product->getTypeInstance()->getUsedProductAttributes($product) as $attribute) {
- $collection->addAttributeToSelect($attribute->getAttributeCode());
- $collection->addAttributeToFilter($attribute->getAttributeCode(), array('notnull'=>1));
- }
-
- $this->setCollection($collection);
-
- if ($this->isReadonly()) {
- $collection->addFieldToFilter('entity_id', array('in' => $this->_getSelectedProducts()));
- }
-
- parent::_prepareCollection();
- return $this;
- }
-
- protected function _getSelectedProducts()
- {
- $products = $this->getRequest()->getPost('products', null);
- if (!is_array($products)) {
- $products = $this->_getProduct()->getTypeInstance()->getUsedProductIds($this->_getProduct());
- }
- return $products;
- }
-
- /**
- * Check block is readonly
- *
- * @return boolean
- */
- public function isReadonly()
- {
- if ($this->hasData('is_readonly')) {
- return $this->getData('is_readonly');
- }
- return $this->_getProduct()->getCompositeReadonly();
- }
-
- protected function _prepareColumns()
- {
- $product = $this->_getProduct();
- $attributes = $product->getTypeInstance()->getConfigurableAttributes($product);
-
- if (!$this->isReadonly()) {
- $this->addColumn('in_products', array(
- 'header_css_class' => 'a-center',
- 'type' => 'checkbox',
- 'name' => 'in_products',
- 'values' => $this->_getSelectedProducts(),
- 'align' => 'center',
- 'index' => 'entity_id',
- 'renderer' => 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid_Renderer_Checkbox',
- 'attributes' => $attributes
- ));
- }
-
- $this->addColumn('entity_id', array(
- 'header' => Mage::helper('Mage_Catalog_Helper_Data')->__('ID'),
- 'sortable' => true,
- 'width' => '60px',
- 'index' => 'entity_id'
- ));
- $this->addColumn('name', array(
- 'header' => Mage::helper('Mage_Catalog_Helper_Data')->__('Name'),
- 'index' => 'name'
- ));
-
-
- $sets = Mage::getModel('Mage_Eav_Model_Entity_Attribute_Set')->getCollection()
- ->setEntityTypeFilter($this->_getProduct()->getResource()->getTypeId())
- ->load()
- ->toOptionHash();
-
- $this->addColumn('set_name',
- array(
- 'header'=> Mage::helper('Mage_Catalog_Helper_Data')->__('Attrib. Set Name'),
- 'width' => '130px',
- 'index' => 'attribute_set_id',
- 'type' => 'options',
- 'options' => $sets,
- ));
-
- $this->addColumn('sku', array(
- 'header' => Mage::helper('Mage_Catalog_Helper_Data')->__('SKU'),
- 'width' => '80px',
- 'index' => 'sku'
- ));
-
- $this->addColumn('price', array(
- 'header' => Mage::helper('Mage_Catalog_Helper_Data')->__('Price'),
- 'type' => 'currency',
- 'currency_code' => (string) Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE),
- 'index' => 'price'
- ));
-
- $this->addColumn('is_saleable', array(
- 'header' => Mage::helper('Mage_Catalog_Helper_Data')->__('Inventory'),
- 'renderer' => 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid_Renderer_Inventory',
- 'filter' => 'Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid_Filter_Inventory',
- 'index' => 'is_saleable'
- ));
-
- foreach ($attributes as $attribute) {
- $productAttribute = $attribute->getProductAttribute();
- $productAttribute->getSource();
- $this->addColumn($productAttribute->getAttributeCode(), array(
- 'header' => $productAttribute->getFrontend()->getLabel(),
- 'index' => $productAttribute->getAttributeCode(),
- 'type' => $productAttribute->getSourceModel() ? 'options' : 'number',
- 'options' => $productAttribute->getSourceModel() ? $this->getOptions($attribute) : ''
- ));
- }
-
- $this->addColumn('action',
- array(
- 'header' => Mage::helper('Mage_Catalog_Helper_Data')->__('Action'),
- 'type' => 'action',
- 'getter' => 'getId',
- 'actions' => array(
- array(
- 'caption' => Mage::helper('Mage_Catalog_Helper_Data')->__('Edit'),
- 'url' => $this->getEditParamsForAssociated(),
- 'field' => 'id',
- 'onclick' => 'superProduct.createPopup(this.href);return false;'
- )
- ),
- 'filter' => false,
- 'sortable' => false
- ));
-
- return parent::_prepareColumns();
- }
-
- public function getEditParamsForAssociated()
- {
- return array(
- 'base' => '*/*/edit',
- 'params' => array(
- 'required' => $this->_getRequiredAttributesIds(),
- 'popup' => 1,
- 'product' => $this->_getProduct()->getId()
- )
- );
- }
-
- /**
- * Retrieve Required attributes Ids (comma separated)
- *
- * @return string
- */
- protected function _getRequiredAttributesIds()
- {
- $attributesIds = array();
- foreach (
- $this->_getProduct()
- ->getTypeInstance()
- ->getConfigurableAttributes($this->_getProduct()) as $attribute
- ) {
- $attributesIds[] = $attribute->getProductAttribute()->getId();
- }
-
- return implode(',', $attributesIds);
- }
-
- public function getOptions($attribute) {
- $result = array();
- foreach ($attribute->getProductAttribute()->getSource()->getAllOptions() as $option) {
- if($option['value']!='') {
- $result[$option['value']] = $option['label'];
- }
- }
-
- return $result;
- }
-
- public function getGridUrl()
- {
- return $this->getUrl('*/*/superConfig', array('_current'=>true));
- }
-
-}
View
56 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tab/Super/Settings.php
@@ -26,7 +26,7 @@
/**
- * Create Configuranle procuct Settings Tab Block
+ * Create Configurable product Settings Tab Block
*
* @category Mage
* @package Mage_Adminhtml
@@ -40,19 +40,14 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Settings extends Mage_
*/
protected function _prepareLayout()
{
- $onclick = "setSuperSettings('" . $this->getContinueUrl() . "','attribute-checkbox', 'attributes')";
+ $onclick = "jQuery('#product-edit-form').attr('action', "
+ . $this->helper('Mage_Core_Helper_Data')->jsonEncode($this->getContinueUrl())
+ . ").addClass('ignore-validate').submit();";
$this->addChild('continue_button', 'Mage_Backend_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Continue'),
+ 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Generate Variations'),
'onclick' => $onclick,
- 'class' => 'save',
+ 'class' => 'save',
));
-
- $this->addChild('back_button', 'Mage_Backend_Block_Widget_Button', array(
- 'label' => Mage::helper('Mage_Catalog_Helper_Data')->__('Back'),
- 'onclick' => "setLocation('" . $this->getBackUrl() . "')",
- 'class' => 'back'
- ));
-
parent::_prepareLayout();
}
@@ -75,52 +70,42 @@ protected function _prepareForm()
{
$form = new Varien_Data_Form();
$fieldset = $form->addFieldset('settings', array(
- 'legend'=>Mage::helper('Mage_Catalog_Helper_Data')->__('Select Configurable Attributes ')
+ 'legend'=>Mage::helper('Mage_Catalog_Helper_Data')->__('Select Configurable Attributes')
));
$product = $this->_getProduct();
$attributes = $product->getTypeInstance()
->getSetAttributes($product);
- $fieldset->addField('req_text', 'note', array(
- 'text' => '<ul class="messages"><li class="notice-msg"><ul><li>'
- . $this->__('Only attributes with scope "Global", input type "Dropdown" and Use To Create Configurable Product "Yes" are available.')
- . '</li></ul></li></ul>'
- ));
-
$hasAttributes = false;
+ $usedAttributes = $product->isConfigurable()
+ ? $this->_getProduct()->getTypeInstance()->getUsedProductAttributeIds($this->_getProduct())
+ : array();
+
+ $configurableType = Mage::getSingleton('Mage_Catalog_Model_Product_Type_Configurable');
foreach ($attributes as $attribute) {
- if ($product->getTypeInstance()->canUseAttribute($attribute, $product)) {
+ if ($configurableType->canUseAttribute($attribute, $product)) {
$hasAttributes = true;
- $fieldset->addField('attribute_'.$attribute->getAttributeId(), 'checkbox', array(
+ $fieldset->addField('attribute_' . $attribute->getAttributeId(), 'checkbox', array(
'label' => $attribute->getFrontend()->getLabel(),
'title' => $attribute->getFrontend()->getLabel(),
- 'name' => 'attribute',
- 'class' => 'attribute-checkbox',
- 'value' => $attribute->getAttributeId()
+ 'name' => 'attributes[]',
+ 'class' => 'configurable-attribute-checkbox',
+ 'value' => $attribute->getAttributeId(),
+ 'checked' => in_array($attribute->getAttributeId(), $usedAttributes)
));
}
}
if ($hasAttributes) {
- $fieldset->addField('attributes', 'hidden', array(
- 'name' => 'attribute_validate',
- 'value' => '',
- 'class' => 'validate-super-product-attributes'
- ));
-
$fieldset->addField('continue_button', 'note', array(
'text' => $this->getChildHtml('continue_button'),
));
- }
- else {
+ } else {
$fieldset->addField('note_text', 'note', array(
'text' => $this->__('This attribute set does not have attributes which we can use for configurable product')
));
- $fieldset->addField('back_button', 'note', array(
- 'text' => $this->getChildHtml('back_button'),
- ));
}
@@ -137,8 +122,7 @@ protected function _prepareForm()
public function getContinueUrl()
{
return $this->getUrl($this->_getProduct()->getId() ? '*/*/edit' : '*/*/new', array(
- '_current' => true,
- 'attributes' => '{{attributes}}'
+ '_current' => true,
));
}
View
9 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Edit/Tabs.php
@@ -39,7 +39,7 @@ protected function _construct()
{
parent::_construct();
$this->setId('product_info_tabs');
- $this->setDestElementId('product-edit-form');
+ $this->setDestElementId('product-edit-form-tabs');
$this->setTitle(Mage::helper('Mage_Catalog_Helper_Data')->__('Product Information'));
}
@@ -74,7 +74,7 @@ protected function _prepareLayout()
continue;
}
- $this->addTab('group_'.$group->getId(), array(
+ $this->addTab('group_' . $group->getId(), array(
'label' => Mage::helper('Mage_Catalog_Helper_Data')->__($group->getAttributeGroupName()),
'content' => $this->_translateHtml($tabAttributesBlock->setGroup($group)
->setGroupAttributes($attributes)
@@ -120,11 +120,6 @@ protected function _prepareLayout()
'class' => 'ajax',
));
- $storeId = 0;
- if ($this->getRequest()->getParam('store')) {
- $storeId = Mage::app()->getStore($this->getRequest()->getParam('store'))->getId();
- }
-
$alertPriceAllow = Mage::getStoreConfig('catalog/productalert/allow_price');
$alertStockAllow = Mage::getStoreConfig('catalog/productalert/allow_stock');
View
37 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Category.php
@@ -68,17 +68,19 @@ protected function _getCategoriesCollection()
}
/**
- * Get html for element
+ * Get html of element
*
* @return string
*/
public function getElementHtml()
{
- return parent::getElementHtml()
- . "<script>//<![CDATA[\n jQuery("
- . $this->_getCodeHelper()->jsonEncode('#' . $this->getHtmlId())
- . ").categorySelector(" . $this->_getCodeHelper()->jsonEncode($this->_getSelectorOptions()) . ");
- \n//]]></script>";
+ /** @var $coreHelper Mage_Core_Helper_Data */
+ $coreHelper = Mage::helper('Mage_Core_Helper_Data');
+ return parent::getElementHtml() . "\n"
+ . '<script>//<![CDATA[' . "\n"
+ . 'jQuery(' . $coreHelper->jsonEncode('#' . $this->getHtmlId()) . ').categorySelector('
+ . $coreHelper->jsonEncode($this->_getSelectorOptions()) . ')' . "\n"
+ . '//]]></script>';
}
/**
@@ -89,28 +91,7 @@ public function getElementHtml()
protected function _getSelectorOptions()
{
return array(
- 'url' => $this->_getBackendHelper()->getUrl('adminhtml/catalog_category/suggestCategories'),
+ 'url' => Mage::helper('Mage_Backend_Helper_Data')->getUrl('adminhtml/catalog_category/suggestCategories'),
);
}
-
- /**
- * Get backend area helper
- *
- * @return Mage_Backend_Helper_Data"
- */
- protected function _getBackendHelper()
- {
- return Mage::helper("Mage_Backend_Helper_Data");
- }
-
- /**
- * Get code module helper
- *
- * @return Mage_Backend_Helper_Data"
- */
- protected function _getCodeHelper()
- {
- return Mage::helper("Mage_Core_Helper_Data");
- }
-
}
View
88 app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Weight/Renderer.php
@@ -0,0 +1,88 @@
+<?php
+/**
+ * Magento
+ *
+ * NOTICE OF LICENSE
+ *
+ * This source file is subject to the Open Software License (OSL 3.0)
+ * that is bundled with this package in the file LICENSE.txt.
+ * It is also available through the world-wide-web at this URL:
+ * http://opensource.org/licenses/osl-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_Adminhtml
+ * @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
+ */
+
+/**
+ * Product form weight field helper
+ *
+ * @category Mage
+ * @package Mage_Adminhtml
+ * @author Magento Core Team <core@magentocommerce.com>
+ */
+class Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Weight_Renderer extends Varien_Data_Form_Element_Text
+{
+ const VIRTUAL_FIELD_HTML_ID = 'weight_and_type_switcher';
+
+ /**
+ * Is virtual checkbox element
+ *
+ * @var Varien_Data_Form_Element_Checkbox
+ */
+ protected $_virtual;
+
+ /**
+ * Catalog helper
+ *
+ * @var Mage_Catalog_Helper_Product
+ */
+ protected $_helper;
+
+ public function __construct(array $data = array())
+ {
+ $this->_helper = isset($data['helper']) ? $data['helper'] : Mage::helper('Mage_Catalog_Helper_Product');
+ $this->_virtual = isset($data['element'])
+ ? $data['element']
+ : Mage::getModel('Varien_Data_Form_Element_Checkbox');
+ $this->_virtual->setId(self::VIRTUAL_FIELD_HTML_ID)->setName('is_virtual')
+ ->setLabel($this->_helper->getTypeSwitcherControlLabel());
+ parent::__construct($data);
+ }
+
+ /**
+ * Add Is Virtual checkbox html to weight field
+ *
+ * @return string
+ */
+ public function getElementHtml()
+ {
+ if (!$this->getForm()->getDataObject()->getTypeInstance()->hasWeight()) {
+ $this->_virtual->setChecked('checked');
+ }
+ return parent::getElementHtml() . $this->_virtual->getElementHtml() . $this->_virtual->getLabelHtml();
+ }
+
+ /**
+ * Set form for both fields
+ *
+ * @param Varien_Data_Form $form
+ * @return Varien_Data_Form
+ */
+ public function setForm($form)
+ {
+ $this->_virtual->setForm($form);
+ return parent::setForm($form);
+ }
+
+}
View
4 app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php
@@ -48,9 +48,11 @@ protected function _prepareForm()
$fieldset = $form->addFieldset('review_details', array('legend' => Mage::helper('Mage_Review_Helper_Data')->__('Review Details'), 'class' => 'fieldset-wide'));
+ /** @var $helper Mage_Review_Helper_Data */
+ $helper = Mage::helper('Mage_Review_Helper_Data');
$fieldset->addField('product_name', 'note', array(
'label' => Mage::helper('Mage_Review_Helper_Data')->__('Product'),
- 'text' => '<a href="' . $this->getUrl('*/catalog_product/edit', array('id' => $product->getId())) . '" onclick="this.target=\'blank\'">' . $product->getName() . '</a>'
+ 'text' => '<a href="' . $this->getUrl('*/catalog_product/edit', array('id' => $product->getId())) . '" onclick="this.target=\'blank\'">' . $helper->escapeHtml($product->getName()) . '</a>'
));
if ($customer->getId()) {
View
2 app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php
@@ -32,7 +32,7 @@
* @package Mage_Adminhtml
* @author Magento Core Team <core@magentocommerce.com>
*/
-class Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute extends Mage_Core_Helper_Data
+class Mage_Adminhtml_Helper_Catalog_Product_Edit_Action_Attribute extends Mage_Backend_Helper_Data
{
/**
* Selected products for mass-update
View
43 app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php
@@ -145,7 +145,7 @@ public function editAction()
/**
* Check if we have data in session (if duering category save was exceprion)
*/
- $data = Mage::getSingleton('Mage_Adminhtml_Model_Session')->getCategoryData(true);
+ $data = $this->_getSession()->getCategoryData(true);
if (isset($data['general'])) {
$category->addData($data['general']);
}
@@ -331,9 +331,9 @@ public function saveAction()
/**
* Proceed with $_POST['use_config']
- * set into category model for proccessing through validation
+ * set into category model for processing through validation
*/
- $category->setData("use_post_data_config", $this->getRequest()->getPost('use_config'));
+ $category->setData('use_post_data_config', $this->getRequest()->getPost('use_config'));
try {
$validate = $category->validate();
@@ -348,13 +348,10 @@ public function saveAction()
}
}
- /**
- * Unset $_POST['use_config'] before save
- */
$category->unsetData('use_post_data_config');
$category->save();
- Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess(Mage::helper('Mage_Catalog_Helper_Data')->__('The category has been saved.'));
+ $this->_getSession()->addSuccess(Mage::helper('Mage_Catalog_Helper_Data')->__('The category has been saved.'));
$refreshTree = 'true';
}
catch (Exception $e){
@@ -363,10 +360,26 @@ public function saveAction()
$refreshTree = 'false';
}
}
- $url = $this->getUrl('*/*/edit', array('_current' => true, 'id' => $category->getId()));
- $this->getResponse()->setBody(
- '<script type="text/javascript">parent.updateContent("' . $url . '", {}, '.$refreshTree.');</script>'
- );
+
+ if ($this->getRequest()->getPost('return_session_messages_only')) {
+ $category->load($category->getId()); // to obtain truncated category name
+
+ /** @var $block Mage_Core_Block_Messages */
+ $block = Mage::getSingleton('Mage_Core_Block_Messages');
+ $block->setMessages($this->_getSession()->getMessages(true));
+ $body = Mage::helper('Mage_Core_Helper_Data')->jsonEncode(array(
+ 'messages' => $block->getGroupedHtml(),
+ 'error' => $refreshTree !== 'true',
+ 'category' => $category->toArray(),
+ ));
+ } else {
+ $url = $this->getUrl('*/*/edit', array('_current' => true, 'id' => $category->getId()));
+ $body = '<script type="text/javascript">parent.updateContent("'
+ . $url . '", {}, ' . $refreshTree
+ . ');</script>';
+ }
+
+ $this->getResponse()->setBody($body);
}
/**
@@ -390,7 +403,7 @@ public function moveAction()
try {
$category->move($parentNodeId, $prevNodeId);
- $this->getResponse()->setBody("SUCCESS");
+ $this->getResponse()->setBody('SUCCESS');
}
catch (Mage_Core_Exception $e) {
$this->getResponse()->setBody($e->getMessage());
@@ -415,15 +428,15 @@ public function deleteAction()
Mage::getSingleton('Mage_Backend_Model_Auth_Session')->setDeletedPath($category->getPath());
$category->delete();
- Mage::getSingleton('Mage_Adminhtml_Model_Session')->addSuccess(Mage::helper('Mage_Catalog_Helper_Data')->__('The category has been deleted.'));
+ $this->_getSession()->addSuccess(Mage::helper('Mage_Catalog_Helper_Data')->__('The category has been deleted.'));
}
catch (Mage_Core_Exception $e){
- Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError($e->getMessage());
+ $this->_getSession()->addError($e->getMessage());
$this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=>true)));
return;
}
catch (Exception $e){
- Mage::getSingleton('Mage_Adminhtml_Model_Session')->addError(Mage::helper('Mage_Catalog_Helper_Data')->__('An error occurred while trying to delete the category.'));
+ $this->_getSession()->addError(Mage::helper('Mage_Catalog_Helper_Data')->__('An error occurred while trying to delete the category.'));
$this->getResponse()->setRedirect($this->getUrl('*/*/edit', array('_current'=>true)));
return;
}
View
4 app/code/core/Mage/Adminhtml/controllers/Catalog/Product/AttributeController.php
@@ -311,6 +311,10 @@ public function saveAction()
if(!isset($data['apply_to'])) {
$data['apply_to'] = array();
}
+ if (!$model->getIsUserDefined() && $model->getId()) {
+ //Unset attribute field for system attributes
+ unset($data['apply_to']);
+ }
//filter
$data = $this->_filterPostData($data);
View
63 app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php
@@ -87,13 +87,17 @@ protected function _initProduct()
$product->setAttributeSetId($setId);
}
- $attributes = $this->getRequest()->getParam('attributes');
- if ($attributes && $product->isConfigurable() &&
- (!$productId || !$product->getTypeInstance()->getUsedProductAttributeIds($product))) {
- $product->getTypeInstance()->setUsedProductAttributeIds(
- explode(",", base64_decode(urldecode($attributes))),
- $product
- );
+ if ($this->getRequest()->has('attributes')) {
+ $attributes = $this->getRequest()->getParam('attributes');
+ if (!empty($attributes)) {
+ $product->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE);
+ $this->_objectManager->get('Mage_Catalog_Model_Product_Type_Configurable')->setUsedProductAttributeIds(
+ $attributes,
+ $product
+ );
+ } else {
+ $product->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_SIMPLE);
+ }
}
// Required attributes of simple product for configurable creation
@@ -120,7 +124,6 @@ protected function _initProduct()
/* @var $configProduct Mage_Catalog_Model_Product */
$data = array();
foreach ($configProduct->getTypeInstance()->getEditableAttributes($configProduct) as $attribute) {
-
/* @var $attribute Mage_Catalog_Model_Resource_Eav_Attribute */
if(!$attribute->getIsUnique()
&& $attribute->getFrontend()->getInputType()!='gallery'
@@ -255,8 +258,8 @@ public function editAction()
$_additionalLayoutPart = '';
if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE
- && !($product->getTypeInstance()->getUsedProductAttributeIds($product)))
- {
+ && !($product->getTypeInstance()->getUsedProductAttributeIds($product))
+ ) {
$_additionalLayoutPart = '_new';
}
@@ -644,21 +647,29 @@ protected function _initProductSave($product)
/**
* Initialize data for configurable product
*/
- if (($data = $this->getRequest()->getPost('configurable_products_data'))
- && !$product->getConfigurableReadonly()
- ) {
- $product->setConfigurableProductsData(Mage::helper('Mage_Core_Helper_Data')->jsonDecode($data));
- }
- if (($data = $this->getRequest()->getPost('configurable_attributes_data'))
- && !$product->getConfigurableReadonly()
- ) {
- $product->setConfigurableAttributesData(Mage::helper('Mage_Core_Helper_Data')->jsonDecode($data));
- }
- $product->setCanSaveConfigurableAttributes(
- (bool) $this->getRequest()->getPost('affect_configurable_product_attributes')
- && !$product->getConfigurableReadonly()
- );
+ $attributes = $this->getRequest()->getParam('attributes');
+ if (!empty($attributes)) {
+ $product->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE);
+ $this->_objectManager->get('Mage_Catalog_Model_Product_Type_Configurable')->setUsedProductAttributeIds(
+ $attributes,
+ $product
+ );
+
+ $product->setAssociatedProductIds($this->getRequest()->getPost('associated_product_ids', array()));
+
+ $data = $this->getRequest()->getPost('configurable_attributes_data');
+ if ($data) {
+ $product->setConfigurableAttributesData(Mage::helper('Mage_Core_Helper_Data')->jsonDecode($data));
+ }
+
+ $product->setCanSaveConfigurableAttributes(
+ (bool)$this->getRequest()->getPost('affect_configurable_product_attributes')
+ );
+ } elseif ($product->getTypeId() === Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE) {
+ $product->setTypeId(Mage_Catalog_Model_Product_Type::TYPE_VIRTUAL);
+ $product->setTypeInstance(null);
+ }
/**
* Initialize product options
@@ -715,6 +726,10 @@ public function saveAction()
$this->_filterStockData($data['product']['stock_data']);
$product = $this->_initProductSave($this->_initProduct());
+ Mage::dispatchEvent(
+ 'catalog_product_transition_product_type',
+ array('product' => $product, 'request' => $this->getRequest())
+ );
try {
if (isset($data['product'][$product->getIdFieldName()])) {
View
171 app/code/core/Mage/Adminhtml/view/adminhtml/catalog.xml
@@ -50,21 +50,28 @@
<action method="addJs"><file>Mage_Adminhtml::jquery/fileUploader/load-image.min.js</file></action>
<action method="addJs"><file>Mage_Adminhtml::jquery/fileUploader/canvas-to-blob.min.js</file></action>
<action method="addJs"><file>Mage_Adminhtml::jquery/fileUploader/jquery.fileupload-fp.js</file></action>
- <action method="addCss"><file>Mage_Adminhtml::catalog/jquery.category-selector.css</file></action>
- <action method="addJs"><file>Mage_Adminhtml::catalog/jquery.category-selector.js</file></action>
- <action method="addJs"><file>Mage_Adminhtml::catalog/jquery.base-image-uploader.js</file></action>
- <action method="addCss"><file>Mage_Adminhtml::catalog/jquery.base-image-uploader.css</file></action>
+ <action method="addCss"><file>Mage_Adminhtml::catalog/category-selector.css</file></action>
+ <action method="addJs"><file>Mage_Adminhtml::catalog/category-selector.js</file></action>
+ <action method="addJs"><file>Mage_Adminhtml::catalog/type-switcher.js</file></action>
+ <action method="addJs"><file>Mage_Adminhtml::catalog/base-image-uploader.js</file></action>
+ <action method="addCss"><file>Mage_Adminhtml::catalog/base-image-uploader.css</file></action>
+ <action method="addCss"><file>Mage_Adminhtml::catalog/configurable-product.css</file></action>
</reference>
<reference name="content">
- <block type="Mage_Adminhtml_Block_Catalog_Product_Edit" name="product_edit"></block>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit" name="product_edit">
+ <container name="product-type-tabs" label="Tabs">
+ </container>
+ </block>
<block type="Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet" name="attribute-set-info" template="Mage_Adminhtml::catalog/product/edit/attribute_set.phtml"></block>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_NewCategory" name="new-category" template="Mage_Adminhtml::catalog/product/edit/category/new/form.phtml"/>
</reference>
<reference name="left">
<block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs" name="product_tabs"></block>
</reference>
<reference name="js">
- <block type="Mage_Core_Block_Template" name="change-attribute-set" template="Mage_Adminhtml::catalog/product/change_attribute_set_widget.phtml" />
- <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="change-attribute-set" template="Mage_Adminhtml::catalog/product/change_attribute_set_widget.phtml"/>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_NewCategory" name="new-category-js" template="Mage_Adminhtml::catalog/product/edit/category/new/js.phtml"/>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Js" template="catalog/product/js.phtml" name="catalog_product_js"/>
<block type="Mage_Core_Block_Template" template="Mage_Adminhtml::catalog/wysiwyg/js.phtml"/>
</reference>
</adminhtml_catalog_product_new>
@@ -79,23 +86,30 @@
<action method="addJs"><file>Mage_Adminhtml::jquery/fileUploader/load-image.min.js</file></action>
<action method="addJs"><file>Mage_Adminhtml::jquery/fileUploader/canvas-to-blob.min.js</file></action>
<action method="addJs"><file>Mage_Adminhtml::jquery/fileUploader/jquery.fileupload-fp.js</file></action>
- <action method="addCss"><file>Mage_Adminhtml::catalog/jquery.category-selector.css</file></action>
- <action method="addJs"><file>Mage_Adminhtml::catalog/jquery.category-selector.js</file></action>
- <action method="addJs"><file>Mage_Adminhtml::catalog/jquery.base-image-uploader.js</file></action>
- <action method="addCss"><file>Mage_Adminhtml::catalog/jquery.base-image-uploader.css</file></action>
+ <action method="addCss"><file>Mage_Adminhtml::catalog/category-selector.css</file></action>
+ <action method="addJs"><file>Mage_Adminhtml::catalog/category-selector.js</file></action>
+ <action method="addJs"><file>Mage_Adminhtml::catalog/type-switcher.js</file></action>
+ <action method="addJs"><file>Mage_Adminhtml::catalog/base-image-uploader.js</file></action>
+ <action method="addCss"><file>Mage_Adminhtml::catalog/base-image-uploader.css</file></action>
+ <action method="addCss"><file>Mage_Adminhtml::catalog/configurable-product.css</file></action>
</reference>
<reference name="content">
- <block type="Mage_Adminhtml_Block_Catalog_Product_Edit" name="product_edit"></block>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit" name="product_edit">
+ <container name="product-type-tabs" label="Tabs">
+ </container>
+ </block>
<block type="Mage_Adminhtml_Block_Catalog_Product_Edit_AttributeSet" name="attribute-set-info" template="Mage_Adminhtml::catalog/product/edit/attribute_set.phtml"></block>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_NewCategory" name="new-category" template="Mage_Adminhtml::catalog/product/edit/category/new/form.phtml"/>
</reference>
<reference name="left">
<block type="Mage_Backend_Block_Store_Switcher" name="store_switcher" before="-"></block>
<block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs" name="product_tabs"></block>
</reference>
<reference name="js">
- <block type="Mage_Core_Block_Template" name="change-attribute-set" template="Mage_Adminhtml::catalog/product/change_attribute_set_widget.phtml" />
- <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="change-attribute-set" template="Mage_Adminhtml::catalog/product/change_attribute_set_widget.phtml"/>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_NewCategory" name="new-category-js" template="Mage_Adminhtml::catalog/product/edit/category/new/js.phtml"/>
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Js" template="catalog/product/js.phtml" name="catalog_product_js"/>
+ <block type="Mage_Core_Block_Template" template="Mage_Adminhtml::catalog/wysiwyg/js.phtml"/>
</reference>
</adminhtml_catalog_product_edit>
@@ -143,8 +157,92 @@
</container>
</adminhtml_catalog_product_relatedgrid>
+ <adminhtml_catalog_product_superconfig_config>
+ <reference name="admin.product.edit.tab.super.config.grid.container">
+ <block type="Mage_Backend_Block_Widget_Grid" name="admin.product.edit.tab.super.config.grid" as="grid">
+ <arguments>
+ <id>configurable_associated_products_grid</id>
+ <dataSource type="object">Mage_Catalog_Model_Resource_Product_Collection_AssociatedProduct</dataSource>
+ <use_ajax>true</use_ajax>
+ <default_sort>entity_id</default_sort>
+ <default_dir>DESC</default_dir>
+ <save_parameters_in_session>0</save_parameters_in_session>
+ <grid_url type="url">
+ <path>*/*/superConfig</path>
+ <params>
+ <_current>1</_current>
+ </params>
+ </grid_url>
+ </arguments>
+ <block type="Mage_Catalog_Block_Product_Configurable_AssociatedSelector_Backend_Grid_ColumnSet" as="grid.columnSet"
+ name="admin.product.edit.tab.super.config.grid.columnSet">
+ <arguments>
+ <id>super_product_links</id>
+ </arguments>
+ <block type="Mage_Backend_Block_Widget_Grid_Column" as="entity_id">
+ <arguments>
+ <header translate="true" module="Mage_Core">ID</header>
+ <width>60px</width>
+ <type>text</type>
+ <index>entity_id</index>
+ <id>entity_id</id>
+ <filter>0</filter>
+ <sortable>1</sortable>
+ <column_css_class>associated-product-id</column_css_class>
+ </arguments>
+ </block>
+ <block type="Mage_Backend_Block_Widget_Grid_Column" as="name">
+ <arguments>
+ <header translate="true" module="Mage_Core">Name</header>
+ <type>text</type>
+ <index>name</index>
+ <id>name</id>
+ <filter>0</filter>
+ <sortable>1</sortable>
+ <column_css_class>associated-product-name</column_css_class>
+ </arguments>
+ </block>
+ <block type="Mage_Backend_Block_Widget_Grid_Column" as="price">
+ <arguments>
+ <header translate="true" module="Mage_Core">Price</header>
+ <type>currency</type>
+ <index>price</index>
+ <id>price</id>
+ <filter>0</filter>
+ <sortable>1</sortable>
+ <column_css_class>associated-product-price</column_css_class>
+ </arguments>
+ </block>
+ <block type="Mage_Backend_Block_Widget_Grid_Column" as="sku" name="admin.product.edit.tab.super.config.grid.sku">
+ <arguments>
+ <header translate="true" module="Mage_Core">SKU</header>
+ <type>text</type>
+ <index>sku</index>
+ <id>sku</id>
+ <filter>0</filter>
+ <sortable>1</sortable>
+ <column_css_class>associated-product-sku</column_css_class>
+ </arguments>
+ </block>
+ <block type="Mage_Backend_Block_Widget_Grid_Column" as="weight">
+ <arguments>
+ <header translate="true" module="Mage_Core">Weight</header>
+ <type>text</type>
+ <index>weight</index>
+ <id>weight</id>
+ <filter>0</filter>
+ <sortable>1</sortable>
+ <column_css_class>associated-product-weight</column_css_class>
+ </arguments>
+ </block>
+ </block>
+ </block>
+ </reference>
+ </adminhtml_catalog_product_superconfig_config>
+
<adminhtml_catalog_product_superconfig>
- <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config_Grid" name="admin.product.edit.tab.super.config.grid" output="1" />
+ <update handle="adminhtml_catalog_product_superconfig_config"/>
+ <container output="1" name="admin.product.edit.tab.super.config.grid.container" label="grid"></container>
</adminhtml_catalog_product_superconfig>
<adminhtml_catalog_product_alertspricegrid>
@@ -207,8 +305,27 @@
<!--
Layout handle for simple products
-->
-
- <adminhtml_catalog_product_simple />
+ <adminhtml_catalog_product_simple>
+ <update handle="adminhtml_catalog_product_superconfig_config"/>
+ <reference name="product_tabs">
+ <action method="addTab"><name>downloadable_items</name><block>Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable</block></action>
+ </reference>
+ <reference name="product-type-tabs">
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config" name="admin.product.edit.tab.super.config.grid.container"></block>
+ </reference>
+ </adminhtml_catalog_product_simple>
+<!--
+Layout handle for virtual products
+-->
+ <adminhtml_catalog_product_virtual>
+ <update handle="adminhtml_catalog_product_superconfig_config"/>
+ <reference name="product_tabs">
+ <action method="addTab"><name>downloadable_items</name><block>Mage_Downloadable_Block_Adminhtml_Catalog_Product_Edit_Tab_Downloadable</block></action>
+ </reference>
+ <reference name="product-type-tabs">
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config" name="admin.product.edit.tab.super.config.grid.container"></block>
+ </reference>
+ </adminhtml_catalog_product_virtual>
<!--
Layout handle for grouped products
@@ -249,22 +366,16 @@ Layout handle for configurable products
-->
<adminhtml_catalog_product_configurable_new>
- <reference name="product_tabs">
- <action method="addTab">
- <name>configurable</name>
- <block>Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config</block>
- </action>
- <action method="bindShadowTabs">
- <first>configurable</first>
- <second>customer_options</second>
- </action>
+ <update handle="adminhtml_catalog_product_superconfig_config"/>
+ <reference name="product-type-tabs">
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config" name="admin.product.edit.tab.super.config.grid.container"></block>
</reference>
</adminhtml_catalog_product_configurable_new>
<adminhtml_catalog_product_configurable>
- <reference name="product_tabs">
- <action method="addTab"><name>configurable</name><block>Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config</block></action>
- <action method="bindShadowTabs"><first>configurable</first><second>customer_options</second></action>
+ <update handle="adminhtml_catalog_product_superconfig_config"/>
+ <reference name="product-type-tabs">
+ <block type="Mage_Adminhtml_Block_Catalog_Product_Edit_Tab_Super_Config" name="admin.product.edit.tab.super.config.grid.container"></block>
</reference>
</adminhtml_catalog_product_configurable>
View
61 app/code/core/Mage/Adminhtml/view/adminhtml/catalog/base-image-uploader.css
@@ -0,0 +1,61 @@
+/**
+ * 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_Adminhtml
+ * @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
+ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
+ */
+
+#product-edit-form-tabs .base-image-uploader {
+ max-height: 265px;
+ max-width: 180px;
+}
+
+#product-edit-form-tabs > div:first-of-type {
+ min-width: 940px;
+}
+
+#product-edit-form-tabs > div:first-of-type .hor-scroll {
+ width: auto;
+ padding-right: 200px;
+ overflow: visible;
+ position: relative;
+}
+
+#product-edit-form-tabs #image_image {
+ position: absolute;
+ right: 0;
+}
+
+#product-edit-form-tabs #qty {
+ width: 50px;
+ margin-right: 16px;
+ text-align: right;
+ padding-right: 3px;
+}
+
+#product-edit-form-tabs #quantity_and_stock_status {
+ width: 204px;
+}
+
+#product-edit-form-tabs #short_description {
+ height: auto;
+ min-height: 3em;
+}
View
4 ...tml/catalog/jquery.base-image-uploader.js → .../adminhtml/catalog/base-image-uploader.js
@@ -18,7 +18,7 @@
* needs please refer to http://www.magentocommerce.com for more information.
*
* @category Mage
- * @package js
+ * @package Mage_Adminhtml
* @copyright Copyright (c) 2012 X.commerce, Inc. (http://www.magentocommerce.com)
* @license http://o