Flagbit_ChangeAttributeSet - Version 2.0.0

Version Notes

In Magento every product has a fixed attibute set. This module enables you to switch it.

Download this release

Release Info

Developer Magento Core Team
Extension Flagbit_ChangeAttributeSet
Version 2.0.0
Comparing to
See all releases


Code changes from version 1.0.4 to 2.0.0

app/code/community/Flagbit/ChangeAttributeSet/Block/ProductGrid.php DELETED
@@ -1,66 +0,0 @@
1
- <?php
2
- /* *
3
- * This script is part of the TypoGento project *
4
- * *
5
- * TypoGento is free software; you can redistribute it and/or modify it *
6
- * under the terms of the GNU General Public License version 2 as *
7
- * published by the Free Software Foundation. *
8
- * *
9
- * This script is distributed in the hope that it will be useful, but *
10
- * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
11
- * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
- * Public License for more details. *
13
- * */
14
-
15
- /**
16
- * ChangeAttributeSet ProductGrid Block
17
- *
18
- * @version $Id: ProductGrid.php 282 2010-04-27 14:42:36Z fuhr $
19
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
20
- */
21
- class Flagbit_ChangeAttributeSet_Block_ProductGrid
22
- extends Mage_Adminhtml_Block_Catalog_Product_Grid
23
- {
24
- /**
25
- * Class constructor
26
- *
27
- * Calls the parent constructor
28
- */
29
- public function __construct() {
30
- parent::__construct ();
31
- }
32
-
33
- /**
34
- * Prepares massaction
35
- *
36
- * @return Flagbit_ChangeAttributeSet_Block_ProductGrid
37
- */
38
- protected function _prepareMassaction()
39
- {
40
- parent::_prepareMassaction();
41
- $statuses = Mage::getSingleton('catalog/product_status')->getOptionArray();
42
-
43
- $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
44
- ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
45
- ->load()
46
- ->toOptionHash();
47
-
48
- array_unshift($statuses, array('label'=>'', 'value'=>''));
49
-
50
- $this->getMassactionBlock()->addItem('attribute_set', array(
51
- 'label'=> Mage::helper('catalog')->__('Change attribute set'),
52
- 'url' => $this->getUrl('*/*/changeattributeset', array('_current'=>true)),
53
- 'additional' => array(
54
- 'visibility' => array(
55
- 'name' => 'attribute_set',
56
- 'type' => 'select',
57
- 'class' => 'required-entry',
58
- 'label' => Mage::helper('catalog')->__('Attribute Set'),
59
- 'values' => $sets
60
- )
61
- )
62
- ));
63
-
64
- return $this;
65
- }
66
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Flagbit/ChangeAttributeSet/Model/Observer.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /* *
3
+ * This script is part of the ChangeAttributeSet project *
4
+ * *
5
+ * TypoGento is free software; you can redistribute it and/or modify it *
6
+ * under the terms of the GNU General Public License version 2 as *
7
+ * published by the Free Software Foundation. *
8
+ * *
9
+ * This script is distributed in the hope that it will be useful, but *
10
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
11
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General *
12
+ * Public License for more details. *
13
+ * */
14
+
15
+ /**
16
+ * ChangeAttributeSet Observer Model
17
+ *
18
+ * @version $Id: ProductController.php 282 2010-04-27 14:42:36Z fuhr $
19
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
20
+ */
21
+ class Flagbit_ChangeAttributeSet_Model_Observer
22
+ {
23
+
24
+ /**
25
+ * add Massaction Option to Productgrid
26
+ *
27
+ * @param $observer Varien_Event
28
+ */
29
+ public function addMassactionToProductGrid($observer)
30
+ {
31
+ $block = $observer->getBlock();
32
+ if($block instanceof Mage_Adminhtml_Block_Catalog_Product_Grid){
33
+
34
+ $sets = Mage::getResourceModel('eav/entity_attribute_set_collection')
35
+ ->setEntityTypeFilter(Mage::getModel('catalog/product')->getResource()->getTypeId())
36
+ ->load()
37
+ ->toOptionHash();
38
+
39
+ $block->getMassactionBlock()->addItem('flagbit_changeattributeset', array(
40
+ 'label'=> Mage::helper('catalog')->__('Change attribute set'),
41
+ 'url' => $block->getUrl('*/*/changeattributeset', array('_current'=>true)),
42
+ 'additional' => array(
43
+ 'visibility' => array(
44
+ 'name' => 'attribute_set',
45
+ 'type' => 'select',
46
+ 'class' => 'required-entry',
47
+ 'label' => Mage::helper('catalog')->__('Attribute Set'),
48
+ 'values' => $sets
49
+ )
50
+ )
51
+ ));
52
+ }
53
+ }
54
+
55
+ }
app/code/community/Flagbit/ChangeAttributeSet/controllers/{IndexController.php → Adminhtml/Catalog/ProductController.php} RENAMED
@@ -1,6 +1,6 @@
1
  <?php
2
  /* *
3
- * This script is part of the TypoGento project *
4
  * *
5
  * TypoGento is free software; you can redistribute it and/or modify it *
6
  * under the terms of the GNU General Public License version 2 as *
@@ -12,29 +12,19 @@
12
  * Public License for more details. *
13
  * */
14
 
15
- require_once 'app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php';
16
-
17
  /**
18
- * ChangeAttributeSet Index Controller
19
  *
20
- * @version $Id: IndexController.php 282 2010-04-27 14:42:36Z fuhr $
21
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
22
  */
23
- class Flagbit_ChangeAttributeSet_IndexController
24
- extends Mage_Adminhtml_Catalog_ProductController
25
  {
26
- /**
27
- * Class Constructor
28
- * call the parent Constructor
29
- */
30
- public function __constuct(){
31
- parent::__construct();
32
- }
33
 
34
  /**
35
  * Product list page
36
  */
37
- public function indexAction()
38
  {
39
  $productIds = $this->getRequest()->getParam('product');
40
  $storeId = (int)$this->getRequest()->getParam('store', 0);
1
  <?php
2
  /* *
3
+ * This script is part of the ChangeAttributeSet project *
4
  * *
5
  * TypoGento is free software; you can redistribute it and/or modify it *
6
  * under the terms of the GNU General Public License version 2 as *
12
  * Public License for more details. *
13
  * */
14
 
 
 
15
  /**
16
+ * ChangeAttributeSet Controller
17
  *
18
+ * @version $Id: ProductController.php 642 2011-03-14 17:21:28Z weller $
19
  * @license http://opensource.org/licenses/gpl-license.php GNU Public License, version 2
20
  */
21
+ class Flagbit_ChangeAttributeSet_Adminhtml_Catalog_ProductController extends Mage_Adminhtml_Controller_Action
 
22
  {
 
 
 
 
 
 
 
23
 
24
  /**
25
  * Product list page
26
  */
27
+ public function changeattributesetAction()
28
  {
29
  $productIds = $this->getRequest()->getParam('product');
30
  $storeId = (int)$this->getRequest()->getParam('store', 0);
app/code/community/Flagbit/ChangeAttributeSet/etc/config.xml CHANGED
@@ -2,38 +2,41 @@
2
  <config>
3
  <modules>
4
  <Flagbit_ChangeAttributeSet>
5
- <active>true</active>
6
- <codePool>community</codePool>
7
- <version>1.0.4</version>
8
  </Flagbit_ChangeAttributeSet>
9
  </modules>
10
 
11
  <global>
12
- <blocks>
13
- <adminhtml>
14
- <rewrite>
15
- <catalog_product_grid>Flagbit_ChangeAttributeSet_Block_ProductGrid</catalog_product_grid>
16
- </rewrite>
17
- </adminhtml>
18
- </blocks>
19
-
20
- <rewrite>
21
- <flagbit_form_index>
22
- <from><![CDATA[#^/{adminhtml}/catalog_product/changeattributeset/.*#]]></from>
23
- <to>/changeattributeset/</to>
24
- </flagbit_form_index>
25
- </rewrite>
26
  </global>
 
 
 
 
 
 
 
 
 
 
 
 
 
27
 
28
  <admin>
29
  <routers>
30
- <flagbit_changeattributeset>
31
- <use>admin</use>
32
  <args>
33
- <module>Flagbit_ChangeAttributeSet</module>
34
- <frontName>changeattributeset</frontName>
 
35
  </args>
36
- </flagbit_changeattributeset>
37
  </routers>
38
- </admin>
 
39
  </config>
2
  <config>
3
  <modules>
4
  <Flagbit_ChangeAttributeSet>
5
+ <version>2.0.0</version>
 
 
6
  </Flagbit_ChangeAttributeSet>
7
  </modules>
8
 
9
  <global>
10
+ <models>
11
+ <flagbit_changeattributeset>
12
+ <class>Flagbit_ChangeAttributeSet_Model</class>
13
+ </flagbit_changeattributeset>
14
+ </models>
 
 
 
 
 
 
 
 
 
15
  </global>
16
+ <adminhtml>
17
+ <events>
18
+ <adminhtml_block_html_before>
19
+ <observers>
20
+ <flagbit_changeattributeset>
21
+ <type>singleton</type>
22
+ <class>flagbit_changeattributeset/observer</class>
23
+ <method>addMassactionToProductGrid</method>
24
+ </flagbit_changeattributeset>
25
+ </observers>
26
+ </adminhtml_block_html_before>
27
+ </events>
28
+ </adminhtml>
29
 
30
  <admin>
31
  <routers>
32
+ <adminhtml>
 
33
  <args>
34
+ <modules>
35
+ <Flagbit_ChangeAttributeSet before="Mage_Adminhtml">Flagbit_ChangeAttributeSet_Adminhtml</Flagbit_ChangeAttributeSet>
36
+ </modules>
37
  </args>
38
+ </adminhtml>
39
  </routers>
40
+ </admin>
41
+
42
  </config>
package.xml CHANGED
@@ -1,18 +1,18 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Flagbit_ChangeAttributeSet</name>
4
- <version>1.0.4</version>
5
  <stability>stable</stability>
6
- <license uri="http://www.opensource.org/licenses/gpl-license.php">GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>In Magento every product has a fixed attibute set. This module enables you to switch it.</summary>
10
- <description>In Magento every product has a fixed attribute set that cannot be changed after the product's creation. This is in many productive contexts not an acceptable limitation. This module overrides the standard behaviour and makes it possible to change attribute sets after the item's creation making Magento even more flexible. :) Fixed 404 Redirect Bug.</description>
11
  <notes>In Magento every product has a fixed attibute set. This module enables you to switch it.</notes>
12
- <authors><author><name>Flagbit GmbH </name><user>auto-converted</user><email>magento@flagbit.de</email></author></authors>
13
- <date>2010-06-07</date>
14
- <time>16:25:02</time>
15
- <contents><target name="magecommunity"><dir name="Flagbit"><dir name="ChangeAttributeSet"><dir name="Block"><file name="ProductGrid.php" hash="408ad70ad00ceafdd01198b7abac3f82"/></dir><dir name="controllers"><file name="IndexController.php" hash="e44e63dd4a7f6b2d47598e921c562e46"/></dir><dir name="etc"><file name="config.xml" hash="59b52c384688f9f73d86ccefcb7166df"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flagbit_ChangeAttributeSet.xml" hash="90087134613f57e05ebc216a6e576d4a"/></dir></target></contents>
16
  <compatible/>
17
- <dependencies><required><package><name>TBT_Enhancedgrid</name><channel>community</channel><min></min><max></max></package></required></dependencies>
18
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Flagbit_ChangeAttributeSet</name>
4
+ <version>2.0.0</version>
5
  <stability>stable</stability>
6
+ <license>GPL</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>In Magento every product has a fixed attibute set. This module enables you to switch it.</summary>
10
+ <description>In Magento every product has a fixed attribute set that cannot be changed after the products creation. This is in many productive contexts not an acceptable limitation. This module overrides the standard behaviour and makes it possible to change attribute sets after the items creation making Magento even more flexible. :) Fixed 404 Redirect Bug.</description>
11
  <notes>In Magento every product has a fixed attibute set. This module enables you to switch it.</notes>
12
+ <authors><author><name>Flagbit GmbH Co. KG</name><user>auto-converted</user><email>magento@flagbit.de</email></author></authors>
13
+ <date>2011-03-14</date>
14
+ <time>18:22:00</time>
15
+ <contents><target name="magecommunity"><dir name="Flagbit"><dir name="ChangeAttributeSet"><dir name="controllers"><dir name="Adminhtml"><dir name="Catalog"><file name="ProductController.php" hash="570196bb060a10c735da6ea6ed148f73"/></dir></dir></dir><dir name="etc"><file name="config.xml" hash="337448ff175a567af045f03d5ce92067"/></dir><dir name="Model"><file name="Observer.php" hash="9b948ae7eb6edcd56767d708fd1ef954"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Flagbit_ChangeAttributeSet.xml" hash="90087134613f57e05ebc216a6e576d4a"/></dir></target></contents>
16
  <compatible/>
17
+ <dependencies/>
18
  </package>