Version Notes
Fixes 404 issues, adds a Categories and Date Added column options, msc Magento 1.4 incompatibilities, and more
Download this release
Release Info
Developer | Magento Core Team |
Extension | TBT_Enhancedgrid |
Version | 1.3 |
Comparing to | |
See all releases |
Code changes from version 1.2.1.1 to 1.3
- app/code/community/TBT/Enhancedgrid/Block/Catalog/Product.php +3 -11
- app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid.php +44 -8
- app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column.php +4 -7
- app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Filter/Category.php +4 -7
- app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Filter/Image.php +4 -4
- app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Renderer/Action.php +4 -5
- app/code/community/TBT/Enhancedgrid/Helper/Data.php +45 -6
- app/code/community/TBT/Enhancedgrid/Model/System/Config/Source/Columns/Show.php +2 -0
- app/code/community/TBT/Enhancedgrid/Model/System/Config/Source/Sort/Direction.php +7 -1
- app/code/community/TBT/Enhancedgrid/controllers/Catalog/ProductController.php +3 -6
- app/code/community/TBT/Enhancedgrid/etc/config.xml +10 -7
- app/design/adminhtml/default/default/template/tbt/enhancedgrid/catalog/product.phtml +11 -4
- package.xml +7 -8
app/code/community/TBT/Enhancedgrid/Block/Catalog/Product.php
CHANGED
@@ -18,19 +18,11 @@
|
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
-
* @copyright Copyright (c) 2008
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
-
|
27 |
-
/**
|
28 |
-
* Catalog manage products block
|
29 |
-
*
|
30 |
-
* @category Mage
|
31 |
-
* @package Mage_Adminhtml
|
32 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
33 |
-
*/
|
34 |
class TBT_Enhancedgrid_Block_Catalog_Product extends Mage_Adminhtml_Block_Catalog_Product
|
35 |
{
|
36 |
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
+
* @category WDCA
|
22 |
+
* @package TBT_Enhancedgrid
|
23 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
class TBT_Enhancedgrid_Block_Catalog_Product extends Mage_Adminhtml_Block_Catalog_Product
|
27 |
{
|
28 |
|
app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid.php
CHANGED
@@ -112,10 +112,22 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
112 |
public function getQueryStr() {
|
113 |
return urldecode($this->getParam('q'));
|
114 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
115 |
protected function _prepareCollection()
|
116 |
{
|
117 |
$collection = $this->getCollection();
|
118 |
-
|
|
|
|
|
119 |
$collection = Mage::helper('enhancedgrid')
|
120 |
->getSearchCollection($queryString, $this->getRequest());
|
121 |
}
|
@@ -134,7 +146,6 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
134 |
|
135 |
//$collection->addAttributeToSelect('attribute_set_id');
|
136 |
//$collection->addAttributeToSelect('type_id');
|
137 |
-
//$collection->addAttributeToSelect('image'); // TODO remove this
|
138 |
|
139 |
if ($store->getId()) {
|
140 |
//$collection->setStoreId($store->getId());
|
@@ -166,21 +177,24 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
166 |
'left');
|
167 |
$category_name_attribute_id = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_category', 'name')->getId();
|
168 |
|
|
|
|
|
169 |
$collection
|
170 |
->joinField('categories',
|
171 |
-
|
172 |
'GROUP_CONCAT(_table_categories.value)',
|
173 |
'entity_id=category_id',
|
174 |
"_table_categories.attribute_id={$category_name_attribute_id}",
|
175 |
'left');
|
176 |
$collection
|
177 |
->joinField('category',
|
178 |
-
|
179 |
'value',
|
180 |
'entity_id=category_id',
|
181 |
"_table_category.attribute_id={$category_name_attribute_id}",
|
182 |
'left');
|
183 |
$collection->groupByAttribute('entity_id');
|
|
|
184 |
}
|
185 |
|
186 |
$this->setCollection($collection);
|
@@ -197,12 +211,31 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
197 |
/**
|
198 |
* if the attribute has options an options entry will be
|
199 |
* added to $columnOptions
|
200 |
-
* TODO: load first
|
201 |
*/
|
202 |
private function loadColumnOptions($attr_code) {
|
203 |
$attr = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', $attr_code);
|
204 |
if(sizeof($attr->getData()) > 0) {
|
205 |
if($attr->getFrontendInput() == 'select') {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
$values = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
207 |
->setAttributeFilter($attr->getId())
|
208 |
->setStoreFilter($this->_getStore()->getId(), false)
|
@@ -218,12 +251,15 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
218 |
}
|
219 |
|
220 |
}
|
|
|
221 |
|
222 |
|
223 |
protected function _getStore()
|
224 |
{
|
225 |
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
226 |
-
|
|
|
|
|
227 |
}
|
228 |
|
229 |
|
@@ -417,12 +453,10 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
417 |
'index' => 'categories',
|
418 |
'sort_index' => 'category',
|
419 |
'filter_index' => 'category',
|
420 |
-
'type' => 'category',
|
421 |
));
|
422 |
}
|
423 |
}
|
424 |
|
425 |
-
|
426 |
// EG: Show all (other) needed columns.
|
427 |
$ignoreCols = array('id'=>true, 'websites'=>true,'status'=>true,'visibility'=>true,'qty'=>true,
|
428 |
'price'=>true,'sku'=>true,'attribute_set_id'=>true, 'type_id'=>true,'name'=>true,
|
@@ -436,6 +470,8 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
436 |
'tier_price' => array('type'=>'price', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Tier Price'), 'currency_code' => $currency),
|
437 |
'tax_class_id' => array('type'=>'text', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Tax Class ID')),
|
438 |
'special_to_date' => array('type'=>'date', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Spshl TO Date')),
|
|
|
|
|
439 |
'special_price' => array('type'=>'price', 'width'=>'30px', 'header'=> Mage::helper('catalog')->__('Special Price'), 'currency_code' => $currency),
|
440 |
'special_from_date' => array('type'=>'date', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Spshl FROM Date')),
|
441 |
'color' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Color')),
|
112 |
public function getQueryStr() {
|
113 |
return urldecode($this->getParam('q'));
|
114 |
}
|
115 |
+
/**
|
116 |
+
* get collection object
|
117 |
+
* //@nelkaake -a 13/11/10: this is just here for the codeassist function
|
118 |
+
*
|
119 |
+
* @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
|
120 |
+
*/
|
121 |
+
public function getCollection()
|
122 |
+
{
|
123 |
+
return parent::getCollection();
|
124 |
+
}
|
125 |
protected function _prepareCollection()
|
126 |
{
|
127 |
$collection = $this->getCollection();
|
128 |
+
//@nelkaake -m 13/11/10: Just made it a little nicer
|
129 |
+
$queryString = $this->getQueryStr();
|
130 |
+
if($queryString) {
|
131 |
$collection = Mage::helper('enhancedgrid')
|
132 |
->getSearchCollection($queryString, $this->getRequest());
|
133 |
}
|
146 |
|
147 |
//$collection->addAttributeToSelect('attribute_set_id');
|
148 |
//$collection->addAttributeToSelect('type_id');
|
|
|
149 |
|
150 |
if ($store->getId()) {
|
151 |
//$collection->setStoreId($store->getId());
|
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);
|
211 |
/**
|
212 |
* if the attribute has options an options entry will be
|
213 |
* added to $columnOptions
|
|
|
214 |
*/
|
215 |
private function loadColumnOptions($attr_code) {
|
216 |
$attr = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', $attr_code);
|
217 |
if(sizeof($attr->getData()) > 0) {
|
218 |
if($attr->getFrontendInput() == 'select') {
|
219 |
+
//@nelkaake -a 13/11/10:
|
220 |
+
if($attr->getSourceModel() != null) {
|
221 |
+
$sourcemodel = Mage::getModel($attr->getSourceModel());
|
222 |
+
if(method_exists($sourcemodel, 'getAllOptions')) {
|
223 |
+
try {
|
224 |
+
$values = $sourcemodel->getAllOptions();
|
225 |
+
|
226 |
+
$options = array();
|
227 |
+
foreach($values as $value) {
|
228 |
+
$options[$value['value']] = $value['label'];
|
229 |
+
}
|
230 |
+
//die($attr_code);
|
231 |
+
$this->columnOptions[$attr_code] = $options;
|
232 |
+
return;
|
233 |
+
} catch (Exception $e) {
|
234 |
+
Mage::log("Tried to get options for {$attr_code} using getAllOptions on {$attr->getSourceModel()}, but an exception occured: ". (String)$e);
|
235 |
+
}
|
236 |
+
}
|
237 |
+
}
|
238 |
+
//@nelkaake -a 13/11/10:
|
239 |
$values = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
240 |
->setAttributeFilter($attr->getId())
|
241 |
->setStoreFilter($this->_getStore()->getId(), false)
|
251 |
}
|
252 |
|
253 |
}
|
254 |
+
|
255 |
|
256 |
|
257 |
protected function _getStore()
|
258 |
{
|
259 |
$storeId = (int) $this->getRequest()->getParam('store', 0);
|
260 |
+
$store = Mage::app()->getStore($storeId);
|
261 |
+
if($store->getId() != $storeId) $store = Mage::app()->getStore(0);
|
262 |
+
return $store;
|
263 |
}
|
264 |
|
265 |
|
453 |
'index' => 'categories',
|
454 |
'sort_index' => 'category',
|
455 |
'filter_index' => 'category',
|
|
|
456 |
));
|
457 |
}
|
458 |
}
|
459 |
|
|
|
460 |
// EG: Show all (other) needed columns.
|
461 |
$ignoreCols = array('id'=>true, 'websites'=>true,'status'=>true,'visibility'=>true,'qty'=>true,
|
462 |
'price'=>true,'sku'=>true,'attribute_set_id'=>true, 'type_id'=>true,'name'=>true,
|
470 |
'tier_price' => array('type'=>'price', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Tier Price'), 'currency_code' => $currency),
|
471 |
'tax_class_id' => array('type'=>'text', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Tax Class ID')),
|
472 |
'special_to_date' => array('type'=>'date', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Spshl TO Date')),
|
473 |
+
//@nelkaake Tuesday April 27, 2010 :
|
474 |
+
'created_at' => array('type'=>'datetime', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Date Created')),
|
475 |
'special_price' => array('type'=>'price', 'width'=>'30px', 'header'=> Mage::helper('catalog')->__('Special Price'), 'currency_code' => $currency),
|
476 |
'special_from_date' => array('type'=>'date', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Spshl FROM Date')),
|
477 |
'color' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Color')),
|
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column.php
CHANGED
@@ -12,18 +12,15 @@
|
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
-
* @category Mage
|
16 |
-
* @package TBT_MassRelater
|
17 |
-
* @copyright Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
|
18 |
-
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
|
21 |
/**
|
22 |
* Grid column block
|
23 |
*
|
24 |
-
* @category
|
25 |
-
* @package
|
26 |
-
* @
|
|
|
27 |
*/
|
28 |
class TBT_Enhancedgrid_Block_Widget_Grid_Column extends Mage_Adminhtml_Block_Widget_Grid_Column
|
29 |
{
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
|
|
|
|
|
|
|
|
15 |
*/
|
16 |
|
17 |
/**
|
18 |
* Grid column block
|
19 |
*
|
20 |
+
* @category WDCA
|
21 |
+
* @package TBT_Enhancedgrid
|
22 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
23 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
24 |
*/
|
25 |
class TBT_Enhancedgrid_Block_Widget_Grid_Column extends Mage_Adminhtml_Block_Widget_Grid_Column
|
26 |
{
|
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Filter/Category.php
CHANGED
@@ -18,19 +18,16 @@
|
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
-
* @copyright
|
24 |
-
* @license
|
25 |
*/
|
26 |
|
27 |
|
28 |
/**
|
29 |
* Store grid column filter
|
30 |
*
|
31 |
-
* @category Mage
|
32 |
-
* @package Mage_Adminhtml
|
33 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
34 |
*/
|
35 |
class TBT_Rewards_Block_Widget_Grid_Column_Filter_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Text
|
36 |
{
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
+
* @category WDCA
|
22 |
+
* @package TBT_Enhancedgrid
|
23 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
|
28 |
/**
|
29 |
* Store grid column filter
|
30 |
*
|
|
|
|
|
|
|
31 |
*/
|
32 |
class TBT_Rewards_Block_Widget_Grid_Column_Filter_Category extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Text
|
33 |
{
|
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Filter/Image.php
CHANGED
@@ -12,9 +12,9 @@
|
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
-
* @category
|
16 |
-
* @package
|
17 |
-
* @copyright Copyright (c) 2008
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
|
@@ -22,7 +22,7 @@
|
|
22 |
* Checkbox grid column filter
|
23 |
*
|
24 |
* @category Mage
|
25 |
-
* @package
|
26 |
* @author Magento Core Team <core@magentocommerce.com>
|
27 |
*/
|
28 |
class TBT_Enhancedgrid_Block_Widget_Grid_Column_Filter_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Text
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
+
* @category WDCA
|
16 |
+
* @package TBT_Enhancedgrid
|
17 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
|
22 |
* Checkbox grid column filter
|
23 |
*
|
24 |
* @category Mage
|
25 |
+
* @package TBT_Enhancedgrid
|
26 |
* @author Magento Core Team <core@magentocommerce.com>
|
27 |
*/
|
28 |
class TBT_Enhancedgrid_Block_Widget_Grid_Column_Filter_Image extends Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Text
|
app/code/community/TBT/Enhancedgrid/Block/Widget/Grid/Column/Renderer/Action.php
CHANGED
@@ -12,9 +12,9 @@
|
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
-
* @category
|
16 |
-
* @package
|
17 |
-
* @copyright Copyright (c) 2008
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
|
@@ -22,8 +22,7 @@
|
|
22 |
* Grid column widget for rendering action grid cells
|
23 |
*
|
24 |
* @category Mage
|
25 |
-
* @package
|
26 |
-
* @author Magento Core Team <core@magentocommerce.com>
|
27 |
*/
|
28 |
class TBT_Enhancedgrid_Block_Widget_Grid_Column_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
|
29 |
{
|
12 |
* obtain it through the world-wide-web, please send an email
|
13 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
*
|
15 |
+
* @category WDCA
|
16 |
+
* @package TBT_Enhancedgrid
|
17 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
18 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
19 |
*/
|
20 |
|
22 |
* Grid column widget for rendering action grid cells
|
23 |
*
|
24 |
* @category Mage
|
25 |
+
* @package TBT_Enhancedgrid
|
|
|
26 |
*/
|
27 |
class TBT_Enhancedgrid_Block_Widget_Grid_Column_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
|
28 |
{
|
app/code/community/TBT/Enhancedgrid/Helper/Data.php
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<?PHP
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class TBT_Enhancedgrid_Helper_Data extends Mage_Core_Helper_Abstract {
|
4 |
|
5 |
|
@@ -20,12 +26,45 @@ class TBT_Enhancedgrid_Helper_Data extends Mage_Core_Helper_Abstract {
|
|
20 |
|
21 |
|
22 |
public function getSearchCollection($queryString, $request) {
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
29 |
}
|
30 |
|
31 |
|
1 |
<?PHP
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @category WDCA
|
5 |
+
* @package TBT_Enhancedgrid
|
6 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
class TBT_Enhancedgrid_Helper_Data extends Mage_Core_Helper_Abstract {
|
10 |
|
11 |
|
26 |
|
27 |
|
28 |
public function getSearchCollection($queryString, $request) {
|
29 |
+
//@nelkaake -m 13/11/10: Added compatibility with Magento 1.4 and up
|
30 |
+
if(Mage::helper('enhancedgrid')->isMageVerAtLeast('1.4.0.0')) {
|
31 |
+
$res = Mage::helper('catalogsearch')->getQuery()
|
32 |
+
->getSearchCollection()
|
33 |
+
->setStoreId(Mage::app()->getStore()->getId())
|
34 |
+
->addSearchFilter($queryString);
|
35 |
+
} else {
|
36 |
+
$request->setParam('q', $queryString);
|
37 |
+
$searchquery = Mage::helper('catalogSearch')->getQuery();
|
38 |
+
$searchquery->setStoreId(Mage::app()->getStore()->getId());
|
39 |
+
$searchquery->save();
|
40 |
+
$res = $searchquery->getResultCollection();
|
41 |
+
}
|
42 |
|
43 |
+
return $res;
|
44 |
+
}
|
45 |
+
|
46 |
+
|
47 |
+
/**
|
48 |
+
* True if the Magento version currently being run is x.x.x.x or higher
|
49 |
+
*
|
50 |
+
* @usage isMageVersionAtLeast('1.4.0.0') returns true for 1.4.0.0 and >
|
51 |
+
*
|
52 |
+
* @return boolean
|
53 |
+
*/
|
54 |
+
public function isMageVerAtLeast($version_str) {
|
55 |
+
$version_str_sections = explode('.', $version_str);
|
56 |
+
$mage_version_sections = explode('.', Mage::getVersion());
|
57 |
+
foreach( $version_str_sections as $key => $value){
|
58 |
+
if(!isset($mage_version_sections[$key])) break;
|
59 |
+
|
60 |
+
if ($mage_version_sections[$key] > $value ){
|
61 |
+
return true;
|
62 |
+
}
|
63 |
+
if ($mage_version_sections[$key] < $value ) {
|
64 |
+
return false;
|
65 |
+
}
|
66 |
+
}
|
67 |
+
return true;
|
68 |
}
|
69 |
|
70 |
|
app/code/community/TBT/Enhancedgrid/Model/System/Config/Source/Columns/Show.php
CHANGED
@@ -40,6 +40,8 @@ class TBT_Enhancedgrid_Model_System_Config_Source_Columns_Show
|
|
40 |
$cols[] = array('value' => 'qty', 'label' => 'Quantity');
|
41 |
$cols[] = array('value' => 'websites', 'label' => 'Websites');
|
42 |
$cols[] = array('value' => 'categories', 'label' => 'Categories');
|
|
|
|
|
43 |
foreach($collection->getItems() as $col) {
|
44 |
$cols[] = array('value' => $col->getAttributeCode(), 'label' => $col->getFrontendLabel());
|
45 |
}
|
40 |
$cols[] = array('value' => 'qty', 'label' => 'Quantity');
|
41 |
$cols[] = array('value' => 'websites', 'label' => 'Websites');
|
42 |
$cols[] = array('value' => 'categories', 'label' => 'Categories');
|
43 |
+
//@nelkaake Tuesday April 27, 2010 :
|
44 |
+
$cols[] = array('value' => 'created_at', 'label' => 'Date Created');
|
45 |
foreach($collection->getItems() as $col) {
|
46 |
$cols[] = array('value' => $col->getAttributeCode(), 'label' => $col->getFrontendLabel());
|
47 |
}
|
app/code/community/TBT/Enhancedgrid/Model/System/Config/Source/Sort/Direction.php
CHANGED
@@ -1,5 +1,11 @@
|
|
1 |
<?php
|
2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class TBT_Enhancedgrid_Model_System_Config_Source_Sort_Direction
|
4 |
{
|
5 |
public function toOptionArray()
|
1 |
<?php
|
2 |
+
/**
|
3 |
+
*
|
4 |
+
* @category WDCA
|
5 |
+
* @package TBT_Enhancedgrid
|
6 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
7 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
8 |
+
*/
|
9 |
class TBT_Enhancedgrid_Model_System_Config_Source_Sort_Direction
|
10 |
{
|
11 |
public function toOptionArray()
|
app/code/community/TBT/Enhancedgrid/controllers/Catalog/ProductController.php
CHANGED
@@ -18,18 +18,15 @@
|
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
-
* @copyright Copyright (c) 2008
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
/**
|
28 |
* Catalog product controller
|
29 |
*
|
30 |
-
* @category Mage
|
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
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
+
* @category WDCA
|
22 |
+
* @package TBT_Enhancedgrid
|
23 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
24 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
|
27 |
/**
|
28 |
* Catalog product controller
|
29 |
*
|
|
|
|
|
|
|
30 |
*/
|
31 |
include_once "Mage/Adminhtml/controllers/Catalog/ProductController.php";
|
32 |
class TBT_Enhancedgrid_Catalog_ProductController extends Mage_Adminhtml_Catalog_ProductController
|
app/code/community/TBT/Enhancedgrid/etc/config.xml
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
<config>
|
4 |
<modules>
|
5 |
<TBT_Enhancedgrid>
|
6 |
-
<version>1.
|
7 |
</TBT_Enhancedgrid>
|
8 |
</modules>
|
9 |
|
@@ -45,13 +45,16 @@
|
|
45 |
</adminhtml>
|
46 |
</blocks>
|
47 |
|
48 |
-
<!-- rewrite>
|
49 |
-
<tbt_enhancedgrid_catalog_product>
|
50 |
-
<from><![CDATA[#^/adminhtml/catalog_product/((index.*))/$#]]></from>
|
51 |
-
<to>/enhancedgrid/catalog_product/${1}/</to>
|
52 |
-
</tbt_enhancedgrid_catalog_product>
|
53 |
-
</rewrite -->
|
54 |
<rewrite>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
55 |
<tbt_enhancedgrid_catalog_product>
|
56 |
<from><![CDATA[#^/adminhtml/catalog_product/((massProd.*))/$#]]></from>
|
57 |
<to>/enhancedgrid/catalog_product/${1}/</to>
|
3 |
<config>
|
4 |
<modules>
|
5 |
<TBT_Enhancedgrid>
|
6 |
+
<version>1.3</version>
|
7 |
</TBT_Enhancedgrid>
|
8 |
</modules>
|
9 |
|
45 |
</adminhtml>
|
46 |
</blocks>
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
<rewrite>
|
49 |
+
<!-- @nelkaake -a 13/11/10: Added for Magento 1.4 compatibility -->
|
50 |
+
<tbt_enhancedgrid_catalog_product_export_csv>
|
51 |
+
<from><![CDATA[#^/admin/catalog_product/((exportCsv.*))/$#]]></from>
|
52 |
+
<to>/enhancedgrid/catalog_product/${1}/</to>
|
53 |
+
</tbt_enhancedgrid_catalog_product_export_csv>
|
54 |
+
<tbt_enhancedgrid_catalog_product_export_xml>
|
55 |
+
<from><![CDATA[#^/admin/catalog_product/((exportXml.*))/$#]]></from>
|
56 |
+
<to>/enhancedgrid/catalog_product/${1}/</to>
|
57 |
+
</tbt_enhancedgrid_catalog_product_export_xml>
|
58 |
<tbt_enhancedgrid_catalog_product>
|
59 |
<from><![CDATA[#^/adminhtml/catalog_product/((massProd.*))/$#]]></from>
|
60 |
<to>/enhancedgrid/catalog_product/${1}/</to>
|
app/design/adminhtml/default/default/template/tbt/enhancedgrid/catalog/product.phtml
CHANGED
@@ -18,10 +18,10 @@
|
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
-
* @category
|
22 |
-
* @package
|
23 |
-
* @copyright Copyright (c) 2008
|
24 |
-
* @license http://opensource.org/licenses/
|
25 |
*/
|
26 |
?>
|
27 |
<div class="content-header">
|
@@ -29,6 +29,13 @@
|
|
29 |
<tr>
|
30 |
<td style="width:50%;"><h3 class="icon-head head-products"><?php echo $this->_headerText ?></h3></td>
|
31 |
<td class="a-right">
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
<?php echo $this->getAddNewButtonHtml() ?>
|
33 |
</td>
|
34 |
</tr>
|
18 |
* versions in the future. If you wish to customize Magento for your
|
19 |
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
*
|
21 |
+
* @category WDCA
|
22 |
+
* @package TBT_Enhancedgrid
|
23 |
+
* @copyright Copyright (c) 2008-2010 WDCA (http://www.wdca.ca)
|
24 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
25 |
*/
|
26 |
?>
|
27 |
<div class="content-header">
|
29 |
<tr>
|
30 |
<td style="width:50%;"><h3 class="icon-head head-products"><?php echo $this->_headerText ?></h3></td>
|
31 |
<td class="a-right">
|
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>
|
39 |
<?php echo $this->getAddNewButtonHtml() ?>
|
40 |
</td>
|
41 |
</tr>
|
package.xml
CHANGED
@@ -1,19 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>TBT_Enhancedgrid</name>
|
4 |
-
<version>1.
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL 3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
-
<summary>Fixes 404 issues
|
10 |
-
<description>Fixes 404 issues
|
11 |
-
<notes>Fixes 404 issues
|
12 |
-
Now Considered STABLE</notes>
|
13 |
<authors><author><name>Jay</name><user>auto-converted</user><email>najibkaake@gmail.com</email></author></authors>
|
14 |
-
<date>2010-
|
15 |
-
<time>
|
16 |
-
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="tbt_enhancedgrid.xml" hash="c2a14141d8a6cb67ec2c86b61b168950"/></dir><dir name="template"><dir name="tbt"><dir name="enhancedgrid"><dir name="catalog"><
|
17 |
<compatible/>
|
18 |
<dependencies/>
|
19 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>TBT_Enhancedgrid</name>
|
4 |
+
<version>1.3</version>
|
5 |
<stability>stable</stability>
|
6 |
<license>OSL 3.0</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
+
<summary>Fixes 404 issues, adds a Categories and Date Added column options, msc Magento 1.4 incompatibilities, and more</summary>
|
10 |
+
<description>Fixes 404 issues, adds a Categories and Date Added column options, msc Magento 1.4 incompatibilities, and more.</description>
|
11 |
+
<notes>Fixes 404 issues, adds a Categories and Date Added column options, msc Magento 1.4 incompatibilities, and more</notes>
|
|
|
12 |
<authors><author><name>Jay</name><user>auto-converted</user><email>najibkaake@gmail.com</email></author></authors>
|
13 |
+
<date>2010-11-15</date>
|
14 |
+
<time>01:58:21</time>
|
15 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="tbt_enhancedgrid.xml" hash="c2a14141d8a6cb67ec2c86b61b168950"/></dir><dir name="template"><dir name="tbt"><dir name="enhancedgrid"><dir name="catalog"><file name="product.phtml" hash="7b0aa7c937af137171576c8c2092f118"/><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="7e3f13d77e5a726618dddbf7d910d242"/><dir name="Product"><file name="Grid.php" hash="63669a35a52c2f08547a7083d537f65c"/></dir></dir><dir name="System"><file name="Html.php" hash="45e5f2264b741206c09c67ae8099d0f1"/></dir><dir name="Widget"><dir name="Grid"><file name="Column.php" hash="98caa4a2d91e47b97498a79fcd3e9bd2"/><dir name="Column"><dir name="Filter"><file name="Category.php" hash="b94ef867beaa8bd63890c4e93e5e660a"/><file name="Image.php" hash="0b083385939ff2b6b1f569027f2b0be7"/></dir><dir name="Renderer"><file name="Action.php" hash="eba6832f8f1999317a5221d29481f4ca"/><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="f33d7e6a27c120f3358f8895fd4f39f5"/></dir></dir><dir name="etc"><file name="config.xml" hash="761f15ea87dbd333f0b4241a721723b1"/><file name="system.xml" hash="8701ce4222932d3ba031168ef4681c95"/></dir><dir name="Helper"><file name="Data.php" hash="5edfe25a532d7f520ba9efc9d7aa1d05"/></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="60a4925e633dd002424fd059f54bc057"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies/>
|
18 |
</package>
|