Permalink
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...
magento-team committed Dec 7, 2012
1 parent 71f6961 commit 975952e5466659bd685c7a1d1af08b2752485ff3
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
@@ -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
@@ -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 = '')
{
@@ -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();
@@ -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(
@@ -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;
+ }
}
@@ -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);
}
}
@@ -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');
+ }
+}
Oops, something went wrong.

0 comments on commit 975952e

Please sign in to comment.