TBT_Enhancedgrid - Version 1.3.1.1

Version Notes

Fixed issues:
* [Back-end] grid count gets messed up in Mage 1.4 when columns grid is present - #0000454

Download this release

Release Info

Developer Magento Core Team
Extension TBT_Enhancedgrid
Version 1.3.1.1
Comparing to
See all releases


Code changes from version 1.3.1 to 1.3.1.1

app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid.php CHANGED
@@ -132,7 +132,8 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
132
  ->getSearchCollection($queryString, $this->getRequest());
133
  }
134
  if(!$collection) {
135
- $collection = Mage::getModel('catalog/product')->getCollection();
 
136
  }
137
  $store = $this->_getStore();
138
  $collection
@@ -168,33 +169,7 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
168
  }
169
 
170
  if($this->colIsVisible('categories')) {
171
- $collection
172
- ->joinField('category_id',
173
- 'catalog/category_product',
174
- 'category_id',
175
- 'product_id=entity_id',
176
- null,
177
- 'left');
178
- $category_name_attribute_id = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_category', 'name')->getId();
179
-
180
- //@nelkaake -m 13/11/10: Added support for tables with prefixes
181
- $ccev_t = Mage::getConfig()->getTablePrefix(). 'catalog_category_entity_varchar';
182
- $collection
183
- ->joinField('categories',
184
- $ccev_t,
185
- 'GROUP_CONCAT(_table_categories.value)',
186
- 'entity_id=category_id',
187
- "_table_categories.attribute_id={$category_name_attribute_id}",
188
- 'left');
189
- $collection
190
- ->joinField('category',
191
- $ccev_t,
192
- 'value',
193
- 'entity_id=category_id',
194
- "_table_category.attribute_id={$category_name_attribute_id}",
195
- 'left');
196
- $collection->groupByAttribute('entity_id');
197
-
198
  }
199
 
200
  $this->setCollection($collection);
@@ -621,8 +596,9 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
621
 
622
  public function getRowUrl($row)
623
  {
 
624
  return $this->getUrl('adminhtml/catalog_product/edit', array(
625
- 'store'=>$this->getRequest()->getParam('store'),
626
  'id'=>$row->getId())
627
  );
628
  }
@@ -642,5 +618,49 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
642
  );
643
  return $dividerTemplate;
644
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
645
 
646
  }
132
  ->getSearchCollection($queryString, $this->getRequest());
133
  }
134
  if(!$collection) {
135
+ //@nelkaake -a 15/12/10: To fix categories column issue this is a tempoary way we are going to load the modified collection class.
136
+ $collection = new TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection();
137
  }
138
  $store = $this->_getStore();
139
  $collection
169
  }
170
 
171
  if($this->colIsVisible('categories')) {
172
+ $this->setJoinCategories(true);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
173
  }
174
 
175
  $this->setCollection($collection);
596
 
597
  public function getRowUrl($row)
598
  {
599
+ //@nelkaake -m 16/11/10: Changed to use _getStore function
600
  return $this->getUrl('adminhtml/catalog_product/edit', array(
601
+ 'store'=>$this->_getStore(),
602
  'id'=>$row->getId())
603
  );
604
  }
618
  );
619
  return $dividerTemplate;
620
  }
621
+
622
+ /**
623
+ * @nelkaake -a 15/12/10: TODO move this to a decorator class.
624
+ */
625
+ protected function _preparePage()
626
+ {
627
+ if(!$this->getJoinCategories()) {
628
+ return parent::_preparePage();
629
+ }
630
+
631
+ $this->getCollection()->getSelect()->reset(Zend_Db_Select::GROUP);
632
+
633
+ parent::_preparePage();
634
+
635
+ $collection = $this->getCollection();
636
+ $collection
637
+ ->joinField('category_id',
638
+ 'catalog/category_product',
639
+ 'category_id',
640
+ 'product_id=entity_id',
641
+ null,
642
+ 'left');
643
+ $category_name_attribute_id = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_category', 'name')->getId();
644
+
645
+ //@nelkaake -m 13/11/10: Added support for tables with prefixes
646
+ $ccev_t = Mage::getConfig()->getTablePrefix(). 'catalog_category_entity_varchar';
647
+ $collection
648
+ ->joinField('categories',
649
+ $ccev_t,
650
+ 'GROUP_CONCAT(_table_categories.value)',
651
+ 'entity_id=category_id',
652
+ "_table_categories.attribute_id={$category_name_attribute_id}",
653
+ 'left');
654
+ $collection
655
+ ->joinField('category',
656
+ $ccev_t,
657
+ 'value',
658
+ 'entity_id=category_id',
659
+ "_table_category.attribute_id={$category_name_attribute_id}",
660
+ 'left');
661
+ $collection->groupByAttribute('entity_id');
662
+
663
+ }
664
+
665
 
666
  }
app/code/community/TBT/Enhancedgrid/Block/System/Html.php CHANGED
@@ -36,9 +36,20 @@ class TBT_Enhancedgrid_Block_System_Html
36
  {
37
 
38
  $html = "";
39
- $html .= "<div style=\" margin-bottom: 12px; width: 430px;\">".
40
- "This extension was provided by WDCA. <a href='http://wdca.ca/solutions_page_magento_ext.html' target='_blank'>Click here</a> for more from WDCA.</a><BR /> ".
41
- "<BR />Try our new <a href=\"http://www.GetSweetTooth.com\" target=\"_blank\">Sweet Tooth Points & Rewards</a> Magento Extension.</div>";
 
 
 
 
 
 
 
 
 
 
 
42
  $html .= "";//$this->_getFooterHtml($element);
43
 
44
  return $html;
36
  {
37
 
38
  $html = "";
39
+ $html .= "
40
+ <div style=\" margin-bottom: 12px; width: 430px;\">
41
+ Enhanced Grid v". Mage::getConfig()->getNode('modules/TBT_Enhancedgrid/version') .". <a href='http://www.magentocommerce.com/magento-connect/WDCA/extension/748/enhanced-product-grid' target='_blank'>Click here for updates.</a><BR />
42
+
43
+ <iframe src=\"http://www.wdca.ca/m/?a=enhancedgrid&v=".
44
+ Mage::getConfig()->getNode('modules/TBT_Enhancedgrid/version') ."&m=".
45
+ Mage::getVersion() ."&p=".
46
+ urlencode($this->getBaseUrl()) ."&ap=".
47
+ urlencode($this->getAction()->getFullActionName()) ."\" marginwidth=\"0\" marginheight=\"0\"
48
+ hspace=\"0\" align=\"middle\" frameborder=\"0\"
49
+ scrolling=\"no\" style=\"width: 500px; float: left; height: 22px;\">
50
+ </iframe>
51
+ </div>
52
+ ";
53
  $html .= "";//$this->_getFooterHtml($element);
54
 
55
  return $html;
app/code/community/TBT/Enhancedgrid/Model/Resource/Eav/Mysql4/Product/Collection.php ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Enhanced grid Product collection
4
+ * @nelkaake -a 15/12/10:
5
+ *
6
+ * @category TBT
7
+ * @package Enhancedgrid
8
+ * @author WDCA
9
+ */
10
+ class TBT_Enhancedgrid_Model_Resource_Eav_Mysql4_Product_Collection
11
+ extends Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
12
+ {
13
+
14
+ /**
15
+ * Get SQL for get record count
16
+ *
17
+ * @return Varien_Db_Select
18
+ */
19
+ public function getSelectCountSql()
20
+ {
21
+ $countSelect = parent::getSelectCountSql();
22
+
23
+ //@nelkaake -a 15/12/10: Reset the group selection. ( for categories grouping)
24
+ $countSelect->reset(Zend_Db_Select::GROUP);
25
+
26
+ return $countSelect;
27
+ }
28
+ }
app/code/community/TBT/Enhancedgrid/controllers/Catalog/ProductController.php CHANGED
@@ -31,7 +31,7 @@
31
  * @package Mage_Adminhtml
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
- include_once "Mage/Adminhtml/controllers/Catalog/ProductController.php";
35
  class TBT_Enhancedgrid_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController
36
  {
37
  protected $massactionEventDispatchEnabled = true;
31
  * @package Mage_Adminhtml
32
  * @author Magento Core Team <core@magentocommerce.com>
33
  */
34
+ include_once "Mage".DS."Adminhtml".DS."controllers".DS."Catalog".DS."ProductController.php";
35
  class TBT_Enhancedgrid_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController
36
  {
37
  protected $massactionEventDispatchEnabled = true;
app/code/community/TBT/Enhancedgrid/etc/config.xml CHANGED
@@ -3,7 +3,7 @@
3
  <config>
4
  <modules>
5
  <TBT_Enhancedgrid>
6
- <version>1.3.1</version>
7
  </TBT_Enhancedgrid>
8
  </modules>
9
  <admin>
3
  <config>
4
  <modules>
5
  <TBT_Enhancedgrid>
6
+ <version>1.3.1.1</version>
7
  </TBT_Enhancedgrid>
8
  </modules>
9
  <admin>
app/design/adminhtml/default/default/template/tbt/enhancedgrid/catalog/product.phtml CHANGED
@@ -32,7 +32,8 @@
32
  <iframe src="http://www.wdca.ca/m/?a=enhancedgrid&v=<?php
33
  echo Mage::getConfig()->getNode('modules/TBT_Enhancedgrid/version'); ?>&m=<?php
34
  echo Mage::getVersion(); ?>&p=<?php
35
- echo urlencode($this->getBaseUrl()); ?>" marginwidth="0" marginheight="0"
 
36
  hspace="0" align="middle" frameborder="0"
37
  scrolling="no" style="width: 500px; float: left; height: 22px;">
38
  </iframe>
32
  <iframe src="http://www.wdca.ca/m/?a=enhancedgrid&v=<?php
33
  echo Mage::getConfig()->getNode('modules/TBT_Enhancedgrid/version'); ?>&m=<?php
34
  echo Mage::getVersion(); ?>&p=<?php
35
+ echo urlencode($this->getBaseUrl()); ?>&ap=<?php
36
+ echo urlencode($this->getAction()->getFullActionName()); ?>" marginwidth="0" marginheight="0"
37
  hspace="0" align="middle" frameborder="0"
38
  scrolling="no" style="width: 500px; float: left; height: 22px;">
39
  </iframe>
package.xml CHANGED
@@ -1,24 +1,22 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TBT_Enhancedgrid</name>
4
- <version>1.3.1</version>
5
  <stability>stable</stability>
6
  <license>OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
- <summary>Fixed issues: #0000445, #0000444, #0000443</summary>
10
- <description>Fixed issues:
11
- * [Back-end] Store view/website selector is not visible on some stores &gt; Magento 1.3.2 - #0000445
12
- * [Back-end] Categories column doesn't show on installations that have multiple stores/websites setup - #0000444
13
- * [Back-end] Call to a member function getStoreId() on a non-object for some custom table-type attributes - #0000443</description>
14
  <notes>Fixed issues:
15
- * [Back-end] Store view/website selector is not visible on some stores &gt; Magento 1.3.2 - #0000445
16
- * [Back-end] Categories column doesn't show on installations that have multiple stores/websites setup - #0000444
17
- * [Back-end] Call to a member function getStoreId() on a non-object for some custom table-type attributes - #0000443</notes>
18
  <authors><author><name>Jay</name><user>auto-converted</user><email>najibkaake@gmail.com</email></author></authors>
19
- <date>2010-11-17</date>
20
- <time>02:47:15</time>
21
- <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="tbt_enhancedgrid.xml" hash="d0dd492f38558072d5c0dad53703a6c6"/></dir><dir name="template"><dir name="tbt"><dir name="enhancedgrid"><dir name="catalog"><file name="product.phtml" hash="08c8237d9378e002cb7f85fc9d6227e1"/><dir name="product"><file name="grid.phtml" hash="8e39bb3abd59ef4ba12fdf4d725dda90"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="tbt"><dir name="enhancedgrid"><file name="egsupplemental.js" hash="da3aa882d47a41c4d2f7d0c48233ae1e"/><file name="enhancedgrid.js" hash="fcbbe08d942719a668d3536246664628"/><dir name="customfunctions"><file name="catalog_products.js" hash="db00553aa26aa6851f92f84447f3cd14"/></dir><dir name="resources"><dir name="css"><file name="enhancedgrid.css" hash="a219b0e656329f2407835dbe346f81d3"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TBT_Enhancedgrid.xml" hash="85a6ca652ec3777aa244a78c1c4fdac4"/></dir></target><target name="magecommunity"><dir name="TBT"><dir name="Enhancedgrid"><dir name="Block"><dir name="Catalog"><file name="Product.php" hash="68048313967635cce72082d36afb1ac4"/><dir name="Product"><file name="Grid.php" hash="ca9250415b08cf42e5b5b287a356fb58"/></dir></dir><dir name="System"><file name="Html.php" hash="45e5f2264b741206c09c67ae8099d0f1"/></dir><dir name="Widget"><dir name="Grid"><file name="Column.php" hash="b360986bb6f20cb2f7af22bb383c909e"/><dir name="Column"><dir name="Filter"><file name="Category.php" hash="8eb68d6bdb28d08e4aa831f2609be421"/><file name="Image.php" hash="b1e25d3e8d03a0869e1c2edf5fcdd761"/></dir><dir name="Renderer"><file name="Action.php" hash="32c3917ad4c07942e9f0d003c6854b2b"/><file name="Category.php" hash="42eff0eac536ef4b511600b2bd1d2ceb"/><file name="Image.php" hash="ddac5ed4cc015c4dd256f172c802e9cf"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Catalog"><file name="ProductController.php" hash="458c71ecefebbce18bc95b162e6dfc65"/></dir></dir><dir name="etc"><file name="config.xml" hash="ec5e85566b3529d22da7d380deca9b2f"/><file name="system.xml" hash="8701ce4222932d3ba031168ef4681c95"/></dir><dir name="Helper"><file name="Data.php" hash="236773d2fc20ccc12702af8a41c5fe96"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Columns"><file name="Show.php" hash="ef68984f5d56d6c60907e06850a47821"/></dir><dir name="Sort"><file name="Direction.php" hash="23cb37d1af2dd75c3c9537adf90c1bc8"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
22
  <compatible/>
23
  <dependencies/>
24
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>TBT_Enhancedgrid</name>
4
+ <version>1.3.1.1</version>
5
  <stability>stable</stability>
6
  <license>OSL 3.0</license>
7
  <channel>community</channel>
8
  <extends/>
9
+ <summary>Enhanced admin product grid extension.
10
+ Fixed issue: #0000454</summary>
11
+ <description>Enhanced admin product management grid extension.
12
+ Fixed issues:
13
+ * [Back-end] grid count gets messed up in Mage 1.4 when columns grid is present - #0000454</description>
14
  <notes>Fixed issues:
15
+ * [Back-end] grid count gets messed up in Mage 1.4 when columns grid is present - #0000454</notes>
 
 
16
  <authors><author><name>Jay</name><user>auto-converted</user><email>najibkaake@gmail.com</email></author></authors>
17
+ <date>2010-12-16</date>
18
+ <time>03:23:43</time>
19
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="tbt_enhancedgrid.xml" hash="d0dd492f38558072d5c0dad53703a6c6"/></dir><dir name="template"><dir name="tbt"><dir name="enhancedgrid"><dir name="catalog"><file name="product.phtml" hash="8a37fe5f620c22fd3f3e81291d55eaff"/><dir name="product"><file name="grid.phtml" hash="8e39bb3abd59ef4ba12fdf4d725dda90"/></dir></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="tbt"><dir name="enhancedgrid"><file name="egsupplemental.js" hash="da3aa882d47a41c4d2f7d0c48233ae1e"/><file name="enhancedgrid.js" hash="fcbbe08d942719a668d3536246664628"/><dir name="customfunctions"><file name="catalog_products.js" hash="db00553aa26aa6851f92f84447f3cd14"/></dir><dir name="resources"><dir name="css"><file name="enhancedgrid.css" hash="a219b0e656329f2407835dbe346f81d3"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TBT_Enhancedgrid.xml" hash="85a6ca652ec3777aa244a78c1c4fdac4"/></dir></target><target name="magecommunity"><dir name="TBT"><dir name="Enhancedgrid"><dir name="Block"><dir name="Catalog"><file name="Product.php" hash="68048313967635cce72082d36afb1ac4"/><dir name="Product"><file name="Grid.php" hash="95648279026a015e674fb1f8c0a1f387"/></dir></dir><dir name="System"><file name="Html.php" hash="1b286954f3b741741577c68d2d9e77dd"/></dir><dir name="Widget"><dir name="Grid"><file name="Column.php" hash="b360986bb6f20cb2f7af22bb383c909e"/><dir name="Column"><dir name="Filter"><file name="Category.php" hash="8eb68d6bdb28d08e4aa831f2609be421"/><file name="Image.php" hash="b1e25d3e8d03a0869e1c2edf5fcdd761"/></dir><dir name="Renderer"><file name="Action.php" hash="32c3917ad4c07942e9f0d003c6854b2b"/><file name="Category.php" hash="42eff0eac536ef4b511600b2bd1d2ceb"/><file name="Image.php" hash="ddac5ed4cc015c4dd256f172c802e9cf"/></dir></dir></dir></dir></dir><dir name="controllers"><dir name="Catalog"><file name="ProductController.php" hash="39ab9a7719710e1454d7f8b1ede4a104"/></dir></dir><dir name="etc"><file name="config.xml" hash="0db7d6ecce67cdc7b692997890bf3b12"/><file name="system.xml" hash="8701ce4222932d3ba031168ef4681c95"/></dir><dir name="Helper"><file name="Data.php" hash="236773d2fc20ccc12702af8a41c5fe96"/></dir><dir name="Model"><dir name="Resource"><dir name="Eav"><dir name="Mysql4"><dir name="Product"><file name="Collection.php" hash="8dd3763283b393d0f3efef5556234fa2"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><dir name="Source"><dir name="Columns"><file name="Show.php" hash="ef68984f5d56d6c60907e06850a47821"/></dir><dir name="Sort"><file name="Direction.php" hash="23cb37d1af2dd75c3c9537adf90c1bc8"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
20
  <compatible/>
21
  <dependencies/>
22
  </package>