Version Notes
- Now compatible with Magento ver. 1.0.19870.6 up to 1.2.1.2
- Added support for columns that have "drop-down" values.
- Fixed bug that broke "add new product" url
- Fixed bug that broke "update attributes" url.
Download this release
Release Info
| Developer | Magento Core Team |
| Extension | TBT_Enhancedgrid |
| Version | 1.1 |
| Comparing to | |
| See all releases | |
Code changes from version 1.031 to 1.1
- app/code/community/TBT/Enhancedgrid/Block/Catalog/Product.php +10 -0
- app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid.php +39 -4
- app/code/community/TBT/Enhancedgrid/controllers/Catalog/ProductController.php +2 -2
- app/code/community/TBT/Enhancedgrid/etc/config.xml +1 -1
- app/code/community/TBT/Enhancedgrid/etc/system.xml +5 -3
- js/tbt/enhancedgrid/customfunctions/catalog_products.js +16 -1
- js/tbt/enhancedgrid/egsupplemental.js +18 -1
- js/tbt/enhancedgrid/enhancedgrid.js +25 -5
- package.xml +9 -6
app/code/community/TBT/Enhancedgrid/Block/Catalog/Product.php
CHANGED
|
@@ -40,11 +40,21 @@ class TBT_Enhancedgrid_Block_Catalog_Product extends Mage_Adminhtml_Block_Catalo
|
|
| 40 |
$this->_headerText = Mage::helper('enhancedgrid')->__('Manage Products (Enhanced)');
|
| 41 |
|
| 42 |
}
|
|
|
|
| 43 |
protected function _prepareLayout()
|
| 44 |
{
|
| 45 |
parent::_prepareLayout();
|
| 46 |
$this->setTemplate('tbt/enhancedgrid/catalog/product.phtml');
|
| 47 |
$this->setChild('grid', $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid', 'product.enhancedgrid'));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 48 |
}
|
| 49 |
}
|
| 50 |
|
| 40 |
$this->_headerText = Mage::helper('enhancedgrid')->__('Manage Products (Enhanced)');
|
| 41 |
|
| 42 |
}
|
| 43 |
+
|
| 44 |
protected function _prepareLayout()
|
| 45 |
{
|
| 46 |
parent::_prepareLayout();
|
| 47 |
$this->setTemplate('tbt/enhancedgrid/catalog/product.phtml');
|
| 48 |
$this->setChild('grid', $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid', 'product.enhancedgrid'));
|
| 49 |
+
|
| 50 |
+
$this->setChild('add_new_button',
|
| 51 |
+
$this->getLayout()->createBlock('adminhtml/widget_button')
|
| 52 |
+
->setData(array(
|
| 53 |
+
'label' => Mage::helper('catalog')->__('Add Product'),
|
| 54 |
+
'onclick' => "setLocation('".$this->getUrl('adminhtml/*/new')."')",
|
| 55 |
+
'class' => 'add'
|
| 56 |
+
))
|
| 57 |
+
);
|
| 58 |
}
|
| 59 |
}
|
| 60 |
|
app/code/community/TBT/Enhancedgrid/Block/Catalog/Product/Grid.php
CHANGED
|
@@ -35,6 +35,7 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
| 35 |
{
|
| 36 |
protected $isenhanced = true;
|
| 37 |
private $columnSettings = array();
|
|
|
|
| 38 |
private $isenabled = true;
|
| 39 |
|
| 40 |
public function __construct()
|
|
@@ -161,6 +162,31 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
| 161 |
|
| 162 |
return $this;
|
| 163 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 164 |
|
| 165 |
|
| 166 |
protected function _getStore()
|
|
@@ -187,7 +213,12 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
| 187 |
|
| 188 |
protected function _prepareColumns()
|
| 189 |
{
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
|
|
|
|
| 191 |
if($this->colIsVisible('id')) {
|
| 192 |
$this->addColumn('id',
|
| 193 |
array(
|
|
@@ -237,7 +268,6 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
| 237 |
));
|
| 238 |
}
|
| 239 |
if($this->colIsVisible('name')) {
|
| 240 |
-
$store = $this->_getStore();
|
| 241 |
if ($store->getId()) {
|
| 242 |
$this->addColumn('custom_name',
|
| 243 |
array(
|
|
@@ -287,7 +317,6 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
| 287 |
|
| 288 |
|
| 289 |
if($this->colIsVisible('price')) {
|
| 290 |
-
$store = $this->_getStore();
|
| 291 |
$this->addColumn('price',
|
| 292 |
array(
|
| 293 |
'header'=> Mage::helper('catalog')->__('Price'),
|
|
@@ -362,7 +391,7 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
| 362 |
'special_to_date' => array('type'=>'date', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Spshl TO Date')),
|
| 363 |
'special_price' => array('type'=>'price', 'width'=>'30px', 'header'=> Mage::helper('catalog')->__('Special Price'), 'currency_code' => $currency),
|
| 364 |
'special_from_date' => array('type'=>'date', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Spshl FROM Date')),
|
| 365 |
-
'color' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('
|
| 366 |
'size' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Size')),
|
| 367 |
'brand' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Brand')),
|
| 368 |
'custom_design' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Custom Design')),
|
|
@@ -390,6 +419,12 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
| 390 |
);
|
| 391 |
}
|
| 392 |
$innerSettings['index'] = $col;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
$this->addColumn($col, $innerSettings);
|
| 394 |
}
|
| 395 |
|
|
@@ -450,7 +485,7 @@ class TBT_Enhancedgrid_Block_Catalog_Product_Grid extends Mage_Adminhtml_Block_W
|
|
| 450 |
|
| 451 |
$this->getMassactionBlock()->addItem('attributes', array(
|
| 452 |
'label' => Mage::helper('catalog')->__('Update attributes'),
|
| 453 |
-
'url' => $this->getUrl('
|
| 454 |
));
|
| 455 |
|
| 456 |
|
| 35 |
{
|
| 36 |
protected $isenhanced = true;
|
| 37 |
private $columnSettings = array();
|
| 38 |
+
private $columnOptions = array();
|
| 39 |
private $isenabled = true;
|
| 40 |
|
| 41 |
public function __construct()
|
| 162 |
|
| 163 |
return $this;
|
| 164 |
}
|
| 165 |
+
|
| 166 |
+
/**
|
| 167 |
+
* if the attribute has options an options entry will be
|
| 168 |
+
* added to $columnOptions
|
| 169 |
+
* TODO: load first
|
| 170 |
+
*/
|
| 171 |
+
private function loadColumnOptions($attr_code) {
|
| 172 |
+
$attr = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', $attr_code);
|
| 173 |
+
if(sizeof($attr->getData()) > 0) {
|
| 174 |
+
if($attr->getFrontendInput() == 'select') {
|
| 175 |
+
$values = Mage::getResourceModel('eav/entity_attribute_option_collection')
|
| 176 |
+
->setAttributeFilter($attr->getId())
|
| 177 |
+
->setStoreFilter($this->_getStore(), false)
|
| 178 |
+
->load();
|
| 179 |
+
$options = array();
|
| 180 |
+
foreach($values as $value) {
|
| 181 |
+
$options[$value->getOptionId()] = $value->getValue();
|
| 182 |
+
}
|
| 183 |
+
//die($attr_code);
|
| 184 |
+
$this->columnOptions[$attr_code] = $options;
|
| 185 |
+
//die(print_r($this->columnOptions, true));
|
| 186 |
+
}
|
| 187 |
+
}
|
| 188 |
+
|
| 189 |
+
}
|
| 190 |
|
| 191 |
|
| 192 |
protected function _getStore()
|
| 213 |
|
| 214 |
protected function _prepareColumns()
|
| 215 |
{
|
| 216 |
+
// Loads all the column options for each applicable column.
|
| 217 |
+
foreach($this->columnSettings as $col => $true) {
|
| 218 |
+
$this->loadColumnOptions($col);
|
| 219 |
+
}
|
| 220 |
|
| 221 |
+
$store = $this->_getStore();
|
| 222 |
if($this->colIsVisible('id')) {
|
| 223 |
$this->addColumn('id',
|
| 224 |
array(
|
| 268 |
));
|
| 269 |
}
|
| 270 |
if($this->colIsVisible('name')) {
|
|
|
|
| 271 |
if ($store->getId()) {
|
| 272 |
$this->addColumn('custom_name',
|
| 273 |
array(
|
| 317 |
|
| 318 |
|
| 319 |
if($this->colIsVisible('price')) {
|
|
|
|
| 320 |
$this->addColumn('price',
|
| 321 |
array(
|
| 322 |
'header'=> Mage::helper('catalog')->__('Price'),
|
| 391 |
'special_to_date' => array('type'=>'date', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Spshl TO Date')),
|
| 392 |
'special_price' => array('type'=>'price', 'width'=>'30px', 'header'=> Mage::helper('catalog')->__('Special Price'), 'currency_code' => $currency),
|
| 393 |
'special_from_date' => array('type'=>'date', 'width'=>'100px', 'header'=> Mage::helper('catalog')->__('Spshl FROM Date')),
|
| 394 |
+
'color' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Color')),
|
| 395 |
'size' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Size')),
|
| 396 |
'brand' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Brand')),
|
| 397 |
'custom_design' => array('type'=>'text', 'width'=>'70px', 'header'=> Mage::helper('catalog')->__('Custom Design')),
|
| 419 |
);
|
| 420 |
}
|
| 421 |
$innerSettings['index'] = $col;
|
| 422 |
+
//echo print_r($this->columnOptions, true);
|
| 423 |
+
if(isset($this->columnOptions[$col])) {
|
| 424 |
+
//die($col);
|
| 425 |
+
$innerSettings['type'] = 'options';
|
| 426 |
+
$innerSettings['options'] = $this->columnOptions[$col];
|
| 427 |
+
}
|
| 428 |
$this->addColumn($col, $innerSettings);
|
| 429 |
}
|
| 430 |
|
| 485 |
|
| 486 |
$this->getMassactionBlock()->addItem('attributes', array(
|
| 487 |
'label' => Mage::helper('catalog')->__('Update attributes'),
|
| 488 |
+
'url' => $this->getUrl('adminhtml/catalog_product_action_attribute/edit', array('_current'=>true))
|
| 489 |
));
|
| 490 |
|
| 491 |
|
app/code/community/TBT/Enhancedgrid/controllers/Catalog/ProductController.php
CHANGED
|
@@ -80,7 +80,7 @@ class TBT_Enhancedgrid_Catalog_ProductController extends Mage_Adminhtml_Catalog_
|
|
| 80 |
public function exportCsvAction()
|
| 81 |
{
|
| 82 |
$fileName = 'products.csv';
|
| 83 |
-
$content = $this->getLayout()->createBlock('
|
| 84 |
->getCsv();
|
| 85 |
|
| 86 |
$this->_sendUploadResponse($fileName, $content);
|
|
@@ -92,7 +92,7 @@ class TBT_Enhancedgrid_Catalog_ProductController extends Mage_Adminhtml_Catalog_
|
|
| 92 |
public function exportXmlAction()
|
| 93 |
{
|
| 94 |
$fileName = 'products.xml';
|
| 95 |
-
$content = $this->getLayout()->createBlock('
|
| 96 |
->getXml();
|
| 97 |
|
| 98 |
$this->_sendUploadResponse($fileName, $content);
|
| 80 |
public function exportCsvAction()
|
| 81 |
{
|
| 82 |
$fileName = 'products.csv';
|
| 83 |
+
$content = $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid')
|
| 84 |
->getCsv();
|
| 85 |
|
| 86 |
$this->_sendUploadResponse($fileName, $content);
|
| 92 |
public function exportXmlAction()
|
| 93 |
{
|
| 94 |
$fileName = 'products.xml';
|
| 95 |
+
$content = $this->getLayout()->createBlock('enhancedgrid/catalog_product_grid')
|
| 96 |
->getXml();
|
| 97 |
|
| 98 |
$this->_sendUploadResponse($fileName, $content);
|
app/code/community/TBT/Enhancedgrid/etc/config.xml
CHANGED
|
@@ -75,7 +75,7 @@
|
|
| 75 |
<truncatelongtextafter>60</truncatelongtextafter>
|
| 76 |
</general>
|
| 77 |
<columns>
|
| 78 |
-
<showcolumns>id,name,type_id,attribute_set_id,sku,price,qty,visibility,status,websites,
|
| 79 |
</columns>
|
| 80 |
<images>
|
| 81 |
<showurl>0</showurl>
|
| 75 |
<truncatelongtextafter>60</truncatelongtextafter>
|
| 76 |
</general>
|
| 77 |
<columns>
|
| 78 |
+
<showcolumns>id,name,type_id,attribute_set_id,sku,price,qty,visibility,status,websites,thumbnail</showcolumns>
|
| 79 |
</columns>
|
| 80 |
<images>
|
| 81 |
<showurl>0</showurl>
|
app/code/community/TBT/Enhancedgrid/etc/system.xml
CHANGED
|
@@ -10,6 +10,7 @@
|
|
| 10 |
<sections>
|
| 11 |
<enhancedgrid translate="label" module="enhancedgrid">
|
| 12 |
<label>Enhanced Product Grid</label>
|
|
|
|
| 13 |
<tab>tbtall</tab>
|
| 14 |
<frontend_type>text</frontend_type>
|
| 15 |
<sort_order>10</sort_order>
|
|
@@ -19,7 +20,8 @@
|
|
| 19 |
<groups>
|
| 20 |
<columns translate="label">
|
| 21 |
<label>General Options</label>
|
| 22 |
-
<
|
|
|
|
| 23 |
<show_in_default>1</show_in_default>
|
| 24 |
<show_in_website>1</show_in_website>
|
| 25 |
<fields>
|
|
@@ -58,7 +60,7 @@
|
|
| 58 |
</columns>
|
| 59 |
<images translate="label">
|
| 60 |
<label>In-Grid Image Options</label>
|
| 61 |
-
<sort_order>
|
| 62 |
<show_in_default>1</show_in_default>
|
| 63 |
<show_in_website>1</show_in_website>
|
| 64 |
<fields>
|
|
@@ -98,7 +100,7 @@
|
|
| 98 |
</images>
|
| 99 |
<defaults translate="label">
|
| 100 |
<label>Default Grid State</label>
|
| 101 |
-
<sort_order>
|
| 102 |
<show_in_default>1</show_in_default>
|
| 103 |
<show_in_website>1</show_in_website>
|
| 104 |
<fields>
|
| 10 |
<sections>
|
| 11 |
<enhancedgrid translate="label" module="enhancedgrid">
|
| 12 |
<label>Enhanced Product Grid</label>
|
| 13 |
+
<comment>This extension was developed by Trade Business Technology Corp. For customization </comment>
|
| 14 |
<tab>tbtall</tab>
|
| 15 |
<frontend_type>text</frontend_type>
|
| 16 |
<sort_order>10</sort_order>
|
| 20 |
<groups>
|
| 21 |
<columns translate="label">
|
| 22 |
<label>General Options</label>
|
| 23 |
+
<comment>------ Need More Custom E-Commerce Solutions Like This? We can help! Contact Jay at "jaye@tbtcorp.com" for more info. ------</comment>
|
| 24 |
+
<sort_order>200</sort_order>
|
| 25 |
<show_in_default>1</show_in_default>
|
| 26 |
<show_in_website>1</show_in_website>
|
| 27 |
<fields>
|
| 60 |
</columns>
|
| 61 |
<images translate="label">
|
| 62 |
<label>In-Grid Image Options</label>
|
| 63 |
+
<sort_order>300</sort_order>
|
| 64 |
<show_in_default>1</show_in_default>
|
| 65 |
<show_in_website>1</show_in_website>
|
| 66 |
<fields>
|
| 100 |
</images>
|
| 101 |
<defaults translate="label">
|
| 102 |
<label>Default Grid State</label>
|
| 103 |
+
<sort_order>400</sort_order>
|
| 104 |
<show_in_default>1</show_in_default>
|
| 105 |
<show_in_website>1</show_in_website>
|
| 106 |
<fields>
|
js/tbt/enhancedgrid/customfunctions/catalog_products.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
function chooseWhatToRelateTo() {
|
| 3 |
var productids = window.prompt("Enter the id's for products you'd like to relate the currently selected products to.\n"
|
| 4 |
+"For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, X will be\n"
|
| 1 |
+
/**
|
| 2 |
+
* Trade Business Technology Corp.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE OF LICENSE
|
| 5 |
+
*
|
| 6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 8 |
+
* It is also available through the world-wide-web at this URL:
|
| 9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 10 |
+
* If you did not receive a copy of the license and are unable to
|
| 11 |
+
* obtain it through the world-wide-web, please send an email
|
| 12 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 13 |
+
*
|
| 14 |
+
* @copyright Copyright (c) 2008-2009 Trade Business Technology Corp. (contact@tbtcorp.com)
|
| 15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 16 |
+
*/
|
| 17 |
function chooseWhatToRelateTo() {
|
| 18 |
var productids = window.prompt("Enter the id's for products you'd like to relate the currently selected products to.\n"
|
| 19 |
+"For example: Suppose you selected X, Y and Z. If you enter 'A,B' here, X will be\n"
|
js/tbt/enhancedgrid/egsupplemental.js
CHANGED
|
@@ -1,4 +1,21 @@
|
|
| 1 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
//form tags to omit in NS6+:
|
| 3 |
|
| 4 |
var omitformtags=["input", "textarea", "select"]
|
| 1 |
+
/**
|
| 2 |
+
* Trade Business Technology Corp.
|
| 3 |
+
*
|
| 4 |
+
* NOTICE OF LICENSE
|
| 5 |
+
*
|
| 6 |
+
* This source file is subject to the Open Software License (OSL 3.0)
|
| 7 |
+
* that is bundled with this package in the file LICENSE.txt.
|
| 8 |
+
* It is also available through the world-wide-web at this URL:
|
| 9 |
+
* http://opensource.org/licenses/osl-3.0.php
|
| 10 |
+
* If you did not receive a copy of the license and are unable to
|
| 11 |
+
* obtain it through the world-wide-web, please send an email
|
| 12 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 13 |
+
*
|
| 14 |
+
* @copyright Copyright (c) 2008-2009 Trade Business Technology Corp. (contact@tbtcorp.com)
|
| 15 |
+
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 16 |
+
*/
|
| 17 |
+
|
| 18 |
+
|
| 19 |
//form tags to omit in NS6+:
|
| 20 |
|
| 21 |
var omitformtags=["input", "textarea", "select"]
|
js/tbt/enhancedgrid/enhancedgrid.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
/**
|
| 2 |
-
*
|
| 3 |
*
|
| 4 |
* NOTICE OF LICENSE
|
| 5 |
*
|
|
@@ -11,7 +11,7 @@
|
|
| 11 |
* obtain it through the world-wide-web, please send an email
|
| 12 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 13 |
*
|
| 14 |
-
* @copyright Copyright (c) 2008
|
| 15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 16 |
*/
|
| 17 |
|
|
@@ -221,6 +221,11 @@ varienGridMassaction.prototype.initialize = function (containerId, grid, checked
|
|
| 221 |
this.checkCheckboxes();
|
| 222 |
// MAGE -- end
|
| 223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 224 |
// TBT -- enhanced grid -- begin
|
| 225 |
this.grid.multiSelectFunction = this.onMultiSelect.bind(this);
|
| 226 |
//this.selectedRows = false;
|
|
@@ -240,13 +245,19 @@ varienGridMassaction.prototype.onMultiSelect = function(events) {
|
|
| 240 |
var checkVal = events[rowid].checkbox.value;
|
| 241 |
if(events[rowid].checkbox.checked) {
|
| 242 |
checkValues.push(checkVal);
|
| 243 |
-
|
|
|
|
| 244 |
} else {
|
| 245 |
uncheckValues.push(checkVal);
|
| 246 |
-
|
|
|
|
| 247 |
}
|
| 248 |
}
|
| 249 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 250 |
this.updateCount();
|
| 251 |
};
|
| 252 |
varienGridMassaction.prototype.apply = function() {
|
|
@@ -289,7 +300,15 @@ varienGridMassaction.prototype.apply = function() {
|
|
| 289 |
fieldsHtml += this.fieldTemplate.evaluate({name: fieldName, value: item});
|
| 290 |
}.bind(this)); */
|
| 291 |
|
| 292 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 293 |
if(multiFields != null) {
|
| 294 |
for (var i=0; i<multiFields.length; i++) {
|
| 295 |
fieldsHtml += this.fieldTemplate.evaluate({name: multiFields[i]+'[]', value: item});
|
|
@@ -300,6 +319,7 @@ varienGridMassaction.prototype.apply = function() {
|
|
| 300 |
}.bind(this));
|
| 301 |
this.formHiddens.update(fieldsHtml);
|
| 302 |
|
|
|
|
| 303 |
if(!this.validator.validate()) {
|
| 304 |
return;
|
| 305 |
}
|
| 1 |
/**
|
| 2 |
+
* Trade Business Technology Corp.
|
| 3 |
*
|
| 4 |
* NOTICE OF LICENSE
|
| 5 |
*
|
| 11 |
* obtain it through the world-wide-web, please send an email
|
| 12 |
* to license@magentocommerce.com so we can send you a copy immediately.
|
| 13 |
*
|
| 14 |
+
* @copyright Copyright (c) 2008-2009 Trade Business Technology Corp. (contact@tbtcorp.com)
|
| 15 |
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
|
| 16 |
*/
|
| 17 |
|
| 221 |
this.checkCheckboxes();
|
| 222 |
// MAGE -- end
|
| 223 |
|
| 224 |
+
// Magento ver < 1.16
|
| 225 |
+
if (typeof(varienStringArray) == 'undefined') {
|
| 226 |
+
this.mageIsLessThan116 = true;
|
| 227 |
+
}
|
| 228 |
+
|
| 229 |
// TBT -- enhanced grid -- begin
|
| 230 |
this.grid.multiSelectFunction = this.onMultiSelect.bind(this);
|
| 231 |
//this.selectedRows = false;
|
| 245 |
var checkVal = events[rowid].checkbox.value;
|
| 246 |
if(events[rowid].checkbox.checked) {
|
| 247 |
checkValues.push(checkVal);
|
| 248 |
+
if(!this.mageIsLessThan116)
|
| 249 |
+
this.checkedString = varienStringArray.add(checkVal, this.checkedString);
|
| 250 |
} else {
|
| 251 |
uncheckValues.push(checkVal);
|
| 252 |
+
if(!this.mageIsLessThan116)
|
| 253 |
+
this.checkedString = varienStringArray.remove(checkVal, this.checkedString);
|
| 254 |
}
|
| 255 |
}
|
| 256 |
|
| 257 |
+
if(this.mageIsLessThan116) {
|
| 258 |
+
this.addCheckedValues(checkValues);
|
| 259 |
+
this.unsetCheckedValues(uncheckValues);
|
| 260 |
+
}
|
| 261 |
this.updateCount();
|
| 262 |
};
|
| 263 |
varienGridMassaction.prototype.apply = function() {
|
| 300 |
fieldsHtml += this.fieldTemplate.evaluate({name: fieldName, value: item});
|
| 301 |
}.bind(this)); */
|
| 302 |
|
| 303 |
+
// ENHANCED GRID BEGIN (MAGE END)
|
| 304 |
+
var itArray;
|
| 305 |
+
if (this.mageIsLessThan116) {
|
| 306 |
+
itArray = this.getCheckedValues();
|
| 307 |
+
} else {
|
| 308 |
+
itArray = this.getCheckedValues().split(",");
|
| 309 |
+
}
|
| 310 |
+
|
| 311 |
+
itArray.each(function(item){
|
| 312 |
if(multiFields != null) {
|
| 313 |
for (var i=0; i<multiFields.length; i++) {
|
| 314 |
fieldsHtml += this.fieldTemplate.evaluate({name: multiFields[i]+'[]', value: item});
|
| 319 |
}.bind(this));
|
| 320 |
this.formHiddens.update(fieldsHtml);
|
| 321 |
|
| 322 |
+
// ENHANCED GRID END (MAGE BEGIN)
|
| 323 |
if(!this.validator.validate()) {
|
| 324 |
return;
|
| 325 |
}
|
package.xml
CHANGED
|
@@ -1,18 +1,21 @@
|
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>TBT_Enhancedgrid</name>
|
| 4 |
-
<version>1.
|
| 5 |
-
<stability>
|
| 6 |
<license>OSL 3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Enhances the product grid to add a bunch of convenient features.</summary>
|
| 10 |
<description>Enhances the product grid to add a bunch of convenient features.</description>
|
| 11 |
-
<notes>-
|
|
|
|
|
|
|
|
|
|
| 12 |
<authors><author><name>Jay</name><user>auto-converted</user><email>najibkaake@gmail.com</email></author></authors>
|
| 13 |
-
<date>2009-
|
| 14 |
-
<time>01:
|
| 15 |
-
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="tbt_enhancedgrid.xml" hash="ef12b7e54560a59ee8a92f7cae2688c4"/></dir><dir name="template"><dir name="tbt"><dir name="enhancedgrid"><dir name="catalog"><dir name="product"><file name="grid.phtml" hash="8e39bb3abd59ef4ba12fdf4d725dda90"/></dir><file name="product.phtml" hash="5fceede9ce2aaee2f33f97f106db4eaa"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="tbt"><dir name="enhancedgrid"><dir name="customfunctions"><file name="catalog_products.js" hash="
|
| 16 |
<compatible/>
|
| 17 |
<dependencies/>
|
| 18 |
</package>
|
| 1 |
<?xml version="1.0"?>
|
| 2 |
<package>
|
| 3 |
<name>TBT_Enhancedgrid</name>
|
| 4 |
+
<version>1.1</version>
|
| 5 |
+
<stability>stable</stability>
|
| 6 |
<license>OSL 3.0</license>
|
| 7 |
<channel>community</channel>
|
| 8 |
<extends/>
|
| 9 |
<summary>Enhances the product grid to add a bunch of convenient features.</summary>
|
| 10 |
<description>Enhances the product grid to add a bunch of convenient features.</description>
|
| 11 |
+
<notes>- Now compatible with Magento ver. 1.0.19870.6 up to 1.2.1.2
|
| 12 |
+
- Added support for columns that have "drop-down" values.
|
| 13 |
+
- Fixed bug that broke "add new product" url
|
| 14 |
+
- Fixed bug that broke "update attributes" url.</notes>
|
| 15 |
<authors><author><name>Jay</name><user>auto-converted</user><email>najibkaake@gmail.com</email></author></authors>
|
| 16 |
+
<date>2009-03-22</date>
|
| 17 |
+
<time>01:49:15</time>
|
| 18 |
+
<contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="tbt_enhancedgrid.xml" hash="ef12b7e54560a59ee8a92f7cae2688c4"/></dir><dir name="template"><dir name="tbt"><dir name="enhancedgrid"><dir name="catalog"><dir name="product"><file name="grid.phtml" hash="8e39bb3abd59ef4ba12fdf4d725dda90"/></dir><file name="product.phtml" hash="5fceede9ce2aaee2f33f97f106db4eaa"/></dir></dir></dir></dir></dir></dir></dir></target><target name="mage"><dir name="js"><dir name="tbt"><dir name="enhancedgrid"><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><file name="egsupplemental.js" hash="da3aa882d47a41c4d2f7d0c48233ae1e"/><file name="enhancedgrid.js" hash="fcbbe08d942719a668d3536246664628"/></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"><dir name="Product"><file name="Grid.php" hash="7f9d3061f3abc62a4910700a36fb9434"/></dir><file name="Product.php" hash="a6348f1f8ce10e628fb27537a659fafb"/></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Filter"><file name="Image.php" hash="b1e25d3e8d03a0869e1c2edf5fcdd761"/></dir><dir name="Renderer"><file name="Action.php" hash="32c3917ad4c07942e9f0d003c6854b2b"/><file name="Image.php" hash="9639860b3ad18b08b835e145c2ec95ea"/></dir></dir><file name="Column.php" hash="51e74c94d0d6599cadd948a054d475af"/></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="71721df4637ea2776c54fa741046b6b9"/><file name="system.xml" hash="0358fa988da45162ac9ce4ea64246ac2"/></dir><dir name="Helper"><file name="Data.php" hash="5ef9a7ad806e6b25bd34453851a7977e"/></dir><dir name="Model"><dir name="System"><dir name="Config"><dir name="Source"><dir name="Columns"><file name="Show.php" hash="18a3eafdda1d53c942788ccbdfb77746"/></dir><dir name="Sort"><file name="Direction.php" hash="23cb37d1af2dd75c3c9537adf90c1bc8"/></dir></dir></dir></dir></dir></dir></dir></target></contents>
|
| 19 |
<compatible/>
|
| 20 |
<dependencies/>
|
| 21 |
</package>
|
